Skip to content

editorGlobalsRemotePackaideNester

Class: RemotePackaideNester

A nester computing placement suggestions utilizing a remote nesting service.

Hierarchy

  • RemotePackaideNester

Index

Properties

Methods

Properties

Static Private endpointUrl

endpointUrl: string = Config.get("general.apiRoot") + "api/v1/nest"

Defined in src/modules/kyub.core.svgObjExporter/src/manualNesting/RemotePackaideNester.ts:34

Methods

Static Private _createNestingSuggestion

_createNestingSuggestion(centeredOutline: Polygon, sheetPolygons: Polygon[], sheetToOriginTransforms: Matrix4[], partToPositive: Matrix4, partOutline: Polygon, currentNesting: Nesting, globalOrigin: ReadonlyVector3, heuristic: PlacementHeuristic): PromiseNestingSuggestion

Defined in src/modules/kyub.core.svgObjExporter/src/manualNesting/RemotePackaideNester.ts:94

Parameters:

Name Type
centeredOutline Polygon
sheetPolygons Polygon[]
sheetToOriginTransforms Matrix4[]
partToPositive Matrix4
partOutline Polygon
currentNesting Nesting
globalOrigin ReadonlyVector3
heuristic PlacementHeuristic

Returns: PromiseNestingSuggestion


Static Private _decodeTransforms

_decodeTransforms(transforms: [number, number, number, number, number]): Matrix4

Defined in src/modules/kyub.core.svgObjExporter/src/manualNesting/RemotePackaideNester.ts:186

Transform is encoded as translation, rotation angle and rotation center

Parameters:

Name Type Description
transforms [number, number, number, number, number] The encoded transforms following the schema [x, y, angle, cx, cy]

Returns: Matrix4

The decoded transform as matrix.


Static Private _queryServer

_queryServer(partPolygons: Polygon[], sheetPolygons: Polygon[], heuristic: PlacementHeuristic): Promise‹Array‹Array‹Matrix4 | null›››

Defined in src/modules/kyub.core.svgObjExporter/src/manualNesting/RemotePackaideNester.ts:141

Queries a request to the packaide server receiving a placement as translation and rotation for the given parts and the given sheet.

Parameters:

Name Type Default Description
partPolygons Polygon[] - Polygons representing the parts for which placements should be computed.
sheetPolygons Polygon[] - The sheets to place the parts on, possibly containing holes which will be respected.
heuristic PlacementHeuristic PlacementHeuristic.BoundingBox The heuristic which will be used to compute the placement.

Returns: Promise‹Array‹Array‹Matrix4 | null›››

a transform matrix for each given part which encodes the part's tranlsation and rotation. Null if the part could not be placed.


Static getNestingSuggestions

getNestingSuggestions(sheetPolygons: Polygon[], partNesting: Nesting, globalOrigin: ReadonlyVector3): PromiseNestingSuggestion[]›

Defined in src/modules/kyub.core.svgObjExporter/src/manualNesting/RemotePackaideNester.ts:47

Computes for a given part and sheet possible placement suggestions according to different heuristics. Other placed parts can be specified by setting them as hole on the sheet polygons, so they are respected by the placement suggestions.

Parameters:

Name Type Default Description
sheetPolygons Polygon[] - The sheet polygons in world space. Holes are respected during nesting.
partNesting Nesting - The part placement suggestions should be computed for.
globalOrigin ReadonlyVector3 new Vector3() Specifying the global nesting offset.

Returns: PromiseNestingSuggestion[]›

A list containing placement suggestions.