@itwin/core-geometry 5.10.0-dev.6 → 5.10.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/CHANGELOG.md +6 -1
- 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.d.ts +28 -29
- package/lib/cjs/clipping/BooleanClipNode.d.ts.map +1 -1
- package/lib/cjs/clipping/BooleanClipNode.js +61 -29
- package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
- package/lib/cjs/clipping/ClipPlane.d.ts +12 -13
- package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPlane.js +19 -12
- package/lib/cjs/clipping/ClipPlane.js.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.d.ts +13 -8
- package/lib/cjs/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js +18 -7
- package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.d.ts +13 -5
- package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/clipping/ClipVector.d.ts +11 -5
- package/lib/cjs/clipping/ClipVector.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipVector.js +22 -7
- package/lib/cjs/clipping/ClipVector.js.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +7 -20
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.js +16 -20
- package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts +8 -19
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +19 -22
- 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/ConstrainedCurve2d.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.d.ts +4 -4
- package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js +5 -6
- 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.d.ts +4 -4
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +4 -6
- 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/AnnounceTangentStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.d.ts +2 -3
- package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js +5 -6
- package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/ChainCollectorContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.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/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PointToCurveTangentHandler.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/TransferWithSplitArcs.js.map +1 -1
- package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.js.map +1 -1
- package/lib/cjs/curve/internalContexts/geometry2d/ConstraintSet.js.map +1 -1
- package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2d.js.map +1 -1
- package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.js.map +1 -1
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedCircle2d.js.map +1 -1
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedEllipse2d.js.map +1 -1
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedHyperbola2d.js.map +1 -1
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedLine2d.js.map +1 -1
- package/lib/cjs/curve/internalContexts/geometry2d/UnboundedParabola2d.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.d.ts.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.d.ts +4 -3
- package/lib/cjs/geometry3d/Ellipsoid.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js +7 -4
- 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.d.ts +16 -11
- package/lib/cjs/geometry3d/Plane3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3d.js +16 -11
- package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
- package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
- package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/cjs/geometry4d/Map4d.js.map +1 -1
- package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
- package/lib/cjs/geometry4d/MomentData.js.map +1 -1
- package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
- package/lib/cjs/geometry4d/Point4d.js.map +1 -1
- package/lib/cjs/numerics/BandedSystem.js.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
- package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
- package/lib/cjs/numerics/Complex.js.map +1 -1
- package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
- package/lib/cjs/numerics/Newton.js.map +1 -1
- package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
- package/lib/cjs/numerics/PolarData.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/cjs/numerics/Quadrature.js.map +1 -1
- package/lib/cjs/numerics/Range1dArray.js.map +1 -1
- package/lib/cjs/numerics/SmallSystem.js.map +1 -1
- package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
- package/lib/cjs/numerics/UnionFind.js.map +1 -1
- package/lib/cjs/numerics/UsageSums.js.map +1 -1
- package/lib/cjs/polyface/AuxData.js.map +1 -1
- package/lib/cjs/polyface/BoxTopology.js.map +1 -1
- package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
- package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
- package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
- package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -1
- 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.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/MinimumValueTester.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
- package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
- package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
- package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
- package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
- package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
- package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
- package/lib/cjs/serialization/BGFBReader.js.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
- package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/cjs/serialization/DeepCompare.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
- package/lib/cjs/solid/Box.js.map +1 -1
- package/lib/cjs/solid/Cone.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/RuledSweep.js.map +1 -1
- package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
- package/lib/cjs/solid/Sphere.js.map +1 -1
- package/lib/cjs/solid/SweepContour.js.map +1 -1
- package/lib/cjs/solid/TorusPipe.js.map +1 -1
- package/lib/cjs/topology/ChainMerge.js.map +1 -1
- package/lib/cjs/topology/Graph.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/Voronoi.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.d.ts +28 -29
- package/lib/esm/clipping/BooleanClipNode.d.ts.map +1 -1
- package/lib/esm/clipping/BooleanClipNode.js +61 -29
- package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
- package/lib/esm/clipping/ClipPlane.d.ts +12 -13
- package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPlane.js +19 -12
- package/lib/esm/clipping/ClipPlane.js.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.d.ts +13 -8
- package/lib/esm/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.js +18 -7
- package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.d.ts +13 -5
- package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/clipping/ClipVector.d.ts +11 -5
- package/lib/esm/clipping/ClipVector.d.ts.map +1 -1
- package/lib/esm/clipping/ClipVector.js +22 -7
- package/lib/esm/clipping/ClipVector.js.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +7 -20
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.js +16 -20
- package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts +8 -19
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +19 -22
- 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/ConstrainedCurve2d.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.d.ts +4 -4
- package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js +5 -6
- 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.d.ts +4 -4
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +4 -6
- 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/AnnounceTangentStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.d.ts +2 -3
- package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js +5 -6
- package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/ChainCollectorContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.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/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/PointToCurveTangentHandler.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/TransferWithSplitArcs.js.map +1 -1
- package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.js.map +1 -1
- package/lib/esm/curve/internalContexts/geometry2d/ConstraintSet.js.map +1 -1
- package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2d.js.map +1 -1
- package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.js.map +1 -1
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedCircle2d.js.map +1 -1
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedEllipse2d.js.map +1 -1
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedHyperbola2d.js.map +1 -1
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedLine2d.js.map +1 -1
- package/lib/esm/curve/internalContexts/geometry2d/UnboundedParabola2d.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.d.ts.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.d.ts +4 -3
- package/lib/esm/geometry3d/Ellipsoid.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js +7 -4
- 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.d.ts +16 -11
- package/lib/esm/geometry3d/Plane3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3d.js +16 -11
- package/lib/esm/geometry3d/Plane3d.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray2d.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/esm/geometry3d/Segment1d.js.map +1 -1
- package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
- package/lib/esm/geometry3d/XYZProps.js.map +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/esm/geometry4d/Map4d.js.map +1 -1
- package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
- package/lib/esm/geometry4d/MomentData.js.map +1 -1
- package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
- package/lib/esm/geometry4d/Point4d.js.map +1 -1
- package/lib/esm/numerics/BandedSystem.js.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
- package/lib/esm/numerics/ClusterableArray.js.map +1 -1
- package/lib/esm/numerics/Complex.js.map +1 -1
- package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
- package/lib/esm/numerics/Newton.js.map +1 -1
- package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
- package/lib/esm/numerics/PolarData.js.map +1 -1
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/lib/esm/numerics/Quadrature.js.map +1 -1
- package/lib/esm/numerics/Range1dArray.js.map +1 -1
- package/lib/esm/numerics/SmallSystem.js.map +1 -1
- package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
- package/lib/esm/numerics/UnionFind.js.map +1 -1
- package/lib/esm/numerics/UsageSums.js.map +1 -1
- package/lib/esm/polyface/AuxData.js.map +1 -1
- package/lib/esm/polyface/BoxTopology.js.map +1 -1
- package/lib/esm/polyface/FacetFaceData.js.map +1 -1
- package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
- package/lib/esm/polyface/FacetOrientation.js.map +1 -1
- package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -1
- 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.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/polyface/RangeLengthData.js.map +1 -1
- package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/MinimumValueTester.js.map +1 -1
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
- package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
- package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
- package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
- package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
- package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
- package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
- package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
- package/lib/esm/serialization/BGFBReader.js.map +1 -1
- package/lib/esm/serialization/BGFBWriter.js.map +1 -1
- package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/esm/serialization/DeepCompare.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
- package/lib/esm/solid/Box.js.map +1 -1
- package/lib/esm/solid/Cone.js.map +1 -1
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/RuledSweep.js.map +1 -1
- package/lib/esm/solid/SolidPrimitive.js.map +1 -1
- package/lib/esm/solid/Sphere.js.map +1 -1
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/lib/esm/solid/TorusPipe.js.map +1 -1
- package/lib/esm/topology/ChainMerge.js.map +1 -1
- package/lib/esm/topology/Graph.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/Voronoi.js.map +1 -1
- package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module CartesianGeometry
|
|
3
|
-
*/
|
|
4
1
|
import { Arc3d } from "../curve/Arc3d";
|
|
5
2
|
import { AnnounceNumberNumber, AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from "../curve/CurvePrimitive";
|
|
6
3
|
import { GrowableXYZArray } from "../geometry3d/GrowableXYZArray";
|
|
@@ -9,20 +6,21 @@ import { Point3d } from "../geometry3d/Point3dVector3d";
|
|
|
9
6
|
import { Range1d } from "../geometry3d/Range";
|
|
10
7
|
import { GrowableXYZArrayCache } from "../geometry3d/ReusableObjectCache";
|
|
11
8
|
import { Clipper, PolygonClipper } from "./ClipUtils";
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
9
|
+
/**
|
|
10
|
+
* BooleanClipNode is an abstract base class for boolean actions by an array of clippers.
|
|
11
|
+
* * Derived class must implement:
|
|
14
12
|
* * The single point test `isPointOnOrInsideChildren`
|
|
15
13
|
* * Boolean operation on 1d intervals `combineIntervals`
|
|
16
|
-
* * The `keepInside` flag controls an additional optional flip of the boolean result
|
|
17
|
-
* * if `keepInside === true`, accept the "inside" of the
|
|
14
|
+
* * The `keepInside` flag controls an additional optional flip of the boolean result:
|
|
15
|
+
* * if `keepInside === true`, accept the "inside" of the child clippers.
|
|
18
16
|
* * if `keepInside === false`, accept the "outside" of the child clippers.
|
|
19
|
-
* * Hence the combinations of derived classes for (OR, AND, XOR) and keepInside are
|
|
20
|
-
* * (OR, true) = simple union (OR), i.e
|
|
21
|
-
* * (OR, false) = complement of union (NOR), i.e
|
|
22
|
-
* * (AND, true) = simple intersection (AND), i.e
|
|
23
|
-
* * (AND, false) = complement of intersection (NAND), i.e
|
|
24
|
-
* * (XOR,true) = simple parity, i.e
|
|
25
|
-
* * (XOR,false) = complement of parity
|
|
17
|
+
* * Hence the combinations of derived classes for (OR, AND, XOR) and keepInside are:
|
|
18
|
+
* * (OR, true) = simple union (OR), i.e., "in" one or more clips.
|
|
19
|
+
* * (OR, false) = complement of union (NOR), i.e., "outside" all clips.
|
|
20
|
+
* * (AND, true) = simple intersection (AND), i.e., "in" all clips.
|
|
21
|
+
* * (AND, false) = complement of intersection (NAND), i.e., "outside" one or more clips.
|
|
22
|
+
* * (XOR, true) = simple parity, i.e., "in" an odd number of clips.
|
|
23
|
+
* * (XOR, false) = complement of parity, i.e., "in" an even number of clips.
|
|
26
24
|
* @internal
|
|
27
25
|
*/
|
|
28
26
|
export declare abstract class BooleanClipNode implements Clipper {
|
|
@@ -37,65 +35,66 @@ export declare abstract class BooleanClipNode implements Clipper {
|
|
|
37
35
|
toJSON(): any;
|
|
38
36
|
/** Capture a (reference to a) child node or nodes */
|
|
39
37
|
captureChild(child: Clipper | Clipper[]): void;
|
|
40
|
-
/** Toggle the "keepInside" behavior. Return the prior value.
|
|
38
|
+
/** Toggle the "keepInside" behavior. Return the prior value. */
|
|
41
39
|
toggleResult(): boolean;
|
|
42
|
-
/** Set the "keepInside" behavior
|
|
40
|
+
/** Set the "keepInside" behavior. */
|
|
43
41
|
selectResult(keepInside: boolean): boolean;
|
|
44
42
|
/**
|
|
45
|
-
* Conditionally (if a1 > a0 strictly) call announce
|
|
43
|
+
* Conditionally (if a1 > a0 strictly) call `announce(a0, a1)`.
|
|
46
44
|
* * Return 0 if not called, 1 if called.
|
|
47
45
|
*/
|
|
48
46
|
protected testedAnnounceNN(a0: number, a1: number, announce?: AnnounceNumberNumber): number;
|
|
49
47
|
/**
|
|
50
|
-
* Conditionally (if a1 > a0 strictly) call announce
|
|
48
|
+
* Conditionally (if a1 > a0 strictly) call `announce(a0, a1, cp)`.
|
|
51
49
|
* * Return 0 if not called, 1 if called.
|
|
52
50
|
*/
|
|
53
51
|
protected testedAnnounceNNC(a0: number, a1: number, cp: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive): number;
|
|
54
|
-
/** Swap the _intervalsA and _intervalsB */
|
|
52
|
+
/** Swap the `_intervalsA` and `_intervalsB`. */
|
|
55
53
|
protected swapAB(): void;
|
|
56
54
|
/**
|
|
57
|
-
* Announce all "outside intervals" --not masked by intervals
|
|
55
|
+
* Announce all "outside intervals" -- not masked by intervals.
|
|
58
56
|
* * Return true if any intervals announced.
|
|
59
57
|
*/
|
|
60
58
|
protected announcePartsNN(keepInside: boolean, intervals: Range1d[], f0: number, f1: number, announce?: AnnounceNumberNumber): boolean;
|
|
61
59
|
/**
|
|
62
|
-
* Announce all "outside intervals" --not masked by intervals
|
|
60
|
+
* Announce all "outside intervals" -- not masked by intervals.
|
|
63
61
|
* * Return true if any intervals announced.
|
|
64
62
|
*/
|
|
65
63
|
protected announcePartsNNC(keepInside: boolean, intervals: Range1d[], f0: number, f1: number, cp: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive): boolean;
|
|
66
|
-
/** Invoke callback to test if a point is "in" this clipper */
|
|
64
|
+
/** Invoke callback to test if a point is "in" this clipper. */
|
|
67
65
|
isPointOnOrInside(point: Point3d): boolean;
|
|
68
|
-
/**
|
|
66
|
+
/** Method from [[Clipper]] interface. */
|
|
69
67
|
announceClippedSegmentIntervals(f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: AnnounceNumberNumber): boolean;
|
|
70
|
-
/**
|
|
68
|
+
/** Method from [[Clipper]] interface. */
|
|
71
69
|
announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean;
|
|
70
|
+
announceClippedCurveIntervals(curve: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive): boolean;
|
|
72
71
|
}
|
|
73
72
|
/**
|
|
74
|
-
* Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children
|
|
73
|
+
* Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children.
|
|
75
74
|
* @internal
|
|
76
75
|
*/
|
|
77
76
|
export declare class BooleanClipNodeUnion extends BooleanClipNode {
|
|
78
77
|
get operationName(): string;
|
|
79
78
|
constructor(keepInside: boolean);
|
|
80
|
-
/** Return true if inside any child clipper */
|
|
79
|
+
/** Return true if inside any child clipper. */
|
|
81
80
|
isPointOnOrInsideChildren(point: Point3d): boolean;
|
|
82
81
|
combineIntervals(operandA: Range1d[], operandB: Range1d[]): Range1d[];
|
|
83
82
|
appendPolygonClip(xyz: IndexedXYZCollection, insideFragments: GrowableXYZArray[], outsideFragments: GrowableXYZArray[], arrayCache: GrowableXYZArrayCache): void;
|
|
84
83
|
}
|
|
85
84
|
/**
|
|
86
|
-
* Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children
|
|
85
|
+
* Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children.
|
|
87
86
|
* @internal
|
|
88
87
|
*/
|
|
89
88
|
export declare class BooleanClipNodeParity extends BooleanClipNode {
|
|
90
89
|
get operationName(): string;
|
|
91
90
|
constructor(keepInside: boolean);
|
|
92
|
-
/** Return true if inside an odd number of clippers child clipper */
|
|
91
|
+
/** Return true if inside an odd number of clippers child clipper. */
|
|
93
92
|
isPointOnOrInsideChildren(point: Point3d): boolean;
|
|
94
93
|
combineIntervals(operandA: Range1d[], operandB: Range1d[]): Range1d[];
|
|
95
94
|
appendPolygonClip(xyz: IndexedXYZCollection, insideFragments: GrowableXYZArray[], outsideFragments: GrowableXYZArray[], arrayCache: GrowableXYZArrayCache): void;
|
|
96
95
|
}
|
|
97
96
|
/**
|
|
98
|
-
* Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children
|
|
97
|
+
* Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children.
|
|
99
98
|
* @internal
|
|
100
99
|
*/
|
|
101
100
|
export declare class BooleanClipNodeIntersection extends BooleanClipNode implements PolygonClipper {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BooleanClipNode.d.ts","sourceRoot":"","sources":["../../../src/clipping/BooleanClipNode.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file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2,28 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module CartesianGeometry
|
|
7
|
+
*/
|
|
8
|
+
import { assert } from "@itwin/core-bentley";
|
|
5
9
|
import { Range1d } from "../geometry3d/Range";
|
|
6
10
|
import { Range1dArray } from "../numerics/Range1dArray";
|
|
7
11
|
import { ClipStepAction, ClipUtilities } from "./ClipUtils";
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
12
|
+
/**
|
|
13
|
+
* BooleanClipNode is an abstract base class for boolean actions by an array of clippers.
|
|
14
|
+
* * Derived class must implement:
|
|
10
15
|
* * The single point test `isPointOnOrInsideChildren`
|
|
11
16
|
* * Boolean operation on 1d intervals `combineIntervals`
|
|
12
|
-
* * The `keepInside` flag controls an additional optional flip of the boolean result
|
|
13
|
-
* * if `keepInside === true`, accept the "inside" of the
|
|
17
|
+
* * The `keepInside` flag controls an additional optional flip of the boolean result:
|
|
18
|
+
* * if `keepInside === true`, accept the "inside" of the child clippers.
|
|
14
19
|
* * if `keepInside === false`, accept the "outside" of the child clippers.
|
|
15
|
-
* * Hence the combinations of derived classes for (OR, AND, XOR) and keepInside are
|
|
16
|
-
* * (OR, true) = simple union (OR), i.e
|
|
17
|
-
* * (OR, false) = complement of union (NOR), i.e
|
|
18
|
-
* * (AND, true) = simple intersection (AND), i.e
|
|
19
|
-
* * (AND, false) = complement of intersection (NAND), i.e
|
|
20
|
-
* * (XOR,true) = simple parity, i.e
|
|
21
|
-
* * (XOR,false) = complement of parity
|
|
20
|
+
* * Hence the combinations of derived classes for (OR, AND, XOR) and keepInside are:
|
|
21
|
+
* * (OR, true) = simple union (OR), i.e., "in" one or more clips.
|
|
22
|
+
* * (OR, false) = complement of union (NOR), i.e., "outside" all clips.
|
|
23
|
+
* * (AND, true) = simple intersection (AND), i.e., "in" all clips.
|
|
24
|
+
* * (AND, false) = complement of intersection (NAND), i.e., "outside" one or more clips.
|
|
25
|
+
* * (XOR, true) = simple parity, i.e., "in" an odd number of clips.
|
|
26
|
+
* * (XOR, false) = complement of parity, i.e., "in" an even number of clips.
|
|
22
27
|
* @internal
|
|
23
28
|
*/
|
|
24
29
|
export class BooleanClipNode {
|
|
@@ -55,18 +60,18 @@ export class BooleanClipNode {
|
|
|
55
60
|
this._clippers.push(child);
|
|
56
61
|
}
|
|
57
62
|
}
|
|
58
|
-
/** Toggle the "keepInside" behavior. Return the prior value.
|
|
63
|
+
/** Toggle the "keepInside" behavior. Return the prior value. */
|
|
59
64
|
toggleResult() {
|
|
60
65
|
return this.selectResult(!this._keepInside);
|
|
61
66
|
}
|
|
62
|
-
/** Set the "keepInside" behavior
|
|
67
|
+
/** Set the "keepInside" behavior. */
|
|
63
68
|
selectResult(keepInside) {
|
|
64
69
|
const s = this._keepInside;
|
|
65
70
|
this._keepInside = keepInside;
|
|
66
71
|
return s;
|
|
67
72
|
}
|
|
68
73
|
/**
|
|
69
|
-
* Conditionally (if a1 > a0 strictly) call announce
|
|
74
|
+
* Conditionally (if a1 > a0 strictly) call `announce(a0, a1)`.
|
|
70
75
|
* * Return 0 if not called, 1 if called.
|
|
71
76
|
*/
|
|
72
77
|
testedAnnounceNN(a0, a1, announce) {
|
|
@@ -78,7 +83,7 @@ export class BooleanClipNode {
|
|
|
78
83
|
return 0;
|
|
79
84
|
}
|
|
80
85
|
/**
|
|
81
|
-
* Conditionally (if a1 > a0 strictly) call announce
|
|
86
|
+
* Conditionally (if a1 > a0 strictly) call `announce(a0, a1, cp)`.
|
|
82
87
|
* * Return 0 if not called, 1 if called.
|
|
83
88
|
*/
|
|
84
89
|
testedAnnounceNNC(a0, a1, cp, announce) {
|
|
@@ -89,14 +94,14 @@ export class BooleanClipNode {
|
|
|
89
94
|
}
|
|
90
95
|
return 0;
|
|
91
96
|
}
|
|
92
|
-
/** Swap the _intervalsA and _intervalsB */
|
|
97
|
+
/** Swap the `_intervalsA` and `_intervalsB`. */
|
|
93
98
|
swapAB() {
|
|
94
99
|
const q = this._intervalsA;
|
|
95
100
|
this._intervalsA = this._intervalsB;
|
|
96
101
|
this._intervalsB = q;
|
|
97
102
|
}
|
|
98
103
|
/**
|
|
99
|
-
* Announce all "outside intervals" --not masked by intervals
|
|
104
|
+
* Announce all "outside intervals" -- not masked by intervals.
|
|
100
105
|
* * Return true if any intervals announced.
|
|
101
106
|
*/
|
|
102
107
|
announcePartsNN(keepInside, intervals, f0, f1, announce) {
|
|
@@ -118,7 +123,7 @@ export class BooleanClipNode {
|
|
|
118
123
|
return numAnnounce > 0;
|
|
119
124
|
}
|
|
120
125
|
/**
|
|
121
|
-
* Announce all "outside intervals" --not masked by intervals
|
|
126
|
+
* Announce all "outside intervals" -- not masked by intervals.
|
|
122
127
|
* * Return true if any intervals announced.
|
|
123
128
|
*/
|
|
124
129
|
announcePartsNNC(keepInside, intervals, f0, f1, cp, announce) {
|
|
@@ -139,12 +144,12 @@ export class BooleanClipNode {
|
|
|
139
144
|
}
|
|
140
145
|
return numAnnounce > 0;
|
|
141
146
|
}
|
|
142
|
-
/** Invoke callback to test if a point is "in" this clipper */
|
|
147
|
+
/** Invoke callback to test if a point is "in" this clipper. */
|
|
143
148
|
isPointOnOrInside(point) {
|
|
144
149
|
const q = this.isPointOnOrInsideChildren(point);
|
|
145
150
|
return this._keepInside ? q : !q;
|
|
146
151
|
}
|
|
147
|
-
/**
|
|
152
|
+
/** Method from [[Clipper]] interface. */
|
|
148
153
|
announceClippedSegmentIntervals(f0, f1, pointA, pointB, announce) {
|
|
149
154
|
this._intervalsA.length = 0;
|
|
150
155
|
const announceIntervalB = (a0, a1) => {
|
|
@@ -171,7 +176,7 @@ export class BooleanClipNode {
|
|
|
171
176
|
}
|
|
172
177
|
return this.announcePartsNN(this._keepInside, this._intervalsA, f0, f1, announce);
|
|
173
178
|
}
|
|
174
|
-
/**
|
|
179
|
+
/** Method from [[Clipper]] interface. */
|
|
175
180
|
announceClippedArcIntervals(arc, announce) {
|
|
176
181
|
this._intervalsA.length = 0;
|
|
177
182
|
const announceIntervalB = (a0, a1) => {
|
|
@@ -192,17 +197,40 @@ export class BooleanClipNode {
|
|
|
192
197
|
}
|
|
193
198
|
return this.announcePartsNNC(this._keepInside, this._intervalsA, 0, 1, arc, announce);
|
|
194
199
|
}
|
|
200
|
+
/* Method from [[Clipper]] interface. */
|
|
201
|
+
announceClippedCurveIntervals(curve, announce) {
|
|
202
|
+
this._intervalsA.length = 0;
|
|
203
|
+
const announceIntervalB = (a0, a1, _cp) => {
|
|
204
|
+
this._intervalsB.push(Range1d.createXX(a0, a1));
|
|
205
|
+
};
|
|
206
|
+
let i = 0;
|
|
207
|
+
for (const c of this._clippers) {
|
|
208
|
+
this._intervalsB.length = 0;
|
|
209
|
+
c.announceClippedCurveIntervals?.(curve, announceIntervalB) ?? assert(false, () => `Expect ${c.constructor.name} to implement announceClippedCurveIntervals`);
|
|
210
|
+
Range1dArray.simplifySortUnion(this._intervalsB);
|
|
211
|
+
if (i === 0) {
|
|
212
|
+
this.swapAB();
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
this._intervalsA = this.combineIntervals(this._intervalsA, this._intervalsB);
|
|
216
|
+
}
|
|
217
|
+
i++;
|
|
218
|
+
}
|
|
219
|
+
return this.announcePartsNNC(this._keepInside, this._intervalsA, 0, 1, curve, announce);
|
|
220
|
+
}
|
|
195
221
|
}
|
|
196
222
|
/**
|
|
197
|
-
* Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children
|
|
223
|
+
* Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children.
|
|
198
224
|
* @internal
|
|
199
225
|
*/
|
|
200
226
|
export class BooleanClipNodeUnion extends BooleanClipNode {
|
|
201
|
-
get operationName() {
|
|
227
|
+
get operationName() {
|
|
228
|
+
return this._keepInside ? "OR" : "NOR";
|
|
229
|
+
}
|
|
202
230
|
constructor(keepInside) {
|
|
203
231
|
super(keepInside);
|
|
204
232
|
}
|
|
205
|
-
/** Return true if inside any child clipper */
|
|
233
|
+
/** Return true if inside any child clipper. */
|
|
206
234
|
isPointOnOrInsideChildren(point) {
|
|
207
235
|
for (const clipper of this._clippers) {
|
|
208
236
|
if (clipper.isPointOnOrInside(point))
|
|
@@ -218,15 +246,17 @@ export class BooleanClipNodeUnion extends BooleanClipNode {
|
|
|
218
246
|
}
|
|
219
247
|
}
|
|
220
248
|
/**
|
|
221
|
-
* Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children
|
|
249
|
+
* Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children.
|
|
222
250
|
* @internal
|
|
223
251
|
*/
|
|
224
252
|
export class BooleanClipNodeParity extends BooleanClipNode {
|
|
225
|
-
get operationName() {
|
|
253
|
+
get operationName() {
|
|
254
|
+
return this._keepInside ? "XOR" : "NXOR";
|
|
255
|
+
}
|
|
226
256
|
constructor(keepInside) {
|
|
227
257
|
super(keepInside);
|
|
228
258
|
}
|
|
229
|
-
/** Return true if inside an odd number of clippers child clipper */
|
|
259
|
+
/** Return true if inside an odd number of clippers child clipper. */
|
|
230
260
|
isPointOnOrInsideChildren(point) {
|
|
231
261
|
let q = false;
|
|
232
262
|
for (const clipper of this._clippers) {
|
|
@@ -243,11 +273,13 @@ export class BooleanClipNodeParity extends BooleanClipNode {
|
|
|
243
273
|
}
|
|
244
274
|
}
|
|
245
275
|
/**
|
|
246
|
-
* Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children
|
|
276
|
+
* Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children.
|
|
247
277
|
* @internal
|
|
248
278
|
*/
|
|
249
279
|
export class BooleanClipNodeIntersection extends BooleanClipNode {
|
|
250
|
-
get operationName() {
|
|
280
|
+
get operationName() {
|
|
281
|
+
return this._keepInside ? "AND" : "NAND";
|
|
282
|
+
}
|
|
251
283
|
constructor(keepInside) {
|
|
252
284
|
super(keepInside);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IAAI,CAAC;IACd,CAAC;IACM,gBAAgB,CAAC,QAAmB,EAAE,QAAmB;QAC9D,OAAO,YAAY,CAAC,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC1D,CAAC;IACM,iBAAiB,CACtB,GAAyB,EACzB,eAAmC,EACnC,gBAAoC,EACpC,UAAiC;QAGjC,aAAa,CAAC,qBAAqB,CACjC,GAAG,EACH,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,gBAAgB,EACrD,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,eAAe,EACrD,SAAS,EACT,cAAc,CAAC,cAAc,EAC7B,cAAc,CAAC,SAAS,EACxB,cAAc,CAAC,QAAQ,EACvB,UAAU,CACX,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\n\r\nimport { Arc3d } from \"../curve/Arc3d\";\r\nimport { AnnounceNumberNumber, AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\r\nimport { IndexedXYZCollection } from \"../geometry3d/IndexedXYZCollection\";\r\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Range1d } from \"../geometry3d/Range\";\r\nimport { GrowableXYZArrayCache } from \"../geometry3d/ReusableObjectCache\";\r\nimport { Range1dArray } from \"../numerics/Range1dArray\";\r\nimport { Clipper, ClipStepAction, ClipUtilities, PolygonClipper } from \"./ClipUtils\";\r\n\r\n/** BooleanClipNode is an abstract base class for boolean actions by an array of clippers.\r\n * * Derived class must implement\r\n * * The single point test `isPointOnOrInsideChildren`\r\n * * Boolean operation on 1d intervals `combineIntervals`\r\n * * The `keepInside` flag controls an additional optional flip of the boolean result.\r\n * * if `keepInside === true`, accept the \"inside\" of the clip clippers\r\n * * if `keepInside === false`, accept the \"outside\" of the child clippers.\r\n * * Hence the combinations of derived classes for (OR, AND, XOR) and keepInside are\r\n * * (OR, true) = simple union (OR), i.e. \"in\" one or more clips\r\n * * (OR, false) = complement of union (NOR), i.e. \"outside\" all clips\r\n * * (AND, true) = simple intersection (AND), i.e. \"in\" all clips\r\n * * (AND, false) = complement of intersection (NAND), i.e. \"outside\" one or more clips\r\n * * (XOR,true) = simple parity, i.e. \"in\" an odd number of clips\r\n * * (XOR,false) = complement of parity ), i.e. \"in\" an even number of clips\r\n * @internal\r\n */\r\nexport abstract class BooleanClipNode implements Clipper {\r\n protected _clippers: Clipper[];\r\n protected _intervalsA: Range1d[];\r\n protected _intervalsB: Range1d[];\r\n protected _keepInside: boolean;\r\n\r\n public constructor(keepInside: boolean) {\r\n this._keepInside = keepInside;\r\n this._clippers = [];\r\n this._intervalsA = [];\r\n this._intervalsB = [];\r\n }\r\n protected abstract isPointOnOrInsideChildren(point: Point3d): boolean;\r\n protected abstract combineIntervals(operandA: Range1d[], operandB: Range1d[]): Range1d[];\r\n public abstract get operationName(): string;\r\n public toJSON(): any {\r\n const data = [];\r\n for (const c of this._clippers) {\r\n const c1 = c as any;\r\n if (c1.toJSON)\r\n data.push(c1.toJSON());\r\n }\r\n // return this.formatJSON(data);\r\n const s = this.operationName;\r\n const json: { [opType: string]: any[] } = {};\r\n json[s] = data;\r\n return json;\r\n }\r\n /** Capture a (reference to a) child node or nodes */\r\n public captureChild(child: Clipper | Clipper[]) {\r\n if (Array.isArray(child)) {\r\n for (const c of child) this.captureChild(c);\r\n } else {\r\n this._clippers.push(child);\r\n }\r\n }\r\n /** Toggle the \"keepInside\" behavior. Return the prior value. */\r\n public toggleResult(): boolean {\r\n return this.selectResult(!this._keepInside);\r\n }\r\n /** Set the \"keepInside\" behavior */\r\n public selectResult(keepInside: boolean): boolean {\r\n const s = this._keepInside;\r\n this._keepInside = keepInside;\r\n return s;\r\n }\r\n /**\r\n * Conditionally (if a1 > a0 strictly) call announce (a0, a1).\r\n * * Return 0 if not called, 1 if called.\r\n */\r\n protected testedAnnounceNN(a0: number, a1: number, announce?: AnnounceNumberNumber): number {\r\n if (a0 < a1) {\r\n if (announce)\r\n announce(a0, a1);\r\n return 1;\r\n }\r\n return 0;\r\n }\r\n /**\r\n * Conditionally (if a1 > a0 strictly) call announce (a0, a1, cp).\r\n * * Return 0 if not called, 1 if called.\r\n */\r\n protected testedAnnounceNNC(\r\n a0: number, a1: number, cp: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive,\r\n ): number {\r\n if (a0 < a1) {\r\n if (announce)\r\n announce(a0, a1, cp);\r\n return 1;\r\n }\r\n return 0;\r\n }\r\n /** Swap the _intervalsA and _intervalsB */\r\n protected swapAB(): void {\r\n const q = this._intervalsA;\r\n this._intervalsA = this._intervalsB;\r\n this._intervalsB = q;\r\n }\r\n /**\r\n * Announce all \"outside intervals\" --not masked by intervals\r\n * * Return true if any intervals announced.\r\n */\r\n protected announcePartsNN(\r\n keepInside: boolean, intervals: Range1d[], f0: number, f1: number, announce?: AnnounceNumberNumber,\r\n ): boolean {\r\n let numAnnounce = 0;\r\n if (!keepInside) {\r\n let lowFraction = f0;\r\n for (const interval of intervals) {\r\n numAnnounce += this.testedAnnounceNN(lowFraction, interval.low, announce);\r\n lowFraction = interval.high;\r\n }\r\n numAnnounce += this.testedAnnounceNN(lowFraction, f1, announce);\r\n } else {\r\n for (const interval of intervals) {\r\n // use f0..f1 ?\r\n numAnnounce += this.testedAnnounceNN(interval.low, interval.high, announce);\r\n }\r\n }\r\n return numAnnounce > 0;\r\n }\r\n /**\r\n * Announce all \"outside intervals\" --not masked by intervals\r\n * * Return true if any intervals announced.\r\n */\r\n protected announcePartsNNC(\r\n keepInside: boolean, intervals: Range1d[], f0: number, f1: number, cp: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive,\r\n ): boolean {\r\n let numAnnounce = 0;\r\n if (!keepInside) {\r\n let lowFraction = f0;\r\n for (const interval of intervals) {\r\n numAnnounce += this.testedAnnounceNNC(lowFraction, interval.low, cp, announce);\r\n lowFraction = interval.high;\r\n }\r\n numAnnounce += this.testedAnnounceNNC(lowFraction, f1, cp, announce);\r\n } else {\r\n for (const interval of intervals) {\r\n // use f0..f1 ?\r\n numAnnounce += this.testedAnnounceNNC(interval.low, interval.high, cp, announce);\r\n }\r\n }\r\n return numAnnounce > 0;\r\n }\r\n /** Invoke callback to test if a point is \"in\" this clipper */\r\n public isPointOnOrInside(point: Point3d): boolean {\r\n const q = this.isPointOnOrInsideChildren(point);\r\n return this._keepInside ? q : !q;\r\n }\r\n /** Announce \"in\" portions of a line segment. See `Clipper.announceClippedSegmentIntervals` */\r\n public announceClippedSegmentIntervals(\r\n f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: AnnounceNumberNumber,\r\n ): boolean {\r\n this._intervalsA.length = 0;\r\n const announceIntervalB = (a0: number, a1: number) => {\r\n this._intervalsB.push(Range1d.createXX(a0, a1));\r\n };\r\n // Strategy:\r\n // _intervalsA is the accumulated UNION of from clippers\r\n // _intervalsB is the current clipper.\r\n // announceIntervalB appends single new interval to _intervalB\r\n // at end, output gaps in _intervalsA\r\n //\r\n let i = 0;\r\n for (const c of this._clippers) {\r\n this._intervalsB.length = 0;\r\n c.announceClippedSegmentIntervals(f0, f1, pointA, pointB, announceIntervalB);\r\n Range1dArray.simplifySortUnion(this._intervalsB);\r\n if (i === 0) {\r\n this.swapAB();\r\n } else {\r\n this._intervalsA = this.combineIntervals(this._intervalsA, this._intervalsB);\r\n }\r\n i++;\r\n }\r\n return this.announcePartsNN(this._keepInside, this._intervalsA, f0, f1, announce);\r\n }\r\n /** Announce \"in\" portions of a line segment. See `Clipper.announceClippedSegmentIntervals` */\r\n public announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\r\n this._intervalsA.length = 0;\r\n const announceIntervalB = (a0: number, a1: number) => {\r\n this._intervalsB.push(Range1d.createXX(a0, a1));\r\n };\r\n let i = 0;\r\n for (const c of this._clippers) {\r\n this._intervalsB.length = 0;\r\n c.announceClippedArcIntervals(arc, announceIntervalB);\r\n Range1dArray.simplifySortUnion(this._intervalsB);\r\n if (i === 0) {\r\n this.swapAB();\r\n } else {\r\n this._intervalsA = this.combineIntervals(this._intervalsA, this._intervalsB);\r\n }\r\n i++;\r\n }\r\n return this.announcePartsNNC(this._keepInside, this._intervalsA, 0, 1, arc, announce);\r\n }\r\n}\r\n\r\n/**\r\n * Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children\r\n * @internal\r\n */\r\nexport class BooleanClipNodeUnion extends BooleanClipNode {\r\n public get operationName(): string { return this._keepInside ? \"OR\" : \"NOR\"; }\r\n public constructor(keepInside: boolean) {\r\n super(keepInside);\r\n }\r\n /** Return true if inside any child clipper */\r\n public isPointOnOrInsideChildren(point: Point3d): boolean {\r\n for (const clipper of this._clippers) {\r\n if (clipper.isPointOnOrInside(point))\r\n return true;\r\n }\r\n return false;\r\n }\r\n public combineIntervals(operandA: Range1d[], operandB: Range1d[]): Range1d[] {\r\n return Range1dArray.unionSorted(operandA, operandB);\r\n }\r\n public appendPolygonClip(\r\n xyz: IndexedXYZCollection,\r\n insideFragments: GrowableXYZArray[],\r\n outsideFragments: GrowableXYZArray[],\r\n arrayCache: GrowableXYZArrayCache,\r\n ) {\r\n ClipUtilities.doPolygonClipSequence(\r\n xyz,\r\n this._clippers,\r\n this._keepInside ? insideFragments : outsideFragments,\r\n this._keepInside ? outsideFragments : insideFragments,\r\n undefined,\r\n ClipStepAction.acceptIn,\r\n ClipStepAction.passToNextStep,\r\n ClipStepAction.acceptOut,\r\n arrayCache,\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children\r\n * @internal\r\n */\r\nexport class BooleanClipNodeParity extends BooleanClipNode {\r\n public get operationName(): string { return this._keepInside ? \"XOR\" : \"NXOR\"; }\r\n public constructor(keepInside: boolean) {\r\n super(keepInside);\r\n }\r\n /** Return true if inside an odd number of clippers child clipper */\r\n public isPointOnOrInsideChildren(point: Point3d): boolean {\r\n let q = false;\r\n for (const clipper of this._clippers) {\r\n if (clipper.isPointOnOrInside(point))\r\n q = !q;\r\n }\r\n return q;\r\n }\r\n public combineIntervals(operandA: Range1d[], operandB: Range1d[]): Range1d[] {\r\n return Range1dArray.paritySorted(operandA, operandB);\r\n }\r\n public appendPolygonClip(\r\n xyz: IndexedXYZCollection,\r\n insideFragments: GrowableXYZArray[],\r\n outsideFragments: GrowableXYZArray[],\r\n arrayCache: GrowableXYZArrayCache,\r\n ) {\r\n ClipUtilities.doPolygonClipParitySequence(\r\n xyz,\r\n this._clippers,\r\n this._keepInside ? insideFragments : outsideFragments,\r\n this._keepInside ? outsideFragments : insideFragments,\r\n arrayCache,\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children\r\n * @internal\r\n */\r\nexport class BooleanClipNodeIntersection extends BooleanClipNode implements PolygonClipper {\r\n public get operationName(): string { return this._keepInside ? \"AND\" : \"NAND\"; }\r\n public constructor(keepInside: boolean) {\r\n super(keepInside);\r\n }\r\n /** Return false if outside of any child clipper */\r\n public isPointOnOrInsideChildren(point: Point3d): boolean {\r\n for (const clipper of this._clippers) {\r\n if (!clipper.isPointOnOrInside(point))\r\n return false;\r\n }\r\n return true;\r\n }\r\n public combineIntervals(operandA: Range1d[], operandB: Range1d[]): Range1d[] {\r\n return Range1dArray.intersectSorted(operandA, operandB);\r\n }\r\n public appendPolygonClip(\r\n xyz: IndexedXYZCollection,\r\n insideFragments: GrowableXYZArray[],\r\n outsideFragments: GrowableXYZArray[],\r\n arrayCache: GrowableXYZArrayCache,\r\n ) {\r\n\r\n ClipUtilities.doPolygonClipSequence(\r\n xyz,\r\n this._clippers,\r\n this._keepInside ? insideFragments : outsideFragments,\r\n this._keepInside ? outsideFragments : insideFragments,\r\n undefined,\r\n ClipStepAction.passToNextStep,\r\n ClipStepAction.acceptOut,\r\n ClipStepAction.acceptIn,\r\n arrayCache,\r\n );\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"BooleanClipNode.js","sourceRoot":"","sources":["../../../src/clipping/BooleanClipNode.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAM7C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAW,cAAc,EAAE,aAAa,EAAkB,MAAM,aAAa,CAAC;AAErF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAgB,eAAe;IACzB,SAAS,CAAY;IACrB,WAAW,CAAY;IACvB,WAAW,CAAY;IACvB,WAAW,CAAU;IAC/B,YAAmB,UAAmB;QACpC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;IACxB,CAAC;IAIM,MAAM;QACX,MAAM,IAAI,GAAG,EAAE,CAAC;QAChB,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YAC/B,MAAM,EAAE,GAAG,CAAQ,CAAC;YACpB,IAAI,EAAE,CAAC,MAAM;gBACX,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;QAC3B,CAAC;QACD,gCAAgC;QAChC,MAAM,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC;QAC7B,MAAM,IAAI,GAAgC,EAAE,CAAC;QAC7C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ACrC,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC;gBACnC,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACM,gBAAgB,CAAC,QAAmB,EAAE,QAAmB;QAC9D,OAAO,YAAY,CAAC,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC1D,CAAC;IACM,iBAAiB,CACtB,GAAyB,EACzB,eAAmC,EACnC,gBAAoC,EACpC,UAAiC;QAGjC,aAAa,CAAC,qBAAqB,CACjC,GAAG,EACH,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,gBAAgB,EACrD,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,eAAe,EACrD,SAAS,EACT,cAAc,CAAC,cAAc,EAC7B,cAAc,CAAC,SAAS,EACxB,cAAc,CAAC,QAAQ,EACvB,UAAU,CACX,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module CartesianGeometry\n */\n\nimport { assert } from \"@itwin/core-bentley\";\nimport { Arc3d } from \"../curve/Arc3d\";\nimport { AnnounceNumberNumber, AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from \"../curve/CurvePrimitive\";\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\nimport { IndexedXYZCollection } from \"../geometry3d/IndexedXYZCollection\";\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\nimport { Range1d } from \"../geometry3d/Range\";\nimport { GrowableXYZArrayCache } from \"../geometry3d/ReusableObjectCache\";\nimport { Range1dArray } from \"../numerics/Range1dArray\";\nimport { Clipper, ClipStepAction, ClipUtilities, PolygonClipper } from \"./ClipUtils\";\n\n/**\n * BooleanClipNode is an abstract base class for boolean actions by an array of clippers.\n * * Derived class must implement:\n * * The single point test `isPointOnOrInsideChildren`\n * * Boolean operation on 1d intervals `combineIntervals`\n * * The `keepInside` flag controls an additional optional flip of the boolean result:\n * * if `keepInside === true`, accept the \"inside\" of the child clippers.\n * * if `keepInside === false`, accept the \"outside\" of the child clippers.\n * * Hence the combinations of derived classes for (OR, AND, XOR) and keepInside are:\n * * (OR, true) = simple union (OR), i.e., \"in\" one or more clips.\n * * (OR, false) = complement of union (NOR), i.e., \"outside\" all clips.\n * * (AND, true) = simple intersection (AND), i.e., \"in\" all clips.\n * * (AND, false) = complement of intersection (NAND), i.e., \"outside\" one or more clips.\n * * (XOR, true) = simple parity, i.e., \"in\" an odd number of clips.\n * * (XOR, false) = complement of parity, i.e., \"in\" an even number of clips.\n * @internal\n */\nexport abstract class BooleanClipNode implements Clipper {\n protected _clippers: Clipper[];\n protected _intervalsA: Range1d[];\n protected _intervalsB: Range1d[];\n protected _keepInside: boolean;\n public constructor(keepInside: boolean) {\n this._keepInside = keepInside;\n this._clippers = [];\n this._intervalsA = [];\n this._intervalsB = [];\n }\n protected abstract isPointOnOrInsideChildren(point: Point3d): boolean;\n protected abstract combineIntervals(operandA: Range1d[], operandB: Range1d[]): Range1d[];\n public abstract get operationName(): string;\n public toJSON(): any {\n const data = [];\n for (const c of this._clippers) {\n const c1 = c as any;\n if (c1.toJSON)\n data.push(c1.toJSON());\n }\n // return this.formatJSON(data);\n const s = this.operationName;\n const json: { [opType: string]: any[] } = {};\n json[s] = data;\n return json;\n }\n /** Capture a (reference to a) child node or nodes */\n public captureChild(child: Clipper | Clipper[]) {\n if (Array.isArray(child)) {\n for (const c of child) this.captureChild(c);\n } else {\n this._clippers.push(child);\n }\n }\n /** Toggle the \"keepInside\" behavior. Return the prior value. */\n public toggleResult(): boolean {\n return this.selectResult(!this._keepInside);\n }\n /** Set the \"keepInside\" behavior. */\n public selectResult(keepInside: boolean): boolean {\n const s = this._keepInside;\n this._keepInside = keepInside;\n return s;\n }\n /**\n * Conditionally (if a1 > a0 strictly) call `announce(a0, a1)`.\n * * Return 0 if not called, 1 if called.\n */\n protected testedAnnounceNN(a0: number, a1: number, announce?: AnnounceNumberNumber): number {\n if (a0 < a1) {\n if (announce)\n announce(a0, a1);\n return 1;\n }\n return 0;\n }\n /**\n * Conditionally (if a1 > a0 strictly) call `announce(a0, a1, cp)`.\n * * Return 0 if not called, 1 if called.\n */\n protected testedAnnounceNNC(\n a0: number, a1: number, cp: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive,\n ): number {\n if (a0 < a1) {\n if (announce)\n announce(a0, a1, cp);\n return 1;\n }\n return 0;\n }\n /** Swap the `_intervalsA` and `_intervalsB`. */\n protected swapAB(): void {\n const q = this._intervalsA;\n this._intervalsA = this._intervalsB;\n this._intervalsB = q;\n }\n /**\n * Announce all \"outside intervals\" -- not masked by intervals.\n * * Return true if any intervals announced.\n */\n protected announcePartsNN(\n keepInside: boolean, intervals: Range1d[], f0: number, f1: number, announce?: AnnounceNumberNumber,\n ): boolean {\n let numAnnounce = 0;\n if (!keepInside) {\n let lowFraction = f0;\n for (const interval of intervals) {\n numAnnounce += this.testedAnnounceNN(lowFraction, interval.low, announce);\n lowFraction = interval.high;\n }\n numAnnounce += this.testedAnnounceNN(lowFraction, f1, announce);\n } else {\n for (const interval of intervals) {\n // use f0..f1 ?\n numAnnounce += this.testedAnnounceNN(interval.low, interval.high, announce);\n }\n }\n return numAnnounce > 0;\n }\n /**\n * Announce all \"outside intervals\" -- not masked by intervals.\n * * Return true if any intervals announced.\n */\n protected announcePartsNNC(\n keepInside: boolean, intervals: Range1d[], f0: number, f1: number, cp: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive,\n ): boolean {\n let numAnnounce = 0;\n if (!keepInside) {\n let lowFraction = f0;\n for (const interval of intervals) {\n numAnnounce += this.testedAnnounceNNC(lowFraction, interval.low, cp, announce);\n lowFraction = interval.high;\n }\n numAnnounce += this.testedAnnounceNNC(lowFraction, f1, cp, announce);\n } else {\n for (const interval of intervals) {\n // use f0..f1 ?\n numAnnounce += this.testedAnnounceNNC(interval.low, interval.high, cp, announce);\n }\n }\n return numAnnounce > 0;\n }\n /** Invoke callback to test if a point is \"in\" this clipper. */\n public isPointOnOrInside(point: Point3d): boolean {\n const q = this.isPointOnOrInsideChildren(point);\n return this._keepInside ? q : !q;\n }\n /** Method from [[Clipper]] interface. */\n public announceClippedSegmentIntervals(\n f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: AnnounceNumberNumber,\n ): boolean {\n this._intervalsA.length = 0;\n const announceIntervalB = (a0: number, a1: number) => {\n this._intervalsB.push(Range1d.createXX(a0, a1));\n };\n // Strategy:\n // _intervalsA is the accumulated UNION of from clippers\n // _intervalsB is the current clipper.\n // announceIntervalB appends single new interval to _intervalB\n // at end, output gaps in _intervalsA\n //\n let i = 0;\n for (const c of this._clippers) {\n this._intervalsB.length = 0;\n c.announceClippedSegmentIntervals(f0, f1, pointA, pointB, announceIntervalB);\n Range1dArray.simplifySortUnion(this._intervalsB);\n if (i === 0) {\n this.swapAB();\n } else {\n this._intervalsA = this.combineIntervals(this._intervalsA, this._intervalsB);\n }\n i++;\n }\n return this.announcePartsNN(this._keepInside, this._intervalsA, f0, f1, announce);\n }\n /** Method from [[Clipper]] interface. */\n public announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\n this._intervalsA.length = 0;\n const announceIntervalB = (a0: number, a1: number) => {\n this._intervalsB.push(Range1d.createXX(a0, a1));\n };\n let i = 0;\n for (const c of this._clippers) {\n this._intervalsB.length = 0;\n c.announceClippedArcIntervals(arc, announceIntervalB);\n Range1dArray.simplifySortUnion(this._intervalsB);\n if (i === 0) {\n this.swapAB();\n } else {\n this._intervalsA = this.combineIntervals(this._intervalsA, this._intervalsB);\n }\n i++;\n }\n return this.announcePartsNNC(this._keepInside, this._intervalsA, 0, 1, arc, announce);\n }\n /* Method from [[Clipper]] interface. */\n public announceClippedCurveIntervals(curve: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\n this._intervalsA.length = 0;\n const announceIntervalB = (a0: number, a1: number, _cp: CurvePrimitive) => {\n this._intervalsB.push(Range1d.createXX(a0, a1));\n };\n let i = 0;\n for (const c of this._clippers) {\n this._intervalsB.length = 0;\n c.announceClippedCurveIntervals?.(curve, announceIntervalB) ?? assert(false, () => `Expect ${c.constructor.name} to implement announceClippedCurveIntervals`);\n Range1dArray.simplifySortUnion(this._intervalsB);\n if (i === 0) {\n this.swapAB();\n } else {\n this._intervalsA = this.combineIntervals(this._intervalsA, this._intervalsB);\n }\n i++;\n }\n return this.announcePartsNNC(this._keepInside, this._intervalsA, 0, 1, curve, announce);\n }\n}\n\n/**\n * Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children.\n * @internal\n */\nexport class BooleanClipNodeUnion extends BooleanClipNode {\n public get operationName(): string {\n return this._keepInside ? \"OR\" : \"NOR\";\n }\n public constructor(keepInside: boolean) {\n super(keepInside);\n }\n /** Return true if inside any child clipper. */\n public isPointOnOrInsideChildren(point: Point3d): boolean {\n for (const clipper of this._clippers) {\n if (clipper.isPointOnOrInside(point))\n return true;\n }\n return false;\n }\n public combineIntervals(operandA: Range1d[], operandB: Range1d[]): Range1d[] {\n return Range1dArray.unionSorted(operandA, operandB);\n }\n public appendPolygonClip(\n xyz: IndexedXYZCollection,\n insideFragments: GrowableXYZArray[],\n outsideFragments: GrowableXYZArray[],\n arrayCache: GrowableXYZArrayCache,\n ) {\n ClipUtilities.doPolygonClipSequence(\n xyz,\n this._clippers,\n this._keepInside ? insideFragments : outsideFragments,\n this._keepInside ? outsideFragments : insideFragments,\n undefined,\n ClipStepAction.acceptIn,\n ClipStepAction.passToNextStep,\n ClipStepAction.acceptOut,\n arrayCache,\n );\n }\n}\n\n/**\n * Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children.\n * @internal\n */\nexport class BooleanClipNodeParity extends BooleanClipNode {\n public get operationName(): string {\n return this._keepInside ? \"XOR\" : \"NXOR\";\n }\n public constructor(keepInside: boolean) {\n super(keepInside);\n }\n /** Return true if inside an odd number of clippers child clipper. */\n public isPointOnOrInsideChildren(point: Point3d): boolean {\n let q = false;\n for (const clipper of this._clippers) {\n if (clipper.isPointOnOrInside(point))\n q = !q;\n }\n return q;\n }\n public combineIntervals(operandA: Range1d[], operandB: Range1d[]): Range1d[] {\n return Range1dArray.paritySorted(operandA, operandB);\n }\n public appendPolygonClip(\n xyz: IndexedXYZCollection,\n insideFragments: GrowableXYZArray[],\n outsideFragments: GrowableXYZArray[],\n arrayCache: GrowableXYZArrayCache,\n ) {\n ClipUtilities.doPolygonClipParitySequence(\n xyz,\n this._clippers,\n this._keepInside ? insideFragments : outsideFragments,\n this._keepInside ? outsideFragments : insideFragments,\n arrayCache,\n );\n }\n}\n\n/**\n * Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children.\n * @internal\n */\nexport class BooleanClipNodeIntersection extends BooleanClipNode implements PolygonClipper {\n public get operationName(): string {\n return this._keepInside ? \"AND\" : \"NAND\";\n }\n public constructor(keepInside: boolean) {\n super(keepInside);\n }\n /** Return false if outside of any child clipper */\n public isPointOnOrInsideChildren(point: Point3d): boolean {\n for (const clipper of this._clippers) {\n if (!clipper.isPointOnOrInside(point))\n return false;\n }\n return true;\n }\n public combineIntervals(operandA: Range1d[], operandB: Range1d[]): Range1d[] {\n return Range1dArray.intersectSorted(operandA, operandB);\n }\n public appendPolygonClip(\n xyz: IndexedXYZCollection,\n insideFragments: GrowableXYZArray[],\n outsideFragments: GrowableXYZArray[],\n arrayCache: GrowableXYZArrayCache,\n ) {\n\n ClipUtilities.doPolygonClipSequence(\n xyz,\n this._clippers,\n this._keepInside ? insideFragments : outsideFragments,\n this._keepInside ? outsideFragments : insideFragments,\n undefined,\n ClipStepAction.passToNextStep,\n ClipStepAction.acceptOut,\n ClipStepAction.acceptIn,\n arrayCache,\n );\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Arc3d } from "../curve/Arc3d";
|
|
2
|
-
import { AnnounceNumberNumberCurvePrimitive } from "../curve/CurvePrimitive";
|
|
2
|
+
import { AnnounceNumberNumber, AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from "../curve/CurvePrimitive";
|
|
3
3
|
import { Angle } from "../geometry3d/Angle";
|
|
4
4
|
import { GrowableFloat64Array } from "../geometry3d/GrowableFloat64Array";
|
|
5
5
|
import { GrowableXYZArray } from "../geometry3d/GrowableXYZArray";
|
|
@@ -36,7 +36,7 @@ export interface ClipPlaneProps {
|
|
|
36
36
|
* More details can be found at docs/learning/geometry/Clipping.md
|
|
37
37
|
*
|
|
38
38
|
* Hence
|
|
39
|
-
* * The halfspace function evaluation for
|
|
39
|
+
* * The halfspace function evaluation for point (x,y,z) is `(x,y,z) DOT (u,v,w) - signedDistance`.
|
|
40
40
|
* * POSITIVE values of the halfspace function are "inside".
|
|
41
41
|
* * ZERO value of the halfspace function is "on".
|
|
42
42
|
* * NEGATIVE value of the halfspace function is "outside".
|
|
@@ -49,7 +49,7 @@ export declare class ClipPlane extends Plane3d implements Clipper, PolygonClippe
|
|
|
49
49
|
/**
|
|
50
50
|
* Construct a parallel plane through the origin.
|
|
51
51
|
* * Move it to the actual position.
|
|
52
|
-
* * _distanceFromOrigin is the distance it moved, with the (inward) normal direction as positive
|
|
52
|
+
* * _distanceFromOrigin is the distance it moved, with the (inward) normal direction as positive.
|
|
53
53
|
*/
|
|
54
54
|
private _distanceFromOrigin;
|
|
55
55
|
private _invisible;
|
|
@@ -205,17 +205,16 @@ export declare class ClipPlane extends Plane3d implements Clipper, PolygonClippe
|
|
|
205
205
|
*/
|
|
206
206
|
isPointOn(point: Point3d, tolerance?: number): boolean;
|
|
207
207
|
/**
|
|
208
|
-
* Compute intersections of an (UNBOUNDED) arc with the plane.
|
|
209
|
-
* @param arc arc to test.
|
|
210
|
-
* @param intersectionRadians array to receive results
|
|
208
|
+
* Compute intersections of an (UNBOUNDED) arc with the plane. Append them (as radians) to a growing array.
|
|
209
|
+
* @param arc arc to test. The angle limits of the arc are NOT considered.
|
|
210
|
+
* @param intersectionRadians array to receive results.
|
|
211
211
|
*/
|
|
212
212
|
appendIntersectionRadians(arc: Arc3d, intersectionRadians: GrowableFloat64Array): void;
|
|
213
|
-
private static
|
|
214
|
-
/**
|
|
215
|
-
* Announce fractional intervals of arc clip.
|
|
216
|
-
* * Each call to `announce(fraction0, fraction1, arc)` announces one interval that is inside the clip plane.
|
|
217
|
-
*/
|
|
213
|
+
private static _clipFractionArray;
|
|
214
|
+
/** Method from [[Clipper]] interface. */
|
|
218
215
|
announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean;
|
|
216
|
+
/** Method from [[Clipper]] interface. */
|
|
217
|
+
announceClippedCurveIntervals(curve: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive): boolean;
|
|
219
218
|
/**
|
|
220
219
|
* Compute intersection of (unbounded) segment with the plane.
|
|
221
220
|
* * If the ends are on the same side of the plane, return undefined.
|
|
@@ -262,8 +261,8 @@ export declare class ClipPlane extends Plane3d implements Clipper, PolygonClippe
|
|
|
262
261
|
* * Both params default to true to get the full effect of transforming space.
|
|
263
262
|
*/
|
|
264
263
|
multiplyPlaneByMatrix4d(matrix: Matrix4d, invert?: boolean, transpose?: boolean): boolean;
|
|
265
|
-
/**
|
|
266
|
-
announceClippedSegmentIntervals(f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?:
|
|
264
|
+
/** Method from [[Clipper]] interface. */
|
|
265
|
+
announceClippedSegmentIntervals(f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: AnnounceNumberNumber): boolean;
|
|
267
266
|
/**
|
|
268
267
|
* Return a coordinate frame with
|
|
269
268
|
* * origin at closest point to global origin
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClipPlane.d.ts","sourceRoot":"","sources":["../../../src/clipping/ClipPlane.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"ClipPlane.d.ts","sourceRoot":"","sources":["../../../src/clipping/ClipPlane.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EAAE,oBAAoB,EAAE,kCAAkC,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEnH,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAW,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAAE,OAAO,EAAiB,cAAc,EAAE,MAAM,aAAa,CAAC;AAErE;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,iCAAiC;IACjC,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,mDAAmD;IACnD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,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C,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO;CAI9F"}
|
|
@@ -26,7 +26,7 @@ import { ClipUtilities } from "./ClipUtils";
|
|
|
26
26
|
* More details can be found at docs/learning/geometry/Clipping.md
|
|
27
27
|
*
|
|
28
28
|
* Hence
|
|
29
|
-
* * The halfspace function evaluation for
|
|
29
|
+
* * The halfspace function evaluation for point (x,y,z) is `(x,y,z) DOT (u,v,w) - signedDistance`.
|
|
30
30
|
* * POSITIVE values of the halfspace function are "inside".
|
|
31
31
|
* * ZERO value of the halfspace function is "on".
|
|
32
32
|
* * NEGATIVE value of the halfspace function is "outside".
|
|
@@ -39,7 +39,7 @@ export class ClipPlane extends Plane3d {
|
|
|
39
39
|
/**
|
|
40
40
|
* Construct a parallel plane through the origin.
|
|
41
41
|
* * Move it to the actual position.
|
|
42
|
-
* * _distanceFromOrigin is the distance it moved, with the (inward) normal direction as positive
|
|
42
|
+
* * _distanceFromOrigin is the distance it moved, with the (inward) normal direction as positive.
|
|
43
43
|
*/
|
|
44
44
|
_distanceFromOrigin;
|
|
45
45
|
_invisible;
|
|
@@ -375,9 +375,9 @@ export class ClipPlane extends Plane3d {
|
|
|
375
375
|
return Math.abs(this.altitude(point)) <= tolerance;
|
|
376
376
|
}
|
|
377
377
|
/**
|
|
378
|
-
* Compute intersections of an (UNBOUNDED) arc with the plane.
|
|
379
|
-
* @param arc arc to test.
|
|
380
|
-
* @param intersectionRadians array to receive results
|
|
378
|
+
* Compute intersections of an (UNBOUNDED) arc with the plane. Append them (as radians) to a growing array.
|
|
379
|
+
* @param arc arc to test. The angle limits of the arc are NOT considered.
|
|
380
|
+
* @param intersectionRadians array to receive results.
|
|
381
381
|
*/
|
|
382
382
|
appendIntersectionRadians(arc, intersectionRadians) {
|
|
383
383
|
const arcVectors = arc.toVectors();
|
|
@@ -386,18 +386,25 @@ export class ClipPlane extends Plane3d {
|
|
|
386
386
|
const gamma = this.velocity(arcVectors.vector90);
|
|
387
387
|
AnalyticRoots.appendImplicitLineUnitCircleIntersections(alpha, beta, gamma, undefined, undefined, intersectionRadians);
|
|
388
388
|
}
|
|
389
|
-
static
|
|
390
|
-
/**
|
|
391
|
-
* Announce fractional intervals of arc clip.
|
|
392
|
-
* * Each call to `announce(fraction0, fraction1, arc)` announces one interval that is inside the clip plane.
|
|
393
|
-
*/
|
|
389
|
+
static _clipFractionArray = new GrowableFloat64Array();
|
|
390
|
+
/** Method from [[Clipper]] interface. */
|
|
394
391
|
announceClippedArcIntervals(arc, announce) {
|
|
395
|
-
const breaks = ClipPlane.
|
|
392
|
+
const breaks = ClipPlane._clipFractionArray;
|
|
396
393
|
breaks.clear();
|
|
397
394
|
this.appendIntersectionRadians(arc, breaks);
|
|
398
395
|
arc.sweep.radiansArrayToPositivePeriodicFractions(breaks);
|
|
399
396
|
return ClipUtilities.selectIntervals01(arc, breaks, this, announce);
|
|
400
397
|
}
|
|
398
|
+
/** Method from [[Clipper]] interface. */
|
|
399
|
+
announceClippedCurveIntervals(curve, announce) {
|
|
400
|
+
const breaks = ClipPlane._clipFractionArray;
|
|
401
|
+
breaks.clear();
|
|
402
|
+
const results = [];
|
|
403
|
+
curve.appendPlaneIntersectionPoints(this, results);
|
|
404
|
+
for (const r of results)
|
|
405
|
+
breaks.push(r.fraction);
|
|
406
|
+
return ClipUtilities.selectIntervals01(curve, breaks, this, announce);
|
|
407
|
+
}
|
|
401
408
|
/**
|
|
402
409
|
* Compute intersection of (unbounded) segment with the plane.
|
|
403
410
|
* * If the ends are on the same side of the plane, return undefined.
|
|
@@ -492,7 +499,7 @@ export class ClipPlane extends Plane3d {
|
|
|
492
499
|
this.setPlane4d(plane);
|
|
493
500
|
return true;
|
|
494
501
|
}
|
|
495
|
-
/**
|
|
502
|
+
/** Method from [[Clipper]] interface. */
|
|
496
503
|
announceClippedSegmentIntervals(f0, f1, pointA, pointB, announce) {
|
|
497
504
|
if (f1 < f0)
|
|
498
505
|
return false;
|