Skip to content

Rectangle2DUtil

implementation of the 2D rectangle utility functions

  • create a rectangle polygon by center point, rotation angle, width and thickness
  • create a rectangle polygon by corner points

Rectangle2DUtil

Canonical path: Utils.Geometry.Rectangle2DUtil.Rectangle2DUtil

implementation of the 2D rectangle utility functions

polygon_by_center staticmethod

polygon_by_center(
    center_point: Point2D, rotation_angle: Angle, width: float, thickness: float
) -> Polygon2D

create a rectangle polygon by center point, rotation angle, width and thickness

Parameters:

  • center_point (Point2D) –

    center point

  • rotation_angle (Angle) –

    rotation angle

  • width (float) –

    width

  • thickness (float) –

    thickness

Returns:

polygon_by_corner_points staticmethod

polygon_by_corner_points(bottom_left: Point2D, top_right: Point2D) -> Polygon2D

create a model element for a 2d rectangle by corner points

Parameters:

  • bottom_left (Point2D) –

    bottom left corner point

  • top_right (Point2D) –

    top right corner point

Returns:

polygon_by_ref_point staticmethod

polygon_by_ref_point(
    ref_point: Point2D,
    ref_point_position: RefPointPosition,
    rotation_angle: Angle,
    width: float,
    thickness: float,
) -> Polygon2D

create a rectangle polygon by reference point, rotation angle, width and thickness

Parameters:

  • ref_point (Point2D) –

    reference point

  • ref_point_position (RefPointPosition) –

    reference point position

  • rotation_angle (Angle) –

    rotation angle

  • width (float) –

    width

  • thickness (float) –

    thickness

Returns:

polygon_by_sizes staticmethod

polygon_by_sizes(
    width: float, thickness: float, rotation_angle: Angle
) -> Polygon2D

create a rectangle polygon by width and thickness, located at origin

Parameters:

  • width (float) –

    width

  • thickness (float) –

    thickness

  • rotation_angle (Angle) –

    rotation angle

Returns:

Placeholder