editor › Globals › OrnamentSanitizer
Class: OrnamentSanitizer
This is a helper for stabilizing and wrapping functional ornaments and edges of the plate in material, nonfunctional ornaments get clipped to achieve this.
Hierarchy
- OrnamentSanitizer
Index
Methods
- _calculateSafetyDistance
- _getClippingDataFromPlate
- _getOffsetPolygon
- _getOrnamentCutouts
- _split
- getClampedOrnamentCutouts
- getClampedOrnamentCutoutsAsynchronously
Methods
Static Private _calculateSafetyDistance
▸ _calculateSafetyDistance(point: RasterizedOutlinePoint, plate: Plate): number
Defined in src/model/visualization/textures/OrnamentSanitizer.ts:383
Parameters:
| Name | Type |
|---|---|
point |
RasterizedOutlinePoint |
plate |
Plate |
Returns: number
Static Private _getClippingDataFromPlate
▸ _getClippingDataFromPlate(plate: Plate, jointShapeChanges: any, fabricationConfig: FabricationConfig): object
Defined in src/model/visualization/textures/OrnamentSanitizer.ts:178
get all the cutouts necessary from the plate
Parameters:
| Name | Type |
|---|---|
plate |
Plate |
jointShapeChanges |
any |
fabricationConfig |
FabricationConfig |
Returns: object
-
holePolygons: Polygon[]
-
ornamentCutoutGroups: Array‹object›
-
outlinePolygon: Polygon
-
safetyAreaPolygons: Polygon[]
Static Private _getOffsetPolygon
▸ _getOffsetPolygon(polygon: ArrayPoint2[], offset: number): Polygon
Defined in src/model/visualization/textures/OrnamentSanitizer.ts:400
offset input polygon by input offset
Parameters:
| Name | Type |
|---|---|
polygon |
ArrayPoint2[] |
offset |
number |
Returns: Polygon
Static Private _getOrnamentCutouts
▸ _getOrnamentCutouts(plate: Plate): object
Defined in src/model/visualization/textures/OrnamentSanitizer.ts:298
get the ornament cutouts and divide them into functional/nonfunctional.
The resulting polygons are expected to be in plate-local (not texture) coordinates
Parameters:
| Name | Type |
|---|---|
plate |
Plate |
Returns: object
-
ornamentCutoutGroups: Array‹object›
-
safetyAreaCutouts: Polygon[]
Static Private _split
▸ _split(polygons: Polygon[], maxPointSum: number): Polygon[][]
Defined in src/model/visualization/textures/OrnamentSanitizer.ts:347
Parameters:
| Name | Type |
|---|---|
polygons |
Polygon[] |
maxPointSum |
number |
Returns: Polygon[][]
array of array of polygons. Polygons are split in groups so that each group does not exceed the summed number of points provided
Static getClampedOrnamentCutouts
▸ getClampedOrnamentCutouts(plate: Plate, jointShapeChanges: any, fabricationConfig: FabricationConfig): IOrnamentCutout[]
Defined in src/model/visualization/textures/OrnamentSanitizer.ts:50
Clamps the input texture to functional Ornaments (e.g. asset cutouts) and plate borders
Parameters:
| Name | Type | Description |
|---|---|---|
plate |
Plate | plate to clamp to |
jointShapeChanges |
any | - |
fabricationConfig |
FabricationConfig | - |
Returns: IOrnamentCutout[]
an array with clamped cutouts
Static getClampedOrnamentCutoutsAsynchronously
▸ getClampedOrnamentCutoutsAsynchronously(plate: Plate, jointShapeChanges: any, fabricationConfig: FabricationConfig): Promise‹IOrnamentCutout[]›
Defined in src/model/visualization/textures/OrnamentSanitizer.ts:106
Clamps the input texture to functional Ornaments (e.g. asset cutouts) and plate borders
Parameters:
| Name | Type | Description |
|---|---|---|
plate |
Plate | plate to clamp to |
jointShapeChanges |
any | - |
fabricationConfig |
FabricationConfig | - |
Returns: Promise‹IOrnamentCutout[]›
an array with clamped cutouts