@itwin/core-geometry 4.0.0-dev.55 → 4.0.0-dev.56
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/cjs/Geometry.d.ts +5 -1
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +5 -1
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/geometry3d/Angle.d.ts +29 -34
- package/lib/cjs/geometry3d/Angle.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Angle.js +31 -36
- package/lib/cjs/geometry3d/Angle.js.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.d.ts +48 -43
- package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js +48 -43
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +5 -8
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +5 -8
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/OrderedRotationAngles.d.ts +3 -3
- package/lib/cjs/geometry3d/OrderedRotationAngles.d.ts.map +1 -1
- package/lib/cjs/geometry3d/OrderedRotationAngles.js +3 -3
- package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dArrayCarrier.d.ts +8 -10
- package/lib/cjs/geometry3d/Point2dArrayCarrier.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point2dArrayCarrier.js +8 -10
- package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.d.ts +37 -34
- package/lib/cjs/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.js +38 -35
- package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts +17 -21
- package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js +16 -20
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +84 -67
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +84 -67
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts +76 -66
- package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Transform.js +88 -77
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.d.ts +15 -16
- package/lib/cjs/geometry3d/YawPitchRollAngles.d.ts.map +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.js +14 -15
- package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts +72 -58
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js +132 -108
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/Geometry.d.ts +5 -1
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +5 -1
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/geometry3d/Angle.d.ts +29 -34
- package/lib/esm/geometry3d/Angle.d.ts.map +1 -1
- package/lib/esm/geometry3d/Angle.js +31 -36
- package/lib/esm/geometry3d/Angle.js.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.d.ts +48 -43
- package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js +48 -43
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +5 -8
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +5 -8
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/OrderedRotationAngles.d.ts +3 -3
- package/lib/esm/geometry3d/OrderedRotationAngles.d.ts.map +1 -1
- package/lib/esm/geometry3d/OrderedRotationAngles.js +3 -3
- package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/esm/geometry3d/Point2dArrayCarrier.d.ts +8 -10
- package/lib/esm/geometry3d/Point2dArrayCarrier.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point2dArrayCarrier.js +8 -10
- package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.d.ts +37 -34
- package/lib/esm/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.js +38 -35
- package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts +17 -21
- package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js +16 -20
- package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +84 -67
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +84 -67
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts +76 -66
- package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
- package/lib/esm/geometry3d/Transform.js +88 -77
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.d.ts +15 -16
- package/lib/esm/geometry3d/YawPitchRollAngles.d.ts.map +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.js +14 -15
- package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts +72 -58
- package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js +132 -108
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/package.json +3 -3
|
@@ -64,19 +64,22 @@ export class SteppedIndexFunctionFactory {
|
|
|
64
64
|
static createConstant(value = 0) {
|
|
65
65
|
return (_i, _n) => value;
|
|
66
66
|
}
|
|
67
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* Return a function that steps linearly
|
|
68
69
|
* * f(i,n) = y0 + (i/n) * a
|
|
69
70
|
*/
|
|
70
71
|
static createLinear(a, f0 = 0) {
|
|
71
72
|
return (i, n) => (f0 + a * (i / n));
|
|
72
73
|
}
|
|
73
|
-
/**
|
|
74
|
+
/**
|
|
75
|
+
* Return a function that steps with cosine of angles in sweep
|
|
74
76
|
* * f(i,n) = y0 + amplitude * cos(i/n)
|
|
75
77
|
*/
|
|
76
78
|
static createCosine(amplitude, sweep = AngleSweep.create360(), f0 = 0) {
|
|
77
79
|
return (i, n) => (f0 + amplitude * Math.cos(sweep.fractionToRadians(i / n)));
|
|
78
80
|
}
|
|
79
|
-
/**
|
|
81
|
+
/**
|
|
82
|
+
* Return a function that steps with cosine of angles in sweep.
|
|
80
83
|
* * f(i,n) = y0 + amplitude * sin(i/n)
|
|
81
84
|
*/
|
|
82
85
|
static createSine(amplitude, sweep = AngleSweep.create360(), f0 = 0) {
|
|
@@ -88,7 +91,8 @@ export class SteppedIndexFunctionFactory {
|
|
|
88
91
|
* @alpha
|
|
89
92
|
*/
|
|
90
93
|
class Sample {
|
|
91
|
-
/**
|
|
94
|
+
/**
|
|
95
|
+
* Return an array of Point3d, with x,y,z all stepping through a range of values.
|
|
92
96
|
* x varies fastest, then y then z
|
|
93
97
|
*/
|
|
94
98
|
static createPoint3dLattice(low, step, high) {
|
|
@@ -99,7 +103,8 @@ class Sample {
|
|
|
99
103
|
points.push(Point3d.create(x, y, z));
|
|
100
104
|
return points;
|
|
101
105
|
}
|
|
102
|
-
/**
|
|
106
|
+
/**
|
|
107
|
+
* Return an array of Point2d, with x,y all stepping through a range of values.
|
|
103
108
|
* x varies fastest, then y
|
|
104
109
|
*/
|
|
105
110
|
static createPoint2dLattice(low, step, high) {
|
|
@@ -147,7 +152,8 @@ class Sample {
|
|
|
147
152
|
static createCenteredRectangleXY(cx, cy, ax, ay, z = 0) {
|
|
148
153
|
return this.createRectangleXY(cx - ax, cy - ay, 2 * ax, 2 * ay, z);
|
|
149
154
|
}
|
|
150
|
-
/**
|
|
155
|
+
/**
|
|
156
|
+
* Access the last point in the array. push another shifted by dx,dy,dz.
|
|
151
157
|
* * No push if all are 0.
|
|
152
158
|
* * If array is empty, push a leading 000
|
|
153
159
|
*/
|
|
@@ -169,7 +175,8 @@ class Sample {
|
|
|
169
175
|
points.push(points[0].clone());
|
|
170
176
|
return points;
|
|
171
177
|
}
|
|
172
|
-
/**
|
|
178
|
+
/**
|
|
179
|
+
* Create points for an L shaped polygon
|
|
173
180
|
* * lower left at x0,y0.
|
|
174
181
|
* * ax,ay are larger side lengths (lower left to corners along x and y directions)
|
|
175
182
|
* * bx,by are smaller side lengths (inner corner to points along x and y directions)
|
|
@@ -194,7 +201,7 @@ class Sample {
|
|
|
194
201
|
return [
|
|
195
202
|
plane0, plane1, plane2,
|
|
196
203
|
ClipPlane.createNormalAndDistance(Vector3d.create(3, 4, 0), 2.0),
|
|
197
|
-
ClipPlane.createEdgeXY(Point3d.create(1, 0, 0), Point3d.create(24, 32, 0))
|
|
204
|
+
ClipPlane.createEdgeXY(Point3d.create(1, 0, 0), Point3d.create(24, 32, 0)),
|
|
198
205
|
];
|
|
199
206
|
}
|
|
200
207
|
/**
|
|
@@ -210,16 +217,17 @@ class Sample {
|
|
|
210
217
|
const quadrant4 = ConvexClipPlaneSet.createXYBox(0, -1, 1, 0);
|
|
211
218
|
result.push(UnionOfConvexClipPlaneSets.createConvexSets([
|
|
212
219
|
quadrant1.clone(),
|
|
213
|
-
quadrant4.clone()
|
|
220
|
+
quadrant4.clone(),
|
|
214
221
|
]));
|
|
215
222
|
result.push(UnionOfConvexClipPlaneSets.createConvexSets([
|
|
216
223
|
quadrant1.clone(),
|
|
217
224
|
quadrant2.clone(),
|
|
218
|
-
quadrant4.clone()
|
|
225
|
+
quadrant4.clone(),
|
|
219
226
|
]));
|
|
220
227
|
return result;
|
|
221
228
|
}
|
|
222
|
-
/**
|
|
229
|
+
/**
|
|
230
|
+
* Create (unweighted) bspline curves.
|
|
223
231
|
* order varies from 2 to 5
|
|
224
232
|
*/
|
|
225
233
|
static createBsplineCurves(includeMultipleKnots = false) {
|
|
@@ -256,7 +264,8 @@ class Sample {
|
|
|
256
264
|
}
|
|
257
265
|
return result;
|
|
258
266
|
}
|
|
259
|
-
/**
|
|
267
|
+
/**
|
|
268
|
+
* Create weighted bspline curves.
|
|
260
269
|
* order varies from 2 to 5
|
|
261
270
|
*/
|
|
262
271
|
static createBspline3dHCurves() {
|
|
@@ -294,8 +303,7 @@ class Sample {
|
|
|
294
303
|
}
|
|
295
304
|
return result;
|
|
296
305
|
}
|
|
297
|
-
/** Create weighted bsplines for circular arcs.
|
|
298
|
-
*/
|
|
306
|
+
/** Create weighted bsplines for circular arcs. */
|
|
299
307
|
static createBspline3dHArcs() {
|
|
300
308
|
const result = [];
|
|
301
309
|
const halfRadians = Angle.degreesToRadians(60.0);
|
|
@@ -310,14 +318,15 @@ class Sample {
|
|
|
310
318
|
Point4d.create(-1, 0, 0, c),
|
|
311
319
|
Point4d.create(-c, -s, 0, 1),
|
|
312
320
|
Point4d.create(c, -s, 0, c),
|
|
313
|
-
Point4d.create(1, 0, 0, 1)
|
|
321
|
+
Point4d.create(1, 0, 0, 1),
|
|
314
322
|
];
|
|
315
323
|
const knots = [0, 0, 1, 1, 2, 2, 3, 3];
|
|
316
324
|
const curve = BSplineCurve3dH.create(points, knots, 3);
|
|
317
325
|
result.push(curve);
|
|
318
326
|
return result;
|
|
319
327
|
}
|
|
320
|
-
/**
|
|
328
|
+
/**
|
|
329
|
+
* Return array [x,y,z,w] bspline control points for an arc in 90 degree bspline spans.
|
|
321
330
|
* @param points array of [x,y,z,w]
|
|
322
331
|
* @param center center of arc
|
|
323
332
|
* @param axes matrix with 0 and 90 degree axes
|
|
@@ -363,7 +372,7 @@ class Sample {
|
|
|
363
372
|
result.push(b);
|
|
364
373
|
return result;
|
|
365
374
|
}
|
|
366
|
-
/**
|
|
375
|
+
/** Create a plane from origin and normal coordinates -- default to 001 normal if needed. */
|
|
367
376
|
static createPlane(x, y, z, u, v, w) {
|
|
368
377
|
const point = Point3d.create(x, y, z);
|
|
369
378
|
const vector = Vector3d.create(u, v, w).normalize();
|
|
@@ -383,22 +392,23 @@ class Sample {
|
|
|
383
392
|
return [
|
|
384
393
|
LineString3d.createPoints([
|
|
385
394
|
Point3d.create(0, 0, 0),
|
|
386
|
-
Point3d.create(1, 0, 0)
|
|
395
|
+
Point3d.create(1, 0, 0),
|
|
387
396
|
]),
|
|
388
397
|
LineString3d.createPoints([
|
|
389
398
|
Point3d.create(0, 0, 0),
|
|
390
399
|
Point3d.create(1, 0, 0),
|
|
391
|
-
Point3d.create(1, 1, 0)
|
|
400
|
+
Point3d.create(1, 1, 0),
|
|
392
401
|
]),
|
|
393
402
|
LineString3d.createPoints([
|
|
394
403
|
Point3d.create(0, 0, 0),
|
|
395
404
|
Point3d.create(1, 0, 0),
|
|
396
405
|
Point3d.create(1, 1, 0),
|
|
397
|
-
Point3d.create(2, 2, 0)
|
|
398
|
-
])
|
|
406
|
+
Point3d.create(2, 2, 0),
|
|
407
|
+
]),
|
|
399
408
|
];
|
|
400
409
|
}
|
|
401
|
-
/**
|
|
410
|
+
/**
|
|
411
|
+
* Assorted Matrix3d:
|
|
402
412
|
* * identity
|
|
403
413
|
* * rotation around x
|
|
404
414
|
* * rotation around general vector
|
|
@@ -423,10 +433,11 @@ class Sample {
|
|
|
423
433
|
Transform.createTranslationXYZ(1, 2, 0),
|
|
424
434
|
Transform.createTranslationXYZ(1, 2, 3),
|
|
425
435
|
Transform.createFixedPointAndMatrix(Point3d.create(4, 1, -2), Matrix3d.createUniformScale(2.0)),
|
|
426
|
-
Transform.createFixedPointAndMatrix(Point3d.create(4, 1, -2), Matrix3d.createRotationAroundVector(Vector3d.create(1, 2, 3), Angle.createRadians(10)))
|
|
436
|
+
Transform.createFixedPointAndMatrix(Point3d.create(4, 1, -2), Matrix3d.createRotationAroundVector(Vector3d.create(1, 2, 3), Angle.createRadians(10))),
|
|
427
437
|
];
|
|
428
438
|
}
|
|
429
|
-
/**
|
|
439
|
+
/**
|
|
440
|
+
* Return an array of Matrix3d with various skew and scale. This includes at least:
|
|
430
441
|
* * identity
|
|
431
442
|
* * 3 distinct diagonals.
|
|
432
443
|
* * The distinct diagonal base with smaller value added to other 6 spots in succession.
|
|
@@ -445,9 +456,10 @@ class Sample {
|
|
|
445
456
|
Matrix3d.createRowValues(5, 2, 3, 2, 6, 1, -1, 2, 7),
|
|
446
457
|
];
|
|
447
458
|
}
|
|
448
|
-
/**
|
|
459
|
+
/**
|
|
460
|
+
* Return an array of singular Matrix3d. This includes at least:
|
|
449
461
|
* * all zeros
|
|
450
|
-
* * one
|
|
462
|
+
* * one non-zero column
|
|
451
463
|
* * two independent columns, third is zero
|
|
452
464
|
* * two independent columns, third is sum of those
|
|
453
465
|
* * two independent columns, third is copy of one
|
|
@@ -459,26 +471,26 @@ class Sample {
|
|
|
459
471
|
const vector0 = Vector3d.createZero();
|
|
460
472
|
return [
|
|
461
473
|
Matrix3d.createZero(),
|
|
462
|
-
// one
|
|
474
|
+
// one non-zero column
|
|
463
475
|
Matrix3d.createColumns(vectorU, vector0, vector0),
|
|
464
476
|
Matrix3d.createColumns(vector0, vectorU, vector0),
|
|
465
|
-
Matrix3d.createColumns(vector0, vector0,
|
|
466
|
-
// two independent
|
|
477
|
+
Matrix3d.createColumns(vector0, vector0, vectorU),
|
|
478
|
+
// two independent non-zero columns with one zero column
|
|
467
479
|
Matrix3d.createColumns(vectorU, vectorV, vector0),
|
|
468
480
|
Matrix3d.createColumns(vector0, vectorU, vectorV),
|
|
469
|
-
Matrix3d.createColumns(
|
|
470
|
-
//
|
|
481
|
+
Matrix3d.createColumns(vectorU, vector0, vectorV),
|
|
482
|
+
// two independent columns with one dependent column
|
|
471
483
|
Matrix3d.createColumns(vectorU, vectorV, vectorUPlusV),
|
|
472
484
|
Matrix3d.createColumns(vectorU, vectorUPlusV, vectorV),
|
|
473
|
-
Matrix3d.createColumns(vectorUPlusV,
|
|
474
|
-
// two independent with duplicate
|
|
475
|
-
Matrix3d.createColumns(vectorU, vectorV, vectorU),
|
|
485
|
+
Matrix3d.createColumns(vectorUPlusV, vectorU, vectorV),
|
|
486
|
+
// two independent with columns with one duplicate column
|
|
476
487
|
Matrix3d.createColumns(vectorU, vectorU, vectorV),
|
|
477
|
-
Matrix3d.createColumns(
|
|
488
|
+
Matrix3d.createColumns(vectorU, vectorV, vectorU),
|
|
489
|
+
Matrix3d.createColumns(vectorV, vectorU, vectorU),
|
|
478
490
|
];
|
|
479
491
|
}
|
|
480
492
|
/**
|
|
481
|
-
*
|
|
493
|
+
* Return an array of rigid transforms. This includes (at least)
|
|
482
494
|
* * Identity
|
|
483
495
|
* * translation with identity matrix
|
|
484
496
|
* * rotation around origin and arbitrary vector
|
|
@@ -493,16 +505,15 @@ class Sample {
|
|
|
493
505
|
Transform.createTranslationXYZ(distanceScale3 * 1, distanceScale3 * 2, distanceScale3 * 3),
|
|
494
506
|
Transform.createFixedPointAndMatrix(Point3d.create(0, 0, 0), Matrix3d.createRotationAroundVector(Vector3d.unitY(), Angle.createDegrees(10))),
|
|
495
507
|
Transform.createFixedPointAndMatrix(Point3d.create(distanceScale4 * 4, distanceScale4 * 1, -distanceScale4 * 2), Matrix3d.createRotationAroundVector(Vector3d.create(1, 2, 3), Angle.createDegrees(10))),
|
|
496
|
-
Transform.createFixedPointAndMatrix(Point3d.create(distanceScale4 * 4, distanceScale4 * 1, -distanceScale4 * 2), Matrix3d.createRotationAroundVector(Vector3d.create(-2, 1, 4), Angle.createDegrees(35)))
|
|
508
|
+
Transform.createFixedPointAndMatrix(Point3d.create(distanceScale4 * 4, distanceScale4 * 1, -distanceScale4 * 2), Matrix3d.createRotationAroundVector(Vector3d.create(-2, 1, 4), Angle.createDegrees(35))),
|
|
497
509
|
];
|
|
498
510
|
}
|
|
499
|
-
/**
|
|
500
|
-
* Return a single rigid transform with all terms nonzero.
|
|
501
|
-
*/
|
|
511
|
+
/** Return a single rigid transform with all terms nonzero. */
|
|
502
512
|
static createMessyRigidTransform(fixedPoint) {
|
|
503
513
|
return Transform.createFixedPointAndMatrix(fixedPoint ? fixedPoint : Point3d.create(1, 2, 3), Matrix3d.createRotationAroundVector(Vector3d.create(0.3, -0.2, 1.2), Angle.createDegrees(15.7)));
|
|
504
514
|
}
|
|
505
|
-
/**
|
|
515
|
+
/**
|
|
516
|
+
* Return various rigid matrices:
|
|
506
517
|
* * identity
|
|
507
518
|
* * small rotations around x, y, z
|
|
508
519
|
* * small rotation around (1,2,3)
|
|
@@ -532,9 +543,7 @@ class Sample {
|
|
|
532
543
|
}
|
|
533
544
|
return result;
|
|
534
545
|
}
|
|
535
|
-
/**
|
|
536
|
-
* Create full Map4d for each `Sample.createInvertibleTransforms ()`
|
|
537
|
-
*/
|
|
546
|
+
/** Create full Map4d for each `Sample.createInvertibleTransforms()` */
|
|
538
547
|
static createMap4ds() {
|
|
539
548
|
const result = [];
|
|
540
549
|
let transform;
|
|
@@ -552,7 +561,12 @@ class Sample {
|
|
|
552
561
|
static createSimplePaths(withGaps = false) {
|
|
553
562
|
const point0 = Point3d.create(0, 0, 0);
|
|
554
563
|
const point1 = Point3d.create(10, 0, 0);
|
|
555
|
-
const p1 = [
|
|
564
|
+
const p1 = [
|
|
565
|
+
point1, Point3d.create(0, 10, 0),
|
|
566
|
+
Point3d.create(6, 10, 0),
|
|
567
|
+
Point3d.create(6, 10, 0),
|
|
568
|
+
Point3d.create(0, 10, 0),
|
|
569
|
+
];
|
|
556
570
|
const segment1 = LineSegment3d.create(point0, point1);
|
|
557
571
|
const vectorU = Vector3d.unitX(3);
|
|
558
572
|
const vectorV = Vector3d.unitY(3);
|
|
@@ -567,7 +581,8 @@ class Sample {
|
|
|
567
581
|
simplePaths.push(Path.create(LineSegment3d.create(Point3d.create(0, 0, 0), Point3d.create(10, 0, 0)), LineSegment3d.create(Point3d.create(10, 10, 0), Point3d.create(5, 0, 0))));
|
|
568
582
|
return simplePaths;
|
|
569
583
|
}
|
|
570
|
-
/**
|
|
584
|
+
/**
|
|
585
|
+
* Assorted `Path` with lines and arcs.
|
|
571
586
|
* Specifically useful for offset tests.
|
|
572
587
|
*/
|
|
573
588
|
static createLineArcPaths() {
|
|
@@ -596,12 +611,16 @@ class Sample {
|
|
|
596
611
|
}
|
|
597
612
|
/** Assorted `PointString3d` objects. */
|
|
598
613
|
static createSimplePointStrings() {
|
|
599
|
-
const p1 = [
|
|
614
|
+
const p1 = [
|
|
615
|
+
[Point3d.create(0, 10, 0)],
|
|
616
|
+
[Point3d.create(6, 10, 0)],
|
|
617
|
+
[Point3d.create(6, 10, 0), [Point3d.create(6, 10, 0)]],
|
|
618
|
+
];
|
|
600
619
|
const simplePaths = [
|
|
601
620
|
PointString3d.create(Point3d.create(1, 2, 0)),
|
|
602
621
|
PointString3d.create(Point3d.create(0, 0, 0), Point3d.create(10, 0, 0)),
|
|
603
622
|
PointString3d.create(Point3d.create(10, 0, 0), Point3d.create(10, 5, 0)),
|
|
604
|
-
PointString3d.create(p1)
|
|
623
|
+
PointString3d.create(p1),
|
|
605
624
|
];
|
|
606
625
|
return simplePaths;
|
|
607
626
|
}
|
|
@@ -630,8 +649,7 @@ class Sample {
|
|
|
630
649
|
* @param dx1 distance along x axis at y=dy
|
|
631
650
|
* @param numPhase number of phases of the jump.
|
|
632
651
|
* @param dyReturn y value for return to origin. If 0, the wave ends at y=0 after then final "down" with one extra horizontal dx0
|
|
633
|
-
*
|
|
634
|
-
*
|
|
652
|
+
* If nonzero, rise to that y value, return to x=0, and return down to origin.
|
|
635
653
|
*/
|
|
636
654
|
static createSquareWave(origin, dx0, dy, dx1, numPhase, dyReturn) {
|
|
637
655
|
const result = [origin.clone()];
|
|
@@ -692,7 +710,7 @@ class Sample {
|
|
|
692
710
|
}
|
|
693
711
|
return points;
|
|
694
712
|
}
|
|
695
|
-
/**
|
|
713
|
+
/** Append sawtooth with x distances successively scaled by xFactor */
|
|
696
714
|
static appendVariableSawTooth(points, dxLow, riseX, riseY, dxHigh, numPhase, xFactor) {
|
|
697
715
|
let factor = 1.0;
|
|
698
716
|
for (let i = 0; i < numPhase; i++) {
|
|
@@ -733,7 +751,8 @@ class Sample {
|
|
|
733
751
|
data.push(data[0].clone());
|
|
734
752
|
return data;
|
|
735
753
|
}
|
|
736
|
-
/**
|
|
754
|
+
/**
|
|
755
|
+
* Append to a linestring, taking steps along given vector directions
|
|
737
756
|
* If the linestring is empty, a 000 point is added.
|
|
738
757
|
* @param linestring LineString3d to receive points.
|
|
739
758
|
* @param numPhase number of phases of the sawtooth
|
|
@@ -750,7 +769,8 @@ class Sample {
|
|
|
750
769
|
}
|
|
751
770
|
}
|
|
752
771
|
}
|
|
753
|
-
/**
|
|
772
|
+
/**
|
|
773
|
+
* Assorted regions with arc boundaries
|
|
754
774
|
* * full circle
|
|
755
775
|
* * with varying sweep:
|
|
756
776
|
* * partial arc with single chord closure
|
|
@@ -777,7 +797,8 @@ class Sample {
|
|
|
777
797
|
}
|
|
778
798
|
return result;
|
|
779
799
|
}
|
|
780
|
-
/**
|
|
800
|
+
/**
|
|
801
|
+
* Assorted loops in xy plane:
|
|
781
802
|
* * unit square
|
|
782
803
|
* * rectangle
|
|
783
804
|
* * L shape
|
|
@@ -817,10 +838,14 @@ class Sample {
|
|
|
817
838
|
];
|
|
818
839
|
if (includeBCurves) {
|
|
819
840
|
const ey = 1.0;
|
|
820
|
-
result.push(ParityRegion.create(Loop.create(LineSegment3d.create(point0, pointA), BSplineCurve3d.createUniformKnots([
|
|
841
|
+
result.push(ParityRegion.create(Loop.create(LineSegment3d.create(point0, pointA), BSplineCurve3d.createUniformKnots([
|
|
842
|
+
pointA,
|
|
843
|
+
Point3d.create(ax + 1, ey),
|
|
821
844
|
Point3d.create(ax + 1, 2 * ey),
|
|
822
845
|
Point3d.create(ax + 2, 3 * ey),
|
|
823
|
-
Point3d.create(ax + 1, 4 * ey),
|
|
846
|
+
Point3d.create(ax + 1, 4 * ey),
|
|
847
|
+
pointB,
|
|
848
|
+
], 3), Arc3d.createCircularStartMiddleEnd(pointB, pointC1, point0))));
|
|
824
849
|
}
|
|
825
850
|
return result;
|
|
826
851
|
}
|
|
@@ -834,7 +859,7 @@ class Sample {
|
|
|
834
859
|
const by = 2.0;
|
|
835
860
|
const result = [
|
|
836
861
|
UnionRegion.create(Loop.create(LineString3d.createRectangleXY(Point3d.create(0, 0, 0), ax, ay)), Loop.create(LineString3d.createRectangleXY(Point3d.create(0, 2 * ay, 0), bx, by))),
|
|
837
|
-
UnionRegion.create(Loop.create(LineString3d.create(Sample.createRectangleXY(parityRange.low.x, parityRange.high.y + 0.5, parityRange.xLength(), parityRange.yLength()))), parityRegions[0])
|
|
862
|
+
UnionRegion.create(Loop.create(LineString3d.create(Sample.createRectangleXY(parityRange.low.x, parityRange.high.y + 0.5, parityRange.xLength(), parityRange.yLength()))), parityRegions[0]),
|
|
838
863
|
];
|
|
839
864
|
return result;
|
|
840
865
|
}
|
|
@@ -853,7 +878,8 @@ class Sample {
|
|
|
853
878
|
];
|
|
854
879
|
return result;
|
|
855
880
|
}
|
|
856
|
-
/**
|
|
881
|
+
/**
|
|
882
|
+
* Assorted smooth curve primitives:
|
|
857
883
|
* * line segments
|
|
858
884
|
* * arcs
|
|
859
885
|
*/
|
|
@@ -868,7 +894,7 @@ class Sample {
|
|
|
868
894
|
Arc3d.create(Point3d.create(0, 0, 0), Vector3d.create(size, alpha * size, 0), Vector3d.create(-alpha * beta * size, beta * size, 0), AngleSweep.createStartEndDegrees(-40, 270)),
|
|
869
895
|
];
|
|
870
896
|
}
|
|
871
|
-
/**
|
|
897
|
+
/** Assorted small polyface grids, possibly expanded by gridMultiplier */
|
|
872
898
|
static createSimpleIndexedPolyfaces(gridMultiplier) {
|
|
873
899
|
const meshes = [
|
|
874
900
|
Sample.createTriangularUnitGridPolyface(Point3d.create(), Vector3d.unitX(), Vector3d.unitY(), gridMultiplier * 3, 2 * gridMultiplier, false, false, false),
|
|
@@ -1099,7 +1125,7 @@ class Sample {
|
|
|
1099
1125
|
}
|
|
1100
1126
|
return BSplineSurface3dH.create(xyzPoles, weights, numU, orderU, undefined, numV, orderV, undefined);
|
|
1101
1127
|
}
|
|
1102
|
-
/**
|
|
1128
|
+
/** Assorted linear sweeps */
|
|
1103
1129
|
static createSimpleLinearSweeps() {
|
|
1104
1130
|
const result = [];
|
|
1105
1131
|
const base = Loop.create(LineString3d.createRectangleXY(Point3d.create(), 2, 3));
|
|
@@ -1118,7 +1144,7 @@ class Sample {
|
|
|
1118
1144
|
const xyPoints = [
|
|
1119
1145
|
Point2d.create(0, 0),
|
|
1120
1146
|
Point2d.create(1, 0),
|
|
1121
|
-
Point2d.create(1, 1)
|
|
1147
|
+
Point2d.create(1, 1),
|
|
1122
1148
|
];
|
|
1123
1149
|
result.push(LinearSweep.createZSweep(xyPoints, 1, 3, false));
|
|
1124
1150
|
// this forces artificial closure point . . .
|
|
@@ -1162,7 +1188,7 @@ class Sample {
|
|
|
1162
1188
|
for (const axis of [
|
|
1163
1189
|
Ray3d.createXYZUVW(0, 0, 0, 0, 1, 0),
|
|
1164
1190
|
Ray3d.createXYZUVW(5, 0, 0, 0, 1, 0),
|
|
1165
|
-
Ray3d.createXYZUVW(-1, 0, 0, -1, 1, 0)
|
|
1191
|
+
Ray3d.createXYZUVW(-1, 0, 0, -1, 1, 0),
|
|
1166
1192
|
]) {
|
|
1167
1193
|
result.push(RotationalSweep.create(base, axis, Angle.createDegrees(45.0), false));
|
|
1168
1194
|
result.push(RotationalSweep.create(base, axis, Angle.createDegrees(150.0), true));
|
|
@@ -1187,7 +1213,7 @@ class Sample {
|
|
|
1187
1213
|
/** Create true (non-spherical) ellipsoids. */
|
|
1188
1214
|
static createEllipsoids() {
|
|
1189
1215
|
return [
|
|
1190
|
-
Sphere.createEllipsoid(Transform.createOriginAndMatrix(Point3d.create(0, 0, 0), Matrix3d.createRowValues(4, 1, 1, 1, 4, 1, 0.5, 0.2, 5)), AngleSweep.createFullLatitude(), true)
|
|
1216
|
+
Sphere.createEllipsoid(Transform.createOriginAndMatrix(Point3d.create(0, 0, 0), Matrix3d.createRowValues(4, 1, 1, 1, 4, 1, 0.5, 0.2, 5)), AngleSweep.createFullLatitude(), true),
|
|
1191
1217
|
];
|
|
1192
1218
|
}
|
|
1193
1219
|
/** Create assorted cones. */
|
|
@@ -1245,8 +1271,7 @@ class Sample {
|
|
|
1245
1271
|
result.push(Box.createDgnBox(cornerA, frameY.columnX(), frameY.columnY(), cornerA.plusScaled(frameY.columnZ(), h), aX, aY, bX, bY, capped));
|
|
1246
1272
|
return result;
|
|
1247
1273
|
}
|
|
1248
|
-
/**
|
|
1249
|
-
*/
|
|
1274
|
+
/** Create an array of points for a rectangle with corners (x0,y0,z) and (x1,y1,z) */
|
|
1250
1275
|
static createRectangle(x0, y0, x1, y1, z = 0.0, closed = false) {
|
|
1251
1276
|
const points = [
|
|
1252
1277
|
Point3d.create(x0, y0, z),
|
|
@@ -1258,8 +1283,7 @@ class Sample {
|
|
|
1258
1283
|
points.push(Point3d.create(x0, y0, z));
|
|
1259
1284
|
return points;
|
|
1260
1285
|
}
|
|
1261
|
-
/**
|
|
1262
|
-
*/
|
|
1286
|
+
/** Create an array of points for a rectangle with corners of a Range2d. */
|
|
1263
1287
|
static createRectangleInRange2d(range, z = 0.0, closed = false) {
|
|
1264
1288
|
const x0 = range.low.x;
|
|
1265
1289
|
const x1 = range.high.x;
|
|
@@ -1368,8 +1392,9 @@ class Sample {
|
|
|
1368
1392
|
}
|
|
1369
1393
|
return points;
|
|
1370
1394
|
}
|
|
1371
|
-
/**
|
|
1372
|
-
*
|
|
1395
|
+
/**
|
|
1396
|
+
* Primary shape is a "triangle" with lower edge pushed in so it becomes a mild nonconvex quad.
|
|
1397
|
+
* Fractal effects are gentle.
|
|
1373
1398
|
*/
|
|
1374
1399
|
static nonConvexQuadSimpleFractal(numRecursion, perpendicularFactor) {
|
|
1375
1400
|
const pattern = [
|
|
@@ -1386,7 +1411,7 @@ class Sample {
|
|
|
1386
1411
|
];
|
|
1387
1412
|
return Sample.createRecursiveFractalPolygon(poles, pattern, numRecursion, perpendicularFactor);
|
|
1388
1413
|
}
|
|
1389
|
-
/**
|
|
1414
|
+
/** Create a diamond with convex fractal */
|
|
1390
1415
|
static createFractalDiamondConvexPattern(numRecursion, perpendicularFactor) {
|
|
1391
1416
|
const pattern = [
|
|
1392
1417
|
Point2d.create(),
|
|
@@ -1483,7 +1508,7 @@ class Sample {
|
|
|
1483
1508
|
];
|
|
1484
1509
|
return Sample.createRecursiveFractalPolygon(poles, pattern, numRecursion, perpendicularFactor);
|
|
1485
1510
|
}
|
|
1486
|
-
/**
|
|
1511
|
+
/** Append interpolated points from the array tail to the target. */
|
|
1487
1512
|
static appendSplits(points, target, numSplit, includeTarget) {
|
|
1488
1513
|
const pointA = points[points.length - 1];
|
|
1489
1514
|
for (let i = 0; i < numSplit; i++)
|
|
@@ -1527,7 +1552,8 @@ class Sample {
|
|
|
1527
1552
|
geometry.push(LineSegment3d.createXYZXYZ(x0, y1, z0, x0, y1, z1));
|
|
1528
1553
|
return geometry;
|
|
1529
1554
|
}
|
|
1530
|
-
/**
|
|
1555
|
+
/**
|
|
1556
|
+
* Assorted transition spirals
|
|
1531
1557
|
* * (All combinations of bearing radius bearing radius length subsets.)
|
|
1532
1558
|
*/
|
|
1533
1559
|
static createSimpleTransitionSpirals() {
|
|
@@ -1548,10 +1574,11 @@ class Sample {
|
|
|
1548
1574
|
DirectSpiral3d.createFromLengthAndRadius("ChineseCubic", r0, r1, Angle.createDegrees(0), undefined, arcLength, undefined, Transform.createOriginAndMatrix(Point3d.create(1, 2, 0), Matrix3d.createRotationAroundVector(Vector3d.unitZ(), Angle.createDegrees(15)))),
|
|
1549
1575
|
DirectSpiral3d.createFromLengthAndRadius("JapaneseCubic", r0, r1, Angle.createDegrees(0), undefined, arcLength, undefined, Transform.createOriginAndMatrix(Point3d.create(1, 2, 0), Matrix3d.createRotationAroundVector(Vector3d.unitZ(), Angle.createDegrees(15)))),
|
|
1550
1576
|
DirectSpiral3d.createFromLengthAndRadius("DirectHalfCosine", r0, r1, Angle.createDegrees(0), undefined, arcLength, undefined, Transform.createOriginAndMatrix(Point3d.create(1, 2, 0), Matrix3d.createRotationAroundVector(Vector3d.unitZ(), Angle.createDegrees(15)))),
|
|
1551
|
-
DirectSpiral3d.createCzechCubic(Transform.createIdentity(), arcLength, r1)
|
|
1577
|
+
DirectSpiral3d.createCzechCubic(Transform.createIdentity(), arcLength, r1),
|
|
1552
1578
|
];
|
|
1553
1579
|
}
|
|
1554
|
-
/**
|
|
1580
|
+
/**
|
|
1581
|
+
* Create a Bezier curve with significant twist effects
|
|
1555
1582
|
* * r and theta are circle in xy plane at steps in thetaStepper
|
|
1556
1583
|
* * z varies with sin(phi) at steps in phiStepper.
|
|
1557
1584
|
*/
|
|
@@ -1607,18 +1634,10 @@ class Sample {
|
|
|
1607
1634
|
result.push(CurveChainWithDistanceIndex.createCapture(Path.create(// arc spline with smooth joins
|
|
1608
1635
|
Arc3d.createXY(Point3d.create(5, 0), 5, AngleSweep.createStartEndDegrees(180, 0)), Arc3d.createXY(Point3d.create(15, 0), 5, AngleSweep.createStartEndDegrees(180, 360)), Arc3d.createXY(Point3d.create(25, 0), 5, AngleSweep.createStartEndDegrees(180, 0)))));
|
|
1609
1636
|
result.push(CurveChainWithDistanceIndex.createCapture(Path.create(// 2-pt Interpolation Curve
|
|
1610
|
-
InterpolationCurve3d.createCapture(InterpolationCurve3dOptions.create({
|
|
1611
|
-
fitPoints: [pointsA[0], pointsA[1]],
|
|
1612
|
-
})))));
|
|
1637
|
+
InterpolationCurve3d.createCapture(InterpolationCurve3dOptions.create({ fitPoints: [pointsA[0], pointsA[1]] })))));
|
|
1613
1638
|
result.push(CurveChainWithDistanceIndex.createCapture(Path.create(// 3-pt Interpolation Curve
|
|
1614
|
-
InterpolationCurve3d.createCapture(InterpolationCurve3dOptions.create({
|
|
1615
|
-
|
|
1616
|
-
})))));
|
|
1617
|
-
result.push(CurveChainWithDistanceIndex.createCapture(Path.create(InterpolationCurve3d.createCapture(InterpolationCurve3dOptions.create({
|
|
1618
|
-
fitPoints: pointsA,
|
|
1619
|
-
startTangent: Point3d.create(1, -1),
|
|
1620
|
-
endTangent: Point3d.create(-1, -1),
|
|
1621
|
-
})))));
|
|
1639
|
+
InterpolationCurve3d.createCapture(InterpolationCurve3dOptions.create({ fitPoints: [pointsA[0], pointsA[1], pointsA[2]] })))));
|
|
1640
|
+
result.push(CurveChainWithDistanceIndex.createCapture(Path.create(InterpolationCurve3d.createCapture(InterpolationCurve3dOptions.create({ fitPoints: pointsA, startTangent: Point3d.create(1, -1), endTangent: Point3d.create(-1, -1) })))));
|
|
1622
1641
|
result.push(CurveChainWithDistanceIndex.createCapture(Path.create(IntegratedSpiral3d.createRadiusRadiusBearingBearing(Segment1d.create(0, 100), AngleSweep.createStartEndDegrees(10, 75), Segment1d.create(0, 1), Transform.createOriginAndMatrix(Point3d.createZero(), Matrix3d.createRotationAroundAxisIndex(2, Angle.createDegrees(30))), "bloss"))));
|
|
1623
1642
|
result.push(CurveChainWithDistanceIndex.createCapture(Path.create(DirectSpiral3d.createDirectHalfCosine(Transform.createOriginAndMatrix(Point3d.createZero(), Matrix3d.createRotationAroundAxisIndex(2, Angle.createDegrees(110))), 50, 350, Segment1d.create(0, 1)))));
|
|
1624
1643
|
return result;
|
|
@@ -1702,7 +1721,7 @@ class Sample {
|
|
|
1702
1721
|
const sweep2 = AngleSweep.createStartEndDegrees(160.0, 380.0);
|
|
1703
1722
|
for (const arcs of [
|
|
1704
1723
|
Sample.createArcs(1.0), Sample.createArcs(0.5),
|
|
1705
|
-
Sample.createArcs(1.0, sweep1), Sample.createArcs(0.3, sweep2)
|
|
1724
|
+
Sample.createArcs(1.0, sweep1), Sample.createArcs(0.3, sweep2),
|
|
1706
1725
|
]) {
|
|
1707
1726
|
for (const arc of arcs)
|
|
1708
1727
|
result.push(arc);
|
|
@@ -1805,10 +1824,10 @@ class Sample {
|
|
|
1805
1824
|
return points;
|
|
1806
1825
|
}
|
|
1807
1826
|
/**
|
|
1808
|
-
* *
|
|
1809
|
-
* *
|
|
1810
|
-
* *
|
|
1811
|
-
* *
|
|
1827
|
+
* * Let ay = 4
|
|
1828
|
+
* * Base polygon has vertices (0,0), (ax,0), (2*ax,0), (2* ax,ay), (ax,ay), (0,ay), (0,0).
|
|
1829
|
+
* * Shift the x coordinates of vertices 1,4 by indicated amounts (0-based numbering)
|
|
1830
|
+
* * Shift the y coordinates for points 1,2,3,4 by indicated amounts (in 0-based numbering)
|
|
1812
1831
|
* * This is useful for testing non-y-monotonic face situations.
|
|
1813
1832
|
* * Return as points.
|
|
1814
1833
|
* @param dy1
|
|
@@ -1828,7 +1847,7 @@ class Sample {
|
|
|
1828
1847
|
return points;
|
|
1829
1848
|
}
|
|
1830
1849
|
/**
|
|
1831
|
-
*
|
|
1850
|
+
* Make line segments for each pair of adjacent points.
|
|
1832
1851
|
* @param points array of points
|
|
1833
1852
|
* @param forceClosure if true, inspect coordinates to determine if a closure edge is needed.
|
|
1834
1853
|
*/
|
|
@@ -1944,7 +1963,8 @@ class Sample {
|
|
|
1944
1963
|
this.appendGeometry(this.createBagOfCurves(), result);
|
|
1945
1964
|
return result;
|
|
1946
1965
|
}
|
|
1947
|
-
/**
|
|
1966
|
+
/**
|
|
1967
|
+
* Create points on a sine wave
|
|
1948
1968
|
* Point i is origin + (i * xStep, a *sin(theta0 + i * dTheta), b * sin(beta0 + i * dBeta))
|
|
1949
1969
|
* * Default b is zero, so it is a simple sine wave
|
|
1950
1970
|
* * If the dTheta and dBeta are equal, it is a sine wave in a tilted plane.
|
|
@@ -1953,8 +1973,9 @@ class Sample {
|
|
|
1953
1973
|
static createPointSineWave(origin, numInterval = 24, xStep = Math.PI / 12, a = 1, thetaSweep = AngleSweep.createStartEndDegrees(0, 360), b = 0, betaSweep = AngleSweep.createStartEndDegrees(0, 180)) {
|
|
1954
1974
|
return this.createPointsByIndexFunctions(numInterval, SteppedIndexFunctionFactory.createLinear(xStep, origin ? origin.x : 0), SteppedIndexFunctionFactory.createCosine(a, thetaSweep, origin ? origin.y : 0), SteppedIndexFunctionFactory.createCosine(b, betaSweep, origin ? origin.z : 0));
|
|
1955
1975
|
}
|
|
1956
|
-
/**
|
|
1957
|
-
*
|
|
1976
|
+
/**
|
|
1977
|
+
* Create points with x,y,z independent functions of i and numInterval,
|
|
1978
|
+
* Point3d.create (fx(i,numInterval), fy(i,numInterval), fz(i, numInterval));
|
|
1958
1979
|
*/
|
|
1959
1980
|
static createPointsByIndexFunctions(numInterval, fx, fy, fz) {
|
|
1960
1981
|
const points = [];
|
|
@@ -2025,9 +2046,7 @@ class Sample {
|
|
|
2025
2046
|
builder.addGreedyTriangulationBetweenLineStrings(point0, point1);
|
|
2026
2047
|
return builder.claimPolyface();
|
|
2027
2048
|
}
|
|
2028
|
-
/**
|
|
2029
|
-
* create strokes on an arc at radius r0, then returning at radius r1.
|
|
2030
|
-
*/
|
|
2049
|
+
/** Create strokes on an arc at radius r0, then returning at radius r1. */
|
|
2031
2050
|
static createAnnulusPolyline(edgesPerQuadrant, center, r0, r1, theta0, theta1, addClosure) {
|
|
2032
2051
|
const point0 = [];
|
|
2033
2052
|
const point1 = [];
|
|
@@ -2097,7 +2116,12 @@ class Sample {
|
|
|
2097
2116
|
for (let yC = 0; yC + 1 <= ySweep; yC++) {
|
|
2098
2117
|
const yD = yC + 1;
|
|
2099
2118
|
if (acceptFunction(xA, yC))
|
|
2100
|
-
builder.addPolygon([
|
|
2119
|
+
builder.addPolygon([
|
|
2120
|
+
Point3d.create(xA, yC, zA),
|
|
2121
|
+
Point3d.create(xB, yC, zB),
|
|
2122
|
+
Point3d.create(xB, yD, zB),
|
|
2123
|
+
Point3d.create(xA, yD, zA),
|
|
2124
|
+
]);
|
|
2101
2125
|
}
|
|
2102
2126
|
}
|
|
2103
2127
|
}
|
|
@@ -2155,7 +2179,7 @@ Sample.plane3dByOriginAndUnitNormal = [
|
|
|
2155
2179
|
Plane3dByOriginAndUnitNormal.createYZPlane(),
|
|
2156
2180
|
Plane3dByOriginAndUnitNormal.createZXPlane(),
|
|
2157
2181
|
Sample.createPlane(0, 0, 0, 3, 0, 1),
|
|
2158
|
-
Sample.createPlane(1, 2, 3, 2, 4, -1)
|
|
2182
|
+
Sample.createPlane(1, 2, 3, 2, 4, -1),
|
|
2159
2183
|
];
|
|
2160
2184
|
/** Assorted Ray3d, not all unit direction vectors. */
|
|
2161
2185
|
Sample.ray3d = [
|
|
@@ -2163,7 +2187,7 @@ Sample.ray3d = [
|
|
|
2163
2187
|
Sample.createRay(0, 0, 0, 0, 1, 0),
|
|
2164
2188
|
Sample.createRay(0, 0, 0, 0, 0, 1),
|
|
2165
2189
|
Sample.createRay(0, 0, 0, 1, 2, 0),
|
|
2166
|
-
Sample.createRay(1, 2, 3, 4, 2, -1)
|
|
2190
|
+
Sample.createRay(1, 2, 3, 4, 2, -1),
|
|
2167
2191
|
];
|
|
2168
2192
|
/** Assorted angles. All principal directions, some others included. */
|
|
2169
2193
|
Sample.angle = [
|
|
@@ -2172,7 +2196,7 @@ Sample.angle = [
|
|
|
2172
2196
|
Angle.createDegrees(180),
|
|
2173
2197
|
Angle.createDegrees(-90),
|
|
2174
2198
|
Angle.createDegrees(30),
|
|
2175
|
-
Angle.createDegrees(-105)
|
|
2199
|
+
Angle.createDegrees(-105),
|
|
2176
2200
|
];
|
|
2177
2201
|
/** Assorted angle sweeps */
|
|
2178
2202
|
Sample.angleSweep = [
|
|
@@ -2181,35 +2205,35 @@ Sample.angleSweep = [
|
|
|
2181
2205
|
AngleSweep.createStartEndDegrees(-90, 0),
|
|
2182
2206
|
AngleSweep.createStartEndDegrees(0, -90),
|
|
2183
2207
|
AngleSweep.createStartEndDegrees(0, 30),
|
|
2184
|
-
AngleSweep.createStartEndDegrees(45, 110)
|
|
2208
|
+
AngleSweep.createStartEndDegrees(45, 110),
|
|
2185
2209
|
];
|
|
2186
|
-
/**
|
|
2210
|
+
/** Assorted line segments */
|
|
2187
2211
|
Sample.lineSegment3d = [
|
|
2188
2212
|
LineSegment3d.create(Point3d.create(0, 0, 0), Point3d.create(1, 0, 0)),
|
|
2189
2213
|
LineSegment3d.create(Point3d.create(0, 0, 0), Point3d.create(0, 1, 0)),
|
|
2190
2214
|
LineSegment3d.create(Point3d.create(0, 0, 0), Point3d.create(0, 0, 1)),
|
|
2191
|
-
LineSegment3d.create(Point3d.create(1, 2, 3), Point3d.create(-2, -3, 0.5))
|
|
2215
|
+
LineSegment3d.create(Point3d.create(1, 2, 3), Point3d.create(-2, -3, 0.5)),
|
|
2192
2216
|
];
|
|
2193
|
-
/** Assorted Range1d:
|
|
2217
|
+
/** Assorted Range1d: single point, null, simple forward, simple reverse */
|
|
2194
2218
|
Sample.range1d = [
|
|
2195
2219
|
Range1d.createX(1),
|
|
2196
2220
|
Range1d.createNull(),
|
|
2197
2221
|
Range1d.createXX(1, 2),
|
|
2198
|
-
Range1d.createXX(2, 1)
|
|
2222
|
+
Range1d.createXX(2, 1),
|
|
2199
2223
|
];
|
|
2200
2224
|
/** Assorted range2d: single point, null, 2 point with various creation orders. */
|
|
2201
2225
|
Sample.range2d = [
|
|
2202
2226
|
Range2d.createXY(1, 2),
|
|
2203
2227
|
Range2d.createNull(),
|
|
2204
2228
|
Range2d.createXYXY(1, 2, 0, 3),
|
|
2205
|
-
Range2d.createXYXY(1, 2, 3, 4)
|
|
2229
|
+
Range2d.createXYXY(1, 2, 3, 4),
|
|
2206
2230
|
];
|
|
2207
2231
|
/** Assorted range2d: single point, null, 2 point with various creation orders. */
|
|
2208
2232
|
Sample.range3d = [
|
|
2209
2233
|
Range3d.createXYZ(1, 2, 3),
|
|
2210
2234
|
Range3d.createNull(),
|
|
2211
2235
|
Range3d.createXYZXYZ(1, 2, 0, 3, 4, 7),
|
|
2212
|
-
Range3d.createXYZXYZ(1, 2, 3, -2, -4, -1)
|
|
2236
|
+
Range3d.createXYZXYZ(1, 2, 3, -2, -4, -1),
|
|
2213
2237
|
];
|
|
2214
2238
|
export { Sample };
|
|
2215
2239
|
//# sourceMappingURL=GeometrySamples.js.map
|