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

Method _findFromEdge

cadquery/cq.py:1368–1390  ·  view source on GitHub ↗

Finds the previous edge for an operation that needs it, similar to method _findFromPoint. Examples include tangentArcPoint. :param useLocalCoords: selects whether the point is returned in local coordinates or global coordinates. :return: an Edge

(self, useLocalCoords: bool = False)

Source from the content-addressed store, hash-verified

1366 return p
1367
1368 def _findFromEdge(self, useLocalCoords: bool = False) -> Edge:
1369 """
1370 Finds the previous edge for an operation that needs it, similar to
1371 method _findFromPoint. Examples include tangentArcPoint.
1372
1373 :param useLocalCoords: selects whether the point is returned
1374 in local coordinates or global coordinates.
1375 :return: an Edge
1376 """
1377 obj = self.objects[-1] if self.objects else self.plane.origin
1378
1379 if not isinstance(obj, Edge):
1380 raise RuntimeError(
1381 "Previous Edge requested, but the previous object was of "
1382 + f"type {type(obj)}, not an Edge."
1383 )
1384
1385 rv: Edge = obj
1386
1387 if useLocalCoords:
1388 rv = self.plane.toLocalCoords(rv)
1389
1390 return rv
1391
1392 def rarray(
1393 self: T,

Callers 2

tangentArcPointMethod · 0.95
test_findFromEdgeMethod · 0.80

Calls 1

toLocalCoordsMethod · 0.80

Tested by 1

test_findFromEdgeMethod · 0.64