@@ -702,6 +702,17 @@ def from_extrusion(
702702 """
703703 Construct a BRep by extruding a closed curve along a direction vector.
704704
705+ Parameters
706+ ----------
707+ profile : :class:`OCCBrepEdge` | :class:`OCCBrepFace`
708+ The base profile of the extrusion.
709+ vector : :class:`Vector`
710+ The extrusion vector.
711+ The extrusion has the same height as the length vector.
712+ cap_ends : bool, optional
713+ Flag indicating that the ends of the brep should be capped.
714+ Currently this flag is not supported.
715+
705716 Returns
706717 -------
707718 :class:`OCCBrep`
@@ -1173,7 +1184,11 @@ def from_boolean_union(
11731184 # Converters
11741185 # ==============================================================================
11751186
1176- def to_tesselation (self , linear_deflection : Optional [float ] = None , angular_deflection : Optional [float ] = None ) -> tuple [Mesh , list [Polyline ]]:
1187+ def to_tesselation (
1188+ self ,
1189+ linear_deflection : Optional [float ] = None ,
1190+ angular_deflection : Optional [float ] = None ,
1191+ ) -> tuple [Mesh , list [Polyline ]]:
11771192 """
11781193 Create a tesselation of the shape for visualisation.
11791194
@@ -1192,11 +1207,13 @@ def to_tesselation(self, linear_deflection: Optional[float] = None, angular_defl
11921207 linear_deflection = linear_deflection or TOL .lineardeflection
11931208 angular_deflection = angular_deflection or TOL .angulardeflection
11941209
1195- BRepMesh .BRepMesh_IncrementalMesh (self .occ_shape , linear_deflection , False , angular_deflection , True )
1196- bt = BRep .BRep_Tool ()
11971210 mesh = Mesh ()
11981211 polylines = []
11991212 seen = []
1213+
1214+ BRepMesh .BRepMesh_IncrementalMesh (self .occ_shape , linear_deflection , False , angular_deflection , True )
1215+ bt = BRep .BRep_Tool ()
1216+
12001217 for face in self .faces :
12011218 location = TopLoc .TopLoc_Location ()
12021219 triangulation = bt .Triangulation (face .occ_face , location )
@@ -1231,6 +1248,7 @@ def to_tesselation(self, linear_deflection: Optional[float] = None, angular_defl
12311248 node = nodes .Value (i )
12321249 points .append (vertices [node - 1 ])
12331250 polylines .append (Polyline (points ))
1251+
12341252 # This might not be necssary
12351253 lines = []
12361254 for edge in self .edges :
@@ -1244,6 +1262,7 @@ def to_tesselation(self, linear_deflection: Optional[float] = None, angular_defl
12441262 lines .append (edge .curve .to_polyline ())
12451263 elif edge .is_bspline :
12461264 lines .append (edge .curve .to_polyline ())
1265+
12471266 polylines += lines
12481267 return mesh , polylines
12491268
@@ -1289,21 +1308,27 @@ def to_polygons(self) -> list[Polygon]:
12891308 polygons .append (Polygon (points ))
12901309 return polygons
12911310
1292- def to_viewmesh (self , linear_deflection : float = 0.001 ) -> tuple [compas .datastructures .Mesh , list [compas .geometry .Polyline ]]:
1311+ def to_viewmesh (
1312+ self ,
1313+ linear_deflection : Optional [float ] = None ,
1314+ angular_deflection : Optional [float ] = None ,
1315+ ) -> tuple [compas .datastructures .Mesh , list [compas .geometry .Polyline ]]:
12931316 """
12941317 Convert the BRep to a view mesh.
12951318
12961319 Parameters
12971320 ----------
12981321 linear_deflection : float, optional
1299- The maximum linear deflection between the geometry and its discrete representation.
1322+ Allowable "distance" deviation between curved geometry and mesh discretisation.
1323+ angular_deflection : float, optional
1324+ Allowable "curvature" deviation between curved geometry and mesh discretisation.
13001325
13011326 Returns
13021327 -------
13031328 tuple[:class:`compas.datastructures.Mesh`, list[:class:`compas.geometry.Polyline`]]
13041329
13051330 """
1306- return self .to_tesselation (linear_deflection = linear_deflection )
1331+ return self .to_tesselation (linear_deflection = linear_deflection , angular_deflection = angular_deflection )
13071332
13081333 # ==============================================================================
13091334 # Relationships
@@ -1735,7 +1760,6 @@ def heal(self):
17351760 """
17361761 self .sew ()
17371762 self .fix ()
1738- self .make_positive ()
17391763
17401764 def intersect (self , other : "OCCBrep" ) -> Union ["OCCBrep" , None ]:
17411765 """Intersect this Brep with another.
0 commit comments