Skip to content

editor › Globals › MosaicElementCutout

Class: MosaicElementCutout

The MosaicElementCutouts are part of a {@see MosaicElementContainer} and describe a cutout that is cut out inside a container. It can be the entire container polygon, a specific part of the container polygon or an empty polygon (a spacer). This is defined by the union of the polygons in the polygon array. We store the cutouts rotated around the different rotation angles of the MosaicElementContainer.

This is not an instance of a cutout but only a definition/general description of one. The actual cutouts are made in {@see PolygonOrnamentDescriptor} and its {@see MosaicElementAnnotation}. This description is also used for mosaic alignment (AlignmentHelper) and the definition of the icons of the mosaic menu {@see MenuItem}.

Hierarchy

  • MosaicElementCutout

↳ SpacerMosaicElement

Index

Constructors

Properties

Methods

Constructors

constructor

+ new MosaicElementCutout(id: string, container: MosaicElementContainer, polygons: Polygon[], isRotatableCutout: boolean): MosaicElementCutout

Defined in src/modules/kyub.core.plateOrnaments/src/MosaicElementOrnaments/MosaicElementCutout.ts:44

Parameters:

Name Type Default Description
id string - of the cutout
container MosaicElementContainer - the MosaicElementContainer in which this cutout is defined
polygons Polygon[] - the polygons that define the cutout
isRotatableCutout boolean true does it change the polygons if you rotate the given polygons around the rotationAnglesOfCutout of the mosaicElementContainer? for circles: false. This will lead to rotatedCutouts only containing the given polygons and no other rotations.

Returns: MosaicElementCutout

Properties

Private container

• container: MosaicElementContainer

Defined in src/modules/kyub.core.plateOrnaments/src/MosaicElementOrnaments/MosaicElementCutout.ts:41


Readonly id

• id: string

Defined in src/modules/kyub.core.plateOrnaments/src/MosaicElementOrnaments/MosaicElementCutout.ts:39


Private polygons

• polygons: Polygon[]

Defined in src/modules/kyub.core.plateOrnaments/src/MosaicElementOrnaments/MosaicElementCutout.ts:43


Private Readonly rotatedCutouts

• rotatedCutouts: IRotatedMosaicElementCutout[]

Defined in src/modules/kyub.core.plateOrnaments/src/MosaicElementOrnaments/MosaicElementCutout.ts:44

Methods

Private _arePolygonsOutlinesDifferent

▸ _arePolygonsOutlinesDifferent(polygonA: Polygon, polygonB: Polygon): boolean

Defined in src/modules/kyub.core.plateOrnaments/src/MosaicElementOrnaments/MosaicElementCutout.ts:208

Parameters:

Name Type
polygonA Polygon
polygonB Polygon

Returns: boolean


Private _calculateOuterLineIntersections

▸ _calculateOuterLineIntersections(): Line3[]

Defined in src/modules/kyub.core.plateOrnaments/src/MosaicElementOrnaments/MosaicElementCutout.ts:176

Returns: Line3[]

the array of lines of the cutout outline that touch the container.


Private _createRotatedMosaicElementCutouts

▸ _createRotatedMosaicElementCutouts(angles: number[], isRotatableCutout: boolean): IRotatedMosaicElementCutout[]

Defined in src/modules/kyub.core.plateOrnaments/src/MosaicElementOrnaments/MosaicElementCutout.ts:122

Parameters:

Name Type Description
angles number[] for each given angle we create a RotatedMosaicElementCutout which contains the polygons rotated by that angle.
isRotatableCutout boolean should the polygons be rotated at all?

Returns: IRotatedMosaicElementCutout[]


getAABB

▸ getAABB(): AABB

Defined in src/modules/kyub.core.plateOrnaments/src/MosaicElementOrnaments/MosaicElementCutout.ts:88

Returns: AABB


getPolygons

▸ getPolygons(): Polygon[]

Defined in src/modules/kyub.core.plateOrnaments/src/MosaicElementOrnaments/MosaicElementCutout.ts:106

Returns: Polygon[]


getRotatedCutouts

▸ getRotatedCutouts(): IRotatedMosaicElementCutout[]

Defined in src/modules/kyub.core.plateOrnaments/src/MosaicElementOrnaments/MosaicElementCutout.ts:110

Returns: IRotatedMosaicElementCutout[]


getUnscaledPolygons

▸ getUnscaledPolygons(): Polygon[]

Defined in src/modules/kyub.core.plateOrnaments/src/MosaicElementOrnaments/MosaicElementCutout.ts:95

Returns: Polygon[]

polygons as if they had not been scaled by their container type


isSpacer

▸ isSpacer(): boolean

Defined in src/modules/kyub.core.plateOrnaments/src/MosaicElementOrnaments/MosaicElementCutout.ts:114

Returns: boolean


rotatePolygons

▸ rotatePolygons(quaternion: Quaternion): Polygon[]

Defined in src/modules/kyub.core.plateOrnaments/src/MosaicElementOrnaments/MosaicElementCutout.ts:80

clones and rotates the polygons

Parameters:

Name Type
quaternion Quaternion

Returns: Polygon[]

cloned polygons


scale

▸ scale(scale: Vector3): void

Defined in src/modules/kyub.core.plateOrnaments/src/MosaicElementOrnaments/MosaicElementCutout.ts:65

Parameters:

Name Type
scale Vector3

Returns: void