editor › Globals › CompoundNesting
Class: CompoundNesting ‹NestingElement›
A composite nesting, that places other nesting in a common 2d space. It caches the mapping from PlateGroup to Nesting, which is only updated when you miss the cache.
Type parameters
▪ NestingElement: Nesting
Hierarchy
↳ CompoundNesting
Index
Constructors
Properties
Methods
- _createChildNestingMirroredInDirection
- _doesOverlap
- _getCenterOfPlateGroup
- _getMatrixConsideringMirroring
- _getNestingForPlateGroup
- _getTransformationMatrix
- _mirrorRasterizedOutlines
- _printCompareNestingWith
- _transformDirectionWithInverse
- addLabelOnEdge
- addNestingWithMatrix
- addOutlineAsNestingElement
- cloneWithNewPlateGroups
- createMirroredCopy
- createMirroredCopyInDirection
- debugPrint
- getAABB
- getJointCenterAndNormalInPlateGroupCoordinates
- getJointHintPosition
- getMatrixFor
- getMatrixForNesting
- getNestings
- getNewInstance
- getOutline
- getOutlines
- getPlateGroups
- getPositionAndRotationFor
- getPositionAndRotationForNesting
- getRasterizedOutlinesForPlateGroup
- getSimpleNestingElementsWithPositions
- hasPlateGroup
- isAtomic
- isPlateGroupMirrored
- removeNesting
- render
- setMatrixForNesting
Constructors
constructor
+ new CompoundNesting(allPlateGroups: PlateGroup[]): CompoundNesting
Overrides Nesting.constructor
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/CompoundNesting.ts:20
Parameters:
| Name | Type |
|---|---|
allPlateGroups |
PlateGroup[] |
Returns: CompoundNesting
Properties
Protected Readonly matrices
• matrices: Map‹NestingElement, Matrix4‹›› = new Map
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/CompoundNesting.ts:19
Protected Readonly nestings
• nestings: Set‹NestingElement› = new Set
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/CompoundNesting.ts:18
Protected Readonly plateGroupFacade
• plateGroupFacade: PlateGroupGraphFacade
Inherited from Nesting.plateGroupFacade
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/Nesting.ts:28
Private Readonly plateGroupToNesting
• plateGroupToNesting: Map‹PlateGroup‹›, NestingElement› = new Map
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/CompoundNesting.ts:20
Protected Readonly simpleNestingElements
• simpleNestingElements: Map‹SimpleNestingElement‹›, Matrix4‹›› = new Map
Inherited from Nesting.simpleNestingElements
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/Nesting.ts:29
Methods
Private _createChildNestingMirroredInDirection
▸ _createChildNestingMirroredInDirection(nesting: NestingElement, direction: Vector3): Promise‹NestingElement›
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/CompoundNesting.ts:255
Parameters:
| Name | Type |
|---|---|
nesting |
NestingElement |
direction |
Vector3 |
Returns: Promise‹NestingElement›
Protected _doesOverlap
▸ _doesOverlap(polygonToAdd: Polygon): Promise‹boolean›
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/CompoundNesting.ts:241
Parameters:
| Name | Type |
|---|---|
polygonToAdd |
Polygon |
Returns: Promise‹boolean›
Protected _getCenterOfPlateGroup
▸ _getCenterOfPlateGroup(plateGroup: PlateGroup): Vector3
Inherited from Nesting._getCenterOfPlateGroup
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/Nesting.ts:277
Parameters:
| Name | Type |
|---|---|
plateGroup |
PlateGroup |
Returns: Vector3
Protected _getMatrixConsideringMirroring
▸ _getMatrixConsideringMirroring(originalMatrix: Matrix4, originalCenter: Vector3, mirroringCenter: Vector3, mirroringDirection: Vector3, targetYAxis: Vector3): Matrix4
Inherited from Nesting._getMatrixConsideringMirroring
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/Nesting.ts:222
Creates a new positional matrix for an element within a Nesting when that Nesting should be mirrored in place.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
originalMatrix |
Matrix4 | - | is the original matrix of the element within the nesting |
originalCenter |
Vector3 | - | is the original center of the element (with the matrix applied) |
mirroringCenter |
Vector3 | - | is the point on which the mirroring should be oriented on |
mirroringDirection |
Vector3 | - | is the direction that should be used to mirror on, mirroring in y-dir means flipping the y coordinates |
targetYAxis |
Vector3 | new Vector3(0, 1, 0) | can be used to correct the rotation offset of a RO that was mirrored y-wise |
Returns: Matrix4
Protected _getNestingForPlateGroup
▸ _getNestingForPlateGroup(plateGroup: PlateGroup, errorOnNotFound: boolean): NestingElement
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/CompoundNesting.ts:214
This method uses a local cache and validates the entry of PlateGroup. If necessary, it rebuilds that entry
Parameters:
| Name | Type | Default |
|---|---|---|
plateGroup |
PlateGroup | - |
errorOnNotFound |
boolean | true |
Returns: NestingElement
Nesting that contains the PlateGroup, or null if none found and no error is thrown
Protected _getTransformationMatrix
▸ _getTransformationMatrix(currentPosition: Vector3, currentNormal: Vector3, targetPosition: Vector3, targetNormal: Vector3): Matrix4
Inherited from Nesting._getTransformationMatrix
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/Nesting.ts:191
Constructs a matrix transforming current position and normal to the target
Parameters:
| Name | Type |
|---|---|
currentPosition |
Vector3 |
currentNormal |
Vector3 |
targetPosition |
Vector3 |
targetNormal |
Vector3 |
Returns: Matrix4
Protected _mirrorRasterizedOutlines
▸ _mirrorRasterizedOutlines(plateGroup: PlateGroup): Map‹Plate, RasterizedOutlineWithHoles›
Inherited from Nesting._mirrorRasterizedOutlines
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/Nesting.ts:255
Mirror the rasterized outlines of the plateGroup in place, typically in y-wise direction (i.e. on x axis)
Parameters:
| Name | Type |
|---|---|
plateGroup |
PlateGroup |
Returns: Map‹Plate, RasterizedOutlineWithHoles›
Protected _printCompareNestingWith
▸ _printCompareNestingWith(otherNesting: Nesting): Promise‹void›
Inherited from Nesting._printCompareNestingWith
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/Nesting.ts:287
Print both this nesting an the other nesting separately and combined
Parameters:
| Name | Type |
|---|---|
otherNesting |
Nesting |
Returns: Promise‹void›
Protected _transformDirectionWithInverse
▸ _transformDirectionWithInverse(direction: Vector3, matrix: Matrix4): Vector3
Inherited from Nesting._transformDirectionWithInverse
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/Nesting.ts:272
Parameters:
| Name | Type |
|---|---|
direction |
Vector3 |
matrix |
Matrix4 |
Returns: Vector3
addLabelOnEdge
▸ addLabelOnEdge(plateGroup: PlateGroup, edgeJoint: EdgeJoint, labelText: string, isReceiving: boolean): SymbolicLinkNestingElement
Inherited from Nesting.addLabelOnEdge
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/Nesting.ts:93
Parameters:
| Name | Type | Default |
|---|---|---|
plateGroup |
PlateGroup | - |
edgeJoint |
EdgeJoint | - |
labelText |
string | - |
isReceiving |
boolean | false |
Returns: SymbolicLinkNestingElement
addNestingWithMatrix
▸ addNestingWithMatrix(nesting: NestingElement, placementMatrix: Matrix4): void
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/CompoundNesting.ts:161
Parameters:
| Name | Type |
|---|---|
nesting |
NestingElement |
placementMatrix |
Matrix4 |
Returns: void
addOutlineAsNestingElement
▸ addOutlineAsNestingElement(applyKerf: boolean): Promise‹void›
Inherited from Nesting.addOutlineAsNestingElement
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/Nesting.ts:87
Parameters:
| Name | Type | Default |
|---|---|---|
applyKerf |
boolean | true |
Returns: Promise‹void›
cloneWithNewPlateGroups
▸ cloneWithNewPlateGroups(oldToNewPlateGroups: Map‹PlateGroup, PlateGroup›): CompoundNesting
Overrides Nesting.cloneWithNewPlateGroups
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/CompoundNesting.ts:68
Parameters:
| Name | Type |
|---|---|
oldToNewPlateGroups |
Map‹PlateGroup, PlateGroup› |
Returns: CompoundNesting
createMirroredCopy
▸ createMirroredCopy(): Promise‹this›
Inherited from Nesting.createMirroredCopy
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/Nesting.ts:108
Creates a deep clone mirrored on AABB center y-wise (i.e. on x-axis)
Returns: Promise‹this›
createMirroredCopyInDirection
▸ createMirroredCopyInDirection(direction: Vector3): Promise‹this›
Overrides Nesting.createMirroredCopyInDirection
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/CompoundNesting.ts:186
Parameters:
| Name | Type |
|---|---|
direction |
Vector3 |
Returns: Promise‹this›
debugPrint
▸ debugPrint(polygonToAdd: Polygon, debugLevel: DebugLevel‹›): void
Inherited from Nesting.debugPrint
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/Nesting.ts:156
Prints the current layout into the console
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
polygonToAdd |
Polygon | null | an additional polygon that will be added to the current print |
debugLevel |
DebugLevel‹› | Nesting.defaultDebugLevel | determines the visibility, to show the print with debugLevel nesting use flag #debug.nesting=0 |
Returns: void
getAABB
▸ getAABB(): AABB
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/CompoundNesting.ts:125
Returns: AABB
getJointCenterAndNormalInPlateGroupCoordinates
▸ getJointCenterAndNormalInPlateGroupCoordinates(plateGroup: PlateGroup, edgeJoint: EdgeJoint): [Vector3, Vector3]
Overrides Nesting.getJointCenterAndNormalInPlateGroupCoordinates
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/CompoundNesting.ts:81
Parameters:
| Name | Type |
|---|---|
plateGroup |
PlateGroup |
edgeJoint |
EdgeJoint |
Returns: [Vector3, Vector3]
getJointHintPosition
▸ getJointHintPosition(plateGroup: PlateGroup, edgeJoint: EdgeJoint): [Vector3, number]
Inherited from Nesting.getJointHintPosition
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/Nesting.ts:181
Returns the center of the edgeJoint and the outward-facing direction as an angle in degrees.
Parameters:
| Name | Type |
|---|---|
plateGroup |
PlateGroup |
edgeJoint |
EdgeJoint |
Returns: [Vector3, number]
getMatrixFor
▸ getMatrixFor(plateGroup: PlateGroup): Matrix4
Overrides Nesting.getMatrixFor
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/CompoundNesting.ts:60
Parameters:
| Name | Type |
|---|---|
plateGroup |
PlateGroup |
Returns: Matrix4
getMatrixForNesting
▸ getMatrixForNesting(nesting: NestingElement): Matrix4
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/CompoundNesting.ts:45
Parameters:
| Name | Type |
|---|---|
nesting |
NestingElement |
Returns: Matrix4
getNestings
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/CompoundNesting.ts:30
getNewInstance
▸ getNewInstance(): CompoundNesting‹NestingElement›
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/CompoundNesting.ts:26
Returns: CompoundNesting‹NestingElement›
getOutline
▸ getOutline(): Promise‹Polygon›
Overrides Nesting.getOutline
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/CompoundNesting.ts:93
Creates a polygon representing the outline of the first nesting for compound nestings with only one nesting, calculates a polygon representing the aabb otherwise.
Returns: Promise‹Polygon›
getOutlines
▸ getOutlines(): Promise‹Polygon[]›
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/CompoundNesting.ts:112
Creates a list of polygons representing the outline for each nesting within this compound nesting.
Returns: Promise‹Polygon[]›
getPlateGroups
▸ getPlateGroups(): PlateGroup[]
Overrides Nesting.getPlateGroups
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/CompoundNesting.ts:143
Returns: PlateGroup[]
getPositionAndRotationFor
▸ getPositionAndRotationFor(plateGroup: PlateGroup): [Vector2, number]
Inherited from Nesting.getPositionAndRotationFor
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/Nesting.ts:139
Creates position + rotation from the transformation matrix that is used for internal representation
Parameters:
| Name | Type |
|---|---|
plateGroup |
PlateGroup |
Returns: [Vector2, number]
getPositionAndRotationForNesting
▸ getPositionAndRotationForNesting(nesting: NestingElement): [Vector2, number]
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/CompoundNesting.ts:50
Parameters:
| Name | Type |
|---|---|
nesting |
NestingElement |
Returns: [Vector2, number]
getRasterizedOutlinesForPlateGroup
▸ getRasterizedOutlinesForPlateGroup(plateGroup: PlateGroup): Map‹Plate, RasterizedOutlineWithHoles›
Overrides Nesting.getRasterizedOutlinesForPlateGroup
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/CompoundNesting.ts:153
Parameters:
| Name | Type |
|---|---|
plateGroup |
PlateGroup |
Returns: Map‹Plate, RasterizedOutlineWithHoles›
getSimpleNestingElementsWithPositions
▸ getSimpleNestingElementsWithPositions(): Array‹[SimpleNestingElement, Matrix4]›
Overrides Nesting.getSimpleNestingElementsWithPositions
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/CompoundNesting.ts:34
Returns: Array‹[SimpleNestingElement, Matrix4]›
hasPlateGroup
▸ hasPlateGroup(plateGroup: PlateGroup): boolean
Overrides Nesting.hasPlateGroup
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/CompoundNesting.ts:149
Parameters:
| Name | Type |
|---|---|
plateGroup |
PlateGroup |
Returns: boolean
isAtomic
▸ isAtomic(): boolean
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/CompoundNesting.ts:139
Returns: boolean
isPlateGroupMirrored
▸ isPlateGroupMirrored(plateGroup: PlateGroup): boolean
Inherited from Nesting.isPlateGroupMirrored
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/Nesting.ts:118
If this returns false, then the plateGroup outline and the plateGroup RasterizedOutline are in the same coordinate system. Otherwise, the RasterizedOutline was flipped once y-wise. (see RasterizedOutline)
Parameters:
| Name | Type |
|---|---|
plateGroup |
PlateGroup |
Returns: boolean
removeNesting
▸ removeNesting(nesting: NestingElement): void
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/CompoundNesting.ts:176
Parameters:
| Name | Type |
|---|---|
nesting |
NestingElement |
Returns: void
render
▸ render(): Promise‹void›
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/CompoundNesting.ts:204
Returns: Promise‹void›
setMatrixForNesting
▸ setMatrixForNesting(nesting: NestingElement, matrix: Matrix4): void
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/CompoundNesting.ts:55
Parameters:
| Name | Type |
|---|---|
nesting |
NestingElement |
matrix |
Matrix4 |
Returns: void