@itwin/core-geometry 4.5.0-dev.4 → 4.5.0-dev.41
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 +67 -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.d.ts +16 -8
- package/lib/cjs/geometry3d/XYZProps.d.ts.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.d.ts +16 -8
- package/lib/esm/geometry3d/XYZProps.d.ts.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 +6 -4
|
@@ -18,35 +18,28 @@ const Range_1 = require("../geometry3d/Range");
|
|
|
18
18
|
const ClusterableArray_1 = require("../numerics/ClusterableArray");
|
|
19
19
|
const AuxData_1 = require("./AuxData");
|
|
20
20
|
const TaggedNumericData_1 = require("./TaggedNumericData");
|
|
21
|
+
// cspell:word internaldocs
|
|
21
22
|
/**
|
|
22
|
-
* PolyfaceData carries data arrays for point, normal,
|
|
23
|
-
*
|
|
24
|
-
* *
|
|
25
|
-
* *
|
|
26
|
-
* *
|
|
23
|
+
* `PolyfaceData` carries data arrays for point, normal, uv-parameters, and color, and index arrays for each.
|
|
24
|
+
* * Normal, uv-parameter, and color data are optional.
|
|
25
|
+
* * A given data array is defined if and only if its corresponding index array is defined.
|
|
26
|
+
* * All defined index arrays have parallel face loop order and structure, and thus the same length.
|
|
27
|
+
* * `IndexedPolyface` carries a PolyfaceData as a member (NOT as a base class; it already has `GeometryQuery` as base).
|
|
28
|
+
* * `IndexedPolyfaceVisitor` uses PolyfaceData as a base class. In this use, there is only a single facet in `PolyfaceData`.
|
|
29
|
+
* * `PolyfaceData` does not know what index range constitutes a given facet. This is managed by a derived/carrier class.
|
|
27
30
|
* @public
|
|
28
31
|
*/
|
|
29
32
|
class PolyfaceData {
|
|
30
|
-
/**
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
/** boolean tag indicating if the facets are viewable from the back */
|
|
38
|
-
get expectedClosure() { return this._expectedClosure; }
|
|
39
|
-
set expectedClosure(value) { this._expectedClosure = value; }
|
|
40
|
-
/** Constructor for facets.
|
|
41
|
-
* * The various params control whether respective arrays are to be allocated.
|
|
42
|
-
* * If arrayData is provided, all other params are IGNORED.
|
|
43
|
-
* *
|
|
33
|
+
/**
|
|
34
|
+
* Constructor for facets.
|
|
35
|
+
* @param needNormals `true` to allocate empty normal data and index arrays; `false` (default) to leave undefined.
|
|
36
|
+
* @param needParams `true` to allocate empty uv parameter data and index arrays; `false` (default) to leave undefined.
|
|
37
|
+
* @param needColors `true` to allocate empty color data and index arrays; `false` (default) to leave undefined.
|
|
38
|
+
* @param twoSided `true` if the facets are to be considered viewable from the back; `false` (default) if not.
|
|
44
39
|
*/
|
|
45
40
|
constructor(needNormals = false, needParams = false, needColors = false, twoSided = false) {
|
|
46
|
-
this.face = [];
|
|
47
41
|
this.point = new GrowableXYZArray_1.GrowableXYZArray();
|
|
48
42
|
this.pointIndex = [];
|
|
49
|
-
this.edgeVisible = [];
|
|
50
43
|
if (needNormals) {
|
|
51
44
|
this.normal = new GrowableXYZArray_1.GrowableXYZArray();
|
|
52
45
|
this.normalIndex = [];
|
|
@@ -59,6 +52,8 @@ class PolyfaceData {
|
|
|
59
52
|
this.color = [];
|
|
60
53
|
this.colorIndex = [];
|
|
61
54
|
}
|
|
55
|
+
this.face = [];
|
|
56
|
+
this.edgeVisible = [];
|
|
62
57
|
this._twoSided = twoSided;
|
|
63
58
|
this._expectedClosure = 0;
|
|
64
59
|
}
|
|
@@ -67,30 +62,29 @@ class PolyfaceData {
|
|
|
67
62
|
const result = new PolyfaceData();
|
|
68
63
|
result.point = this.point.clone();
|
|
69
64
|
result.pointIndex = this.pointIndex.slice();
|
|
70
|
-
result.edgeVisible = this.edgeVisible.slice();
|
|
71
|
-
result.face = this.face.slice();
|
|
72
|
-
result.twoSided = this.twoSided;
|
|
73
|
-
result.expectedClosure = this.expectedClosure;
|
|
74
65
|
if (this.normal)
|
|
75
66
|
result.normal = this.normal.clone();
|
|
76
|
-
if (this.param)
|
|
77
|
-
result.param = this.param.clone();
|
|
78
|
-
if (this.color)
|
|
79
|
-
result.color = this.color.slice();
|
|
80
67
|
if (this.normalIndex)
|
|
81
68
|
result.normalIndex = this.normalIndex.slice();
|
|
69
|
+
if (this.param)
|
|
70
|
+
result.param = this.param.clone();
|
|
82
71
|
if (this.paramIndex)
|
|
83
72
|
result.paramIndex = this.paramIndex.slice();
|
|
73
|
+
if (this.color)
|
|
74
|
+
result.color = this.color.slice();
|
|
84
75
|
if (this.colorIndex)
|
|
85
76
|
result.colorIndex = this.colorIndex.slice();
|
|
77
|
+
result.face = this.face.slice();
|
|
86
78
|
if (this.auxData)
|
|
87
79
|
result.auxData = this.auxData.clone();
|
|
88
|
-
if (this.taggedNumericData)
|
|
80
|
+
if (this.taggedNumericData)
|
|
89
81
|
result.taggedNumericData = this.taggedNumericData.clone();
|
|
90
|
-
|
|
82
|
+
result.edgeVisible = this.edgeVisible.slice();
|
|
83
|
+
result.twoSided = this.twoSided;
|
|
84
|
+
result.expectedClosure = this.expectedClosure;
|
|
91
85
|
return result;
|
|
92
86
|
}
|
|
93
|
-
/** Test for equal indices and nearly equal coordinates */
|
|
87
|
+
/** Test for equal indices and nearly equal coordinates. */
|
|
94
88
|
isAlmostEqual(other) {
|
|
95
89
|
if (!GrowableXYZArray_1.GrowableXYZArray.isAlmostEqual(this.point, other.point))
|
|
96
90
|
return false;
|
|
@@ -108,77 +102,133 @@ class PolyfaceData {
|
|
|
108
102
|
return false;
|
|
109
103
|
if (!PointHelpers_1.NumberArray.isExactEqual(this.colorIndex, other.colorIndex))
|
|
110
104
|
return false;
|
|
111
|
-
if (!PointHelpers_1.NumberArray.isExactEqual(this.edgeVisible, other.edgeVisible))
|
|
112
|
-
return false;
|
|
113
105
|
if (!AuxData_1.PolyfaceAuxData.isAlmostEqual(this.auxData, other.auxData))
|
|
114
106
|
return false;
|
|
107
|
+
if (!TaggedNumericData_1.TaggedNumericData.areAlmostEqual(this.taggedNumericData, other.taggedNumericData))
|
|
108
|
+
return false;
|
|
109
|
+
if (!PointHelpers_1.NumberArray.isExactEqual(this.edgeVisible, other.edgeVisible))
|
|
110
|
+
return false;
|
|
115
111
|
if (this.twoSided !== other.twoSided)
|
|
116
112
|
return false;
|
|
117
113
|
if (this.expectedClosure !== other.expectedClosure)
|
|
118
114
|
return false;
|
|
119
|
-
if (!TaggedNumericData_1.TaggedNumericData.areAlmostEqual(this.taggedNumericData, other.taggedNumericData))
|
|
120
|
-
return false;
|
|
121
115
|
return true;
|
|
122
116
|
}
|
|
123
117
|
/** Ask if normals are required in this mesh. */
|
|
124
|
-
get requireNormals() {
|
|
118
|
+
get requireNormals() {
|
|
119
|
+
return undefined !== this.normal;
|
|
120
|
+
}
|
|
121
|
+
/** Ask if params are required in this mesh. */
|
|
122
|
+
get requireParams() {
|
|
123
|
+
return undefined !== this.param;
|
|
124
|
+
}
|
|
125
|
+
/** Ask if colors are required in this mesh. */
|
|
126
|
+
get requireColors() {
|
|
127
|
+
return undefined !== this.color;
|
|
128
|
+
}
|
|
125
129
|
/** Get the point count */
|
|
126
|
-
get pointCount() {
|
|
130
|
+
get pointCount() {
|
|
131
|
+
return this.point.length;
|
|
132
|
+
}
|
|
127
133
|
/** Get the normal count */
|
|
128
|
-
get normalCount() {
|
|
134
|
+
get normalCount() {
|
|
135
|
+
return this.normal ? this.normal.length : 0;
|
|
136
|
+
}
|
|
129
137
|
/** Get the param count */
|
|
130
|
-
get paramCount() {
|
|
138
|
+
get paramCount() {
|
|
139
|
+
return this.param ? this.param.length : 0;
|
|
140
|
+
}
|
|
131
141
|
/** Get the color count */
|
|
132
|
-
get colorCount() {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
/** Get the
|
|
142
|
+
get colorCount() {
|
|
143
|
+
return this.color ? this.color.length : 0;
|
|
144
|
+
}
|
|
145
|
+
/** Get the index count. Note that the point array is always indexed, and index arrays all have the same length. */
|
|
146
|
+
get indexCount() {
|
|
147
|
+
return this.pointIndex.length;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Get the number of faces.
|
|
136
151
|
* * Note that a "face" is not a facet.
|
|
137
|
-
* * A
|
|
152
|
+
* * A face is a subset of the Polyface's facets grouped for application purposes.
|
|
138
153
|
*/
|
|
139
|
-
get faceCount() {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
|
|
156
|
-
this.
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
154
|
+
get faceCount() {
|
|
155
|
+
return this.face.length;
|
|
156
|
+
}
|
|
157
|
+
/** Return indexed point at index `i`. This is a COPY of the coordinates, not a reference. */
|
|
158
|
+
getPoint(i, result) {
|
|
159
|
+
return this.point.getPoint3dAtCheckedPointIndex(i, result);
|
|
160
|
+
}
|
|
161
|
+
/** Return indexed normal at index `i`. This is a COPY of the normal, not a reference. */
|
|
162
|
+
getNormal(i, result) {
|
|
163
|
+
return this.normal ? this.normal.getVector3dAtCheckedVectorIndex(i, result) : undefined;
|
|
164
|
+
}
|
|
165
|
+
/** Return indexed param at index `i`. This is a COPY of the coordinates, not a reference. */
|
|
166
|
+
getParam(i, result) {
|
|
167
|
+
return this.param ? this.param.getPoint2dAtCheckedPointIndex(i, result) : undefined;
|
|
168
|
+
}
|
|
169
|
+
/** Return indexed color at index `i`. Index `i` is not checked for validity. */
|
|
170
|
+
getColor(i) {
|
|
171
|
+
return this.color ? this.color[i] : 0;
|
|
172
|
+
}
|
|
173
|
+
/** Return indexed visibility. at index `i`. Index `i` is not checked for validity. */
|
|
174
|
+
getEdgeVisible(i) {
|
|
175
|
+
return this.edgeVisible[i];
|
|
176
|
+
}
|
|
177
|
+
/** Get boolean tag indicating if the facets are to be considered viewable from the back. */
|
|
178
|
+
get twoSided() {
|
|
179
|
+
return this._twoSided;
|
|
180
|
+
}
|
|
181
|
+
set twoSided(value) {
|
|
182
|
+
this._twoSided = value;
|
|
183
|
+
}
|
|
184
|
+
/** Get flag indicating if the mesh closure is unknown (0), open sheet (1), closed solid (2). */
|
|
185
|
+
get expectedClosure() {
|
|
186
|
+
return this._expectedClosure;
|
|
187
|
+
}
|
|
188
|
+
set expectedClosure(value) {
|
|
189
|
+
this._expectedClosure = value;
|
|
190
|
+
}
|
|
191
|
+
/** Set the tagged geometry data. */
|
|
192
|
+
setTaggedNumericData(data) {
|
|
193
|
+
this.taggedNumericData = data;
|
|
194
|
+
}
|
|
195
|
+
/** Copy the contents (not pointer) of `point[i]` into `dest`. Index `i` is not checked for validity. */
|
|
196
|
+
copyPointTo(i, dest) {
|
|
197
|
+
this.point.getPoint3dAtUncheckedPointIndex(i, dest);
|
|
198
|
+
}
|
|
199
|
+
/** Copy the contents (not pointer) of `normal[i]` into `dest`. Index `i` is not checked for validity. */
|
|
200
|
+
copyNormalTo(i, dest) {
|
|
201
|
+
if (this.normal)
|
|
202
|
+
this.normal.getVector3dAtUncheckedVectorIndex(i, dest);
|
|
203
|
+
}
|
|
204
|
+
/** Copy the contents (not pointer) of `param[i]` into `dest`. Index `i` is not checked for validity. */
|
|
205
|
+
copyParamTo(i, dest) {
|
|
206
|
+
if (this.param)
|
|
207
|
+
this.param.getPoint2dAtUncheckedPointIndex(i, dest);
|
|
208
|
+
}
|
|
209
|
+
/** Test if param at a index `i` matches the given uv */
|
|
210
|
+
isAlmostEqualParamIndexUV(i, u, v) {
|
|
211
|
+
if (this.param !== undefined && i >= 0 && i < this.param.length)
|
|
212
|
+
return Geometry_1.Geometry.isSameCoordinate(u, this.param.getXAtUncheckedPointIndex(i))
|
|
213
|
+
&& Geometry_1.Geometry.isSameCoordinate(v, this.param.getYAtUncheckedPointIndex(i));
|
|
165
214
|
return false;
|
|
166
215
|
}
|
|
167
216
|
/**
|
|
168
|
-
*
|
|
217
|
+
* Copy data from `other` to `this`.
|
|
169
218
|
* * This is the essence of transferring coordinates spread throughout a large polyface into a visitor's single facet.
|
|
170
|
-
* * "other" is the
|
|
171
|
-
* *
|
|
172
|
-
* * does NOT copy face data - visitors reference the FacetFaceData array for the whole polyface!!
|
|
219
|
+
* * Common usage: "other" is a Polyface, "this" is a PolyfaceVisitor to receive data from a single facet of the Polyface.
|
|
220
|
+
* * Does NOT copy face data - visitors reference the FacetFaceData array for the whole polyface.
|
|
173
221
|
* @param other polyface data being mined.
|
|
174
|
-
* @param index0 start index in other's index arrays
|
|
175
|
-
* @param index1 end index (one beyond last data
|
|
222
|
+
* @param index0 start index in other's index arrays.
|
|
223
|
+
* @param index1 end index (one beyond last data accessed) in other's index arrays.
|
|
176
224
|
* @param numWrap number of points to replicate as wraparound.
|
|
177
225
|
*/
|
|
178
226
|
gatherIndexedData(other, index0, index1, numWrap) {
|
|
179
227
|
const numEdge = index1 - index0;
|
|
228
|
+
if (numWrap > numEdge)
|
|
229
|
+
numWrap = numEdge;
|
|
180
230
|
const numTotal = numEdge + numWrap;
|
|
181
|
-
this.
|
|
231
|
+
this.resizeAllArrays(numTotal);
|
|
182
232
|
// copy wrapped points
|
|
183
233
|
for (let i = 0; i < numEdge; i++)
|
|
184
234
|
this.point.transferFromGrowableXYZArray(i, other.point, other.pointIndex[index0 + i]);
|
|
@@ -189,41 +239,48 @@ class PolyfaceData {
|
|
|
189
239
|
this.pointIndex[i] = other.pointIndex[index0 + i];
|
|
190
240
|
for (let i = 0; i < numWrap; i++)
|
|
191
241
|
this.pointIndex[numEdge + i] = this.pointIndex[i];
|
|
192
|
-
// copy wrapped
|
|
193
|
-
for (let i = 0; i < numEdge; i++)
|
|
194
|
-
this.edgeVisible[i] = other.edgeVisible[index0 + i];
|
|
195
|
-
for (let i = 0; i < numWrap; i++)
|
|
196
|
-
this.edgeVisible[numEdge + i] = this.edgeVisible[i];
|
|
242
|
+
// copy wrapped normals
|
|
197
243
|
if (this.normal && this.normalIndex && other.normal && other.normalIndex) {
|
|
198
244
|
for (let i = 0; i < numEdge; i++)
|
|
199
245
|
this.normal.transferFromGrowableXYZArray(i, other.normal, other.normalIndex[index0 + i]);
|
|
200
246
|
for (let i = 0; i < numWrap; i++)
|
|
201
247
|
this.normal.transferFromGrowableXYZArray(numEdge + i, this.normal, i);
|
|
248
|
+
// copy wrapped normalIndex
|
|
202
249
|
for (let i = 0; i < numEdge; i++)
|
|
203
250
|
this.normalIndex[i] = other.normalIndex[index0 + i];
|
|
204
251
|
for (let i = 0; i < numWrap; i++)
|
|
205
252
|
this.normalIndex[numEdge + i] = this.normalIndex[i];
|
|
206
253
|
}
|
|
254
|
+
// copy wrapped params
|
|
207
255
|
if (this.param && this.paramIndex && other.param && other.paramIndex) {
|
|
208
256
|
for (let i = 0; i < numEdge; i++)
|
|
209
257
|
this.param.transferFromGrowableXYArray(i, other.param, other.paramIndex[index0 + i]);
|
|
210
258
|
for (let i = 0; i < numWrap; i++)
|
|
211
259
|
this.param.transferFromGrowableXYArray(numEdge + i, this.param, i);
|
|
260
|
+
// copy wrapped paramIndex
|
|
212
261
|
for (let i = 0; i < numEdge; i++)
|
|
213
262
|
this.paramIndex[i] = other.paramIndex[index0 + i];
|
|
214
263
|
for (let i = 0; i < numWrap; i++)
|
|
215
264
|
this.paramIndex[numEdge + i] = this.paramIndex[i];
|
|
216
265
|
}
|
|
266
|
+
// copy wrapped colors
|
|
217
267
|
if (this.color && this.colorIndex && other.color && other.colorIndex) {
|
|
218
268
|
for (let i = 0; i < numEdge; i++)
|
|
219
269
|
this.color[i] = other.color[other.colorIndex[index0 + i]];
|
|
220
270
|
for (let i = 0; i < numWrap; i++)
|
|
221
271
|
this.color[numEdge + i] = this.color[i];
|
|
272
|
+
// copy wrapped colorIndex
|
|
222
273
|
for (let i = 0; i < numEdge; i++)
|
|
223
274
|
this.colorIndex[i] = other.colorIndex[index0 + i];
|
|
224
275
|
for (let i = 0; i < numWrap; i++)
|
|
225
276
|
this.colorIndex[numEdge + i] = this.colorIndex[i];
|
|
226
277
|
}
|
|
278
|
+
// copy wrapped edge visibility
|
|
279
|
+
for (let i = 0; i < numEdge; i++)
|
|
280
|
+
this.edgeVisible[i] = other.edgeVisible[index0 + i];
|
|
281
|
+
for (let i = 0; i < numWrap; i++)
|
|
282
|
+
this.edgeVisible[numEdge + i] = this.edgeVisible[i];
|
|
283
|
+
// copy wrapped auxData
|
|
227
284
|
if (this.auxData && other.auxData && this.auxData.channels.length === other.auxData.channels.length) {
|
|
228
285
|
for (let iChannel = 0; iChannel < this.auxData.channels.length; iChannel++) {
|
|
229
286
|
const thisChannel = this.auxData.channels[iChannel];
|
|
@@ -240,15 +297,20 @@ class PolyfaceData {
|
|
|
240
297
|
}
|
|
241
298
|
}
|
|
242
299
|
}
|
|
300
|
+
// copy wrapped auxData index
|
|
243
301
|
for (let i = 0; i < numEdge; i++)
|
|
244
302
|
this.auxData.indices[i] = other.auxData.indices[index0 + i];
|
|
245
303
|
for (let i = 0; i < numWrap; i++)
|
|
246
304
|
this.auxData.indices[numEdge + i] = this.auxData.indices[i];
|
|
247
305
|
}
|
|
248
306
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
307
|
+
/** Trim the `data` arrays to the stated `length`. */
|
|
308
|
+
static trimArray(data, length) {
|
|
309
|
+
if (data && length < data.length)
|
|
310
|
+
data.length = length;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Trim all index arrays to the stated `length`.
|
|
252
314
|
* * This is called by PolyfaceBuilder to clean up after an aborted construction sequence.
|
|
253
315
|
*/
|
|
254
316
|
trimAllIndexArrays(length) {
|
|
@@ -265,7 +327,78 @@ class PolyfaceData {
|
|
|
265
327
|
}
|
|
266
328
|
}
|
|
267
329
|
}
|
|
268
|
-
/**
|
|
330
|
+
/**
|
|
331
|
+
* Resize all data and index arrays to the specified `length`.
|
|
332
|
+
* * This is used by visitors, whose data and index arrays are all parallel.
|
|
333
|
+
*/
|
|
334
|
+
resizeAllArrays(length) {
|
|
335
|
+
if (length > this.point.length) {
|
|
336
|
+
while (this.point.length < length)
|
|
337
|
+
this.point.push(Point3dVector3d_1.Point3d.create());
|
|
338
|
+
while (this.pointIndex.length < length)
|
|
339
|
+
this.pointIndex.push(-1);
|
|
340
|
+
if (this.normal)
|
|
341
|
+
while (this.normal.length < length)
|
|
342
|
+
this.normal.push(Point3dVector3d_1.Vector3d.create());
|
|
343
|
+
if (this.normalIndex)
|
|
344
|
+
while (this.normalIndex.length < length)
|
|
345
|
+
this.normalIndex.push(-1);
|
|
346
|
+
if (this.param)
|
|
347
|
+
while (this.param.length < length)
|
|
348
|
+
this.param.push(Point2dVector2d_1.Point2d.create());
|
|
349
|
+
if (this.paramIndex)
|
|
350
|
+
while (this.paramIndex.length < length)
|
|
351
|
+
this.paramIndex.push(-1);
|
|
352
|
+
if (this.color)
|
|
353
|
+
while (this.color.length < length)
|
|
354
|
+
this.color.push(0);
|
|
355
|
+
if (this.colorIndex)
|
|
356
|
+
while (this.colorIndex.length < length)
|
|
357
|
+
this.colorIndex.push(-1);
|
|
358
|
+
while (this.edgeVisible.length < length)
|
|
359
|
+
this.edgeVisible.push(false);
|
|
360
|
+
if (this.auxData) {
|
|
361
|
+
for (const channel of this.auxData.channels) {
|
|
362
|
+
for (const channelData of channel.data) {
|
|
363
|
+
while (channelData.values.length < length * channel.entriesPerValue)
|
|
364
|
+
channelData.values.push(0);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
if (this.auxData.indices)
|
|
368
|
+
this.auxData.indices.push(-1);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
else if (length < this.point.length) {
|
|
372
|
+
this.point.resize(length);
|
|
373
|
+
this.pointIndex.length = length;
|
|
374
|
+
if (this.normal)
|
|
375
|
+
this.normal.resize(length);
|
|
376
|
+
if (this.normalIndex)
|
|
377
|
+
this.normalIndex.length = length;
|
|
378
|
+
if (this.param)
|
|
379
|
+
this.param.resize(length);
|
|
380
|
+
if (this.paramIndex)
|
|
381
|
+
this.paramIndex.length = length;
|
|
382
|
+
if (this.color)
|
|
383
|
+
this.color.length = length;
|
|
384
|
+
if (this.colorIndex)
|
|
385
|
+
this.colorIndex.length = length;
|
|
386
|
+
this.edgeVisible.length = length;
|
|
387
|
+
if (this.auxData) {
|
|
388
|
+
for (const channel of this.auxData.channels) {
|
|
389
|
+
for (const channelData of channel.data) {
|
|
390
|
+
channelData.values.length = length * channel.entriesPerValue;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
if (this.auxData.indices)
|
|
394
|
+
this.auxData.indices.length = length;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Resize all data arrays to the specified `length`.
|
|
400
|
+
* @deprecated in 4.x because name is misleading. Call [[PolyfaceData.resizeAllArrays]] instead.
|
|
401
|
+
*/
|
|
269
402
|
resizeAllDataArrays(length) {
|
|
270
403
|
if (length > this.point.length) {
|
|
271
404
|
while (this.point.length < length)
|
|
@@ -311,56 +444,16 @@ class PolyfaceData {
|
|
|
311
444
|
}
|
|
312
445
|
}
|
|
313
446
|
}
|
|
314
|
-
/** Return the range of the point array (optionally transformed) */
|
|
447
|
+
/** Return the range of the point array (optionally transformed). */
|
|
315
448
|
range(result, transform) {
|
|
316
449
|
result = result ? result : Range_1.Range3d.createNull();
|
|
317
450
|
result.extendArray(this.point, transform);
|
|
318
451
|
return result;
|
|
319
452
|
}
|
|
320
|
-
/**
|
|
321
|
-
*
|
|
322
|
-
* *
|
|
323
|
-
*
|
|
324
|
-
* * hence for "internal" k, facetStartIndex[k] is both the upper limit of facet k-1 and the start of facet k.
|
|
325
|
-
* *
|
|
326
|
-
*/
|
|
327
|
-
reverseIndices(facetStartIndex) {
|
|
328
|
-
if (facetStartIndex && PolyfaceData.isValidFacetStartIndexArray(facetStartIndex)) {
|
|
329
|
-
PolyfaceData.reverseIndices(facetStartIndex, this.pointIndex, true);
|
|
330
|
-
if (this.normalIndex !== this.pointIndex)
|
|
331
|
-
PolyfaceData.reverseIndices(facetStartIndex, this.normalIndex, true);
|
|
332
|
-
if (this.paramIndex !== this.pointIndex)
|
|
333
|
-
PolyfaceData.reverseIndices(facetStartIndex, this.paramIndex, true);
|
|
334
|
-
if (this.colorIndex !== this.pointIndex)
|
|
335
|
-
PolyfaceData.reverseIndices(facetStartIndex, this.colorIndex, true);
|
|
336
|
-
PolyfaceData.reverseIndices(facetStartIndex, this.edgeVisible, false);
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
/** reverse indices facet-by-facet, with the given facetStartIndex array delimiting faces.
|
|
340
|
-
*
|
|
341
|
-
* * facetStartIndex[0] == 0 always -- start of facet zero.
|
|
342
|
-
* * facet k has indices from facetStartIndex[k] <= i < facetStartIndex[k+1]
|
|
343
|
-
* * hence for "internal" k, facetStartIndex[k] is both the upper limit of facet k-1 and the start of facet k.
|
|
344
|
-
* *
|
|
345
|
-
*/
|
|
346
|
-
reverseIndicesSingleFacet(facetId, facetStartIndex) {
|
|
347
|
-
PolyfaceData.reverseIndicesSingleFacet(facetId, facetStartIndex, this.pointIndex, true);
|
|
348
|
-
if (this.normalIndex !== this.pointIndex)
|
|
349
|
-
PolyfaceData.reverseIndicesSingleFacet(facetId, facetStartIndex, this.normalIndex, true);
|
|
350
|
-
if (this.paramIndex !== this.pointIndex)
|
|
351
|
-
PolyfaceData.reverseIndicesSingleFacet(facetId, facetStartIndex, this.paramIndex, true);
|
|
352
|
-
if (this.colorIndex !== this.pointIndex)
|
|
353
|
-
PolyfaceData.reverseIndicesSingleFacet(facetId, facetStartIndex, this.colorIndex, true);
|
|
354
|
-
PolyfaceData.reverseIndicesSingleFacet(facetId, facetStartIndex, this.edgeVisible, false);
|
|
355
|
-
}
|
|
356
|
-
/** Scale all the normals by -1 */
|
|
357
|
-
reverseNormals() {
|
|
358
|
-
if (this.normal)
|
|
359
|
-
this.normal.scaleInPlace(-1.0);
|
|
360
|
-
}
|
|
361
|
-
/** Apply `transform` to point and normal arrays and to auxData.
|
|
362
|
-
* * IMPORTANT This base class is just a data carrier. It does not know if the index order and normal directions have special meaning.
|
|
363
|
-
* * i.e. caller must separately reverse index order and normal direction if needed.
|
|
453
|
+
/**
|
|
454
|
+
* Apply `transform` to point and normal arrays and to auxData.
|
|
455
|
+
* * IMPORTANT This base class is just a data carrier. It does not know if the index order and normal directions
|
|
456
|
+
* have special meaning, i.e., caller must separately reverse index order and normal direction if needed.
|
|
364
457
|
*/
|
|
365
458
|
tryTransformInPlace(transform) {
|
|
366
459
|
this.point.multiplyTransformInPlace(transform);
|
|
@@ -373,13 +466,14 @@ class PolyfaceData {
|
|
|
373
466
|
* * Search for duplicates within points, normals, params, and colors.
|
|
374
467
|
* * Compress each data array.
|
|
375
468
|
* * Revise all indexing for the relocated data.
|
|
376
|
-
* @param tolerance optional tolerance for clustering mesh vertices. Default is [[Geometry.smallMetricDistance]].
|
|
469
|
+
* @param tolerance (optional) tolerance for clustering mesh vertices. Default is [[Geometry.smallMetricDistance]].
|
|
377
470
|
*/
|
|
378
471
|
compress(tolerance = Geometry_1.Geometry.smallMetricDistance) {
|
|
472
|
+
// more info can be found at geometry/internaldocs/Polyface.md
|
|
379
473
|
const packedPoints = ClusterableArray_1.ClusterableArray.clusterGrowablePoint3dArray(this.point, tolerance);
|
|
380
474
|
this.point = packedPoints.growablePackedPoints;
|
|
381
475
|
packedPoints.updateIndices(this.pointIndex);
|
|
382
|
-
// for now, normals, params, and colors use the default tolerance for clustering
|
|
476
|
+
// for now, normals, params, and colors use the default tolerance for clustering
|
|
383
477
|
if (this.normalIndex && this.normal) {
|
|
384
478
|
const packedNormals = ClusterableArray_1.ClusterableArray.clusterGrowablePoint3dArray(this.normal);
|
|
385
479
|
this.normal = packedNormals.growablePackedPoints;
|
|
@@ -397,10 +491,11 @@ class PolyfaceData {
|
|
|
397
491
|
}
|
|
398
492
|
}
|
|
399
493
|
/**
|
|
400
|
-
* Test if facetStartIndex is (minimally
|
|
401
|
-
* *
|
|
494
|
+
* Test if `facetStartIndex` is (minimally) valid.
|
|
495
|
+
* * Length must be nonzero (recall that for "no facets", the `facetStartIndex` array still must contain a 0).
|
|
402
496
|
* * Each entry must be strictly smaller than the one that follows.
|
|
403
|
-
* @param facetStartIndex
|
|
497
|
+
* @param facetStartIndex start indices of all facets. Facet k starts at facetStartIndex[k] up to (but not including)
|
|
498
|
+
* `facetStartIndex[k + 1]`
|
|
404
499
|
*/
|
|
405
500
|
static isValidFacetStartIndexArray(facetStartIndex) {
|
|
406
501
|
// facetStartIndex for empty facets has a single entry "0" -- empty array is not allowed
|
|
@@ -411,8 +506,14 @@ class PolyfaceData {
|
|
|
411
506
|
return false;
|
|
412
507
|
return true;
|
|
413
508
|
}
|
|
414
|
-
/**
|
|
415
|
-
*
|
|
509
|
+
/**
|
|
510
|
+
* Reverse the indices for the specified facets in the given index array.
|
|
511
|
+
* * Parameterized over type T so non-number data (e.g., boolean visibility flags) can be reversed.
|
|
512
|
+
* @param facetStartIndex start indices of *consecutive* facets to be reversed, e.g., an IndexedPolyface's _facetStart
|
|
513
|
+
* array. See the non-static [[reverseIndices]].
|
|
514
|
+
* @param indices the index array, e.g., pointIndex, normalIndex, etc.
|
|
515
|
+
* @param preserveStart `true` to preserve the start index of each facet (e.g., facet [1,2,3,4] becomes [1,4,3,2]);
|
|
516
|
+
* `false` to reverse all indices (e.g., facet [1,2,3,4] becomes [4,3,2,1]).
|
|
416
517
|
*/
|
|
417
518
|
static reverseIndices(facetStartIndex, indices, preserveStart) {
|
|
418
519
|
if (!indices || indices.length === 0)
|
|
@@ -422,8 +523,7 @@ class PolyfaceData {
|
|
|
422
523
|
for (let i = 0; i + 1 < facetStartIndex.length; i++) {
|
|
423
524
|
let index0 = facetStartIndex[i];
|
|
424
525
|
let index1 = facetStartIndex[i + 1];
|
|
425
|
-
if (preserveStart) {
|
|
426
|
-
// leave [index0] as is so reversed facet starts at same vertex
|
|
526
|
+
if (preserveStart) { // leave "index0" as is so reversed facet starts at same vertex
|
|
427
527
|
while (index1 > index0 + 2) {
|
|
428
528
|
index1--;
|
|
429
529
|
index0++;
|
|
@@ -432,8 +532,7 @@ class PolyfaceData {
|
|
|
432
532
|
indices[index1] = a;
|
|
433
533
|
}
|
|
434
534
|
}
|
|
435
|
-
else {
|
|
436
|
-
// reverse all
|
|
535
|
+
else { // reverse all
|
|
437
536
|
while (index1 > index0 + 1) {
|
|
438
537
|
index1--;
|
|
439
538
|
const a = indices[index0];
|
|
@@ -448,19 +547,26 @@ class PolyfaceData {
|
|
|
448
547
|
}
|
|
449
548
|
return false;
|
|
450
549
|
}
|
|
451
|
-
/**
|
|
452
|
-
*
|
|
550
|
+
/**
|
|
551
|
+
* Reverse the indices for the specified facet in the specified index array.
|
|
552
|
+
* * Parameterized over type T so non-number data (e.g., boolean visibility flags) can be reversed.
|
|
553
|
+
* @param facetIndex index of the facet to reverse. The entries of `indices` to be reversed are found at
|
|
554
|
+
* `facetStartIndex[facetIndex] <= i < facetStartIndex[facetIndex + 1]`.
|
|
555
|
+
* @param facetStartIndex start indices of *consecutive* facets, e.g., an IndexedPolyface's _facetStart array.
|
|
556
|
+
* See [[reverseIndices]].
|
|
557
|
+
* @param indices the index array, e.g., pointIndex, normalIndex, etc.
|
|
558
|
+
* @param preserveStart `true` to preserve the start index of each facet (e.g., facet [1,2,3,4] becomes [1,4,3,2]);
|
|
559
|
+
* `false` to reverse all indices (e.g., facet [1,2,3,4] becomes [4,3,2,1]).
|
|
453
560
|
*/
|
|
454
|
-
static reverseIndicesSingleFacet(
|
|
561
|
+
static reverseIndicesSingleFacet(facetIndex, facetStartIndex, indices, preserveStart) {
|
|
455
562
|
if (!indices || indices.length === 0)
|
|
456
563
|
return true; // empty case
|
|
457
564
|
if (indices.length > 0) {
|
|
458
565
|
if (facetStartIndex[facetStartIndex.length - 1] === indices.length
|
|
459
|
-
&&
|
|
460
|
-
let index0 = facetStartIndex[
|
|
461
|
-
let index1 = facetStartIndex[
|
|
462
|
-
if (preserveStart) {
|
|
463
|
-
// leave [index0] as is so reversed facet starts at same vertex
|
|
566
|
+
&& facetIndex >= 0 && facetIndex + 1 < facetStartIndex.length) {
|
|
567
|
+
let index0 = facetStartIndex[facetIndex];
|
|
568
|
+
let index1 = facetStartIndex[facetIndex + 1];
|
|
569
|
+
if (preserveStart) { // leave "index0" as is so reversed facet starts at same vertex
|
|
464
570
|
while (index1 > index0 + 2) {
|
|
465
571
|
index1--;
|
|
466
572
|
index0++;
|
|
@@ -469,8 +575,7 @@ class PolyfaceData {
|
|
|
469
575
|
indices[index1] = a;
|
|
470
576
|
}
|
|
471
577
|
}
|
|
472
|
-
else {
|
|
473
|
-
// reverse all
|
|
578
|
+
else { // reverse all
|
|
474
579
|
while (index1 > index0 + 1) {
|
|
475
580
|
index1--;
|
|
476
581
|
const a = indices[index0];
|
|
@@ -484,19 +589,55 @@ class PolyfaceData {
|
|
|
484
589
|
}
|
|
485
590
|
return false;
|
|
486
591
|
}
|
|
592
|
+
/**
|
|
593
|
+
* Reverse the indices for the specified facets in the index arrays (pointIndex, normalIndex, paramIndex, colorIndex,
|
|
594
|
+
* and edgeVisible).
|
|
595
|
+
* @param facetStartIndex start indices of *consecutive* facets to be reversed.
|
|
596
|
+
* * Consecutive indices in this array define where a given facet is represented in each of the parallel index arrays.
|
|
597
|
+
* * The indices for facet k are `facetStartIndex[k]` up to (but not including) `facetStartIndex[k + 1]`.
|
|
598
|
+
* * This implies `facetStartIndex[k + 1]` is both the upper limit of facet k's indices, and the start index of facet k+1.
|
|
599
|
+
* * For example, passing an IndexedPolyface's _facetStart array into this method reverses every facet.
|
|
600
|
+
*/
|
|
601
|
+
reverseIndices(facetStartIndex) {
|
|
602
|
+
if (facetStartIndex && PolyfaceData.isValidFacetStartIndexArray(facetStartIndex)) {
|
|
603
|
+
PolyfaceData.reverseIndices(facetStartIndex, this.pointIndex, true);
|
|
604
|
+
if (this.normalIndex !== this.pointIndex)
|
|
605
|
+
PolyfaceData.reverseIndices(facetStartIndex, this.normalIndex, true);
|
|
606
|
+
if (this.paramIndex !== this.pointIndex)
|
|
607
|
+
PolyfaceData.reverseIndices(facetStartIndex, this.paramIndex, true);
|
|
608
|
+
if (this.colorIndex !== this.pointIndex)
|
|
609
|
+
PolyfaceData.reverseIndices(facetStartIndex, this.colorIndex, true);
|
|
610
|
+
PolyfaceData.reverseIndices(facetStartIndex, this.edgeVisible, false);
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* Reverse the indices for the specified facet in the index arrays (pointIndex, normalIndex, paramIndex, colorIndex,
|
|
615
|
+
* and edgeVisible).
|
|
616
|
+
* @param facetIndex index of the facet to reverse. The entries of each index array to be reversed are found at
|
|
617
|
+
* `facetStartIndex[facetIndex] <= i < facetStartIndex[facetIndex + 1]`.
|
|
618
|
+
* @param facetStartIndex start indices of *consecutive* facets, e.g., an IndexedPolyface's _facetStart array.
|
|
619
|
+
* See [[reverseIndices]].
|
|
620
|
+
*/
|
|
621
|
+
reverseIndicesSingleFacet(facetIndex, facetStartIndex) {
|
|
622
|
+
PolyfaceData.reverseIndicesSingleFacet(facetIndex, facetStartIndex, this.pointIndex, true);
|
|
623
|
+
if (this.normalIndex !== this.pointIndex)
|
|
624
|
+
PolyfaceData.reverseIndicesSingleFacet(facetIndex, facetStartIndex, this.normalIndex, true);
|
|
625
|
+
if (this.paramIndex !== this.pointIndex)
|
|
626
|
+
PolyfaceData.reverseIndicesSingleFacet(facetIndex, facetStartIndex, this.paramIndex, true);
|
|
627
|
+
if (this.colorIndex !== this.pointIndex)
|
|
628
|
+
PolyfaceData.reverseIndicesSingleFacet(facetIndex, facetStartIndex, this.colorIndex, true);
|
|
629
|
+
PolyfaceData.reverseIndicesSingleFacet(facetIndex, facetStartIndex, this.edgeVisible, false);
|
|
630
|
+
}
|
|
631
|
+
/** Scale all the normals by -1. */
|
|
632
|
+
reverseNormals() {
|
|
633
|
+
if (this.normal)
|
|
634
|
+
this.normal.scaleInPlace(-1.0);
|
|
635
|
+
}
|
|
487
636
|
}
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
// <li>all arrays are (independently) indexed.
|
|
491
|
-
// <li>with regret, the point, param, normal, and color arrays are exposed publicly.
|
|
492
|
-
// <li>getX methods are "trusting" -- no bounds check
|
|
493
|
-
// <li>getX methods return references to X.
|
|
494
|
-
// <li> EXCEPT -- for optional arrays, the return 000.
|
|
495
|
-
// <li>copyX methods move data to caller-supplied result..
|
|
496
|
-
// </ul>
|
|
497
|
-
/** Relative tolerance used in tests for planar facets
|
|
637
|
+
/**
|
|
638
|
+
* Relative tolerance used in tests for planar facets.
|
|
498
639
|
* @internal
|
|
499
|
-
|
|
640
|
+
*/
|
|
500
641
|
PolyfaceData.planarityLocalRelTol = 1.0e-13;
|
|
501
642
|
exports.PolyfaceData = PolyfaceData;
|
|
502
643
|
//# sourceMappingURL=PolyfaceData.js.map
|