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

Method sweep_multi

cadquery/occ_impl/shapes.py:4682–4722  ·  view source on GitHub ↗

Multi section sweep. Only single outer profile per section is allowed. :param profiles: list of profiles :param path: The wire to sweep the face resulting from the wires over :param mode: additional sweep mode parameters. :return: a Solid object

(
        cls,
        profiles: Iterable[Wire | Face],
        path: Wire | Edge,
        makeSolid: bool = True,
        isFrenet: bool = False,
        mode: Vector | Wire | Edge | None = None,
    )

Source from the content-addressed store, hash-verified

4680
4681 @classmethod
4682 def sweep_multi(
4683 cls,
4684 profiles: Iterable[Wire | Face],
4685 path: Wire | Edge,
4686 makeSolid: bool = True,
4687 isFrenet: bool = False,
4688 mode: Vector | Wire | Edge | None = None,
4689 ) -> Solid:
4690 """
4691 Multi section sweep. Only single outer profile per section is allowed.
4692
4693 :param profiles: list of profiles
4694 :param path: The wire to sweep the face resulting from the wires over
4695 :param mode: additional sweep mode parameters.
4696 :return: a Solid object
4697 """
4698 if isinstance(path, Edge):
4699 w = Wire.assembleEdges([path,]).wrapped
4700 else:
4701 w = path.wrapped
4702
4703 builder = BRepOffsetAPI_MakePipeShell(w)
4704
4705 translate = False
4706 rotate = False
4707
4708 if mode:
4709 rotate = cls._setSweepMode(builder, path, mode)
4710 else:
4711 builder.SetMode(isFrenet)
4712
4713 for p in profiles:
4714 w = p.wrapped if isinstance(p, Wire) else p.outerWire().wrapped
4715 builder.Add(w, translate, rotate)
4716
4717 builder.Build()
4718
4719 if makeSolid:
4720 builder.MakeSolid()
4721
4722 return cls(builder.Shape())
4723
4724 def outerShell(self) -> Shell:
4725 """

Callers 1

_sweepMethod · 0.80

Calls 3

assembleEdgesMethod · 0.80
_setSweepModeMethod · 0.80
outerWireMethod · 0.80

Tested by

no test coverage detected