Skip to content

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:

Attributes:

AxisAngle property writable

AxisAngle: Angle

Get the axis angle

Returns the the angle of the major axis

Center property writable

Center: Point2D

Get center point

CenterRel property writable

CenterRel: Point2D

Get center point in relative coordinate system.

CounterClockwise property writable

CounterClockwise: bool

Returns winding direction counterclockwise true/false

DeltaAngle property

DeltaAngle: Angle

Get difference between EndAngle and StartAngle

EndAngle property writable

EndAngle: Angle

Get end angle

EndPoint property writable

EndPoint: Point2D

Get the end point in world coordinate system.

EndRelPoint property

EndRelPoint: Point2D

Get the end point in relative coordinate system

MajorRadius property writable

MajorRadius: float

Get major radius

MinorRadius property writable

MinorRadius: float

Get minor radius

RefPoint property writable

RefPoint: Point2D

Get reference point

StartAngle property writable

StartAngle: Angle

Get start angle

StartPoint property writable

StartPoint: Point2D

Get the start point in world coordinate system.

StartRelPoint property

StartRelPoint: Point2D

Get the start point in relative coordinate system

Close

Close()

Close arc

End angle will be adjusted to close arc.

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

Get the axis angle

Returns the the angle of the major axis

Returns:

GetCenter

GetCenter() -> Point2D

Get center point

Returns:

GetCenterRel

GetCenterRel() -> Point2D

Get center point in relative coordinate system.

Returns:

GetDeltaAngle

GetDeltaAngle() -> Angle

Get difference between EndAngle and StartAngle

Returns:

GetEndAngle

GetEndAngle() -> Angle

Get end angle

Returns:

GetEndPoint

GetEndPoint() -> Point2D

Get the end point in world coordinate system.

Returns:

GetEndRelPoint

GetEndRelPoint() -> Point2D

Get the end point in relative coordinate system

Returns:

GetEndTangent

GetEndTangent() -> Vector2D

Get tangent vector at the end point of Arc

Returns:

  • Vector2D

    Tangent vector (unit vector)

GetMajorRadius

GetMajorRadius() -> float

Get major radius

Returns:

  • float

    major radius

GetMinorRadius

GetMinorRadius() -> float

Get minor radius

Returns:

  • float

    minor radius

GetPoint

GetPoint(angle: Angle) -> Point2D

Get point on Arc in world coordinate system

Calculates the point at central angle in parameter angle on the Arc

Parameters:

  • angle (Angle) –

    central angle of the point

Returns:

GetPointLocalAngle

GetPointLocalAngle(pnt: Point2D) -> Angle

Get local angle on arc for point in world coordinate system

Calculates the angle of the point projected on the arc count from 0 (axis) with respect to the clockwise/counterclockwise orientation

Parameters:

Returns:

  • Angle

    angle local angle of the point

GetRefPoint

GetRefPoint() -> Point2D

Get reference point

Returns:

GetStartAngle

GetStartAngle() -> Angle

Get start angle

Returns:

GetStartPoint

GetStartPoint() -> Point2D

Get the start point in world coordinate system.

Returns:

GetStartRelPoint

GetStartRelPoint() -> Point2D

Get the start point in relative coordinate system

Returns:

GetStartTangent

GetStartTangent() -> Vector2D

Get tangent vector at the start point of Arc

Returns:

  • Vector2D

    Tangent vector (unit vector)

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

IsCircle() -> bool

Test if ellipse is circle

Tests if major radius equals minor radius

Returns:

  • bool

    if ellipse is circle

IsClosed

IsClosed() -> bool

Check if arc is closed ( Full circle/ellipse )

Returns:

  • bool

    closed curve true/false

IsCounterClockwise

IsCounterClockwise() -> bool

Returns winding direction counterclockwise true/false

Returns:

  • bool

    Is counterclockwise true/false

Reverse

Reverse()

Reverse of current arc

Method reverse Arc, start with end angle and orientation.

SetAxisAngle

SetAxisAngle(angle: Angle)

Set the axis angle

Set the angle of the major axis

Parameters:

  • angle (Angle) –

    axis angle

SetCenter

SetCenter(center: Point2D)

Set center point

Parameters:

  • center (Point2D) –

    center point

SetCenterRel

SetCenterRel(center: Point2D)

Set center point in local coordinate system

Parameters:

  • center (Point2D) –

    center point

SetCounterClockwise

SetCounterClockwise(ccw: bool)

Set the winding direction of the arc

Parameters:

  • ccw (bool) –

    winding counterclockwise true/false

SetEndAngle

SetEndAngle(angle: Angle)

Set end angle

Set the end angle

Parameters:

  • angle (Angle) –

    end angle

SetEndPoint

SetEndPoint(endpoint: Point2D)

Set the end point in world coordinate system

Parameters:

  • endpoint (Point2D) –

    constant 2D point

SetMajorRadius

SetMajorRadius(radius: float)

Set major radius

Parameters:

  • radius (float) –

    major radius

SetMinorRadius

SetMinorRadius(radius: float)

Set minor radius

Parameters:

  • radius (float) –

    minor radius

SetRefPoint

SetRefPoint(refPoint: Point2D)

Set reference point

Parameters:

  • refPoint (Point2D) –

    reference point

SetStartAngle

SetStartAngle(angle: Angle)

Set start angle

Set the start angle

Parameters:

  • angle (Angle) –

    start angle

SetStartPoint

SetStartPoint(startpoint: Point2D)

Set the start point in world coordinate system

Parameters:

  • startpoint (Point2D) –

    constant 2D point

Supplement

Supplement()

Convert to supplementary arc

Orientation of arc will not be changed.

__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

__init__()

Initialize

__init__(arc: Arc2D)

Copy constructor.

Parameters:

  • arc (Arc2D) –

    Arc2D to be copied

__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

__mul__

__mul__(matrix: Matrix2D) -> Arc2D

Matrix transformation.

Parameters:

  • matrix (Matrix2D) –

    transformation matrix.

Returns:

  • Arc2D

    transformed Arc2D.

__repr__

__repr__() -> str

Convert to string