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

Function project

cadquery/occ_impl/shapes.py:7542–7562  ·  view source on GitHub ↗

Project s onto base using normal projection.

(
    s: Shape,
    base: Shape,
    continuity: Literal["C1", "C2", "C3"] = "C2",
    degree: int = 3,
    maxseg: int = 30,
    tol: float = 1e-4,
)

Source from the content-addressed store, hash-verified

7540
7541@multidispatch
7542def project(
7543 s: Shape,
7544 base: Shape,
7545 continuity: Literal["C1", "C2", "C3"] = "C2",
7546 degree: int = 3,
7547 maxseg: int = 30,
7548 tol: float = 1e-4,
7549) -> Shape:
7550 """
7551 Project s onto base using normal projection.
7552 """
7553
7554 bldr = BRepAlgo_NormalProjection(base.wrapped)
7555 bldr.SetParams(tol, tol ** (2 / 3), _to_geomabshape(continuity), degree, maxseg)
7556
7557 for el in _get_wires(s):
7558 bldr.Add(el.wrapped)
7559
7560 bldr.Build()
7561
7562 return _compound_or_shape(bldr.Projection())
7563
7564
7565@multidispatch

Callers 1

test_projectFunction · 0.85

Calls 9

_to_geomabshapeFunction · 0.85
_get_wiresFunction · 0.85
_compound_or_shapeFunction · 0.85
_get_edgesFunction · 0.85
VectorClass · 0.85
_normalizeFunction · 0.85
compoundFunction · 0.85
toDirMethod · 0.80
appendMethod · 0.80

Tested by 1

test_projectFunction · 0.68