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

Method ellipse

cadquery/cq.py:2612–2647  ·  view source on GitHub ↗

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,
    )

Source from the content-addressed store, hash-verified

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,

Callers 8

test_face_interfaceFunction · 0.45
test_ellipseMethod · 0.45
testDXFMethod · 0.45
testSimpleShellMethod · 0.45
testNormalMethod · 0.45
testEdgeTypesFilterMethod · 0.45

Calls 4

eachpointMethod · 0.95
VectorClass · 0.85
makeEllipseMethod · 0.45
movedMethod · 0.45

Tested by 8

test_face_interfaceFunction · 0.36
test_ellipseMethod · 0.36
testDXFMethod · 0.36
testSimpleShellMethod · 0.36
testNormalMethod · 0.36
testEdgeTypesFilterMethod · 0.36