@itwin/ecschema-rpcinterface-tests 4.8.0-dev.20 → 4.8.0-dev.23
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/dist/_bea9.bundled-tests.js.map +1 -1
- package/lib/dist/bundled-tests.js +375 -320
- package/lib/dist/bundled-tests.js.map +1 -1
- package/lib/dist/core_frontend_lib_esm_ApproximateTerrainHeightsProps_js.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_loaders_gl_draco_3_1_6_node_modules_loaders_gl_draco_di-0642a6.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_meshoptimizer_0_20_0_node_modules_meshoptimizer_index_m-a5ae61.bundled-tests.js.map +1 -1
- package/package.json +15 -15
|
@@ -65173,10 +65173,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
65173
65173
|
* @beta
|
|
65174
65174
|
*/
|
|
65175
65175
|
class CustomAttributeClass extends _Class__WEBPACK_IMPORTED_MODULE_2__.ECClass {
|
|
65176
|
+
/**
|
|
65177
|
+
* @deprecated in 4.8 use [[appliesTo]]
|
|
65178
|
+
* */
|
|
65176
65179
|
get containerType() {
|
|
65177
|
-
|
|
65180
|
+
return this.appliesTo;
|
|
65181
|
+
}
|
|
65182
|
+
get appliesTo() {
|
|
65183
|
+
if (undefined === this._appliesTo)
|
|
65178
65184
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_1__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_1__.ECObjectsStatus.InvalidContainerType, `The CustomAttributeClass ${this.name} does not have a CustomAttributeContainerType.`);
|
|
65179
|
-
return this.
|
|
65185
|
+
return this._appliesTo;
|
|
65180
65186
|
}
|
|
65181
65187
|
constructor(schema, name, modifier) {
|
|
65182
65188
|
super(schema, name, modifier);
|
|
@@ -65189,21 +65195,21 @@ class CustomAttributeClass extends _Class__WEBPACK_IMPORTED_MODULE_2__.ECClass {
|
|
|
65189
65195
|
*/
|
|
65190
65196
|
toJSON(standalone = false, includeSchemaVersion = false) {
|
|
65191
65197
|
const schemaJson = super.toJSON(standalone, includeSchemaVersion);
|
|
65192
|
-
schemaJson.appliesTo = (0,_ECObjects__WEBPACK_IMPORTED_MODULE_0__.containerTypeToString)(this.
|
|
65198
|
+
schemaJson.appliesTo = (0,_ECObjects__WEBPACK_IMPORTED_MODULE_0__.containerTypeToString)(this.appliesTo);
|
|
65193
65199
|
return schemaJson;
|
|
65194
65200
|
}
|
|
65195
65201
|
/** @internal */
|
|
65196
65202
|
async toXml(schemaXml) {
|
|
65197
65203
|
const itemElement = await super.toXml(schemaXml);
|
|
65198
|
-
itemElement.setAttribute("appliesTo", (0,_ECObjects__WEBPACK_IMPORTED_MODULE_0__.containerTypeToString)(this.
|
|
65204
|
+
itemElement.setAttribute("appliesTo", (0,_ECObjects__WEBPACK_IMPORTED_MODULE_0__.containerTypeToString)(this.appliesTo));
|
|
65199
65205
|
return itemElement;
|
|
65200
65206
|
}
|
|
65201
65207
|
fromJSONSync(customAttributeProps) {
|
|
65202
65208
|
super.fromJSONSync(customAttributeProps);
|
|
65203
|
-
const
|
|
65204
|
-
if (undefined ===
|
|
65205
|
-
throw new _Exception__WEBPACK_IMPORTED_MODULE_1__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_1__.ECObjectsStatus.InvalidContainerType, `${
|
|
65206
|
-
this.
|
|
65209
|
+
const appliesTo = (0,_ECObjects__WEBPACK_IMPORTED_MODULE_0__.parseCustomAttributeContainerType)(customAttributeProps.appliesTo);
|
|
65210
|
+
if (undefined === appliesTo)
|
|
65211
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_1__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_1__.ECObjectsStatus.InvalidContainerType, `${appliesTo} is not a valid CustomAttributeContainerType.`);
|
|
65212
|
+
this._appliesTo = appliesTo;
|
|
65207
65213
|
}
|
|
65208
65214
|
async fromJSON(customAttributeProps) {
|
|
65209
65215
|
this.fromJSONSync(customAttributeProps);
|
|
@@ -65211,8 +65217,8 @@ class CustomAttributeClass extends _Class__WEBPACK_IMPORTED_MODULE_2__.ECClass {
|
|
|
65211
65217
|
/**
|
|
65212
65218
|
* @alpha Used in schema editing.
|
|
65213
65219
|
*/
|
|
65214
|
-
|
|
65215
|
-
this.
|
|
65220
|
+
setAppliesTo(containerType) {
|
|
65221
|
+
this._appliesTo = containerType;
|
|
65216
65222
|
}
|
|
65217
65223
|
}
|
|
65218
65224
|
/**
|
|
@@ -74083,6 +74089,8 @@ class AccuSnap {
|
|
|
74083
74089
|
showElemInfo(viewPt, vp, hit, delay) {
|
|
74084
74090
|
if (!_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.viewManager.doesHostHaveFocus || undefined !== this._toolTipPromise)
|
|
74085
74091
|
return;
|
|
74092
|
+
if (!_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.wantToolTip(hit))
|
|
74093
|
+
return;
|
|
74086
74094
|
const promise = this._toolTipPromise = delay.executeAfter(async () => {
|
|
74087
74095
|
if (promise !== this._toolTipPromise)
|
|
74088
74096
|
return; // we abandoned this request during delay
|
|
@@ -157517,7 +157525,7 @@ class MapTileTreeReference extends _internal__WEBPACK_IMPORTED_MODULE_7__.TileTr
|
|
|
157517
157525
|
return {
|
|
157518
157526
|
isBaseLayer,
|
|
157519
157527
|
index: isBaseLayer ? undefined : { isOverlay: this.isOverlay, index: this._baseImageryLayerIncluded ? tree.layerIndex - 1 : tree.layerIndex },
|
|
157520
|
-
settings: tree.layerSettings, provider: tree.imageryProvider
|
|
157528
|
+
settings: tree.layerSettings, provider: tree.imageryProvider,
|
|
157521
157529
|
};
|
|
157522
157530
|
});
|
|
157523
157531
|
}
|
|
@@ -157579,7 +157587,7 @@ class MapTileTreeReference extends _internal__WEBPACK_IMPORTED_MODULE_7__.TileTr
|
|
|
157579
157587
|
let carto;
|
|
157580
157588
|
const strings = [];
|
|
157581
157589
|
const getTooltipFunc = async (imageryTreeRef, quadId, cartoGraphic, imageryTree) => {
|
|
157582
|
-
strings.push(
|
|
157590
|
+
strings.push(`${_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.localization.getLocalizedString("iModelJs:MapLayers.ImageryLayer")}: ${imageryTreeRef.layerSettings.name}`);
|
|
157583
157591
|
carto = cartoGraphic;
|
|
157584
157592
|
await imageryTree.imageryLoader.getToolTip(strings, quadId, cartoGraphic, imageryTree);
|
|
157585
157593
|
};
|
|
@@ -157590,11 +157598,11 @@ class MapTileTreeReference extends _internal__WEBPACK_IMPORTED_MODULE_7__.TileTr
|
|
|
157590
157598
|
// No results added
|
|
157591
157599
|
}
|
|
157592
157600
|
if (carto) {
|
|
157593
|
-
strings.push(
|
|
157594
|
-
strings.push(
|
|
157601
|
+
strings.push(`${_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.localization.getLocalizedString("iModelJs:MapLayers.Latitude")}: ${carto.latitudeDegrees.toFixed(4)}`);
|
|
157602
|
+
strings.push(`${_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.localization.getLocalizedString("iModelJs:MapLayers.Longitude")}: ${carto.longitudeDegrees.toFixed(4)}`);
|
|
157595
157603
|
if (this.settings.applyTerrain && tree.terrainExaggeration !== 0.0) {
|
|
157596
157604
|
const geodeticHeight = (carto.height - tree.bimElevationBias) / tree.terrainExaggeration;
|
|
157597
|
-
strings.push(
|
|
157605
|
+
strings.push(`${_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.localization.getLocalizedString("iModelJs:MapLayers.Height")}: ${geodeticHeight.toFixed(1)} ${_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.localization.getLocalizedString("iModelJs:MapLayers.SeaLevel")}: ${(geodeticHeight - tree.geodeticOffset).toFixed(1)}`);
|
|
157598
157606
|
}
|
|
157599
157607
|
}
|
|
157600
157608
|
const div = document.createElement("div");
|
|
@@ -167513,6 +167521,8 @@ class ToolAdmin {
|
|
|
167513
167521
|
}
|
|
167514
167522
|
/** The current tool. May be ViewTool, InputCollector, PrimitiveTool, or IdleTool - in that priority order. */
|
|
167515
167523
|
get currentTool() { return this.activeTool ? this.activeTool : this.idleTool; }
|
|
167524
|
+
/** Allow applications to inhibit specific tooltips, such as for maps. */
|
|
167525
|
+
wantToolTip(_hit) { return true; }
|
|
167516
167526
|
/** Ask the current tool to provide tooltip contents for the supplied HitDetail. */
|
|
167517
167527
|
async getToolTip(hit) { return this.currentTool.getToolTip(hit); }
|
|
167518
167528
|
async onMouseEnter(event) {
|
|
@@ -235720,10 +235730,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
235720
235730
|
|
|
235721
235731
|
|
|
235722
235732
|
/**
|
|
235723
|
-
* A FacetSector
|
|
235724
|
-
* *
|
|
235725
|
-
* *
|
|
235726
|
-
* *
|
|
235733
|
+
* A FacetSector.
|
|
235734
|
+
* * Initially holds coordinate data for a place where xyz and sectionDerivative are known.
|
|
235735
|
+
* * Normal is computed as a deferred step using an edge to adjacent place on ruled surface.
|
|
235736
|
+
* * Indices are set up even later.
|
|
235727
235737
|
*/
|
|
235728
235738
|
class FacetSector {
|
|
235729
235739
|
constructor(needNormal = false, needUV = false, needSectionDerivative = false) {
|
|
@@ -235742,8 +235752,9 @@ class FacetSector {
|
|
|
235742
235752
|
this.sectionDerivative = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
|
|
235743
235753
|
}
|
|
235744
235754
|
}
|
|
235745
|
-
/**
|
|
235746
|
-
*
|
|
235755
|
+
/**
|
|
235756
|
+
* Copy contents (not pointers) from `other`.
|
|
235757
|
+
* * ASSUME all fields defined in the instance are defined in `other`.
|
|
235747
235758
|
*/
|
|
235748
235759
|
copyContentsFrom(other) {
|
|
235749
235760
|
this.xyz.setFromPoint3d(other.xyz);
|
|
@@ -235757,10 +235768,11 @@ class FacetSector {
|
|
|
235757
235768
|
if (this.sectionDerivative)
|
|
235758
235769
|
this.sectionDerivative.setFrom(other.sectionDerivative);
|
|
235759
235770
|
}
|
|
235760
|
-
/**
|
|
235761
|
-
*
|
|
235771
|
+
/**
|
|
235772
|
+
* Access xyz, derivative from given arrays.
|
|
235773
|
+
* * ASSUME corresponding defined conditions.
|
|
235762
235774
|
* * xyz and derivative are set.
|
|
235763
|
-
* *
|
|
235775
|
+
* * Index fields for updated data are cleared to -1.
|
|
235764
235776
|
*/
|
|
235765
235777
|
loadIndexedPointAndDerivativeCoordinatesFromPackedArrays(i, packedXYZ, packedDerivatives, fractions, v) {
|
|
235766
235778
|
packedXYZ.getPoint3dAtCheckedPointIndex(i, this.xyz);
|
|
@@ -235782,16 +235794,14 @@ class FacetSector {
|
|
|
235782
235794
|
uvw.z = 0.0;
|
|
235783
235795
|
}
|
|
235784
235796
|
/**
|
|
235785
|
-
*
|
|
235786
|
-
*
|
|
235787
|
-
*
|
|
235788
|
-
* @param
|
|
235789
|
-
* @param sectorB "upper" sector
|
|
235790
|
-
*
|
|
235797
|
+
* Given two sectors with xyz and sectionDerivative (u derivative), use the edge from A to B as v direction
|
|
235798
|
+
* in-surface derivative. Compute cross products (and normalize).
|
|
235799
|
+
* @param sectorA "lower" sector.
|
|
235800
|
+
* @param sectorB "upper" sector.
|
|
235791
235801
|
*/
|
|
235792
235802
|
static computeNormalsAlongRuleLine(sectorA, sectorB) {
|
|
235793
|
-
// We expect that if sectionDerivative is defined so is normal.
|
|
235794
|
-
//
|
|
235803
|
+
// We expect that if a sector's sectionDerivative is defined, then so is its normal. If a normal is undefined, the
|
|
235804
|
+
// crossProduct returns an object that goes unused---not good, but the garbage collector will clean it up.
|
|
235795
235805
|
if (sectorA.sectionDerivative && sectorB.sectionDerivative) {
|
|
235796
235806
|
const vectorAB = FacetSector._edgeVector;
|
|
235797
235807
|
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.createStartEnd(sectorA.xyz, sectorB.xyz, vectorAB);
|
|
@@ -235806,12 +235816,10 @@ class FacetSector {
|
|
|
235806
235816
|
}
|
|
235807
235817
|
FacetSector._edgeVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
|
|
235808
235818
|
/**
|
|
235809
|
-
*
|
|
235810
235819
|
* * Simple construction for strongly typed GeometryQuery objects:
|
|
235811
235820
|
*
|
|
235812
235821
|
* * Create a builder with `builder = PolyfaceBuilder.create()`
|
|
235813
235822
|
* * Add GeometryQuery objects:
|
|
235814
|
-
*
|
|
235815
235823
|
* * `builder.addGeometryQuery(g: GeometryQuery)`
|
|
235816
235824
|
* * `builder.addCone(cone: Cone)`
|
|
235817
235825
|
* * `builder.addTorusPipe(surface: TorusPipe)`
|
|
@@ -235822,7 +235830,7 @@ FacetSector._edgeVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0
|
|
|
235822
235830
|
* * `builder.addSphere(sphere: Sphere)`
|
|
235823
235831
|
* * `builder.addBox(box: Box)`
|
|
235824
235832
|
* * `builder.addIndexedPolyface(polyface)`
|
|
235825
|
-
* *
|
|
235833
|
+
* * Extract with `builder.claimPolyface(true)`
|
|
235826
235834
|
*
|
|
235827
235835
|
* * Simple construction for ephemeral constructive data:
|
|
235828
235836
|
*
|
|
@@ -235838,9 +235846,10 @@ FacetSector._edgeVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0
|
|
|
235838
235846
|
* * `builder.addTrianglesInUncheckedConvexPolygon(linestring, toggle)`
|
|
235839
235847
|
* * `builder.addUVGridBody(surface,numU, numV, createFanInCaps)`
|
|
235840
235848
|
* * `builder.addGraph(Graph, acceptFaceFunction)`
|
|
235841
|
-
* *
|
|
235849
|
+
* * Extract with `builder.claimPolyface(true)`
|
|
235850
|
+
*
|
|
235851
|
+
* * Low-level detail construction -- direct use of indices:
|
|
235842
235852
|
*
|
|
235843
|
-
* * Low-level detail construction -- direct use of indices
|
|
235844
235853
|
* * Create a builder with `builder = PolyfaceBuilder.create()`
|
|
235845
235854
|
* * Add GeometryQuery objects
|
|
235846
235855
|
* * `builder.addPoint(point)`
|
|
@@ -235848,17 +235857,21 @@ FacetSector._edgeVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0
|
|
|
235848
235857
|
* * `builder.addPointXYZ(x,y,z)`
|
|
235849
235858
|
* * `builder.addTriangleFacet(points)`
|
|
235850
235859
|
* * `builder.addQuadFacet(points)`
|
|
235851
|
-
|
|
235860
|
+
* @public
|
|
235852
235861
|
*/
|
|
235853
235862
|
class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_3__.NullGeometryHandler {
|
|
235854
|
-
/**
|
|
235855
|
-
get options() {
|
|
235863
|
+
/** Return (pointer to) the `StrokeOptions` in use by the builder. */
|
|
235864
|
+
get options() {
|
|
235865
|
+
return this._options;
|
|
235866
|
+
}
|
|
235856
235867
|
/** Ask if this builder is reversing vertex order as loops are received. */
|
|
235857
|
-
get reversedFlag() {
|
|
235868
|
+
get reversedFlag() {
|
|
235869
|
+
return this._reversed;
|
|
235870
|
+
}
|
|
235858
235871
|
/**
|
|
235859
235872
|
* Extract the polyface.
|
|
235860
|
-
* @param compress whether to cluster vertices (default true)
|
|
235861
|
-
* @param tolerance compression tolerance (default Geometry.smallMetricDistance)
|
|
235873
|
+
* @param compress whether to cluster vertices (default `true`).
|
|
235874
|
+
* @param tolerance compression tolerance (default `Geometry.smallMetricDistance`).
|
|
235862
235875
|
*/
|
|
235863
235876
|
claimPolyface(compress = true, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
|
|
235864
235877
|
if (compress)
|
|
@@ -235866,7 +235879,9 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
235866
235879
|
return this._polyface;
|
|
235867
235880
|
}
|
|
235868
235881
|
/** Toggle (reverse) the flag controlling orientation flips for newly added facets. */
|
|
235869
|
-
toggleReversedFacetFlag() {
|
|
235882
|
+
toggleReversedFacetFlag() {
|
|
235883
|
+
this._reversed = !this._reversed;
|
|
235884
|
+
}
|
|
235870
235885
|
constructor(options) {
|
|
235871
235886
|
super();
|
|
235872
235887
|
this._options = options ? options : _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_4__.StrokeOptions.createForFacets();
|
|
@@ -235874,25 +235889,27 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
235874
235889
|
this._reversed = false;
|
|
235875
235890
|
}
|
|
235876
235891
|
/**
|
|
235877
|
-
* Create a builder with given StrokeOptions
|
|
235878
|
-
* @param options StrokeOptions (captured)
|
|
235892
|
+
* Create a builder with given StrokeOptions.
|
|
235893
|
+
* @param options StrokeOptions (captured).
|
|
235879
235894
|
*/
|
|
235880
235895
|
static create(options) {
|
|
235881
235896
|
return new PolyfaceBuilder(options);
|
|
235882
235897
|
}
|
|
235883
|
-
/**
|
|
235898
|
+
/** Add facets for a transformed unit box. */
|
|
235884
235899
|
addTransformedUnitBox(transform) {
|
|
235885
235900
|
this.addTransformedRangeMesh(transform, _geometry3d_Range__WEBPACK_IMPORTED_MODULE_6__.Range3d.createXYZXYZ(0, 0, 0, 1, 1, 1));
|
|
235886
235901
|
}
|
|
235887
|
-
/**
|
|
235902
|
+
/**
|
|
235903
|
+
* Add facets for a transformed range box.
|
|
235888
235904
|
* * For best results, the transformed range corners should define a nonzero volume or area.
|
|
235889
|
-
* @param transform applied to the range points before adding to the polyface
|
|
235890
|
-
* @param range sides become 6 quad polyface facets
|
|
235891
|
-
* @param faceSelector for each face in the order of BoxTopology.cornerIndexCCW
|
|
235905
|
+
* @param transform applied to the range points before adding to the polyface.
|
|
235906
|
+
* @param range sides become 6 quad polyface facets.
|
|
235907
|
+
* @param faceSelector for each face in the order of `BoxTopology.cornerIndexCCW`, `faceSelector[i] === false` skips
|
|
235908
|
+
* that facet.
|
|
235892
235909
|
*/
|
|
235893
235910
|
addTransformedRangeMesh(transform, range, faceSelector) {
|
|
235894
235911
|
const pointIndex0 = this._polyface.data.pointCount;
|
|
235895
|
-
// these will have sequential indices starting at pointIndex0
|
|
235912
|
+
// these will have sequential indices starting at pointIndex0
|
|
235896
235913
|
const points = range.corners();
|
|
235897
235914
|
for (const p of points)
|
|
235898
235915
|
this._polyface.addPoint(transform.multiplyPoint3d(p));
|
|
@@ -235914,9 +235931,11 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
235914
235931
|
faceCounter++;
|
|
235915
235932
|
}
|
|
235916
235933
|
}
|
|
235917
|
-
/**
|
|
235918
|
-
*
|
|
235919
|
-
* @param
|
|
235934
|
+
/**
|
|
235935
|
+
* Add triangles from `conePoint` to each far edge.
|
|
235936
|
+
* @param conePoint the common vertex of all triangles.
|
|
235937
|
+
* @param ls linestring with point coordinates.
|
|
235938
|
+
* @param toggle if `true`, wrap the triangle creation in toggleReversedFacetFlag.
|
|
235920
235939
|
*/
|
|
235921
235940
|
addTriangleFan(conePoint, ls, toggle) {
|
|
235922
235941
|
const n = ls.numPoints();
|
|
@@ -235935,12 +235954,11 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
235935
235954
|
this.toggleReversedFacetFlag();
|
|
235936
235955
|
}
|
|
235937
235956
|
}
|
|
235938
|
-
/**
|
|
235939
|
-
*
|
|
235940
|
-
* *
|
|
235941
|
-
*
|
|
235942
|
-
* @param
|
|
235943
|
-
* @param reverse if true, wrap the triangle creation in toggleReversedFacetFlag.
|
|
235957
|
+
/**
|
|
235958
|
+
* Add triangles from the first point of the linestring to the subsequent edges of the linestring.
|
|
235959
|
+
* * No checks are made for polygon convexity or edge collinearity, conditions which would ensure positive area triangles.
|
|
235960
|
+
* @param ls linestring with point coordinates.
|
|
235961
|
+
* @param reverse if `true`, wrap the triangle creation in toggleReversedFacetFlag.
|
|
235944
235962
|
*/
|
|
235945
235963
|
addTrianglesInUncheckedConvexPolygon(ls, toggle) {
|
|
235946
235964
|
const n = ls.numPoints();
|
|
@@ -235985,36 +236003,36 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
235985
236003
|
this.toggleReversedFacetFlag();
|
|
235986
236004
|
}
|
|
235987
236005
|
}
|
|
235988
|
-
/**
|
|
235989
|
-
* Announce point coordinates.
|
|
235990
|
-
*/
|
|
236006
|
+
/** Add a point to the polyface. */
|
|
235991
236007
|
addPoint(xyz) {
|
|
235992
236008
|
return this._polyface.addPoint(xyz);
|
|
235993
236009
|
}
|
|
235994
236010
|
/**
|
|
235995
|
-
*
|
|
236011
|
+
* Add a point to the polyface.
|
|
235996
236012
|
* @deprecated in 3.x. Use addPoint instead.
|
|
235997
236013
|
*/
|
|
235998
236014
|
findOrAddPoint(xyz) {
|
|
235999
236015
|
return this.addPoint(xyz);
|
|
236000
236016
|
}
|
|
236001
|
-
/**
|
|
236002
|
-
* Announce uv parameter coordinates.
|
|
236003
|
-
*/
|
|
236017
|
+
/** Add a uv parameter to the polyface. */
|
|
236004
236018
|
addParamXY(x, y) {
|
|
236005
236019
|
return this._polyface.addParamUV(x, y);
|
|
236006
236020
|
}
|
|
236007
236021
|
/**
|
|
236008
|
-
*
|
|
236022
|
+
* Add a uv parameter to the polyface.
|
|
236009
236023
|
* @deprecated in 3.x. Use addParamXY instead.
|
|
236010
236024
|
*/
|
|
236011
236025
|
findOrAddParamXY(x, y) {
|
|
236012
236026
|
return this.addParamXY(x, y);
|
|
236013
236027
|
}
|
|
236014
236028
|
/**
|
|
236015
|
-
*
|
|
236016
|
-
*
|
|
236017
|
-
* @param
|
|
236029
|
+
* Add a point to the polyface. The implementation is free to either create a new point or return the index of a
|
|
236030
|
+
* prior point with the same coordinates.
|
|
236031
|
+
* @param ls the linestring.
|
|
236032
|
+
* @param index index of the point in the linestring.
|
|
236033
|
+
* @param transform (optional) transform to be applied.
|
|
236034
|
+
* @param priorIndex (optional) index of a prior point to check for possible duplicate value.
|
|
236035
|
+
* @returns the point index in the polyface.
|
|
236018
236036
|
*/
|
|
236019
236037
|
findOrAddPointInLineString(ls, index, transform, priorIndex) {
|
|
236020
236038
|
const q = ls.pointAt(index, PolyfaceBuilder._workPointFindOrAddA);
|
|
@@ -236026,9 +236044,13 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236026
236044
|
return undefined;
|
|
236027
236045
|
}
|
|
236028
236046
|
/**
|
|
236029
|
-
*
|
|
236030
|
-
*
|
|
236031
|
-
* @param
|
|
236047
|
+
* Add a point to the polyface. The implementation is free to either create a new point or return the index of a
|
|
236048
|
+
* prior point with the same coordinates.
|
|
236049
|
+
* @param xyz the array of points.
|
|
236050
|
+
* @param index index of the point in the array.
|
|
236051
|
+
* @param transform (optional) transform to be applied.
|
|
236052
|
+
* @param priorIndex (optional) index of a prior point to check for possible duplicate value.
|
|
236053
|
+
* @returns the point index in the polyface.
|
|
236032
236054
|
*/
|
|
236033
236055
|
findOrAddPointInGrowableXYZArray(xyz, index, transform, priorIndex) {
|
|
236034
236056
|
const q = xyz.getPoint3dAtCheckedPointIndex(index, PolyfaceBuilder._workPointFindOrAddA);
|
|
@@ -236040,9 +236062,13 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236040
236062
|
return undefined;
|
|
236041
236063
|
}
|
|
236042
236064
|
/**
|
|
236043
|
-
*
|
|
236044
|
-
*
|
|
236045
|
-
* @param
|
|
236065
|
+
* Add a normal to the polyface. The implementation is free to either create a new normal or return the index of a
|
|
236066
|
+
* prior normal with the same coordinates.
|
|
236067
|
+
* @param xyz the array of normals.
|
|
236068
|
+
* @param index index of the normal in the array.
|
|
236069
|
+
* @param transform (optional) transform to be applied.
|
|
236070
|
+
* @param priorIndex (optional) index of a prior point to check for possible duplicate value.
|
|
236071
|
+
* @returns the normal index in the polyface.
|
|
236046
236072
|
*/
|
|
236047
236073
|
findOrAddNormalInGrowableXYZArray(xyz, index, transform, priorIndex) {
|
|
236048
236074
|
const q = xyz.getVector3dAtCheckedVectorIndex(index, PolyfaceBuilder._workVectorFindOrAdd);
|
|
@@ -236054,40 +236080,49 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236054
236080
|
return undefined;
|
|
236055
236081
|
}
|
|
236056
236082
|
/**
|
|
236057
|
-
*
|
|
236058
|
-
* @
|
|
236059
|
-
* @param index
|
|
236083
|
+
* Add a uv parameter to the polyface.
|
|
236084
|
+
* @param data the array of uv data.
|
|
236085
|
+
* @param index index of the param in the array.
|
|
236086
|
+
* @returns the uv parameter index in the polyface.
|
|
236060
236087
|
*/
|
|
236061
236088
|
addParamInGrowableXYArray(data, index) {
|
|
236062
236089
|
if (!data)
|
|
236063
236090
|
return undefined;
|
|
236064
236091
|
const q = data.getPoint2dAtCheckedPointIndex(index, PolyfaceBuilder._workUVFindOrAdd);
|
|
236065
|
-
if (q)
|
|
236092
|
+
if (q)
|
|
236066
236093
|
return this._polyface.addParam(q);
|
|
236067
|
-
}
|
|
236068
236094
|
return undefined;
|
|
236069
236095
|
}
|
|
236070
236096
|
/**
|
|
236071
|
-
*
|
|
236097
|
+
* Add a uv parameter to the polyface.
|
|
236072
236098
|
* @deprecated in 3.x. Use addParamInGrowableXYArray instead.
|
|
236073
236099
|
*/
|
|
236074
236100
|
findOrAddParamInGrowableXYArray(data, index) {
|
|
236075
236101
|
return this.addParamInGrowableXYArray(data, index);
|
|
236076
236102
|
}
|
|
236077
236103
|
/**
|
|
236078
|
-
*
|
|
236079
|
-
*
|
|
236080
|
-
* @param
|
|
236104
|
+
* Add a uv parameter to the polyface, taking `u` from `ls.fractions` and `v` from input. The implementation is
|
|
236105
|
+
* free to either create a new param or return the index of a prior param with the same coordinates.
|
|
236106
|
+
* @param ls the linestring.
|
|
236107
|
+
* @param index index of the point in the linestring.
|
|
236108
|
+
* @param v the v parameter.
|
|
236109
|
+
* @param priorIndexA (optional) an index of a prior param to check for possible duplicate value.
|
|
236110
|
+
* @param priorIndexB (optional) another index of a prior param to check for possible duplicate value.
|
|
236111
|
+
* @returns the uv parameter index in the polyface.
|
|
236081
236112
|
*/
|
|
236082
236113
|
findOrAddParamInLineString(ls, index, v, priorIndexA, priorIndexB) {
|
|
236083
|
-
const u = (ls.fractions && index < ls.fractions.length) ?
|
|
236114
|
+
const u = (ls.fractions && index < ls.fractions.length) ?
|
|
236115
|
+
ls.fractions.atUncheckedIndex(index) : index / ls.points.length;
|
|
236084
236116
|
return this._polyface.addParamUV(u, v, priorIndexA, priorIndexB);
|
|
236085
236117
|
}
|
|
236086
236118
|
/**
|
|
236087
|
-
*
|
|
236088
|
-
* @
|
|
236089
|
-
* @param index Index of the
|
|
236090
|
-
* @param
|
|
236119
|
+
* Add a normal to the polyface.
|
|
236120
|
+
* @param ls the linestring.
|
|
236121
|
+
* @param index Index of the normal in the linestring's surface normal array.
|
|
236122
|
+
* @param transform (optional) transform to be applied.
|
|
236123
|
+
* @param priorIndexA (optional) an index of a prior normal to check for possible duplicate value.
|
|
236124
|
+
* @param priorIndexB (optional) another index of a prior normal to check for possible duplicate value.
|
|
236125
|
+
* @returns the normal index in the polyface.
|
|
236091
236126
|
*/
|
|
236092
236127
|
findOrAddNormalInLineString(ls, index, transform, priorIndexA, priorIndexB) {
|
|
236093
236128
|
const linestringNormals = ls.packedSurfaceNormals;
|
|
@@ -236101,14 +236136,12 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236101
236136
|
}
|
|
236102
236137
|
return undefined;
|
|
236103
236138
|
}
|
|
236104
|
-
/**
|
|
236105
|
-
* Announce point coordinates.
|
|
236106
|
-
*/
|
|
236139
|
+
/** Add a point to the polyface. */
|
|
236107
236140
|
addPointXYZ(x, y, z) {
|
|
236108
236141
|
return this._polyface.addPointXYZ(x, y, z);
|
|
236109
236142
|
}
|
|
236110
236143
|
/**
|
|
236111
|
-
*
|
|
236144
|
+
* Add a point to the polyface.
|
|
236112
236145
|
* @deprecated in 3.x. Use addPointXYZ instead.
|
|
236113
236146
|
*/
|
|
236114
236147
|
findOrAddPointXYZ(x, y, z) {
|
|
@@ -236130,18 +236163,22 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236130
236163
|
normal = normal ? normal : _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
|
|
236131
236164
|
return normal;
|
|
236132
236165
|
}
|
|
236133
|
-
//
|
|
236166
|
+
// ### TODO: Consider case where normals will be reversed and point through the other end of the facet.
|
|
236134
236167
|
/**
|
|
236135
236168
|
* Add a quad to the polyface given its points in order around the edges.
|
|
236136
|
-
* @param points array of at least
|
|
236137
|
-
* @param params optional array of at least four uv parameters (if undefined
|
|
236138
|
-
*
|
|
236139
|
-
* @param
|
|
236169
|
+
* @param points array of at least four vertices.
|
|
236170
|
+
* @param params (optional) array of at least four uv parameters (if `undefined`, params are calculated without
|
|
236171
|
+
* reference data).
|
|
236172
|
+
* @param normals (optional) array of at least four vectors (if `undefined`, the quad is assumed to be planar and its
|
|
236173
|
+
* normal is calculated).
|
|
236174
|
+
* @param colors (optional) array of at least four colors.
|
|
236140
236175
|
*/
|
|
236141
236176
|
addQuadFacet(points, params, normals, colors) {
|
|
236142
236177
|
if (points instanceof _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_10__.GrowableXYZArray)
|
|
236143
236178
|
points = points.getPoint3dArray();
|
|
236144
|
-
|
|
236179
|
+
if (points.length < 4)
|
|
236180
|
+
return;
|
|
236181
|
+
// if params and/or normals are needed, calculate them first
|
|
236145
236182
|
const needParams = this.options.needParams;
|
|
236146
236183
|
const needNormals = this.options.needNormals;
|
|
236147
236184
|
const needColors = this.options.needColors;
|
|
@@ -236191,7 +236228,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236191
236228
|
}
|
|
236192
236229
|
}
|
|
236193
236230
|
if (this._options.shouldTriangulate) {
|
|
236194
|
-
//
|
|
236231
|
+
// add as two triangles, with a diagonal along the shortest distance
|
|
236195
236232
|
const vectorAC = points[0].vectorTo(points[2]);
|
|
236196
236233
|
const vectorBD = points[1].vectorTo(points[3]);
|
|
236197
236234
|
// Note: We pass along any values for normals or params that we calculated
|
|
@@ -236206,7 +236243,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236206
236243
|
return;
|
|
236207
236244
|
}
|
|
236208
236245
|
let idx0, idx1, idx2, idx3;
|
|
236209
|
-
//
|
|
236246
|
+
// add params if needed
|
|
236210
236247
|
if (needParams) {
|
|
236211
236248
|
idx0 = this._polyface.addParam(param0);
|
|
236212
236249
|
idx1 = this._polyface.addParam(param1);
|
|
@@ -236214,7 +236251,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236214
236251
|
idx3 = this._polyface.addParam(param3);
|
|
236215
236252
|
this.addIndexedQuadParamIndexes(idx0, idx1, idx3, idx2);
|
|
236216
236253
|
}
|
|
236217
|
-
//
|
|
236254
|
+
// add normals if needed
|
|
236218
236255
|
if (needNormals) {
|
|
236219
236256
|
idx0 = this._polyface.addNormal(normal0);
|
|
236220
236257
|
idx1 = this._polyface.addNormal(normal1);
|
|
@@ -236222,7 +236259,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236222
236259
|
idx3 = this._polyface.addNormal(normal3);
|
|
236223
236260
|
this.addIndexedQuadNormalIndexes(idx0, idx1, idx3, idx2);
|
|
236224
236261
|
}
|
|
236225
|
-
//
|
|
236262
|
+
// add colors if needed
|
|
236226
236263
|
if (needColors) {
|
|
236227
236264
|
idx0 = this._polyface.addColor(color0);
|
|
236228
236265
|
idx1 = this._polyface.addColor(color1);
|
|
@@ -236230,18 +236267,19 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236230
236267
|
idx3 = this._polyface.addColor(color3);
|
|
236231
236268
|
this.addIndexedQuadColorIndexes(idx0, idx1, idx3, idx2);
|
|
236232
236269
|
}
|
|
236233
|
-
//
|
|
236270
|
+
// add point and point indexes last (terminates the facet)
|
|
236234
236271
|
idx0 = this.addPoint(points[0]);
|
|
236235
236272
|
idx1 = this.addPoint(points[1]);
|
|
236236
236273
|
idx2 = this.addPoint(points[2]);
|
|
236237
236274
|
idx3 = this.addPoint(points[3]);
|
|
236238
236275
|
this.addIndexedQuadPointIndexes(idx0, idx1, idx3, idx2);
|
|
236239
236276
|
}
|
|
236240
|
-
/**
|
|
236277
|
+
/**
|
|
236278
|
+
* Add a single quad facet from existing points to the polyface.
|
|
236241
236279
|
* * The actual quad may be reversed or triangulated based on builder setup.
|
|
236242
|
-
* * indexA0 and indexA1 are in the forward order at the "A" end of the quad
|
|
236243
|
-
* * indexB0 and indexB1 are in the forward order at the "B" end of the quad.
|
|
236244
|
-
* * This means ccw/cw ordered vertices v[i] should be passed into this function as i=[0,1,3,2]
|
|
236280
|
+
* * `indexA0` and `indexA1` are in the forward order at the "A" end of the quad
|
|
236281
|
+
* * `indexB0` and `indexB1` are in the forward order at the "B" end of the quad.
|
|
236282
|
+
* * This means ccw/cw ordered vertices v[i] should be passed into this function as i=[0,1,3,2].
|
|
236245
236283
|
*/
|
|
236246
236284
|
addIndexedQuadPointIndexes(indexA0, indexA1, indexB0, indexB1, terminate = true) {
|
|
236247
236285
|
if (this._reversed) {
|
|
@@ -236304,13 +236342,14 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236304
236342
|
this._polyface.addColorIndex(indexB0);
|
|
236305
236343
|
}
|
|
236306
236344
|
}
|
|
236307
|
-
// ### TODO: Consider case where normals will be reversed and point through the other end of the facet
|
|
236345
|
+
// ### TODO: Consider case where normals will be reversed and point through the other end of the facet.
|
|
236308
236346
|
/**
|
|
236309
236347
|
* Add a triangle to the polyface given its points in order around the edges.
|
|
236310
|
-
* @param points array of at least three vertices
|
|
236311
|
-
* @param params optional array of at least three uv parameters (if undefined
|
|
236312
|
-
*
|
|
236313
|
-
* @param
|
|
236348
|
+
* @param points array of at least three vertices.
|
|
236349
|
+
* @param params (optional) array of at least three uv parameters (if `undefined`, params are calculated without
|
|
236350
|
+
* reference data).
|
|
236351
|
+
* @param normals (optional) array of at least three vectors (if `undefined`, the normal is calculated).
|
|
236352
|
+
* @param colors (optional) array of at least three colors.
|
|
236314
236353
|
*/
|
|
236315
236354
|
addTriangleFacet(points, params, normals, colors) {
|
|
236316
236355
|
if (points.length < 3)
|
|
@@ -236329,14 +236368,14 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236329
236368
|
point1 = points[1];
|
|
236330
236369
|
point2 = points[2];
|
|
236331
236370
|
}
|
|
236332
|
-
//
|
|
236371
|
+
// add params if needed
|
|
236333
236372
|
if (this._options.needParams) {
|
|
236334
|
-
if (params && params.length >= 3) { //
|
|
236373
|
+
if (params && params.length >= 3) { // params were given
|
|
236335
236374
|
idx0 = this._polyface.addParam(params[0]);
|
|
236336
236375
|
idx1 = this._polyface.addParam(params[1]);
|
|
236337
236376
|
idx2 = this._polyface.addParam(params[2]);
|
|
236338
236377
|
}
|
|
236339
|
-
else { //
|
|
236378
|
+
else { // compute params
|
|
236340
236379
|
const paramTransform = this.getUVTransformForTriangleFacet(point0, point1, point2);
|
|
236341
236380
|
idx0 = this._polyface.addParam(_geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_1__.Point2d.createFrom(paramTransform ? paramTransform.multiplyPoint3d(point0) : undefined));
|
|
236342
236381
|
idx1 = this._polyface.addParam(_geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_1__.Point2d.createFrom(paramTransform ? paramTransform.multiplyPoint3d(point1) : undefined));
|
|
@@ -236344,14 +236383,14 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236344
236383
|
}
|
|
236345
236384
|
this.addIndexedTriangleParamIndexes(idx0, idx1, idx2);
|
|
236346
236385
|
}
|
|
236347
|
-
//
|
|
236386
|
+
// add normals if needed
|
|
236348
236387
|
if (this._options.needNormals) {
|
|
236349
|
-
if (normals !== undefined && normals.length > 2) { //
|
|
236388
|
+
if (normals !== undefined && normals.length > 2) { // normals were given
|
|
236350
236389
|
idx0 = this._polyface.addNormal(normals[0]);
|
|
236351
236390
|
idx1 = this._polyface.addNormal(normals[1]);
|
|
236352
236391
|
idx2 = this._polyface.addNormal(normals[2]);
|
|
236353
236392
|
}
|
|
236354
|
-
else { //
|
|
236393
|
+
else { // compute normals
|
|
236355
236394
|
const normal = this.getNormalForTriangularFacet(point0, point1, point2);
|
|
236356
236395
|
idx0 = this._polyface.addNormal(normal);
|
|
236357
236396
|
idx1 = this._polyface.addNormal(normal);
|
|
@@ -236359,7 +236398,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236359
236398
|
}
|
|
236360
236399
|
this.addIndexedTriangleNormalIndexes(idx0, idx1, idx2);
|
|
236361
236400
|
}
|
|
236362
|
-
//
|
|
236401
|
+
// add colors if needed and provided
|
|
236363
236402
|
if (this._options.needColors) {
|
|
236364
236403
|
if (colors !== undefined && colors.length > 2) {
|
|
236365
236404
|
idx0 = this._polyface.addColor(colors[0]);
|
|
@@ -236368,15 +236407,15 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236368
236407
|
this.addIndexedTriangleColorIndexes(idx0, idx1, idx2);
|
|
236369
236408
|
}
|
|
236370
236409
|
}
|
|
236371
|
-
//
|
|
236410
|
+
// add point and point indexes last (terminates the facet)
|
|
236372
236411
|
idx0 = this.addPoint(point0);
|
|
236373
236412
|
idx1 = this.addPoint(point1);
|
|
236374
236413
|
idx2 = this.addPoint(point2);
|
|
236375
236414
|
this.addIndexedTrianglePointIndexes(idx0, idx1, idx2);
|
|
236376
236415
|
}
|
|
236377
|
-
/**
|
|
236378
|
-
*
|
|
236379
|
-
* * The
|
|
236416
|
+
/**
|
|
236417
|
+
* Add a single triangular facet from existing points to the polyface.
|
|
236418
|
+
* * The added triangle may be reversed based on builder setup.
|
|
236380
236419
|
*/
|
|
236381
236420
|
addIndexedTrianglePointIndexes(indexA, indexB, indexC, terminateFacet = true) {
|
|
236382
236421
|
if (!this._reversed) {
|
|
@@ -236443,7 +236482,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236443
236482
|
if (sectorA0.xyz.isAlmostEqual(sectorA1.xyz)
|
|
236444
236483
|
|| sectorA1.xyz.isAlmostEqual(sectorA2.xyz)
|
|
236445
236484
|
|| sectorA2.xyz.isAlmostEqual(sectorA0.xyz)) {
|
|
236446
|
-
// trivially degenerate triangle
|
|
236485
|
+
// trivially degenerate triangle; skip!!!
|
|
236447
236486
|
}
|
|
236448
236487
|
else {
|
|
236449
236488
|
if (this._options.needNormals)
|
|
@@ -236455,7 +236494,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236455
236494
|
}
|
|
236456
236495
|
addSectorQuadA01B01(sectorA0, sectorA1, sectorB0, sectorB1) {
|
|
236457
236496
|
if (sectorA0.xyz.isAlmostEqual(sectorA1.xyz) && sectorB0.xyz.isAlmostEqual(sectorB1.xyz)) {
|
|
236458
|
-
// ignore null quad
|
|
236497
|
+
// ignore null quad
|
|
236459
236498
|
}
|
|
236460
236499
|
else if (this._options.shouldTriangulate) {
|
|
236461
236500
|
this.addSectorTriangle(sectorA0, sectorA1, sectorB1);
|
|
@@ -236469,10 +236508,9 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236469
236508
|
this.addIndexedQuadPointIndexes(sectorA0.xyzIndex, sectorA1.xyzIndex, sectorB0.xyzIndex, sectorB1.xyzIndex, true);
|
|
236470
236509
|
}
|
|
236471
236510
|
}
|
|
236472
|
-
/**
|
|
236473
|
-
*
|
|
236474
|
-
* *
|
|
236475
|
-
* * addIndexedQuad is free to apply reversal or triangulation options.
|
|
236511
|
+
/**
|
|
236512
|
+
* Add facets between lineStrings with matched point counts.
|
|
236513
|
+
* * Surface normals are computed from (a) curve tangents in the linestrings and (b) rule line between linestrings.
|
|
236476
236514
|
*/
|
|
236477
236515
|
addBetweenLineStringsWithRuleEdgeNormals(lineStringA, vA, lineStringB, vB, addClosure = false) {
|
|
236478
236516
|
const pointA = lineStringA.packedPoints;
|
|
@@ -236506,7 +236544,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236506
236544
|
FacetSector.computeNormalsAlongRuleLine(sectorA1, sectorB1);
|
|
236507
236545
|
this.setSectorIndices(sectorA1);
|
|
236508
236546
|
this.setSectorIndices(sectorB1);
|
|
236509
|
-
// create the facet
|
|
236547
|
+
// create the facet
|
|
236510
236548
|
this.addSectorQuadA01B01(sectorA0, sectorA1, sectorB0, sectorB1);
|
|
236511
236549
|
sectorA0.copyContentsFrom(sectorA1);
|
|
236512
236550
|
sectorB0.copyContentsFrom(sectorB1);
|
|
@@ -236514,10 +236552,9 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236514
236552
|
if (addClosure)
|
|
236515
236553
|
this.addSectorQuadA01B01(sectorA0, sectorA00, sectorB0, sectorB00);
|
|
236516
236554
|
}
|
|
236517
|
-
/**
|
|
236518
|
-
*
|
|
236519
|
-
* *
|
|
236520
|
-
* * uv indices pre-stored
|
|
236555
|
+
/**
|
|
236556
|
+
* Add facets between lineStrings with matched point counts.
|
|
236557
|
+
* * Indices of points, normals, and uv parameters are pre-stored in the linestrings.
|
|
236521
236558
|
*/
|
|
236522
236559
|
addBetweenLineStringsWithStoredIndices(lineStringA, lineStringB) {
|
|
236523
236560
|
const pointA = lineStringA.pointIndices;
|
|
@@ -236553,7 +236590,8 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236553
236590
|
}
|
|
236554
236591
|
}
|
|
236555
236592
|
else {
|
|
236556
|
-
if (pointA.atUncheckedIndex(i - 1) !== pointA.atUncheckedIndex(i) ||
|
|
236593
|
+
if (pointA.atUncheckedIndex(i - 1) !== pointA.atUncheckedIndex(i) ||
|
|
236594
|
+
pointB.atUncheckedIndex(i - 1) !== pointB.atUncheckedIndex(i)) {
|
|
236557
236595
|
this.addIndexedQuadPointIndexes(pointA.atUncheckedIndex(i - 1), pointA.atUncheckedIndex(i), pointB.atUncheckedIndex(i - 1), pointB.atUncheckedIndex(i), false);
|
|
236558
236596
|
if (normalA && normalB)
|
|
236559
236597
|
this.addIndexedQuadNormalIndexes(normalA.atUncheckedIndex(i - 1), normalA.atUncheckedIndex(i), normalB.atUncheckedIndex(i - 1), normalB.atUncheckedIndex(i));
|
|
@@ -236564,8 +236602,8 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236564
236602
|
this._polyface.terminateFacet();
|
|
236565
236603
|
}
|
|
236566
236604
|
}
|
|
236567
|
-
/**
|
|
236568
|
-
*
|
|
236605
|
+
/**
|
|
236606
|
+
* Add facets between lineStrings with matched point counts.
|
|
236569
236607
|
* * Facets are announced to addIndexedQuad.
|
|
236570
236608
|
* * addIndexedQuad is free to apply reversal or triangulation options.
|
|
236571
236609
|
*/
|
|
@@ -236591,7 +236629,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236591
236629
|
}
|
|
236592
236630
|
else {
|
|
236593
236631
|
const children = curves.children;
|
|
236594
|
-
// just send the children individually
|
|
236632
|
+
// just send the children individually; final compress will fix things??
|
|
236595
236633
|
if (children)
|
|
236596
236634
|
for (const c of children) {
|
|
236597
236635
|
this.addBetweenTransformedLineStrings(c, transformA, transformB);
|
|
@@ -236623,11 +236661,9 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236623
236661
|
}
|
|
236624
236662
|
}
|
|
236625
236663
|
}
|
|
236626
|
-
/**
|
|
236627
|
-
* Add facets from a Cone
|
|
236628
|
-
*/
|
|
236664
|
+
/** Add facets from a Cone. */
|
|
236629
236665
|
addCone(cone) {
|
|
236630
|
-
// ensure identical stroke counts at each end
|
|
236666
|
+
// ensure identical stroke counts at each end
|
|
236631
236667
|
let strokeCount = 16;
|
|
236632
236668
|
if (this._options)
|
|
236633
236669
|
strokeCount = this._options.applyTolerancesToArc(cone.getMaxRadius());
|
|
@@ -236652,9 +236688,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236652
236688
|
}
|
|
236653
236689
|
}
|
|
236654
236690
|
}
|
|
236655
|
-
/**
|
|
236656
|
-
* Add facets for a TorusPipe.
|
|
236657
|
-
*/
|
|
236691
|
+
/** Add facets for a TorusPipe. */
|
|
236658
236692
|
addTorusPipe(surface, phiStrokeCount, thetaStrokeCount) {
|
|
236659
236693
|
const thetaFraction = surface.getThetaFraction();
|
|
236660
236694
|
let numU = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.clamp(_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.resolveNumber(phiStrokeCount, 8), 4, 64);
|
|
@@ -236698,11 +236732,11 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236698
236732
|
}
|
|
236699
236733
|
/**
|
|
236700
236734
|
* Add point data (no params, normals) for linestrings.
|
|
236701
|
-
* * This recurses through curve chains (loops and paths)
|
|
236702
|
-
* *
|
|
236735
|
+
* * This recurses through curve chains (loops and paths).
|
|
236736
|
+
* * LineStrings are swept.
|
|
236703
236737
|
* * All other curve types are ignored.
|
|
236704
|
-
* @param
|
|
236705
|
-
* @param
|
|
236738
|
+
* @param contour contour which contains only linestrings.
|
|
236739
|
+
* @param vector sweep vector.
|
|
236706
236740
|
*/
|
|
236707
236741
|
addLinearSweepLineStringsXYZOnly(contour, vector) {
|
|
236708
236742
|
if (contour instanceof _curve_LineString3d__WEBPACK_IMPORTED_MODULE_11__.LineString3d) {
|
|
@@ -236718,22 +236752,18 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236718
236752
|
pointB = pointA.plus(vector, pointB);
|
|
236719
236753
|
indexA1 = this.addPoint(pointA);
|
|
236720
236754
|
indexB1 = this.addPoint(pointB);
|
|
236721
|
-
if (i > 0)
|
|
236755
|
+
if (i > 0)
|
|
236722
236756
|
this.addIndexedQuadPointIndexes(indexA0, indexA1, indexB0, indexB1);
|
|
236723
|
-
}
|
|
236724
236757
|
indexA0 = indexA1;
|
|
236725
236758
|
indexB0 = indexB1;
|
|
236726
236759
|
}
|
|
236727
236760
|
}
|
|
236728
236761
|
else if (contour instanceof _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_13__.CurveChain) {
|
|
236729
|
-
for (const ls of contour.children)
|
|
236762
|
+
for (const ls of contour.children)
|
|
236730
236763
|
this.addLinearSweepLineStringsXYZOnly(ls, vector);
|
|
236731
|
-
}
|
|
236732
236764
|
}
|
|
236733
236765
|
}
|
|
236734
|
-
/**
|
|
236735
|
-
* Construct facets for a rotational sweep.
|
|
236736
|
-
*/
|
|
236766
|
+
/** Construct facets for a rotational sweep. */
|
|
236737
236767
|
addRotationalSweep(surface) {
|
|
236738
236768
|
const contour = surface.getCurves();
|
|
236739
236769
|
const section0 = _curve_Query_StrokeCountChain__WEBPACK_IMPORTED_MODULE_16__.StrokeCountSection.createForParityRegionOrChain(contour, this._options);
|
|
@@ -236756,22 +236786,21 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236756
236786
|
const capContour = surface.getSweepContourRef();
|
|
236757
236787
|
capContour.purgeFacets();
|
|
236758
236788
|
capContour.emitFacets(this, true, undefined);
|
|
236759
|
-
// final loop pass left transformA at end
|
|
236789
|
+
// final loop pass left transformA at end
|
|
236760
236790
|
capContour.emitFacets(this, false, surface.getFractionalRotationTransform(1.0));
|
|
236761
236791
|
}
|
|
236762
236792
|
}
|
|
236763
|
-
/**
|
|
236764
|
-
* Construct facets for any planar region
|
|
236765
|
-
*/
|
|
236793
|
+
/** Construct facets for any planar region. */
|
|
236766
236794
|
addTriangulatedRegion(region) {
|
|
236767
236795
|
const contour = _solid_SweepContour__WEBPACK_IMPORTED_MODULE_18__.SweepContour.createForLinearSweep(region);
|
|
236768
236796
|
if (contour)
|
|
236769
236797
|
contour.emitFacets(this, this.reversedFlag, undefined);
|
|
236770
236798
|
}
|
|
236771
236799
|
/**
|
|
236800
|
+
* Apply stroke counts to curve primitives.
|
|
236772
236801
|
* * Recursively visit all children of data.
|
|
236773
|
-
* * At each primitive, invoke
|
|
236774
|
-
* @
|
|
236802
|
+
* * At each primitive, invoke `computeStrokeCountForOptions` method with options from the builder.
|
|
236803
|
+
* @deprecated in 4.x. This method does nothing and is unneeded.
|
|
236775
236804
|
*/
|
|
236776
236805
|
applyStrokeCountsToCurvePrimitives(data) {
|
|
236777
236806
|
const options = this._options;
|
|
@@ -236781,9 +236810,9 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236781
236810
|
else if (data instanceof _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_13__.CurveCollection) {
|
|
236782
236811
|
const children = data.children;
|
|
236783
236812
|
if (children)
|
|
236784
|
-
for (const child of children)
|
|
236813
|
+
for (const child of children)
|
|
236814
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
236785
236815
|
this.applyStrokeCountsToCurvePrimitives(child);
|
|
236786
|
-
}
|
|
236787
236816
|
}
|
|
236788
236817
|
}
|
|
236789
236818
|
addBetweenStrokeSetsWithRuledNormals(stroke0, stroke1, numVEdge) {
|
|
@@ -236803,22 +236832,20 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236803
236832
|
}
|
|
236804
236833
|
createIndicesInLineString(ls, vParam, transform) {
|
|
236805
236834
|
const n = ls.numPoints();
|
|
236806
|
-
|
|
236807
|
-
|
|
236808
|
-
|
|
236809
|
-
|
|
236810
|
-
|
|
236811
|
-
|
|
236812
|
-
|
|
236813
|
-
|
|
236814
|
-
indexB = this.findOrAddPointInLineString(ls, i, transform, indexA);
|
|
236815
|
-
pointIndices.push(indexB);
|
|
236816
|
-
indexA = indexB;
|
|
236817
|
-
}
|
|
236818
|
-
// assume last point can only repeat back to zero ...
|
|
236819
|
-
indexB = this.findOrAddPointInLineString(ls, n - 1, transform, index0);
|
|
236835
|
+
const pointIndices = ls.ensureEmptyPointIndices();
|
|
236836
|
+
const index0 = this.findOrAddPointInLineString(ls, 0, transform);
|
|
236837
|
+
pointIndices.push(index0);
|
|
236838
|
+
if (n > 1) {
|
|
236839
|
+
let indexA = index0;
|
|
236840
|
+
let indexB;
|
|
236841
|
+
for (let i = 1; i + 1 < n; i++) {
|
|
236842
|
+
indexB = this.findOrAddPointInLineString(ls, i, transform, indexA);
|
|
236820
236843
|
pointIndices.push(indexB);
|
|
236844
|
+
indexA = indexB;
|
|
236821
236845
|
}
|
|
236846
|
+
// assume last point can only repeat back to zero
|
|
236847
|
+
indexB = this.findOrAddPointInLineString(ls, n - 1, transform, index0);
|
|
236848
|
+
pointIndices.push(indexB);
|
|
236822
236849
|
}
|
|
236823
236850
|
if (this._options.needNormals && ls.packedSurfaceNormals !== undefined) {
|
|
236824
236851
|
const normalIndices = ls.ensureEmptyNormalIndices();
|
|
@@ -236832,7 +236859,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236832
236859
|
normalIndices.push(normalIndexB);
|
|
236833
236860
|
normalIndexA = normalIndexB;
|
|
236834
236861
|
}
|
|
236835
|
-
// assume last point can only repeat back to zero
|
|
236862
|
+
// assume last point can only repeat back to zero
|
|
236836
236863
|
normalIndexB = this.findOrAddNormalInLineString(ls, n - 1, transform, normalIndex0, normalIndexA);
|
|
236837
236864
|
normalIndices.push(normalIndexB);
|
|
236838
236865
|
}
|
|
@@ -236849,7 +236876,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236849
236876
|
uvIndices.push(uvIndexB);
|
|
236850
236877
|
uvIndexA = uvIndexB;
|
|
236851
236878
|
}
|
|
236852
|
-
// assume last point can only repeat back to zero
|
|
236879
|
+
// assume last point can only repeat back to zero
|
|
236853
236880
|
uvIndexB = this.findOrAddParamInLineString(ls, n - 1, vParam, uvIndexA, uvIndex0);
|
|
236854
236881
|
uvIndices.push(uvIndexB);
|
|
236855
236882
|
}
|
|
@@ -236876,12 +236903,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236876
236903
|
}
|
|
236877
236904
|
}
|
|
236878
236905
|
}
|
|
236879
|
-
/**
|
|
236880
|
-
*
|
|
236881
|
-
* Add facets from
|
|
236882
|
-
* * The swept contour
|
|
236883
|
-
* * each cap.
|
|
236884
|
-
*/
|
|
236906
|
+
/** Add facets from the linear sweep. */
|
|
236885
236907
|
addLinearSweep(surface) {
|
|
236886
236908
|
const contour = surface.getCurvesRef();
|
|
236887
236909
|
const section0 = _curve_Query_StrokeCountChain__WEBPACK_IMPORTED_MODULE_16__.StrokeCountSection.createForParityRegionOrChain(contour, this._options);
|
|
@@ -236898,17 +236920,14 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236898
236920
|
contourA.emitFacets(this, false, sweepTransform);
|
|
236899
236921
|
}
|
|
236900
236922
|
}
|
|
236901
|
-
/**
|
|
236902
|
-
* Add facets from a ruled sweep.
|
|
236903
|
-
*/
|
|
236923
|
+
/** Add facets from a ruled sweep. */
|
|
236904
236924
|
addRuledSweep(surface) {
|
|
236905
236925
|
const contours = surface.sweepContoursRef();
|
|
236906
236926
|
let stroke0;
|
|
236907
236927
|
let stroke1;
|
|
236908
236928
|
const sectionMaps = [];
|
|
236909
|
-
for (const contour of contours)
|
|
236929
|
+
for (const contour of contours)
|
|
236910
236930
|
sectionMaps.push(_curve_Query_StrokeCountChain__WEBPACK_IMPORTED_MODULE_16__.StrokeCountSection.createForParityRegionOrChain(contour.curves, this._options));
|
|
236911
|
-
}
|
|
236912
236931
|
if (_curve_Query_StrokeCountChain__WEBPACK_IMPORTED_MODULE_16__.StrokeCountSection.enforceStrokeCountCompatibility(sectionMaps)) {
|
|
236913
236932
|
_curve_Query_StrokeCountChain__WEBPACK_IMPORTED_MODULE_16__.StrokeCountSection.enforceCompatibleDistanceSums(sectionMaps);
|
|
236914
236933
|
for (let i = 0; i < contours.length; i++) {
|
|
@@ -236934,9 +236953,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236934
236953
|
}
|
|
236935
236954
|
return true;
|
|
236936
236955
|
}
|
|
236937
|
-
/**
|
|
236938
|
-
* Add facets from a Sphere
|
|
236939
|
-
*/
|
|
236956
|
+
/** Add facets from a sphere. */
|
|
236940
236957
|
addSphere(sphere, strokeCount) {
|
|
236941
236958
|
let numStrokeTheta = strokeCount ? strokeCount : this.options.applyTolerancesToArc(sphere.maxAxisRadius());
|
|
236942
236959
|
if (_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isOdd(numStrokeTheta))
|
|
@@ -236956,21 +236973,19 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236956
236973
|
this.endFace();
|
|
236957
236974
|
}
|
|
236958
236975
|
}
|
|
236959
|
-
/**
|
|
236960
|
-
* Add facets from a Box
|
|
236961
|
-
*/
|
|
236976
|
+
/** Add facets from a box. */
|
|
236962
236977
|
addBox(box) {
|
|
236963
236978
|
const corners = box.getCorners();
|
|
236964
236979
|
const xLength = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.maxXY(box.getBaseX(), box.getBaseX());
|
|
236965
236980
|
const yLength = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.maxXY(box.getBaseY(), box.getTopY());
|
|
236966
236981
|
let zLength = 0.0;
|
|
236967
|
-
for (let i = 0; i < 4; i++)
|
|
236982
|
+
for (let i = 0; i < 4; i++)
|
|
236968
236983
|
zLength = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.maxXY(zLength, corners[i].distance(corners[i + 4]));
|
|
236969
|
-
}
|
|
236970
236984
|
const numX = this._options.applyMaxEdgeLength(1, xLength);
|
|
236971
236985
|
const numY = this._options.applyMaxEdgeLength(1, yLength);
|
|
236972
236986
|
const numZ = this._options.applyMaxEdgeLength(1, zLength);
|
|
236973
|
-
//
|
|
236987
|
+
// wrap the 4 out-of-plane faces as a single parameter space with "distance"
|
|
236988
|
+
// advancing in x, then y, then negative x, then negative y
|
|
236974
236989
|
const uParamRange = _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_14__.Segment1d.create(0, xLength);
|
|
236975
236990
|
const vParamRange = _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_14__.Segment1d.create(0, zLength);
|
|
236976
236991
|
this.addUVGridBody(_geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_21__.BilinearPatch.create(corners[0], corners[1], corners[4], corners[5]), numX, numZ, uParamRange, vParamRange);
|
|
@@ -236980,7 +236995,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236980
236995
|
this.addUVGridBody(_geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_21__.BilinearPatch.create(corners[3], corners[2], corners[7], corners[6]), numX, numZ, uParamRange, vParamRange);
|
|
236981
236996
|
uParamRange.shift(xLength);
|
|
236982
236997
|
this.addUVGridBody(_geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_21__.BilinearPatch.create(corners[2], corners[0], corners[6], corners[4]), numY, numZ, uParamRange, vParamRange);
|
|
236983
|
-
// finally end that wraparound face
|
|
236998
|
+
// finally end that wraparound face
|
|
236984
236999
|
this.endFace();
|
|
236985
237000
|
if (box.capped) {
|
|
236986
237001
|
uParamRange.set(0.0, xLength);
|
|
@@ -236993,15 +237008,15 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
236993
237008
|
this.endFace();
|
|
236994
237009
|
}
|
|
236995
237010
|
}
|
|
236996
|
-
/**
|
|
236997
|
-
*
|
|
236998
|
-
* * Add points to the polyface
|
|
236999
|
-
* *
|
|
237000
|
-
* @param points array of points.
|
|
237011
|
+
/**
|
|
237012
|
+
* Add a polygon to the evolving facets.
|
|
237013
|
+
* * Add points to the polyface.
|
|
237014
|
+
* * Indices are added (in reverse order if indicated by the builder state).
|
|
237015
|
+
* @param points array of points. This may contain extra points not to be used in the polygon.
|
|
237001
237016
|
* @param numPointsToUse number of points to use.
|
|
237002
237017
|
*/
|
|
237003
237018
|
addPolygon(points, numPointsToUse) {
|
|
237004
|
-
// don't use trailing points that match start point
|
|
237019
|
+
// don't use trailing points that match start point
|
|
237005
237020
|
if (numPointsToUse === undefined)
|
|
237006
237021
|
numPointsToUse = points.length;
|
|
237007
237022
|
while (numPointsToUse > 1 && points[numPointsToUse - 1].isAlmostEqual(points[0]))
|
|
@@ -237021,23 +237036,23 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
237021
237036
|
}
|
|
237022
237037
|
this._polyface.terminateFacet();
|
|
237023
237038
|
}
|
|
237024
|
-
/**
|
|
237025
|
-
*
|
|
237039
|
+
/**
|
|
237040
|
+
* Add a polygon to the evolving facets.
|
|
237026
237041
|
* * Add points to the polyface
|
|
237027
|
-
* *
|
|
237042
|
+
* * Indices are added (in reverse order if indicated by the builder state).
|
|
237028
237043
|
* * Arrays with 2 or fewer points are ignored.
|
|
237029
237044
|
* @param points array of points. Trailing closure points are ignored.
|
|
237030
237045
|
*/
|
|
237031
237046
|
addPolygonGrowableXYZArray(points) {
|
|
237032
|
-
// don't use trailing points that match start point
|
|
237047
|
+
// don't use trailing points that match start point
|
|
237033
237048
|
let numPointsToUse = points.length;
|
|
237034
237049
|
while (numPointsToUse > 2 && _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isSmallMetricDistance(points.distanceIndexIndex(0, numPointsToUse - 1)))
|
|
237035
237050
|
numPointsToUse--;
|
|
237036
237051
|
// strip trailing duplicates
|
|
237037
237052
|
while (numPointsToUse > 2 && _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isSmallMetricDistance(points.distanceIndexIndex(numPointsToUse - 2, numPointsToUse - 1)))
|
|
237038
237053
|
numPointsToUse--;
|
|
237039
|
-
// ignore triangles for which the height is less than smallMetricDistance times length
|
|
237040
|
-
// sum of edge lengths is twice the perimeter.
|
|
237054
|
+
// ignore triangles for which the height is less than smallMetricDistance times length.
|
|
237055
|
+
// sum of edge lengths is twice the perimeter. If it is flat that's twice the largest base dimension.
|
|
237041
237056
|
// cross product magnitude is twice the area.
|
|
237042
237057
|
if (numPointsToUse === 3) {
|
|
237043
237058
|
const cross = points.crossProductIndexIndexIndex(0, 1, 2);
|
|
@@ -237063,19 +237078,20 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
237063
237078
|
this._polyface.terminateFacet();
|
|
237064
237079
|
}
|
|
237065
237080
|
}
|
|
237066
|
-
/**
|
|
237067
|
-
*
|
|
237068
|
-
* *
|
|
237069
|
-
* *
|
|
237070
|
-
* *
|
|
237071
|
-
*
|
|
237072
|
-
* @param
|
|
237073
|
-
* @param
|
|
237074
|
-
* @param
|
|
237075
|
-
* @param
|
|
237081
|
+
/**
|
|
237082
|
+
* Add a polygon to the evolving facets.
|
|
237083
|
+
* * Add points to the polyface.
|
|
237084
|
+
* * Compute each point index as the point is added.
|
|
237085
|
+
* * All data arrays are parallel to the point array.
|
|
237086
|
+
* * Point indices are added in reverse order if indicated by the builder state.
|
|
237087
|
+
* @param points array of vertices in order around the facet.
|
|
237088
|
+
* @param normals (optional) array of normals, one per vertex.
|
|
237089
|
+
* @param params (optional) array of uv-parameters, one per vertex.
|
|
237090
|
+
* @param colors (optional) array of colors, one per vertex.
|
|
237091
|
+
* @param edgeVisible (optional) array of flags, one per vertex, true iff edge starting at corresponding vertex is visible.
|
|
237076
237092
|
*/
|
|
237077
237093
|
addFacetFromGrowableArrays(points, normals, params, colors, edgeVisible) {
|
|
237078
|
-
// don't use trailing points that match start point
|
|
237094
|
+
// don't use trailing points that match start point
|
|
237079
237095
|
let numPointsToUse = points.length;
|
|
237080
237096
|
while (numPointsToUse > 1 && _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isSmallMetricDistance(points.distanceIndexIndex(0, numPointsToUse - 1)))
|
|
237081
237097
|
numPointsToUse--;
|
|
@@ -237126,13 +237142,14 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
237126
237142
|
}
|
|
237127
237143
|
this._polyface.terminateFacet();
|
|
237128
237144
|
}
|
|
237129
|
-
/**
|
|
237130
|
-
*
|
|
237145
|
+
/**
|
|
237146
|
+
* Add the current visitor facet to the evolving polyface.
|
|
237147
|
+
* * Indices are added (in reverse order if indicated by the builder state).
|
|
237131
237148
|
*/
|
|
237132
237149
|
addFacetFromVisitor(visitor) {
|
|
237133
237150
|
this.addFacetFromGrowableArrays(visitor.point, visitor.normal, visitor.param, visitor.color, visitor.edgeVisible);
|
|
237134
237151
|
}
|
|
237135
|
-
/** Add all visitor facets to the evolving polyface (in reverse order if indicated by the builder state) */
|
|
237152
|
+
/** Add all visitor facets to the evolving polyface (in reverse order if indicated by the builder state). */
|
|
237136
237153
|
addFacetsFromVisitor(visitor) {
|
|
237137
237154
|
visitor.reset();
|
|
237138
237155
|
for (; visitor.moveToNextFacet();)
|
|
@@ -237141,8 +237158,8 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
237141
237158
|
/**
|
|
237142
237159
|
* Add the subset of visitor data indexed by the indices.
|
|
237143
237160
|
* * Ideally, the subset represents a sub-facet of the visited facet.
|
|
237144
|
-
* @param visitor data for the currently visited facet
|
|
237145
|
-
* @param indices local indices into the visitor data arrays
|
|
237161
|
+
* @param visitor data for the currently visited facet.
|
|
237162
|
+
* @param indices local indices into the visitor data arrays.
|
|
237146
237163
|
* @returns whether the data was added successfully. Encountering an invalid index returns false.
|
|
237147
237164
|
*/
|
|
237148
237165
|
addFacetFromIndexedVisitor(visitor, indices) {
|
|
@@ -237170,49 +237187,71 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
237170
237187
|
this.addFacetFromGrowableArrays(xyz, normal, param, color, visible);
|
|
237171
237188
|
return true;
|
|
237172
237189
|
}
|
|
237173
|
-
/** Add a polyface
|
|
237190
|
+
/** Add a polyface with optional reverse and transform. */
|
|
237174
237191
|
addIndexedPolyface(source, reversed = false, transform) {
|
|
237175
237192
|
this._polyface.addIndexedPolyface(source, reversed, transform);
|
|
237176
237193
|
}
|
|
237177
237194
|
/**
|
|
237178
237195
|
* Produce a new FacetFaceData for all terminated facets since construction of the previous face.
|
|
237179
|
-
* Each facet number/index is mapped to the FacetFaceData through the faceToFaceData array.
|
|
237180
|
-
*
|
|
237196
|
+
* * Each facet number/index is mapped to the FacetFaceData through the faceToFaceData array.
|
|
237197
|
+
* @returns true if successful, and false otherwise.
|
|
237181
237198
|
*/
|
|
237182
237199
|
endFace() {
|
|
237183
237200
|
return this._polyface.setNewFaceData();
|
|
237184
237201
|
}
|
|
237185
|
-
/** Double dispatch handler for Cone */
|
|
237186
|
-
handleCone(g) {
|
|
237187
|
-
|
|
237188
|
-
|
|
237189
|
-
/** Double dispatch handler for
|
|
237190
|
-
|
|
237191
|
-
|
|
237192
|
-
|
|
237193
|
-
/** Double dispatch handler for
|
|
237194
|
-
|
|
237195
|
-
|
|
237196
|
-
|
|
237197
|
-
/** Double dispatch handler for
|
|
237198
|
-
|
|
237199
|
-
|
|
237200
|
-
|
|
237201
|
-
/** Double dispatch handler for
|
|
237202
|
-
|
|
237203
|
-
|
|
237204
|
-
|
|
237205
|
-
/**
|
|
237206
|
-
|
|
237202
|
+
/** Double dispatch handler for Cone. */
|
|
237203
|
+
handleCone(g) {
|
|
237204
|
+
return this.addCone(g);
|
|
237205
|
+
}
|
|
237206
|
+
/** Double dispatch handler for TorusPipe. */
|
|
237207
|
+
handleTorusPipe(g) {
|
|
237208
|
+
return this.addTorusPipe(g);
|
|
237209
|
+
}
|
|
237210
|
+
/** Double dispatch handler for Sphere. */
|
|
237211
|
+
handleSphere(g) {
|
|
237212
|
+
return this.addSphere(g);
|
|
237213
|
+
}
|
|
237214
|
+
/** Double dispatch handler for Box. */
|
|
237215
|
+
handleBox(g) {
|
|
237216
|
+
return this.addBox(g);
|
|
237217
|
+
}
|
|
237218
|
+
/** Double dispatch handler for LinearSweep. */
|
|
237219
|
+
handleLinearSweep(g) {
|
|
237220
|
+
return this.addLinearSweep(g);
|
|
237221
|
+
}
|
|
237222
|
+
/** Double dispatch handler for RotationalSweep. */
|
|
237223
|
+
handleRotationalSweep(g) {
|
|
237224
|
+
return this.addRotationalSweep(g);
|
|
237225
|
+
}
|
|
237226
|
+
/** Double dispatch handler for RuledSweep. */
|
|
237227
|
+
handleRuledSweep(g) {
|
|
237228
|
+
return this.addRuledSweep(g);
|
|
237229
|
+
}
|
|
237230
|
+
/** Double dispatch handler for Loop. */
|
|
237231
|
+
handleLoop(g) {
|
|
237232
|
+
return this.addTriangulatedRegion(g);
|
|
237233
|
+
}
|
|
237234
|
+
/** Double dispatch handler for ParityRegion. */
|
|
237235
|
+
handleParityRegion(g) {
|
|
237236
|
+
return this.addTriangulatedRegion(g);
|
|
237237
|
+
}
|
|
237238
|
+
/** Double dispatch handler for UnionRegion. */
|
|
237239
|
+
handleUnionRegion(g) {
|
|
237240
|
+
return this.addTriangulatedRegion(g);
|
|
237241
|
+
}
|
|
237242
|
+
/** Add facets for a GeometryQuery object. This is double dispatch through `dispatchToGeometryHandler(this)` */
|
|
237243
|
+
addGeometryQuery(g) {
|
|
237244
|
+
g.dispatchToGeometryHandler(this);
|
|
237245
|
+
}
|
|
237207
237246
|
/**
|
|
237208
237247
|
* Add a graph to the builder.
|
|
237209
|
-
* * Visit one node per face
|
|
237210
|
-
* * If `acceptFaceFunction(node)` returns true, pass face coordinates to the builder
|
|
237248
|
+
* * Visit one node per face.
|
|
237249
|
+
* * If `acceptFaceFunction(node)` returns true, pass face coordinates to the builder.
|
|
237211
237250
|
* * Accepted face edge visibility is determined by `isEdgeVisibleFunction`.
|
|
237212
237251
|
* * Rely on the builder's compress step to find common vertex coordinates.
|
|
237213
|
-
* @param graph faces to add as facets
|
|
237214
|
-
* @param acceptFaceFunction optional test for whether to add a given face. Default: ignore exterior faces
|
|
237215
|
-
* @param isEdgeVisibleFunction optional test for whether to hide an edge. Default: hide interior edges
|
|
237252
|
+
* @param graph faces to add as facets.
|
|
237253
|
+
* @param acceptFaceFunction optional test for whether to add a given face. Default: ignore exterior faces.
|
|
237254
|
+
* @param isEdgeVisibleFunction optional test for whether to hide an edge. Default: hide interior edges.
|
|
237216
237255
|
* @internal
|
|
237217
237256
|
*/
|
|
237218
237257
|
addGraph(graph, acceptFaceFunction = (node) => _topology_Graph__WEBPACK_IMPORTED_MODULE_23__.HalfEdge.testNodeMaskNotExterior(node), isEdgeVisibleFunction = (node) => _topology_Graph__WEBPACK_IMPORTED_MODULE_23__.HalfEdge.testMateMaskExterior(node)) {
|
|
@@ -237243,12 +237282,12 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
237243
237282
|
});
|
|
237244
237283
|
}
|
|
237245
237284
|
/**
|
|
237246
|
-
*
|
|
237247
|
-
* * For each node in `faces
|
|
237248
|
-
* *
|
|
237249
|
-
* *
|
|
237250
|
-
* * (
|
|
237251
|
-
* *
|
|
237285
|
+
* Add a graph's faces to the builder.
|
|
237286
|
+
* * For each node in `faces`:
|
|
237287
|
+
* * Add all of its vertices to the polyface.
|
|
237288
|
+
* * Add point indices to form a new facet.
|
|
237289
|
+
* * (note: no normal or param indices are added)
|
|
237290
|
+
* * Terminate the facet.
|
|
237252
237291
|
* @internal
|
|
237253
237292
|
*/
|
|
237254
237293
|
addGraphFaces(faces) {
|
|
@@ -237266,9 +237305,10 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
237266
237305
|
/**
|
|
237267
237306
|
* Create a polyface containing the faces of a HalfEdgeGraph, with test functions to filter faces and hide edges.
|
|
237268
237307
|
* * This is a static wrapper of [[addGraph]].
|
|
237269
|
-
* @param graph faces to add as facets
|
|
237270
|
-
* @param
|
|
237271
|
-
* @param
|
|
237308
|
+
* @param graph faces to add as facets.
|
|
237309
|
+
* @param options (optional) options for the polyface.
|
|
237310
|
+
* @param acceptFaceFunction optional test for whether to add a given face. Default: ignore exterior faces.
|
|
237311
|
+
* @param isEdgeVisibleFunction optional test for whether to hide an edge. Default: hide interior edges.
|
|
237272
237312
|
* @internal
|
|
237273
237313
|
*/
|
|
237274
237314
|
static graphToPolyface(graph, options, acceptFaceFunction = (node) => _topology_Graph__WEBPACK_IMPORTED_MODULE_23__.HalfEdge.testNodeMaskNotExterior(node), isEdgeVisibleFunction = (node) => _topology_Graph__WEBPACK_IMPORTED_MODULE_23__.HalfEdge.testMateMaskExterior(node)) {
|
|
@@ -237277,7 +237317,8 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
237277
237317
|
builder.endFace();
|
|
237278
237318
|
return builder.claimPolyface();
|
|
237279
237319
|
}
|
|
237280
|
-
/**
|
|
237320
|
+
/**
|
|
237321
|
+
* Create a polyface containing the faces of a HalfEdgeGraph that are specified by the HalfEdge array.
|
|
237281
237322
|
* @internal
|
|
237282
237323
|
*/
|
|
237283
237324
|
static graphFacesToPolyface(faces) {
|
|
@@ -237286,7 +237327,8 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
237286
237327
|
builder.endFace();
|
|
237287
237328
|
return builder.claimPolyface();
|
|
237288
237329
|
}
|
|
237289
|
-
/**
|
|
237330
|
+
/**
|
|
237331
|
+
* Create a polyface containing triangles in a (space) polygon.
|
|
237290
237332
|
* * The polyface contains only coordinate data (no params or normals).
|
|
237291
237333
|
*/
|
|
237292
237334
|
static polygonToTriangulatedPolyface(points, localToWorld) {
|
|
@@ -237307,13 +237349,13 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
237307
237349
|
return undefined;
|
|
237308
237350
|
}
|
|
237309
237351
|
/**
|
|
237310
|
-
*
|
|
237311
|
-
* * pointArray[i] is an array of 3 or 4 points
|
|
237312
|
-
* * paramArray[i] is an array of matching number of params
|
|
237352
|
+
* Add facets to the builder given arrays of coordinates for multiple facets.
|
|
237353
|
+
* * pointArray[i] is an array of 3 or 4 points.
|
|
237354
|
+
* * paramArray[i] is an array of matching number of params.
|
|
237313
237355
|
* * normalArray[i] is an array of matching number of normals.
|
|
237314
|
-
* @param pointArray array of arrays of point coordinates
|
|
237315
|
-
* @param paramArray array of arrays of uv parameters
|
|
237316
|
-
* @param normalArray array of arrays of normals
|
|
237356
|
+
* @param pointArray array of arrays of point coordinates.
|
|
237357
|
+
* @param paramArray (optional) array of arrays of uv parameters.
|
|
237358
|
+
* @param normalArray (optional) array of arrays of normals.
|
|
237317
237359
|
* @param endFace if true, call this.endFace after adding all the facets.
|
|
237318
237360
|
*/
|
|
237319
237361
|
addCoordinateFacets(pointArray, paramArray, normalArray, endFace = false) {
|
|
@@ -237329,15 +237371,16 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
237329
237371
|
this.endFace();
|
|
237330
237372
|
}
|
|
237331
237373
|
/**
|
|
237374
|
+
* Add facets from the parametric surface.
|
|
237332
237375
|
* * Evaluate `(numU + 1) * (numV + 1)` grid points (in 0..1 in both u and v) on a surface.
|
|
237333
237376
|
* * Add the facets for `numU * numV` quads.
|
|
237334
237377
|
* * uv params are the 0..1 fractions.
|
|
237335
|
-
* *
|
|
237336
|
-
* @param surface
|
|
237337
|
-
* @param numU number of intervals (edges) in the u direction
|
|
237338
|
-
* @param numV number of intervals (edges) in the v direction
|
|
237339
|
-
* @param uMap optional mapping from u fraction to parameter space (such as texture)
|
|
237340
|
-
* @param vMap optional mapping from v fraction to parameter space (such as texture)
|
|
237378
|
+
* * Normals are cross products of u and v direction partial derivatives.
|
|
237379
|
+
* @param surface UV surface to evaluate.
|
|
237380
|
+
* @param numU number of intervals (edges) in the u direction (number of points is `numU + 1`).
|
|
237381
|
+
* @param numV number of intervals (edges) in the v direction (number of points is `numV + 1`).
|
|
237382
|
+
* @param uMap optional mapping from u fraction to parameter space (such as texture).
|
|
237383
|
+
* @param vMap optional mapping from v fraction to parameter space (such as texture).
|
|
237341
237384
|
*/
|
|
237342
237385
|
addUVGridBody(surface, numU, numV, uMap, vMap) {
|
|
237343
237386
|
let xyzIndex0 = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_27__.GrowableFloat64Array(numU);
|
|
@@ -237366,7 +237409,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
237366
237409
|
const dv = 1.0 / numV;
|
|
237367
237410
|
const plane = _geometry3d_Plane3dByOriginAndVectors__WEBPACK_IMPORTED_MODULE_28__.Plane3dByOriginAndVectors.createXYPlane();
|
|
237368
237411
|
for (let v = 0; v <= numV; v++) {
|
|
237369
|
-
// evaluate new points
|
|
237412
|
+
// evaluate new points
|
|
237370
237413
|
xyzIndex1.clear();
|
|
237371
237414
|
if (needNormals)
|
|
237372
237415
|
normalIndex1.clear();
|
|
@@ -237416,23 +237459,26 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
237416
237459
|
indexSwap = xyzIndex1;
|
|
237417
237460
|
xyzIndex1 = xyzIndex0;
|
|
237418
237461
|
xyzIndex0 = indexSwap;
|
|
237419
|
-
if (needParams)
|
|
237462
|
+
if (needParams)
|
|
237420
237463
|
indexSwap = paramIndex1;
|
|
237421
|
-
|
|
237422
|
-
|
|
237423
|
-
|
|
237424
|
-
if (needNormals) {
|
|
237464
|
+
paramIndex1 = paramIndex0;
|
|
237465
|
+
paramIndex0 = indexSwap;
|
|
237466
|
+
if (needNormals)
|
|
237425
237467
|
indexSwap = normalIndex1;
|
|
237426
|
-
|
|
237427
|
-
|
|
237428
|
-
}
|
|
237468
|
+
normalIndex1 = normalIndex0;
|
|
237469
|
+
normalIndex0 = indexSwap;
|
|
237429
237470
|
}
|
|
237430
237471
|
xyzIndex0.clear();
|
|
237431
237472
|
xyzIndex1.clear();
|
|
237432
237473
|
}
|
|
237433
237474
|
/**
|
|
237434
|
-
*
|
|
237435
|
-
*
|
|
237475
|
+
* Create a polyface from a triangulation of the points.
|
|
237476
|
+
* * The triangulation is computed as seen in the top view: z-coordinates are ignored.
|
|
237477
|
+
* @param points an array of points.
|
|
237478
|
+
* @param options (optional) stroke options. Currently only two options are supported. If `options.needNormals` is
|
|
237479
|
+
* true, all facets are assigned the single normal 001. If `options.needParams` is true, all facet vertices are
|
|
237480
|
+
* assigned uv-parameters equal to their xy-coordinates. These options are rarely useful.
|
|
237481
|
+
* @returns triangulated polyface or `undefined` if triangulation was not possible.
|
|
237436
237482
|
*/
|
|
237437
237483
|
static pointsToTriangulatedPolyface(points, options) {
|
|
237438
237484
|
const graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_26__.Triangulator.createTriangulatedGraphFromPoints(points);
|
|
@@ -237440,21 +237486,20 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
237440
237486
|
return PolyfaceBuilder.graphToPolyface(graph, options);
|
|
237441
237487
|
return undefined;
|
|
237442
237488
|
}
|
|
237443
|
-
/**
|
|
237444
|
-
*
|
|
237489
|
+
/**
|
|
237490
|
+
* Add triangular facets between two linestrings.
|
|
237491
|
+
* * Each triangle will have 1 vertex on one of the linestrings and 2 on the other.
|
|
237445
237492
|
* * Choice of triangles is heuristic, hence does not have a unique solution.
|
|
237446
|
-
* * Logic
|
|
237447
|
-
* * Make near-coplanar facets
|
|
237448
|
-
* *
|
|
237493
|
+
* * Logic for choosing among the various possible triangles prefers:
|
|
237494
|
+
* * Make near-coplanar facets.
|
|
237495
|
+
* * Make facets with good aspect ratio.
|
|
237449
237496
|
* * This is exercised with a limited number of lookahead points, i.e. greedy to make first-available decision.
|
|
237450
237497
|
* @param pointsA points of first linestring.
|
|
237451
237498
|
* @param pointsB points of second linestring.
|
|
237452
237499
|
*/
|
|
237453
237500
|
addGreedyTriangulationBetweenLineStrings(pointsA, pointsB) {
|
|
237454
237501
|
const context = _GreedyTriangulationBetweenLineStrings__WEBPACK_IMPORTED_MODULE_29__.GreedyTriangulationBetweenLineStrings.createContext();
|
|
237455
|
-
context.emitTriangles(resolveToIndexedXYZCollectionOrCarrier(pointsA), resolveToIndexedXYZCollectionOrCarrier(pointsB), (triangle) => {
|
|
237456
|
-
this.addTriangleFacet(triangle.points);
|
|
237457
|
-
});
|
|
237502
|
+
context.emitTriangles(resolveToIndexedXYZCollectionOrCarrier(pointsA), resolveToIndexedXYZCollectionOrCarrier(pointsB), (triangle) => { this.addTriangleFacet(triangle.points); });
|
|
237458
237503
|
}
|
|
237459
237504
|
addMiteredPipesFromPoints(centerline, sectionData, numFacetAround = 12) {
|
|
237460
237505
|
const sections = _curve_CurveFactory__WEBPACK_IMPORTED_MODULE_30__.CurveFactory.createMiteredPipeSections(centerline, sectionData);
|
|
@@ -237479,13 +237524,14 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
237479
237524
|
}
|
|
237480
237525
|
}
|
|
237481
237526
|
/**
|
|
237482
|
-
*
|
|
237483
|
-
* * Circular or elliptical pipe cross sections can be specified by supplying either a radius, a pair of semi-axis
|
|
237527
|
+
* Add quad facets along a mitered pipe that follows a centerline curve.
|
|
237528
|
+
* * Circular or elliptical pipe cross sections can be specified by supplying either a radius, a pair of semi-axis
|
|
237529
|
+
* lengths, or a full Arc3d:
|
|
237484
237530
|
* * For semi-axis length input, x corresponds to an ellipse local axis nominally situated parallel to the xy-plane.
|
|
237485
|
-
* *
|
|
237531
|
+
* * For Arc3d input, the center is translated to the centerline start point to act as initial cross section.
|
|
237486
237532
|
* @param centerline centerline of pipe. If curved, it will be stroked using the builder's StrokeOptions.
|
|
237487
|
-
* @param sectionData circle radius, ellipse semi-axis lengths, or full Arc3d
|
|
237488
|
-
* @param numFacetAround how many equal parameter-space chords around each section
|
|
237533
|
+
* @param sectionData circle radius, ellipse semi-axis lengths, or full Arc3d.
|
|
237534
|
+
* @param numFacetAround how many equal parameter-space chords around each section.
|
|
237489
237535
|
*/
|
|
237490
237536
|
addMiteredPipes(centerline, sectionData, numFacetAround = 12) {
|
|
237491
237537
|
if (Array.isArray(centerline)) {
|
|
@@ -237506,7 +237552,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
237506
237552
|
this.addMiteredPipesFromPoints(linestring.packedPoints, sectionData, numFacetAround);
|
|
237507
237553
|
}
|
|
237508
237554
|
}
|
|
237509
|
-
/** Return the polyface index array indices corresponding to the given edge, or undefined if error. */
|
|
237555
|
+
/** Return the polyface index array indices corresponding to the given edge, or `undefined` if error. */
|
|
237510
237556
|
getEdgeIndices(edge) {
|
|
237511
237557
|
let indexA = -1;
|
|
237512
237558
|
let indexB = -1;
|
|
@@ -237518,8 +237564,10 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
237518
237564
|
}
|
|
237519
237565
|
return (indexA < 0 || indexB < 0) ? undefined : { edgeIndexA: indexA, edgeIndexB: indexB };
|
|
237520
237566
|
}
|
|
237521
|
-
/**
|
|
237522
|
-
*
|
|
237567
|
+
/**
|
|
237568
|
+
* Create a side face between base and swept facets along a base boundary edge.
|
|
237569
|
+
* * Assumes numBaseFacets base facets were added to this builder, immediately followed by the same number of swept
|
|
237570
|
+
* facets with opposite orientation (first index not preserved).
|
|
237523
237571
|
*/
|
|
237524
237572
|
addSweptFace(baseBoundaryEdge, numBaseFacets) {
|
|
237525
237573
|
const edge = this.getEdgeIndices(baseBoundaryEdge);
|
|
@@ -237538,7 +237586,12 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
237538
237586
|
const edgeIndexOffsetInFaceLoopB = edge.edgeIndexB - baseFacetIndexStart;
|
|
237539
237587
|
const sweptEdgeIndexOffsetInFaceLoopA = (numBaseFacetEdges - 1) - edgeIndexOffsetInFaceLoopA;
|
|
237540
237588
|
const sweptEdgeIndexOffsetInFaceLoopB = (numBaseFacetEdges - 1) - edgeIndexOffsetInFaceLoopB;
|
|
237541
|
-
const indices = [
|
|
237589
|
+
const indices = [
|
|
237590
|
+
edge.edgeIndexB,
|
|
237591
|
+
edge.edgeIndexA,
|
|
237592
|
+
sweptFacetIndexStart + sweptEdgeIndexOffsetInFaceLoopA,
|
|
237593
|
+
sweptFacetIndexStart + sweptEdgeIndexOffsetInFaceLoopB,
|
|
237594
|
+
];
|
|
237542
237595
|
const vertices = [];
|
|
237543
237596
|
let colors; // try to re-use colors; missing normals and params will be computed if needed
|
|
237544
237597
|
if (undefined !== this.options.needColors && undefined !== this._polyface.data.color && undefined !== this._polyface.data.colorIndex)
|
|
@@ -237559,11 +237612,13 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
237559
237612
|
return true;
|
|
237560
237613
|
}
|
|
237561
237614
|
/**
|
|
237562
|
-
* Add facets from the source polyface, from its translation along the vector, and from its swept boundary edges,
|
|
237563
|
-
*
|
|
237564
|
-
* @param
|
|
237565
|
-
* @param
|
|
237566
|
-
* @
|
|
237615
|
+
* Add facets from the source polyface, from its translation along the vector, and from its swept boundary edges,
|
|
237616
|
+
* to form a polyface that encloses a volume.
|
|
237617
|
+
* @param source the surface mesh to sweep.
|
|
237618
|
+
* @param sweepVector the direction and length to sweep the surface mesh.
|
|
237619
|
+
* @param triangulateSides whether to triangulate side facets, or leave as quads.
|
|
237620
|
+
* @returns whether the added facets comprise a simple sweep. If false, the resulting mesh may have self-intersections,
|
|
237621
|
+
* be non-manifold, have inconsistently oriented facets, etc.
|
|
237567
237622
|
*/
|
|
237568
237623
|
addSweptIndexedPolyface(source, sweepVector, triangulateSides = false) {
|
|
237569
237624
|
let isSimpleSweep = true;
|
|
@@ -298375,7 +298430,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
298375
298430
|
/***/ ((module) => {
|
|
298376
298431
|
|
|
298377
298432
|
"use strict";
|
|
298378
|
-
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.8.0-dev.
|
|
298433
|
+
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.8.0-dev.23","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2020 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^4.8.0-dev.23","@itwin/core-bentley":"workspace:^4.8.0-dev.23","@itwin/core-common":"workspace:^4.8.0-dev.23","@itwin/core-geometry":"workspace:^4.8.0-dev.23","@itwin/core-orbitgt":"workspace:^4.8.0-dev.23","@itwin/core-quantity":"workspace:^4.8.0-dev.23"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/certa":"workspace:*","@itwin/eslint-plugin":"^4.0.2","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^10.0.6","@types/sinon":"^17.0.2","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.3.10","chai-as-promised":"^7.1.1","cpx2":"^3.0.0","eslint":"^8.56.0","glob":"^10.3.12","mocha":"^10.2.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^17.0.1","source-map-loader":"^4.0.0","typescript":"~5.3.3","typemoq":"^2.1.0","webpack":"^5.76.0"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.1.0","@itwin/object-storage-core":"^2.2.2","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","meshoptimizer":"~0.20.0","wms-capabilities":"0.4.0"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"}}');
|
|
298379
298434
|
|
|
298380
298435
|
/***/ })
|
|
298381
298436
|
|