Skip to content

Commit

Permalink
2.0RC6
Browse files Browse the repository at this point in the history
  • Loading branch information
Puiching-Memory committed Dec 2, 2023
1 parent 66734fc commit 75a215c
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 6 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ GPNU[广东技术师范大学]MineCraft 建筑工具
* [ ] 方块匹配颜色
* [ ] 表面平滑
* [ ] 提供更多3D文件格式支持
* [ ]

# 2.0发布

Expand All @@ -24,6 +23,12 @@ objloadN.py:导入和分析.OBJ文件

output.py:生成和导出.schem文件

# 已知问题

* 当路径为根目录时出现问题
* 当obj使用分组结构时出现问题
* 当mtl使用材质和obj(usemtl)顺序不同时出现问题

# 所需库

* python3.10/3.11(经过测试)
Expand Down
Binary file removed __pycache__/objloadN.cpython-310.pyc
Binary file not shown.
Binary file removed __pycache__/objloadN.cpython-311.pyc
Binary file not shown.
Binary file removed __pycache__/objloader.cpython-311.pyc
Binary file not shown.
Binary file removed __pycache__/output.cpython-310.pyc
Binary file not shown.
Binary file removed __pycache__/output.cpython-311.pyc
Binary file not shown.
6 changes: 5 additions & 1 deletion objloadN.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from rich.progress import track
import rich.progress
import os
import math

# import PIL.Image
from PIL import Image
Expand Down Expand Up @@ -99,14 +100,17 @@ def _analyze(self):
continue

if str(i).startswith('map_Kd'):
self.child[current].set_map_kd(str(self.path[:-7]) + '/' + i[7:])
self.child[current].set_map_kd(os.path.dirname(self.path) + '/' + i[7:])
continue


#print(self.child[0].get())

def get_pixel(self,img_index:int,x_scale:float,y_scale:float):
#print(img_index)
x_scale = math.modf(x_scale)[0]
y_scale = math.modf(y_scale)[0]

data = self.child[img_index].get_colour(self.child[img_index].get_map_size()[0] * x_scale,self.child[img_index].get_map_size()[1] * y_scale)
return data

Expand Down
40 changes: 36 additions & 4 deletions output.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,52 @@
mc_block = {
"minecraft:white_concrete": (205, 210, 211),
"minecraft:light_gray_concrete": (124, 124, 114),
"minecraft:gray_concrete": (53, 56, 60),
"minecraft:gray_concrete": (54, 57, 61),
"minecraft:black_concrete": (8, 10, 15),
"minecraft:brown_concrete": (96, 59, 32),
"minecraft:brown_concrete": (96, 59, 31),
"minecraft:red_concrete": (141, 33, 33),
"minecraft:orange_concrete": (222, 96, 0),
"minecraft:yellow_concrete": (238, 173, 21),
"minecraft:lime_concrete": (94, 168, 25),
"minecraft:green_concrete": (72, 90, 36),
"minecraft:cyan_concrete": (21, 117, 133),
"minecraft:green_concrete": (72, 91, 36),
"minecraft:cyan_concrete": (21, 119, 136),
"minecraft:light_blue_concrete": (35, 134, 195),
"minecraft:blue_concrete": (44, 46, 142),
"minecraft:purple_concrete": (99, 31, 154),
"minecraft:magenta_concrete": (165, 46, 155),
"minecraft:pink_concrete": (210, 99, 140),
"minecraft:bamboo_planks": (197, 176, 82),
"minecraft:stripped_oak_wood": (177, 143, 85),
"minecraft:stripped_jungle_wood": (171, 132, 84),
"minecraft:stripped_birch_wood": (196, 175, 118),
"minecraft:stripped_acacia_wood": (173, 92, 59),
"minecraft:stripped_mangrove_wood": (119, 54, 47),
"minecraft:stripped_dark_oak_wood": (71, 56, 35),
"minecraft:stripped_cherry_wood": (214, 144, 148),
"minecraft:packed_mud": (142, 107, 80),
"minecraft:polished_deepslate": (65, 65, 66),
"minecraft:polished_andesite": (123, 126, 126),
"minecraft:stone": (124, 124, 124),
"minecraft:smooth_stone": (154, 154, 154),
"minecraft:polished_granite": (148, 102, 85),
"minecraft:polished_diorite": (177, 177, 178),
"minecraft:polished_blackstone": (50, 45, 53),
"minecraft:nether_bricks": (47, 23, 27),
"minecraft:netherrack": (98, 38, 38),
"minecraft:end_stone": (220, 223, 159),
"minecraft:dark_prismarine": (44, 71, 60),
"minecraft:prismarine_bricks": (86, 156, 139),
"minecraft:smooth_red_sandstone": (181, 97, 31),
"minecraft:smooth_sandstone": (223, 214, 170),
"minecraft:iron_block": (214, 214, 214),
"minecraft:purpur_block": (159, 115, 159),
"minecraft:redstone_block": (182, 25, 5),
"minecraft:emerald_block": (42, 194, 81),
"minecraft:lapis_block": (29, 64, 137),
"minecraft:diamond_block": (81, 228, 221),
"minecraft:netherite_block": (61, 55, 58),
"minecraft:quartz_block": (223, 227, 218),
"minecraft:quartz_block": (223, 227, 218),
}

class SchemN:
Expand Down

0 comments on commit 75a215c

Please sign in to comment.