Skip to content

Commit 25fa220

Browse files
Faster makeFromWires
1 parent 7493e61 commit 25fa220

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

cadquery/occ_impl/shapes.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156

157157
from OCP.TopExp import TopExp
158158

159-
from OCP.ShapeFix import ShapeFix_Shape, ShapeFix_Solid
159+
from OCP.ShapeFix import ShapeFix_Shape, ShapeFix_Solid, ShapeFix_Face
160160

161161
from OCP.STEPControl import STEPControl_Writer, STEPControl_AsIs
162162

@@ -2110,9 +2110,13 @@ def makeFromWires(
21102110
if not face_builder.IsDone():
21112111
raise ValueError(f"Cannot build face(s): {face_builder.Error()}")
21122112

2113-
face = face_builder.Shape()
2113+
face = face_builder.Face()
21142114

2115-
return cls(face).fix()
2115+
sf = ShapeFix_Face(face)
2116+
sf.FixOrientation()
2117+
sf.Perform()
2118+
2119+
return cls(sf.Result())
21162120

21172121
@classmethod
21182122
def makeSplineApprox(
@@ -2127,7 +2131,7 @@ def makeSplineApprox(
21272131
Approximate a spline surface through the provided points.
21282132
21292133
:param points: a 2D list of Vectors that represent the points
2130-
:param tol: tolerance of the algorithm (consult OCC documentation).
2134+
:param tol: tolerance of the algorithm (consult OCC documentation).
21312135
:param smoothing: optional tuple of 3 weights use for variational smoothing (default: None)
21322136
:param minDeg: minimum spline degree. Enforced only when smothing is None (default: 1)
21332137
:param maxDeg: maximum spline degree (default: 6)

0 commit comments

Comments
 (0)