mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-26 10:21:00 +00:00
10 lines
471 B
Python
10 lines
471 B
Python
# Export the real male's relief as a triangle mesh, so the grazing test uses the actual geometry.
|
|
import os, json
|
|
import Part
|
|
HERE = os.path.dirname(os.path.abspath(__file__))
|
|
s = Part.Shape(); s.read(os.path.join(HERE, "bear.step"))
|
|
verts, facets = s.Solids[0].tessellate(0.25)
|
|
V = [[round(p.x,4), round(p.y,4), round(p.z,4)] for p in verts]
|
|
json.dump({"v": V, "f": facets}, open(os.path.join(HERE, "bear_mesh.json"), "w"))
|
|
print(f"verts {len(V)} facets {len(facets)}")
|