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]])
| 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 | """ |