Make a circle for each item on the stack. :param radius: radius of the circle :param forConstruction: should the new wires be reference geometry only? :type forConstruction: true if the wires are for reference, false if they are creating part geometry
(self: T, radius: float, forConstruction: bool = False)
| 2575 | |
| 2576 | # circle from current point |
| 2577 | def circle(self: T, radius: float, forConstruction: bool = False) -> T: |
| 2578 | """ |
| 2579 | Make a circle for each item on the stack. |
| 2580 | |
| 2581 | :param radius: radius of the circle |
| 2582 | :param forConstruction: should the new wires be reference geometry only? |
| 2583 | :type forConstruction: true if the wires are for reference, false if they are creating |
| 2584 | part geometry |
| 2585 | :return: a new CQ object with the created wires on the stack |
| 2586 | |
| 2587 | A common use case is to use a for-construction rectangle to define the centers of a |
| 2588 | hole pattern:: |
| 2589 | |
| 2590 | s = Workplane().rect(4.0, 4.0, forConstruction=True).vertices().circle(0.25) |
| 2591 | |
| 2592 | Creates 4 circles at the corners of a square centered on the origin. Another common case is |
| 2593 | to use successive circle() calls to create concentric circles. This works because the |
| 2594 | center of a circle is its reference point:: |
| 2595 | |
| 2596 | s = Workplane().circle(2.0).circle(1.0) |
| 2597 | |
| 2598 | Creates two concentric circles, which when extruded will form a ring. |
| 2599 | |
| 2600 | Future Enhancements: |
| 2601 | better way to handle forConstruction |
| 2602 | project points not in the workplane plane onto the workplane plane |
| 2603 | |
| 2604 | """ |
| 2605 | |
| 2606 | c = Wire.makeCircle(radius, Vector(), Vector(0, 0, 1)) |
| 2607 | c.forConstruction = forConstruction |
| 2608 | |
| 2609 | return self.eachpoint(lambda loc: c.moved(loc), True) |
| 2610 | |
| 2611 | # ellipse from current point |
| 2612 | def ellipse( |