@itwin/core-geometry 5.0.0-dev.20 → 5.0.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/cjs/bspline/BezierCurveBase.d.ts.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +10 -1
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +13 -1
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.d.ts +10 -4
- package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
- package/lib/cjs/curve/CurveFactory.js +50 -59
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/StrokeOptions.d.ts +3 -3
- package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/cjs/curve/StrokeOptions.js +1 -1
- package/lib/cjs/curve/StrokeOptions.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.d.ts +2 -1
- package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js +2 -1
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts +27 -20
- package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.js +56 -30
- package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +2 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +2 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts +4 -4
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +18 -50
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/solid/SweepContour.d.ts +24 -15
- package/lib/cjs/solid/SweepContour.d.ts.map +1 -1
- package/lib/cjs/solid/SweepContour.js +24 -15
- package/lib/cjs/solid/SweepContour.js.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.d.ts.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +10 -1
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +13 -1
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/CurveFactory.d.ts +10 -4
- package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
- package/lib/esm/curve/CurveFactory.js +50 -59
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/StrokeOptions.d.ts +3 -3
- package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/esm/curve/StrokeOptions.js +1 -1
- package/lib/esm/curve/StrokeOptions.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.d.ts +2 -1
- package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js +2 -1
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.d.ts +27 -20
- package/lib/esm/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.js +56 -30
- package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +2 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js +2 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts +4 -4
- package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +19 -51
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/solid/SweepContour.d.ts +24 -15
- package/lib/esm/solid/SweepContour.d.ts.map +1 -1
- package/lib/esm/solid/SweepContour.js +24 -15
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IndexedPolyfaceVisitor.js","sourceRoot":"","sources":["../../../src/polyface/IndexedPolyfaceVisitor.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,0CAAuC;AACvC,+CAA4C;AAE5C,mEAAyD;AACzD,yDAAsD;AACtD,yCAA8D;AAC9D,iDAA8C;AAE9C;;;;GAIG;AACH,MAAa,sBAAuB,SAAQ,2BAAY;IAMtD,sEAAsE;IACtE,YAAsB,QAAyB,EAAE,OAAe;QAC9D,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACpH,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,QAAQ,CAAC,IAAI,CAAC,OAAO;YACvB,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;QAC1D,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QACnB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC;QACzB,IAAI,CAAC,kBAAkB,GAAG,CAAC,CAAC,CAAC;IAE/B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WAAW,GAAG,0BAAQ,CAAC,UAAU,EAAE,CAAC;QAC1C,KAAK,OAAO,CAAC,KAAK,EAAE,EAAE,OAAO,CAAC,eAAe,EAAE,GAAI,CAAC;YAClD,IAAI,CAAC,uBAAU,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,WAAW,CAAC;gBACpD,SAAS,CAAC,mBAAmB;YAC/B,IAAI,WAAW,CAAC,UAAU,CAAC,aAAa,CAAC,GAAG,GAAG;gBAC7C,SAAS,CAAC,uCAAuC;YACnD,IAAI,WAAW,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC,0BAA0B,CAAC,SAAS,CAAC;gBACzF,SAAS,CAAC,oBAAoB;YAChC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,4BAA4B,CAAC,mBAAmB,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACrG,CAAC;CACF;AA/FD,oEA+FC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Polyface\r\n */\r\n\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Angle } from \"../geometry3d/Angle\";\r\nimport { Point2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { PolygonOps } from \"../geometry3d/PolygonOps\";\r\nimport { IndexedPolyface, PolyfaceVisitor } from \"./Polyface\";\r\nimport { PolyfaceData } from \"./PolyfaceData\";\r\n\r\n/**\r\n * An `IndexedPolyfaceVisitor` is an iterator-like object that \"visits\" facets of a mesh.\r\n * * The visitor extends `PolyfaceData`, so it can at any time hold all the data of a single facet.\r\n * @public\r\n */\r\nexport class IndexedPolyfaceVisitor extends PolyfaceData implements PolyfaceVisitor {\r\n private _currentFacetIndex: number;\r\n private _nextFacetIndex: number;\r\n private _numWrap: number;\r\n private _numEdges: number;\r\n private _polyface: IndexedPolyface;\r\n // to be called from static factory method that validates the polyface\r\n protected constructor(polyface: IndexedPolyface, numWrap: number) {\r\n super(polyface.data.normalCount > 0, polyface.data.paramCount > 0, polyface.data.colorCount > 0, polyface.twoSided);\r\n this._polyface = polyface;\r\n this._numWrap = numWrap;\r\n if (polyface.data.auxData)\r\n this.auxData = polyface.data.auxData.createForVisitor();\r\n this.reset();\r\n this._numEdges = 0;\r\n this._nextFacetIndex = 0;\r\n this._currentFacetIndex = -1;\r\n\r\n }\r\n /** Return the client polyface object. */\r\n public clientPolyface(): IndexedPolyface {\r\n return this._polyface;\r\n }\r\n /** Return the number of facets this visitor is able to visit. */\r\n public getVisitableFacetCount(): number {\r\n return this._polyface.facetCount;\r\n }\r\n /**\r\n * Set the number of vertices replicated in visitor arrays (both data and index arrays).\r\n * * 0,1,2 are the most common as numWrap.\r\n * * Example: suppose `[6,7,8]` is the pointIndex array representing a triangle. First edge would be `6,7`. Second\r\n * edge is `7,8`. Third edge is `8,6`. To access `6` for the third edge, we have to go back to the start of array.\r\n * Therefore, it is useful to store `6` at the end of pointIndex array, i.e., `[6,7,8,6]` meaning `numWrap = 1`.\r\n * Continuing this example, `numWrap = 2` (i.e., `[6,7,8,6,7]`) is useful when each vertex visit requires the next\r\n * two points, e.g., to form two adjacent vectors for a cross product.\r\n */\r\n public setNumWrap(numWrap: number) {\r\n this._numWrap = numWrap;\r\n }\r\n /**\r\n * Return the number of edges in the current facet.\r\n * * If `numWrap > 0` for this visitor, the number of edges is smaller than the number of points.\r\n */\r\n public get numEdgesThisFacet(): number {\r\n return this._numEdges;\r\n }\r\n /** Create a visitor for iterating the facets of `polyface`. */\r\n public static create(polyface: IndexedPolyface, numWrap: number): IndexedPolyfaceVisitor {\r\n return new IndexedPolyfaceVisitor(polyface, numWrap);\r\n }\r\n /** Advance the iterator to a particular facet in the client polyface. */\r\n public moveToReadIndex(facetIndex: number): boolean {\r\n if (!this._polyface.isValidFacetIndex(facetIndex))\r\n return false;\r\n this._currentFacetIndex = facetIndex;\r\n this._nextFacetIndex = facetIndex + 1;\r\n this._numEdges = this._polyface.numEdgeInFacet(facetIndex);\r\n this.resizeAllArrays(this._numEdges + this._numWrap);\r\n this.gatherIndexedData(\r\n this._polyface.data,\r\n this._polyface.facetIndex0(this._currentFacetIndex),\r\n this._polyface.facetIndex1(this._currentFacetIndex),\r\n this._numWrap,\r\n );\r\n return true;\r\n }\r\n /** Advance the iterator to a the 'next' facet in the client polyface. */\r\n public moveToNextFacet(): boolean {\r\n if (this._nextFacetIndex !== this._currentFacetIndex)\r\n return this.moveToReadIndex(this._nextFacetIndex);\r\n this._nextFacetIndex++;\r\n return true;\r\n }\r\n /** Reset the iterator to start at the first facet of the polyface. */\r\n public reset(): void {\r\n this.moveToReadIndex(0);\r\n this._nextFacetIndex = 0; // so immediate moveToNextFacet stays here.\r\n }\r\n /**\r\n * Attempts to extract the distance parameter for the given vertex `index` on the current facet.\r\n * Returns the distance parameter as a point. Returns `undefined` on failure.\r\n */\r\n public tryGetDistanceParameter(index: number, result?: Point2d): Point2d | undefined {\r\n if (index < 0 || index >= this.numEdgesThisFacet)\r\n return undefined;\r\n if (this.param === undefined || this._polyface.data.face.length === 0)\r\n return undefined;\r\n const faceData = this._polyface.tryGetFaceData(this._currentFacetIndex);\r\n if (!faceData)\r\n return undefined;\r\n return faceData.convertParamXYToDistance(\r\n this.param.getXAtUncheckedPointIndex(index),\r\n this.param.getYAtUncheckedPointIndex(index),\r\n result,\r\n );\r\n }\r\n /**\r\n * Attempts to extract the normalized parameter (0,1) for the given vertex `index` on the current facet.\r\n * Returns the normalized parameter as a point. Returns `undefined` on failure.\r\n */\r\n public tryGetNormalizedParameter(index: number, result?: Point2d): Point2d | undefined {\r\n if (index < 0 || index >= this.numEdgesThisFacet)\r\n return undefined;\r\n if (this.param === undefined || this._polyface.data.face.length === 0)\r\n return undefined;\r\n const faceData = this._polyface.tryGetFaceData(this._currentFacetIndex);\r\n if (!faceData)\r\n return undefined;\r\n return faceData.convertParamXYToNormalized(\r\n this.param.getXAtUncheckedPointIndex(index),\r\n this.param.getYAtUncheckedPointIndex(index),\r\n result,\r\n );\r\n }\r\n /** Return the index (in the client polyface) of the current facet. */\r\n public currentReadIndex(): number {\r\n return this._currentFacetIndex;\r\n }\r\n /** Return the point index of vertex `i` within the currently loaded facet. */\r\n public clientPointIndex(i: number): number {\r\n return this.pointIndex[i];\r\n }\r\n /** Return the param index of vertex `i` within the currently loaded facet. */\r\n public clientParamIndex(i: number): number {\r\n return this.paramIndex ? this.paramIndex[i] : -1;\r\n }\r\n /** Return the normal index of vertex `i` within the currently loaded facet. */\r\n public clientNormalIndex(i: number): number {\r\n return this.normalIndex ? this.normalIndex[i] : -1;\r\n }\r\n /** Return the color index of vertex `i` within the currently loaded facet. */\r\n public clientColorIndex(i: number): number {\r\n return this.colorIndex ? this.colorIndex[i] : -1;\r\n }\r\n /** Return the aux data index of vertex `i` within the currently loaded facet. */\r\n public clientAuxIndex(i: number): number {\r\n return this.auxData ? this.auxData.indices[i] : -1;\r\n }\r\n /** Clear the contents of all arrays. */\r\n public clearArrays(): void {\r\n this.point.length = 0;\r\n this.edgeVisible.length = 0;\r\n if (this.param !== undefined)\r\n this.param.length = 0;\r\n if (this.normal !== undefined)\r\n this.normal.length = 0;\r\n if (this.color !== undefined)\r\n this.color.length = 0;\r\n // TODO: indices? auxData? taggedNumericData?\r\n }\r\n /** Transfer data from a specified `index` of the `other` visitor as new data in this visitor. */\r\n public pushDataFrom(other: PolyfaceVisitor, index: number): void {\r\n this.point.pushFromGrowableXYZArray(other.point, index);\r\n this.edgeVisible.push(other.edgeVisible[index]);\r\n if (this.param && other.param && index < other.param.length)\r\n this.param.pushFromGrowableXYArray(other.param, index);\r\n if (this.normal && other.normal && index < other.normal.length)\r\n this.normal.pushFromGrowableXYZArray(other.normal, index);\r\n if (this.color && other.color && index < other.color.length)\r\n this.color.push(other.color[index]);\r\n // TODO: indices? auxData? taggedNumericData?\r\n }\r\n /**\r\n * Transfer interpolated data from the other visitor.\r\n * * All data values are interpolated at `fraction` between `other` values at `index0` and `index1`.\r\n */\r\n public pushInterpolatedDataFrom(other: PolyfaceVisitor, index0: number, fraction: number, index1: number): void {\r\n if (index0 > index1)\r\n this.pushInterpolatedDataFrom(other, index1, 1.0 - fraction, index0);\r\n this.point.pushInterpolatedFromGrowableXYZArray(other.point, index0, fraction, index1);\r\n const newVisibility = (((index0 + 1) % other.edgeVisible.length) === index1) ? other.edgeVisible[index0] : false;\r\n this.edgeVisible.push(newVisibility); // interpolation along an edge preserves visibility of original edge\r\n if (this.param && other.param && index0 < other.param.length && index1 < other.param.length)\r\n this.param.pushInterpolatedFromGrowableXYArray(other.param, index0, fraction, index1);\r\n if (this.normal && other.normal && index0 < other.normal.length && index1 < other.normal.length)\r\n this.normal.pushInterpolatedFromGrowableXYZArray(other.normal, index0, fraction, index1);\r\n if (this.color && other.color && index0 < other.color.length && index1 < other.color.length)\r\n this.color.push(Geometry.interpolateColor(other.color[index0], fraction, other.color[index1]));\r\n // TODO: auxData? taggedNumericData?\r\n }\r\n}\r\n/**\r\n * An `IndexedPolyfaceSubsetVisitor` is an `IndexedPolyfaceVisitor` which only visits a subset of facets in the polyface.\r\n * * The subset is defined by an array of facet indices provided when this visitor is created.\r\n * * Input indices (e.g., for `moveToReadIndex`) are understood to be indices into the subset array.\r\n * @public\r\n */\r\nexport class IndexedPolyfaceSubsetVisitor extends IndexedPolyfaceVisitor {\r\n private _parentFacetIndices?: number[]; // only undefined during super constructor!\r\n private _currentActiveIndex: number; // index within _parentFacetIndices, or -1 after construction\r\n private _nextActiveIndex: number; // index within _parentFacetIndices\r\n\r\n private constructor(polyface: IndexedPolyface, activeFacetIndices: number[], numWrap: number) {\r\n super(polyface, numWrap);\r\n this._parentFacetIndices = activeFacetIndices.slice();\r\n this._currentActiveIndex = -1;\r\n this._nextActiveIndex = 0;\r\n }\r\n private isValidSubsetIndex(index: number): boolean {\r\n return (undefined !== this._parentFacetIndices) && index >= 0 && index < this._parentFacetIndices.length;\r\n }\r\n /**\r\n * Create a visitor for iterating a subset of the facets of `polyface`.\r\n * @param polyface reference to the client polyface, supplying facets\r\n * @param activeFacetIndices array of indices of facets in the client polyface to visit. This array is cloned.\r\n * @param numWrap number of vertices replicated in the visitor arrays to facilitate simpler caller code. Default is zero.\r\n */\r\n public static createSubsetVisitor(polyface: IndexedPolyface, activeFacetIndices: number[], numWrap: number = 0): IndexedPolyfaceSubsetVisitor {\r\n return new IndexedPolyfaceSubsetVisitor(polyface, activeFacetIndices, numWrap);\r\n }\r\n /**\r\n * Advance the iterator to a particular facet in the subset of client polyface facets.\r\n * @param activeIndex the index of the facet within the subset, not to be confused with the index of the facet within the client polyface.\r\n * @return whether the iterator was successfully moved.\r\n */\r\n public override moveToReadIndex(activeIndex: number): boolean {\r\n if (this.isValidSubsetIndex(activeIndex)) {\r\n this._currentActiveIndex = activeIndex;\r\n this._nextActiveIndex = activeIndex + 1;\r\n return super.moveToReadIndex(this._parentFacetIndices![activeIndex]);\r\n }\r\n return false;\r\n }\r\n /**\r\n * Advance the iterator to the next facet in the subset of client polyface facets.\r\n * @return whether the iterator was successfully moved.\r\n */\r\n public override moveToNextFacet(): boolean {\r\n if (this._nextActiveIndex !== this._currentActiveIndex)\r\n return this.moveToReadIndex(this._nextActiveIndex);\r\n this._nextActiveIndex++;\r\n return true;\r\n }\r\n /** Reset the iterator to start at the first active facet in the subset of client polyface facets. */\r\n public override reset(): void {\r\n this.moveToReadIndex(0);\r\n this._nextActiveIndex = 0; // so immediate moveToNextFacet stays here.\r\n }\r\n /**\r\n * Return the parent facet index of the indicated index within the subset of client polyface facets.\r\n * @param activeIndex index of the facet within the subset. Default is the active facet.\r\n * @return valid client polyface facet index, or `undefined` if invalid input index.\r\n */\r\n public parentFacetIndex(activeIndex?: number): number | undefined {\r\n if (undefined === activeIndex)\r\n activeIndex = this._currentActiveIndex;\r\n return this.isValidSubsetIndex(activeIndex) ? this._parentFacetIndices![activeIndex] : undefined;\r\n }\r\n /** Return the number of facets this visitor is able to visit. */\r\n public override getVisitableFacetCount(): number {\r\n return this._parentFacetIndices ? this._parentFacetIndices.length : 0;\r\n }\r\n /**\r\n * Create a visitor for those mesh facets with normal in the same half-space as the given vector.\r\n * * For example, to visit the top facets of a tiled terrain mesh but skip the \"skirt\" facets, pass\r\n * `compareVector = Vector3d.unitZ()` and a suitable `sideAngle` tolerance. Note that this will also\r\n * filter out *interior* facets that are nearly vertical, not just the \"skirt\" facets on the boundary.\r\n * @param mesh the mesh from which to select facets\r\n * @param compareVector vector to which to compare facet normals. The visitor will visit only those facets\r\n * with normals in the same half-space as this vector. Default is 001.\r\n * @param sideAngle optional angular tolerance to filter the facets near the border between half-spaces.\r\n * The visitor will *not* visit facets whose normals are nearly perpendicular to `compareVector`.\r\n * Default is [[Geometry.smallAngleRadians]].\r\n * @param numWrap optional number of entries replicated in visitor arrays. Default is 0.\r\n */\r\n public static createNormalComparison(mesh: IndexedPolyface | IndexedPolyfaceVisitor, compareVector: Vector3d = Vector3d.unitZ(), sideAngle: Angle = Angle.createSmallAngle(), numWrap: number = 0): IndexedPolyfaceSubsetVisitor {\r\n if (mesh instanceof IndexedPolyface)\r\n return this.createNormalComparison(mesh.createVisitor(), compareVector, sideAngle, numWrap);\r\n const visitor = mesh;\r\n const facets: number[] = [];\r\n const facetNormal = Vector3d.createZero();\r\n for (visitor.reset(); visitor.moveToNextFacet(); ) {\r\n if (!PolygonOps.unitNormal(visitor.point, facetNormal))\r\n continue; // degenerate facet\r\n if (facetNormal.dotProduct(compareVector) < 0.0)\r\n continue; // ignore facet facing other half-space\r\n if (facetNormal.angleFromPerpendicular(compareVector).isMagnitudeLessThanOrEqual(sideAngle))\r\n continue; // ignore side facet\r\n facets.push(visitor.currentReadIndex());\r\n }\r\n return IndexedPolyfaceSubsetVisitor.createSubsetVisitor(visitor.clientPolyface(), facets, numWrap);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"IndexedPolyfaceVisitor.js","sourceRoot":"","sources":["../../../src/polyface/IndexedPolyfaceVisitor.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,0CAAuC;AACvC,+CAA4C;AAE5C,mEAAyD;AACzD,yDAAsD;AACtD,yCAA8D;AAC9D,iDAA8C;AAE9C;;;;GAIG;AACH,MAAa,sBAAuB,SAAQ,2BAAY;IAMtD,sEAAsE;IACtE,YAAsB,QAAyB,EAAE,OAAe;QAC9D,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACpH,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,QAAQ,CAAC,IAAI,CAAC,OAAO;YACvB,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;QAC1D,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QACnB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC;QACzB,IAAI,CAAC,kBAAkB,GAAG,CAAC,CAAC,CAAC;IAE/B,CAAC;IACD,yCAAyC;IAClC,cAAc;QACnB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IACD,iEAAiE;IAC1D,sBAAsB;QAC3B,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC;IACnC,CAAC;IACD;;;;;;;;OAQG;IACI,UAAU,CAAC,OAAe;QAC/B,IAAI,CAAC,QAAQ,GA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B,IAAI,WAAW,CAAC,UAAU,CAAC,aAAa,CAAC,GAAG,GAAG;gBAC7C,SAAS,CAAC,uCAAuC;YACnD,IAAI,WAAW,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC,0BAA0B,CAAC,SAAS,CAAC;gBACzF,SAAS,CAAC,oBAAoB;YAChC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,4BAA4B,CAAC,mBAAmB,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACrG,CAAC;CACF;AAvGD,oEAuGC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Polyface\r\n */\r\n\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Angle } from \"../geometry3d/Angle\";\r\nimport { Point2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { PolygonOps } from \"../geometry3d/PolygonOps\";\r\nimport { IndexedPolyface, PolyfaceVisitor } from \"./Polyface\";\r\nimport { PolyfaceData } from \"./PolyfaceData\";\r\n\r\n/**\r\n * An `IndexedPolyfaceVisitor` is an iterator-like object that \"visits\" facets of a mesh.\r\n * * The visitor extends `PolyfaceData`, so it can at any time hold all the data of a single facet.\r\n * @public\r\n */\r\nexport class IndexedPolyfaceVisitor extends PolyfaceData implements PolyfaceVisitor {\r\n private _currentFacetIndex: number;\r\n private _nextFacetIndex: number;\r\n private _numWrap: number;\r\n private _numEdges: number;\r\n private _polyface: IndexedPolyface;\r\n // to be called from static factory method that validates the polyface\r\n protected constructor(polyface: IndexedPolyface, numWrap: number) {\r\n super(polyface.data.normalCount > 0, polyface.data.paramCount > 0, polyface.data.colorCount > 0, polyface.twoSided);\r\n this._polyface = polyface;\r\n this._numWrap = numWrap;\r\n if (polyface.data.auxData)\r\n this.auxData = polyface.data.auxData.createForVisitor();\r\n this.reset();\r\n this._numEdges = 0;\r\n this._nextFacetIndex = 0;\r\n this._currentFacetIndex = -1;\r\n\r\n }\r\n /** Return the client polyface object. */\r\n public clientPolyface(): IndexedPolyface {\r\n return this._polyface;\r\n }\r\n /** Return the number of facets this visitor is able to visit. */\r\n public getVisitableFacetCount(): number {\r\n return this._polyface.facetCount;\r\n }\r\n /**\r\n * Set the number of vertices replicated in visitor arrays (both data and index arrays).\r\n * * 0,1,2 are the most common as numWrap.\r\n * * Example: suppose `[6,7,8]` is the pointIndex array representing a triangle. First edge would be `6,7`. Second\r\n * edge is `7,8`. Third edge is `8,6`. To access `6` for the third edge, we have to go back to the start of array.\r\n * Therefore, it is useful to store `6` at the end of pointIndex array, i.e., `[6,7,8,6]` meaning `numWrap = 1`.\r\n * Continuing this example, `numWrap = 2` (i.e., `[6,7,8,6,7]`) is useful when each vertex visit requires the next\r\n * two points, e.g., to form two adjacent vectors for a cross product.\r\n */\r\n public setNumWrap(numWrap: number) {\r\n this._numWrap = numWrap;\r\n }\r\n /**\r\n * Return the number of edges in the current facet.\r\n * * If `numWrap > 0` for this visitor, the number of edges is smaller than the number of points.\r\n */\r\n public get numEdgesThisFacet(): number {\r\n return this._numEdges;\r\n }\r\n /** Create a visitor for iterating the facets of `polyface`. */\r\n public static create(polyface: IndexedPolyface, numWrap: number): IndexedPolyfaceVisitor {\r\n return new IndexedPolyfaceVisitor(polyface, numWrap);\r\n }\r\n /** Advance the iterator to a particular facet in the client polyface. */\r\n public moveToReadIndex(facetIndex: number): boolean {\r\n if (!this._polyface.isValidFacetIndex(facetIndex))\r\n return false;\r\n this._currentFacetIndex = facetIndex;\r\n this._nextFacetIndex = facetIndex + 1;\r\n this._numEdges = this._polyface.numEdgeInFacet(facetIndex);\r\n this.resizeAllArrays(this._numEdges + this._numWrap);\r\n this.gatherIndexedData(\r\n this._polyface.data,\r\n this._polyface.facetIndex0(this._currentFacetIndex),\r\n this._polyface.facetIndex1(this._currentFacetIndex),\r\n this._numWrap,\r\n );\r\n return true;\r\n }\r\n /** Advance the iterator to a the 'next' facet in the client polyface. */\r\n public moveToNextFacet(): boolean {\r\n if (this._nextFacetIndex !== this._currentFacetIndex)\r\n return this.moveToReadIndex(this._nextFacetIndex);\r\n this._nextFacetIndex++;\r\n return true;\r\n }\r\n /** Reset the iterator to start at the first facet of the polyface. */\r\n public reset(): void {\r\n this.moveToReadIndex(0);\r\n this._nextFacetIndex = 0; // so immediate moveToNextFacet stays here.\r\n }\r\n /**\r\n * Attempts to extract the distance parameter for the given vertex `index` on the current facet.\r\n * Returns the distance parameter as a point. Returns `undefined` on failure.\r\n */\r\n public tryGetDistanceParameter(index: number, result?: Point2d): Point2d | undefined {\r\n if (index < 0 || index >= this.numEdgesThisFacet)\r\n return undefined;\r\n if (this.param === undefined || this._polyface.data.face.length === 0)\r\n return undefined;\r\n const faceData = this._polyface.tryGetFaceData(this._currentFacetIndex);\r\n if (!faceData)\r\n return undefined;\r\n return faceData.convertParamXYToDistance(\r\n this.param.getXAtUncheckedPointIndex(index),\r\n this.param.getYAtUncheckedPointIndex(index),\r\n result,\r\n );\r\n }\r\n /**\r\n * Attempts to extract the normalized parameter (0,1) for the given vertex `index` on the current facet.\r\n * Returns the normalized parameter as a point. Returns `undefined` on failure.\r\n */\r\n public tryGetNormalizedParameter(index: number, result?: Point2d): Point2d | undefined {\r\n if (index < 0 || index >= this.numEdgesThisFacet)\r\n return undefined;\r\n if (this.param === undefined || this._polyface.data.face.length === 0)\r\n return undefined;\r\n const faceData = this._polyface.tryGetFaceData(this._currentFacetIndex);\r\n if (!faceData)\r\n return undefined;\r\n return faceData.convertParamXYToNormalized(\r\n this.param.getXAtUncheckedPointIndex(index),\r\n this.param.getYAtUncheckedPointIndex(index),\r\n result,\r\n );\r\n }\r\n /** Return the index (in the client polyface) of the current facet. */\r\n public currentReadIndex(): number {\r\n return this._currentFacetIndex;\r\n }\r\n /** Return the point index of vertex `i` within the currently loaded facet. */\r\n public clientPointIndex(i: number): number {\r\n return this.pointIndex[i];\r\n }\r\n /** Return the param index of vertex `i` within the currently loaded facet. */\r\n public clientParamIndex(i: number): number {\r\n return this.paramIndex ? this.paramIndex[i] : -1;\r\n }\r\n /** Return the normal index of vertex `i` within the currently loaded facet. */\r\n public clientNormalIndex(i: number): number {\r\n return this.normalIndex ? this.normalIndex[i] : -1;\r\n }\r\n /** Return the color index of vertex `i` within the currently loaded facet. */\r\n public clientColorIndex(i: number): number {\r\n return this.colorIndex ? this.colorIndex[i] : -1;\r\n }\r\n /** Return the aux data index of vertex `i` within the currently loaded facet. */\r\n public clientAuxIndex(i: number): number {\r\n return this.auxData ? this.auxData.indices[i] : -1;\r\n }\r\n /** Clear the contents of all arrays. */\r\n public clearArrays(): void {\r\n this.point.length = 0;\r\n this.edgeVisible.length = 0;\r\n if (this.param !== undefined)\r\n this.param.length = 0;\r\n if (this.normal !== undefined)\r\n this.normal.length = 0;\r\n if (this.color !== undefined)\r\n this.color.length = 0;\r\n // TODO: indices? auxData? taggedNumericData?\r\n }\r\n /** Transfer data from a specified `index` of the `other` visitor as new data in this visitor. */\r\n public pushDataFrom(other: PolyfaceVisitor, index: number): void {\r\n this.point.pushFromGrowableXYZArray(other.point, index);\r\n this.edgeVisible.push(other.edgeVisible[index]);\r\n if (this.param && other.param && index < other.param.length)\r\n this.param.pushFromGrowableXYArray(other.param, index);\r\n if (this.normal && other.normal && index < other.normal.length)\r\n this.normal.pushFromGrowableXYZArray(other.normal, index);\r\n if (this.color && other.color && index < other.color.length)\r\n this.color.push(other.color[index]);\r\n // TODO: indices? auxData? taggedNumericData?\r\n }\r\n /**\r\n * Transfer interpolated data from the other visitor.\r\n * * All data values are interpolated at `fraction` between `other` values at `index0` and `index1`.\r\n */\r\n public pushInterpolatedDataFrom(other: PolyfaceVisitor, index0: number, fraction: number, index1: number): void {\r\n if (index0 > index1)\r\n this.pushInterpolatedDataFrom(other, index1, 1.0 - fraction, index0);\r\n this.point.pushInterpolatedFromGrowableXYZArray(other.point, index0, fraction, index1);\r\n const newVisibility = (((index0 + 1) % other.edgeVisible.length) === index1) ? other.edgeVisible[index0] : false;\r\n this.edgeVisible.push(newVisibility); // interpolation along an edge preserves visibility of original edge\r\n if (this.param && other.param && index0 < other.param.length && index1 < other.param.length)\r\n this.param.pushInterpolatedFromGrowableXYArray(other.param, index0, fraction, index1);\r\n if (this.normal && other.normal && index0 < other.normal.length && index1 < other.normal.length)\r\n this.normal.pushInterpolatedFromGrowableXYZArray(other.normal, index0, fraction, index1);\r\n if (this.color && other.color && index0 < other.color.length && index1 < other.color.length)\r\n this.color.push(Geometry.interpolateColor(other.color[index0], fraction, other.color[index1]));\r\n // TODO: auxData? taggedNumericData?\r\n }\r\n}\r\n/**\r\n * An `IndexedPolyfaceSubsetVisitor` is an `IndexedPolyfaceVisitor` which only visits a subset of facets in the polyface.\r\n * * The subset is defined by an array of facet indices provided when this visitor is created.\r\n * * Input indices (e.g., for `moveToReadIndex`) are understood to be indices into the subset array.\r\n * @public\r\n */\r\nexport class IndexedPolyfaceSubsetVisitor extends IndexedPolyfaceVisitor {\r\n private _parentFacetIndices?: number[]; // only undefined during super constructor!\r\n private _currentActiveIndex: number; // index within _parentFacetIndices, or -1 after construction\r\n private _nextActiveIndex: number; // index within _parentFacetIndices\r\n\r\n private constructor(polyface: IndexedPolyface, activeFacetIndices: number[], numWrap: number) {\r\n super(polyface, numWrap);\r\n this._parentFacetIndices = activeFacetIndices.slice();\r\n this._currentActiveIndex = -1;\r\n this._nextActiveIndex = 0;\r\n }\r\n private isValidSubsetIndex(index: number): boolean {\r\n return (undefined !== this._parentFacetIndices) && index >= 0 && index < this._parentFacetIndices.length;\r\n }\r\n /**\r\n * Create a visitor for iterating a subset of the facets of `polyface`.\r\n * @param polyface reference to the client polyface, supplying facets\r\n * @param activeFacetIndices array of indices of facets in the client polyface to visit. This array is cloned.\r\n * @param numWrap number of vertices replicated in the visitor arrays to facilitate simpler caller code. Default is zero.\r\n */\r\n public static createSubsetVisitor(\r\n polyface: IndexedPolyface, activeFacetIndices: number[], numWrap: number = 0,\r\n ): IndexedPolyfaceSubsetVisitor {\r\n return new IndexedPolyfaceSubsetVisitor(polyface, activeFacetIndices, numWrap);\r\n }\r\n /**\r\n * Advance the iterator to a particular facet in the subset of client polyface facets.\r\n * @param activeIndex the index of the facet within the subset, not to be confused with the index of the facet within\r\n * the client polyface.\r\n * @return whether the iterator was successfully moved.\r\n */\r\n public override moveToReadIndex(activeIndex: number): boolean {\r\n if (this.isValidSubsetIndex(activeIndex)) {\r\n this._currentActiveIndex = activeIndex;\r\n this._nextActiveIndex = activeIndex + 1;\r\n return super.moveToReadIndex(this._parentFacetIndices![activeIndex]);\r\n }\r\n return false;\r\n }\r\n /**\r\n * Advance the iterator to the next facet in the subset of client polyface facets.\r\n * @return whether the iterator was successfully moved.\r\n */\r\n public override moveToNextFacet(): boolean {\r\n if (this._nextActiveIndex !== this._currentActiveIndex)\r\n return this.moveToReadIndex(this._nextActiveIndex);\r\n this._nextActiveIndex++;\r\n return true;\r\n }\r\n /** Reset the iterator to start at the first active facet in the subset of client polyface facets. */\r\n public override reset(): void {\r\n this.moveToReadIndex(0);\r\n this._nextActiveIndex = 0; // so immediate moveToNextFacet stays here.\r\n }\r\n /**\r\n * Return the parent facet index of the indicated index within the subset of client polyface facets.\r\n * @param activeIndex index of the facet within the subset. Default is the active facet.\r\n * @return valid client polyface facet index, or `undefined` if invalid input index.\r\n */\r\n public parentFacetIndex(activeIndex?: number): number | undefined {\r\n if (undefined === activeIndex)\r\n activeIndex = this._currentActiveIndex;\r\n return this.isValidSubsetIndex(activeIndex) ? this._parentFacetIndices![activeIndex] : undefined;\r\n }\r\n /** Return the number of facets this visitor is able to visit. */\r\n public override getVisitableFacetCount(): number {\r\n return this._parentFacetIndices ? this._parentFacetIndices.length : 0;\r\n }\r\n /**\r\n * Create a visitor for those mesh facets with normal in the same half-space as the given vector.\r\n * * For example, to visit the top facets of a tiled terrain mesh but skip the \"skirt\" facets, pass\r\n * `compareVector = Vector3d.unitZ()` and a suitable `sideAngle` tolerance. Note that this will also\r\n * filter out *interior* facets that are nearly vertical, not just the \"skirt\" facets on the boundary.\r\n * @param mesh the mesh from which to select facets\r\n * @param compareVector vector to which to compare facet normals. The visitor will visit only those facets\r\n * with normals in the same half-space as this vector. Default is 001.\r\n * @param sideAngle optional angular tolerance to filter the facets near the border between half-spaces.\r\n * The visitor will *not* visit facets whose normals are nearly perpendicular to `compareVector`.\r\n * Default is [[Geometry.smallAngleRadians]].\r\n * @param numWrap optional number of entries replicated in visitor arrays. Default is 0.\r\n */\r\n public static createNormalComparison(\r\n mesh: IndexedPolyface | IndexedPolyfaceVisitor,\r\n compareVector: Vector3d = Vector3d.unitZ(),\r\n sideAngle: Angle = Angle.createSmallAngle(),\r\n numWrap: number = 0,\r\n ): IndexedPolyfaceSubsetVisitor {\r\n if (mesh instanceof IndexedPolyface)\r\n return this.createNormalComparison(mesh.createVisitor(), compareVector, sideAngle, numWrap);\r\n const visitor = mesh;\r\n const facets: number[] = [];\r\n const facetNormal = Vector3d.createZero();\r\n for (visitor.reset(); visitor.moveToNextFacet();) {\r\n if (!PolygonOps.unitNormal(visitor.point, facetNormal))\r\n continue; // degenerate facet\r\n if (facetNormal.dotProduct(compareVector) < 0.0)\r\n continue; // ignore facet facing other half-space\r\n if (facetNormal.angleFromPerpendicular(compareVector).isMagnitudeLessThanOrEqual(sideAngle))\r\n continue; // ignore side facet\r\n facets.push(visitor.currentReadIndex());\r\n }\r\n return IndexedPolyfaceSubsetVisitor.createSubsetVisitor(visitor.clientPolyface(), facets, numWrap);\r\n }\r\n}\r\n"]}
|
|
@@ -477,8 +477,6 @@ export declare class PolyfaceBuilder extends NullGeometryHandler {
|
|
|
477
477
|
* @param pointsB points of second linestring.
|
|
478
478
|
*/
|
|
479
479
|
addGreedyTriangulationBetweenLineStrings(pointsA: Point3d[] | LineString3d | IndexedXYZCollection, pointsB: Point3d[] | LineString3d | IndexedXYZCollection): void;
|
|
480
|
-
/** Doc is same as `addMiteredPipes` doc. */
|
|
481
|
-
private addMiteredPipesFromPoints;
|
|
482
480
|
/**
|
|
483
481
|
* Add quad facets along a mitered pipe that follows a centerline curve.
|
|
484
482
|
* * At the end of each pipe segment, the pipe is mitered by the plane that bisects the angle between successive
|
|
@@ -487,8 +485,10 @@ export declare class PolyfaceBuilder extends NullGeometryHandler {
|
|
|
487
485
|
* lengths, or an Arc3d:
|
|
488
486
|
* * For semi-axis length input, x and y correspond to ellipse local axes perpendicular to each other and to the
|
|
489
487
|
* start tangent.
|
|
490
|
-
* * For Arc3d input, the center is translated to the centerline start point
|
|
491
|
-
*
|
|
488
|
+
* * For Arc3d input, the center is translated to the centerline start point. For best results, ensure this arc
|
|
489
|
+
* is perpendicular to the centerline start tangent.
|
|
490
|
+
* * This function internally calls [[CurveFactory.createMiteredSweepSections]], passing in the `startTangent`
|
|
491
|
+
* option to preserve the rotation of Arc3d-type `sectionData`.
|
|
492
492
|
* @param centerline centerline of pipe. If curved, it will be stroked using the builder's StrokeOptions, otherwise
|
|
493
493
|
* for best results, ensure no successive duplicate points with e.g., [[GrowableXYZArray.createCompressed]].
|
|
494
494
|
* @param sectionData circle radius, ellipse semi-axis lengths, or Arc3d.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolyfaceBuilder.d.ts","sourceRoot":"","sources":["../../../src/polyface/PolyfaceBuilder.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAIvC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAA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C5B,MAAM,EAAE,eAAe,EAAE,WAAW,EAAE,QAAQ,EAAE,gBAAgB,GAAE,OAAe,GAChF,OAAO;CAyCX"}
|
|
@@ -1832,44 +1832,6 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
1832
1832
|
const context = GreedyTriangulationBetweenLineStrings_1.GreedyTriangulationBetweenLineStrings.createContext();
|
|
1833
1833
|
context.emitTriangles(resolveToIndexedXYZCollectionOrCarrier(pointsA), resolveToIndexedXYZCollectionOrCarrier(pointsB), (triangle) => { this.addTriangleFacet(triangle.points); });
|
|
1834
1834
|
}
|
|
1835
|
-
/** Doc is same as `addMiteredPipes` doc. */
|
|
1836
|
-
addMiteredPipesFromPoints(centerline, sectionData, numFacetAround = 12, capped = false) {
|
|
1837
|
-
const sections = CurveFactory_1.CurveFactory.createMiteredPipeSections(centerline, sectionData);
|
|
1838
|
-
const pointA0 = Point3dVector3d_1.Point3d.create();
|
|
1839
|
-
const pointA1 = Point3dVector3d_1.Point3d.create();
|
|
1840
|
-
const pointB0 = Point3dVector3d_1.Point3d.create();
|
|
1841
|
-
const pointB1 = Point3dVector3d_1.Point3d.create();
|
|
1842
|
-
const wantCaps = capped && (!(sectionData instanceof Arc3d_1.Arc3d) || sectionData.sweep.isFullCircle);
|
|
1843
|
-
if (numFacetAround < 3)
|
|
1844
|
-
numFacetAround = 3;
|
|
1845
|
-
const df = 1.0 / numFacetAround;
|
|
1846
|
-
if (wantCaps) { // start cap facets
|
|
1847
|
-
const startLineString = LineString3d_1.LineString3d.create();
|
|
1848
|
-
for (let i = 0; i < numFacetAround; i++)
|
|
1849
|
-
startLineString.addPoint(sections[0].fractionToPoint(i * df));
|
|
1850
|
-
this.addTrianglesInUncheckedConvexPolygon(startLineString, true);
|
|
1851
|
-
this.endFace();
|
|
1852
|
-
}
|
|
1853
|
-
for (let i = 1; i < sections.length; i++) { // side facets
|
|
1854
|
-
const arcA = sections[i - 1];
|
|
1855
|
-
const arcB = sections[i];
|
|
1856
|
-
arcA.fractionToPoint(0.0, pointA0);
|
|
1857
|
-
arcB.fractionToPoint(0.0, pointB0);
|
|
1858
|
-
for (let k = 1; k <= numFacetAround; k++, pointA0.setFromPoint3d(pointA1), pointB0.setFromPoint3d(pointB1)) {
|
|
1859
|
-
const f = k * df;
|
|
1860
|
-
arcA.fractionToPoint(f, pointA1);
|
|
1861
|
-
arcB.fractionToPoint(f, pointB1);
|
|
1862
|
-
this.addQuadFacet([pointA0, pointA1, pointB1, pointB0]); // ASSUME: CCW section traversal wrt rail tangent
|
|
1863
|
-
}
|
|
1864
|
-
}
|
|
1865
|
-
if (wantCaps) { // end cap facets
|
|
1866
|
-
const endLineString = LineString3d_1.LineString3d.create();
|
|
1867
|
-
for (let i = 0; i < numFacetAround; i++)
|
|
1868
|
-
endLineString.addPoint(sections[sections.length - 1].fractionToPoint(i * df));
|
|
1869
|
-
this.addTrianglesInUncheckedConvexPolygon(endLineString, false);
|
|
1870
|
-
this.endFace();
|
|
1871
|
-
}
|
|
1872
|
-
}
|
|
1873
1835
|
/**
|
|
1874
1836
|
* Add quad facets along a mitered pipe that follows a centerline curve.
|
|
1875
1837
|
* * At the end of each pipe segment, the pipe is mitered by the plane that bisects the angle between successive
|
|
@@ -1878,8 +1840,10 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
1878
1840
|
* lengths, or an Arc3d:
|
|
1879
1841
|
* * For semi-axis length input, x and y correspond to ellipse local axes perpendicular to each other and to the
|
|
1880
1842
|
* start tangent.
|
|
1881
|
-
* * For Arc3d input, the center is translated to the centerline start point
|
|
1882
|
-
*
|
|
1843
|
+
* * For Arc3d input, the center is translated to the centerline start point. For best results, ensure this arc
|
|
1844
|
+
* is perpendicular to the centerline start tangent.
|
|
1845
|
+
* * This function internally calls [[CurveFactory.createMiteredSweepSections]], passing in the `startTangent`
|
|
1846
|
+
* option to preserve the rotation of Arc3d-type `sectionData`.
|
|
1883
1847
|
* @param centerline centerline of pipe. If curved, it will be stroked using the builder's StrokeOptions, otherwise
|
|
1884
1848
|
* for best results, ensure no successive duplicate points with e.g., [[GrowableXYZArray.createCompressed]].
|
|
1885
1849
|
* @param sectionData circle radius, ellipse semi-axis lengths, or Arc3d.
|
|
@@ -1887,16 +1851,20 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
1887
1851
|
* @param capped if `true`, add a cap at each end of the pipe; defaults to `false`.
|
|
1888
1852
|
*/
|
|
1889
1853
|
addMiteredPipes(centerline, sectionData, numFacetAround = 12, capped = false) {
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1854
|
+
const arc = CurveFactory_1.CurveFactory.createArcFromSectionData(centerline, sectionData);
|
|
1855
|
+
if (!arc)
|
|
1856
|
+
return;
|
|
1857
|
+
if (numFacetAround < 3)
|
|
1858
|
+
numFacetAround = 3;
|
|
1859
|
+
const section = LineString3d_1.LineString3d.create();
|
|
1860
|
+
section.appendFractionalStrokePoints(arc, numFacetAround, 0.0, 1.0, true);
|
|
1861
|
+
const strokeOptions = this._options.clone();
|
|
1862
|
+
const outputSelect = CurveFactory_1.MiteredSweepOutputSelect.AlsoMesh;
|
|
1863
|
+
const startTangent = sectionData instanceof Arc3d_1.Arc3d ? arc.binormalVector() : undefined; // preserve arc orientation
|
|
1864
|
+
const options = { strokeOptions, capped, outputSelect, startTangent };
|
|
1865
|
+
const sections = CurveFactory_1.CurveFactory.createMiteredSweepSections(centerline, section, options);
|
|
1866
|
+
if (sections && sections.mesh)
|
|
1867
|
+
this.addIndexedPolyface(sections.mesh);
|
|
1900
1868
|
}
|
|
1901
1869
|
/** Return the polyface index array indices corresponding to the given edge, or `undefined` if error. */
|
|
1902
1870
|
getEdgeIndices(edge) {
|