Skip to content

editorGlobalsFingerShapeGenerator

Class: FingerShapeGenerator

Based on finger specifications, calculates actual shape changes for the selected physical object.

Hierarchy

  • FingerShapeGenerator

Index

Methods

Methods

Static Private _addCornerShapeDescription

_addCornerShapeDescription(polygons: any, tag: any): void

Defined in src/model/visualization/Joints/Renderer/FingerRendering/FingerShapeGenerator.ts:512

Parameters:

Name Type
polygons any
tag any

Returns: void


Static Private _buildFlexPolygon

_buildFlexPolygon(curve: Vector3[], segment: CutoutSpec[number], flexSegment: FlexCutoutSpec[number], offset: IExpression): FlexPolygon

Defined in src/model/visualization/Joints/Renderer/FingerRendering/FingerShapeGenerator.ts:183

Parameters:

Name Type
curve Vector3[]
segment CutoutSpec[number]
flexSegment FlexCutoutSpec[number]
offset IExpression

Returns: FlexPolygon


Static Private _buildShape

_buildShape(width: number, bottom: number, top: number, startPosition: number, curvePoints: Vector3[], sandingElongation: number): Polygon

Defined in src/model/visualization/Joints/Renderer/FingerRendering/FingerShapeGenerator.ts:158

Parameters:

Name Type Default
width number -
bottom number -
top number -
startPosition number -
curvePoints Vector3[] -
sandingElongation number 0

Returns: Polygon


Static Private _combineShapes

_combineShapes(...shapes: Array‹object›): object

Defined in src/model/visualization/Joints/Renderer/FingerRendering/FingerShapeGenerator.ts:486

Parameters:

Name Type
...shapes Array‹object›

Returns: object


Static Private _computeCornerShapes

_computeCornerShapes(startOrEnd: "start" | "end", joinedPlatesContext: EdgeJoinedPlatesContext, adjacentContext: EdgeJoinedPlatesContext, to: "addition" | "cutout", adjacentTo: "addition" | "cutout", fabricationConfig: FabricationConfig): Polygon[]

Defined in src/model/visualization/Joints/Renderer/FingerRendering/FingerShapeGenerator.ts:652

Parameters:

Name Type
startOrEnd "start" | "end"
joinedPlatesContext EdgeJoinedPlatesContext
adjacentContext EdgeJoinedPlatesContext
to "addition" | "cutout"
adjacentTo "addition" | "cutout"
fabricationConfig FabricationConfig

Returns: Polygon[]


Static Private _getAdditionShapes

_getAdditionShapes(fingerSpecs: FingerSpecs, fabricationConfig: FabricationConfig, curvePoints: Vector3[]): object

Defined in src/model/visualization/Joints/Renderer/FingerRendering/FingerShapeGenerator.ts:281

Parameters:

Name Type
fingerSpecs FingerSpecs
fabricationConfig FabricationConfig
curvePoints Vector3[]

Returns: object


Static Private _getConcaveCornerShapes

_getConcaveCornerShapes(startOrEnd: "start" | "end", joinedPlatesContext: EdgeJoinedPlatesContext, adjacentContext: EdgeJoinedPlatesContext, fabricationConfig: FabricationConfig): object

Defined in src/model/visualization/Joints/Renderer/FingerRendering/FingerShapeGenerator.ts:524

Generates a rectangle, that has the size of the elongation of the master plate. For plates, that are not joined to the master plate, an addition is generated.

see ../../src/model/visualization/Joints/corner_shapes_documentation.svg

Parameters:

Name Type
startOrEnd "start" | "end"
joinedPlatesContext EdgeJoinedPlatesContext
adjacentContext EdgeJoinedPlatesContext
fabricationConfig FabricationConfig

Returns: object

  • additionShapes: Polygon[]

  • cutoutShapes: Polygon[]


Static Private _getConvexCornerShapes

_getConvexCornerShapes(startOrEnd: "start" | "end", joinedPlatesContext: EdgeJoinedPlatesContext, adjacentContext: EdgeJoinedPlatesContext, fabricationConfig: FabricationConfig): object

Defined in src/model/visualization/Joints/Renderer/FingerRendering/FingerShapeGenerator.ts:399

For convex corners @see ../../src/model/visualization/Joints/corner_shapes_documentation.svg

Parameters:

Name Type
startOrEnd "start" | "end"
joinedPlatesContext EdgeJoinedPlatesContext
adjacentContext EdgeJoinedPlatesContext
fabricationConfig FabricationConfig

Returns: object

  • additionShapes: Polygon[]

  • cutoutShapes: Polygon[]


Static Private _getCornerShapes

_getCornerShapes(startOrEnd: "start" | "end", joinedPlatesContext: EdgeJoinedPlatesContext, fabricationConfig: FabricationConfig): object

Defined in src/model/visualization/Joints/Renderer/FingerRendering/FingerShapeGenerator.ts:342

Generate the corner shapes for the given corner.

Parameters:

Name Type
startOrEnd "start" | "end"
joinedPlatesContext EdgeJoinedPlatesContext
fabricationConfig FabricationConfig

Returns: object


Static Private _getCutoutShapes

_getCutoutShapes(fingerSpecs: FingerSpecs, fabricationConfig: FabricationConfig, curvePoints: Vector3[], includeFullCutouts: boolean): object

Defined in src/model/visualization/Joints/Renderer/FingerRendering/FingerShapeGenerator.ts:225

Parameters:

Name Type Default Description
fingerSpecs FingerSpecs - -
fabricationConfig FabricationConfig - -
curvePoints Vector3[] - -
includeFullCutouts boolean false Set this to true when generating TeeJoints. If true, all cutouts will be represented as a cutout shape. If false, only the necessary cutout/addition will be created and the cutout shapes will always remove all enclosing material.

Returns: object


Static Private _getMasterPlateClearance

_getMasterPlateClearance(startOrEnd: "start" | "end", joinedPlatesContext: EdgeJoinedPlatesContext, adjacentContext: EdgeJoinedPlatesContext, fabricationConfig: FabricationConfig): object

Defined in src/model/visualization/Joints/Renderer/FingerRendering/FingerShapeGenerator.ts:545

Parameters:

Name Type
startOrEnd "start" | "end"
joinedPlatesContext EdgeJoinedPlatesContext
adjacentContext EdgeJoinedPlatesContext
fabricationConfig FabricationConfig

Returns: object

  • additionShapes: any[]

  • cutoutShapes: any[]


Static Private _getMasterPlateElongation

_getMasterPlateElongation(startOrEnd: "start" | "end", joinedPlatesContext: EdgeJoinedPlatesContext, fabricationConfig: FabricationConfig): number

Defined in src/model/visualization/Joints/Renderer/FingerRendering/FingerShapeGenerator.ts:621

TODO Find a better way of getting this information Assumes, that joinedPlatesContext is joined to the master plate.

Parameters:

Name Type
startOrEnd "start" | "end"
joinedPlatesContext EdgeJoinedPlatesContext
fabricationConfig FabricationConfig

Returns: number

the length of the master plate"s fingers


Static Private _getShapeChangeVisualPriority

_getShapeChangeVisualPriority(index: number, lastIndex: number, joinedPlatesContext: JoinedPlatesContext): ShapeChangePriority

Defined in src/model/visualization/Joints/Renderer/FingerRendering/FingerShapeGenerator.ts:731

Parameters:

Name Type
index number
lastIndex number
joinedPlatesContext JoinedPlatesContext

Returns: ShapeChangePriority


Static Private _removeZeroSizePolygons

_removeZeroSizePolygons(polygons: Polygon[]): void

Defined in src/model/visualization/Joints/Renderer/FingerRendering/FingerShapeGenerator.ts:503

Parameters:

Name Type
polygons Polygon[]

Returns: void


Static clampShapeChanges

clampShapeChanges(shapeChanges: object, section: OutlineSection, fabricationConfig: FabricationConfig, startOrEnd: "start" | "end"): object

Defined in src/model/visualization/Joints/Renderer/FingerRendering/FingerShapeGenerator.ts:125

Clamps finger joints sticking out in acute angles (for visualization only).

Parameters:

shapeChanges: object

Name Type
additions ShapeChange[]
cutouts ShapeChange[]

section: OutlineSection

fabricationConfig: FabricationConfig

startOrEnd: "start" | "end"

Returns: object


Static generateFlexShapeChanges

generateFlexShapeChanges(curve: Vector3[], fingerSpecs: FingerSpecs, verticalHandler: FlexVerticalCalculationHandler): IFlexShapeChanges

Defined in src/model/visualization/Joints/Renderer/FingerRendering/FingerShapeGenerator.ts:64

Parameters:

Name Type
curve Vector3[]
fingerSpecs FingerSpecs
verticalHandler FlexVerticalCalculationHandler

Returns: IFlexShapeChanges


Static generateShapeChanges

generateShapeChanges(fingerSpecs: FingerSpecs, fabricationConfig: FabricationConfig, curvePoints: Vector3[], includeFullCutouts: boolean): IShapeChanges

Defined in src/model/visualization/Joints/Renderer/FingerRendering/FingerShapeGenerator.ts:34

Based on finger specifications, calculates actual shape changes for the selected physical object ToDO: Write tests

Parameters:

Name Type
fingerSpecs FingerSpecs
fabricationConfig FabricationConfig
curvePoints Vector3[]
includeFullCutouts boolean

Returns: IShapeChanges


Static getSectionOffsetVector

getSectionOffsetVector(section: OutlineSection, sanding: SandingString, type: "maxAddition" | "maxCutout", at?: 0 | 1, sandingElongation: number, creaseDistance: number): Vector3

Defined in src/model/visualization/Joints/Renderer/FingerRendering/FingerShapeGenerator.ts:94

Parameters:

Name Type Default
section OutlineSection -
sanding SandingString "sanded"
type "maxAddition" | "maxCutout" -
at? 0 | 1 -
sandingElongation number 0
creaseDistance number 0

Returns: Vector3