File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 1- from typing import List , Tuple
1+ from typing import List , Tuple , Union
22
33import compas .geometry
44import compas .datastructures
5959from OCC .Core .TopTools import TopTools_IndexedDataMapOfShapeListOfShape
6060from OCC .Core .TopTools import TopTools_ListIteratorOfListOfShape
6161from OCC .Core .TopExp import topexp_MapShapesAndUniqueAncestors
62+ from OCC .Core .BRepOffsetAPI import BRepOffsetAPI_MakePipe
6263
6364# from OCC.Core.TopExp import topexp_MapShapesAndAncestors
6465# from OCC.Core.TopExp import topexp_FirstVertex
@@ -638,13 +639,18 @@ def from_faces(cls, faces: List[BRepFace]) -> "BRep":
638639
639640 @classmethod
640641 def from_extrusion (cls , curve , vector ) -> "BRep" :
642+ """Construct a BRep by extruding a closed curve along a direction vector."""
641643 pass
642644
643645 @classmethod
644- def from_sweep (cls , profile , path ) -> "BRep" :
645- pass
646+ def from_sweep (cls , profile : Union [BRepEdge , BRepFace ], path : BRepLoop ) -> "BRep" :
647+ """Construct a BRep by sweeping a profile along a path."""
648+ brep = cls ()
649+ brep .occ_shape = BRepOffsetAPI_MakePipe (
650+ path .occ_wire , profile .occ_shape
651+ ).Shape ()
652+ return brep
646653
647- # create pipe
648654 # create patch
649655 # create offset
650656
You can’t perform that action at this time.
0 commit comments