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

Function cap

cadquery/occ_impl/shapes.py:6836–6857  ·  view source on GitHub ↗

Fill edges/wire possibly obeying constraints and try to connect smoothly to the context shape.

(s: Shape, ctx: Shape, constraints: Sequence[Shape | VectorLike] = ())

Source from the content-addressed store, hash-verified

6834
6835
6836def cap(s: Shape, ctx: Shape, constraints: Sequence[Shape | VectorLike] = ()) -> Shape:
6837 """
6838 Fill edges/wire possibly obeying constraints and try to connect smoothly to the context shape.
6839 """
6840
6841 builder = BRepOffsetAPI_MakeFilling()
6842 builder.SetResolParam(2, 15, 5)
6843
6844 for e in _get_edges(s):
6845 f = _get_one(e.ancestors(ctx, "Face"), "Face")
6846 builder.Add(e.wrapped, f.wrapped, GeomAbs_Shape.GeomAbs_G1, True)
6847
6848 for c in constraints:
6849 if isinstance(c, Shape):
6850 for e in _get_edges(c):
6851 builder.Add(e.wrapped, GeomAbs_C0, False)
6852 else:
6853 builder.Add(Vector(c).toPnt())
6854
6855 builder.Build()
6856
6857 return _compound_or_shape(builder.Shape())
6858
6859
6860def fillet(

Callers 1

test_capFunction · 0.85

Calls 6

_get_edgesFunction · 0.85
_get_oneFunction · 0.85
VectorClass · 0.85
_compound_or_shapeFunction · 0.85
toPntMethod · 0.80
ancestorsMethod · 0.45

Tested by 1

test_capFunction · 0.68