@immugio/three-math-extensions 0.2.21 → 0.2.22
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/CHANGELOG.md +11 -2
- package/README.md +183 -1
- package/cjs/Line2D.js +59 -8
- package/cjs/Line3D.js +1 -1
- package/docs/classes/BoundingBox.md +13 -9
- package/docs/classes/Line2D.md +292 -80
- package/docs/classes/Line3D.md +155 -84
- package/docs/classes/Polygon.md +23 -19
- package/docs/classes/Rectangle.md +23 -19
- package/docs/classes/Size2.md +8 -4
- package/docs/classes/Vec2.md +62 -12
- package/docs/classes/Vec3.md +65 -15
- package/docs/interfaces/Point2.md +3 -3
- package/docs/interfaces/Point3.md +4 -4
- package/docs/modules.md +86 -5
- package/esm/Line2D.js +59 -8
- package/esm/Line3D.js +1 -1
- package/package.json +1 -1
- package/src/Line2D.ts +69 -8
- package/src/Line3D.ts +1 -1
- package/types/Line2D.d.ts +21 -2
- package/types/Line3D.d.ts +1 -1
- package/docs/README.md +0 -90
package/docs/classes/Line3D.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[@immugio/three-math-extensions](
|
|
1
|
+
[@immugio/three-math-extensions](../../README.md) / [Exports](../modules.md) / Line3D
|
|
2
2
|
|
|
3
3
|
# Class: Line3D
|
|
4
4
|
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
### Properties
|
|
18
18
|
|
|
19
19
|
- [end](Line3D.md#end)
|
|
20
|
+
- [index](Line3D.md#index)
|
|
20
21
|
- [start](Line3D.md#start)
|
|
21
22
|
|
|
22
23
|
### Accessors
|
|
@@ -32,6 +33,7 @@
|
|
|
32
33
|
- [clipLine](Line3D.md#clipline)
|
|
33
34
|
- [clipLines](Line3D.md#cliplines)
|
|
34
35
|
- [clone](Line3D.md#clone)
|
|
36
|
+
- [connectsTo](Line3D.md#connectsto)
|
|
35
37
|
- [containsPoint](Line3D.md#containspoint)
|
|
36
38
|
- [covers](Line3D.md#covers)
|
|
37
39
|
- [distanceToPoint](Line3D.md#distancetopoint)
|
|
@@ -52,20 +54,26 @@
|
|
|
52
54
|
- [translate](Line3D.md#translate)
|
|
53
55
|
- [fromPoints](Line3D.md#frompoints)
|
|
54
56
|
- [fromPolygon](Line3D.md#frompolygon)
|
|
57
|
+
- [groupConnectedLines](Line3D.md#groupconnectedlines)
|
|
55
58
|
- [joinLines](Line3D.md#joinlines)
|
|
56
59
|
|
|
57
60
|
## Constructors
|
|
58
61
|
|
|
59
62
|
### constructor
|
|
60
63
|
|
|
61
|
-
• **new Line3D**(`start`, `end`)
|
|
64
|
+
• **new Line3D**(`start`, `end`, `index?`): [`Line3D`](Line3D.md)
|
|
62
65
|
|
|
63
66
|
#### Parameters
|
|
64
67
|
|
|
65
|
-
| Name | Type |
|
|
66
|
-
| :------ | :------ |
|
|
67
|
-
| `start` | [`Vec3`](Vec3.md) |
|
|
68
|
-
| `end` | [`Vec3`](Vec3.md) |
|
|
68
|
+
| Name | Type | Default value |
|
|
69
|
+
| :------ | :------ | :------ |
|
|
70
|
+
| `start` | [`Vec3`](Vec3.md) | `undefined` |
|
|
71
|
+
| `end` | [`Vec3`](Vec3.md) | `undefined` |
|
|
72
|
+
| `index` | `number` | `0` |
|
|
73
|
+
|
|
74
|
+
#### Returns
|
|
75
|
+
|
|
76
|
+
[`Line3D`](Line3D.md)
|
|
69
77
|
|
|
70
78
|
#### Overrides
|
|
71
79
|
|
|
@@ -73,7 +81,7 @@ Line3.constructor
|
|
|
73
81
|
|
|
74
82
|
#### Defined in
|
|
75
83
|
|
|
76
|
-
[src/Line3D.ts:13](https://github.com/Immugio/three-math-extensions/blob/
|
|
84
|
+
[src/Line3D.ts:13](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L13)
|
|
77
85
|
|
|
78
86
|
## Properties
|
|
79
87
|
|
|
@@ -87,7 +95,17 @@ Line3.end
|
|
|
87
95
|
|
|
88
96
|
#### Defined in
|
|
89
97
|
|
|
90
|
-
[src/Line3D.ts:9](https://github.com/Immugio/three-math-extensions/blob/
|
|
98
|
+
[src/Line3D.ts:9](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L9)
|
|
99
|
+
|
|
100
|
+
___
|
|
101
|
+
|
|
102
|
+
### index
|
|
103
|
+
|
|
104
|
+
• **index**: `number` = `0`
|
|
105
|
+
|
|
106
|
+
#### Defined in
|
|
107
|
+
|
|
108
|
+
[src/Line3D.ts:13](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L13)
|
|
91
109
|
|
|
92
110
|
___
|
|
93
111
|
|
|
@@ -101,7 +119,7 @@ Line3.start
|
|
|
101
119
|
|
|
102
120
|
#### Defined in
|
|
103
121
|
|
|
104
|
-
[src/Line3D.ts:8](https://github.com/Immugio/three-math-extensions/blob/
|
|
122
|
+
[src/Line3D.ts:8](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L8)
|
|
105
123
|
|
|
106
124
|
## Accessors
|
|
107
125
|
|
|
@@ -117,7 +135,7 @@ Returns the center of this line
|
|
|
117
135
|
|
|
118
136
|
#### Defined in
|
|
119
137
|
|
|
120
|
-
[src/Line3D.ts:270](https://github.com/Immugio/three-math-extensions/blob/
|
|
138
|
+
[src/Line3D.ts:270](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L270)
|
|
121
139
|
|
|
122
140
|
___
|
|
123
141
|
|
|
@@ -133,7 +151,7 @@ Returns the direction of this line.
|
|
|
133
151
|
|
|
134
152
|
#### Defined in
|
|
135
153
|
|
|
136
|
-
[src/Line3D.ts:263](https://github.com/Immugio/three-math-extensions/blob/
|
|
154
|
+
[src/Line3D.ts:263](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L263)
|
|
137
155
|
|
|
138
156
|
___
|
|
139
157
|
|
|
@@ -149,7 +167,7 @@ Returns the start and end points of the line as an array.
|
|
|
149
167
|
|
|
150
168
|
#### Defined in
|
|
151
169
|
|
|
152
|
-
[src/Line3D.ts:293](https://github.com/Immugio/three-math-extensions/blob/
|
|
170
|
+
[src/Line3D.ts:293](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L293)
|
|
153
171
|
|
|
154
172
|
___
|
|
155
173
|
|
|
@@ -165,7 +183,7 @@ Returns this line's length.
|
|
|
165
183
|
|
|
166
184
|
#### Defined in
|
|
167
185
|
|
|
168
|
-
[src/Line3D.ts:247](https://github.com/Immugio/three-math-extensions/blob/
|
|
186
|
+
[src/Line3D.ts:247](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L247)
|
|
169
187
|
|
|
170
188
|
## Methods
|
|
171
189
|
|
|
@@ -187,7 +205,7 @@ Divides the Line3D into a number of segments of the given length.
|
|
|
187
205
|
|
|
188
206
|
#### Defined in
|
|
189
207
|
|
|
190
|
-
[src/Line3D.ts:405](https://github.com/Immugio/three-math-extensions/blob/
|
|
208
|
+
[src/Line3D.ts:405](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L405)
|
|
191
209
|
|
|
192
210
|
___
|
|
193
211
|
|
|
@@ -197,12 +215,6 @@ ___
|
|
|
197
215
|
|
|
198
216
|
Returns lines that are the result of clipping this line by the
|
|
199
217
|
|
|
200
|
-
**`Other`**
|
|
201
|
-
|
|
202
|
-
line.
|
|
203
|
-
Clips must be parallel to this line.
|
|
204
|
-
Clones the line, does not modify this.
|
|
205
|
-
|
|
206
218
|
#### Parameters
|
|
207
219
|
|
|
208
220
|
| Name | Type | Default value |
|
|
@@ -214,9 +226,15 @@ Clones the line, does not modify this.
|
|
|
214
226
|
|
|
215
227
|
[`Line3D`](Line3D.md)[]
|
|
216
228
|
|
|
229
|
+
**`Other`**
|
|
230
|
+
|
|
231
|
+
line.
|
|
232
|
+
Clips must be parallel to this line.
|
|
233
|
+
Clones the line, does not modify this.
|
|
234
|
+
|
|
217
235
|
#### Defined in
|
|
218
236
|
|
|
219
|
-
[src/Line3D.ts:51](https://github.com/Immugio/three-math-extensions/blob/
|
|
237
|
+
[src/Line3D.ts:51](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L51)
|
|
220
238
|
|
|
221
239
|
___
|
|
222
240
|
|
|
@@ -242,7 +260,7 @@ Clones the line, does not modify this.
|
|
|
242
260
|
|
|
243
261
|
#### Defined in
|
|
244
262
|
|
|
245
|
-
[src/Line3D.ts:76](https://github.com/Immugio/three-math-extensions/blob/
|
|
263
|
+
[src/Line3D.ts:76](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L76)
|
|
246
264
|
|
|
247
265
|
___
|
|
248
266
|
|
|
@@ -262,7 +280,35 @@ Line3.clone
|
|
|
262
280
|
|
|
263
281
|
#### Defined in
|
|
264
282
|
|
|
265
|
-
[src/Line3D.ts:
|
|
283
|
+
[src/Line3D.ts:577](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L577)
|
|
284
|
+
|
|
285
|
+
___
|
|
286
|
+
|
|
287
|
+
### connectsTo
|
|
288
|
+
|
|
289
|
+
▸ **connectsTo**(`other`, `tolerance?`, `breakpoints?`): `boolean`
|
|
290
|
+
|
|
291
|
+
Returns true if any endpoint of this line is within the tolerance of any
|
|
292
|
+
|
|
293
|
+
#### Parameters
|
|
294
|
+
|
|
295
|
+
| Name | Type | Default value |
|
|
296
|
+
| :------ | :------ | :------ |
|
|
297
|
+
| `other` | [`Line3D`](Line3D.md) | `undefined` |
|
|
298
|
+
| `tolerance` | `number` | `0` |
|
|
299
|
+
| `breakpoints` | [`Vec3`](Vec3.md)[] | `[]` |
|
|
300
|
+
|
|
301
|
+
#### Returns
|
|
302
|
+
|
|
303
|
+
`boolean`
|
|
304
|
+
|
|
305
|
+
**`Other`**
|
|
306
|
+
|
|
307
|
+
line's endpoints.
|
|
308
|
+
|
|
309
|
+
#### Defined in
|
|
310
|
+
|
|
311
|
+
[src/Line3D.ts:551](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L551)
|
|
266
312
|
|
|
267
313
|
___
|
|
268
314
|
|
|
@@ -285,7 +331,7 @@ Check that this line section contains provided point.
|
|
|
285
331
|
|
|
286
332
|
#### Defined in
|
|
287
333
|
|
|
288
|
-
[src/Line3D.ts:302](https://github.com/Immugio/three-math-extensions/blob/
|
|
334
|
+
[src/Line3D.ts:302](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L302)
|
|
289
335
|
|
|
290
336
|
___
|
|
291
337
|
|
|
@@ -295,10 +341,6 @@ ___
|
|
|
295
341
|
|
|
296
342
|
Returns true if this line section completely overlaps the
|
|
297
343
|
|
|
298
|
-
**`Other`**
|
|
299
|
-
|
|
300
|
-
line section.
|
|
301
|
-
|
|
302
344
|
#### Parameters
|
|
303
345
|
|
|
304
346
|
| Name | Type | Default value |
|
|
@@ -310,9 +352,13 @@ line section.
|
|
|
310
352
|
|
|
311
353
|
`boolean`
|
|
312
354
|
|
|
355
|
+
**`Other`**
|
|
356
|
+
|
|
357
|
+
line section.
|
|
358
|
+
|
|
313
359
|
#### Defined in
|
|
314
360
|
|
|
315
|
-
[src/Line3D.ts:200](https://github.com/Immugio/three-math-extensions/blob/
|
|
361
|
+
[src/Line3D.ts:200](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L200)
|
|
316
362
|
|
|
317
363
|
___
|
|
318
364
|
|
|
@@ -320,7 +366,7 @@ ___
|
|
|
320
366
|
|
|
321
367
|
▸ **distanceToPoint**(`p`, `clampToLine?`): `number`
|
|
322
368
|
|
|
323
|
-
Distance from this line to provided point.
|
|
369
|
+
Distance from this line to the provided point.
|
|
324
370
|
|
|
325
371
|
#### Parameters
|
|
326
372
|
|
|
@@ -335,7 +381,7 @@ Distance from this line to provided point.
|
|
|
335
381
|
|
|
336
382
|
#### Defined in
|
|
337
383
|
|
|
338
|
-
[src/Line3D.ts:312](https://github.com/Immugio/three-math-extensions/blob/
|
|
384
|
+
[src/Line3D.ts:312](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L312)
|
|
339
385
|
|
|
340
386
|
___
|
|
341
387
|
|
|
@@ -362,7 +408,7 @@ Line3.equals
|
|
|
362
408
|
|
|
363
409
|
#### Defined in
|
|
364
410
|
|
|
365
|
-
[src/Line3D.ts:
|
|
411
|
+
[src/Line3D.ts:570](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L570)
|
|
366
412
|
|
|
367
413
|
___
|
|
368
414
|
|
|
@@ -372,15 +418,6 @@ ___
|
|
|
372
418
|
|
|
373
419
|
Returns a copy of
|
|
374
420
|
|
|
375
|
-
**`Other`**
|
|
376
|
-
|
|
377
|
-
line, the direction of
|
|
378
|
-
|
|
379
|
-
**`Other`**
|
|
380
|
-
|
|
381
|
-
is reversed if needed.
|
|
382
|
-
Returns null if lines are not parallel.
|
|
383
|
-
|
|
384
421
|
#### Parameters
|
|
385
422
|
|
|
386
423
|
| Name | Type | Default value |
|
|
@@ -392,9 +429,18 @@ Returns null if lines are not parallel.
|
|
|
392
429
|
|
|
393
430
|
[`Line3D`](Line3D.md)
|
|
394
431
|
|
|
432
|
+
**`Other`**
|
|
433
|
+
|
|
434
|
+
line, the direction of
|
|
435
|
+
|
|
436
|
+
**`Other`**
|
|
437
|
+
|
|
438
|
+
is reversed if needed.
|
|
439
|
+
Returns null if lines are not parallel.
|
|
440
|
+
|
|
395
441
|
#### Defined in
|
|
396
442
|
|
|
397
|
-
[src/Line3D.ts:323](https://github.com/Immugio/three-math-extensions/blob/
|
|
443
|
+
[src/Line3D.ts:323](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L323)
|
|
398
444
|
|
|
399
445
|
___
|
|
400
446
|
|
|
@@ -403,8 +449,8 @@ ___
|
|
|
403
449
|
▸ **intersect**(`other`): [`Line3D`](Line3D.md)
|
|
404
450
|
|
|
405
451
|
Calculates the intersection between this and `other` line. The lines are assumed to be infinite.
|
|
406
|
-
In a lot of cases an actual intersection cannot be calculated due to rounding errors.
|
|
407
|
-
Therefore, the intersection calculated by this method comes in
|
|
452
|
+
In a lot of cases, an actual intersection cannot be calculated due to rounding errors.
|
|
453
|
+
Therefore, the intersection calculated by this method comes in the form of the shorted possible line segment connecting the two lines.
|
|
408
454
|
Sources:
|
|
409
455
|
http://paulbourke.net/geometry/pointlineplane/
|
|
410
456
|
https://stackoverflow.com/questions/2316490/the-algorithm-to-find-the-point-of-intersection-of-two-3d-line-segment/2316934#2316934
|
|
@@ -421,34 +467,34 @@ https://stackoverflow.com/questions/2316490/the-algorithm-to-find-the-point-of-i
|
|
|
421
467
|
|
|
422
468
|
#### Defined in
|
|
423
469
|
|
|
424
|
-
[src/Line3D.ts:456](https://github.com/Immugio/three-math-extensions/blob/
|
|
470
|
+
[src/Line3D.ts:456](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L456)
|
|
425
471
|
|
|
426
472
|
___
|
|
427
473
|
|
|
428
474
|
### isParallelTo
|
|
429
475
|
|
|
430
|
-
▸ **isParallelTo**(`other`, `
|
|
476
|
+
▸ **isParallelTo**(`other`, `angleTolerance?`): `boolean`
|
|
431
477
|
|
|
432
478
|
Check if
|
|
433
479
|
|
|
434
|
-
**`Other`**
|
|
435
|
-
|
|
436
|
-
is parallel to this line.
|
|
437
|
-
|
|
438
480
|
#### Parameters
|
|
439
481
|
|
|
440
482
|
| Name | Type | Default value |
|
|
441
483
|
| :------ | :------ | :------ |
|
|
442
484
|
| `other` | [`Line3D`](Line3D.md) | `undefined` |
|
|
443
|
-
| `
|
|
485
|
+
| `angleTolerance` | `number` | `Number.EPSILON` |
|
|
444
486
|
|
|
445
487
|
#### Returns
|
|
446
488
|
|
|
447
489
|
`boolean`
|
|
448
490
|
|
|
491
|
+
**`Other`**
|
|
492
|
+
|
|
493
|
+
is parallel to this line.
|
|
494
|
+
|
|
449
495
|
#### Defined in
|
|
450
496
|
|
|
451
|
-
[src/Line3D.ts:344](https://github.com/Immugio/three-math-extensions/blob/
|
|
497
|
+
[src/Line3D.ts:344](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L344)
|
|
452
498
|
|
|
453
499
|
___
|
|
454
500
|
|
|
@@ -458,13 +504,6 @@ ___
|
|
|
458
504
|
|
|
459
505
|
Joins a copy of this line with the
|
|
460
506
|
|
|
461
|
-
**`Other`**
|
|
462
|
-
|
|
463
|
-
line.
|
|
464
|
-
Other must be parallel to this line.
|
|
465
|
-
Returns null if there is no overlap
|
|
466
|
-
Clones the line, does not modify this.
|
|
467
|
-
|
|
468
507
|
#### Parameters
|
|
469
508
|
|
|
470
509
|
| Name | Type | Default value |
|
|
@@ -477,9 +516,16 @@ Clones the line, does not modify this.
|
|
|
477
516
|
|
|
478
517
|
[`Line3D`](Line3D.md)
|
|
479
518
|
|
|
519
|
+
**`Other`**
|
|
520
|
+
|
|
521
|
+
line.
|
|
522
|
+
Other must be parallel to this line.
|
|
523
|
+
Returns null if there is no overlap
|
|
524
|
+
Clones the line, does not modify this.
|
|
525
|
+
|
|
480
526
|
#### Defined in
|
|
481
527
|
|
|
482
|
-
[src/Line3D.ts:111](https://github.com/Immugio/three-math-extensions/blob/
|
|
528
|
+
[src/Line3D.ts:111](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L111)
|
|
483
529
|
|
|
484
530
|
___
|
|
485
531
|
|
|
@@ -499,7 +545,7 @@ ___
|
|
|
499
545
|
|
|
500
546
|
#### Defined in
|
|
501
547
|
|
|
502
|
-
[src/Line3D.ts:380](https://github.com/Immugio/three-math-extensions/blob/
|
|
548
|
+
[src/Line3D.ts:380](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L380)
|
|
503
549
|
|
|
504
550
|
___
|
|
505
551
|
|
|
@@ -519,7 +565,7 @@ ___
|
|
|
519
565
|
|
|
520
566
|
#### Defined in
|
|
521
567
|
|
|
522
|
-
[src/Line3D.ts:368](https://github.com/Immugio/three-math-extensions/blob/
|
|
568
|
+
[src/Line3D.ts:368](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L368)
|
|
523
569
|
|
|
524
570
|
___
|
|
525
571
|
|
|
@@ -535,7 +581,7 @@ Project the line to 2D space, Y value is dropped
|
|
|
535
581
|
|
|
536
582
|
#### Defined in
|
|
537
583
|
|
|
538
|
-
[src/Line3D.ts:
|
|
584
|
+
[src/Line3D.ts:563](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L563)
|
|
539
585
|
|
|
540
586
|
___
|
|
541
587
|
|
|
@@ -545,10 +591,6 @@ ___
|
|
|
545
591
|
|
|
546
592
|
Returns true if there is any overlap between this line and the
|
|
547
593
|
|
|
548
|
-
**`Other`**
|
|
549
|
-
|
|
550
|
-
line section.
|
|
551
|
-
|
|
552
594
|
#### Parameters
|
|
553
595
|
|
|
554
596
|
| Name | Type | Default value |
|
|
@@ -561,9 +603,13 @@ line section.
|
|
|
561
603
|
|
|
562
604
|
`boolean`
|
|
563
605
|
|
|
606
|
+
**`Other`**
|
|
607
|
+
|
|
608
|
+
line section.
|
|
609
|
+
|
|
564
610
|
#### Defined in
|
|
565
611
|
|
|
566
|
-
[src/Line3D.ts:210](https://github.com/Immugio/three-math-extensions/blob/
|
|
612
|
+
[src/Line3D.ts:210](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L210)
|
|
567
613
|
|
|
568
614
|
___
|
|
569
615
|
|
|
@@ -586,7 +632,7 @@ Returns a new line that is the projection of this line onto @other. Uses `closes
|
|
|
586
632
|
|
|
587
633
|
#### Defined in
|
|
588
634
|
|
|
589
|
-
[src/Line3D.ts:394](https://github.com/Immugio/three-math-extensions/blob/
|
|
635
|
+
[src/Line3D.ts:394](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L394)
|
|
590
636
|
|
|
591
637
|
___
|
|
592
638
|
|
|
@@ -606,7 +652,7 @@ ___
|
|
|
606
652
|
|
|
607
653
|
#### Defined in
|
|
608
654
|
|
|
609
|
-
[src/Line3D.ts:359](https://github.com/Immugio/three-math-extensions/blob/
|
|
655
|
+
[src/Line3D.ts:359](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L359)
|
|
610
656
|
|
|
611
657
|
___
|
|
612
658
|
|
|
@@ -628,7 +674,7 @@ Set the center of the line to the provided point. Length and direction remain un
|
|
|
628
674
|
|
|
629
675
|
#### Defined in
|
|
630
676
|
|
|
631
|
-
[src/Line3D.ts:278](https://github.com/Immugio/three-math-extensions/blob/
|
|
677
|
+
[src/Line3D.ts:278](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L278)
|
|
632
678
|
|
|
633
679
|
___
|
|
634
680
|
|
|
@@ -650,7 +696,7 @@ Set the length of this line. Center and direction remain unchanged.
|
|
|
650
696
|
|
|
651
697
|
#### Defined in
|
|
652
698
|
|
|
653
|
-
[src/Line3D.ts:255](https://github.com/Immugio/three-math-extensions/blob/
|
|
699
|
+
[src/Line3D.ts:255](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L255)
|
|
654
700
|
|
|
655
701
|
___
|
|
656
702
|
|
|
@@ -664,7 +710,7 @@ ___
|
|
|
664
710
|
|
|
665
711
|
#### Defined in
|
|
666
712
|
|
|
667
|
-
[src/Line3D.ts:
|
|
713
|
+
[src/Line3D.ts:581](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L581)
|
|
668
714
|
|
|
669
715
|
___
|
|
670
716
|
|
|
@@ -686,20 +732,21 @@ Move this line by the given vector.
|
|
|
686
732
|
|
|
687
733
|
#### Defined in
|
|
688
734
|
|
|
689
|
-
[src/Line3D.ts:441](https://github.com/Immugio/three-math-extensions/blob/
|
|
735
|
+
[src/Line3D.ts:441](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L441)
|
|
690
736
|
|
|
691
737
|
___
|
|
692
738
|
|
|
693
739
|
### fromPoints
|
|
694
740
|
|
|
695
|
-
▸
|
|
741
|
+
▸ **fromPoints**(`start`, `end`, `index?`): [`Line3D`](Line3D.md)
|
|
696
742
|
|
|
697
743
|
#### Parameters
|
|
698
744
|
|
|
699
|
-
| Name | Type |
|
|
700
|
-
| :------ | :------ |
|
|
701
|
-
| `start` | [`Point3`](../interfaces/Point3.md) |
|
|
702
|
-
| `end` | [`Point3`](../interfaces/Point3.md) |
|
|
745
|
+
| Name | Type | Default value |
|
|
746
|
+
| :------ | :------ | :------ |
|
|
747
|
+
| `start` | [`Point3`](../interfaces/Point3.md) | `undefined` |
|
|
748
|
+
| `end` | [`Point3`](../interfaces/Point3.md) | `undefined` |
|
|
749
|
+
| `index` | `number` | `0` |
|
|
703
750
|
|
|
704
751
|
#### Returns
|
|
705
752
|
|
|
@@ -707,13 +754,13 @@ ___
|
|
|
707
754
|
|
|
708
755
|
#### Defined in
|
|
709
756
|
|
|
710
|
-
[src/Line3D.ts:18](https://github.com/Immugio/three-math-extensions/blob/
|
|
757
|
+
[src/Line3D.ts:18](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L18)
|
|
711
758
|
|
|
712
759
|
___
|
|
713
760
|
|
|
714
761
|
### fromPolygon
|
|
715
762
|
|
|
716
|
-
▸
|
|
763
|
+
▸ **fromPolygon**(`polygon`, `forceClosedPolygon?`): [`Line3D`](Line3D.md)[]
|
|
717
764
|
|
|
718
765
|
Creates a polygon formed by an array of lines from points provided.
|
|
719
766
|
The polygon will only be closed if either
|
|
@@ -732,13 +779,37 @@ The polygon will only be closed if either
|
|
|
732
779
|
|
|
733
780
|
#### Defined in
|
|
734
781
|
|
|
735
|
-
[src/Line3D.ts:27](https://github.com/Immugio/three-math-extensions/blob/
|
|
782
|
+
[src/Line3D.ts:27](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L27)
|
|
783
|
+
|
|
784
|
+
___
|
|
785
|
+
|
|
786
|
+
### groupConnectedLines
|
|
787
|
+
|
|
788
|
+
▸ **groupConnectedLines**(`lines`, `tolerance?`, `breakpoints?`): [`Line3D`](Line3D.md)[][]
|
|
789
|
+
|
|
790
|
+
Accepts an array of Line3D and groups them into arrays of connected lines
|
|
791
|
+
|
|
792
|
+
#### Parameters
|
|
793
|
+
|
|
794
|
+
| Name | Type | Default value | Description |
|
|
795
|
+
| :------ | :------ | :------ | :------ |
|
|
796
|
+
| `lines` | [`Line3D`](Line3D.md)[] | `undefined` | Lines to be grouped |
|
|
797
|
+
| `tolerance` | `number` | `0` | Tolerance for considering lines as connected |
|
|
798
|
+
| `breakpoints` | [`Vec3`](Vec3.md)[] | `[]` | |
|
|
799
|
+
|
|
800
|
+
#### Returns
|
|
801
|
+
|
|
802
|
+
[`Line3D`](Line3D.md)[][]
|
|
803
|
+
|
|
804
|
+
#### Defined in
|
|
805
|
+
|
|
806
|
+
[src/Line3D.ts:511](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L511)
|
|
736
807
|
|
|
737
808
|
___
|
|
738
809
|
|
|
739
810
|
### joinLines
|
|
740
811
|
|
|
741
|
-
▸
|
|
812
|
+
▸ **joinLines**(`lines`, `distanceTolerance?`, `parallelTolerance?`): [`Line3D`](Line3D.md)[]
|
|
742
813
|
|
|
743
814
|
Joins provided lines into several joined lines.
|
|
744
815
|
Lines must be parallel for joining.
|
|
@@ -757,4 +828,4 @@ Lines must be parallel for joining.
|
|
|
757
828
|
|
|
758
829
|
#### Defined in
|
|
759
830
|
|
|
760
|
-
[src/Line3D.ts:165](https://github.com/Immugio/three-math-extensions/blob/
|
|
831
|
+
[src/Line3D.ts:165](https://github.com/Immugio/three-math-extensions/blob/905d178/src/Line3D.ts#L165)
|