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

Method pushPoints

cadquery/cq.py:1489–1520  ·  view source on GitHub ↗

Pushes a list of points onto the stack as vertices. The points are in the 2D coordinate space of the workplane face :param pntList: a list of points to push onto the stack :type pntList: list of 2-tuples, in *local* coordinates :return: a new workplane with

(self: T, pntList: Iterable[Union[VectorLike, Location]])

Source from the content-addressed store, hash-verified

1487 return self.pushPoints(locs)
1488
1489 def pushPoints(self: T, pntList: Iterable[Union[VectorLike, Location]]) -> T:
1490 """
1491 Pushes a list of points onto the stack as vertices.
1492 The points are in the 2D coordinate space of the workplane face
1493
1494 :param pntList: a list of points to push onto the stack
1495 :type pntList: list of 2-tuples, in *local* coordinates
1496 :return: a new workplane with the desired points on the stack.
1497
1498 A common use is to provide a list of points for a subsequent operation, such as creating
1499 circles or holes. This example creates a cube, and then drills three holes through it,
1500 based on three points::
1501
1502 s = (
1503 Workplane()
1504 .box(1, 1, 1)
1505 .faces(">Z")
1506 .workplane()
1507 .pushPoints([(-0.3, 0.3), (0.3, 0.3), (0, 0)])
1508 )
1509 body = s.circle(0.05).cutThruAll()
1510
1511 Here the circle function operates on all three points, and is then extruded to create three
1512 holes. See :meth:`circle` for how it works.
1513 """
1514 vecs: List[Union[Location, Vector]] = []
1515 for pnt in pntList:
1516 vecs.append(
1517 pnt if isinstance(pnt, Location) else self.plane.toWorldCoords(pnt)
1518 )
1519
1520 return self.newObject(vecs)
1521
1522 def center(self: T, x: float, y: float) -> T:
1523 """

Callers 15

rarrayMethod · 0.95
polarArrayMethod · 0.95
testPointListMethod · 0.80
testNestedCircleMethod · 0.80
testCounterBoresMethod · 0.80
testCleanMethod · 0.80
testNoCleanMethod · 0.80
testExtrudeUntilFaceMethod · 0.80
testCutBlindUntilFaceMethod · 0.80
testFindSolidMethod · 0.80
testTagMethod · 0.80

Calls 3

newObjectMethod · 0.95
appendMethod · 0.80
toWorldCoordsMethod · 0.80

Tested by 15

testPointListMethod · 0.64
testNestedCircleMethod · 0.64
testCounterBoresMethod · 0.64
testCleanMethod · 0.64
testNoCleanMethod · 0.64
testExtrudeUntilFaceMethod · 0.64
testCutBlindUntilFaceMethod · 0.64
testFindSolidMethod · 0.64
testTagMethod · 0.64
testTagSelectorsMethod · 0.64
test_interpPlateMethod · 0.64