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

Method makeEllipse

cadquery/occ_impl/shapes.py:2999–3036  ·  view source on GitHub ↗

Makes an Ellipse centered at the provided point, having normal in the provided direction :param x_radius: floating point major radius of the ellipse (x-axis), must be > 0 :param y_radius: floating point minor radius of the ellipse (y-axis), must be > 0 :param center

(
        cls,
        x_radius: float,
        y_radius: float,
        center: VectorLike,
        normal: VectorLike,
        xDir: VectorLike,
        angle1: float = 360.0,
        angle2: float = 360.0,
        rotation_angle: float = 0.0,
        closed: bool = True,
    )

Source from the content-addressed store, hash-verified

2997
2998 @classmethod
2999 def makeEllipse(
3000 cls,
3001 x_radius: float,
3002 y_radius: float,
3003 center: VectorLike,
3004 normal: VectorLike,
3005 xDir: VectorLike,
3006 angle1: float = 360.0,
3007 angle2: float = 360.0,
3008 rotation_angle: float = 0.0,
3009 closed: bool = True,
3010 ) -> Wire:
3011 """
3012 Makes an Ellipse centered at the provided point, having normal in the provided direction
3013
3014 :param x_radius: floating point major radius of the ellipse (x-axis), must be > 0
3015 :param y_radius: floating point minor radius of the ellipse (y-axis), must be > 0
3016 :param center: vector representing the center of the circle
3017 :param normal: vector representing the direction of the plane the circle should lie in
3018 :param angle1: start angle of arc
3019 :param angle2: end angle of arc
3020 :param rotation_angle: angle to rotate the created ellipse / arc
3021 """
3022
3023 ellipse_edge = Edge.makeEllipse(
3024 x_radius, y_radius, center, normal, xDir, angle1, angle2
3025 )
3026
3027 if angle1 != angle2 and closed:
3028 line = Edge.makeLine(ellipse_edge.endPoint(), ellipse_edge.startPoint())
3029 w = cls.assembleEdges([ellipse_edge, line])
3030 else:
3031 w = cls.assembleEdges([ellipse_edge])
3032
3033 if rotation_angle != 0.0:
3034 w = w.rotate(center, Vector(center) + Vector(normal), rotation_angle)
3035
3036 return w
3037
3038 @classmethod
3039 def makePolygon(

Callers

nothing calls this directly

Calls 7

VectorClass · 0.85
makeLineMethod · 0.80
endPointMethod · 0.80
startPointMethod · 0.80
assembleEdgesMethod · 0.80
makeEllipseMethod · 0.45
rotateMethod · 0.45

Tested by

no test coverage detected