|
103 | 103 | TopoDS_Vertex,
|
104 | 104 | TopoDS_Solid,
|
105 | 105 | TopoDS_Shell,
|
| 106 | + TopoDS_CompSolid, |
106 | 107 | )
|
107 | 108 |
|
108 | 109 | from OCP.GC import GC_MakeArcOfCircle, GC_MakeArcOfEllipse # geometry construction
|
|
219 | 220 | ta.TopAbs_FACE: "Face",
|
220 | 221 | ta.TopAbs_SHELL: "Shell",
|
221 | 222 | ta.TopAbs_SOLID: "Solid",
|
| 223 | + ta.TopAbs_COMPSOLID: "CompSolid", |
222 | 224 | ta.TopAbs_COMPOUND: "Compound",
|
223 | 225 | }
|
224 | 226 |
|
|
241 | 243 | ta.TopAbs_FACE: TopoDS.Face_s,
|
242 | 244 | ta.TopAbs_SHELL: TopoDS.Shell_s,
|
243 | 245 | ta.TopAbs_SOLID: TopoDS.Solid_s,
|
| 246 | + ta.TopAbs_COMPSOLID: TopoDS.CompSolid_s, |
244 | 247 | ta.TopAbs_COMPOUND: TopoDS.Compound_s,
|
245 | 248 | }
|
246 | 249 |
|
|
251 | 254 | ta.TopAbs_FACE: BRepAdaptor_Surface,
|
252 | 255 | ta.TopAbs_SHELL: "Shell",
|
253 | 256 | ta.TopAbs_SOLID: "Solid",
|
| 257 | + ta.TopAbs_SOLID: "CompSolid", |
254 | 258 | ta.TopAbs_COMPOUND: "Compound",
|
255 | 259 | }
|
256 | 260 |
|
|
280 | 284 | ga.GeomAbs_OtherCurve: "OTHER",
|
281 | 285 | }
|
282 | 286 |
|
283 |
| -Shapes = Literal["Vertex", "Edge", "Wire", "Face", "Shell", "Solid", "Compound"] |
| 287 | +Shapes = Literal[ |
| 288 | + "Vertex", "Edge", "Wire", "Face", "Shell", "Solid", "CompSolid", "Compound" |
| 289 | +] |
284 | 290 | Geoms = Literal[
|
285 | 291 | "Vertex",
|
286 | 292 | "Wire",
|
@@ -386,6 +392,7 @@ def cast(
|
386 | 392 | ta.TopAbs_FACE: Face,
|
387 | 393 | ta.TopAbs_SHELL: Shell,
|
388 | 394 | ta.TopAbs_SOLID: Solid,
|
| 395 | + ta.TopAbs_COMPSOLID: CompSolid, |
389 | 396 | ta.TopAbs_COMPOUND: Compound,
|
390 | 397 | }
|
391 | 398 |
|
@@ -726,6 +733,13 @@ def Solids(self) -> List["Solid"]:
|
726 | 733 |
|
727 | 734 | return [Solid(i) for i in self._entities("Solid")]
|
728 | 735 |
|
| 736 | + def CompSolids(self) -> List["CompSolid"]: |
| 737 | + """ |
| 738 | + :returns: All the compsolids in this Shape |
| 739 | + """ |
| 740 | + |
| 741 | + return [CompSolid(i) for i in self._entities("CompSolid")] |
| 742 | + |
729 | 743 | def Area(self) -> float:
|
730 | 744 | """
|
731 | 745 | :returns: The surface area of all faces in this Shape
|
@@ -2746,6 +2760,14 @@ def dprism(
|
2746 | 2760 | return Solid(shape)
|
2747 | 2761 |
|
2748 | 2762 |
|
| 2763 | +class CompSolid(Shape, Mixin3D): |
| 2764 | + """ |
| 2765 | + a single compsolid |
| 2766 | + """ |
| 2767 | + |
| 2768 | + wrapped: TopoDS_CompSolid |
| 2769 | + |
| 2770 | + |
2749 | 2771 | class Compound(Shape, Mixin3D):
|
2750 | 2772 | """
|
2751 | 2773 | a collection of disconnected solids
|
|
0 commit comments