Skip to content

editorGlobalsCellShapeGenerator

Class: CellShapeGenerator

Hierarchy

  • CellShapeGenerator

Index

Methods

Methods

Static Private _modifierForShape

_modifierForShape(shape: CornerShape, specs: ICellMembraneJointSpecs): number

Defined in src/modules/kyub.core.cell/src/CellShapeGenerator.ts:325

Parameters:

Name Type
shape CornerShape
specs ICellMembraneJointSpecs

Returns: number


Static calculateCornerShape

calculateCornerShape(specs: ICellMembraneJointSectionSpecs, fingerWidth: number, isStart: boolean): IShapeChangeInfo[]

Defined in src/modules/kyub.core.cell/src/CellShapeGenerator.ts:241

Equal, Addition: __ _ | | | | - - - | - - -| - - | ' ------- | '


'  |
'  |

Equal, Cutout: _ | | - - | - - - | - - ' | ------ ---'---- | ' | ' | ' ---'--- ' |

Different, Addition, Cutout: __ | - - - | - _'______| | ' | ' | '


'  |
'  |

Parameters:

Name Type
specs ICellMembraneJointSectionSpecs
fingerWidth number
isStart boolean

Returns: IShapeChangeInfo[]


Static calculateFingers

calculateFingers(specs: ICellMembraneJointSectionSpecs): IShapeChangeInfo[]

Defined in src/modules/kyub.core.cell/src/CellShapeGenerator.ts:170

Calculates finger positions for the rounded zig-zag pattern. The pattern starts at (0, 0) and ends at (lengthOfJoint, 0)

Parameters:

Name Type
specs ICellMembraneJointSectionSpecs

Returns: IShapeChangeInfo[]


Static calculateFingersForMiddle

calculateFingersForMiddle(joint: CellMembraneJoint, fingersA: IShapeChangeInfo[], fingersB: IShapeChangeInfo[]): IShapeChangeInfo[]

Defined in src/modules/kyub.core.cell/src/CellShapeGenerator.ts:119

Parameters:

Name Type
joint CellMembraneJoint
fingersA IShapeChangeInfo[]
fingersB IShapeChangeInfo[]

Returns: IShapeChangeInfo[]


Static calculateFingersForTop

calculateFingersForTop(specs: ICellMembraneJointSectionSpecs): IShapeChangeInfo[]

Defined in src/modules/kyub.core.cell/src/CellShapeGenerator.ts:139

Parameters:

Name Type
specs ICellMembraneJointSectionSpecs

Returns: IShapeChangeInfo[]


Static determineFingerSize

determineFingerSize(plates: [Plate, Plate]): [number, number]

Defined in src/modules/kyub.core.cell/src/CellShapeGenerator.ts:50

Parameters:

Name Type
plates [Plate, Plate]

Returns: [number, number]


Static getCellDimensions

getCellDimensions(materialSize: Vector2): Vector2

Defined in src/modules/kyub.core.cell/src/CellShapeGenerator.ts:66

A plate has to fit inside the material size given. Since the CellMembraneJoints adds some additional length (= fingerHeight / 2) to 2 sides material size has to be subtracted by that amount

Parameters:

Name Type
materialSize Vector2

Returns: Vector2


Static getCornerShape

getCornerShape(startOrEnd: "start" | "end", joint: CellMembraneJoint, section: OutlineSection, plate: Plate): CornerShape

Defined in src/modules/kyub.core.cell/src/CellShapeGenerator.ts:295

Parameters:

Name Type
startOrEnd "start" | "end"
joint CellMembraneJoint
section OutlineSection
plate Plate

Returns: CornerShape


Static getFingerWidth

getFingerWidth(points: IShapeChangeInfo[]): number

Defined in src/modules/kyub.core.cell/src/CellShapeGenerator.ts:114

Parameters:

Name Type
points IShapeChangeInfo[]

Returns: number


Static getJointSectionSpecs

getJointSectionSpecs(joint: CellMembraneJoint, section: OutlineSection): ICellMembraneJointSectionSpecs

Defined in src/modules/kyub.core.cell/src/CellShapeGenerator.ts:92

Parameters:

Name Type
joint CellMembraneJoint
section OutlineSection

Returns: ICellMembraneJointSectionSpecs


Static getJointSpecs

getJointSpecs(joint: CellMembraneJoint): ICellMembraneJointSpecs

Defined in src/modules/kyub.core.cell/src/CellShapeGenerator.ts:70

Parameters:

Name Type
joint CellMembraneJoint

Returns: ICellMembraneJointSpecs


Static reverseFingers

reverseFingers(fingers: IShapeChangeInfo[], jointLength: number): IShapeChangeInfo[]

Defined in src/modules/kyub.core.cell/src/CellShapeGenerator.ts:196

Parameters:

Name Type
fingers IShapeChangeInfo[]
jointLength number

Returns: IShapeChangeInfo[]