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

Method _cutFromBase

cadquery/cq.py:3264–3278  ·  view source on GitHub ↗

Cuts the provided object from the base solid, if one can be found. :param obj: :return: a new object that represents the result of combining the base object with obj, or obj if one could not be found

(self: T, obj: Shape)

Source from the content-addressed store, hash-verified

3262 return self.newObject([r])
3263
3264 def _cutFromBase(self: T, obj: Shape) -> T:
3265 """
3266 Cuts the provided object from the base solid, if one can be found.
3267
3268 :param obj:
3269 :return: a new object that represents the result of combining the base object with obj,
3270 or obj if one could not be found
3271 """
3272 baseSolid = self._findType((Solid,), True, True)
3273
3274 r = obj
3275 if baseSolid is not None:
3276 r = baseSolid.cut(obj)
3277
3278 return self.newObject([r])
3279
3280 def combine(
3281 self: T, clean: bool = True, glue: bool = False, tol: Optional[float] = None,

Callers 2

_combineWithBaseMethod · 0.95
test_cutFromBaseMethod · 0.80

Calls 3

_findTypeMethod · 0.95
newObjectMethod · 0.95
cutMethod · 0.45

Tested by 1

test_cutFromBaseMethod · 0.64