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
Methods:
-
Close
–Close arc
-
EqualRef
–Test for equal reference points
-
GetAxisAngle
–Get the axis angle
-
GetCenter
–Get center point
-
GetCenterRel
–Get center point in relative coordinate system.
-
GetDeltaAngle
–Get difference between EndAngle and StartAngle
-
GetEndAngle
–Get end angle
-
GetEndPoint
–Get the end point in world coordinate system.
-
GetEndRelPoint
–Get the end point in relative coordinate system
-
GetEndTangent
–Get tangent vector at the end point of Arc
-
GetMajorRadius
–Get major radius
-
GetMinorRadius
–Get minor radius
-
GetPoint
–Get point on Arc in world coordinate system
-
GetPointLocalAngle
–Get local angle on arc for point in world coordinate system
-
GetRefPoint
–Get reference point
-
GetStartAngle
–Get start angle
-
GetStartPoint
–Get the start point in world coordinate system.
-
GetStartRelPoint
–Get the start point in relative coordinate system
-
GetStartTangent
–Get tangent vector at the start point of Arc
-
IsAngleOnArc
–Checks if the given angle lies on the arc
-
IsCircle
–Test if ellipse is circle
-
IsClosed
–Check if arc is closed ( Full circle/ellipse )
-
IsCounterClockwise
–Returns winding direction counterclockwise true/false
-
Reverse
–Reverse of current arc
-
SetAxisAngle
–Set the axis angle
-
SetCenter
–Set center point
-
SetCenterRel
–Set center point in local coordinate system
-
SetCounterClockwise
–Set the winding direction of the arc
-
SetEndAngle
–Set end angle
-
SetEndPoint
–Set the end point in world coordinate system
-
SetMajorRadius
–Set major radius
-
SetMinorRadius
–Set minor radius
-
SetRefPoint
–Set reference point
-
SetStartAngle
–Set start angle
-
SetStartPoint
–Set the start point in world coordinate system
-
Supplement
–Convert to supplementary arc
-
__eq__
–Comparison of arcs.
-
__init__
–Overloaded function. See individual overloads.
-
__mul__
–Matrix transformation.
-
__repr__
–Convert to string
Attributes:
-
AxisAngle
(Angle
) –Get the axis angle
-
Center
(Point2D
) –Get center point
-
CenterRel
(Point2D
) –Get center point in relative coordinate system.
-
CounterClockwise
(bool
) –Returns winding direction counterclockwise true/false
-
DeltaAngle
(Angle
) –Get difference between EndAngle and StartAngle
-
EndAngle
(Angle
) –Get end angle
-
EndPoint
(Point2D
) –Get the end point in world coordinate system.
-
EndRelPoint
(Point2D
) –Get the end point in relative coordinate system
-
MajorRadius
(float
) –Get major radius
-
MinorRadius
(float
) –Get minor radius
-
RefPoint
(Point2D
) –Get reference point
-
StartAngle
(Angle
) –Get start angle
-
StartPoint
(Point2D
) –Get the start point in world coordinate system.
-
StartRelPoint
(Point2D
) –Get the start point in relative coordinate system
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