Arc2D
Canonical path: NemAll_Python_Geometry.Arc2D
Representation class for 2D arc.
Arc2D could be a circular or elliptical arc. All angles are given as central angles. In case of an elliptical arc the ellipse angle and the central angle do not correspond. All start angle is normalized to the range [-PI..2PI]. The winding direction of the arc could either be in clockwise or in counterclockwise direction.
Examples:
Circular arc without axis rotation
Circular arc with axis rotation (the same arc could be created without axis rotation only by increasing the start and end angles by the axis angle)
Elliptical arc
AxisAngle
property
writable
AxisAngle: Angle
Get the axis angle
Returns the the angle of the major axis
CounterClockwise
property
writable
Returns winding direction counterclockwise true/false
EqualRef
EqualRef(arc: Arc2D) -> bool
Test for equal reference points
Parameters:
-
arc
(Arc2D
) –Arc which will be compared
Returns:
-
bool
–result as bool
GetAxisAngle
GetAxisAngle() -> Angle
GetCenterRel
GetCenterRel() -> Point2D
GetDeltaAngle
GetDeltaAngle() -> Angle
GetEndPoint
GetEndPoint() -> Point2D
GetEndRelPoint
GetEndRelPoint() -> Point2D
GetEndTangent
GetEndTangent() -> Vector2D
GetPoint
GetPointLocalAngle
GetStartPoint
GetStartPoint() -> Point2D
GetStartRelPoint
GetStartRelPoint() -> Point2D
GetStartTangent
GetStartTangent() -> Vector2D
IsAngleOnArc
IsAngleOnArc(angle: Angle) -> bool
Checks if the given angle lies on the arc
Parameters:
-
angle
(Angle
) –angle to test
Returns:
-
bool
–Angle on arc true/false
IsCircle
Test if ellipse is circle
Tests if major radius equals minor radius
Returns:
-
bool
–if ellipse is circle
IsClosed
Check if arc is closed ( Full circle/ellipse )
Returns:
-
bool
–closed curve true/false
IsCounterClockwise
Returns winding direction counterclockwise true/false
Returns:
-
bool
–Is counterclockwise true/false
SetAxisAngle
SetAxisAngle(angle: Angle)
SetCenterRel
SetCenterRel(center: Point2D)
SetCounterClockwise
Set the winding direction of the arc
Parameters:
-
ccw
(bool
) –winding counterclockwise true/false
SetEndAngle
SetEndAngle(angle: Angle)
SetEndPoint
SetEndPoint(endpoint: Point2D)
SetMajorRadius
Set major radius
Parameters:
-
radius
(float
) –major radius
SetMinorRadius
Set minor radius
Parameters:
-
radius
(float
) –minor radius
SetRefPoint
SetRefPoint(refPoint: Point2D)
SetStartAngle
SetStartAngle(angle: Angle)
SetStartPoint
SetStartPoint(startpoint: Point2D)
__eq__
__eq__(arc: Arc2D) -> bool
Comparison of arcs.
Be careful, this method work without tolerance!
Parameters:
-
arc
(Arc2D
) –arc to be compared.
Returns:
-
bool
–True when arcs are equal, otherwise false.
__init__
overloaded
Initialize
__init__(arc: Arc2D)
__init__(
center: Point2D,
minor: float,
major: float,
axisangle: float,
startangle: float,
endangle: float,
counterClockwise: bool = True,
)
Constructor
Parameters:
-
center
(Point2D
) –Center point
-
minor
(float
) –Minor radius
-
major
(float
) –Major radius
-
axisangle
(float
) –Axis angle
-
startangle
(float
) –Start angle
-
endangle
(float
) –End angle
-
counterClockwise
(bool
, default:True
) –Direction is counter clockwise: true/false
__init__(center: Point2D, radius: float, counterClockwise: bool = True)
Constructor for creating circle
Create circle as arc with start angle 0 [rad] and end angle 2pi [rad]. Minor and major radii are equal.
Parameters:
-
center
(Point2D
) –Center point
-
radius
(float
) –Minor radius
-
counterClockwise
(bool
, default:True
) –Direction is counter clockwise: true/false