MCPcopy Index your code
hub / github.com/CadQuery/cadquery / Compound

Class Compound

cadquery/occ_impl/shapes.py:4768–5002  ·  view source on GitHub ↗

a collection of disconnected solids

Source from the content-addressed store, hash-verified

4766
4767
4768class Compound(Shape, Mixin3D):
4769 """
4770 a collection of disconnected solids
4771 """
4772
4773 wrapped: TopoDS_Compound
4774
4775 @staticmethod
4776 def _makeCompound(listOfShapes: Iterable[TopoDS_Shape]) -> TopoDS_Compound:
4777
4778 comp = TopoDS_Compound()
4779 comp_builder = TopoDS_Builder()
4780 comp_builder.MakeCompound(comp)
4781
4782 for s in listOfShapes:
4783 comp_builder.Add(comp, s)
4784
4785 return comp
4786
4787 def remove(self, *shape: Shape) -> Self:
4788 """
4789 Remove the specified shapes.
4790 """
4791
4792 comp_builder = TopoDS_Builder()
4793
4794 for s in shape:
4795 comp_builder.Remove(self.wrapped, s.wrapped)
4796
4797 return self
4798
4799 @classmethod
4800 def makeCompound(cls, listOfShapes: Iterable[Shape]) -> Compound:
4801 """
4802 Create a compound out of a list of shapes
4803 """
4804
4805 return cls(cls._makeCompound((s.wrapped for s in listOfShapes)))
4806
4807 @classmethod
4808 def makeText(
4809 cls,
4810 text: str,
4811 size: float,
4812 height: float,
4813 font: str = "Arial",
4814 fontPath: str | None = None,
4815 kind: Literal["regular", "bold", "italic"] = "regular",
4816 halign: Literal["center", "left", "right"] = "center",
4817 valign: Literal["center", "top", "bottom"] = "center",
4818 position: Plane = Plane.XY(),
4819 ) -> Shape:
4820 """
4821 Create a 3D text
4822 """
4823
4824 font_kind = {
4825 "regular": Font_FA_Regular,

Callers 4

CompoundsMethod · 0.85
projectMethod · 0.85
offset2DMethod · 0.85
compoundFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected