@bitbybit-dev/base 0.20.0 → 0.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/inputs/base-inputs.d.ts +35 -0
- package/lib/api/inputs/base-inputs.js +19 -1
- package/lib/api/inputs/point-inputs.d.ts +23 -0
- package/lib/api/inputs/point-inputs.js +22 -0
- package/lib/api/inputs/text-inputs.d.ts +106 -0
- package/lib/api/inputs/text-inputs.js +141 -0
- package/lib/api/inputs/vector-inputs.d.ts +20 -0
- package/lib/api/inputs/vector-inputs.js +21 -0
- package/lib/api/models/index.d.ts +1 -0
- package/lib/api/models/index.js +1 -0
- package/lib/api/models/simplex.d.ts +206 -0
- package/lib/api/models/simplex.js +112 -0
- package/lib/api/models/text/bucket.d.ts +2 -0
- package/lib/api/models/text/bucket.js +2 -0
- package/lib/api/models/text/index.d.ts +1 -0
- package/lib/api/models/text/index.js +1 -0
- package/lib/api/models/text/vector-char-data.d.ts +19 -0
- package/lib/api/models/text/vector-char-data.js +13 -0
- package/lib/api/models/text/vector-text-data.d.ts +19 -0
- package/lib/api/models/text/vector-text-data.js +13 -0
- package/lib/api/services/point.d.ts +21 -1
- package/lib/api/services/point.js +79 -1
- package/lib/api/services/text.d.ts +24 -0
- package/lib/api/services/text.js +157 -0
- package/lib/api/services/vector.d.ts +9 -0
- package/lib/api/services/vector.js +11 -0
- package/package.json +1 -1
|
@@ -10,6 +10,27 @@ export declare namespace Base {
|
|
|
10
10
|
type Vector2 = [number, number];
|
|
11
11
|
type Point3 = [number, number, number];
|
|
12
12
|
type Vector3 = [number, number, number];
|
|
13
|
+
type Axis3 = {
|
|
14
|
+
origin: Base.Point3;
|
|
15
|
+
direction: Base.Vector3;
|
|
16
|
+
};
|
|
17
|
+
type Axis2 = {
|
|
18
|
+
origin: Base.Point2;
|
|
19
|
+
direction: Base.Vector2;
|
|
20
|
+
};
|
|
21
|
+
type Plane3 = {
|
|
22
|
+
origin: Base.Point3;
|
|
23
|
+
normal: Base.Vector3;
|
|
24
|
+
direction: Base.Vector3;
|
|
25
|
+
};
|
|
26
|
+
type BoundingBox = {
|
|
27
|
+
min: Base.Point3;
|
|
28
|
+
max: Base.Point3;
|
|
29
|
+
center?: Base.Point3;
|
|
30
|
+
width?: number;
|
|
31
|
+
height?: number;
|
|
32
|
+
length?: number;
|
|
33
|
+
};
|
|
13
34
|
type Line2 = {
|
|
14
35
|
start: Base.Point2;
|
|
15
36
|
end: Base.Point2;
|
|
@@ -32,4 +53,18 @@ export declare namespace Base {
|
|
|
32
53
|
type TransformMatrixes3x3 = TransformMatrix3x3[];
|
|
33
54
|
type TransformMatrix = [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number];
|
|
34
55
|
type TransformMatrixes = TransformMatrix[];
|
|
56
|
+
enum horizontalAlignEnum {
|
|
57
|
+
/**
|
|
58
|
+
* Aligns to the left
|
|
59
|
+
*/
|
|
60
|
+
left = "left",
|
|
61
|
+
/**
|
|
62
|
+
* Aligns to the center
|
|
63
|
+
*/
|
|
64
|
+
center = "center",
|
|
65
|
+
/**
|
|
66
|
+
* Aligns to the right
|
|
67
|
+
*/
|
|
68
|
+
right = "right"
|
|
69
|
+
}
|
|
35
70
|
}
|
|
@@ -1 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-namespace */
|
|
2
|
+
export var Base;
|
|
3
|
+
(function (Base) {
|
|
4
|
+
let horizontalAlignEnum;
|
|
5
|
+
(function (horizontalAlignEnum) {
|
|
6
|
+
/**
|
|
7
|
+
* Aligns to the left
|
|
8
|
+
*/
|
|
9
|
+
horizontalAlignEnum["left"] = "left";
|
|
10
|
+
/**
|
|
11
|
+
* Aligns to the center
|
|
12
|
+
*/
|
|
13
|
+
horizontalAlignEnum["center"] = "center";
|
|
14
|
+
/**
|
|
15
|
+
* Aligns to the right
|
|
16
|
+
*/
|
|
17
|
+
horizontalAlignEnum["right"] = "right";
|
|
18
|
+
})(horizontalAlignEnum = Base.horizontalAlignEnum || (Base.horizontalAlignEnum = {}));
|
|
19
|
+
})(Base || (Base = {}));
|
|
@@ -291,6 +291,29 @@ export declare namespace Point {
|
|
|
291
291
|
*/
|
|
292
292
|
transformation: Base.TransformMatrixes[];
|
|
293
293
|
}
|
|
294
|
+
class ThreePointsNormalDto {
|
|
295
|
+
constructor(point1?: Base.Point3, point2?: Base.Point3, point3?: Base.Point3, reverseNormal?: boolean);
|
|
296
|
+
/**
|
|
297
|
+
* Point 1
|
|
298
|
+
* @default undefined
|
|
299
|
+
*/
|
|
300
|
+
point1: Base.Point3;
|
|
301
|
+
/**
|
|
302
|
+
* Point 2
|
|
303
|
+
* @default undefined
|
|
304
|
+
*/
|
|
305
|
+
point2: Base.Point3;
|
|
306
|
+
/**
|
|
307
|
+
* Point 3
|
|
308
|
+
* @default undefined
|
|
309
|
+
*/
|
|
310
|
+
point3: Base.Point3;
|
|
311
|
+
/**
|
|
312
|
+
* Reverse normal direction
|
|
313
|
+
* @default false
|
|
314
|
+
*/
|
|
315
|
+
reverseNormal: boolean;
|
|
316
|
+
}
|
|
294
317
|
class RemoveConsecutiveDuplicatesDto {
|
|
295
318
|
constructor(points?: Base.Point3[], tolerance?: number, checkFirstAndLast?: boolean);
|
|
296
319
|
/**
|
|
@@ -342,6 +342,28 @@ export var Point;
|
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
344
|
Point.TransformsForPointsDto = TransformsForPointsDto;
|
|
345
|
+
class ThreePointsNormalDto {
|
|
346
|
+
constructor(point1, point2, point3, reverseNormal) {
|
|
347
|
+
/**
|
|
348
|
+
* Reverse normal direction
|
|
349
|
+
* @default false
|
|
350
|
+
*/
|
|
351
|
+
this.reverseNormal = false;
|
|
352
|
+
if (point1 !== undefined) {
|
|
353
|
+
this.point1 = point1;
|
|
354
|
+
}
|
|
355
|
+
if (point2 !== undefined) {
|
|
356
|
+
this.point2 = point2;
|
|
357
|
+
}
|
|
358
|
+
if (point3 !== undefined) {
|
|
359
|
+
this.point3 = point3;
|
|
360
|
+
}
|
|
361
|
+
if (reverseNormal !== undefined) {
|
|
362
|
+
this.reverseNormal = reverseNormal;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
Point.ThreePointsNormalDto = ThreePointsNormalDto;
|
|
345
367
|
class RemoveConsecutiveDuplicatesDto {
|
|
346
368
|
constructor(points, tolerance, checkFirstAndLast) {
|
|
347
369
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Base } from "./base-inputs";
|
|
1
2
|
export declare namespace Text {
|
|
2
3
|
class TextDto {
|
|
3
4
|
constructor(text?: string);
|
|
@@ -80,4 +81,109 @@ export declare namespace Text {
|
|
|
80
81
|
*/
|
|
81
82
|
values: string[];
|
|
82
83
|
}
|
|
84
|
+
class VectorCharDto {
|
|
85
|
+
constructor(char?: string, xOffset?: number, yOffset?: number, height?: number, extrudeOffset?: number);
|
|
86
|
+
/**
|
|
87
|
+
* The text
|
|
88
|
+
* @default A
|
|
89
|
+
*/
|
|
90
|
+
char: string;
|
|
91
|
+
/**
|
|
92
|
+
* The x offset
|
|
93
|
+
* @default 0
|
|
94
|
+
* @minimum -Infinity
|
|
95
|
+
* @maximum Infinity
|
|
96
|
+
* @step 0.1
|
|
97
|
+
*/
|
|
98
|
+
xOffset?: number;
|
|
99
|
+
/**
|
|
100
|
+
* The y offset
|
|
101
|
+
* @minimum -Infinity
|
|
102
|
+
* @maximum Infinity
|
|
103
|
+
* @step 0.1
|
|
104
|
+
*/
|
|
105
|
+
yOffset?: number;
|
|
106
|
+
/**
|
|
107
|
+
* The height of the text
|
|
108
|
+
* @default 1
|
|
109
|
+
* @minimum -Infinity
|
|
110
|
+
* @maximum Infinity
|
|
111
|
+
* @step 0.1
|
|
112
|
+
*/
|
|
113
|
+
height?: number;
|
|
114
|
+
/**
|
|
115
|
+
* The extrude offset
|
|
116
|
+
* @default 0
|
|
117
|
+
* @minimum -Infinity
|
|
118
|
+
* @maximum Infinity
|
|
119
|
+
* @step 0.1
|
|
120
|
+
*/
|
|
121
|
+
extrudeOffset?: number;
|
|
122
|
+
}
|
|
123
|
+
class VectorTextDto {
|
|
124
|
+
constructor(text?: string, xOffset?: number, yOffset?: number, height?: number, lineSpacing?: number, letterSpacing?: number, align?: Base.horizontalAlignEnum, extrudeOffset?: number, centerOnOrigin?: boolean);
|
|
125
|
+
/**
|
|
126
|
+
* The text
|
|
127
|
+
* @default Hello World
|
|
128
|
+
*/
|
|
129
|
+
text?: string;
|
|
130
|
+
/**
|
|
131
|
+
* The x offset
|
|
132
|
+
* @default 0
|
|
133
|
+
* @minimum -Infinity
|
|
134
|
+
* @maximum Infinity
|
|
135
|
+
* @step 0.1
|
|
136
|
+
*/
|
|
137
|
+
xOffset?: number;
|
|
138
|
+
/**
|
|
139
|
+
* The y offset
|
|
140
|
+
* @default 0
|
|
141
|
+
* @minimum -Infinity
|
|
142
|
+
* @maximum Infinity
|
|
143
|
+
* @step 0.1
|
|
144
|
+
*/
|
|
145
|
+
yOffset?: number;
|
|
146
|
+
/**
|
|
147
|
+
* The height of the text
|
|
148
|
+
* @default 1
|
|
149
|
+
* @minimum -Infinity
|
|
150
|
+
* @maximum Infinity
|
|
151
|
+
* @step 0.1
|
|
152
|
+
*/
|
|
153
|
+
height?: number;
|
|
154
|
+
/**
|
|
155
|
+
* The line spacing
|
|
156
|
+
* @default 1.4
|
|
157
|
+
* @minimum -Infinity
|
|
158
|
+
* @maximum Infinity
|
|
159
|
+
* @step 0.1
|
|
160
|
+
*/
|
|
161
|
+
lineSpacing?: number;
|
|
162
|
+
/**
|
|
163
|
+
* The letter spacing offset
|
|
164
|
+
* @default 0
|
|
165
|
+
* @minimum -Infinity
|
|
166
|
+
* @maximum Infinity
|
|
167
|
+
* @step 0.1
|
|
168
|
+
*/
|
|
169
|
+
letterSpacing?: number;
|
|
170
|
+
/**
|
|
171
|
+
* The extrude offset
|
|
172
|
+
* @default left
|
|
173
|
+
*/
|
|
174
|
+
align?: Base.horizontalAlignEnum;
|
|
175
|
+
/**
|
|
176
|
+
* The extrude offset
|
|
177
|
+
* @default 0
|
|
178
|
+
* @minimum -Infinity
|
|
179
|
+
* @maximum Infinity
|
|
180
|
+
* @step 0.1
|
|
181
|
+
*/
|
|
182
|
+
extrudeOffset?: number;
|
|
183
|
+
/**
|
|
184
|
+
* Will center text on 0, 0, 0
|
|
185
|
+
* @default false
|
|
186
|
+
*/
|
|
187
|
+
centerOnOrigin: boolean;
|
|
188
|
+
}
|
|
83
189
|
}
|
|
@@ -117,4 +117,145 @@ export var Text;
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
Text.TextFormatDto = TextFormatDto;
|
|
120
|
+
class VectorCharDto {
|
|
121
|
+
constructor(char, xOffset, yOffset, height, extrudeOffset) {
|
|
122
|
+
/**
|
|
123
|
+
* The text
|
|
124
|
+
* @default A
|
|
125
|
+
*/
|
|
126
|
+
this.char = "A";
|
|
127
|
+
/**
|
|
128
|
+
* The x offset
|
|
129
|
+
* @default 0
|
|
130
|
+
* @minimum -Infinity
|
|
131
|
+
* @maximum Infinity
|
|
132
|
+
* @step 0.1
|
|
133
|
+
*/
|
|
134
|
+
this.xOffset = 0;
|
|
135
|
+
/**
|
|
136
|
+
* The y offset
|
|
137
|
+
* @minimum -Infinity
|
|
138
|
+
* @maximum Infinity
|
|
139
|
+
* @step 0.1
|
|
140
|
+
*/
|
|
141
|
+
this.yOffset = 0;
|
|
142
|
+
/**
|
|
143
|
+
* The height of the text
|
|
144
|
+
* @default 1
|
|
145
|
+
* @minimum -Infinity
|
|
146
|
+
* @maximum Infinity
|
|
147
|
+
* @step 0.1
|
|
148
|
+
*/
|
|
149
|
+
this.height = 1;
|
|
150
|
+
/**
|
|
151
|
+
* The extrude offset
|
|
152
|
+
* @default 0
|
|
153
|
+
* @minimum -Infinity
|
|
154
|
+
* @maximum Infinity
|
|
155
|
+
* @step 0.1
|
|
156
|
+
*/
|
|
157
|
+
this.extrudeOffset = 0;
|
|
158
|
+
if (char !== undefined) {
|
|
159
|
+
this.char = char;
|
|
160
|
+
}
|
|
161
|
+
if (xOffset !== undefined) {
|
|
162
|
+
this.xOffset = xOffset;
|
|
163
|
+
}
|
|
164
|
+
if (yOffset !== undefined) {
|
|
165
|
+
this.yOffset = yOffset;
|
|
166
|
+
}
|
|
167
|
+
if (height !== undefined) {
|
|
168
|
+
this.height = height;
|
|
169
|
+
}
|
|
170
|
+
if (extrudeOffset !== undefined) {
|
|
171
|
+
this.extrudeOffset = extrudeOffset;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
Text.VectorCharDto = VectorCharDto;
|
|
176
|
+
class VectorTextDto {
|
|
177
|
+
constructor(text, xOffset, yOffset, height, lineSpacing, letterSpacing, align, extrudeOffset, centerOnOrigin) {
|
|
178
|
+
/**
|
|
179
|
+
* The x offset
|
|
180
|
+
* @default 0
|
|
181
|
+
* @minimum -Infinity
|
|
182
|
+
* @maximum Infinity
|
|
183
|
+
* @step 0.1
|
|
184
|
+
*/
|
|
185
|
+
this.xOffset = 0;
|
|
186
|
+
/**
|
|
187
|
+
* The y offset
|
|
188
|
+
* @default 0
|
|
189
|
+
* @minimum -Infinity
|
|
190
|
+
* @maximum Infinity
|
|
191
|
+
* @step 0.1
|
|
192
|
+
*/
|
|
193
|
+
this.yOffset = 0;
|
|
194
|
+
/**
|
|
195
|
+
* The height of the text
|
|
196
|
+
* @default 1
|
|
197
|
+
* @minimum -Infinity
|
|
198
|
+
* @maximum Infinity
|
|
199
|
+
* @step 0.1
|
|
200
|
+
*/
|
|
201
|
+
this.height = 1;
|
|
202
|
+
/**
|
|
203
|
+
* The line spacing
|
|
204
|
+
* @default 1.4
|
|
205
|
+
* @minimum -Infinity
|
|
206
|
+
* @maximum Infinity
|
|
207
|
+
* @step 0.1
|
|
208
|
+
*/
|
|
209
|
+
this.lineSpacing = 1.4;
|
|
210
|
+
/**
|
|
211
|
+
* The letter spacing offset
|
|
212
|
+
* @default 0
|
|
213
|
+
* @minimum -Infinity
|
|
214
|
+
* @maximum Infinity
|
|
215
|
+
* @step 0.1
|
|
216
|
+
*/
|
|
217
|
+
this.letterSpacing = 0;
|
|
218
|
+
/**
|
|
219
|
+
* The extrude offset
|
|
220
|
+
* @default 0
|
|
221
|
+
* @minimum -Infinity
|
|
222
|
+
* @maximum Infinity
|
|
223
|
+
* @step 0.1
|
|
224
|
+
*/
|
|
225
|
+
this.extrudeOffset = 0;
|
|
226
|
+
/**
|
|
227
|
+
* Will center text on 0, 0, 0
|
|
228
|
+
* @default false
|
|
229
|
+
*/
|
|
230
|
+
this.centerOnOrigin = false;
|
|
231
|
+
if (text !== undefined) {
|
|
232
|
+
this.text = text;
|
|
233
|
+
}
|
|
234
|
+
if (xOffset !== undefined) {
|
|
235
|
+
this.xOffset = xOffset;
|
|
236
|
+
}
|
|
237
|
+
if (yOffset !== undefined) {
|
|
238
|
+
this.yOffset = yOffset;
|
|
239
|
+
}
|
|
240
|
+
if (height !== undefined) {
|
|
241
|
+
this.height = height;
|
|
242
|
+
}
|
|
243
|
+
if (lineSpacing !== undefined) {
|
|
244
|
+
this.lineSpacing = lineSpacing;
|
|
245
|
+
}
|
|
246
|
+
if (letterSpacing !== undefined) {
|
|
247
|
+
this.letterSpacing = letterSpacing;
|
|
248
|
+
}
|
|
249
|
+
if (align !== undefined) {
|
|
250
|
+
this.align = align;
|
|
251
|
+
}
|
|
252
|
+
if (extrudeOffset !== undefined) {
|
|
253
|
+
this.extrudeOffset = extrudeOffset;
|
|
254
|
+
}
|
|
255
|
+
if (centerOnOrigin !== undefined) {
|
|
256
|
+
this.centerOnOrigin = centerOnOrigin;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
Text.VectorTextDto = VectorTextDto;
|
|
120
261
|
})(Text || (Text = {}));
|
|
@@ -57,6 +57,26 @@ export declare namespace Vector {
|
|
|
57
57
|
*/
|
|
58
58
|
tolerance: number;
|
|
59
59
|
}
|
|
60
|
+
class VectorsTheSameDto {
|
|
61
|
+
constructor(vec1?: number[], vec2?: number[], tolerance?: number);
|
|
62
|
+
/**
|
|
63
|
+
* First vector
|
|
64
|
+
* @default undefined
|
|
65
|
+
*/
|
|
66
|
+
vec1: number[];
|
|
67
|
+
/**
|
|
68
|
+
* Second vector
|
|
69
|
+
* @default undefined
|
|
70
|
+
*/
|
|
71
|
+
vec2: number[];
|
|
72
|
+
/**
|
|
73
|
+
* Tolerance value
|
|
74
|
+
* @default 1e-7
|
|
75
|
+
* @minimum 0
|
|
76
|
+
* @maximum Infinity
|
|
77
|
+
*/
|
|
78
|
+
tolerance: number;
|
|
79
|
+
}
|
|
60
80
|
class VectorDto {
|
|
61
81
|
constructor(vector?: number[]);
|
|
62
82
|
/**
|
|
@@ -64,6 +64,27 @@ export var Vector;
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
Vector.RemoveConsecutiveDuplicateVectorsDto = RemoveConsecutiveDuplicateVectorsDto;
|
|
67
|
+
class VectorsTheSameDto {
|
|
68
|
+
constructor(vec1, vec2, tolerance) {
|
|
69
|
+
/**
|
|
70
|
+
* Tolerance value
|
|
71
|
+
* @default 1e-7
|
|
72
|
+
* @minimum 0
|
|
73
|
+
* @maximum Infinity
|
|
74
|
+
*/
|
|
75
|
+
this.tolerance = 1e-7;
|
|
76
|
+
if (vec1 !== undefined) {
|
|
77
|
+
this.vec1 = vec1;
|
|
78
|
+
}
|
|
79
|
+
if (vec2 !== undefined) {
|
|
80
|
+
this.vec2 = vec2;
|
|
81
|
+
}
|
|
82
|
+
if (tolerance !== undefined) {
|
|
83
|
+
this.tolerance = tolerance;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
Vector.VectorsTheSameDto = VectorsTheSameDto;
|
|
67
88
|
class VectorDto {
|
|
68
89
|
constructor(vector) {
|
|
69
90
|
if (vector !== undefined) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./text";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./text";
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
export declare const simplex: {
|
|
2
|
+
height: number;
|
|
3
|
+
32: number[];
|
|
4
|
+
33: number[];
|
|
5
|
+
34: number[];
|
|
6
|
+
35: number[];
|
|
7
|
+
36: number[];
|
|
8
|
+
37: number[];
|
|
9
|
+
38: number[];
|
|
10
|
+
39: number[];
|
|
11
|
+
40: number[];
|
|
12
|
+
41: number[];
|
|
13
|
+
42: number[];
|
|
14
|
+
43: number[];
|
|
15
|
+
44: number[];
|
|
16
|
+
45: number[];
|
|
17
|
+
46: number[];
|
|
18
|
+
47: number[];
|
|
19
|
+
48: number[];
|
|
20
|
+
49: number[];
|
|
21
|
+
50: number[];
|
|
22
|
+
51: number[];
|
|
23
|
+
52: number[];
|
|
24
|
+
53: number[];
|
|
25
|
+
54: number[];
|
|
26
|
+
55: number[];
|
|
27
|
+
56: number[];
|
|
28
|
+
57: number[];
|
|
29
|
+
58: number[];
|
|
30
|
+
59: number[];
|
|
31
|
+
60: number[];
|
|
32
|
+
61: number[];
|
|
33
|
+
62: number[];
|
|
34
|
+
63: number[];
|
|
35
|
+
64: number[];
|
|
36
|
+
65: number[];
|
|
37
|
+
66: number[];
|
|
38
|
+
67: number[];
|
|
39
|
+
68: number[];
|
|
40
|
+
69: number[];
|
|
41
|
+
70: number[];
|
|
42
|
+
71: number[];
|
|
43
|
+
72: number[];
|
|
44
|
+
73: number[];
|
|
45
|
+
74: number[];
|
|
46
|
+
75: number[];
|
|
47
|
+
76: number[];
|
|
48
|
+
77: number[];
|
|
49
|
+
78: number[];
|
|
50
|
+
79: number[];
|
|
51
|
+
80: number[];
|
|
52
|
+
81: number[];
|
|
53
|
+
82: number[];
|
|
54
|
+
83: number[];
|
|
55
|
+
84: number[];
|
|
56
|
+
85: number[];
|
|
57
|
+
86: number[];
|
|
58
|
+
87: number[];
|
|
59
|
+
88: number[];
|
|
60
|
+
89: number[];
|
|
61
|
+
90: number[];
|
|
62
|
+
91: number[];
|
|
63
|
+
92: number[];
|
|
64
|
+
93: number[];
|
|
65
|
+
94: number[];
|
|
66
|
+
95: number[];
|
|
67
|
+
96: number[];
|
|
68
|
+
97: number[];
|
|
69
|
+
98: number[];
|
|
70
|
+
99: number[];
|
|
71
|
+
100: number[];
|
|
72
|
+
101: number[];
|
|
73
|
+
102: number[];
|
|
74
|
+
103: number[];
|
|
75
|
+
104: number[];
|
|
76
|
+
105: number[];
|
|
77
|
+
106: number[];
|
|
78
|
+
107: number[];
|
|
79
|
+
108: number[];
|
|
80
|
+
109: number[];
|
|
81
|
+
110: number[];
|
|
82
|
+
111: number[];
|
|
83
|
+
112: number[];
|
|
84
|
+
113: number[];
|
|
85
|
+
114: number[];
|
|
86
|
+
115: number[];
|
|
87
|
+
116: number[];
|
|
88
|
+
117: number[];
|
|
89
|
+
118: number[];
|
|
90
|
+
119: number[];
|
|
91
|
+
120: number[];
|
|
92
|
+
121: number[];
|
|
93
|
+
122: number[];
|
|
94
|
+
123: number[];
|
|
95
|
+
124: number[];
|
|
96
|
+
125: number[];
|
|
97
|
+
126: number[];
|
|
98
|
+
};
|
|
99
|
+
export declare const defaultsVectorParams: {
|
|
100
|
+
xOffset: number;
|
|
101
|
+
yOffset: number;
|
|
102
|
+
input: string;
|
|
103
|
+
align: string;
|
|
104
|
+
font: {
|
|
105
|
+
height: number;
|
|
106
|
+
32: number[];
|
|
107
|
+
33: number[];
|
|
108
|
+
34: number[];
|
|
109
|
+
35: number[];
|
|
110
|
+
36: number[];
|
|
111
|
+
37: number[];
|
|
112
|
+
38: number[];
|
|
113
|
+
39: number[];
|
|
114
|
+
40: number[];
|
|
115
|
+
41: number[];
|
|
116
|
+
42: number[];
|
|
117
|
+
43: number[];
|
|
118
|
+
44: number[];
|
|
119
|
+
45: number[];
|
|
120
|
+
46: number[];
|
|
121
|
+
47: number[];
|
|
122
|
+
48: number[];
|
|
123
|
+
49: number[];
|
|
124
|
+
50: number[];
|
|
125
|
+
51: number[];
|
|
126
|
+
52: number[];
|
|
127
|
+
53: number[];
|
|
128
|
+
54: number[];
|
|
129
|
+
55: number[];
|
|
130
|
+
56: number[];
|
|
131
|
+
57: number[];
|
|
132
|
+
58: number[];
|
|
133
|
+
59: number[];
|
|
134
|
+
60: number[];
|
|
135
|
+
61: number[];
|
|
136
|
+
62: number[];
|
|
137
|
+
63: number[];
|
|
138
|
+
64: number[];
|
|
139
|
+
65: number[];
|
|
140
|
+
66: number[];
|
|
141
|
+
67: number[];
|
|
142
|
+
68: number[];
|
|
143
|
+
69: number[];
|
|
144
|
+
70: number[];
|
|
145
|
+
71: number[];
|
|
146
|
+
72: number[];
|
|
147
|
+
73: number[];
|
|
148
|
+
74: number[];
|
|
149
|
+
75: number[];
|
|
150
|
+
76: number[];
|
|
151
|
+
77: number[];
|
|
152
|
+
78: number[];
|
|
153
|
+
79: number[];
|
|
154
|
+
80: number[];
|
|
155
|
+
81: number[];
|
|
156
|
+
82: number[];
|
|
157
|
+
83: number[];
|
|
158
|
+
84: number[];
|
|
159
|
+
85: number[];
|
|
160
|
+
86: number[];
|
|
161
|
+
87: number[];
|
|
162
|
+
88: number[];
|
|
163
|
+
89: number[];
|
|
164
|
+
90: number[];
|
|
165
|
+
91: number[];
|
|
166
|
+
92: number[];
|
|
167
|
+
93: number[];
|
|
168
|
+
94: number[];
|
|
169
|
+
95: number[];
|
|
170
|
+
96: number[];
|
|
171
|
+
97: number[];
|
|
172
|
+
98: number[];
|
|
173
|
+
99: number[];
|
|
174
|
+
100: number[];
|
|
175
|
+
101: number[];
|
|
176
|
+
102: number[];
|
|
177
|
+
103: number[];
|
|
178
|
+
104: number[];
|
|
179
|
+
105: number[];
|
|
180
|
+
106: number[];
|
|
181
|
+
107: number[];
|
|
182
|
+
108: number[];
|
|
183
|
+
109: number[];
|
|
184
|
+
110: number[];
|
|
185
|
+
111: number[];
|
|
186
|
+
112: number[];
|
|
187
|
+
113: number[];
|
|
188
|
+
114: number[];
|
|
189
|
+
115: number[];
|
|
190
|
+
116: number[];
|
|
191
|
+
117: number[];
|
|
192
|
+
118: number[];
|
|
193
|
+
119: number[];
|
|
194
|
+
120: number[];
|
|
195
|
+
121: number[];
|
|
196
|
+
122: number[];
|
|
197
|
+
123: number[];
|
|
198
|
+
124: number[];
|
|
199
|
+
125: number[];
|
|
200
|
+
126: number[];
|
|
201
|
+
};
|
|
202
|
+
height: number;
|
|
203
|
+
lineSpacing: number;
|
|
204
|
+
letterSpacing: number;
|
|
205
|
+
extrudeOffset: number;
|
|
206
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// -- data source from from http://paulbourke.net/dataformats/hershey/
|
|
2
|
+
// -- original source form openjscad github repo https://github.com/jscad/OpenJSCAD.org (MIT License)
|
|
3
|
+
// { [ascii code]: [width, x, y, ...] } - undefined value as path separator
|
|
4
|
+
export const simplex = {
|
|
5
|
+
height: 21,
|
|
6
|
+
32: [16],
|
|
7
|
+
33: [10, 5, 21, 5, 7, undefined, 5, 2, 4, 1, 5, 0, 6, 1, 5, 2],
|
|
8
|
+
34: [16, 4, 21, 4, 14, undefined, 12, 21, 12, 14],
|
|
9
|
+
35: [21, 11, 25, 4, -7, undefined, 17, 25, 10, -7, undefined, 4, 12, 18, 12, undefined, 3, 6, 17, 6],
|
|
10
|
+
36: [20, 8, 25, 8, -4, undefined, 12, 25, 12, -4, undefined, 17, 18, 15, 20, 12, 21, 8, 21, 5, 20, 3, 18, 3, 16, 4, 14, 5, 13, 7, 12, 13, 10, 15, 9, 16, 8, 17, 6, 17, 3, 15, 1, 12, 0, 8, 0, 5, 1, 3, 3],
|
|
11
|
+
37: [24, 21, 21, 3, 0, undefined, 8, 21, 10, 19, 10, 17, 9, 15, 7, 14, 5, 14, 3, 16, 3, 18, 4, 20, 6, 21, 8, 21, 10, 20, 13, 19, 16, 19, 19, 20, 21, 21, undefined, 17, 7, 15, 6, 14, 4, 14, 2, 16, 0, 18, 0, 20, 1, 21, 3, 21, 5, 19, 7, 17, 7],
|
|
12
|
+
38: [26, 23, 12, 23, 13, 22, 14, 21, 14, 20, 13, 19, 11, 17, 6, 15, 3, 13, 1, 11, 0, 7, 0, 5, 1, 4, 2, 3, 4, 3, 6, 4, 8, 5, 9, 12, 13, 13, 14, 14, 16, 14, 18, 13, 20, 11, 21, 9, 20, 8, 18, 8, 16, 9, 13, 11, 10, 16, 3, 18, 1, 20, 0, 22, 0, 23, 1, 23, 2],
|
|
13
|
+
39: [10, 5, 19, 4, 20, 5, 21, 6, 20, 6, 18, 5, 16, 4, 15],
|
|
14
|
+
40: [14, 11, 25, 9, 23, 7, 20, 5, 16, 4, 11, 4, 7, 5, 2, 7, -2, 9, -5, 11, -7],
|
|
15
|
+
41: [14, 3, 25, 5, 23, 7, 20, 9, 16, 10, 11, 10, 7, 9, 2, 7, -2, 5, -5, 3, -7],
|
|
16
|
+
42: [16, 8, 21, 8, 9, undefined, 3, 18, 13, 12, undefined, 13, 18, 3, 12],
|
|
17
|
+
43: [26, 13, 18, 13, 0, undefined, 4, 9, 22, 9],
|
|
18
|
+
44: [10, 6, 1, 5, 0, 4, 1, 5, 2, 6, 1, 6, -1, 5, -3, 4, -4],
|
|
19
|
+
45: [26, 4, 9, 22, 9],
|
|
20
|
+
46: [10, 5, 2, 4, 1, 5, 0, 6, 1, 5, 2],
|
|
21
|
+
47: [22, 20, 25, 2, -7],
|
|
22
|
+
48: [20, 9, 21, 6, 20, 4, 17, 3, 12, 3, 9, 4, 4, 6, 1, 9, 0, 11, 0, 14, 1, 16, 4, 17, 9, 17, 12, 16, 17, 14, 20, 11, 21, 9, 21],
|
|
23
|
+
49: [20, 6, 17, 8, 18, 11, 21, 11, 0],
|
|
24
|
+
50: [20, 4, 16, 4, 17, 5, 19, 6, 20, 8, 21, 12, 21, 14, 20, 15, 19, 16, 17, 16, 15, 15, 13, 13, 10, 3, 0, 17, 0],
|
|
25
|
+
51: [20, 5, 21, 16, 21, 10, 13, 13, 13, 15, 12, 16, 11, 17, 8, 17, 6, 16, 3, 14, 1, 11, 0, 8, 0, 5, 1, 4, 2, 3, 4],
|
|
26
|
+
52: [20, 13, 21, 3, 7, 18, 7, undefined, 13, 21, 13, 0],
|
|
27
|
+
53: [20, 15, 21, 5, 21, 4, 12, 5, 13, 8, 14, 11, 14, 14, 13, 16, 11, 17, 8, 17, 6, 16, 3, 14, 1, 11, 0, 8, 0, 5, 1, 4, 2, 3, 4],
|
|
28
|
+
54: [20, 16, 18, 15, 20, 12, 21, 10, 21, 7, 20, 5, 17, 4, 12, 4, 7, 5, 3, 7, 1, 10, 0, 11, 0, 14, 1, 16, 3, 17, 6, 17, 7, 16, 10, 14, 12, 11, 13, 10, 13, 7, 12, 5, 10, 4, 7],
|
|
29
|
+
55: [20, 17, 21, 7, 0, undefined, 3, 21, 17, 21],
|
|
30
|
+
56: [20, 8, 21, 5, 20, 4, 18, 4, 16, 5, 14, 7, 13, 11, 12, 14, 11, 16, 9, 17, 7, 17, 4, 16, 2, 15, 1, 12, 0, 8, 0, 5, 1, 4, 2, 3, 4, 3, 7, 4, 9, 6, 11, 9, 12, 13, 13, 15, 14, 16, 16, 16, 18, 15, 20, 12, 21, 8, 21],
|
|
31
|
+
57: [20, 16, 14, 15, 11, 13, 9, 10, 8, 9, 8, 6, 9, 4, 11, 3, 14, 3, 15, 4, 18, 6, 20, 9, 21, 10, 21, 13, 20, 15, 18, 16, 14, 16, 9, 15, 4, 13, 1, 10, 0, 8, 0, 5, 1, 4, 3],
|
|
32
|
+
58: [10, 5, 14, 4, 13, 5, 12, 6, 13, 5, 14, undefined, 5, 2, 4, 1, 5, 0, 6, 1, 5, 2],
|
|
33
|
+
59: [10, 5, 14, 4, 13, 5, 12, 6, 13, 5, 14, undefined, 6, 1, 5, 0, 4, 1, 5, 2, 6, 1, 6, -1, 5, -3, 4, -4],
|
|
34
|
+
60: [24, 20, 18, 4, 9, 20, 0],
|
|
35
|
+
61: [26, 4, 12, 22, 12, undefined, 4, 6, 22, 6],
|
|
36
|
+
62: [24, 4, 18, 20, 9, 4, 0],
|
|
37
|
+
63: [18, 3, 16, 3, 17, 4, 19, 5, 20, 7, 21, 11, 21, 13, 20, 14, 19, 15, 17, 15, 15, 14, 13, 13, 12, 9, 10, 9, 7, undefined, 9, 2, 8, 1, 9, 0, 10, 1, 9, 2],
|
|
38
|
+
64: [27, 18, 13, 17, 15, 15, 16, 12, 16, 10, 15, 9, 14, 8, 11, 8, 8, 9, 6, 11, 5, 14, 5, 16, 6, 17, 8, undefined, 12, 16, 10, 14, 9, 11, 9, 8, 10, 6, 11, 5, undefined, 18, 16, 17, 8, 17, 6, 19, 5, 21, 5, 23, 7, 24, 10, 24, 12, 23, 15, 22, 17, 20, 19, 18, 20, 15, 21, 12, 21, 9, 20, 7, 19, 5, 17, 4, 15, 3, 12, 3, 9, 4, 6, 5, 4, 7, 2, 9, 1, 12, 0, 15, 0, 18, 1, 20, 2, 21, 3, undefined, 19, 16, 18, 8, 18, 6, 19, 5],
|
|
39
|
+
65: [18, 9, 21, 1, 0, undefined, 9, 21, 17, 0, undefined, 4, 7, 14, 7],
|
|
40
|
+
66: [21, 4, 21, 4, 0, undefined, 4, 21, 13, 21, 16, 20, 17, 19, 18, 17, 18, 15, 17, 13, 16, 12, 13, 11, undefined, 4, 11, 13, 11, 16, 10, 17, 9, 18, 7, 18, 4, 17, 2, 16, 1, 13, 0, 4, 0],
|
|
41
|
+
67: [21, 18, 16, 17, 18, 15, 20, 13, 21, 9, 21, 7, 20, 5, 18, 4, 16, 3, 13, 3, 8, 4, 5, 5, 3, 7, 1, 9, 0, 13, 0, 15, 1, 17, 3, 18, 5],
|
|
42
|
+
68: [21, 4, 21, 4, 0, undefined, 4, 21, 11, 21, 14, 20, 16, 18, 17, 16, 18, 13, 18, 8, 17, 5, 16, 3, 14, 1, 11, 0, 4, 0],
|
|
43
|
+
69: [19, 4, 21, 4, 0, undefined, 4, 21, 17, 21, undefined, 4, 11, 12, 11, undefined, 4, 0, 17, 0],
|
|
44
|
+
70: [18, 4, 21, 4, 0, undefined, 4, 21, 17, 21, undefined, 4, 11, 12, 11],
|
|
45
|
+
71: [21, 18, 16, 17, 18, 15, 20, 13, 21, 9, 21, 7, 20, 5, 18, 4, 16, 3, 13, 3, 8, 4, 5, 5, 3, 7, 1, 9, 0, 13, 0, 15, 1, 17, 3, 18, 5, 18, 8, undefined, 13, 8, 18, 8],
|
|
46
|
+
72: [22, 4, 21, 4, 0, undefined, 18, 21, 18, 0, undefined, 4, 11, 18, 11],
|
|
47
|
+
73: [8, 4, 21, 4, 0],
|
|
48
|
+
74: [16, 12, 21, 12, 5, 11, 2, 10, 1, 8, 0, 6, 0, 4, 1, 3, 2, 2, 5, 2, 7],
|
|
49
|
+
75: [21, 4, 21, 4, 0, undefined, 18, 21, 4, 7, undefined, 9, 12, 18, 0],
|
|
50
|
+
76: [17, 4, 21, 4, 0, undefined, 4, 0, 16, 0],
|
|
51
|
+
77: [24, 4, 21, 4, 0, undefined, 4, 21, 12, 0, undefined, 20, 21, 12, 0, undefined, 20, 21, 20, 0],
|
|
52
|
+
78: [22, 4, 21, 4, 0, undefined, 4, 21, 18, 0, undefined, 18, 21, 18, 0],
|
|
53
|
+
79: [22, 9, 21, 7, 20, 5, 18, 4, 16, 3, 13, 3, 8, 4, 5, 5, 3, 7, 1, 9, 0, 13, 0, 15, 1, 17, 3, 18, 5, 19, 8, 19, 13, 18, 16, 17, 18, 15, 20, 13, 21, 9, 21],
|
|
54
|
+
80: [21, 4, 21, 4, 0, undefined, 4, 21, 13, 21, 16, 20, 17, 19, 18, 17, 18, 14, 17, 12, 16, 11, 13, 10, 4, 10],
|
|
55
|
+
81: [22, 9, 21, 7, 20, 5, 18, 4, 16, 3, 13, 3, 8, 4, 5, 5, 3, 7, 1, 9, 0, 13, 0, 15, 1, 17, 3, 18, 5, 19, 8, 19, 13, 18, 16, 17, 18, 15, 20, 13, 21, 9, 21, undefined, 12, 4, 18, -2],
|
|
56
|
+
82: [21, 4, 21, 4, 0, undefined, 4, 21, 13, 21, 16, 20, 17, 19, 18, 17, 18, 15, 17, 13, 16, 12, 13, 11, 4, 11, undefined, 11, 11, 18, 0],
|
|
57
|
+
83: [20, 17, 18, 15, 20, 12, 21, 8, 21, 5, 20, 3, 18, 3, 16, 4, 14, 5, 13, 7, 12, 13, 10, 15, 9, 16, 8, 17, 6, 17, 3, 15, 1, 12, 0, 8, 0, 5, 1, 3, 3],
|
|
58
|
+
84: [16, 8, 21, 8, 0, undefined, 1, 21, 15, 21],
|
|
59
|
+
85: [22, 4, 21, 4, 6, 5, 3, 7, 1, 10, 0, 12, 0, 15, 1, 17, 3, 18, 6, 18, 21],
|
|
60
|
+
86: [18, 1, 21, 9, 0, undefined, 17, 21, 9, 0],
|
|
61
|
+
87: [24, 2, 21, 7, 0, undefined, 12, 21, 7, 0, undefined, 12, 21, 17, 0, undefined, 22, 21, 17, 0],
|
|
62
|
+
88: [20, 3, 21, 17, 0, undefined, 17, 21, 3, 0],
|
|
63
|
+
89: [18, 1, 21, 9, 11, 9, 0, undefined, 17, 21, 9, 11],
|
|
64
|
+
90: [20, 17, 21, 3, 0, undefined, 3, 21, 17, 21, undefined, 3, 0, 17, 0],
|
|
65
|
+
91: [14, 4, 25, 4, -7, undefined, 5, 25, 5, -7, undefined, 4, 25, 11, 25, undefined, 4, -7, 11, -7],
|
|
66
|
+
92: [14, 0, 21, 14, -3],
|
|
67
|
+
93: [14, 9, 25, 9, -7, undefined, 10, 25, 10, -7, undefined, 3, 25, 10, 25, undefined, 3, -7, 10, -7],
|
|
68
|
+
94: [16, 6, 15, 8, 18, 10, 15, undefined, 3, 12, 8, 17, 13, 12, undefined, 8, 17, 8, 0],
|
|
69
|
+
95: [16, 0, -2, 16, -2],
|
|
70
|
+
96: [10, 6, 21, 5, 20, 4, 18, 4, 16, 5, 15, 6, 16, 5, 17],
|
|
71
|
+
97: [19, 15, 14, 15, 0, undefined, 15, 11, 13, 13, 11, 14, 8, 14, 6, 13, 4, 11, 3, 8, 3, 6, 4, 3, 6, 1, 8, 0, 11, 0, 13, 1, 15, 3],
|
|
72
|
+
98: [19, 4, 21, 4, 0, undefined, 4, 11, 6, 13, 8, 14, 11, 14, 13, 13, 15, 11, 16, 8, 16, 6, 15, 3, 13, 1, 11, 0, 8, 0, 6, 1, 4, 3],
|
|
73
|
+
99: [18, 15, 11, 13, 13, 11, 14, 8, 14, 6, 13, 4, 11, 3, 8, 3, 6, 4, 3, 6, 1, 8, 0, 11, 0, 13, 1, 15, 3],
|
|
74
|
+
100: [19, 15, 21, 15, 0, undefined, 15, 11, 13, 13, 11, 14, 8, 14, 6, 13, 4, 11, 3, 8, 3, 6, 4, 3, 6, 1, 8, 0, 11, 0, 13, 1, 15, 3],
|
|
75
|
+
101: [18, 3, 8, 15, 8, 15, 10, 14, 12, 13, 13, 11, 14, 8, 14, 6, 13, 4, 11, 3, 8, 3, 6, 4, 3, 6, 1, 8, 0, 11, 0, 13, 1, 15, 3],
|
|
76
|
+
102: [12, 10, 21, 8, 21, 6, 20, 5, 17, 5, 0, undefined, 2, 14, 9, 14],
|
|
77
|
+
103: [19, 15, 14, 15, -2, 14, -5, 13, -6, 11, -7, 8, -7, 6, -6, undefined, 15, 11, 13, 13, 11, 14, 8, 14, 6, 13, 4, 11, 3, 8, 3, 6, 4, 3, 6, 1, 8, 0, 11, 0, 13, 1, 15, 3],
|
|
78
|
+
104: [19, 4, 21, 4, 0, undefined, 4, 10, 7, 13, 9, 14, 12, 14, 14, 13, 15, 10, 15, 0],
|
|
79
|
+
105: [8, 3, 21, 4, 20, 5, 21, 4, 22, 3, 21, undefined, 4, 14, 4, 0],
|
|
80
|
+
106: [10, 5, 21, 6, 20, 7, 21, 6, 22, 5, 21, undefined, 6, 14, 6, -3, 5, -6, 3, -7, 1, -7],
|
|
81
|
+
107: [17, 4, 21, 4, 0, undefined, 14, 14, 4, 4, undefined, 8, 8, 15, 0],
|
|
82
|
+
108: [8, 4, 21, 4, 0],
|
|
83
|
+
109: [30, 4, 14, 4, 0, undefined, 4, 10, 7, 13, 9, 14, 12, 14, 14, 13, 15, 10, 15, 0, undefined, 15, 10, 18, 13, 20, 14, 23, 14, 25, 13, 26, 10, 26, 0],
|
|
84
|
+
110: [19, 4, 14, 4, 0, undefined, 4, 10, 7, 13, 9, 14, 12, 14, 14, 13, 15, 10, 15, 0],
|
|
85
|
+
111: [19, 8, 14, 6, 13, 4, 11, 3, 8, 3, 6, 4, 3, 6, 1, 8, 0, 11, 0, 13, 1, 15, 3, 16, 6, 16, 8, 15, 11, 13, 13, 11, 14, 8, 14],
|
|
86
|
+
112: [19, 4, 14, 4, -7, undefined, 4, 11, 6, 13, 8, 14, 11, 14, 13, 13, 15, 11, 16, 8, 16, 6, 15, 3, 13, 1, 11, 0, 8, 0, 6, 1, 4, 3],
|
|
87
|
+
113: [19, 15, 14, 15, -7, undefined, 15, 11, 13, 13, 11, 14, 8, 14, 6, 13, 4, 11, 3, 8, 3, 6, 4, 3, 6, 1, 8, 0, 11, 0, 13, 1, 15, 3],
|
|
88
|
+
114: [13, 4, 14, 4, 0, undefined, 4, 8, 5, 11, 7, 13, 9, 14, 12, 14],
|
|
89
|
+
115: [17, 14, 11, 13, 13, 10, 14, 7, 14, 4, 13, 3, 11, 4, 9, 6, 8, 11, 7, 13, 6, 14, 4, 14, 3, 13, 1, 10, 0, 7, 0, 4, 1, 3, 3],
|
|
90
|
+
116: [12, 5, 21, 5, 4, 6, 1, 8, 0, 10, 0, undefined, 2, 14, 9, 14],
|
|
91
|
+
117: [19, 4, 14, 4, 4, 5, 1, 7, 0, 10, 0, 12, 1, 15, 4, undefined, 15, 14, 15, 0],
|
|
92
|
+
118: [16, 2, 14, 8, 0, undefined, 14, 14, 8, 0],
|
|
93
|
+
119: [22, 3, 14, 7, 0, undefined, 11, 14, 7, 0, undefined, 11, 14, 15, 0, undefined, 19, 14, 15, 0],
|
|
94
|
+
120: [17, 3, 14, 14, 0, undefined, 14, 14, 3, 0],
|
|
95
|
+
121: [16, 2, 14, 8, 0, undefined, 14, 14, 8, 0, 6, -4, 4, -6, 2, -7, 1, -7],
|
|
96
|
+
122: [17, 14, 14, 3, 0, undefined, 3, 14, 14, 14, undefined, 3, 0, 14, 0],
|
|
97
|
+
123: [14, 9, 25, 7, 24, 6, 23, 5, 21, 5, 19, 6, 17, 7, 16, 8, 14, 8, 12, 6, 10, undefined, 7, 24, 6, 22, 6, 20, 7, 18, 8, 17, 9, 15, 9, 13, 8, 11, 4, 9, 8, 7, 9, 5, 9, 3, 8, 1, 7, 0, 6, -2, 6, -4, 7, -6, undefined, 6, 8, 8, 6, 8, 4, 7, 2, 6, 1, 5, -1, 5, -3, 6, -5, 7, -6, 9, -7],
|
|
98
|
+
124: [8, 4, 25, 4, -7],
|
|
99
|
+
125: [14, 5, 25, 7, 24, 8, 23, 9, 21, 9, 19, 8, 17, 7, 16, 6, 14, 6, 12, 8, 10, undefined, 7, 24, 8, 22, 8, 20, 7, 18, 6, 17, 5, 15, 5, 13, 6, 11, 10, 9, 6, 7, 5, 5, 5, 3, 6, 1, 7, 0, 8, -2, 8, -4, 7, -6, undefined, 8, 8, 6, 6, 6, 4, 7, 2, 8, 1, 9, -1, 9, -3, 8, -5, 7, -6, 5, -7],
|
|
100
|
+
126: [24, 3, 6, 3, 8, 4, 11, 6, 12, 8, 12, 10, 11, 14, 8, 16, 7, 18, 7, 20, 8, 21, 10, undefined, 3, 8, 4, 10, 6, 11, 8, 11, 10, 10, 14, 7, 16, 6, 18, 6, 20, 7, 21, 10, 21, 12]
|
|
101
|
+
};
|
|
102
|
+
export const defaultsVectorParams = {
|
|
103
|
+
xOffset: 0,
|
|
104
|
+
yOffset: 0,
|
|
105
|
+
input: "?",
|
|
106
|
+
align: "left",
|
|
107
|
+
font: simplex,
|
|
108
|
+
height: 21,
|
|
109
|
+
lineSpacing: 2.142857142857143,
|
|
110
|
+
letterSpacing: 1,
|
|
111
|
+
extrudeOffset: 0
|
|
112
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as Text from "./bucket";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as Text from "./bucket";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Base } from "../../inputs/base-inputs";
|
|
2
|
+
export declare class VectorCharData {
|
|
3
|
+
constructor(width?: number, height?: number, paths?: Base.Point3[][]);
|
|
4
|
+
/**
|
|
5
|
+
* The width of the char
|
|
6
|
+
* @default undefined
|
|
7
|
+
*/
|
|
8
|
+
width?: number;
|
|
9
|
+
/**
|
|
10
|
+
* The height of the char
|
|
11
|
+
* @default undefined
|
|
12
|
+
*/
|
|
13
|
+
height?: number;
|
|
14
|
+
/**
|
|
15
|
+
* The segments of the char
|
|
16
|
+
* @default undefined
|
|
17
|
+
*/
|
|
18
|
+
paths?: Base.Point3[][];
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { VectorCharData } from "./vector-char-data";
|
|
2
|
+
export declare class VectorTextData {
|
|
3
|
+
constructor(width?: number, height?: number, chars?: VectorCharData[]);
|
|
4
|
+
/**
|
|
5
|
+
* The width of the char
|
|
6
|
+
* @default undefined
|
|
7
|
+
*/
|
|
8
|
+
width?: number;
|
|
9
|
+
/**
|
|
10
|
+
* The height of the char
|
|
11
|
+
* @default undefined
|
|
12
|
+
*/
|
|
13
|
+
height?: number;
|
|
14
|
+
/**
|
|
15
|
+
* The segments of the char
|
|
16
|
+
* @default undefined
|
|
17
|
+
*/
|
|
18
|
+
chars?: VectorCharData[];
|
|
19
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { GeometryHelper } from "./geometry-helper";
|
|
2
2
|
import * as Inputs from "../inputs";
|
|
3
3
|
import { Transforms } from "./transforms";
|
|
4
|
+
import { Vector } from "./vector";
|
|
4
5
|
/**
|
|
5
6
|
* Contains various methods for points. Point in bitbybit is simply an array containing 3 numbers for [x, y, z].
|
|
6
7
|
* Because of this form Point can be interchanged with Vector, which also is an array in [x, y, z] form.
|
|
@@ -9,7 +10,8 @@ import { Transforms } from "./transforms";
|
|
|
9
10
|
export declare class Point {
|
|
10
11
|
private readonly geometryHelper;
|
|
11
12
|
private readonly transforms;
|
|
12
|
-
|
|
13
|
+
private readonly vector;
|
|
14
|
+
constructor(geometryHelper: GeometryHelper, transforms: Transforms, vector: Vector);
|
|
13
15
|
/**
|
|
14
16
|
* Transforms the single point
|
|
15
17
|
* @param inputs Contains a point and the transformations to apply
|
|
@@ -82,6 +84,15 @@ export declare class Point {
|
|
|
82
84
|
* @drawable true
|
|
83
85
|
*/
|
|
84
86
|
rotatePointsCenterAxis(inputs: Inputs.Point.RotatePointsCenterAxisDto): Inputs.Base.Point3[];
|
|
87
|
+
/**
|
|
88
|
+
* Gets a bounding box of the points
|
|
89
|
+
* @param inputs Points
|
|
90
|
+
* @returns Bounding box of points
|
|
91
|
+
* @group extract
|
|
92
|
+
* @shortname bounding box pts
|
|
93
|
+
* @drawable true
|
|
94
|
+
*/
|
|
95
|
+
boundingBoxOfPoints(inputs: Inputs.Point.PointsDto): Inputs.Base.BoundingBox;
|
|
85
96
|
/**
|
|
86
97
|
* Measures the closest distance between a point and a collection of points
|
|
87
98
|
* @param inputs Point from which to measure and points to measure the distance against
|
|
@@ -218,5 +229,14 @@ export declare class Point {
|
|
|
218
229
|
* @drawable true
|
|
219
230
|
*/
|
|
220
231
|
removeConsecutiveDuplicates(inputs: Inputs.Point.RemoveConsecutiveDuplicatesDto): Inputs.Base.Point3[];
|
|
232
|
+
/**
|
|
233
|
+
* Creates a normal vector from 3 points
|
|
234
|
+
* @param inputs Three points and the reverse normal flag
|
|
235
|
+
* @returns Normal vector
|
|
236
|
+
* @group create
|
|
237
|
+
* @shortname normal from 3 points
|
|
238
|
+
* @drawable true
|
|
239
|
+
*/
|
|
240
|
+
normalFromThreePoints(inputs: Inputs.Point.ThreePointsNormalDto): Inputs.Base.Vector3;
|
|
221
241
|
private closestPointFromPointData;
|
|
222
242
|
}
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
* When creating 2D points, z coordinate is simply set to 0 - [x, y, 0].
|
|
5
5
|
*/
|
|
6
6
|
export class Point {
|
|
7
|
-
constructor(geometryHelper, transforms) {
|
|
7
|
+
constructor(geometryHelper, transforms, vector) {
|
|
8
8
|
this.geometryHelper = geometryHelper;
|
|
9
9
|
this.transforms = transforms;
|
|
10
|
+
this.vector = vector;
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
12
13
|
* Transforms the single point
|
|
@@ -114,6 +115,42 @@ export class Point {
|
|
|
114
115
|
const rotationTransforms = this.transforms.rotationCenterAxis({ center: inputs.center, axis: inputs.axis, angle: inputs.angle });
|
|
115
116
|
return this.geometryHelper.transformControlPoints(rotationTransforms, inputs.points);
|
|
116
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* Gets a bounding box of the points
|
|
120
|
+
* @param inputs Points
|
|
121
|
+
* @returns Bounding box of points
|
|
122
|
+
* @group extract
|
|
123
|
+
* @shortname bounding box pts
|
|
124
|
+
* @drawable true
|
|
125
|
+
*/
|
|
126
|
+
boundingBoxOfPoints(inputs) {
|
|
127
|
+
const xVals = [];
|
|
128
|
+
const yVals = [];
|
|
129
|
+
const zVals = [];
|
|
130
|
+
inputs.points.forEach(pt => {
|
|
131
|
+
xVals.push(pt[0]);
|
|
132
|
+
yVals.push(pt[1]);
|
|
133
|
+
zVals.push(pt[2]);
|
|
134
|
+
});
|
|
135
|
+
const min = [Math.min(...xVals), Math.min(...yVals), Math.min(...zVals)];
|
|
136
|
+
const max = [Math.max(...xVals), Math.max(...yVals), Math.max(...zVals)];
|
|
137
|
+
const center = [
|
|
138
|
+
(min[0] + max[0]) / 2,
|
|
139
|
+
(min[1] + max[1]) / 2,
|
|
140
|
+
(min[2] + max[2]) / 2,
|
|
141
|
+
];
|
|
142
|
+
const width = max[0] - min[0];
|
|
143
|
+
const height = max[1] - min[1];
|
|
144
|
+
const length = max[2] - min[2];
|
|
145
|
+
return {
|
|
146
|
+
min,
|
|
147
|
+
max,
|
|
148
|
+
center,
|
|
149
|
+
width,
|
|
150
|
+
height,
|
|
151
|
+
length,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
117
154
|
/**
|
|
118
155
|
* Measures the closest distance between a point and a collection of points
|
|
119
156
|
* @param inputs Point from which to measure and points to measure the distance against
|
|
@@ -333,6 +370,47 @@ export class Point {
|
|
|
333
370
|
removeConsecutiveDuplicates(inputs) {
|
|
334
371
|
return this.geometryHelper.removeConsecutivePointDuplicates(inputs.points, inputs.checkFirstAndLast, inputs.tolerance);
|
|
335
372
|
}
|
|
373
|
+
/**
|
|
374
|
+
* Creates a normal vector from 3 points
|
|
375
|
+
* @param inputs Three points and the reverse normal flag
|
|
376
|
+
* @returns Normal vector
|
|
377
|
+
* @group create
|
|
378
|
+
* @shortname normal from 3 points
|
|
379
|
+
* @drawable true
|
|
380
|
+
*/
|
|
381
|
+
normalFromThreePoints(inputs) {
|
|
382
|
+
const p1 = inputs.point1;
|
|
383
|
+
const p2 = inputs.point2;
|
|
384
|
+
const p3 = inputs.point3;
|
|
385
|
+
if (!p1 || !p2 || !p3 || p1.length !== 3 || p2.length !== 3 || p3.length !== 3) {
|
|
386
|
+
throw new Error("All points must be arrays of 3 numbers [x, y, z]");
|
|
387
|
+
}
|
|
388
|
+
// Calculate vector A = p2 - p1
|
|
389
|
+
const ax = p2[0] - p1[0];
|
|
390
|
+
const ay = p2[1] - p1[1];
|
|
391
|
+
const az = p2[2] - p1[2];
|
|
392
|
+
// Calculate vector B = p3 - p1
|
|
393
|
+
const bx = p3[0] - p1[0];
|
|
394
|
+
const by = p3[1] - p1[1];
|
|
395
|
+
const bz = p3[2] - p1[2];
|
|
396
|
+
// Calculate the cross product N = A x B
|
|
397
|
+
let nx = (ay * bz) - (az * by);
|
|
398
|
+
let ny = (az * bx) - (ax * bz);
|
|
399
|
+
let nz = (ax * by) - (ay * bx);
|
|
400
|
+
// Check for collinear points (resulting in a zero vector)
|
|
401
|
+
// A zero vector indicates the points don't form a unique plane.
|
|
402
|
+
// You might want to handle this case depending on your application.
|
|
403
|
+
if (nx === 0 && ny === 0 && nz === 0) {
|
|
404
|
+
console.warn("Points are collinear or coincident; cannot calculate a unique normal.");
|
|
405
|
+
return undefined; // Or return [0, 0, 0] if that's acceptable
|
|
406
|
+
}
|
|
407
|
+
if (inputs.reverseNormal) {
|
|
408
|
+
nx = -nx;
|
|
409
|
+
ny = -ny;
|
|
410
|
+
nz = -nz;
|
|
411
|
+
}
|
|
412
|
+
return this.vector.normalized({ vector: [nx, ny, nz] });
|
|
413
|
+
}
|
|
336
414
|
closestPointFromPointData(inputs) {
|
|
337
415
|
let distance = Number.MAX_SAFE_INTEGER;
|
|
338
416
|
let closestPointIndex;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import * as Inputs from "../inputs";
|
|
2
|
+
import * as Models from "../models";
|
|
3
|
+
import { Point } from "./point";
|
|
2
4
|
/**
|
|
3
5
|
* Contains various text methods.
|
|
4
6
|
*/
|
|
5
7
|
export declare class TextBitByBit {
|
|
8
|
+
private readonly point;
|
|
9
|
+
constructor(point: Point);
|
|
6
10
|
/**
|
|
7
11
|
* Creates a text
|
|
8
12
|
* @param inputs a text
|
|
@@ -66,4 +70,24 @@ export declare class TextBitByBit {
|
|
|
66
70
|
* @drawable false
|
|
67
71
|
*/
|
|
68
72
|
format(inputs: Inputs.Text.TextFormatDto): string;
|
|
73
|
+
/**
|
|
74
|
+
* Creates a vector segments for character and includes width and height information
|
|
75
|
+
* @param inputs a text
|
|
76
|
+
* @returns width, height and segments as json
|
|
77
|
+
* @group vector
|
|
78
|
+
* @shortname vector char
|
|
79
|
+
* @drawable false
|
|
80
|
+
*/
|
|
81
|
+
vectorChar(inputs: Inputs.Text.VectorCharDto): Models.Text.VectorCharData;
|
|
82
|
+
/**
|
|
83
|
+
* Creates a vector text lines for a given text and includes width and height information
|
|
84
|
+
* @param inputs a text as string
|
|
85
|
+
* @returns segments
|
|
86
|
+
* @group vector
|
|
87
|
+
* @shortname vector text
|
|
88
|
+
* @drawable false
|
|
89
|
+
*/
|
|
90
|
+
vectorText(inputs: Inputs.Text.VectorTextDto): Models.Text.VectorTextData[];
|
|
91
|
+
private vectorParamsChar;
|
|
92
|
+
private translateLine;
|
|
69
93
|
}
|
package/lib/api/services/text.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import * as Inputs from "../inputs";
|
|
2
|
+
import { defaultsVectorParams } from "../models/simplex";
|
|
1
3
|
/**
|
|
2
4
|
* Contains various text methods.
|
|
3
5
|
*/
|
|
4
6
|
export class TextBitByBit {
|
|
7
|
+
constructor(point) {
|
|
8
|
+
this.point = point;
|
|
9
|
+
}
|
|
5
10
|
/**
|
|
6
11
|
* Creates a text
|
|
7
12
|
* @param inputs a text
|
|
@@ -81,4 +86,156 @@ export class TextBitByBit {
|
|
|
81
86
|
return typeof inputs.values[number] !== "undefined" ? inputs.values[number] : match;
|
|
82
87
|
});
|
|
83
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Creates a vector segments for character and includes width and height information
|
|
91
|
+
* @param inputs a text
|
|
92
|
+
* @returns width, height and segments as json
|
|
93
|
+
* @group vector
|
|
94
|
+
* @shortname vector char
|
|
95
|
+
* @drawable false
|
|
96
|
+
*/
|
|
97
|
+
vectorChar(inputs) {
|
|
98
|
+
const { xOffset, yOffset, font, input, height, extrudeOffset } = this.vectorParamsChar(inputs);
|
|
99
|
+
let code = input.charCodeAt(0);
|
|
100
|
+
if (!code || !font[code]) {
|
|
101
|
+
code = 63;
|
|
102
|
+
}
|
|
103
|
+
const glyph = [].concat(font[code]);
|
|
104
|
+
const ratio = (height - extrudeOffset) / font.height;
|
|
105
|
+
const extrudeYOffset = (extrudeOffset / 2);
|
|
106
|
+
const width = glyph.shift() * ratio;
|
|
107
|
+
const paths = [];
|
|
108
|
+
let polyline = [];
|
|
109
|
+
for (let i = 0, il = glyph.length; i < il; i += 2) {
|
|
110
|
+
const gx = ratio * glyph[i] + xOffset;
|
|
111
|
+
const gy = ratio * glyph[i + 1] + yOffset + extrudeYOffset;
|
|
112
|
+
if (glyph[i] !== undefined) {
|
|
113
|
+
polyline.push([gx, 0, gy]);
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
paths.push(polyline);
|
|
117
|
+
polyline = [];
|
|
118
|
+
i--;
|
|
119
|
+
}
|
|
120
|
+
if (polyline.length) {
|
|
121
|
+
paths.push(polyline);
|
|
122
|
+
}
|
|
123
|
+
return { width, height, paths };
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Creates a vector text lines for a given text and includes width and height information
|
|
127
|
+
* @param inputs a text as string
|
|
128
|
+
* @returns segments
|
|
129
|
+
* @group vector
|
|
130
|
+
* @shortname vector text
|
|
131
|
+
* @drawable false
|
|
132
|
+
*/
|
|
133
|
+
vectorText(inputs) {
|
|
134
|
+
const { xOffset, yOffset, height, align, extrudeOffset, lineSpacing, letterSpacing } = Object.assign({}, defaultsVectorParams, inputs);
|
|
135
|
+
const text = inputs.text;
|
|
136
|
+
if (typeof text !== "string")
|
|
137
|
+
throw new Error("text must be a string");
|
|
138
|
+
// NOTE: Just like CSS letter-spacing, the spacing could be positive or negative
|
|
139
|
+
const extraLetterSpacing = (height * letterSpacing);
|
|
140
|
+
// manage the list of lines
|
|
141
|
+
let maxWidth = 0; // keep track of max width for final alignment
|
|
142
|
+
let line = { width: 0, height: 0, chars: [] };
|
|
143
|
+
let lines = [];
|
|
144
|
+
const pushLine = () => {
|
|
145
|
+
maxWidth = Math.max(maxWidth, line.width);
|
|
146
|
+
if (line.chars.length)
|
|
147
|
+
lines.push(line);
|
|
148
|
+
line = { width: 0, height: 0, chars: [] };
|
|
149
|
+
};
|
|
150
|
+
// convert the text into a list of vector lines
|
|
151
|
+
let x = xOffset;
|
|
152
|
+
let y = yOffset;
|
|
153
|
+
let vchar;
|
|
154
|
+
const il = text.length;
|
|
155
|
+
for (let i = 0; i < il; i++) {
|
|
156
|
+
const character = text[i];
|
|
157
|
+
if (character === "\n") {
|
|
158
|
+
pushLine();
|
|
159
|
+
// reset x and y for a new line
|
|
160
|
+
x = xOffset;
|
|
161
|
+
y -= height * lineSpacing;
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
// convert the character
|
|
165
|
+
vchar = this.vectorChar({ xOffset: x, yOffset: y, height, extrudeOffset, char: character });
|
|
166
|
+
const width = vchar.width + extraLetterSpacing;
|
|
167
|
+
x += width;
|
|
168
|
+
// update current line
|
|
169
|
+
line.width += width;
|
|
170
|
+
line.height = Math.max(line.height, vchar.height);
|
|
171
|
+
if (character !== " ") {
|
|
172
|
+
line.chars = line.chars.concat(vchar);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
if (line.chars.length)
|
|
176
|
+
pushLine();
|
|
177
|
+
// align all lines as requested
|
|
178
|
+
lines = lines.map((line) => {
|
|
179
|
+
const diff = maxWidth - line.width;
|
|
180
|
+
if (align === Inputs.Base.horizontalAlignEnum.right) {
|
|
181
|
+
return this.translateLine({ x: diff }, line);
|
|
182
|
+
}
|
|
183
|
+
else if (align === Inputs.Base.horizontalAlignEnum.center) {
|
|
184
|
+
return this.translateLine({ x: diff / 2 }, line);
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
return line;
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
if (inputs.centerOnOrigin) {
|
|
191
|
+
const pointsFlat = [];
|
|
192
|
+
// flatten the lines into a single array of points
|
|
193
|
+
lines.forEach((line) => {
|
|
194
|
+
line.chars.forEach((vchar) => {
|
|
195
|
+
vchar.paths.forEach((path) => {
|
|
196
|
+
pointsFlat.push(...path);
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
const bbox = this.point.boundingBoxOfPoints({
|
|
201
|
+
points: pointsFlat,
|
|
202
|
+
});
|
|
203
|
+
lines.forEach((line) => {
|
|
204
|
+
line.chars.forEach((vchar) => {
|
|
205
|
+
vchar.paths = vchar.paths.map((path) => {
|
|
206
|
+
const pts = this.point.translatePoints({
|
|
207
|
+
points: path,
|
|
208
|
+
translation: [
|
|
209
|
+
-bbox.center[0],
|
|
210
|
+
-bbox.center[1],
|
|
211
|
+
-bbox.center[2],
|
|
212
|
+
],
|
|
213
|
+
});
|
|
214
|
+
return pts;
|
|
215
|
+
});
|
|
216
|
+
return vchar;
|
|
217
|
+
});
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
return lines;
|
|
221
|
+
}
|
|
222
|
+
vectorParamsChar(inputs) {
|
|
223
|
+
const params = Object.assign({}, defaultsVectorParams, inputs);
|
|
224
|
+
params.input = inputs.char || params.char;
|
|
225
|
+
return params;
|
|
226
|
+
}
|
|
227
|
+
translateLine(options, line) {
|
|
228
|
+
const { x, y } = Object.assign({ x: 0, y: 0 }, options);
|
|
229
|
+
line.chars = line.chars.map((vchar) => {
|
|
230
|
+
vchar.paths = vchar.paths.map((path) => {
|
|
231
|
+
const pts = this.point.translatePoints({
|
|
232
|
+
points: path,
|
|
233
|
+
translation: [x, 0, y],
|
|
234
|
+
});
|
|
235
|
+
return pts;
|
|
236
|
+
});
|
|
237
|
+
return vchar;
|
|
238
|
+
});
|
|
239
|
+
return line;
|
|
240
|
+
}
|
|
84
241
|
}
|
|
@@ -28,6 +28,15 @@ export declare class Vector {
|
|
|
28
28
|
* @drawable false
|
|
29
29
|
*/
|
|
30
30
|
removeConsecutiveDuplicateVectors(inputs: Inputs.Vector.RemoveConsecutiveDuplicateVectorsDto): number[][];
|
|
31
|
+
/**
|
|
32
|
+
* Checks if two vectors are the same within a given tolerance
|
|
33
|
+
* @param inputs Contains two vectors and a tolerance value
|
|
34
|
+
* @returns Boolean indicating if vectors are the same
|
|
35
|
+
* @group validate
|
|
36
|
+
* @shortname vectors the same
|
|
37
|
+
* @drawable false
|
|
38
|
+
*/
|
|
39
|
+
vectorsTheSame(inputs: Inputs.Vector.VectorsTheSameDto): boolean;
|
|
31
40
|
/**
|
|
32
41
|
* Measures the angle between two vectors in degrees
|
|
33
42
|
* @param inputs Contains two vectors represented as number arrays
|
|
@@ -30,6 +30,17 @@ export class Vector {
|
|
|
30
30
|
removeConsecutiveDuplicateVectors(inputs) {
|
|
31
31
|
return this.geometryHelper.removeConsecutiveVectorDuplicates(inputs.vectors, inputs.checkFirstAndLast, inputs.tolerance);
|
|
32
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Checks if two vectors are the same within a given tolerance
|
|
35
|
+
* @param inputs Contains two vectors and a tolerance value
|
|
36
|
+
* @returns Boolean indicating if vectors are the same
|
|
37
|
+
* @group validate
|
|
38
|
+
* @shortname vectors the same
|
|
39
|
+
* @drawable false
|
|
40
|
+
*/
|
|
41
|
+
vectorsTheSame(inputs) {
|
|
42
|
+
return this.geometryHelper.vectorsTheSame(inputs.vec1, inputs.vec2, inputs.tolerance);
|
|
43
|
+
}
|
|
33
44
|
/**
|
|
34
45
|
* Measures the angle between two vectors in degrees
|
|
35
46
|
* @param inputs Contains two vectors represented as number arrays
|