editor › Globals › RoundCornerAnnotation
Class: RoundCornerAnnotation
This class annotates roundings on a PolygonOrnamentDescriptors corner.
Hierarchy
↳ RoundCornerAnnotation
Index
Constructors
Properties
Methods
- _determineLengthsOfCurve
- _getControlPoint
- _getStartOfCurve
- _replacePoint
- addAppliedCount
- applyMatrix
- applyOntoContainerPolygons
- applyOntoCutoutPolygons
- applyOntoPolygons
- clone
- distanceTo
- doesPointEqual
- getAppliedCount
- getPoint
- getType
- isStillApplicable
- roundPoint
- setPoint
Constructors
constructor
+ new RoundCornerAnnotation(point: ArrayPoint2, appliedCount?: number): RoundCornerAnnotation
Overrides PolygonOrnamentAnnotation.constructor
Defined in src/model/data/Concepts/RoundCornerAnnotation.ts:14
Parameters:
| Name | Type |
|---|---|
point |
ArrayPoint2 |
appliedCount? |
number |
Returns: RoundCornerAnnotation
Properties
Protected appliedCount
• appliedCount: number
Inherited from PolygonOrnamentAnnotation.appliedCount
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:21
Protected point
• point: ArrayPoint2
Inherited from PolygonOrnamentAnnotation.point
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:19
Protected type
• type: string = "RoundCorner"
Overrides PolygonOrnamentAnnotation.type
Defined in src/model/data/Concepts/RoundCornerAnnotation.ts:14
Static Private maxAmountOfRoundingApplies
▪ maxAmountOfRoundingApplies: number = 3
Defined in src/model/data/Concepts/RoundCornerAnnotation.ts:10
Static Private normingFactor
▪ normingFactor: number = 0.1
Defined in src/model/data/Concepts/RoundCornerAnnotation.ts:12
Static Private roundingStrength
▪ roundingStrength: number = 1.5
Defined in src/model/data/Concepts/RoundCornerAnnotation.ts:11
Methods
Private _determineLengthsOfCurve
▸ _determineLengthsOfCurve(prevOutline: Vector2, nextOutline: Vector2): [number, number]
Defined in src/model/data/Concepts/RoundCornerAnnotation.ts:67
Parameters:
| Name | Type |
|---|---|
prevOutline |
Vector2 |
nextOutline |
Vector2 |
Returns: [number, number]
Private _getControlPoint
▸ _getControlPoint(startOfCurve: Vector2, corner: Vector2): Vector2
Defined in src/model/data/Concepts/RoundCornerAnnotation.ts:97
Parameters:
| Name | Type | Description |
|---|---|---|
startOfCurve |
Vector2 | lerping between this point. |
corner |
Vector2 | and that point. |
Returns: Vector2
a control point around which is used to create the bezier-curve. The lerp factor is dependent on the appliedCount of this annotation which weighs in polynomially. We want to limit the amount of rounding by RoundCornerAnnotation.maxAmountOfRoundingApplies.
Private _getStartOfCurve
▸ _getStartOfCurve(pointNextToCorner: Vector2, corner: Vector2, direction: Vector2, len: number): Vector2
Defined in src/model/data/Concepts/RoundCornerAnnotation.ts:85
Parameters:
| Name | Type |
|---|---|
pointNextToCorner |
Vector2 |
corner |
Vector2 |
direction |
Vector2 |
len |
number |
Returns: Vector2
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
Inherited from PolygonOrnamentAnnotation.applyMatrix
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:60
Parameters:
| Name | Type |
|---|---|
matrix |
Matrix4 |
Returns: this
applyOntoContainerPolygons
▸ applyOntoContainerPolygons(polygons: Polygon[]): Polygon[]
Inherited from PolygonOrnamentAnnotation.applyOntoContainerPolygons
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:30
Parameters:
| Name | Type |
|---|---|
polygons |
Polygon[] |
Returns: Polygon[]
applyOntoCutoutPolygons
▸ applyOntoCutoutPolygons(polygons: Polygon[]): Polygon[]
Inherited from PolygonOrnamentAnnotation.applyOntoCutoutPolygons
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:37
Apply this annotation only for cutout polygons and only add polygons that are cutouts
Parameters:
| Name | Type |
|---|---|
polygons |
Polygon[] |
Returns: Polygon[]
applyOntoPolygons
▸ applyOntoPolygons(polygons: Polygon[]): Polygon[]
Overrides PolygonOrnamentAnnotation.applyOntoPolygons
Defined in src/model/data/Concepts/RoundCornerAnnotation.ts:25
The corner next to this annotations point is rounded depending on the appliedCount.
Parameters:
| Name | Type | Description |
|---|---|---|
polygons |
Polygon[] | array of grid polygons |
Returns: Polygon[]
polygons where the corners that equal this point are rounded
clone
▸ clone(): RoundCornerAnnotation
Overrides PolygonOrnamentAnnotation.clone
Defined in src/model/data/Concepts/RoundCornerAnnotation.ts:63
Returns: RoundCornerAnnotation
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
getPoint
▸ getPoint(): ArrayPoint2
Inherited from PolygonOrnamentAnnotation.getPoint
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:86
Returns: ArrayPoint2
getType
▸ getType(): string
Inherited from PolygonOrnamentAnnotation.getType
Defined in src/model/data/Concepts/PolygonOrnamentAnnotation.ts:82
Returns: string
isStillApplicable
▸ isStillApplicable(polygons: Polygon[]): boolean
Overrides PolygonOrnamentAnnotation.isStillApplicable
Defined in src/model/data/Concepts/RoundCornerAnnotation.ts:59
Parameters:
| Name | Type | Description |
|---|---|---|
polygons |
Polygon[] | PolygonOrnamentDescriptor patternPolygons |
Returns: boolean
whether or not the corner of this annotation still exists in the polygon
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
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