Skip to content

jitx/shapes/DShape

Package name: jitx/shapes/DShape

Summary

DShape

D Shape

Constructors

Function Description
DShape Constructor for defstruct DShape

Functions

Function Description
DShape Create a D shape anchored to a specified alignment with respect to the origin.

Definitions

DShape

D Shape

public defstruct DShape <: Shape & Centerable & HasMetaUtils :
    height: Double
    pose: Pose
    radius: Double
    width: Double

  • height: Double - Height of this D shape. Must be non-negative.

  • pose: Pose - Pose of this D shape. Default value is (0.0, 0.0) with no rotation and no flip.

  • radius: Double - Radius of the two rounded corners of this D shape. Must be non-negative and at most the minimum of the width and half of the height.

  • width: Double - Width of this D shape. Must be non-negative.

A rectangle with only its two right corners (top and bottom) rounded.

Similar to he shape of the letter "D". The two right corners are rounded to the same radius, and the top left corners are normal (unrounded). Has a width, height, corner radius and pose. The pose center is the center of the rectangle. The flip of the pose affects the ordering of the chamfered rectangle's points when converted to a polygon (clockwise when flipped, otherwise counter-clockwise).

Constructors

DShape

Constructor for defstruct DShape

public defn DShape (width:Double, height:Double, radius:Double, pose:Pose = ?)

Functions

DShape

Create a D shape anchored to a specified alignment with respect to the origin.

public defn DShape (anchor:Anchor, w:Double, h:Double, r:Double)

  • anchor: Anchor - Anchor to align the D shape with to the origin.
  • w: Double - Width of the D shape.
  • h: Double - Height of the D shape.
  • r: Double - Corner radius of the D shape.

The alignment is performed with respect to the un-rounded rectangular bounding box of the D shape.

Related Packages

Forwarded by packages: jitx/shapes, jitx