MCPcopy Index your code
hub / github.com/CadQuery/cadquery / intersect

Function intersect

cadquery/occ_impl/shapes.py:6727–6752  ·  view source on GitHub ↗

Intersect two shapes.

(
    s1: Shape,
    s2: Shape,
    tol: float = 0.0,
    glue: GlueLiteral = None,
    history: History | None = None,
    name: str | None = None,
)

Source from the content-addressed store, hash-verified

6725
6726
6727def intersect(
6728 s1: Shape,
6729 s2: Shape,
6730 tol: float = 0.0,
6731 glue: GlueLiteral = None,
6732 history: History | None = None,
6733 name: str | None = None,
6734) -> Shape:
6735 """
6736 Intersect two shapes.
6737 """
6738
6739 builder = BOPAlgo_BOP()
6740 builder.SetOperation(BOPAlgo_COMMON)
6741
6742 _set_glue(builder, glue)
6743 _set_builder_options(builder, tol)
6744
6745 builder.AddArgument(s1.wrapped)
6746 builder.AddTool(s2.wrapped)
6747
6748 builder.Perform()
6749
6750 _update_history(history, name, [s1, s2], builder)
6751
6752 return _compound_or_shape(builder.Shape())
6753
6754
6755def split(

Callers 2

__mul__Method · 0.85
test_operatorsFunction · 0.85

Calls 4

_set_glueFunction · 0.85
_set_builder_optionsFunction · 0.85
_update_historyFunction · 0.85
_compound_or_shapeFunction · 0.85

Tested by 1

test_operatorsFunction · 0.68