editor › Globals › SimpleNesting
Class: SimpleNesting
A very simple Nesting implementation that can map PlateGroups directly to a common 2d space.
Hierarchy
↳ SimpleNesting
Index
Constructors
Properties
Methods
- _getCenterOfPlateGroup
- _getMatrixConsideringMirroring
- _getOutlineSync
- _getPointsFromOutlineSection
- _getSectionCenter
- _getSectionNormal
- _getTransformationMatrix
- _mirrorRasterizedOutlines
- _printCompareNestingWith
- _transformDirectionWithInverse
- addLabelOnEdge
- addOutlineAsNestingElement
- addPlateGroupAt
- addPlateGroupWithMatrix
- cloneWithNewPlateGroups
- createMirroredCopy
- createMirroredCopyInDirection
- debugPrint
- getAABB
- getJointCenterAndNormalInPlateGroupCoordinates
- getJointHintPosition
- getMatrixFor
- getOutline
- getPlateGroups
- getPositionAndRotationFor
- getRasterizedOutlinesForPlateGroup
- getSimpleNestingElementsWithPositions
- hasPlateGroup
- isAtomic
- isPlateGroupMirrored
- render
- setMatrixFor
Constructors
constructor
+ new SimpleNesting(allPlateGroups: PlateGroup[]): SimpleNesting
Overrides Nesting.constructor
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/SimpleNesting.ts:19
Parameters:
| Name | Type |
|---|---|
allPlateGroups |
PlateGroup[] |
Returns: SimpleNesting
Properties
Private matrices
• matrices: Map‹PlateGroup‹›, Matrix4‹›› = new Map
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/SimpleNesting.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 plateGroupToRasterizedOutlines
• plateGroupToRasterizedOutlines: Map‹PlateGroup‹›, Map‹Plate‹›, Pick‹[RasterizedOutline‹›, RasterizedOutline‹›[]], number | "sort" | "0" | "1" | "length" | "toString" | "toLocaleString" | "pop" | "push" | "concat" | "join" | "shift" | "slice" | "splice" | "unshift" | "indexOf" | "lastIndexOf" | "every" | "some" | "forEach" | "map" | "filter" | "reduce" | "reduceRight" | "find" | "findIndex" | "fill" | "copyWithin" | "entries" | "keys" | "values" | "includes" | "flatMap" | "flat"››› = new Map
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/SimpleNesting.ts:19
Private plateGroups
• plateGroups: Set‹PlateGroup‹›› = new Set
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/SimpleNesting.ts:17
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
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
Private _getOutlineSync
▸ _getOutlineSync(): Polygon
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/SimpleNesting.ts:187
Returns: Polygon
Private _getPointsFromOutlineSection
▸ _getPointsFromOutlineSection(plateGroup: PlateGroup, section: OutlineSection): Vector3[]
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/SimpleNesting.ts:166
Parameters:
| Name | Type |
|---|---|
plateGroup |
PlateGroup |
section |
OutlineSection |
Returns: Vector3[]
Private _getSectionCenter
▸ _getSectionCenter(plateGroup: PlateGroup, section: OutlineSection): Vector3
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/SimpleNesting.ts:161
Parameters:
| Name | Type |
|---|---|
plateGroup |
PlateGroup |
section |
OutlineSection |
Returns: Vector3
Private _getSectionNormal
▸ _getSectionNormal(plateGroup: PlateGroup, section: OutlineSection): Vector3
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/SimpleNesting.ts:154
Parameters:
| Name | Type |
|---|---|
plateGroup |
PlateGroup |
section |
OutlineSection |
Returns: Vector3
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
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›
addPlateGroupAt
▸ addPlateGroupAt(plateGroup: PlateGroup, rasterizedOutlines: Map‹Plate, RasterizedOutlineWithHoles›, position: Vector3, rotation: number): void
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/SimpleNesting.ts:128
Parameters:
| Name | Type |
|---|---|
plateGroup |
PlateGroup |
rasterizedOutlines |
Map‹Plate, RasterizedOutlineWithHoles› |
position |
Vector3 |
rotation |
number |
Returns: void
addPlateGroupWithMatrix
▸ addPlateGroupWithMatrix(plateGroup: PlateGroup, rasterizedOutlines: Map‹Plate, RasterizedOutlineWithHoles›, matrix: Matrix4): void
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/SimpleNesting.ts:103
Parameters:
| Name | Type |
|---|---|
plateGroup |
PlateGroup |
rasterizedOutlines |
Map‹Plate, RasterizedOutlineWithHoles› |
matrix |
Matrix4 |
Returns: void
cloneWithNewPlateGroups
▸ cloneWithNewPlateGroups(oldToNewPlateGroups: Map‹PlateGroup, PlateGroup›): SimpleNesting
Overrides Nesting.cloneWithNewPlateGroups
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/SimpleNesting.ts:114
Parameters:
| Name | Type |
|---|---|
oldToNewPlateGroups |
Map‹PlateGroup, PlateGroup› |
Returns: SimpleNesting
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/SimpleNesting.ts:85
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/SimpleNesting.ts:81
Returns: AABB
getJointCenterAndNormalInPlateGroupCoordinates
▸ getJointCenterAndNormalInPlateGroupCoordinates(plateGroup: PlateGroup, edgeJoint: EdgeJoint): [Vector3, Vector3]
Overrides Nesting.getJointCenterAndNormalInPlateGroupCoordinates
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/SimpleNesting.ts:62
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/SimpleNesting.ts:37
Parameters:
| Name | Type |
|---|---|
plateGroup |
PlateGroup |
Returns: Matrix4
getOutline
▸ getOutline(): Promise‹Polygon›
Overrides Nesting.getOutline
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/SimpleNesting.ts:77
Creates AABB, could also be implemented to create for example a Convex Hull
Returns: Promise‹Polygon›
getPlateGroups
▸ getPlateGroups(): PlateGroup[]
Overrides Nesting.getPlateGroups
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/SimpleNesting.ts:29
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]
getRasterizedOutlinesForPlateGroup
▸ getRasterizedOutlinesForPlateGroup(plateGroup: PlateGroup): Map‹Plate, RasterizedOutlineWithHoles›
Overrides Nesting.getRasterizedOutlinesForPlateGroup
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/SimpleNesting.ts:51
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/SimpleNesting.ts:58
Returns: Array‹[SimpleNestingElement, Matrix4]›
hasPlateGroup
▸ hasPlateGroup(plateGroup: PlateGroup): boolean
Overrides Nesting.hasPlateGroup
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/SimpleNesting.ts:33
Parameters:
| Name | Type |
|---|---|
plateGroup |
PlateGroup |
Returns: boolean
isAtomic
▸ isAtomic(): boolean
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/SimpleNesting.ts:25
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
render
▸ render(): Promise‹void›
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/SimpleNesting.ts:150
Returns: Promise‹void›
setMatrixFor
▸ setMatrixFor(plateGroup: PlateGroup, matrix: Matrix4): void
Defined in src/modules/kyub.core.svgObjExporter/src/export/Nestings/SimpleNesting.ts:44
Parameters:
| Name | Type |
|---|---|
plateGroup |
PlateGroup |
matrix |
Matrix4 |
Returns: void