Make an ellipse for each item on the stack. :param x_radius: x radius of the ellipse (x-axis of plane the ellipse should lie in) :param y_radius: y radius of the ellipse (y-axis of plane the ellipse should lie in) :param rotation_angle: angle to rotate the ellipse
(
self: T,
x_radius: float,
y_radius: float,
rotation_angle: float = 0.0,
forConstruction: bool = False,
)
| 2610 | |
| 2611 | # ellipse from current point |
| 2612 | def ellipse( |
| 2613 | self: T, |
| 2614 | x_radius: float, |
| 2615 | y_radius: float, |
| 2616 | rotation_angle: float = 0.0, |
| 2617 | forConstruction: bool = False, |
| 2618 | ) -> T: |
| 2619 | """ |
| 2620 | Make an ellipse for each item on the stack. |
| 2621 | |
| 2622 | :param x_radius: x radius of the ellipse (x-axis of plane the ellipse should lie in) |
| 2623 | :param y_radius: y radius of the ellipse (y-axis of plane the ellipse should lie in) |
| 2624 | :param rotation_angle: angle to rotate the ellipse |
| 2625 | :param forConstruction: should the new wires be reference geometry only? |
| 2626 | :type forConstruction: true if the wires are for reference, false if they are creating |
| 2627 | part geometry |
| 2628 | :return: a new CQ object with the created wires on the stack |
| 2629 | |
| 2630 | *NOTE* Due to a bug in opencascade (https://tracker.dev.opencascade.org/view.php?id=31290) |
| 2631 | the center of mass (equals center for next shape) is shifted. To create concentric ellipses |
| 2632 | use:: |
| 2633 | |
| 2634 | Workplane("XY").center(10, 20).ellipse(100, 10).center(0, 0).ellipse(50, 5) |
| 2635 | """ |
| 2636 | |
| 2637 | e = Wire.makeEllipse( |
| 2638 | x_radius, |
| 2639 | y_radius, |
| 2640 | Vector(), |
| 2641 | Vector(0, 0, 1), |
| 2642 | Vector(1, 0, 0), |
| 2643 | rotation_angle=rotation_angle, |
| 2644 | ) |
| 2645 | e.forConstruction = forConstruction |
| 2646 | |
| 2647 | return self.eachpoint(lambda loc: e.moved(loc), True) |
| 2648 | |
| 2649 | def polygon( |
| 2650 | self: T, |