Fill edges/wire possibly obeying constraints and try to connect smoothly to the context shape.
(s: Shape, ctx: Shape, constraints: Sequence[Shape | VectorLike] = ())
| 6834 | |
| 6835 | |
| 6836 | def 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 | |
| 6860 | def fillet( |