Small fix and updates

This commit is contained in:
Yeicor
2025-02-16 12:59:52 +01:00
parent 6ee98b6e19
commit 3116f909d5
3 changed files with 609 additions and 272 deletions

873
poetry.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -11,7 +11,7 @@ include = [
]
[tool.poetry.dependencies]
python = ">=3.10,<3.14"
python = ">=3.10,<3.13" # Due to vtk transitive dependency of build123d -> cadquery-ocp -> vtk
# CAD
build123d = ">=0.9,<0.10"

View File

@@ -38,7 +38,7 @@ def tessellate(
# Perform tessellation tasks
edge_to_faces: Dict[str, List[TopoDS_Face]] = {}
vertex_to_faces: Dict[str, List[TopoDS_Face]] = {}
if faces:
if faces and hasattr(shape, 'faces'):
shape_faces = shape.faces()
for face in shape_faces:
_tessellate_face(mgr, face.wrapped, tolerance, angular_tolerance, obj_color)
@@ -49,13 +49,13 @@ def tessellate(
for vertex in face.vertices():
vertex_to_faces[vertex.wrapped] = vertex_to_faces.get(vertex.wrapped, []) + [face.wrapped]
if len(shape_faces) > 0: obj_color = None # Don't color edges/vertices if faces are colored
if edges:
if edges and hasattr(shape, 'edges'):
shape_edges = shape.edges()
for edge in shape_edges:
_tessellate_edge(mgr, edge.wrapped, edge_to_faces.get(edge.wrapped, []), angular_tolerance,
angular_tolerance, obj_color)
if len(shape_edges) > 0: obj_color = None # Don't color vertices if edges are colored
if vertices:
if vertices and hasattr(shape, 'vertices'):
for vertex in shape.vertices():
_tessellate_vertex(mgr, vertex.wrapped, vertex_to_faces.get(vertex.wrapped, []), obj_color)