Skip to content

editorGlobalsShapeHelper

Class: ShapeHelper

Hierarchy

  • ShapeHelper

Index

Methods

Methods

Static Private _buildEdge

_buildEdge(edgeRadius: number, edgeResolution: number): Polygon

Defined in src/model/visualization/Joints/Renderer/FingerRendering/ShapeHelper.ts:123

Parameters:

Name Type
edgeRadius number
edgeResolution number

Returns: Polygon


Static Private _buildRoundEdges

_buildRoundEdges(edgeRadius: number[], edgeResolution: number, xHalf: number, yHalf: number): ArrayPoint2[]

Defined in src/model/visualization/Joints/Renderer/FingerRendering/ShapeHelper.ts:95

Parameters:

Name Type
edgeRadius number[]
edgeResolution number
xHalf number
yHalf number

Returns: ArrayPoint2[]


Static Private _transformToPoint

_transformToPoint(prototype: Polygon, angle: number, point: ArrayPoint2): ArrayPoint2[]

Defined in src/model/visualization/Joints/Renderer/FingerRendering/ShapeHelper.ts:115

Parameters:

Name Type
prototype Polygon
angle number
point ArrayPoint2

Returns: ArrayPoint2[]


Static makeRectangle

makeRectangle(width: number, height: number, xOffset: number, yOffset: number, translation: Vector3‹›, rotation: Quaternion‹›): ArrayPoint2[]

Defined in src/model/visualization/Joints/Renderer/FingerRendering/ShapeHelper.ts:18

Generates a 2D rectangle with the specified dimensions aligned with the x-Axis, then translates and rotates it as needed.

Parameters:

Name Type Default Description
width number - The width of the rectangle (x), centered x = 0
height number - The height of the rectangle (y), centered around y = 0, if not specified otherwise
xOffset number 0 Before rotation/translation the xOffset is applied to the x coordinates of the rectangle
yOffset number 0 Before rotation/translation the yOffset is applied to the y coordinates of the rectangle
translation Vector3‹› new Vector3() The translation to apply
rotation Quaternion‹› new Quaternion() The rotation to apply

Returns: ArrayPoint2[]


Static makeRoundRectangle

makeRoundRectangle(width: number, height: number, xOffset: number, yOffset: number, translation: Vector3‹›, rotation: Quaternion‹›, edgeRadius?: number | [number, number, number, number], edgeResolution: number): ArrayPoint2[]

Defined in src/model/visualization/Joints/Renderer/FingerRendering/ShapeHelper.ts:60

Generates a 2D rectangle with the specified dimensions aligned with the x-Axis, then translates and rotates it as needed.

Parameters:

Name Type Default Description
width number - The width of the rectangle (x), centered x = 0
height number - The height of the rectangle (y), centered around y = 0, if not specified otherwise
xOffset number 0 Before rotation/translation the xOffset is applied to the x coordinates of the rectangle
yOffset number 0 Before rotation/translation the yOffset is applied to the y coordinates of the rectangle
translation Vector3‹› new Vector3() The translation to apply
rotation Quaternion‹› new Quaternion() The rotation to apply
edgeRadius? number | [number, number, number, number] - The radius of the rounded edges. If an array is given, radius 0 is for (xmin, ymin), 1 for (xmax, ymin), 2 for (xmax, ymax) and 3 for (xmin, ymax)
edgeResolution number 10 The number of spaced Points to approximate a curve

Returns: ArrayPoint2[]