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

Function isSubshape

cadquery/occ_impl/shapes.py:7899–7910  ·  view source on GitHub ↗

Check if s1 is a subshape of s2.

(s1: Shape, s2: Shape)

Source from the content-addressed store, hash-verified

7897
7898
7899def isSubshape(s1: Shape, s2: Shape) -> bool:
7900 """
7901 Check if s1 is a subshape of s2.
7902 """
7903
7904 shape_map = TopTools_IndexedDataMapOfShapeListOfShape()
7905
7906 TopExp.MapShapesAndAncestors_s(
7907 s2.wrapped, shapetype(s1.wrapped), inverse_shape_LUT[s2.ShapeType()], shape_map
7908 )
7909
7910 return shape_map.Contains(s1.wrapped)
7911
7912
7913# %% properties

Callers 5

addSubshapeMethod · 0.85
test_history_boolFunction · 0.85
test_history_extrudeFunction · 0.85
test_history_sweepFunction · 0.85
test_history_loftFunction · 0.85

Calls 2

shapetypeFunction · 0.85
ShapeTypeMethod · 0.45

Tested by 4

test_history_boolFunction · 0.68
test_history_extrudeFunction · 0.68
test_history_sweepFunction · 0.68
test_history_loftFunction · 0.68