editor › Globals › MosaicElementAnnotation
Class: MosaicElementAnnotation
These annotations annotate a pattern and a grid container as polygons. The PolygonOrnamentDescriptor's polygons can be reconstructed out of all the MosaicElementAnnotations.
Hierarchy
↳ MosaicElementAnnotation
Index
Constructors
Properties
Methods
- _replacePoint
- addAppliedCount
- applyMatrix
- applyOntoContainerPolygons
- applyOntoCutoutPolygons
- applyOntoPolygons
- applyRotationOntoPolygons
- clone
- contains
- distanceTo
- doesPointEqual
- getAppliedCount
- getContainerPolygon
- getDarkness
- getGlobalContainerPolygon
- getMosaicType
- getPatternPolygons
- getPoint
- getProperty
- getType
- isStillApplicable
- roundPoint
- setDarkness
- setMosaicType
- setPoint
- setProperty
- _getUnionOfPolygons
Constructors
constructor
+ new MosaicElementAnnotation(point: ArrayPoint2, containerPolygon: Polygon, patternPolygons: Polygon[], mosaicType: "cutout" | "engraving", darkness: number): MosaicElementAnnotation
Overrides PolygonOrnamentAnnotation.constructor
Defined in src/model/data/Concepts/MosaicElementAnnotation.ts:26
Parameters:
| Name | Type | Description |
|---|---|---|
point |
ArrayPoint2 | where in local space of the polygon descriptor does this annotation lie |
containerPolygon |
Polygon | surrounding grid polygon of this annotation in local space. Used for alignment etc. |
patternPolygons |
Polygon[] | pattern cut inside the grid polygon in local space. Used for graphic etc. |
mosaicType |
"cutout" | "engraving" | - |
darkness |
number | - |
Returns: MosaicElementAnnotation
Properties
Protected appliedCount
• appliedCount: number
Inherited from PolygonOrnamentAnnotation.appliedCount
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:21
Private Readonly containerPolygon
• containerPolygon: Polygon
Defined in src/model/data/Concepts/MosaicElementAnnotation.ts:25
Protected darkness
• darkness: number
Defined in src/model/data/Concepts/MosaicElementAnnotation.ts:23
Protected mosaicType
• mosaicType: "cutout" | "engraving" = "cutout"
Defined in src/model/data/Concepts/MosaicElementAnnotation.ts:22
Private Readonly patternPolygons
• patternPolygons: Polygon[]
Defined in src/model/data/Concepts/MosaicElementAnnotation.ts:26
Protected point
• point: ArrayPoint2
Inherited from PolygonOrnamentAnnotation.point
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:19
Protected type
• type: string = "MosaicElement"
Overrides PolygonOrnamentAnnotation.type
Defined in src/model/data/Concepts/MosaicElementAnnotation.ts:21
Static Private inflationOffset
▪ inflationOffset: number = 3 * Config.get("modelLimits.maximumPositionPrecision")
Defined in src/model/data/Concepts/MosaicElementAnnotation.ts:15
Methods
Protected _replacePoint
▸ _replacePoint(polygon: Polygon, idx: number, points: ArrayPoint2[]): Polygon
Inherited from PolygonOrnamentAnnotation._replacePoint
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:98
Parameters:
| Name | Type |
|---|---|
polygon |
Polygon |
idx |
number |
points |
ArrayPoint2[] |
Returns: Polygon
addAppliedCount
▸ addAppliedCount(): void
Inherited from PolygonOrnamentAnnotation.addAppliedCount
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:94
Returns: void
applyMatrix
▸ applyMatrix(matrix: Matrix4): this
Overrides PolygonOrnamentAnnotation.applyMatrix
Defined in src/model/data/Concepts/MosaicElementAnnotation.ts:115
Parameters:
| Name | Type |
|---|---|
matrix |
Matrix4 |
Returns: this
applyOntoContainerPolygons
▸ applyOntoContainerPolygons(polygons: Polygon[]): Polygon[]
Overrides PolygonOrnamentAnnotation.applyOntoContainerPolygons
Defined in src/model/data/Concepts/MosaicElementAnnotation.ts:99
A PolygonOrnamentDescriptor applies this method on all of its MosaicElementAnnotations. It always passes the last result as the "polygons" of the new method call. This leeds to all the MosaicElementAnnotations containerPolygons being incrementally merged into the final container.
Parameters:
| Name | Type | Description |
|---|---|---|
polygons |
Polygon[] | given an existing array of polygons |
Returns: Polygon[]
new polygons where the grid polygons of this Annotation are merged with the given polygons.
applyOntoCutoutPolygons
▸ applyOntoCutoutPolygons(polygons: Polygon[]): Polygon[]
Overrides PolygonOrnamentAnnotation.applyOntoCutoutPolygons
Defined in src/model/data/Concepts/MosaicElementAnnotation.ts:70
A PolygonOrnamentDescriptor applies this method on all of its MosaicElementAnnotations. It always passes the last result as the "polygons" of the new method call. This leeds to all the MosaicElementAnnotations cutoutPolygons being incrementally merged into the final cutout.
Parameters:
| Name | Type | Description |
|---|---|---|
polygons |
Polygon[] | given an existing array of polygons |
Returns: Polygon[]
new polygons where the cutout polygons are merged
applyOntoPolygons
▸ applyOntoPolygons(polygons: Polygon[]): Polygon[]
Inherited from PolygonOrnamentAnnotation.applyOntoPolygons
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:44
Apply this annotation to the given polygons
Parameters:
| Name | Type |
|---|---|
polygons |
Polygon[] |
Returns: Polygon[]
applyRotationOntoPolygons
▸ applyRotationOntoPolygons(quaternion: Quaternion): this
Defined in src/model/data/Concepts/MosaicElementAnnotation.ts:124
Parameters:
| Name | Type |
|---|---|
quaternion |
Quaternion |
Returns: this
clone
▸ clone(): MosaicElementAnnotation
Overrides PolygonOrnamentAnnotation.clone
Defined in src/model/data/Concepts/MosaicElementAnnotation.ts:188
Returns: MosaicElementAnnotation
contains
▸ contains(point: ReadonlyVector3, epsilon: number): boolean
Defined in src/model/data/Concepts/MosaicElementAnnotation.ts:205
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
point |
ReadonlyVector3 | - | a (2D) Point in the local coordinate system of the annotation. |
epsilon |
number | 0 | The epsilon accuracy to check for "insideness", defaults to 0. Notice: leaving the default to 0 will use a raycast algorithm, which is fast but unstable for points exactly on the outline / hole's outlines. |
Returns: boolean
wether the given point lies inside the containerPolygon
distanceTo
▸ distanceTo(localPosition: Vector3): number
Inherited from PolygonOrnamentAnnotation.distanceTo
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:56
Parameters:
| Name | Type |
|---|---|
localPosition |
Vector3 |
Returns: number
doesPointEqual
▸ doesPointEqual(x: number, y: number): boolean
Inherited from PolygonOrnamentAnnotation.doesPointEqual
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:52
Parameters:
| Name | Type |
|---|---|
x |
number |
y |
number |
Returns: boolean
getAppliedCount
▸ getAppliedCount(): number
Inherited from PolygonOrnamentAnnotation.getAppliedCount
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:90
Returns: number
getContainerPolygon
▸ getContainerPolygon(): Polygon
Defined in src/model/data/Concepts/MosaicElementAnnotation.ts:131
Returns: Polygon
getDarkness
▸ getDarkness(): number
Defined in src/model/data/Concepts/MosaicElementAnnotation.ts:158
Returns: number
getGlobalContainerPolygon
▸ getGlobalContainerPolygon(): Polygon
Defined in src/model/data/Concepts/MosaicElementAnnotation.ts:139
Returns: Polygon
getMosaicType
▸ getMosaicType(): "cutout" | "engraving"
Defined in src/model/data/Concepts/MosaicElementAnnotation.ts:147
Returns: "cutout" | "engraving"
getPatternPolygons
▸ getPatternPolygons(): Polygon[]
Defined in src/model/data/Concepts/MosaicElementAnnotation.ts:135
Returns: Polygon[]
getPoint
▸ getPoint(): ArrayPoint2
Inherited from PolygonOrnamentAnnotation.getPoint
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:86
Returns: ArrayPoint2
getProperty
▸ getProperty(property: "type" | "darkness"): any
Defined in src/model/data/Concepts/MosaicElementAnnotation.ts:162
Parameters:
| Name | Type |
|---|---|
property |
"type" | "darkness" |
Returns: any
getType
▸ getType(): string
Inherited from PolygonOrnamentAnnotation.getType
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:82
Returns: string
isStillApplicable
▸ isStillApplicable(polygons: Polygon[]): boolean
Inherited from PolygonOrnamentAnnotation.isStillApplicable
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:48
Parameters:
| Name | Type |
|---|---|
polygons |
Polygon[] |
Returns: boolean
roundPoint
▸ roundPoint(precision: number): this
Inherited from PolygonOrnamentAnnotation.roundPoint
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:73
Parameters:
| Name | Type | Default |
|---|---|---|
precision |
number | 1 |
Returns: this
setDarkness
▸ setDarkness(darkness: number): void
Defined in src/model/data/Concepts/MosaicElementAnnotation.ts:154
Updates the darkness of the annotation
Parameters:
| Name | Type |
|---|---|
darkness |
number |
Returns: void
setMosaicType
▸ setMosaicType(type: "cutout" | "engraving"): void
Defined in src/model/data/Concepts/MosaicElementAnnotation.ts:143
Parameters:
| Name | Type |
|---|---|
type |
"cutout" | "engraving" |
Returns: void
setPoint
▸ setPoint(point: ArrayPoint2): this
Inherited from PolygonOrnamentAnnotation.setPoint
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:67
Parameters:
| Name | Type |
|---|---|
point |
ArrayPoint2 |
Returns: this
setProperty
▸ setProperty(property: "type" | "darkness", value: any): void
Defined in src/model/data/Concepts/MosaicElementAnnotation.ts:173
Parameters:
| Name | Type |
|---|---|
property |
"type" | "darkness" |
value |
any |
Returns: void
Static Private _getUnionOfPolygons
▸ _getUnionOfPolygons(polygons: MultiPolygon): Polygon[]
Defined in src/model/data/Concepts/MosaicElementAnnotation.ts:17
Parameters:
| Name | Type |
|---|---|
polygons |
MultiPolygon |
Returns: Polygon[]