Skip to content

Polygon2DUtil

Canonical path: NemAll_Python_Geometry.Polygon2DUtil

Methods:

CalculateInscribedCircumscribedArc staticmethod

CalculateInscribedCircumscribedArc(
    outline: Polygon2D, centerPoint: Point2D, isCircumscribed: bool
) -> tuple[Arc2D, Arc2D]

Create the inscribed/ circumscribed arc for a regular polygon

Parameters:

  • outline (Polygon2D) –

    Regular polygon

  • centerPoint (Point2D) –

    Center point of the regular polygon

  • isCircumscribed (bool) –

    True, if

Returns:

  • tuple[Arc2D, Arc2D]

    tuple(Circumscribing arc of the regular polygon, Inscribing arc of the regular polygon)

CreateRegularPolygonFromArc staticmethod

CreateRegularPolygonFromArc(
    arc: Arc2D, placement: AxisPlacement2D, segmentation: int, bInscribed: bool
) -> tuple[bool, Polygon2D]

Create a regular polygon for an arc

Parameters:

  • arc (Arc2D) –

    Base arc

  • placement (AxisPlacement2D) –

    Placement for the poylgon

  • segmentation (int) –

    Number of corner points

  • bInscribed (bool) –

    True, if if the arc is inscribed to the polygon

Returns:

  • tuple[bool, Polygon2D]

    tuple(true, if the polygonization was correct, Regular polygon)

FindPointOnPolygonWithDistance staticmethod

FindPointOnPolygonWithDistance(
    polygon: Polygon2D,
    fromPoint: Point2D,
    directionPoint: Point2D,
    iAxisCurve_object: object,
    pointDistance: float,
) -> tuple[int, Point2D]

Find a point on a polygon with a distance

Parameters:

  • polygon (Polygon2D) –

    Polygon

  • fromPoint (Point2D) –

    From point

  • directionPoint (Point2D) –

    Direction point

  • iAxisCurve_object (object) –

    Axis curve

  • pointDistance (float) –

    Point distance

Returns:

GetPolygon2DSegment staticmethod

GetPolygon2DSegment(
    polygon: Polygon2D, clickPoint: Point2D
) -> tuple[int, int, Line2D]

Get the closest segment for the given click point

Parameters:

  • polygon (Polygon2D) –

    Polygon to analyze

  • clickPoint (Point2D) –

    Click point to analyze

Returns:

  • tuple[int, int, Line2D]

    tuple(Index of the start point of the clicked line, Index of the end point of the clicked line, Segment of the polygon, where the click point is on)