MCPcopy
hub / github.com/CadQuery/cadquery / _sweep

Method _sweep

cadquery/cq.py:3823–3876  ·  view source on GitHub ↗

Makes a swept solid from an existing set of pending wires. :param path: A wire along which the pending wires will be swept :param multisection: False to create multiple swept from wires on the chain along path True to create only one solid swept alon

(
        self,
        path: Union["Workplane", Wire, Edge],
        multisection: bool = False,
        makeSolid: bool = True,
        isFrenet: bool = False,
        transition: Literal["right", "round", "transformed"] = "right",
        normal: Optional[VectorLike] = None,
        auxSpine: Optional["Workplane"] = None,
    )

Source from the content-addressed store, hash-verified

3821 return Compound.makeCompound(toFuse)
3822
3823 def _sweep(
3824 self,
3825 path: Union["Workplane", Wire, Edge],
3826 multisection: bool = False,
3827 makeSolid: bool = True,
3828 isFrenet: bool = False,
3829 transition: Literal["right", "round", "transformed"] = "right",
3830 normal: Optional[VectorLike] = None,
3831 auxSpine: Optional["Workplane"] = None,
3832 ) -> Compound:
3833 """
3834 Makes a swept solid from an existing set of pending wires.
3835
3836 :param path: A wire along which the pending wires will be swept
3837 :param multisection:
3838 False to create multiple swept from wires on the chain along path
3839 True to create only one solid swept along path with shape following the list of wires on the chain
3840 :param transition:
3841 handling of profile orientation at C1 path discontinuities.
3842 Possible values are {'transformed','round', 'right'} (default: 'right').
3843 :param normal: optional fixed normal for extrusion
3844 :param auxSpine: a wire defining the binormal along the extrusion path
3845 :return: a solid, suitable for boolean operations
3846 """
3847
3848 toFuse = []
3849
3850 p = path.val() if isinstance(path, Workplane) else path
3851 if not isinstance(p, (Wire, Edge)):
3852 raise ValueError("Wire or Edge instance required")
3853
3854 mode: Union[Vector, Edge, Wire, None] = None
3855 if normal:
3856 mode = Vector(normal)
3857 elif auxSpine:
3858 wire = auxSpine.val()
3859 if not isinstance(wire, (Edge, Wire)):
3860 raise ValueError("Wire or Edge instance required")
3861 mode = wire
3862
3863 if not multisection:
3864 for f in self._getFaces():
3865 thisObj = Solid.sweep(f, p, makeSolid, isFrenet, mode, transition)
3866 toFuse.append(thisObj)
3867 else:
3868 if self.ctx.pendingWires:
3869 sections = self.ctx.popPendingWires()
3870 else:
3871 sections = [f.outerWire() for f in self._getFaces()]
3872
3873 thisObj = Solid.sweep_multi(sections, p, makeSolid, isFrenet, mode)
3874 toFuse.append(thisObj)
3875
3876 return Compound.makeCompound(toFuse)
3877
3878 def interpPlate(
3879 self: T,

Callers 1

sweepMethod · 0.95

Calls 9

_getFacesMethod · 0.95
VectorClass · 0.85
appendMethod · 0.80
popPendingWiresMethod · 0.80
outerWireMethod · 0.80
sweep_multiMethod · 0.80
makeCompoundMethod · 0.80
valMethod · 0.45
sweepMethod · 0.45

Tested by

no test coverage detected