@itwin/core-geometry 4.5.0-dev.3 → 4.5.0-dev.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +47 -1
- package/LICENSE.md +1 -1
- package/lib/cjs/Constant.js.map +1 -1
- package/lib/cjs/Geometry.d.ts +15 -0
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +27 -0
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve3dH.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
- package/lib/cjs/bspline/Bezier1dNd.js.map +1 -1
- package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
- package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
- package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/cjs/bspline/KnotVector.js.map +1 -1
- package/lib/cjs/bspline/SurfaceLocationDetail.js.map +1 -1
- package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/cjs/clipping/BooleanClipFactory.js.map +1 -1
- package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
- package/lib/cjs/clipping/ClipPlane.js.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/clipping/ClipVector.js.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/ConstructCurveBetweenCurves.js.map +1 -1
- package/lib/cjs/curve/CoordinateXYZ.d.ts +10 -13
- package/lib/cjs/curve/CoordinateXYZ.d.ts.map +1 -1
- package/lib/cjs/curve/CoordinateXYZ.js +16 -15
- package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveCurve.js.map +1 -1
- package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurveOps.js.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/CurveProcessor.js.map +1 -1
- package/lib/cjs/curve/CurveTypes.js.map +1 -1
- package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/cjs/curve/GeometryQuery.d.ts +17 -17
- package/lib/cjs/curve/GeometryQuery.d.ts.map +1 -1
- package/lib/cjs/curve/GeometryQuery.js +16 -15
- package/lib/cjs/curve/GeometryQuery.js.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/Loop.js.map +1 -1
- package/lib/cjs/curve/OffsetOptions.js.map +1 -1
- package/lib/cjs/curve/ParityRegion.js.map +1 -1
- package/lib/cjs/curve/Path.js.map +1 -1
- package/lib/cjs/curve/PointString3d.d.ts +17 -13
- package/lib/cjs/curve/PointString3d.d.ts.map +1 -1
- package/lib/cjs/curve/PointString3d.js +35 -20
- package/lib/cjs/curve/PointString3d.js.map +1 -1
- package/lib/cjs/curve/ProxyCurve.js.map +1 -1
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
- package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
- package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/cjs/curve/StrokeOptions.js.map +1 -1
- package/lib/cjs/curve/UnionRegion.js.map +1 -1
- package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/ChainCollectorContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
- package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js +1 -1
- package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js +1 -1
- package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/cjs/geometry3d/Angle.js.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.d.ts.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.js +3 -0
- package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
- package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +8 -2
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js +11 -2
- package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
- package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
- package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/cjs/geometry4d/Map4d.js.map +1 -1
- package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
- package/lib/cjs/geometry4d/MomentData.js.map +1 -1
- package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
- package/lib/cjs/geometry4d/Point4d.js.map +1 -1
- package/lib/cjs/numerics/BandedSystem.js.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
- package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
- package/lib/cjs/numerics/Complex.js.map +1 -1
- package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
- package/lib/cjs/numerics/Newton.js.map +1 -1
- package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
- package/lib/cjs/numerics/PolarData.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/cjs/numerics/Quadrature.js.map +1 -1
- package/lib/cjs/numerics/Range1dArray.js.map +1 -1
- package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
- package/lib/cjs/numerics/UnionFind.js.map +1 -1
- package/lib/cjs/numerics/UsageSums.js.map +1 -1
- package/lib/cjs/polyface/AuxData.js.map +1 -1
- package/lib/cjs/polyface/BoxTopology.js.map +1 -1
- package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
- package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
- package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
- package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +42 -50
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +81 -105
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/cjs/polyface/Polyface.d.ts +166 -120
- package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
- package/lib/cjs/polyface/Polyface.js +251 -162
- package/lib/cjs/polyface/Polyface.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts +18 -10
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +27 -21
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.d.ts +142 -86
- package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.js +305 -164
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/MinimumValueTester.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
- package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
- package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
- package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
- package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
- package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
- package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
- package/lib/cjs/serialization/BGFBReader.js.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
- package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/cjs/serialization/DeepCompare.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
- package/lib/cjs/solid/Box.js.map +1 -1
- package/lib/cjs/solid/Cone.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/RuledSweep.js.map +1 -1
- package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
- package/lib/cjs/solid/Sphere.js.map +1 -1
- package/lib/cjs/solid/SweepContour.js.map +1 -1
- package/lib/cjs/solid/TorusPipe.js.map +1 -1
- package/lib/cjs/topology/ChainMerge.js.map +1 -1
- package/lib/cjs/topology/Graph.d.ts +2 -8
- package/lib/cjs/topology/Graph.d.ts.map +1 -1
- package/lib/cjs/topology/Graph.js +0 -3
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/cjs/topology/MaskManager.js.map +1 -1
- package/lib/cjs/topology/Merging.js.map +1 -1
- package/lib/cjs/topology/RegularizeFace.js.map +1 -1
- package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
- package/lib/cjs/topology/SpaceTriangulation.js.map +1 -1
- package/lib/cjs/topology/Triangulation.d.ts +18 -7
- package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
- package/lib/cjs/topology/Triangulation.js +50 -9
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
- package/lib/esm/Constant.js.map +1 -1
- package/lib/esm/Geometry.d.ts +15 -0
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +27 -0
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
- package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/esm/bspline/BSplineSurface.js.map +1 -1
- package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
- package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
- package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
- package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/esm/bspline/KnotVector.js.map +1 -1
- package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
- package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
- package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
- package/lib/esm/clipping/ClipPlane.js.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/clipping/ClipVector.js.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/ConstructCurveBetweenCurves.js.map +1 -1
- package/lib/esm/curve/CoordinateXYZ.d.ts +10 -13
- package/lib/esm/curve/CoordinateXYZ.d.ts.map +1 -1
- package/lib/esm/curve/CoordinateXYZ.js +16 -15
- package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveCurve.js.map +1 -1
- package/lib/esm/curve/CurveExtendMode.js.map +1 -1
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurveOps.js.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/CurveProcessor.js.map +1 -1
- package/lib/esm/curve/CurveTypes.js.map +1 -1
- package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/esm/curve/GeometryQuery.d.ts +17 -17
- package/lib/esm/curve/GeometryQuery.d.ts.map +1 -1
- package/lib/esm/curve/GeometryQuery.js +16 -15
- package/lib/esm/curve/GeometryQuery.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/Loop.js.map +1 -1
- package/lib/esm/curve/OffsetOptions.js.map +1 -1
- package/lib/esm/curve/ParityRegion.js.map +1 -1
- package/lib/esm/curve/Path.js.map +1 -1
- package/lib/esm/curve/PointString3d.d.ts +17 -13
- package/lib/esm/curve/PointString3d.d.ts.map +1 -1
- package/lib/esm/curve/PointString3d.js +35 -20
- package/lib/esm/curve/PointString3d.js.map +1 -1
- package/lib/esm/curve/ProxyCurve.js.map +1 -1
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
- package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
- package/lib/esm/curve/Query/InOutTests.js.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/esm/curve/StrokeOptions.js.map +1 -1
- package/lib/esm/curve/UnionRegion.js.map +1 -1
- package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/ChainCollectorContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
- package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js +1 -1
- package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js +1 -1
- package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/esm/geometry3d/Angle.js.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.d.ts.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.js +3 -0
- package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
- package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts +8 -2
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js +11 -2
- package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/esm/geometry3d/Plane3d.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray2d.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/esm/geometry3d/Segment1d.js.map +1 -1
- package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
- package/lib/esm/geometry3d/XYZProps.js.map +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/esm/geometry4d/Map4d.js.map +1 -1
- package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
- package/lib/esm/geometry4d/MomentData.js.map +1 -1
- package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
- package/lib/esm/geometry4d/Point4d.js.map +1 -1
- package/lib/esm/numerics/BandedSystem.js.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
- package/lib/esm/numerics/ClusterableArray.js.map +1 -1
- package/lib/esm/numerics/Complex.js.map +1 -1
- package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
- package/lib/esm/numerics/Newton.js.map +1 -1
- package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
- package/lib/esm/numerics/PolarData.js.map +1 -1
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/lib/esm/numerics/Quadrature.js.map +1 -1
- package/lib/esm/numerics/Range1dArray.js.map +1 -1
- package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
- package/lib/esm/numerics/UnionFind.js.map +1 -1
- package/lib/esm/numerics/UsageSums.js.map +1 -1
- package/lib/esm/polyface/AuxData.js.map +1 -1
- package/lib/esm/polyface/BoxTopology.js.map +1 -1
- package/lib/esm/polyface/FacetFaceData.js.map +1 -1
- package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
- package/lib/esm/polyface/FacetOrientation.js.map +1 -1
- package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +42 -50
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js +80 -103
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/esm/polyface/Polyface.d.ts +166 -120
- package/lib/esm/polyface/Polyface.d.ts.map +1 -1
- package/lib/esm/polyface/Polyface.js +251 -162
- package/lib/esm/polyface/Polyface.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts +18 -10
- package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +27 -21
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.d.ts +142 -86
- package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceData.js +305 -164
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/polyface/RangeLengthData.js.map +1 -1
- package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/MinimumValueTester.js.map +1 -1
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
- package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
- package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
- package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
- package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
- package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
- package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
- package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
- package/lib/esm/serialization/BGFBReader.js.map +1 -1
- package/lib/esm/serialization/BGFBWriter.js.map +1 -1
- package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/esm/serialization/DeepCompare.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
- package/lib/esm/solid/Box.js.map +1 -1
- package/lib/esm/solid/Cone.js.map +1 -1
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/RuledSweep.js.map +1 -1
- package/lib/esm/solid/SolidPrimitive.js.map +1 -1
- package/lib/esm/solid/Sphere.js.map +1 -1
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/lib/esm/solid/TorusPipe.js.map +1 -1
- package/lib/esm/topology/ChainMerge.js.map +1 -1
- package/lib/esm/topology/Graph.d.ts +2 -8
- package/lib/esm/topology/Graph.d.ts.map +1 -1
- package/lib/esm/topology/Graph.js +0 -3
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
- package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
- package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/esm/topology/MaskManager.js.map +1 -1
- package/lib/esm/topology/Merging.js.map +1 -1
- package/lib/esm/topology/RegularizeFace.js.map +1 -1
- package/lib/esm/topology/SignedDataSummary.js.map +1 -1
- package/lib/esm/topology/SpaceTriangulation.js.map +1 -1
- package/lib/esm/topology/Triangulation.d.ts +18 -7
- package/lib/esm/topology/Triangulation.d.ts.map +1 -1
- package/lib/esm/topology/Triangulation.js +50 -9
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
- package/package.json +4 -3
|
@@ -15,35 +15,28 @@ import { Range3d } from "../geometry3d/Range";
|
|
|
15
15
|
import { ClusterableArray } from "../numerics/ClusterableArray";
|
|
16
16
|
import { PolyfaceAuxData } from "./AuxData";
|
|
17
17
|
import { TaggedNumericData } from "./TaggedNumericData";
|
|
18
|
+
// cspell:word internaldocs
|
|
18
19
|
/**
|
|
19
|
-
* PolyfaceData carries data arrays for point, normal,
|
|
20
|
-
*
|
|
21
|
-
* *
|
|
22
|
-
* *
|
|
23
|
-
* *
|
|
20
|
+
* `PolyfaceData` carries data arrays for point, normal, uv-parameters, and color, and index arrays for each.
|
|
21
|
+
* * Normal, uv-parameter, and color data are optional.
|
|
22
|
+
* * A given data array is defined if and only if its corresponding index array is defined.
|
|
23
|
+
* * All defined index arrays have parallel face loop order and structure, and thus the same length.
|
|
24
|
+
* * `IndexedPolyface` carries a PolyfaceData as a member (NOT as a base class; it already has `GeometryQuery` as base).
|
|
25
|
+
* * `IndexedPolyfaceVisitor` uses PolyfaceData as a base class. In this use, there is only a single facet in `PolyfaceData`.
|
|
26
|
+
* * `PolyfaceData` does not know what index range constitutes a given facet. This is managed by a derived/carrier class.
|
|
24
27
|
* @public
|
|
25
28
|
*/
|
|
26
29
|
class PolyfaceData {
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
/** boolean tag indicating if the facets are viewable from the back */
|
|
35
|
-
get expectedClosure() { return this._expectedClosure; }
|
|
36
|
-
set expectedClosure(value) { this._expectedClosure = value; }
|
|
37
|
-
/** Constructor for facets.
|
|
38
|
-
* * The various params control whether respective arrays are to be allocated.
|
|
39
|
-
* * If arrayData is provided, all other params are IGNORED.
|
|
40
|
-
* *
|
|
30
|
+
/**
|
|
31
|
+
* Constructor for facets.
|
|
32
|
+
* @param needNormals `true` to allocate empty normal data and index arrays; `false` (default) to leave undefined.
|
|
33
|
+
* @param needParams `true` to allocate empty uv parameter data and index arrays; `false` (default) to leave undefined.
|
|
34
|
+
* @param needColors `true` to allocate empty color data and index arrays; `false` (default) to leave undefined.
|
|
35
|
+
* @param twoSided `true` if the facets are to be considered viewable from the back; `false` (default) if not.
|
|
41
36
|
*/
|
|
42
37
|
constructor(needNormals = false, needParams = false, needColors = false, twoSided = false) {
|
|
43
|
-
this.face = [];
|
|
44
38
|
this.point = new GrowableXYZArray();
|
|
45
39
|
this.pointIndex = [];
|
|
46
|
-
this.edgeVisible = [];
|
|
47
40
|
if (needNormals) {
|
|
48
41
|
this.normal = new GrowableXYZArray();
|
|
49
42
|
this.normalIndex = [];
|
|
@@ -56,6 +49,8 @@ class PolyfaceData {
|
|
|
56
49
|
this.color = [];
|
|
57
50
|
this.colorIndex = [];
|
|
58
51
|
}
|
|
52
|
+
this.face = [];
|
|
53
|
+
this.edgeVisible = [];
|
|
59
54
|
this._twoSided = twoSided;
|
|
60
55
|
this._expectedClosure = 0;
|
|
61
56
|
}
|
|
@@ -64,30 +59,29 @@ class PolyfaceData {
|
|
|
64
59
|
const result = new PolyfaceData();
|
|
65
60
|
result.point = this.point.clone();
|
|
66
61
|
result.pointIndex = this.pointIndex.slice();
|
|
67
|
-
result.edgeVisible = this.edgeVisible.slice();
|
|
68
|
-
result.face = this.face.slice();
|
|
69
|
-
result.twoSided = this.twoSided;
|
|
70
|
-
result.expectedClosure = this.expectedClosure;
|
|
71
62
|
if (this.normal)
|
|
72
63
|
result.normal = this.normal.clone();
|
|
73
|
-
if (this.param)
|
|
74
|
-
result.param = this.param.clone();
|
|
75
|
-
if (this.color)
|
|
76
|
-
result.color = this.color.slice();
|
|
77
64
|
if (this.normalIndex)
|
|
78
65
|
result.normalIndex = this.normalIndex.slice();
|
|
66
|
+
if (this.param)
|
|
67
|
+
result.param = this.param.clone();
|
|
79
68
|
if (this.paramIndex)
|
|
80
69
|
result.paramIndex = this.paramIndex.slice();
|
|
70
|
+
if (this.color)
|
|
71
|
+
result.color = this.color.slice();
|
|
81
72
|
if (this.colorIndex)
|
|
82
73
|
result.colorIndex = this.colorIndex.slice();
|
|
74
|
+
result.face = this.face.slice();
|
|
83
75
|
if (this.auxData)
|
|
84
76
|
result.auxData = this.auxData.clone();
|
|
85
|
-
if (this.taggedNumericData)
|
|
77
|
+
if (this.taggedNumericData)
|
|
86
78
|
result.taggedNumericData = this.taggedNumericData.clone();
|
|
87
|
-
|
|
79
|
+
result.edgeVisible = this.edgeVisible.slice();
|
|
80
|
+
result.twoSided = this.twoSided;
|
|
81
|
+
result.expectedClosure = this.expectedClosure;
|
|
88
82
|
return result;
|
|
89
83
|
}
|
|
90
|
-
/** Test for equal indices and nearly equal coordinates */
|
|
84
|
+
/** Test for equal indices and nearly equal coordinates. */
|
|
91
85
|
isAlmostEqual(other) {
|
|
92
86
|
if (!GrowableXYZArray.isAlmostEqual(this.point, other.point))
|
|
93
87
|
return false;
|
|
@@ -105,77 +99,133 @@ class PolyfaceData {
|
|
|
105
99
|
return false;
|
|
106
100
|
if (!NumberArray.isExactEqual(this.colorIndex, other.colorIndex))
|
|
107
101
|
return false;
|
|
108
|
-
if (!NumberArray.isExactEqual(this.edgeVisible, other.edgeVisible))
|
|
109
|
-
return false;
|
|
110
102
|
if (!PolyfaceAuxData.isAlmostEqual(this.auxData, other.auxData))
|
|
111
103
|
return false;
|
|
104
|
+
if (!TaggedNumericData.areAlmostEqual(this.taggedNumericData, other.taggedNumericData))
|
|
105
|
+
return false;
|
|
106
|
+
if (!NumberArray.isExactEqual(this.edgeVisible, other.edgeVisible))
|
|
107
|
+
return false;
|
|
112
108
|
if (this.twoSided !== other.twoSided)
|
|
113
109
|
return false;
|
|
114
110
|
if (this.expectedClosure !== other.expectedClosure)
|
|
115
111
|
return false;
|
|
116
|
-
if (!TaggedNumericData.areAlmostEqual(this.taggedNumericData, other.taggedNumericData))
|
|
117
|
-
return false;
|
|
118
112
|
return true;
|
|
119
113
|
}
|
|
120
114
|
/** Ask if normals are required in this mesh. */
|
|
121
|
-
get requireNormals() {
|
|
115
|
+
get requireNormals() {
|
|
116
|
+
return undefined !== this.normal;
|
|
117
|
+
}
|
|
118
|
+
/** Ask if params are required in this mesh. */
|
|
119
|
+
get requireParams() {
|
|
120
|
+
return undefined !== this.param;
|
|
121
|
+
}
|
|
122
|
+
/** Ask if colors are required in this mesh. */
|
|
123
|
+
get requireColors() {
|
|
124
|
+
return undefined !== this.color;
|
|
125
|
+
}
|
|
122
126
|
/** Get the point count */
|
|
123
|
-
get pointCount() {
|
|
127
|
+
get pointCount() {
|
|
128
|
+
return this.point.length;
|
|
129
|
+
}
|
|
124
130
|
/** Get the normal count */
|
|
125
|
-
get normalCount() {
|
|
131
|
+
get normalCount() {
|
|
132
|
+
return this.normal ? this.normal.length : 0;
|
|
133
|
+
}
|
|
126
134
|
/** Get the param count */
|
|
127
|
-
get paramCount() {
|
|
135
|
+
get paramCount() {
|
|
136
|
+
return this.param ? this.param.length : 0;
|
|
137
|
+
}
|
|
128
138
|
/** Get the color count */
|
|
129
|
-
get colorCount() {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
/** Get the
|
|
139
|
+
get colorCount() {
|
|
140
|
+
return this.color ? this.color.length : 0;
|
|
141
|
+
}
|
|
142
|
+
/** Get the index count. Note that the point array is always indexed, and index arrays all have the same length. */
|
|
143
|
+
get indexCount() {
|
|
144
|
+
return this.pointIndex.length;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Get the number of faces.
|
|
133
148
|
* * Note that a "face" is not a facet.
|
|
134
|
-
* * A
|
|
149
|
+
* * A face is a subset of the Polyface's facets grouped for application purposes.
|
|
135
150
|
*/
|
|
136
|
-
get faceCount() {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
|
|
153
|
-
this.
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
151
|
+
get faceCount() {
|
|
152
|
+
return this.face.length;
|
|
153
|
+
}
|
|
154
|
+
/** Return indexed point at index `i`. This is a COPY of the coordinates, not a reference. */
|
|
155
|
+
getPoint(i, result) {
|
|
156
|
+
return this.point.getPoint3dAtCheckedPointIndex(i, result);
|
|
157
|
+
}
|
|
158
|
+
/** Return indexed normal at index `i`. This is a COPY of the normal, not a reference. */
|
|
159
|
+
getNormal(i, result) {
|
|
160
|
+
return this.normal ? this.normal.getVector3dAtCheckedVectorIndex(i, result) : undefined;
|
|
161
|
+
}
|
|
162
|
+
/** Return indexed param at index `i`. This is a COPY of the coordinates, not a reference. */
|
|
163
|
+
getParam(i, result) {
|
|
164
|
+
return this.param ? this.param.getPoint2dAtCheckedPointIndex(i, result) : undefined;
|
|
165
|
+
}
|
|
166
|
+
/** Return indexed color at index `i`. Index `i` is not checked for validity. */
|
|
167
|
+
getColor(i) {
|
|
168
|
+
return this.color ? this.color[i] : 0;
|
|
169
|
+
}
|
|
170
|
+
/** Return indexed visibility. at index `i`. Index `i` is not checked for validity. */
|
|
171
|
+
getEdgeVisible(i) {
|
|
172
|
+
return this.edgeVisible[i];
|
|
173
|
+
}
|
|
174
|
+
/** Get boolean tag indicating if the facets are to be considered viewable from the back. */
|
|
175
|
+
get twoSided() {
|
|
176
|
+
return this._twoSided;
|
|
177
|
+
}
|
|
178
|
+
set twoSided(value) {
|
|
179
|
+
this._twoSided = value;
|
|
180
|
+
}
|
|
181
|
+
/** Get flag indicating if the mesh closure is unknown (0), open sheet (1), closed solid (2). */
|
|
182
|
+
get expectedClosure() {
|
|
183
|
+
return this._expectedClosure;
|
|
184
|
+
}
|
|
185
|
+
set expectedClosure(value) {
|
|
186
|
+
this._expectedClosure = value;
|
|
187
|
+
}
|
|
188
|
+
/** Set the tagged geometry data. */
|
|
189
|
+
setTaggedNumericData(data) {
|
|
190
|
+
this.taggedNumericData = data;
|
|
191
|
+
}
|
|
192
|
+
/** Copy the contents (not pointer) of `point[i]` into `dest`. Index `i` is not checked for validity. */
|
|
193
|
+
copyPointTo(i, dest) {
|
|
194
|
+
this.point.getPoint3dAtUncheckedPointIndex(i, dest);
|
|
195
|
+
}
|
|
196
|
+
/** Copy the contents (not pointer) of `normal[i]` into `dest`. Index `i` is not checked for validity. */
|
|
197
|
+
copyNormalTo(i, dest) {
|
|
198
|
+
if (this.normal)
|
|
199
|
+
this.normal.getVector3dAtUncheckedVectorIndex(i, dest);
|
|
200
|
+
}
|
|
201
|
+
/** Copy the contents (not pointer) of `param[i]` into `dest`. Index `i` is not checked for validity. */
|
|
202
|
+
copyParamTo(i, dest) {
|
|
203
|
+
if (this.param)
|
|
204
|
+
this.param.getPoint2dAtUncheckedPointIndex(i, dest);
|
|
205
|
+
}
|
|
206
|
+
/** Test if param at a index `i` matches the given uv */
|
|
207
|
+
isAlmostEqualParamIndexUV(i, u, v) {
|
|
208
|
+
if (this.param !== undefined && i >= 0 && i < this.param.length)
|
|
209
|
+
return Geometry.isSameCoordinate(u, this.param.getXAtUncheckedPointIndex(i))
|
|
210
|
+
&& Geometry.isSameCoordinate(v, this.param.getYAtUncheckedPointIndex(i));
|
|
162
211
|
return false;
|
|
163
212
|
}
|
|
164
213
|
/**
|
|
165
|
-
*
|
|
214
|
+
* Copy data from `other` to `this`.
|
|
166
215
|
* * This is the essence of transferring coordinates spread throughout a large polyface into a visitor's single facet.
|
|
167
|
-
* * "other" is the
|
|
168
|
-
* *
|
|
169
|
-
* * does NOT copy face data - visitors reference the FacetFaceData array for the whole polyface!!
|
|
216
|
+
* * Common usage: "other" is a Polyface, "this" is a PolyfaceVisitor to receive data from a single facet of the Polyface.
|
|
217
|
+
* * Does NOT copy face data - visitors reference the FacetFaceData array for the whole polyface.
|
|
170
218
|
* @param other polyface data being mined.
|
|
171
|
-
* @param index0 start index in other's index arrays
|
|
172
|
-
* @param index1 end index (one beyond last data
|
|
219
|
+
* @param index0 start index in other's index arrays.
|
|
220
|
+
* @param index1 end index (one beyond last data accessed) in other's index arrays.
|
|
173
221
|
* @param numWrap number of points to replicate as wraparound.
|
|
174
222
|
*/
|
|
175
223
|
gatherIndexedData(other, index0, index1, numWrap) {
|
|
176
224
|
const numEdge = index1 - index0;
|
|
225
|
+
if (numWrap > numEdge)
|
|
226
|
+
numWrap = numEdge;
|
|
177
227
|
const numTotal = numEdge + numWrap;
|
|
178
|
-
this.
|
|
228
|
+
this.resizeAllArrays(numTotal);
|
|
179
229
|
// copy wrapped points
|
|
180
230
|
for (let i = 0; i < numEdge; i++)
|
|
181
231
|
this.point.transferFromGrowableXYZArray(i, other.point, other.pointIndex[index0 + i]);
|
|
@@ -186,41 +236,48 @@ class PolyfaceData {
|
|
|
186
236
|
this.pointIndex[i] = other.pointIndex[index0 + i];
|
|
187
237
|
for (let i = 0; i < numWrap; i++)
|
|
188
238
|
this.pointIndex[numEdge + i] = this.pointIndex[i];
|
|
189
|
-
// copy wrapped
|
|
190
|
-
for (let i = 0; i < numEdge; i++)
|
|
191
|
-
this.edgeVisible[i] = other.edgeVisible[index0 + i];
|
|
192
|
-
for (let i = 0; i < numWrap; i++)
|
|
193
|
-
this.edgeVisible[numEdge + i] = this.edgeVisible[i];
|
|
239
|
+
// copy wrapped normals
|
|
194
240
|
if (this.normal && this.normalIndex && other.normal && other.normalIndex) {
|
|
195
241
|
for (let i = 0; i < numEdge; i++)
|
|
196
242
|
this.normal.transferFromGrowableXYZArray(i, other.normal, other.normalIndex[index0 + i]);
|
|
197
243
|
for (let i = 0; i < numWrap; i++)
|
|
198
244
|
this.normal.transferFromGrowableXYZArray(numEdge + i, this.normal, i);
|
|
245
|
+
// copy wrapped normalIndex
|
|
199
246
|
for (let i = 0; i < numEdge; i++)
|
|
200
247
|
this.normalIndex[i] = other.normalIndex[index0 + i];
|
|
201
248
|
for (let i = 0; i < numWrap; i++)
|
|
202
249
|
this.normalIndex[numEdge + i] = this.normalIndex[i];
|
|
203
250
|
}
|
|
251
|
+
// copy wrapped params
|
|
204
252
|
if (this.param && this.paramIndex && other.param && other.paramIndex) {
|
|
205
253
|
for (let i = 0; i < numEdge; i++)
|
|
206
254
|
this.param.transferFromGrowableXYArray(i, other.param, other.paramIndex[index0 + i]);
|
|
207
255
|
for (let i = 0; i < numWrap; i++)
|
|
208
256
|
this.param.transferFromGrowableXYArray(numEdge + i, this.param, i);
|
|
257
|
+
// copy wrapped paramIndex
|
|
209
258
|
for (let i = 0; i < numEdge; i++)
|
|
210
259
|
this.paramIndex[i] = other.paramIndex[index0 + i];
|
|
211
260
|
for (let i = 0; i < numWrap; i++)
|
|
212
261
|
this.paramIndex[numEdge + i] = this.paramIndex[i];
|
|
213
262
|
}
|
|
263
|
+
// copy wrapped colors
|
|
214
264
|
if (this.color && this.colorIndex && other.color && other.colorIndex) {
|
|
215
265
|
for (let i = 0; i < numEdge; i++)
|
|
216
266
|
this.color[i] = other.color[other.colorIndex[index0 + i]];
|
|
217
267
|
for (let i = 0; i < numWrap; i++)
|
|
218
268
|
this.color[numEdge + i] = this.color[i];
|
|
269
|
+
// copy wrapped colorIndex
|
|
219
270
|
for (let i = 0; i < numEdge; i++)
|
|
220
271
|
this.colorIndex[i] = other.colorIndex[index0 + i];
|
|
221
272
|
for (let i = 0; i < numWrap; i++)
|
|
222
273
|
this.colorIndex[numEdge + i] = this.colorIndex[i];
|
|
223
274
|
}
|
|
275
|
+
// copy wrapped edge visibility
|
|
276
|
+
for (let i = 0; i < numEdge; i++)
|
|
277
|
+
this.edgeVisible[i] = other.edgeVisible[index0 + i];
|
|
278
|
+
for (let i = 0; i < numWrap; i++)
|
|
279
|
+
this.edgeVisible[numEdge + i] = this.edgeVisible[i];
|
|
280
|
+
// copy wrapped auxData
|
|
224
281
|
if (this.auxData && other.auxData && this.auxData.channels.length === other.auxData.channels.length) {
|
|
225
282
|
for (let iChannel = 0; iChannel < this.auxData.channels.length; iChannel++) {
|
|
226
283
|
const thisChannel = this.auxData.channels[iChannel];
|
|
@@ -237,15 +294,20 @@ class PolyfaceData {
|
|
|
237
294
|
}
|
|
238
295
|
}
|
|
239
296
|
}
|
|
297
|
+
// copy wrapped auxData index
|
|
240
298
|
for (let i = 0; i < numEdge; i++)
|
|
241
299
|
this.auxData.indices[i] = other.auxData.indices[index0 + i];
|
|
242
300
|
for (let i = 0; i < numWrap; i++)
|
|
243
301
|
this.auxData.indices[numEdge + i] = this.auxData.indices[i];
|
|
244
302
|
}
|
|
245
303
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
304
|
+
/** Trim the `data` arrays to the stated `length`. */
|
|
305
|
+
static trimArray(data, length) {
|
|
306
|
+
if (data && length < data.length)
|
|
307
|
+
data.length = length;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Trim all index arrays to the stated `length`.
|
|
249
311
|
* * This is called by PolyfaceBuilder to clean up after an aborted construction sequence.
|
|
250
312
|
*/
|
|
251
313
|
trimAllIndexArrays(length) {
|
|
@@ -262,7 +324,78 @@ class PolyfaceData {
|
|
|
262
324
|
}
|
|
263
325
|
}
|
|
264
326
|
}
|
|
265
|
-
/**
|
|
327
|
+
/**
|
|
328
|
+
* Resize all data and index arrays to the specified `length`.
|
|
329
|
+
* * This is used by visitors, whose data and index arrays are all parallel.
|
|
330
|
+
*/
|
|
331
|
+
resizeAllArrays(length) {
|
|
332
|
+
if (length > this.point.length) {
|
|
333
|
+
while (this.point.length < length)
|
|
334
|
+
this.point.push(Point3d.create());
|
|
335
|
+
while (this.pointIndex.length < length)
|
|
336
|
+
this.pointIndex.push(-1);
|
|
337
|
+
if (this.normal)
|
|
338
|
+
while (this.normal.length < length)
|
|
339
|
+
this.normal.push(Vector3d.create());
|
|
340
|
+
if (this.normalIndex)
|
|
341
|
+
while (this.normalIndex.length < length)
|
|
342
|
+
this.normalIndex.push(-1);
|
|
343
|
+
if (this.param)
|
|
344
|
+
while (this.param.length < length)
|
|
345
|
+
this.param.push(Point2d.create());
|
|
346
|
+
if (this.paramIndex)
|
|
347
|
+
while (this.paramIndex.length < length)
|
|
348
|
+
this.paramIndex.push(-1);
|
|
349
|
+
if (this.color)
|
|
350
|
+
while (this.color.length < length)
|
|
351
|
+
this.color.push(0);
|
|
352
|
+
if (this.colorIndex)
|
|
353
|
+
while (this.colorIndex.length < length)
|
|
354
|
+
this.colorIndex.push(-1);
|
|
355
|
+
while (this.edgeVisible.length < length)
|
|
356
|
+
this.edgeVisible.push(false);
|
|
357
|
+
if (this.auxData) {
|
|
358
|
+
for (const channel of this.auxData.channels) {
|
|
359
|
+
for (const channelData of channel.data) {
|
|
360
|
+
while (channelData.values.length < length * channel.entriesPerValue)
|
|
361
|
+
channelData.values.push(0);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
if (this.auxData.indices)
|
|
365
|
+
this.auxData.indices.push(-1);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
else if (length < this.point.length) {
|
|
369
|
+
this.point.resize(length);
|
|
370
|
+
this.pointIndex.length = length;
|
|
371
|
+
if (this.normal)
|
|
372
|
+
this.normal.resize(length);
|
|
373
|
+
if (this.normalIndex)
|
|
374
|
+
this.normalIndex.length = length;
|
|
375
|
+
if (this.param)
|
|
376
|
+
this.param.resize(length);
|
|
377
|
+
if (this.paramIndex)
|
|
378
|
+
this.paramIndex.length = length;
|
|
379
|
+
if (this.color)
|
|
380
|
+
this.color.length = length;
|
|
381
|
+
if (this.colorIndex)
|
|
382
|
+
this.colorIndex.length = length;
|
|
383
|
+
this.edgeVisible.length = length;
|
|
384
|
+
if (this.auxData) {
|
|
385
|
+
for (const channel of this.auxData.channels) {
|
|
386
|
+
for (const channelData of channel.data) {
|
|
387
|
+
channelData.values.length = length * channel.entriesPerValue;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
if (this.auxData.indices)
|
|
391
|
+
this.auxData.indices.length = length;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Resize all data arrays to the specified `length`.
|
|
397
|
+
* @deprecated in 4.x because name is misleading. Call [[PolyfaceData.resizeAllArrays]] instead.
|
|
398
|
+
*/
|
|
266
399
|
resizeAllDataArrays(length) {
|
|
267
400
|
if (length > this.point.length) {
|
|
268
401
|
while (this.point.length < length)
|
|
@@ -308,56 +441,16 @@ class PolyfaceData {
|
|
|
308
441
|
}
|
|
309
442
|
}
|
|
310
443
|
}
|
|
311
|
-
/** Return the range of the point array (optionally transformed) */
|
|
444
|
+
/** Return the range of the point array (optionally transformed). */
|
|
312
445
|
range(result, transform) {
|
|
313
446
|
result = result ? result : Range3d.createNull();
|
|
314
447
|
result.extendArray(this.point, transform);
|
|
315
448
|
return result;
|
|
316
449
|
}
|
|
317
|
-
/**
|
|
318
|
-
*
|
|
319
|
-
* *
|
|
320
|
-
*
|
|
321
|
-
* * hence for "internal" k, facetStartIndex[k] is both the upper limit of facet k-1 and the start of facet k.
|
|
322
|
-
* *
|
|
323
|
-
*/
|
|
324
|
-
reverseIndices(facetStartIndex) {
|
|
325
|
-
if (facetStartIndex && PolyfaceData.isValidFacetStartIndexArray(facetStartIndex)) {
|
|
326
|
-
PolyfaceData.reverseIndices(facetStartIndex, this.pointIndex, true);
|
|
327
|
-
if (this.normalIndex !== this.pointIndex)
|
|
328
|
-
PolyfaceData.reverseIndices(facetStartIndex, this.normalIndex, true);
|
|
329
|
-
if (this.paramIndex !== this.pointIndex)
|
|
330
|
-
PolyfaceData.reverseIndices(facetStartIndex, this.paramIndex, true);
|
|
331
|
-
if (this.colorIndex !== this.pointIndex)
|
|
332
|
-
PolyfaceData.reverseIndices(facetStartIndex, this.colorIndex, true);
|
|
333
|
-
PolyfaceData.reverseIndices(facetStartIndex, this.edgeVisible, false);
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
/** reverse indices facet-by-facet, with the given facetStartIndex array delimiting faces.
|
|
337
|
-
*
|
|
338
|
-
* * facetStartIndex[0] == 0 always -- start of facet zero.
|
|
339
|
-
* * facet k has indices from facetStartIndex[k] <= i < facetStartIndex[k+1]
|
|
340
|
-
* * hence for "internal" k, facetStartIndex[k] is both the upper limit of facet k-1 and the start of facet k.
|
|
341
|
-
* *
|
|
342
|
-
*/
|
|
343
|
-
reverseIndicesSingleFacet(facetId, facetStartIndex) {
|
|
344
|
-
PolyfaceData.reverseIndicesSingleFacet(facetId, facetStartIndex, this.pointIndex, true);
|
|
345
|
-
if (this.normalIndex !== this.pointIndex)
|
|
346
|
-
PolyfaceData.reverseIndicesSingleFacet(facetId, facetStartIndex, this.normalIndex, true);
|
|
347
|
-
if (this.paramIndex !== this.pointIndex)
|
|
348
|
-
PolyfaceData.reverseIndicesSingleFacet(facetId, facetStartIndex, this.paramIndex, true);
|
|
349
|
-
if (this.colorIndex !== this.pointIndex)
|
|
350
|
-
PolyfaceData.reverseIndicesSingleFacet(facetId, facetStartIndex, this.colorIndex, true);
|
|
351
|
-
PolyfaceData.reverseIndicesSingleFacet(facetId, facetStartIndex, this.edgeVisible, false);
|
|
352
|
-
}
|
|
353
|
-
/** Scale all the normals by -1 */
|
|
354
|
-
reverseNormals() {
|
|
355
|
-
if (this.normal)
|
|
356
|
-
this.normal.scaleInPlace(-1.0);
|
|
357
|
-
}
|
|
358
|
-
/** Apply `transform` to point and normal arrays and to auxData.
|
|
359
|
-
* * IMPORTANT This base class is just a data carrier. It does not know if the index order and normal directions have special meaning.
|
|
360
|
-
* * i.e. caller must separately reverse index order and normal direction if needed.
|
|
450
|
+
/**
|
|
451
|
+
* Apply `transform` to point and normal arrays and to auxData.
|
|
452
|
+
* * IMPORTANT This base class is just a data carrier. It does not know if the index order and normal directions
|
|
453
|
+
* have special meaning, i.e., caller must separately reverse index order and normal direction if needed.
|
|
361
454
|
*/
|
|
362
455
|
tryTransformInPlace(transform) {
|
|
363
456
|
this.point.multiplyTransformInPlace(transform);
|
|
@@ -370,13 +463,14 @@ class PolyfaceData {
|
|
|
370
463
|
* * Search for duplicates within points, normals, params, and colors.
|
|
371
464
|
* * Compress each data array.
|
|
372
465
|
* * Revise all indexing for the relocated data.
|
|
373
|
-
* @param tolerance optional tolerance for clustering mesh vertices. Default is [[Geometry.smallMetricDistance]].
|
|
466
|
+
* @param tolerance (optional) tolerance for clustering mesh vertices. Default is [[Geometry.smallMetricDistance]].
|
|
374
467
|
*/
|
|
375
468
|
compress(tolerance = Geometry.smallMetricDistance) {
|
|
469
|
+
// more info can be found at geometry/internaldocs/Polyface.md
|
|
376
470
|
const packedPoints = ClusterableArray.clusterGrowablePoint3dArray(this.point, tolerance);
|
|
377
471
|
this.point = packedPoints.growablePackedPoints;
|
|
378
472
|
packedPoints.updateIndices(this.pointIndex);
|
|
379
|
-
// for now, normals, params, and colors use the default tolerance for clustering
|
|
473
|
+
// for now, normals, params, and colors use the default tolerance for clustering
|
|
380
474
|
if (this.normalIndex && this.normal) {
|
|
381
475
|
const packedNormals = ClusterableArray.clusterGrowablePoint3dArray(this.normal);
|
|
382
476
|
this.normal = packedNormals.growablePackedPoints;
|
|
@@ -394,10 +488,11 @@ class PolyfaceData {
|
|
|
394
488
|
}
|
|
395
489
|
}
|
|
396
490
|
/**
|
|
397
|
-
* Test if facetStartIndex is (minimally
|
|
398
|
-
* *
|
|
491
|
+
* Test if `facetStartIndex` is (minimally) valid.
|
|
492
|
+
* * Length must be nonzero (recall that for "no facets", the `facetStartIndex` array still must contain a 0).
|
|
399
493
|
* * Each entry must be strictly smaller than the one that follows.
|
|
400
|
-
* @param facetStartIndex
|
|
494
|
+
* @param facetStartIndex start indices of all facets. Facet k starts at facetStartIndex[k] up to (but not including)
|
|
495
|
+
* `facetStartIndex[k + 1]`
|
|
401
496
|
*/
|
|
402
497
|
static isValidFacetStartIndexArray(facetStartIndex) {
|
|
403
498
|
// facetStartIndex for empty facets has a single entry "0" -- empty array is not allowed
|
|
@@ -408,8 +503,14 @@ class PolyfaceData {
|
|
|
408
503
|
return false;
|
|
409
504
|
return true;
|
|
410
505
|
}
|
|
411
|
-
/**
|
|
412
|
-
*
|
|
506
|
+
/**
|
|
507
|
+
* Reverse the indices for the specified facets in the given index array.
|
|
508
|
+
* * Parameterized over type T so non-number data (e.g., boolean visibility flags) can be reversed.
|
|
509
|
+
* @param facetStartIndex start indices of *consecutive* facets to be reversed, e.g., an IndexedPolyface's _facetStart
|
|
510
|
+
* array. See the non-static [[reverseIndices]].
|
|
511
|
+
* @param indices the index array, e.g., pointIndex, normalIndex, etc.
|
|
512
|
+
* @param preserveStart `true` to preserve the start index of each facet (e.g., facet [1,2,3,4] becomes [1,4,3,2]);
|
|
513
|
+
* `false` to reverse all indices (e.g., facet [1,2,3,4] becomes [4,3,2,1]).
|
|
413
514
|
*/
|
|
414
515
|
static reverseIndices(facetStartIndex, indices, preserveStart) {
|
|
415
516
|
if (!indices || indices.length === 0)
|
|
@@ -419,8 +520,7 @@ class PolyfaceData {
|
|
|
419
520
|
for (let i = 0; i + 1 < facetStartIndex.length; i++) {
|
|
420
521
|
let index0 = facetStartIndex[i];
|
|
421
522
|
let index1 = facetStartIndex[i + 1];
|
|
422
|
-
if (preserveStart) {
|
|
423
|
-
// leave [index0] as is so reversed facet starts at same vertex
|
|
523
|
+
if (preserveStart) { // leave "index0" as is so reversed facet starts at same vertex
|
|
424
524
|
while (index1 > index0 + 2) {
|
|
425
525
|
index1--;
|
|
426
526
|
index0++;
|
|
@@ -429,8 +529,7 @@ class PolyfaceData {
|
|
|
429
529
|
indices[index1] = a;
|
|
430
530
|
}
|
|
431
531
|
}
|
|
432
|
-
else {
|
|
433
|
-
// reverse all
|
|
532
|
+
else { // reverse all
|
|
434
533
|
while (index1 > index0 + 1) {
|
|
435
534
|
index1--;
|
|
436
535
|
const a = indices[index0];
|
|
@@ -445,19 +544,26 @@ class PolyfaceData {
|
|
|
445
544
|
}
|
|
446
545
|
return false;
|
|
447
546
|
}
|
|
448
|
-
/**
|
|
449
|
-
*
|
|
547
|
+
/**
|
|
548
|
+
* Reverse the indices for the specified facet in the specified index array.
|
|
549
|
+
* * Parameterized over type T so non-number data (e.g., boolean visibility flags) can be reversed.
|
|
550
|
+
* @param facetIndex index of the facet to reverse. The entries of `indices` to be reversed are found at
|
|
551
|
+
* `facetStartIndex[facetIndex] <= i < facetStartIndex[facetIndex + 1]`.
|
|
552
|
+
* @param facetStartIndex start indices of *consecutive* facets, e.g., an IndexedPolyface's _facetStart array.
|
|
553
|
+
* See [[reverseIndices]].
|
|
554
|
+
* @param indices the index array, e.g., pointIndex, normalIndex, etc.
|
|
555
|
+
* @param preserveStart `true` to preserve the start index of each facet (e.g., facet [1,2,3,4] becomes [1,4,3,2]);
|
|
556
|
+
* `false` to reverse all indices (e.g., facet [1,2,3,4] becomes [4,3,2,1]).
|
|
450
557
|
*/
|
|
451
|
-
static reverseIndicesSingleFacet(
|
|
558
|
+
static reverseIndicesSingleFacet(facetIndex, facetStartIndex, indices, preserveStart) {
|
|
452
559
|
if (!indices || indices.length === 0)
|
|
453
560
|
return true; // empty case
|
|
454
561
|
if (indices.length > 0) {
|
|
455
562
|
if (facetStartIndex[facetStartIndex.length - 1] === indices.length
|
|
456
|
-
&&
|
|
457
|
-
let index0 = facetStartIndex[
|
|
458
|
-
let index1 = facetStartIndex[
|
|
459
|
-
if (preserveStart) {
|
|
460
|
-
// leave [index0] as is so reversed facet starts at same vertex
|
|
563
|
+
&& facetIndex >= 0 && facetIndex + 1 < facetStartIndex.length) {
|
|
564
|
+
let index0 = facetStartIndex[facetIndex];
|
|
565
|
+
let index1 = facetStartIndex[facetIndex + 1];
|
|
566
|
+
if (preserveStart) { // leave "index0" as is so reversed facet starts at same vertex
|
|
461
567
|
while (index1 > index0 + 2) {
|
|
462
568
|
index1--;
|
|
463
569
|
index0++;
|
|
@@ -466,8 +572,7 @@ class PolyfaceData {
|
|
|
466
572
|
indices[index1] = a;
|
|
467
573
|
}
|
|
468
574
|
}
|
|
469
|
-
else {
|
|
470
|
-
// reverse all
|
|
575
|
+
else { // reverse all
|
|
471
576
|
while (index1 > index0 + 1) {
|
|
472
577
|
index1--;
|
|
473
578
|
const a = indices[index0];
|
|
@@ -481,19 +586,55 @@ class PolyfaceData {
|
|
|
481
586
|
}
|
|
482
587
|
return false;
|
|
483
588
|
}
|
|
589
|
+
/**
|
|
590
|
+
* Reverse the indices for the specified facets in the index arrays (pointIndex, normalIndex, paramIndex, colorIndex,
|
|
591
|
+
* and edgeVisible).
|
|
592
|
+
* @param facetStartIndex start indices of *consecutive* facets to be reversed.
|
|
593
|
+
* * Consecutive indices in this array define where a given facet is represented in each of the parallel index arrays.
|
|
594
|
+
* * The indices for facet k are `facetStartIndex[k]` up to (but not including) `facetStartIndex[k + 1]`.
|
|
595
|
+
* * This implies `facetStartIndex[k + 1]` is both the upper limit of facet k's indices, and the start index of facet k+1.
|
|
596
|
+
* * For example, passing an IndexedPolyface's _facetStart array into this method reverses every facet.
|
|
597
|
+
*/
|
|
598
|
+
reverseIndices(facetStartIndex) {
|
|
599
|
+
if (facetStartIndex && PolyfaceData.isValidFacetStartIndexArray(facetStartIndex)) {
|
|
600
|
+
PolyfaceData.reverseIndices(facetStartIndex, this.pointIndex, true);
|
|
601
|
+
if (this.normalIndex !== this.pointIndex)
|
|
602
|
+
PolyfaceData.reverseIndices(facetStartIndex, this.normalIndex, true);
|
|
603
|
+
if (this.paramIndex !== this.pointIndex)
|
|
604
|
+
PolyfaceData.reverseIndices(facetStartIndex, this.paramIndex, true);
|
|
605
|
+
if (this.colorIndex !== this.pointIndex)
|
|
606
|
+
PolyfaceData.reverseIndices(facetStartIndex, this.colorIndex, true);
|
|
607
|
+
PolyfaceData.reverseIndices(facetStartIndex, this.edgeVisible, false);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* Reverse the indices for the specified facet in the index arrays (pointIndex, normalIndex, paramIndex, colorIndex,
|
|
612
|
+
* and edgeVisible).
|
|
613
|
+
* @param facetIndex index of the facet to reverse. The entries of each index array to be reversed are found at
|
|
614
|
+
* `facetStartIndex[facetIndex] <= i < facetStartIndex[facetIndex + 1]`.
|
|
615
|
+
* @param facetStartIndex start indices of *consecutive* facets, e.g., an IndexedPolyface's _facetStart array.
|
|
616
|
+
* See [[reverseIndices]].
|
|
617
|
+
*/
|
|
618
|
+
reverseIndicesSingleFacet(facetIndex, facetStartIndex) {
|
|
619
|
+
PolyfaceData.reverseIndicesSingleFacet(facetIndex, facetStartIndex, this.pointIndex, true);
|
|
620
|
+
if (this.normalIndex !== this.pointIndex)
|
|
621
|
+
PolyfaceData.reverseIndicesSingleFacet(facetIndex, facetStartIndex, this.normalIndex, true);
|
|
622
|
+
if (this.paramIndex !== this.pointIndex)
|
|
623
|
+
PolyfaceData.reverseIndicesSingleFacet(facetIndex, facetStartIndex, this.paramIndex, true);
|
|
624
|
+
if (this.colorIndex !== this.pointIndex)
|
|
625
|
+
PolyfaceData.reverseIndicesSingleFacet(facetIndex, facetStartIndex, this.colorIndex, true);
|
|
626
|
+
PolyfaceData.reverseIndicesSingleFacet(facetIndex, facetStartIndex, this.edgeVisible, false);
|
|
627
|
+
}
|
|
628
|
+
/** Scale all the normals by -1. */
|
|
629
|
+
reverseNormals() {
|
|
630
|
+
if (this.normal)
|
|
631
|
+
this.normal.scaleInPlace(-1.0);
|
|
632
|
+
}
|
|
484
633
|
}
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
// <li>all arrays are (independently) indexed.
|
|
488
|
-
// <li>with regret, the point, param, normal, and color arrays are exposed publicly.
|
|
489
|
-
// <li>getX methods are "trusting" -- no bounds check
|
|
490
|
-
// <li>getX methods return references to X.
|
|
491
|
-
// <li> EXCEPT -- for optional arrays, the return 000.
|
|
492
|
-
// <li>copyX methods move data to caller-supplied result..
|
|
493
|
-
// </ul>
|
|
494
|
-
/** Relative tolerance used in tests for planar facets
|
|
634
|
+
/**
|
|
635
|
+
* Relative tolerance used in tests for planar facets.
|
|
495
636
|
* @internal
|
|
496
|
-
|
|
637
|
+
*/
|
|
497
638
|
PolyfaceData.planarityLocalRelTol = 1.0e-13;
|
|
498
639
|
export { PolyfaceData };
|
|
499
640
|
//# sourceMappingURL=PolyfaceData.js.map
|