@itwin/core-geometry 4.7.0-dev.7 → 4.7.0-dev.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/Constant.js.map +1 -1
- 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.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.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.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.d.ts +7 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +20 -4
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js +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.map +1 -1
- package/lib/cjs/curve/spiral/NormalizedTransition.js.map +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.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.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.d.ts +3 -3
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +4 -3
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.d.ts +7 -0
- package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js +19 -0
- 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.d.ts +18 -10
- package/lib/cjs/polyface/AuxData.d.ts.map +1 -1
- package/lib/cjs/polyface/AuxData.js +24 -12
- 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 +2 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +2 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/cjs/polyface/Polyface.d.ts +10 -2
- package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
- package/lib/cjs/polyface/Polyface.js +29 -17
- package/lib/cjs/polyface/Polyface.js.map +1 -1
- 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 +10 -9
- package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.js +17 -2
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts +302 -251
- package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +363 -309
- 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.d.ts +18 -20
- package/lib/cjs/serialization/BGFBReader.d.ts.map +1 -1
- package/lib/cjs/serialization/BGFBReader.js +119 -84
- package/lib/cjs/serialization/BGFBReader.js.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.d.ts +1 -1
- package/lib/cjs/serialization/BGFBWriter.d.ts.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.js +10 -15
- 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.d.ts +52 -7
- package/lib/cjs/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js +26 -78
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/serialization/SerializationHelpers.d.ts +17 -0
- package/lib/cjs/serialization/SerializationHelpers.d.ts.map +1 -1
- package/lib/cjs/serialization/SerializationHelpers.js +85 -0
- 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.d.ts +1 -0
- package/lib/cjs/solid/Sphere.d.ts.map +1 -1
- package/lib/cjs/solid/Sphere.js +4 -2
- 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.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.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.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.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.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.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.d.ts +7 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +20 -4
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js +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.map +1 -1
- package/lib/esm/curve/spiral/NormalizedTransition.js.map +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.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.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.d.ts +3 -3
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +4 -3
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.d.ts +7 -0
- package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js +19 -0
- 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.d.ts +18 -10
- package/lib/esm/polyface/AuxData.d.ts.map +1 -1
- package/lib/esm/polyface/AuxData.js +24 -12
- 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 +2 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js +2 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/esm/polyface/Polyface.d.ts +10 -2
- package/lib/esm/polyface/Polyface.d.ts.map +1 -1
- package/lib/esm/polyface/Polyface.js +29 -17
- package/lib/esm/polyface/Polyface.js.map +1 -1
- 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 +10 -9
- package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceData.js +17 -2
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts +302 -251
- package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +363 -309
- 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.d.ts +18 -20
- package/lib/esm/serialization/BGFBReader.d.ts.map +1 -1
- package/lib/esm/serialization/BGFBReader.js +119 -84
- package/lib/esm/serialization/BGFBReader.js.map +1 -1
- package/lib/esm/serialization/BGFBWriter.d.ts +1 -1
- package/lib/esm/serialization/BGFBWriter.d.ts.map +1 -1
- package/lib/esm/serialization/BGFBWriter.js +10 -15
- 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.d.ts +52 -7
- package/lib/esm/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js +26 -78
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/serialization/SerializationHelpers.d.ts +17 -0
- package/lib/esm/serialization/SerializationHelpers.d.ts.map +1 -1
- package/lib/esm/serialization/SerializationHelpers.js +85 -0
- 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.d.ts +1 -0
- package/lib/esm/solid/Sphere.d.ts.map +1 -1
- package/lib/esm/solid/Sphere.js +4 -2
- 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.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.js.map +1 -1
- package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
- package/package.json +3 -3
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* @module Polyface
|
|
7
7
|
*/
|
|
8
8
|
/* eslint-disable @typescript-eslint/naming-convention, no-empty */
|
|
9
|
+
// cspell:word internaldocs
|
|
9
10
|
import { BagOfCurves } from "../curve/CurveCollection";
|
|
10
11
|
import { CurveOps } from "../curve/CurveOps";
|
|
11
12
|
import { MultiChainCollector } from "../curve/internalContexts/MultiChainCollector";
|
|
@@ -48,8 +49,7 @@ import { RangeLengthData } from "./RangeLengthData";
|
|
|
48
49
|
* @public
|
|
49
50
|
*/
|
|
50
51
|
export class SweepLineStringToFacetsOptions {
|
|
51
|
-
/**
|
|
52
|
-
*/
|
|
52
|
+
/** Constructor. Captures fully-checked parameters from static create method. */
|
|
53
53
|
constructor(vectorToEye, sideAngle, assembleChains, collectOnForwardFacets, collectOnSideFacets, collectOnRearFacets) {
|
|
54
54
|
this.vectorToEye = vectorToEye;
|
|
55
55
|
this.sideAngle = sideAngle;
|
|
@@ -58,20 +58,27 @@ export class SweepLineStringToFacetsOptions {
|
|
|
58
58
|
this.collectOnSideFacets = collectOnSideFacets;
|
|
59
59
|
this.collectOnRearFacets = collectOnRearFacets;
|
|
60
60
|
}
|
|
61
|
-
/**
|
|
62
|
-
*
|
|
63
|
-
* * Default
|
|
64
|
-
* * Default
|
|
65
|
-
* * Default
|
|
61
|
+
/**
|
|
62
|
+
* Create an options structure.
|
|
63
|
+
* * Default `vectorToEye` is (0,0,1).
|
|
64
|
+
* * Default `sideAngle` is `Geometry.smallAngleRadians`.
|
|
65
|
+
* * Default `assembleChains` is `true`.
|
|
66
|
+
* * Default `collectOnForwardFacets`, `collectOnSideFacets`, `collectOnRearFacets` are all `true`.
|
|
66
67
|
*/
|
|
67
68
|
static create(vectorToEye, sideAngle, assembleChains, collectOnForwardFacets, collectOnSideFacets, collectOnRearFacets) {
|
|
68
69
|
return new SweepLineStringToFacetsOptions(vectorToEye === undefined ? Vector3d.unitZ() : vectorToEye.clone(), sideAngle === undefined ? Angle.createRadians(Geometry.smallAngleRadians) : sideAngle.clone(), Geometry.resolveValue(assembleChains, true), Geometry.resolveValue(collectOnForwardFacets, true), Geometry.resolveValue(collectOnSideFacets, true), Geometry.resolveValue(collectOnRearFacets, true));
|
|
69
70
|
}
|
|
70
|
-
/** Return true if all outputs are requested */
|
|
71
|
-
get collectAll() {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
/** Return `true` if all outputs are requested. */
|
|
72
|
+
get collectAll() {
|
|
73
|
+
return this.collectOnForwardFacets === true &&
|
|
74
|
+
this.collectOnSideFacets === true &&
|
|
75
|
+
this.collectOnRearFacets === true;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Decide if the instance collector flags accept a facet with the given normal.
|
|
79
|
+
* * A facet whose facet normal has a positive, zero, or negative dot product with `vectorToEye` is classified
|
|
80
|
+
* as forward, side, or rear, respectively.
|
|
81
|
+
* * `undefined` facet normal returns `false`.
|
|
75
82
|
*/
|
|
76
83
|
collectFromThisFacetNormal(facetNormal) {
|
|
77
84
|
if (facetNormal === undefined)
|
|
@@ -85,22 +92,27 @@ export class SweepLineStringToFacetsOptions {
|
|
|
85
92
|
/**
|
|
86
93
|
* Options carrier for [[PolyfaceQuery.cloneOffset]].
|
|
87
94
|
* * Default options are strongly recommended.
|
|
88
|
-
* * The option most likely to be changed is
|
|
95
|
+
* * The option most likely to be changed is `chamferAngleBetweenNormals`.
|
|
89
96
|
* @public
|
|
90
97
|
*/
|
|
91
98
|
export class OffsetMeshOptions {
|
|
92
|
-
/** Constructor -- CAPTURE parameters
|
|
93
|
-
constructor(smoothSingleAngleBetweenNormals = Angle.createDegrees(25), smoothAccumulatedAngleBetweenNormals = Angle.createDegrees(60),
|
|
99
|
+
/** Constructor -- CAPTURE parameters. */
|
|
100
|
+
constructor(smoothSingleAngleBetweenNormals = Angle.createDegrees(25), smoothAccumulatedAngleBetweenNormals = Angle.createDegrees(60), chamferAngleBetweenNormals = Angle.createDegrees(90)) {
|
|
94
101
|
this.smoothSingleAngleBetweenNormals = smoothSingleAngleBetweenNormals.clone();
|
|
95
102
|
this.smoothAccumulatedAngleBetweenNormals = smoothAccumulatedAngleBetweenNormals.clone();
|
|
96
|
-
this.chamferAngleBetweenNormals =
|
|
103
|
+
this.chamferAngleBetweenNormals = chamferAngleBetweenNormals.clone();
|
|
97
104
|
}
|
|
98
|
-
/**
|
|
105
|
+
/**
|
|
106
|
+
* Construct and return an `OffsetMeshOptions` with given parameters.
|
|
99
107
|
* * Angles are forced to minimum values.
|
|
100
108
|
* * Clones of the angles are given to the constructor.
|
|
101
|
-
* @param smoothSingleRadiansBetweenNormals an angle larger than this (between facets) is considered a sharp edge
|
|
102
|
-
*
|
|
103
|
-
* @param
|
|
109
|
+
* @param smoothSingleRadiansBetweenNormals an angle larger than this (between facets) is considered a sharp edge.
|
|
110
|
+
* Default value is `25` degrees.
|
|
111
|
+
* @param smoothAccumulatedAngleBetweenNormals angles that sum to this much may be consolidated for average normal.
|
|
112
|
+
* Default value is `60` degrees.
|
|
113
|
+
* @param chamferTurnAngleBetweenNormals when facets meet and the turn angle (i.e., angle between facet normals)
|
|
114
|
+
* is larger than `chamferTurnAngleBetweenNormals`, a chamfer edge may be added to prevent offset mesh from having
|
|
115
|
+
* facets that extend out too far away from the source mesh. Default value is `120` degrees.
|
|
104
116
|
*/
|
|
105
117
|
static create(smoothSingleAngleBetweenNormals = Angle.createDegrees(25), smoothAccumulatedAngleBetweenNormals = Angle.createDegrees(60), chamferTurnAngleBetweenNormals = Angle.createDegrees(120)) {
|
|
106
118
|
const mySmoothSingleRadiansBetweenNormals = smoothSingleAngleBetweenNormals.clone();
|
|
@@ -116,25 +128,27 @@ export class OffsetMeshOptions {
|
|
|
116
128
|
}
|
|
117
129
|
}
|
|
118
130
|
/**
|
|
119
|
-
* Enumeration of cases for retaining facets among duplicates
|
|
131
|
+
* Enumeration of cases for retaining facets among duplicates.
|
|
120
132
|
* @public
|
|
121
133
|
*/
|
|
122
134
|
export var DuplicateFacetClusterSelector;
|
|
123
135
|
(function (DuplicateFacetClusterSelector) {
|
|
124
|
-
/**
|
|
136
|
+
/** Retain none of the duplicates. */
|
|
125
137
|
DuplicateFacetClusterSelector[DuplicateFacetClusterSelector["SelectNone"] = 0] = "SelectNone";
|
|
126
|
-
/**
|
|
138
|
+
/** Retain any one member among duplicates. */
|
|
127
139
|
DuplicateFacetClusterSelector[DuplicateFacetClusterSelector["SelectAny"] = 1] = "SelectAny";
|
|
128
|
-
/**
|
|
140
|
+
/** Retain all members among duplicates. */
|
|
129
141
|
DuplicateFacetClusterSelector[DuplicateFacetClusterSelector["SelectAll"] = 2] = "SelectAll";
|
|
130
|
-
/**
|
|
142
|
+
/** Retain one from any cluster with an odd number of faces. */
|
|
131
143
|
DuplicateFacetClusterSelector[DuplicateFacetClusterSelector["SelectOneByParity"] = 3] = "SelectOneByParity";
|
|
132
144
|
})(DuplicateFacetClusterSelector || (DuplicateFacetClusterSelector = {}));
|
|
133
|
-
/**
|
|
145
|
+
/**
|
|
146
|
+
* PolyfaceQuery is a static class whose methods implement queries on a `Polyface` or `PolyfaceVisitor` provided as a
|
|
147
|
+
* parameter to each method.
|
|
134
148
|
* @public
|
|
135
149
|
*/
|
|
136
150
|
export class PolyfaceQuery {
|
|
137
|
-
/**
|
|
151
|
+
/** Copy the points from a visitor into a linestring loop. */
|
|
138
152
|
static visitorToLoop(visitor) {
|
|
139
153
|
const ls = LineString3d.createPoints(visitor.point.getPoint3dArray());
|
|
140
154
|
return Loop.create(ls);
|
|
@@ -149,11 +163,15 @@ export class PolyfaceQuery {
|
|
|
149
163
|
}
|
|
150
164
|
return result;
|
|
151
165
|
}
|
|
152
|
-
/**
|
|
153
|
-
*
|
|
154
|
-
|
|
166
|
+
/**
|
|
167
|
+
* Sum all facet areas.
|
|
168
|
+
* @param source polyface or visitor.
|
|
169
|
+
* @param vectorToEye compute sum of (signed) facet areas projected to a view plane perpendicular to `vectorToEye`.
|
|
170
|
+
* If `vectorToEye` is not provided, actual facet areas are calculated (without any projection).
|
|
171
|
+
* @returns the sum of all facet areas. Return 0 if `source` is `undefined`.
|
|
172
|
+
*/
|
|
155
173
|
static sumFacetAreas(source, vectorToEye) {
|
|
156
|
-
let
|
|
174
|
+
let sum = 0;
|
|
157
175
|
if (source !== undefined) {
|
|
158
176
|
if (source instanceof Polyface)
|
|
159
177
|
return PolyfaceQuery.sumFacetAreas(source.createVisitor(1), vectorToEye);
|
|
@@ -162,20 +180,21 @@ export class PolyfaceQuery {
|
|
|
162
180
|
unitVectorToEye = vectorToEye.normalize();
|
|
163
181
|
source.reset();
|
|
164
182
|
while (source.moveToNextFacet()) {
|
|
165
|
-
const
|
|
166
|
-
|
|
183
|
+
const areaNormal = PolygonOps.areaNormal(source.point.getPoint3dArray());
|
|
184
|
+
sum += unitVectorToEye ? areaNormal.dotProduct(unitVectorToEye) : areaNormal.magnitude();
|
|
167
185
|
}
|
|
168
186
|
}
|
|
169
|
-
return
|
|
187
|
+
return sum;
|
|
170
188
|
}
|
|
171
|
-
/**
|
|
172
|
-
*
|
|
189
|
+
/**
|
|
190
|
+
* Sum volumes of tetrahedra from origin to all facets.
|
|
191
|
+
* * If origin is `undefined`, the first point encountered (by the visitor) is used as origin.
|
|
173
192
|
* * If the mesh is closed, this sum is the volume.
|
|
174
|
-
* * If the mesh is not closed, this sum is the volume of a mesh with various additional facets
|
|
175
|
-
*
|
|
176
|
-
|
|
193
|
+
* * If the mesh is not closed, this sum is the volume of a mesh with various additional facets from the origin
|
|
194
|
+
* to facets.
|
|
195
|
+
*/
|
|
177
196
|
static sumTetrahedralVolumes(source, origin) {
|
|
178
|
-
let
|
|
197
|
+
let sum = 0;
|
|
179
198
|
if (source instanceof Polyface)
|
|
180
199
|
return PolyfaceQuery.sumTetrahedralVolumes(source.createVisitor(0), origin);
|
|
181
200
|
let myOrigin = origin;
|
|
@@ -190,17 +209,18 @@ export class PolyfaceQuery {
|
|
|
190
209
|
for (let i = 1; i + 1 < source.point.length; i++) {
|
|
191
210
|
source.point.getPoint3dAtUncheckedPointIndex(i, targetA);
|
|
192
211
|
source.point.getPoint3dAtUncheckedPointIndex(i + 1, targetB);
|
|
193
|
-
|
|
212
|
+
sum += myOrigin.tripleProductToPoints(facetOrigin, targetA, targetB);
|
|
194
213
|
}
|
|
195
214
|
}
|
|
196
|
-
return
|
|
215
|
+
return sum / 6.0;
|
|
197
216
|
}
|
|
198
|
-
/**
|
|
217
|
+
/**
|
|
218
|
+
* Sum (signed) volumes between facets and a plane.
|
|
199
219
|
* Return a structure with multiple sums:
|
|
200
220
|
* * volume = the sum of (signed) volumes between facets and the plane.
|
|
201
|
-
* *
|
|
202
|
-
*
|
|
203
|
-
|
|
221
|
+
* * positiveProjectedFacetAreaMoments, negativeProjectedFacetAreaMoments = moment data with centroid, area, and second
|
|
222
|
+
* moments with respect to the centroid.
|
|
223
|
+
*/
|
|
204
224
|
static sumVolumeBetweenFacetsAndPlane(source, plane) {
|
|
205
225
|
if (source instanceof Polyface)
|
|
206
226
|
return PolyfaceQuery.sumVolumeBetweenFacetsAndPlane(source.createVisitor(0), plane);
|
|
@@ -218,18 +238,18 @@ export class PolyfaceQuery {
|
|
|
218
238
|
const singleFacetProducts = Matrix4d.createZero();
|
|
219
239
|
const projectToPlane = plane.getProjectionToPlane();
|
|
220
240
|
source.reset();
|
|
221
|
-
// For each facet
|
|
222
|
-
//
|
|
223
|
-
//
|
|
224
|
-
// each
|
|
225
|
-
// each volume contribution is
|
|
241
|
+
// For each facet:
|
|
242
|
+
// - form triangles from facet origin to each far edge.
|
|
243
|
+
// - sum signed area and volume contributions.
|
|
244
|
+
// each projected area contribution is twice the area of a triangle.
|
|
245
|
+
// each volume contribution is 3 times the actual volume -- (1/3) of the altitude sums was the centroid altitude.
|
|
226
246
|
while (source.moveToNextFacet()) {
|
|
227
247
|
source.point.getPoint3dAtUncheckedPointIndex(0, facetOrigin);
|
|
228
248
|
h0 = plane.altitude(facetOrigin);
|
|
229
249
|
singleFacetArea = 0;
|
|
230
250
|
// within a single facets, the singleFacetArea sum is accumulated with signs of individual triangles.
|
|
231
|
-
//
|
|
232
|
-
//
|
|
251
|
+
// for a non-convex facet, this can be a mixture of positive and negative areas.
|
|
252
|
+
// the absoluteProjectedAreaSum contribution is forced positive after the sum for the facet.
|
|
233
253
|
for (let i = 1; i + 1 < source.point.length; i++) {
|
|
234
254
|
source.point.getPoint3dAtUncheckedPointIndex(i, targetA);
|
|
235
255
|
source.point.getPoint3dAtUncheckedPointIndex(i + 1, targetB);
|
|
@@ -260,7 +280,7 @@ export class PolyfaceQuery {
|
|
|
260
280
|
negativeProjectedFacetAreaMoments: negativeAreaMoments,
|
|
261
281
|
};
|
|
262
282
|
}
|
|
263
|
-
/** Return the inertia products [xx,xy,xz,xw,
|
|
283
|
+
/** Return the inertia products [xx,xy,xz,xw,yw, etc] integrated over all all facets as viewed from origin. */
|
|
264
284
|
static sumFacetSecondAreaMomentProducts(source, origin) {
|
|
265
285
|
if (source instanceof Polyface)
|
|
266
286
|
return PolyfaceQuery.sumFacetSecondAreaMomentProducts(source.createVisitor(0), origin);
|
|
@@ -271,7 +291,7 @@ export class PolyfaceQuery {
|
|
|
271
291
|
}
|
|
272
292
|
return products;
|
|
273
293
|
}
|
|
274
|
-
/** Return the inertia products [xx,xy,xz,xw,
|
|
294
|
+
/** Return the inertia products [xx,xy,xz,xw,yw, etc] integrated over all tetrahedral volumes from origin. */
|
|
275
295
|
static sumFacetSecondVolumeMomentProducts(source, origin) {
|
|
276
296
|
if (source instanceof Polyface)
|
|
277
297
|
return PolyfaceQuery.sumFacetSecondVolumeMomentProducts(source.createVisitor(0), origin);
|
|
@@ -282,10 +302,11 @@ export class PolyfaceQuery {
|
|
|
282
302
|
}
|
|
283
303
|
return products;
|
|
284
304
|
}
|
|
285
|
-
/**
|
|
286
|
-
*
|
|
287
|
-
* *
|
|
288
|
-
* *
|
|
305
|
+
/**
|
|
306
|
+
* Compute area moments for the mesh. In the returned `MomentData`:
|
|
307
|
+
* * `origin` is the centroid.
|
|
308
|
+
* * `localToWorldMap` has the origin and principal directions.
|
|
309
|
+
* * `radiiOfGyration` radii for rotation around the x,y,z axes.
|
|
289
310
|
*/
|
|
290
311
|
static computePrincipalAreaMoments(source) {
|
|
291
312
|
const origin = source.data.getPoint(0);
|
|
@@ -294,12 +315,13 @@ export class PolyfaceQuery {
|
|
|
294
315
|
const inertiaProducts = PolyfaceQuery.sumFacetSecondAreaMomentProducts(source, origin);
|
|
295
316
|
return MomentData.inertiaProductsToPrincipalAxes(origin, inertiaProducts);
|
|
296
317
|
}
|
|
297
|
-
/**
|
|
298
|
-
*
|
|
299
|
-
* *
|
|
300
|
-
* *
|
|
318
|
+
/**
|
|
319
|
+
* Compute area moments for the mesh. In the returned MomentData:
|
|
320
|
+
* * `origin` is the centroid.
|
|
321
|
+
* * `localToWorldMap` has the origin and principal directions.
|
|
322
|
+
* * `radiiOfGyration` radii for rotation around the x,y,z axes.
|
|
301
323
|
* * The result is only valid if the mesh is closed.
|
|
302
|
-
* * There is no test for closure.
|
|
324
|
+
* * There is no test for closure. Use `PolyfaceQuery.isPolyfaceClosedByEdgePairing(polyface)` to test for closure.
|
|
303
325
|
*/
|
|
304
326
|
static computePrincipalVolumeMoments(source) {
|
|
305
327
|
const origin = source.data.getPoint(0);
|
|
@@ -308,8 +330,10 @@ export class PolyfaceQuery {
|
|
|
308
330
|
const inertiaProducts = PolyfaceQuery.sumFacetSecondVolumeMomentProducts(source, origin);
|
|
309
331
|
return MomentData.inertiaProductsToPrincipalAxes(origin, inertiaProducts);
|
|
310
332
|
}
|
|
311
|
-
/**
|
|
312
|
-
*
|
|
333
|
+
/**
|
|
334
|
+
* Determine whether all facets are convex.
|
|
335
|
+
* @param source polyface or visitor.
|
|
336
|
+
* @returns `true` if all facets are convex; `false` otherwise.
|
|
313
337
|
*/
|
|
314
338
|
static areFacetsConvex(source) {
|
|
315
339
|
if (source instanceof Polyface)
|
|
@@ -326,55 +350,67 @@ export class PolyfaceQuery {
|
|
|
326
350
|
}
|
|
327
351
|
/**
|
|
328
352
|
* Test for convex volume by dihedral angle tests on all edges.
|
|
329
|
-
* * This tests if all dihedral angles are positive.
|
|
330
|
-
* * In a closed solid, this is a strong test for overall convexity.
|
|
331
|
-
* *
|
|
353
|
+
* * This tests if all dihedral angles of the mesh are positive.
|
|
354
|
+
* * In a closed solid, this is a strong test for overall mesh convexity with outward facing normals.
|
|
355
|
+
* * See [[dihedralAngleSummary]] for the definition of "dihedral angle".
|
|
356
|
+
* * With `ignoreBoundaries` true, this may be a useful test when all the facets are in a single edge-connected
|
|
357
|
+
* component, such as a pyramid with no underside.
|
|
332
358
|
* * It is not a correct test if there are multiple, disjoint components.
|
|
333
|
-
*
|
|
334
|
-
*
|
|
335
|
-
*
|
|
336
|
-
* @param source mesh
|
|
337
|
-
* @param ignoreBoundaries if true
|
|
338
|
-
* @returns true if
|
|
359
|
+
* * Take the above-mentioned pyramid with no underside.
|
|
360
|
+
* * Within the same mesh, have a second pyramid placed to the side, still facing upward.
|
|
361
|
+
* * The angles will pass the dihedral convexity test, but the composite thing surely is not convex.
|
|
362
|
+
* @param source mesh.
|
|
363
|
+
* @param ignoreBoundaries if `true` ignore simple boundary edges, i.e., allow unclosed meshes. Default is `false`.
|
|
364
|
+
* @returns true if all dihedral angles of the mesh are positive.
|
|
339
365
|
*/
|
|
340
366
|
static isConvexByDihedralAngleCount(source, ignoreBoundaries = false) {
|
|
341
367
|
return this.dihedralAngleSummary(source, ignoreBoundaries) > 0;
|
|
342
368
|
}
|
|
343
369
|
/**
|
|
344
370
|
* Compute a number summarizing the dihedral angles in the mesh.
|
|
345
|
-
*
|
|
346
|
-
*
|
|
347
|
-
* @param
|
|
348
|
-
* @
|
|
349
|
-
*
|
|
350
|
-
*
|
|
351
|
-
*
|
|
352
|
-
*
|
|
353
|
-
*
|
|
354
|
-
*
|
|
371
|
+
* * A dihedral angle is the signed angle between adjacent facets' normals. This angle is positive when the cross
|
|
372
|
+
* product `normalA x normalB` has the same direction as facetA's traversal of the facets' shared edge.
|
|
373
|
+
* @param source mesh.
|
|
374
|
+
* @param ignoreBoundaries if `true` ignore simple boundary edges, i.e., allow unclosed meshes. Default is `false`.
|
|
375
|
+
* See [[isConvexByDihedralAngleCount]] for comments about passing true when there are multiple
|
|
376
|
+
* connected components.
|
|
377
|
+
* * Return `0` if all dihedral angles are zero (and `ignoreBoundaries === true`). The mesh is planar.
|
|
378
|
+
* * Otherwise, return `1` if all dihedral angles are non-negative. The mesh probably encloses a convex volume and
|
|
379
|
+
* has outward normals.
|
|
380
|
+
* * Otherwise, return `-1` if all dihedral angles are non-positive. The mesh probably encloses a convex volume and
|
|
381
|
+
* has inward normals.
|
|
382
|
+
* * Otherwise, return `-2`. Also return `-2` if a non-manifold condition was detected, or a facet normal could not
|
|
383
|
+
* be computed. A non-manifold condition is a positive-length edge adjacent to more than 2 facets or (if
|
|
384
|
+
* `ignoreBoundaries` is false) adjacent to exactly one facet.
|
|
355
385
|
*/
|
|
356
386
|
static dihedralAngleSummary(source, ignoreBoundaries = false) {
|
|
387
|
+
// more info can be found at geometry/internaldocs/Polyface.md
|
|
357
388
|
const edges = new IndexedEdgeMatcher();
|
|
358
389
|
const visitor = source.createVisitor(1);
|
|
359
390
|
visitor.reset();
|
|
391
|
+
// find centroid normals of all facets
|
|
360
392
|
const centroidNormal = [];
|
|
361
393
|
let normalCounter = 0;
|
|
362
394
|
while (visitor.moveToNextFacet()) {
|
|
363
395
|
const numEdges = visitor.pointCount - 1;
|
|
364
396
|
const normal = PolygonOps.centroidAreaNormal(visitor.point);
|
|
365
397
|
if (normal === undefined)
|
|
366
|
-
return
|
|
398
|
+
return -2;
|
|
367
399
|
centroidNormal.push(normal);
|
|
368
400
|
for (let i = 0; i < numEdges; i++) {
|
|
369
401
|
edges.addEdge(visitor.clientPointIndex(i), visitor.clientPointIndex(i + 1), normalCounter);
|
|
370
402
|
}
|
|
371
403
|
normalCounter++;
|
|
372
404
|
}
|
|
405
|
+
// find "manifold clusters" and "bad clusters"
|
|
406
|
+
// manifold clusters are edges adjacent to 2 facets
|
|
407
|
+
// bad clusters are edges adjacent to more than 2 facets or (if ignoreBoundaries is false) adjacent to 1 facet
|
|
373
408
|
const badClusters = [];
|
|
374
409
|
const manifoldClusters = [];
|
|
375
410
|
edges.sortAndCollectClusters(manifoldClusters, ignoreBoundaries ? undefined : badClusters, undefined, badClusters);
|
|
376
411
|
if (badClusters.length > 0)
|
|
377
|
-
return
|
|
412
|
+
return -2;
|
|
413
|
+
// find angle between facet centroid normals (dihedral angles)
|
|
378
414
|
let numPositive = 0;
|
|
379
415
|
let numPlanar = 0;
|
|
380
416
|
let numNegative = 0;
|
|
@@ -382,8 +418,7 @@ export class PolyfaceQuery {
|
|
|
382
418
|
for (const cluster of manifoldClusters) {
|
|
383
419
|
const sideA = cluster[0];
|
|
384
420
|
const sideB = cluster[1];
|
|
385
|
-
if (sideA instanceof SortableEdge
|
|
386
|
-
&& sideB instanceof SortableEdge
|
|
421
|
+
if (sideA instanceof SortableEdge && sideB instanceof SortableEdge
|
|
387
422
|
&& source.data.point.vectorIndexIndex(sideA.vertexIndexA, sideA.vertexIndexB, edgeVector)) {
|
|
388
423
|
const dihedralAngle = centroidNormal[sideA.facetIndex].direction.signedAngleTo(centroidNormal[sideB.facetIndex].direction, edgeVector);
|
|
389
424
|
if (dihedralAngle.isAlmostZero)
|
|
@@ -394,26 +429,26 @@ export class PolyfaceQuery {
|
|
|
394
429
|
numNegative++;
|
|
395
430
|
}
|
|
396
431
|
}
|
|
432
|
+
// categorize the mesh
|
|
397
433
|
if (numPositive > 0 && numNegative === 0)
|
|
398
434
|
return 1;
|
|
399
435
|
if (numNegative > 0 && numPositive === 0)
|
|
400
436
|
return -1;
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
return 0;
|
|
437
|
+
if (numPlanar > 0 && numPositive === 0 && numNegative === 0) // planar mesh
|
|
438
|
+
return 0;
|
|
439
|
+
return -2;
|
|
405
440
|
}
|
|
406
|
-
/**
|
|
407
|
-
* Test if the facets in `source` occur in perfectly mated pairs, as is required for a closed manifold volume.
|
|
408
|
-
*/
|
|
441
|
+
/** Test if the facets in `source` occur in perfectly mated pairs, as is required for a closed manifold volume. */
|
|
409
442
|
static isPolyfaceClosedByEdgePairing(source) {
|
|
410
443
|
return this.isPolyfaceManifold(source, false);
|
|
411
444
|
}
|
|
412
|
-
/**
|
|
413
|
-
*
|
|
414
|
-
* *
|
|
415
|
-
* *
|
|
416
|
-
*
|
|
445
|
+
/**
|
|
446
|
+
* Test edges pairing in `source` mesh.
|
|
447
|
+
* * For `allowSimpleBoundaries === false` true return means this is a closed 2-manifold surface.
|
|
448
|
+
* * For `allowSimpleBoundaries === true` true means this is a 2-manifold surface which may have boundary, but is
|
|
449
|
+
* still properly matched internally.
|
|
450
|
+
* * Any edge with 3 or more adjacent facets triggers `false` return.
|
|
451
|
+
* * Any edge with 2 adjacent facets in the same direction triggers a `false` return.
|
|
417
452
|
*/
|
|
418
453
|
static isPolyfaceManifold(source, allowSimpleBoundaries = false) {
|
|
419
454
|
const edges = new IndexedEdgeMatcher();
|
|
@@ -430,11 +465,11 @@ export class PolyfaceQuery {
|
|
|
430
465
|
return badClusters.length === 0;
|
|
431
466
|
}
|
|
432
467
|
/**
|
|
433
|
-
*
|
|
434
|
-
*
|
|
435
|
-
* @param source polyface or visitor
|
|
436
|
-
* @param includeTypical true to in include typical boundary edges with a single
|
|
437
|
-
* @param includeMismatch true to include edges with more than 2
|
|
468
|
+
* Construct a CurveCollection containing boundary edges.
|
|
469
|
+
* * Each edge is a LineSegment3d.
|
|
470
|
+
* @param source polyface or visitor.
|
|
471
|
+
* @param includeTypical true to in include typical boundary edges with a single adjacent facet.
|
|
472
|
+
* @param includeMismatch true to include edges with more than 2 adjacent facets.
|
|
438
473
|
* @param includeNull true to include edges with identical start and end vertex indices.
|
|
439
474
|
*/
|
|
440
475
|
static boundaryEdges(source, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
@@ -450,9 +485,9 @@ export class PolyfaceQuery {
|
|
|
450
485
|
/**
|
|
451
486
|
* Collect boundary edges.
|
|
452
487
|
* * Return the edges as the simplest collection of chains of line segments.
|
|
453
|
-
* @param source
|
|
454
|
-
* @param includeTypical true to in include typical boundary edges with a single
|
|
455
|
-
* @param includeMismatch true to include edges with more than 2
|
|
488
|
+
* @param source polyface or visitor.
|
|
489
|
+
* @param includeTypical true to in include typical boundary edges with a single adjacent facet.
|
|
490
|
+
* @param includeMismatch true to include edges with more than 2 adjacent facets.
|
|
456
491
|
* @param includeNull true to include edges with identical start and end vertex indices.
|
|
457
492
|
*/
|
|
458
493
|
static collectBoundaryEdges(source, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
@@ -463,10 +498,11 @@ export class PolyfaceQuery {
|
|
|
463
498
|
/**
|
|
464
499
|
* Test if the facets in `source` occur in perfectly mated pairs, as is required for a closed manifold volume.
|
|
465
500
|
* If not, extract the boundary edges as lines.
|
|
466
|
-
* @param source polyface or visitor
|
|
467
|
-
* @param announceEdge function to be called with each boundary edge. The announcement is start and end points,
|
|
468
|
-
*
|
|
469
|
-
* @param
|
|
501
|
+
* @param source polyface or visitor.
|
|
502
|
+
* @param announceEdge function to be called with each boundary edge. The announcement is start and end points,
|
|
503
|
+
* start and end indices, and facet index.
|
|
504
|
+
* @param includeTypical true to announce typical boundary edges with a single adjacent facet.
|
|
505
|
+
* @param includeMismatch true to announce edges with more than 2 adjacent facets.
|
|
470
506
|
* @param includeNull true to announce edges with identical start and end vertex indices.
|
|
471
507
|
*/
|
|
472
508
|
static announceBoundaryEdges(source, announceEdge, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
@@ -482,17 +518,17 @@ export class PolyfaceQuery {
|
|
|
482
518
|
edges.addEdge(visitor.clientPointIndex(i), visitor.clientPointIndex(i + 1), visitor.currentReadIndex());
|
|
483
519
|
}
|
|
484
520
|
}
|
|
485
|
-
const
|
|
486
|
-
const
|
|
487
|
-
const
|
|
488
|
-
edges.sortAndCollectClusters(undefined,
|
|
521
|
+
const boundaryEdges = [];
|
|
522
|
+
const nullEdges = [];
|
|
523
|
+
const allOtherEdges = [];
|
|
524
|
+
edges.sortAndCollectClusters(undefined, boundaryEdges, nullEdges, allOtherEdges);
|
|
489
525
|
const badList = [];
|
|
490
|
-
if (includeTypical &&
|
|
491
|
-
badList.push(
|
|
492
|
-
if (
|
|
493
|
-
badList.push(
|
|
494
|
-
if (
|
|
495
|
-
badList.push(
|
|
526
|
+
if (includeTypical && boundaryEdges.length > 0)
|
|
527
|
+
badList.push(boundaryEdges);
|
|
528
|
+
if (includeNull && nullEdges.length > 0)
|
|
529
|
+
badList.push(nullEdges);
|
|
530
|
+
if (includeMismatch && allOtherEdges.length > 0)
|
|
531
|
+
badList.push(allOtherEdges);
|
|
496
532
|
if (badList.length === 0)
|
|
497
533
|
return undefined;
|
|
498
534
|
const sourcePolyface = visitor.clientPolyface();
|
|
@@ -509,12 +545,30 @@ export class PolyfaceQuery {
|
|
|
509
545
|
}
|
|
510
546
|
}
|
|
511
547
|
/**
|
|
512
|
-
*
|
|
548
|
+
* Load all half edges from a mesh to an IndexedEdgeMatcher.
|
|
549
|
+
* @param polyface a mesh or a visitor assumed to have numWrap === 1.
|
|
550
|
+
*/
|
|
551
|
+
static createIndexedEdges(polyface) {
|
|
552
|
+
if (polyface instanceof Polyface)
|
|
553
|
+
return this.createIndexedEdges(polyface.createVisitor(1));
|
|
554
|
+
const edges = new IndexedEdgeMatcher();
|
|
555
|
+
polyface.reset();
|
|
556
|
+
while (polyface.moveToNextFacet()) {
|
|
557
|
+
const numEdges = polyface.pointCount - 1;
|
|
558
|
+
for (let i = 0; i < numEdges; i++) {
|
|
559
|
+
edges.addEdge(polyface.clientPointIndex(i), polyface.clientPointIndex(i + 1), polyface.currentReadIndex());
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
return edges;
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* Invoke the callback on each manifold edge whose adjacent facet normals form vectorToEye dot products
|
|
566
|
+
* with opposite sign.
|
|
513
567
|
* * The callback is not called on boundary edges.
|
|
514
|
-
* @param source
|
|
515
|
-
* @param announce callback function invoked on manifold silhouette edges
|
|
516
|
-
* @param vectorToEye normal of plane in which to compute silhouette edges
|
|
517
|
-
* @param sideAngle angular tolerance for perpendicularity test
|
|
568
|
+
* @param source polyface or visitor.
|
|
569
|
+
* @param announce callback function invoked on manifold silhouette edges.
|
|
570
|
+
* @param vectorToEye normal of plane in which to compute silhouette edges.
|
|
571
|
+
* @param sideAngle angular tolerance for perpendicularity test.
|
|
518
572
|
*/
|
|
519
573
|
static announceSilhouetteEdges(source, announce, vectorToEye, sideAngle = Angle.createSmallAngle()) {
|
|
520
574
|
if (source instanceof Polyface)
|
|
@@ -564,16 +618,17 @@ export class PolyfaceQuery {
|
|
|
564
618
|
* Collect manifold edges whose adjacent facet normals form vectorToEye dot products with opposite sign.
|
|
565
619
|
* * Does not return boundary edges.
|
|
566
620
|
* * Return the edges as chains of line segments.
|
|
567
|
-
* @param source
|
|
568
|
-
* @param vectorToEye normal of plane in which to compute silhouette edges
|
|
569
|
-
* @param sideAngle angular tolerance for perpendicularity test
|
|
621
|
+
* @param source polyface or visitor.
|
|
622
|
+
* @param vectorToEye normal of plane in which to compute silhouette edges.
|
|
623
|
+
* @param sideAngle angular tolerance for perpendicularity test.
|
|
570
624
|
*/
|
|
571
625
|
static collectSilhouetteEdges(source, vectorToEye, sideAngle = Angle.createSmallAngle()) {
|
|
572
626
|
const collector = new MultiChainCollector(Geometry.smallMetricDistance, Geometry.smallMetricDistance);
|
|
573
627
|
PolyfaceQuery.announceSilhouetteEdges(source, (ptA, ptB) => collector.captureCurve(LineSegment3d.create(ptA, ptB)), vectorToEye, sideAngle);
|
|
574
628
|
return collector.grabResult(true);
|
|
575
629
|
}
|
|
576
|
-
/**
|
|
630
|
+
/**
|
|
631
|
+
* Find segments (within the linestring) which project to facets.
|
|
577
632
|
* * Announce each pair of linestring segment and on-facet segment through a callback.
|
|
578
633
|
* * Facets are ASSUMED to be convex and planar, and not overlap in the z direction.
|
|
579
634
|
*/
|
|
@@ -586,7 +641,24 @@ export class PolyfaceQuery {
|
|
|
586
641
|
}
|
|
587
642
|
}
|
|
588
643
|
}
|
|
589
|
-
/**
|
|
644
|
+
/**
|
|
645
|
+
* Set the limit on work during an async time blocks, and return the old value.
|
|
646
|
+
* * This should be a large number -- default is 1.0e6
|
|
647
|
+
* @internal
|
|
648
|
+
*/
|
|
649
|
+
static setAsyncWorkLimit(value) {
|
|
650
|
+
const oldValue = this._asyncWorkLimit;
|
|
651
|
+
this._asyncWorkLimit = value;
|
|
652
|
+
return oldValue;
|
|
653
|
+
}
|
|
654
|
+
/**
|
|
655
|
+
* Query the current limit on work during an async time block.
|
|
656
|
+
* @internal
|
|
657
|
+
*/
|
|
658
|
+
static get asyncWorkLimit() {
|
|
659
|
+
return this._asyncWorkLimit;
|
|
660
|
+
}
|
|
661
|
+
/** Execute `context.projectToPolygon` until its work estimates accumulate to workLimit. */
|
|
590
662
|
static async continueAnnounceSweepLinestringToConvexPolyfaceXY(context, visitor, announce) {
|
|
591
663
|
let workCount = 0;
|
|
592
664
|
while ((workCount < this.asyncWorkLimit) && visitor.moveToNextFacet()) {
|
|
@@ -594,16 +666,8 @@ export class PolyfaceQuery {
|
|
|
594
666
|
}
|
|
595
667
|
return workCount;
|
|
596
668
|
}
|
|
597
|
-
/**
|
|
598
|
-
*
|
|
599
|
-
* @internal
|
|
600
|
-
*/
|
|
601
|
-
static setAsyncWorkLimit(value) { const a = this._asyncWorkLimit; this._asyncWorkLimit = value; return a; }
|
|
602
|
-
/** Query the current limit on work during an async time block.
|
|
603
|
-
* @internal
|
|
604
|
-
*/
|
|
605
|
-
static get asyncWorkLimit() { return this._asyncWorkLimit; }
|
|
606
|
-
/** Find segments (within the linestring) which project to facets.
|
|
669
|
+
/**
|
|
670
|
+
* Find segments (within the linestring) which project to facets.
|
|
607
671
|
* * Announce each pair of linestring segment and on-facet segment through a callback.
|
|
608
672
|
* * Facets are ASSUMED to be convex and planar, and not overlap in the z direction.
|
|
609
673
|
* * REMARK: Although this is public, the usual use is via slightly higher level public methods, viz:
|
|
@@ -626,14 +690,15 @@ export class PolyfaceQuery {
|
|
|
626
690
|
// GeometryCoreTestIO.consoleLog({ myWorkTotal: workTotal, myBlockCount: this.awaitBlockCount });
|
|
627
691
|
return workTotal;
|
|
628
692
|
}
|
|
629
|
-
/**
|
|
693
|
+
/**
|
|
694
|
+
* Search the facets for facet subsets that are connected with at least vertex contact.
|
|
630
695
|
* * Return array of arrays of facet indices.
|
|
631
696
|
*/
|
|
632
697
|
static partitionFacetIndicesByVertexConnectedComponent(polyface) {
|
|
633
698
|
if (polyface instanceof Polyface) {
|
|
634
699
|
return this.partitionFacetIndicesByVertexConnectedComponent(polyface.createVisitor(0));
|
|
635
700
|
}
|
|
636
|
-
// The polyface is really a visitor
|
|
701
|
+
// The polyface is really a visitor
|
|
637
702
|
const context = new UnionFindContext(this.visitorClientPointCount(polyface));
|
|
638
703
|
for (polyface.reset(); polyface.moveToNextFacet();) {
|
|
639
704
|
const firstVertexIndexOnThisFacet = polyface.pointIndex[0];
|
|
@@ -661,9 +726,9 @@ export class PolyfaceQuery {
|
|
|
661
726
|
/**
|
|
662
727
|
* * Examine the normal orientation for each faces.
|
|
663
728
|
* * Separate to 3 partitions:
|
|
664
|
-
* *
|
|
665
|
-
* *
|
|
666
|
-
* *
|
|
729
|
+
* * Facets with normal in the positive direction of the vectorToEye (partition 0).
|
|
730
|
+
* * Facets with normal in the negative direction of the vectorToEye (partition 1).
|
|
731
|
+
* * Facets nearly perpendicular to the view vector (partition 2).
|
|
667
732
|
* * Return array of arrays of facet indices.
|
|
668
733
|
*/
|
|
669
734
|
static partitionFacetIndicesByVisibilityVector(polyface, vectorToEye, sideAngleTolerance) {
|
|
@@ -698,13 +763,13 @@ export class PolyfaceQuery {
|
|
|
698
763
|
}
|
|
699
764
|
/**
|
|
700
765
|
* Return the boundary of facets that are facing the eye.
|
|
701
|
-
* @param polyface
|
|
766
|
+
* @param polyface the indexed polyface
|
|
702
767
|
* @param visibilitySubset selector among the visible facet sets extracted by partitionFacetIndicesByVisibilityVector
|
|
703
768
|
* * 0 ==> forward facing
|
|
704
769
|
* * 1 ==> rear facing
|
|
705
770
|
* * 2 ==> side facing
|
|
706
|
-
* @param vectorToEye
|
|
707
|
-
* @param sideAngleTolerance
|
|
771
|
+
* @param vectorToEye the vector to eye
|
|
772
|
+
* @param sideAngleTolerance the tolerance of side angle
|
|
708
773
|
*/
|
|
709
774
|
static boundaryOfVisibleSubset(polyface, visibilitySelect, vectorToEye, sideAngleTolerance = Angle.createDegrees(1.0e-3)) {
|
|
710
775
|
const partitionedIndices = this.partitionFacetIndicesByVisibilityVector(polyface, vectorToEye, sideAngleTolerance);
|
|
@@ -714,10 +779,9 @@ export class PolyfaceQuery {
|
|
|
714
779
|
return this.boundaryEdges(visitor, true, false, false);
|
|
715
780
|
}
|
|
716
781
|
/**
|
|
717
|
-
* Search for edges with only 1
|
|
718
|
-
* *
|
|
719
|
-
* *
|
|
720
|
-
* @param mesh
|
|
782
|
+
* Search for edges with only 1 adjacent facet.
|
|
783
|
+
* * Chain them into loops.
|
|
784
|
+
* * Emit the loops to the announceLoop function.
|
|
721
785
|
*/
|
|
722
786
|
static announceBoundaryChainsAsLineString3d(mesh, announceLoop) {
|
|
723
787
|
const collector = new MultiChainCollector(Geometry.smallMetricDistance, 1000);
|
|
@@ -728,9 +792,9 @@ export class PolyfaceQuery {
|
|
|
728
792
|
* Return a mesh with
|
|
729
793
|
* * clusters of adjacent, coplanar facets merged into larger facets.
|
|
730
794
|
* * other facets included unchanged.
|
|
731
|
-
* @param mesh existing mesh or visitor
|
|
732
|
-
* @param maxSmoothEdgeAngle maximum dihedral angle across an edge between facets deemed coplanar. If undefined,
|
|
733
|
-
*
|
|
795
|
+
* @param mesh existing mesh or visitor.
|
|
796
|
+
* @param maxSmoothEdgeAngle maximum dihedral angle across an edge between facets deemed coplanar. If undefined,
|
|
797
|
+
* uses `Geometry.smallAngleRadians`.
|
|
734
798
|
*/
|
|
735
799
|
static cloneWithMaximalPlanarFacets(mesh, maxSmoothEdgeAngle) {
|
|
736
800
|
if (mesh instanceof Polyface)
|
|
@@ -789,14 +853,14 @@ export class PolyfaceQuery {
|
|
|
789
853
|
* * Unclosed chains are rejected.
|
|
790
854
|
* * Closed chains are triangulated and returned as a mesh.
|
|
791
855
|
* * The options structure enforces restrictions on how complicated the hole filling can be:
|
|
792
|
-
* * maxEdgesAroundHole -- holes with more edges are skipped
|
|
856
|
+
* * maxEdgesAroundHole -- holes with more edges are skipped.
|
|
793
857
|
* * maxPerimeter -- holes with larger summed edge lengths are skipped.
|
|
794
858
|
* * upVector -- holes that do not have positive area along this view are skipped.
|
|
795
|
-
* * includeOriginalMesh -- includes the original mesh in the output mesh, so the composite mesh is a
|
|
796
|
-
*
|
|
859
|
+
* * includeOriginalMesh -- includes the original mesh in the output mesh, so the composite mesh is a
|
|
860
|
+
* clone with holes filled.
|
|
861
|
+
* @param mesh existing mesh.
|
|
797
862
|
* @param options options controlling the hole fill.
|
|
798
863
|
* @param unfilledChains optional array to receive the points around holes that were not filled.
|
|
799
|
-
* @returns
|
|
800
864
|
*/
|
|
801
865
|
static fillSimpleHoles(mesh, options, unfilledChains) {
|
|
802
866
|
if (mesh instanceof Polyface)
|
|
@@ -832,9 +896,7 @@ export class PolyfaceQuery {
|
|
|
832
896
|
}
|
|
833
897
|
return builder.claimPolyface(true);
|
|
834
898
|
}
|
|
835
|
-
/** Clone the facets in each partition to a separate polyface.
|
|
836
|
-
*
|
|
837
|
-
*/
|
|
899
|
+
/** Clone the facets in each partition to a separate polyface. */
|
|
838
900
|
static clonePartitions(polyface, partitions) {
|
|
839
901
|
if (polyface instanceof Polyface) {
|
|
840
902
|
return this.clonePartitions(polyface.createVisitor(0), partitions);
|
|
@@ -857,7 +919,7 @@ export class PolyfaceQuery {
|
|
|
857
919
|
}
|
|
858
920
|
return polyfaces;
|
|
859
921
|
}
|
|
860
|
-
/** Clone facets that pass a filter function */
|
|
922
|
+
/** Clone facets that pass a filter function. */
|
|
861
923
|
static cloneFiltered(source, filter) {
|
|
862
924
|
if (source instanceof Polyface) {
|
|
863
925
|
return this.cloneFiltered(source.createVisitor(0), filter);
|
|
@@ -927,46 +989,44 @@ export class PolyfaceQuery {
|
|
|
927
989
|
}
|
|
928
990
|
return builder.claimPolyface(true);
|
|
929
991
|
}
|
|
930
|
-
/**
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
return visitor.data.point.length;
|
|
936
|
-
const polyface = visitor.clientPolyface();
|
|
992
|
+
/** Return the point count of the `source`. */
|
|
993
|
+
static visitorClientPointCount(source) {
|
|
994
|
+
if (source instanceof Polyface)
|
|
995
|
+
return source.data.point.length;
|
|
996
|
+
const polyface = source.clientPolyface();
|
|
937
997
|
if (polyface !== undefined)
|
|
938
998
|
return polyface.data.point.length;
|
|
939
|
-
|
|
999
|
+
source.reset();
|
|
940
1000
|
let maxIndex = -1;
|
|
941
|
-
while (
|
|
942
|
-
for (const pointIndex of
|
|
1001
|
+
while (source.moveToNextFacet()) {
|
|
1002
|
+
for (const pointIndex of source.pointIndex)
|
|
943
1003
|
if (pointIndex > maxIndex)
|
|
944
1004
|
maxIndex = pointIndex;
|
|
945
1005
|
}
|
|
946
1006
|
return maxIndex + 1;
|
|
947
1007
|
}
|
|
948
|
-
/**
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
return visitor.facetCount;
|
|
955
|
-
visitor = visitor.createVisitor(0);
|
|
1008
|
+
/** Return the facet count of the `source`. */
|
|
1009
|
+
static visitorClientFacetCount(source) {
|
|
1010
|
+
if (source instanceof Polyface) {
|
|
1011
|
+
if (source.facetCount !== undefined)
|
|
1012
|
+
return source.facetCount;
|
|
1013
|
+
source = source.createVisitor(0);
|
|
956
1014
|
}
|
|
957
|
-
const polyface =
|
|
1015
|
+
const polyface = source.clientPolyface();
|
|
958
1016
|
if (polyface !== undefined && polyface.facetCount !== undefined)
|
|
959
1017
|
return polyface.facetCount;
|
|
960
1018
|
let facetCount = 0;
|
|
961
|
-
|
|
962
|
-
while (
|
|
1019
|
+
source.reset();
|
|
1020
|
+
while (source.moveToNextFacet())
|
|
963
1021
|
++facetCount;
|
|
964
1022
|
return facetCount;
|
|
965
1023
|
}
|
|
966
|
-
/**
|
|
1024
|
+
/**
|
|
1025
|
+
* Partition the facet set into connected components such that two adjacent facets are in the same component if and
|
|
1026
|
+
* only if they are adjacent across a clustered edge.
|
|
967
1027
|
* @param edgeClusters sorted and clustered edges (cf. `IndexedEdgeMatcher.sortAndCollectClusters`).
|
|
968
1028
|
* @param numFacets facet count in the parent mesh. In particular, `edge.facetIndex < numFacets` for every input edge.
|
|
969
|
-
* @return collection of facet index arrays, one array per connected component
|
|
1029
|
+
* @return collection of facet index arrays, one array per connected component.
|
|
970
1030
|
*/
|
|
971
1031
|
static partitionFacetIndicesBySortableEdgeClusters(edgeClusters, numFacets) {
|
|
972
1032
|
const context = new UnionFindContext(numFacets);
|
|
@@ -997,10 +1057,12 @@ export class PolyfaceQuery {
|
|
|
997
1057
|
}
|
|
998
1058
|
return facetsInComponent;
|
|
999
1059
|
}
|
|
1000
|
-
/**
|
|
1001
|
-
*
|
|
1002
|
-
*
|
|
1003
|
-
* @
|
|
1060
|
+
/**
|
|
1061
|
+
* Partition the facet set into connected components. Each facet in a given component shares an edge only with
|
|
1062
|
+
* other facets in the component (or is a boundary edge).
|
|
1063
|
+
* @param polyface facets to partition.
|
|
1064
|
+
* @param stopAtVisibleEdges whether to further split connected components by visible edges of the polyface.
|
|
1065
|
+
* @return collection of facet index arrays, one per connected component.
|
|
1004
1066
|
*/
|
|
1005
1067
|
static partitionFacetIndicesByEdgeConnectedComponent(polyface, stopAtVisibleEdges = false) {
|
|
1006
1068
|
if (polyface instanceof Polyface) {
|
|
@@ -1025,7 +1087,8 @@ export class PolyfaceQuery {
|
|
|
1025
1087
|
matcher.sortAndCollectClusters(allEdges, allEdges, allEdges, allEdges);
|
|
1026
1088
|
return this.partitionFacetIndicesBySortableEdgeClusters(allEdges, numFacets);
|
|
1027
1089
|
}
|
|
1028
|
-
/**
|
|
1090
|
+
/**
|
|
1091
|
+
* Find segments (within the line string) which project to facets.
|
|
1029
1092
|
* * Assemble each input segment paired with its projected segment/point as a quad/triangle facet in a new polyface.
|
|
1030
1093
|
* * Input facets are ASSUMED to be convex and planar, and not overlap in the z direction.
|
|
1031
1094
|
*/
|
|
@@ -1039,7 +1102,7 @@ export class PolyfaceQuery {
|
|
|
1039
1102
|
});
|
|
1040
1103
|
return builder.claimPolyface(true);
|
|
1041
1104
|
}
|
|
1042
|
-
/** @deprecated in 4.x. Use sweepLineStringToFacetsXYReturnSweptFacets instead. */
|
|
1105
|
+
/** @deprecated in 4.x. Use [[sweepLineStringToFacetsXYReturnSweptFacets]] instead. */
|
|
1043
1106
|
static sweepLinestringToFacetsXYreturnSweptFacets(linestringPoints, polyface) {
|
|
1044
1107
|
return this.sweepLineStringToFacetsXYReturnSweptFacets(linestringPoints, polyface);
|
|
1045
1108
|
}
|
|
@@ -1052,11 +1115,10 @@ export class PolyfaceQuery {
|
|
|
1052
1115
|
*/
|
|
1053
1116
|
static sweepLineStringToFacets(linestringPoints, polyfaceOrVisitor, options) {
|
|
1054
1117
|
let result = [];
|
|
1055
|
-
// setup default options
|
|
1118
|
+
// setup default options
|
|
1056
1119
|
if (options === undefined)
|
|
1057
1120
|
options = SweepLineStringToFacetsOptions.create(Vector3d.unitZ(), Angle.createRadians(Geometry.smallAngleRadians), // tight geometry tolerance for vertical side facets
|
|
1058
|
-
true,
|
|
1059
|
-
true, true, true); // accept all outputs
|
|
1121
|
+
true, true, true, true);
|
|
1060
1122
|
let chainContext;
|
|
1061
1123
|
if (options.assembleChains)
|
|
1062
1124
|
chainContext = ChainMergeContext.create();
|
|
@@ -1087,9 +1149,9 @@ export class PolyfaceQuery {
|
|
|
1087
1149
|
}
|
|
1088
1150
|
/**
|
|
1089
1151
|
* Sweep the line string in the z-direction to intersections with a mesh, using a search object for speedup.
|
|
1090
|
-
* @param lineStringPoints input line string to drape on the mesh
|
|
1091
|
-
* @param polyfaceOrVisitor mesh, or mesh visitor to traverse only part of a mesh
|
|
1092
|
-
* @param searchByReadIndex object for searching facet 2D ranges tagged by mesh read index
|
|
1152
|
+
* @param lineStringPoints input line string to drape on the mesh.
|
|
1153
|
+
* @param polyfaceOrVisitor mesh, or mesh visitor to traverse only part of a mesh.
|
|
1154
|
+
* @param searchByReadIndex object for searching facet 2D ranges tagged by mesh read index.
|
|
1093
1155
|
* @example Using a 5x5 indexed search grid:
|
|
1094
1156
|
* ```
|
|
1095
1157
|
* const xyRange = Range2d.createFrom(myPolyface.range());
|
|
@@ -1099,7 +1161,7 @@ export class PolyfaceQuery {
|
|
|
1099
1161
|
* }
|
|
1100
1162
|
* const drapedLineStrings = PolyfaceQuery.sweepLineStringToFacetsXY(lineString, myPolyface, searcher);
|
|
1101
1163
|
* ```
|
|
1102
|
-
* @returns collected line strings
|
|
1164
|
+
* @returns the collected line strings.
|
|
1103
1165
|
*/
|
|
1104
1166
|
static sweepLineStringToFacetsXY(lineStringPoints, polyfaceOrVisitor, searchByReadIndex) {
|
|
1105
1167
|
const chainContext = ChainMergeContext.create();
|
|
@@ -1133,32 +1195,36 @@ export class PolyfaceQuery {
|
|
|
1133
1195
|
chainContext.clusterAndMergeVerticesXYZ();
|
|
1134
1196
|
return chainContext.collectMaximalChains();
|
|
1135
1197
|
}
|
|
1136
|
-
/**
|
|
1198
|
+
/**
|
|
1199
|
+
* Find segments (within the linestring) which project to facets.
|
|
1137
1200
|
* * Return collected line segments.
|
|
1138
1201
|
* * This calls [[sweepLineStringToFacets]] with options created by
|
|
1139
|
-
* `const options = SweepLineStringToFacetsOptions.create(Vector3d.unitZ(), Angle.createSmallAngle(),false, true, true, true);`
|
|
1140
|
-
* @deprecated in 4.x. Use [[sweepLineStringToFacets]] to get further options.
|
|
1202
|
+
* `const options = SweepLineStringToFacetsOptions.create(Vector3d.unitZ(), Angle.createSmallAngle(), false, true, true, true);`
|
|
1203
|
+
* @deprecated in 4.x. Use [[PolyfaceQuery.sweepLineStringToFacets]] to get further options.
|
|
1141
1204
|
*/
|
|
1142
1205
|
static sweepLinestringToFacetsXYReturnLines(linestringPoints, polyface) {
|
|
1143
1206
|
const options = SweepLineStringToFacetsOptions.create(Vector3d.unitZ(), Angle.createSmallAngle(), false, true, true, true);
|
|
1144
1207
|
const result = PolyfaceQuery.sweepLineStringToFacets(linestringPoints, polyface, options);
|
|
1145
1208
|
return result;
|
|
1146
1209
|
}
|
|
1147
|
-
/**
|
|
1210
|
+
/**
|
|
1211
|
+
* Find segments (within the linestring) which project to facets.
|
|
1148
1212
|
* * Return chains.
|
|
1149
1213
|
* * This calls [[sweepLineStringToFacets]] with options created by
|
|
1150
1214
|
* `const options = SweepLineStringToFacetsOptions.create(Vector3d.unitZ(), Angle.createSmallAngle(),true, true, true, true);`
|
|
1151
|
-
* @deprecated in 4.x. Use [[sweepLineStringToFacets]] to get further options.
|
|
1215
|
+
* @deprecated in 4.x. Use [[PolyfaceQuery.sweepLineStringToFacets]] to get further options.
|
|
1152
1216
|
*/
|
|
1153
1217
|
static sweepLinestringToFacetsXYReturnChains(linestringPoints, polyface) {
|
|
1154
1218
|
const options = SweepLineStringToFacetsOptions.create(Vector3d.unitZ(), Angle.createSmallAngle(), true, true, true, true);
|
|
1155
1219
|
const result = PolyfaceQuery.sweepLineStringToFacets(linestringPoints, polyface, options);
|
|
1156
1220
|
return result;
|
|
1157
1221
|
}
|
|
1158
|
-
/**
|
|
1222
|
+
/**
|
|
1223
|
+
* Find segments (within the linestring) which project to facets.
|
|
1159
1224
|
* * This is done as a sequence of "await" steps.
|
|
1160
|
-
* * Each "await" step deals with approximately PolyfaceQuery.asyncWorkLimit pairings of
|
|
1161
|
-
*
|
|
1225
|
+
* * Each "await" step deals with approximately PolyfaceQuery.asyncWorkLimit pairings of "linestring edge"
|
|
1226
|
+
* with "facet edge".
|
|
1227
|
+
* * PolyfaceQuery.setAsyncWorkLimit() to change work blocks from default.
|
|
1162
1228
|
* * Return chains.
|
|
1163
1229
|
* * Facets are ASSUMED to be convex and planar, and not overlap in the z direction.
|
|
1164
1230
|
*/
|
|
@@ -1172,7 +1238,7 @@ export class PolyfaceQuery {
|
|
|
1172
1238
|
return chains;
|
|
1173
1239
|
}
|
|
1174
1240
|
/**
|
|
1175
|
-
*
|
|
1241
|
+
* Examine ranges of facets.
|
|
1176
1242
|
* * Return statistical summary of x,y,z ranges.
|
|
1177
1243
|
*/
|
|
1178
1244
|
static collectRangeLengthData(polyface) {
|
|
@@ -1180,17 +1246,18 @@ export class PolyfaceQuery {
|
|
|
1180
1246
|
return this.collectRangeLengthData(polyface.createVisitor(0));
|
|
1181
1247
|
}
|
|
1182
1248
|
const rangeData = new RangeLengthData();
|
|
1183
|
-
// polyface is a visitor
|
|
1249
|
+
// polyface is a visitor
|
|
1184
1250
|
for (polyface.reset(); polyface.moveToNextFacet();)
|
|
1185
1251
|
rangeData.accumulateGrowableXYZArrayRange(polyface.point);
|
|
1186
1252
|
return rangeData;
|
|
1187
1253
|
}
|
|
1188
|
-
/**
|
|
1189
|
-
*
|
|
1254
|
+
/**
|
|
1255
|
+
* Clone the facets, inserting vertices (within edges) where points not part of each facet's vertex indices
|
|
1256
|
+
* impinge within edges.
|
|
1190
1257
|
*/
|
|
1191
1258
|
static cloneWithTVertexFixup(polyface) {
|
|
1192
|
-
const oldFacetVisitor = polyface.createVisitor(1); //
|
|
1193
|
-
const newFacetVisitor = polyface.createVisitor(0); //
|
|
1259
|
+
const oldFacetVisitor = polyface.createVisitor(1); // this is to visit the existing facets
|
|
1260
|
+
const newFacetVisitor = polyface.createVisitor(0); // this is to build the new facets
|
|
1194
1261
|
const rangeSearcher = XYPointBuckets.create(polyface.data.point, 30);
|
|
1195
1262
|
const builder = PolyfaceBuilder.create();
|
|
1196
1263
|
const edgeRange = Range3d.createNull();
|
|
@@ -1201,7 +1268,7 @@ export class PolyfaceQuery {
|
|
|
1201
1268
|
for (oldFacetVisitor.reset(); oldFacetVisitor.moveToNextFacet();) {
|
|
1202
1269
|
newFacetVisitor.clearArrays();
|
|
1203
1270
|
for (let i = 0; i + 1 < oldFacetVisitor.point.length; i++) {
|
|
1204
|
-
// each base vertex is part of the result
|
|
1271
|
+
// each base vertex is part of the result
|
|
1205
1272
|
oldFacetVisitor.point.getPoint3dAtUncheckedPointIndex(i, point0);
|
|
1206
1273
|
oldFacetVisitor.point.getPoint3dAtUncheckedPointIndex(i + 1, point1);
|
|
1207
1274
|
newFacetVisitor.pushDataFrom(oldFacetVisitor, i);
|
|
@@ -1212,12 +1279,12 @@ export class PolyfaceQuery {
|
|
|
1212
1279
|
edgeRange.extend(point1);
|
|
1213
1280
|
edgeRange.ensureMinLengths(Geometry.smallMetricDistance); // add some slop in case segment is axis-aligned
|
|
1214
1281
|
rangeSearcher.announcePointsInRange(edgeRange, (index, _x, _y, _z) => {
|
|
1215
|
-
// x,y,z has x,y within the range of the search
|
|
1282
|
+
// x,y,z has x,y within the range of the search; test for exact on (in full 3d)
|
|
1216
1283
|
polyface.data.point.getPoint3dAtUncheckedPointIndex(index, spacePoint);
|
|
1217
1284
|
const detail = segment.closestPoint(spacePoint, false);
|
|
1218
1285
|
if (undefined !== detail) {
|
|
1219
|
-
if (detail.fraction > 0.0 && detail.fraction < 1.0 && !detail.point.isAlmostEqual(point0) &&
|
|
1220
|
-
&& spacePoint.isAlmostEqual(detail.point)) {
|
|
1286
|
+
if (detail.fraction > 0.0 && detail.fraction < 1.0 && !detail.point.isAlmostEqual(point0) &&
|
|
1287
|
+
!detail.point.isAlmostEqual(point1) && spacePoint.isAlmostEqual(detail.point)) {
|
|
1221
1288
|
if (detailArray === undefined)
|
|
1222
1289
|
detailArray = [];
|
|
1223
1290
|
detail.a = index;
|
|
@@ -1238,14 +1305,13 @@ export class PolyfaceQuery {
|
|
|
1238
1305
|
return builder.claimPolyface();
|
|
1239
1306
|
}
|
|
1240
1307
|
/**
|
|
1308
|
+
* Compare index arrays formatted as follows. Return 0 if arrays are the same.
|
|
1241
1309
|
* * Each array input structure is: [facetIndex, vertexIndex0, vertexIndex1, ....]
|
|
1242
|
-
* * Vertex indices assumed reversed so
|
|
1243
|
-
* * vertexIndex0 is the lowest index on the facet
|
|
1244
|
-
* * vertexIndex1 is the lowest neighbor of vertex0
|
|
1310
|
+
* * Vertex indices assumed reversed so:
|
|
1311
|
+
* * vertexIndex0 is the lowest index on the facet.
|
|
1312
|
+
* * vertexIndex1 is the lowest neighbor of vertex0.
|
|
1245
1313
|
* * first different entry among vertex indices determines lexical result.
|
|
1246
|
-
* *
|
|
1247
|
-
* @param arrayA
|
|
1248
|
-
* @param arrayB
|
|
1314
|
+
* * hence facets with duplicate indices (whether forward or reversed) are considered equal.
|
|
1249
1315
|
*/
|
|
1250
1316
|
static compareFacetIndexAndVertexIndices(arrayA, arrayB) {
|
|
1251
1317
|
if (arrayA.length !== arrayB.length)
|
|
@@ -1258,9 +1324,11 @@ export class PolyfaceQuery {
|
|
|
1258
1324
|
return 0;
|
|
1259
1325
|
}
|
|
1260
1326
|
/**
|
|
1261
|
-
*
|
|
1327
|
+
* Collect facet duplicates.
|
|
1328
|
+
* @param polyface the polyface.
|
|
1262
1329
|
* @param includeSingletons if true, non-duplicated facets are included in the output.
|
|
1263
|
-
*
|
|
1330
|
+
* @returns an array of arrays describing facet duplication. Each array `entry` in the output contains read
|
|
1331
|
+
* indices of a cluster of facets with the same vertex indices.
|
|
1264
1332
|
*/
|
|
1265
1333
|
static collectDuplicateFacetIndices(polyface, includeSingletons = false) {
|
|
1266
1334
|
const result = [];
|
|
@@ -1271,12 +1339,12 @@ export class PolyfaceQuery {
|
|
|
1271
1339
|
return result;
|
|
1272
1340
|
}
|
|
1273
1341
|
/**
|
|
1274
|
-
*
|
|
1275
|
-
* @
|
|
1276
|
-
*
|
|
1342
|
+
* Announce facet duplicates.
|
|
1343
|
+
* @returns an array of arrays describing facet duplication. Each array `entry` in the output contains read
|
|
1344
|
+
* indices of a cluster of facets with the same vertex indices.
|
|
1277
1345
|
*/
|
|
1278
1346
|
static announceDuplicateFacetIndices(polyface, announceCluster) {
|
|
1279
|
-
const visitor = polyface.createVisitor(0); //
|
|
1347
|
+
const visitor = polyface.createVisitor(0); // this is to visit the existing facets
|
|
1280
1348
|
const facetIndexAndVertexIndices = [];
|
|
1281
1349
|
for (visitor.reset(); visitor.moveToNextFacet();) {
|
|
1282
1350
|
const facetIndex = visitor.currentReadIndex();
|
|
@@ -1284,12 +1352,12 @@ export class PolyfaceQuery {
|
|
|
1284
1352
|
const pointIndex = visitor.pointIndex;
|
|
1285
1353
|
const numPointsThisFacet = pointIndex.length;
|
|
1286
1354
|
let lowIndex = 0;
|
|
1287
|
-
// find the lowest point index
|
|
1355
|
+
// find the lowest point index
|
|
1288
1356
|
for (let i = 1; i < visitor.pointIndex.length; i++) {
|
|
1289
1357
|
if (pointIndex[i] < pointIndex[lowIndex])
|
|
1290
1358
|
lowIndex = i;
|
|
1291
1359
|
}
|
|
1292
|
-
// find its lowest neighbor
|
|
1360
|
+
// find its lowest neighbor; assemble sort array in that direction
|
|
1293
1361
|
if (pointIndex[(lowIndex + 1) % numPointsThisFacet] < pointIndex[(lowIndex + numPointsThisFacet - 1) % numPointsThisFacet]) {
|
|
1294
1362
|
for (let i = 0; i < numPointsThisFacet; i++) {
|
|
1295
1363
|
entry.push(pointIndex[(lowIndex + i) % numPointsThisFacet]);
|
|
@@ -1317,9 +1385,11 @@ export class PolyfaceQuery {
|
|
|
1317
1385
|
announceCluster(clusterArray);
|
|
1318
1386
|
}
|
|
1319
1387
|
}
|
|
1320
|
-
/**
|
|
1388
|
+
/**
|
|
1389
|
+
* Return a new facet set with a subset of facets in polyface.
|
|
1390
|
+
* @param source the polyface.
|
|
1321
1391
|
* @param includeSingletons true to copy facets that only appear once
|
|
1322
|
-
* @param clusterSelector indicates whether duplicate clusters are to have 0, 1, or all facets included
|
|
1392
|
+
* @param clusterSelector indicates whether duplicate clusters are to have 0, 1, or all facets included.
|
|
1323
1393
|
*/
|
|
1324
1394
|
static cloneByFacetDuplication(source, includeSingletons, clusterSelector) {
|
|
1325
1395
|
const builder = PolyfaceBuilder.create();
|
|
@@ -1345,25 +1415,23 @@ export class PolyfaceQuery {
|
|
|
1345
1415
|
});
|
|
1346
1416
|
return builder.claimPolyface();
|
|
1347
1417
|
}
|
|
1348
|
-
/** Clone the facets,
|
|
1349
|
-
*
|
|
1350
|
-
*/
|
|
1418
|
+
/** Clone the facets, removing points that are simply within colinear edges. */
|
|
1351
1419
|
static cloneWithColinearEdgeFixup(polyface) {
|
|
1352
|
-
const oldFacetVisitor = polyface.createVisitor(2); //
|
|
1353
|
-
const newFacetVisitor = polyface.createVisitor(0); //
|
|
1420
|
+
const oldFacetVisitor = polyface.createVisitor(2); // this is to visit the existing facets
|
|
1421
|
+
const newFacetVisitor = polyface.createVisitor(0); // this is to build the new facets
|
|
1354
1422
|
const builder = PolyfaceBuilder.create();
|
|
1355
1423
|
const vector01 = Vector3d.create();
|
|
1356
1424
|
const vector12 = Vector3d.create();
|
|
1357
1425
|
const numPoint = polyface.data.point.length;
|
|
1358
1426
|
const pointState = new Int32Array(numPoint);
|
|
1359
|
-
// FIRST PASS
|
|
1360
|
-
//
|
|
1361
|
-
//
|
|
1362
|
-
//
|
|
1363
|
-
//
|
|
1427
|
+
// FIRST PASS: in each sector of each facet, determine if the sector has colinear incoming and outgoing vectors.
|
|
1428
|
+
// Mark each point as
|
|
1429
|
+
// 0 unvisited
|
|
1430
|
+
// -1 adjacent to a non-colinear sector
|
|
1431
|
+
// n adjacent to n colinear sectors
|
|
1364
1432
|
for (oldFacetVisitor.reset(); oldFacetVisitor.moveToNextFacet();) {
|
|
1365
1433
|
for (let i = 0; i + 2 < oldFacetVisitor.point.length; i++) {
|
|
1366
|
-
// each base vertex is part of the result
|
|
1434
|
+
// each base vertex is part of the result
|
|
1367
1435
|
oldFacetVisitor.point.vectorIndexIndex(i, i + 1, vector01);
|
|
1368
1436
|
oldFacetVisitor.point.vectorIndexIndex(i + 1, i + 2, vector12);
|
|
1369
1437
|
const pointIndex = oldFacetVisitor.clientPointIndex(i + 1);
|
|
@@ -1378,7 +1446,7 @@ export class PolyfaceQuery {
|
|
|
1378
1446
|
}
|
|
1379
1447
|
}
|
|
1380
1448
|
}
|
|
1381
|
-
// SECOND PASS
|
|
1449
|
+
// SECOND PASS: make copies, omitting references to points at colinear sectors.
|
|
1382
1450
|
for (oldFacetVisitor.reset(); oldFacetVisitor.moveToNextFacet();) {
|
|
1383
1451
|
newFacetVisitor.clearArrays();
|
|
1384
1452
|
for (let i = 0; i + 2 < oldFacetVisitor.point.length; i++) {
|
|
@@ -1394,9 +1462,9 @@ export class PolyfaceQuery {
|
|
|
1394
1462
|
}
|
|
1395
1463
|
/**
|
|
1396
1464
|
* Set the edge visibility for specified edges in the polyface.
|
|
1397
|
-
* @param polyface mesh to be edited
|
|
1398
|
-
* @param clusters array of edge references
|
|
1399
|
-
* @param value visibility value (true or false)
|
|
1465
|
+
* @param polyface mesh to be edited.
|
|
1466
|
+
* @param clusters array of edge references.
|
|
1467
|
+
* @param value visibility value (true or false).
|
|
1400
1468
|
*/
|
|
1401
1469
|
static setEdgeVisibility(polyface, clusters, value) {
|
|
1402
1470
|
for (const cluster of clusters) {
|
|
@@ -1411,9 +1479,9 @@ export class PolyfaceQuery {
|
|
|
1411
1479
|
}
|
|
1412
1480
|
/**
|
|
1413
1481
|
* Set the visibility of a particular edge of a particular facet.
|
|
1414
|
-
* @param polyface containing polyface
|
|
1415
|
-
* @param facetIndex facet index
|
|
1416
|
-
* @param vertexIndex vertex index (in vertex array) at which the edge starts
|
|
1482
|
+
* @param polyface containing polyface.
|
|
1483
|
+
* @param facetIndex facet index.
|
|
1484
|
+
* @param vertexIndex vertex index (in vertex array) at which the edge starts.
|
|
1417
1485
|
* @param value visibility value.
|
|
1418
1486
|
*/
|
|
1419
1487
|
static setSingleEdgeVisibility(polyface, facetIndex, vertexIndex, value) {
|
|
@@ -1426,9 +1494,9 @@ export class PolyfaceQuery {
|
|
|
1426
1494
|
}
|
|
1427
1495
|
/**
|
|
1428
1496
|
* Get the visibility of a particular edge of a particular facet.
|
|
1429
|
-
* @param polyface containing polyface
|
|
1430
|
-
* @param facetIndex facet index
|
|
1431
|
-
* @param vertexIndex vertex index (in vertex array) at which the edge starts
|
|
1497
|
+
* @param polyface containing polyface.
|
|
1498
|
+
* @param facetIndex facet index.
|
|
1499
|
+
* @param vertexIndex vertex index (in vertex array) at which the edge starts.
|
|
1432
1500
|
*/
|
|
1433
1501
|
static getSingleEdgeVisibility(polyface, facetIndex, vertexIndex) {
|
|
1434
1502
|
const data = polyface.data;
|
|
@@ -1439,29 +1507,13 @@ export class PolyfaceQuery {
|
|
|
1439
1507
|
return data.edgeVisible[i]; // return visibility of first edge in the face that starts at this vertex
|
|
1440
1508
|
return undefined;
|
|
1441
1509
|
}
|
|
1442
|
-
/** Load all half edges from a mesh to an IndexedEdgeMatcher.
|
|
1443
|
-
* @param polyface a mesh, or a visitor assumed to have numWrap === 1
|
|
1444
|
-
*/
|
|
1445
|
-
static createIndexedEdges(polyface) {
|
|
1446
|
-
if (polyface instanceof Polyface)
|
|
1447
|
-
return this.createIndexedEdges(polyface.createVisitor(1));
|
|
1448
|
-
const edges = new IndexedEdgeMatcher();
|
|
1449
|
-
polyface.reset();
|
|
1450
|
-
while (polyface.moveToNextFacet()) {
|
|
1451
|
-
const numEdges = polyface.pointCount - 1;
|
|
1452
|
-
for (let i = 0; i < numEdges; i++) {
|
|
1453
|
-
edges.addEdge(polyface.clientPointIndex(i), polyface.clientPointIndex(i + 1), polyface.currentReadIndex());
|
|
1454
|
-
}
|
|
1455
|
-
}
|
|
1456
|
-
return edges;
|
|
1457
|
-
}
|
|
1458
1510
|
/**
|
|
1459
1511
|
* Return manifold edge pairs whose dihedral angle is bounded by the given angle.
|
|
1460
1512
|
* * The dihedral angle of a manifold edge is measured between the normals of its two adjacent faces.
|
|
1461
1513
|
* * Boundary edges are not returned as they are not manifold.
|
|
1462
|
-
* @param mesh existing polyface or visitor
|
|
1463
|
-
* @param maxSmoothEdgeAngle maximum dihedral angle of a smooth edge. If undefined
|
|
1464
|
-
* @param sharpEdges true to reverse the angle threshold test and return sharp edges; otherwise return smooth edges (default)
|
|
1514
|
+
* @param mesh existing polyface or visitor.
|
|
1515
|
+
* @param maxSmoothEdgeAngle maximum dihedral angle of a smooth edge. If `undefined`, uses `Geometry.smallAngleRadians`.
|
|
1516
|
+
* @param sharpEdges true to reverse the angle threshold test and return sharp edges; otherwise return smooth edges (default).
|
|
1465
1517
|
*/
|
|
1466
1518
|
static collectEdgesByDihedralAngle(mesh, maxSmoothEdgeAngle, sharpEdges = false) {
|
|
1467
1519
|
if (mesh instanceof Polyface)
|
|
@@ -1496,13 +1548,13 @@ export class PolyfaceQuery {
|
|
|
1496
1548
|
return outEdges;
|
|
1497
1549
|
}
|
|
1498
1550
|
/**
|
|
1551
|
+
* Make paired edges invisible.
|
|
1499
1552
|
* * Find mated pairs among facet edges.
|
|
1500
1553
|
* * Mated pairs have the same vertex indices appearing in opposite order.
|
|
1501
1554
|
* * Mark all non-mated pairs visible.
|
|
1502
1555
|
* * At mated pairs
|
|
1503
1556
|
* * if angle across the edge is larger than `sharpEdgeAngle`, mark visible
|
|
1504
1557
|
* * otherwise mark invisible.
|
|
1505
|
-
* @param mesh mesh to be marked
|
|
1506
1558
|
*/
|
|
1507
1559
|
static markPairedEdgesInvisible(mesh, sharpEdgeAngle) {
|
|
1508
1560
|
const visitor = mesh.createVisitor(1);
|
|
@@ -1531,7 +1583,8 @@ export class PolyfaceQuery {
|
|
|
1531
1583
|
}
|
|
1532
1584
|
}
|
|
1533
1585
|
}
|
|
1534
|
-
/**
|
|
1586
|
+
/**
|
|
1587
|
+
* Try to compute a unit normal for a facet accessible through a visitor.
|
|
1535
1588
|
* * Unit normal is computed by `PolygonOps.unitNormal` with the points around the facet.
|
|
1536
1589
|
*/
|
|
1537
1590
|
static computeFacetUnitNormal(visitor, facetIndex, result) {
|
|
@@ -1544,18 +1597,18 @@ export class PolyfaceQuery {
|
|
|
1544
1597
|
return undefined;
|
|
1545
1598
|
}
|
|
1546
1599
|
/**
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1600
|
+
* * Mark all edge visibilities in the IndexedPolyface.
|
|
1601
|
+
* @param mesh mesh to be marked.
|
|
1602
|
+
* @param value true for visible, false for hidden.
|
|
1603
|
+
*/
|
|
1551
1604
|
static markAllEdgeVisibility(mesh, value) {
|
|
1552
1605
|
const data = mesh.data;
|
|
1553
1606
|
for (let i = 0; i < data.edgeVisible.length; i++)
|
|
1554
1607
|
data.edgeVisible[i] = value;
|
|
1555
1608
|
}
|
|
1556
1609
|
/**
|
|
1557
|
-
* Create a HalfEdgeGraph with a face for each facet of the IndexedPolyface
|
|
1558
|
-
* @param mesh mesh to convert
|
|
1610
|
+
* Create a HalfEdgeGraph with a face for each facet of the IndexedPolyface.
|
|
1611
|
+
* @param mesh mesh to convert.
|
|
1559
1612
|
* @internal
|
|
1560
1613
|
*/
|
|
1561
1614
|
static convertToHalfEdgeGraph(mesh) {
|
|
@@ -1574,28 +1627,22 @@ export class PolyfaceQuery {
|
|
|
1574
1627
|
});
|
|
1575
1628
|
return graph;
|
|
1576
1629
|
}
|
|
1577
|
-
/**
|
|
1578
|
-
* * Examine adjacent facet orientations throughout the mesh
|
|
1579
|
-
* * If possible, reverse a subset to achieve proper pairing.
|
|
1580
|
-
* @param mesh
|
|
1581
|
-
*/
|
|
1630
|
+
/** Examine adjacent facet orientations throughout the mesh. If possible, reverse a subset to achieve proper pairing. */
|
|
1582
1631
|
static reorientVertexOrderAroundFacetsForConsistentOrientation(mesh) {
|
|
1583
1632
|
return FacetOrientationFixup.doFixup(mesh);
|
|
1584
1633
|
}
|
|
1585
|
-
/**
|
|
1586
|
-
* Set up indexed normals with one normal in the plane of each facet of the mesh.
|
|
1587
|
-
* @param polyface
|
|
1588
|
-
*/
|
|
1634
|
+
/** Set up indexed normals with one normal in the plane of each facet of the mesh. */
|
|
1589
1635
|
static buildPerFaceNormals(polyface) {
|
|
1590
1636
|
BuildAverageNormalsContext.buildPerFaceNormals(polyface);
|
|
1591
1637
|
}
|
|
1592
1638
|
/**
|
|
1593
|
-
* * At each vertex of the mesh
|
|
1594
|
-
* * Find clusters of almost parallel normals
|
|
1595
|
-
* * Compute simple average of those normals
|
|
1596
|
-
* * Index to the averages
|
|
1639
|
+
* * At each vertex of the mesh:
|
|
1640
|
+
* * Find clusters of almost parallel normals.
|
|
1641
|
+
* * Compute simple average of those normals.
|
|
1642
|
+
* * Index to the averages.
|
|
1597
1643
|
* * For typical meshes, this correctly clusters adjacent normals.
|
|
1598
|
-
* * One can imagine a vertex with multiple "smooth cone-like" sets of
|
|
1644
|
+
* * One can imagine a vertex with multiple "smooth cone-like" sets of adjacent facets such that averaging occurs
|
|
1645
|
+
* among two nonadjacent cones. But this does not seem to be a problem in practice.
|
|
1599
1646
|
* @param polyface polyface to update.
|
|
1600
1647
|
* @param toleranceAngle averaging is done between normals up to this angle.
|
|
1601
1648
|
*/
|
|
@@ -1604,9 +1651,9 @@ export class PolyfaceQuery {
|
|
|
1604
1651
|
}
|
|
1605
1652
|
/**
|
|
1606
1653
|
* Offset the faces of the mesh.
|
|
1607
|
-
* @param source original mesh
|
|
1654
|
+
* @param source original mesh.
|
|
1608
1655
|
* @param signedOffsetDistance distance to offset
|
|
1609
|
-
* @param offsetOptions angle options.
|
|
1656
|
+
* @param offsetOptions angle options. The default options are recommended.
|
|
1610
1657
|
* @returns shifted mesh.
|
|
1611
1658
|
*/
|
|
1612
1659
|
static cloneOffset(source, signedOffsetDistance, offsetOptions = OffsetMeshOptions.create()) {
|
|
@@ -1615,16 +1662,22 @@ export class PolyfaceQuery {
|
|
|
1615
1662
|
OffsetMeshContext.buildOffsetMeshWithEdgeChamfers(source, offsetBuilder, signedOffsetDistance, offsetOptions);
|
|
1616
1663
|
return offsetBuilder.claimPolyface();
|
|
1617
1664
|
}
|
|
1618
|
-
/**
|
|
1619
|
-
*
|
|
1620
|
-
*
|
|
1665
|
+
/**
|
|
1666
|
+
* Search facets for the first one that intersects the infinite line.
|
|
1667
|
+
* * To process _all_ intersections, callers can supply an `options.acceptIntersection` callback that always
|
|
1668
|
+
* returns `false`.
|
|
1669
|
+
* In this case, `intersectRay3d` will return `undefined`, but the callback will be invoked for each intersection.
|
|
1621
1670
|
* * Example callback logic:
|
|
1622
1671
|
* * Accept the first found facet that intersects the half-line specified by the ray: `return detail.a >= 0.0;`
|
|
1623
|
-
* * Collect all intersections: `myIntersections.push(detail.clone()); return false;` Then after `intersectRay3d`
|
|
1624
|
-
*
|
|
1625
|
-
* @param
|
|
1626
|
-
* @param
|
|
1627
|
-
*
|
|
1672
|
+
* * Collect all intersections: `myIntersections.push(detail.clone()); return false;` Then after `intersectRay3d`
|
|
1673
|
+
* returns, sort along `ray` with `myIntersections.sort((d0, d1) => d0.a - d1.a);`
|
|
1674
|
+
* @param visitor facet iterator.
|
|
1675
|
+
* @param ray infinite line parameterized as a ray. The returned `detail.a` is the intersection parameter on the
|
|
1676
|
+
* ray, e.g., zero at `ray.origin` and increasing in `ray.direction`.
|
|
1677
|
+
* @param options options for computing and populating an intersection detail, and an optional callback for
|
|
1678
|
+
* accepting one.
|
|
1679
|
+
* @return detail for the (accepted) intersection with `detail.IsInsideOrOn === true`, or `undefined` if no
|
|
1680
|
+
* (accepted) intersection.
|
|
1628
1681
|
* @see PolygonOps.intersectRay3d
|
|
1629
1682
|
*/
|
|
1630
1683
|
static intersectRay3d(visitor, ray, options) {
|
|
@@ -1667,7 +1720,8 @@ export class PolyfaceQuery {
|
|
|
1667
1720
|
}
|
|
1668
1721
|
// amount of computation to do per step of async methods.
|
|
1669
1722
|
PolyfaceQuery._asyncWorkLimit = 1.e06;
|
|
1670
|
-
/**
|
|
1723
|
+
/**
|
|
1724
|
+
* Number of "await" steps executed in recent async calls.
|
|
1671
1725
|
* @internal
|
|
1672
1726
|
*/
|
|
1673
1727
|
PolyfaceQuery.awaitBlockCount = 0;
|