@itwin/core-geometry 4.1.0-dev.6 → 4.1.0-dev.63
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 +62 -1
- package/lib/cjs/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js +2 -0
- package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
- package/lib/cjs/core-geometry.d.ts +1 -0
- package/lib/cjs/core-geometry.d.ts.map +1 -1
- package/lib/cjs/core-geometry.js +4 -1
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +1 -0
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +1 -0
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +61 -41
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js +69 -46
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +36 -26
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +46 -39
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveCurve.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCurve.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.d.ts +67 -3
- package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
- package/lib/cjs/curve/CurveFactory.js +75 -7
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts +6 -6
- package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js +9 -7
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.d.ts +4 -3
- package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js +4 -3
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/LineSegment3d.d.ts +6 -4
- package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js +4 -4
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +1 -1
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +1 -1
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/Loop.d.ts +7 -5
- package/lib/cjs/curve/Loop.d.ts.map +1 -1
- package/lib/cjs/curve/Loop.js +18 -6
- package/lib/cjs/curve/Loop.js.map +1 -1
- package/lib/cjs/curve/ParityRegion.d.ts +7 -7
- package/lib/cjs/curve/ParityRegion.d.ts.map +1 -1
- package/lib/cjs/curve/ParityRegion.js +19 -11
- package/lib/cjs/curve/ParityRegion.js.map +1 -1
- package/lib/cjs/curve/Path.d.ts +6 -6
- package/lib/cjs/curve/Path.d.ts.map +1 -1
- package/lib/cjs/curve/Path.js +15 -9
- package/lib/cjs/curve/Path.js.map +1 -1
- package/lib/cjs/curve/ProxyCurve.d.ts +4 -6
- package/lib/cjs/curve/ProxyCurve.d.ts.map +1 -1
- package/lib/cjs/curve/ProxyCurve.js +7 -7
- package/lib/cjs/curve/ProxyCurve.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts +69 -47
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +70 -47
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/cjs/curve/StrokeOptions.js +6 -2
- package/lib/cjs/curve/StrokeOptions.js.map +1 -1
- package/lib/cjs/curve/UnionRegion.d.ts +6 -5
- package/lib/cjs/curve/UnionRegion.d.ts.map +1 -1
- package/lib/cjs/curve/UnionRegion.js +17 -8
- package/lib/cjs/curve/UnionRegion.js.map +1 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.d.ts +2 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.js +6 -2
- package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts +4 -0
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js +5 -2
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.d.ts +14 -8
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js +14 -8
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts +56 -34
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +153 -87
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.js +4 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/cjs/geometry3d/Angle.d.ts +9 -0
- package/lib/cjs/geometry3d/Angle.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Angle.js +13 -0
- package/lib/cjs/geometry3d/Angle.js.map +1 -1
- package/lib/cjs/geometry3d/BilinearPatch.d.ts +43 -48
- package/lib/cjs/geometry3d/BilinearPatch.d.ts.map +1 -1
- package/lib/cjs/geometry3d/BilinearPatch.js +51 -55
- package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.d.ts +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.d.ts.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.js +13 -11
- package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/cjs/geometry3d/GeometryHandler.d.ts +5 -5
- package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +18 -0
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +27 -0
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts +36 -32
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js +35 -32
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +8 -0
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +13 -0
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.d.ts +16 -1
- package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js +55 -0
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/geometry3d/Range.d.ts +134 -94
- package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Range.js +297 -145
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts +7 -0
- package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Transform.js +12 -0
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts +64 -6
- package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +104 -19
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts +11 -0
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js +79 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts +11 -0
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js +30 -0
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.d.ts +2 -1
- package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.d.ts +2 -1
- package/lib/cjs/solid/RotationalSweep.d.ts.map +1 -1
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/RuledSweep.d.ts +2 -1
- package/lib/cjs/solid/RuledSweep.d.ts.map +1 -1
- package/lib/cjs/solid/RuledSweep.js.map +1 -1
- package/lib/cjs/solid/SweepContour.d.ts +2 -2
- package/lib/cjs/solid/SweepContour.d.ts.map +1 -1
- package/lib/cjs/solid/SweepContour.js +9 -0
- package/lib/cjs/solid/SweepContour.js.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.js +2 -0
- package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
- package/lib/esm/core-geometry.d.ts +1 -0
- package/lib/esm/core-geometry.d.ts.map +1 -1
- package/lib/esm/core-geometry.js +2 -0
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +1 -0
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +1 -0
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +61 -41
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js +69 -46
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +36 -26
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +46 -39
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveCurve.d.ts.map +1 -1
- package/lib/esm/curve/CurveCurve.js.map +1 -1
- package/lib/esm/curve/CurveFactory.d.ts +67 -3
- package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
- package/lib/esm/curve/CurveFactory.js +74 -6
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts +6 -6
- package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js +9 -7
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurvePrimitive.d.ts +4 -3
- package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js +4 -3
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.d.ts +6 -4
- package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/esm/curve/LineSegment3d.js +4 -4
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +1 -1
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +1 -1
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/Loop.d.ts +7 -5
- package/lib/esm/curve/Loop.d.ts.map +1 -1
- package/lib/esm/curve/Loop.js +18 -6
- package/lib/esm/curve/Loop.js.map +1 -1
- package/lib/esm/curve/ParityRegion.d.ts +7 -7
- package/lib/esm/curve/ParityRegion.d.ts.map +1 -1
- package/lib/esm/curve/ParityRegion.js +19 -11
- package/lib/esm/curve/ParityRegion.js.map +1 -1
- package/lib/esm/curve/Path.d.ts +6 -6
- package/lib/esm/curve/Path.d.ts.map +1 -1
- package/lib/esm/curve/Path.js +15 -9
- package/lib/esm/curve/Path.js.map +1 -1
- package/lib/esm/curve/ProxyCurve.d.ts +4 -6
- package/lib/esm/curve/ProxyCurve.d.ts.map +1 -1
- package/lib/esm/curve/ProxyCurve.js +7 -7
- package/lib/esm/curve/ProxyCurve.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +69 -47
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +70 -47
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/esm/curve/StrokeOptions.js +6 -2
- package/lib/esm/curve/StrokeOptions.js.map +1 -1
- package/lib/esm/curve/UnionRegion.d.ts +6 -5
- package/lib/esm/curve/UnionRegion.d.ts.map +1 -1
- package/lib/esm/curve/UnionRegion.js +17 -8
- package/lib/esm/curve/UnionRegion.js.map +1 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.d.ts +2 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.js +6 -2
- package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts +4 -0
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.js +5 -2
- package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.d.ts +14 -8
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js +14 -8
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts +56 -34
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +153 -87
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.js +4 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/esm/geometry3d/Angle.d.ts +9 -0
- package/lib/esm/geometry3d/Angle.d.ts.map +1 -1
- package/lib/esm/geometry3d/Angle.js +13 -0
- package/lib/esm/geometry3d/Angle.js.map +1 -1
- package/lib/esm/geometry3d/BilinearPatch.d.ts +43 -48
- package/lib/esm/geometry3d/BilinearPatch.d.ts.map +1 -1
- package/lib/esm/geometry3d/BilinearPatch.js +51 -55
- package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.d.ts +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.d.ts.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.js +13 -11
- package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/esm/geometry3d/GeometryHandler.d.ts +5 -5
- package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +18 -0
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +27 -0
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts +36 -32
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js +35 -32
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +8 -0
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +13 -0
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.d.ts +16 -1
- package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js +56 -1
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/geometry3d/Range.d.ts +134 -94
- package/lib/esm/geometry3d/Range.d.ts.map +1 -1
- package/lib/esm/geometry3d/Range.js +297 -145
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts +7 -0
- package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
- package/lib/esm/geometry3d/Transform.js +12 -0
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts +64 -6
- package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +103 -19
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts +11 -0
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js +78 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts +11 -0
- package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js +30 -0
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/solid/LinearSweep.d.ts +2 -1
- package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.d.ts +2 -1
- package/lib/esm/solid/RotationalSweep.d.ts.map +1 -1
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/RuledSweep.d.ts +2 -1
- package/lib/esm/solid/RuledSweep.d.ts.map +1 -1
- package/lib/esm/solid/RuledSweep.js.map +1 -1
- package/lib/esm/solid/SweepContour.d.ts +2 -2
- package/lib/esm/solid/SweepContour.d.ts.map +1 -1
- package/lib/esm/solid/SweepContour.js +9 -0
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/package.json +5 -5
|
@@ -9,32 +9,32 @@ import { Range3d } from "./Range";
|
|
|
9
9
|
import { Ray3d } from "./Ray3d";
|
|
10
10
|
import { Transform } from "./Transform";
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
* *
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
12
|
+
* A bilinear patch is a surface defined by its 4 corner points.
|
|
13
|
+
* * The corner points do not have to be coplanar, but if they are, the quadrilateral should be convex to avoid a self-intersecting surface.
|
|
14
|
+
* ```
|
|
15
|
+
* equation
|
|
16
|
+
* \begin{matrix}
|
|
17
|
+
* v\text{-direction}\\
|
|
18
|
+
* \uparrow\\
|
|
19
|
+
* \text{point01} &\cdots &\text{A1} &\cdots &\text{point11}\\
|
|
20
|
+
* \vdots &&\vdots &&\vdots\\
|
|
21
|
+
* \text{B0} &\cdots &\text{X} &\cdots &\text{B1}\\
|
|
22
|
+
* \vdots &&\vdots &&\vdots\\
|
|
23
|
+
* \text{point00} &\cdots &\text{A0} &\cdots &\text{point10} &\rightarrow~u\text{-direction}
|
|
24
|
+
* \end{matrix}
|
|
25
|
+
* ```
|
|
26
|
+
* * To evaluate the point at (u,v), the following are equivalent:
|
|
27
|
+
* * interpolate first with u then with v:
|
|
27
28
|
* * A0 = interpolate between point00 and point10 at fraction u
|
|
28
29
|
* * A1 = interpolate between point01 and point11 at fraction u
|
|
29
30
|
* * X = interpolate between A0 and A1 at fraction v
|
|
30
|
-
* * interpolate first with v
|
|
31
|
+
* * interpolate first with v then with u:
|
|
31
32
|
* * B0 = interpolate between point00 and point01 at fraction v
|
|
32
33
|
* * B1 = interpolate between point10 and point11 at fraction v
|
|
33
34
|
* * X = interpolate between B0 and B1 at fraction u
|
|
34
|
-
* * sum all at once
|
|
35
|
-
* * X = (1-u)
|
|
36
|
-
*
|
|
37
|
-
* @internal
|
|
35
|
+
* * sum all at once:
|
|
36
|
+
* * X = (1-u)(1-v)point00 + (1-u)(v)point01 + (u)(1-v)point10 + (u)(v)point11
|
|
37
|
+
* @public
|
|
38
38
|
*/
|
|
39
39
|
export declare class BilinearPatch implements UVSurface {
|
|
40
40
|
/** corner at parametric coordinate (0,0) */
|
|
@@ -46,62 +46,57 @@ export declare class BilinearPatch implements UVSurface {
|
|
|
46
46
|
/** corner at parametric coordinate (1,1) */
|
|
47
47
|
point11: Point3d;
|
|
48
48
|
/**
|
|
49
|
-
* Capture (not clone)
|
|
49
|
+
* Capture (not clone) corners to create a new BilinearPatch.
|
|
50
50
|
* @param point00 Point at uv=0,0
|
|
51
51
|
* @param point10 Point at uv=1,0
|
|
52
52
|
* @param point10 Point at uv=0,1
|
|
53
|
-
* @param point11 Point at uv=
|
|
53
|
+
* @param point11 Point at uv=1,1
|
|
54
54
|
*/
|
|
55
55
|
constructor(point00: Point3d, point10: Point3d, point01: Point3d, point11: Point3d);
|
|
56
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* Clone (not capture) corners to create a new BilinearPatch.
|
|
57
58
|
* @param point00 Point at uv=0,0
|
|
58
59
|
* @param point10 Point at uv=1,0
|
|
59
60
|
* @param point10 Point at uv=0,1
|
|
60
|
-
* @param point11 Point at uv=
|
|
61
|
+
* @param point11 Point at uv=1,1
|
|
61
62
|
*/
|
|
62
63
|
static create(point00: Point3d, point10: Point3d, point01: Point3d, point11: Point3d): BilinearPatch;
|
|
63
|
-
/**
|
|
64
|
-
*/
|
|
64
|
+
/** Create a patch from xyz values of the 4 corners. */
|
|
65
65
|
static createXYZ(x00: number, y00: number, z00: number, x10: number, y10: number, z10: number, x01: number, y01: number, z01: number, x11: number, y11: number, z11: number): BilinearPatch;
|
|
66
|
-
/**
|
|
66
|
+
/** Return a cloned patch. */
|
|
67
67
|
clone(): BilinearPatch;
|
|
68
|
-
/**
|
|
68
|
+
/** Test equality of the 4 points. */
|
|
69
69
|
isAlmostEqual(other: BilinearPatch): boolean;
|
|
70
|
-
/** Apply the transform to each point */
|
|
70
|
+
/** Apply the transform to each point. */
|
|
71
71
|
tryTransformInPlace(transform: Transform): boolean;
|
|
72
|
-
/**
|
|
73
|
-
* return a cloned and transformed patch.
|
|
74
|
-
* @param transform
|
|
75
|
-
*/
|
|
72
|
+
/** Return a cloned and transformed patch. */
|
|
76
73
|
cloneTransformed(transform: Transform): BilinearPatch | undefined;
|
|
77
|
-
/** Extend a range by the range of the(optionally transformed) patch
|
|
78
|
-
*/
|
|
74
|
+
/** Extend a range by the range of the (optionally transformed) patch. */
|
|
79
75
|
extendRange(range: Range3d, transform?: Transform): void;
|
|
80
|
-
/**
|
|
81
|
-
*
|
|
82
|
-
* @param
|
|
76
|
+
/**
|
|
77
|
+
* Convert fractional u and v coordinates to surface point
|
|
78
|
+
* @param u fractional coordinate in u direction
|
|
79
|
+
* @param v fractional coordinate in v direction
|
|
80
|
+
* @param result optional pre-allocated point
|
|
83
81
|
*/
|
|
84
82
|
uvFractionToPoint(u: number, v: number, result?: Point3d): Point3d;
|
|
85
83
|
/** Evaluate as a uv surface, returning point and two derivative vectors.
|
|
86
|
-
* @param u fractional
|
|
87
|
-
* @param v fractional
|
|
84
|
+
* @param u fractional coordinate in u direction
|
|
85
|
+
* @param v fractional coordinate in v direction
|
|
86
|
+
* @param result optional pre-allocated carrier for point and vectors
|
|
88
87
|
*/
|
|
89
88
|
uvFractionToPointAndTangents(u: number, v: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors;
|
|
90
|
-
/**
|
|
89
|
+
/** If data[iB][pivotColumn] is larger in absolute value than data[iA][pivotColumn], then swap rows iA and iB. */
|
|
91
90
|
private static conditionalPivot;
|
|
92
91
|
/**
|
|
93
|
-
* Compute the
|
|
92
|
+
* Compute the points of intersection with a ray.
|
|
94
93
|
* @param ray ray in space
|
|
95
94
|
* @returns 1 or 2 points if there are intersections, undefined if no intersections
|
|
96
95
|
*/
|
|
97
96
|
intersectRay(ray: Ray3d): CurveAndSurfaceLocationDetail[] | undefined;
|
|
98
|
-
/**
|
|
99
|
-
* Returns the larger of the u-direction edge lengths at v=0 and v=1
|
|
100
|
-
*/
|
|
97
|
+
/** Returns the larger of the u-direction edge lengths at v=0 and v=1. */
|
|
101
98
|
maxUEdgeLength(): number;
|
|
102
|
-
/**
|
|
103
|
-
* Returns the larger of the v-direction edge lengths at u=0 and u=1
|
|
104
|
-
*/
|
|
99
|
+
/** Returns the larger of the v-direction edge lengths at u=0 and u=1. */
|
|
105
100
|
maxVEdgeLength(): number;
|
|
106
101
|
}
|
|
107
102
|
//# sourceMappingURL=BilinearPatch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BilinearPatch.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/BilinearPatch.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,6BAA6B,EAA2B,MAAM,kCAAkC,CAAC;AAI1G,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"BilinearPatch.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/BilinearPatch.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,6BAA6B,EAA2B,MAAM,kCAAkC,CAAC;AAI1G,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,aAAc,YAAW,SAAS;IAC7C,4CAA4C;IACrC,OAAO,EAAE,OAAO,CAAC;IACxB,4CAA4C;IACrC,OAAO,EAAE,OAAO,CAAC;IACxB,4CAA4C;IACrC,OAAO,EAAE,OAAO,CAAC;IACxB,4CAA4C;IACrC,OAAO,EA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Y,CAAC,GAAG,EAAE,KAAK,GAAG,6BAA6B,EAAE,GAAG,SAAS;IAsC5E,yEAAyE;IAClE,cAAc,IAAI,MAAM;IAG/B,yEAAyE;IAClE,cAAc,IAAI,MAAM;CAGhC"}
|
|
@@ -14,41 +14,42 @@ const Geometry_1 = require("../Geometry");
|
|
|
14
14
|
const Polynomials_1 = require("../numerics/Polynomials");
|
|
15
15
|
const Plane3dByOriginAndVectors_1 = require("./Plane3dByOriginAndVectors");
|
|
16
16
|
const Point3dVector3d_1 = require("./Point3dVector3d");
|
|
17
|
+
// cspell:word uparrow, rightarrow
|
|
17
18
|
/**
|
|
18
|
-
*
|
|
19
|
-
* *
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
19
|
+
* A bilinear patch is a surface defined by its 4 corner points.
|
|
20
|
+
* * The corner points do not have to be coplanar, but if they are, the quadrilateral should be convex to avoid a self-intersecting surface.
|
|
21
|
+
* ```
|
|
22
|
+
* equation
|
|
23
|
+
* \begin{matrix}
|
|
24
|
+
* v\text{-direction}\\
|
|
25
|
+
* \uparrow\\
|
|
26
|
+
* \text{point01} &\cdots &\text{A1} &\cdots &\text{point11}\\
|
|
27
|
+
* \vdots &&\vdots &&\vdots\\
|
|
28
|
+
* \text{B0} &\cdots &\text{X} &\cdots &\text{B1}\\
|
|
29
|
+
* \vdots &&\vdots &&\vdots\\
|
|
30
|
+
* \text{point00} &\cdots &\text{A0} &\cdots &\text{point10} &\rightarrow~u\text{-direction}
|
|
31
|
+
* \end{matrix}
|
|
32
|
+
* ```
|
|
33
|
+
* * To evaluate the point at (u,v), the following are equivalent:
|
|
34
|
+
* * interpolate first with u then with v:
|
|
33
35
|
* * A0 = interpolate between point00 and point10 at fraction u
|
|
34
36
|
* * A1 = interpolate between point01 and point11 at fraction u
|
|
35
37
|
* * X = interpolate between A0 and A1 at fraction v
|
|
36
|
-
* * interpolate first with v
|
|
38
|
+
* * interpolate first with v then with u:
|
|
37
39
|
* * B0 = interpolate between point00 and point01 at fraction v
|
|
38
40
|
* * B1 = interpolate between point10 and point11 at fraction v
|
|
39
41
|
* * X = interpolate between B0 and B1 at fraction u
|
|
40
|
-
* * sum all at once
|
|
41
|
-
* * X = (1-u)
|
|
42
|
-
*
|
|
43
|
-
* @internal
|
|
42
|
+
* * sum all at once:
|
|
43
|
+
* * X = (1-u)(1-v)point00 + (1-u)(v)point01 + (u)(1-v)point10 + (u)(v)point11
|
|
44
|
+
* @public
|
|
44
45
|
*/
|
|
45
46
|
class BilinearPatch {
|
|
46
47
|
/**
|
|
47
|
-
* Capture (not clone)
|
|
48
|
+
* Capture (not clone) corners to create a new BilinearPatch.
|
|
48
49
|
* @param point00 Point at uv=0,0
|
|
49
50
|
* @param point10 Point at uv=1,0
|
|
50
51
|
* @param point10 Point at uv=0,1
|
|
51
|
-
* @param point11 Point at uv=
|
|
52
|
+
* @param point11 Point at uv=1,1
|
|
52
53
|
*/
|
|
53
54
|
constructor(point00, point10, point01, point11) {
|
|
54
55
|
this.point00 = point00;
|
|
@@ -56,32 +57,32 @@ class BilinearPatch {
|
|
|
56
57
|
this.point01 = point01;
|
|
57
58
|
this.point11 = point11;
|
|
58
59
|
}
|
|
59
|
-
/**
|
|
60
|
+
/**
|
|
61
|
+
* Clone (not capture) corners to create a new BilinearPatch.
|
|
60
62
|
* @param point00 Point at uv=0,0
|
|
61
63
|
* @param point10 Point at uv=1,0
|
|
62
64
|
* @param point10 Point at uv=0,1
|
|
63
|
-
* @param point11 Point at uv=
|
|
65
|
+
* @param point11 Point at uv=1,1
|
|
64
66
|
*/
|
|
65
67
|
static create(point00, point10, point01, point11) {
|
|
66
68
|
return new BilinearPatch(point00.clone(), point10.clone(), point01.clone(), point11.clone());
|
|
67
69
|
}
|
|
68
|
-
/**
|
|
69
|
-
*/
|
|
70
|
+
/** Create a patch from xyz values of the 4 corners. */
|
|
70
71
|
static createXYZ(x00, y00, z00, x10, y10, z10, x01, y01, z01, x11, y11, z11) {
|
|
71
72
|
return new BilinearPatch(Point3dVector3d_1.Point3d.create(x00, y00, z00), Point3dVector3d_1.Point3d.create(x10, y10, z10), Point3dVector3d_1.Point3d.create(x01, y01, z01), Point3dVector3d_1.Point3d.create(x11, y11, z11));
|
|
72
73
|
}
|
|
73
|
-
/**
|
|
74
|
+
/** Return a cloned patch. */
|
|
74
75
|
clone() {
|
|
75
76
|
return new BilinearPatch(this.point00.clone(), this.point10.clone(), this.point01.clone(), this.point11.clone());
|
|
76
77
|
}
|
|
77
|
-
/**
|
|
78
|
+
/** Test equality of the 4 points. */
|
|
78
79
|
isAlmostEqual(other) {
|
|
79
80
|
return this.point00.isAlmostEqual(other.point00)
|
|
80
81
|
&& this.point10.isAlmostEqual(other.point10)
|
|
81
82
|
&& this.point01.isAlmostEqual(other.point01)
|
|
82
83
|
&& this.point11.isAlmostEqual(other.point11);
|
|
83
84
|
}
|
|
84
|
-
/** Apply the transform to each point */
|
|
85
|
+
/** Apply the transform to each point. */
|
|
85
86
|
tryTransformInPlace(transform) {
|
|
86
87
|
transform.multiplyPoint3d(this.point00, this.point00);
|
|
87
88
|
transform.multiplyPoint3d(this.point10, this.point10);
|
|
@@ -89,17 +90,13 @@ class BilinearPatch {
|
|
|
89
90
|
transform.multiplyPoint3d(this.point11, this.point11);
|
|
90
91
|
return true;
|
|
91
92
|
}
|
|
92
|
-
/**
|
|
93
|
-
* return a cloned and transformed patch.
|
|
94
|
-
* @param transform
|
|
95
|
-
*/
|
|
93
|
+
/** Return a cloned and transformed patch. */
|
|
96
94
|
cloneTransformed(transform) {
|
|
97
95
|
const result = this.clone();
|
|
98
96
|
result.tryTransformInPlace(transform);
|
|
99
97
|
return result;
|
|
100
98
|
}
|
|
101
|
-
/** Extend a range by the range of the(optionally transformed) patch
|
|
102
|
-
*/
|
|
99
|
+
/** Extend a range by the range of the (optionally transformed) patch. */
|
|
103
100
|
extendRange(range, transform) {
|
|
104
101
|
if (transform) {
|
|
105
102
|
range.extendTransformedPoint(transform, this.point00);
|
|
@@ -114,9 +111,11 @@ class BilinearPatch {
|
|
|
114
111
|
range.extendPoint(this.point11);
|
|
115
112
|
}
|
|
116
113
|
}
|
|
117
|
-
/**
|
|
118
|
-
*
|
|
119
|
-
* @param
|
|
114
|
+
/**
|
|
115
|
+
* Convert fractional u and v coordinates to surface point
|
|
116
|
+
* @param u fractional coordinate in u direction
|
|
117
|
+
* @param v fractional coordinate in v direction
|
|
118
|
+
* @param result optional pre-allocated point
|
|
120
119
|
*/
|
|
121
120
|
uvFractionToPoint(u, v, result) {
|
|
122
121
|
const f00 = (1.0 - u) * (1.0 - v);
|
|
@@ -126,8 +125,9 @@ class BilinearPatch {
|
|
|
126
125
|
return Point3dVector3d_1.Point3d.create(f00 * this.point00.x + f10 * this.point10.x + f01 * this.point01.x + f11 * this.point11.x, f00 * this.point00.y + f10 * this.point10.y + f01 * this.point01.y + f11 * this.point11.y, f00 * this.point00.z + f10 * this.point10.z + f01 * this.point01.z + f11 * this.point11.z, result);
|
|
127
126
|
}
|
|
128
127
|
/** Evaluate as a uv surface, returning point and two derivative vectors.
|
|
129
|
-
* @param u fractional
|
|
130
|
-
* @param v fractional
|
|
128
|
+
* @param u fractional coordinate in u direction
|
|
129
|
+
* @param v fractional coordinate in v direction
|
|
130
|
+
* @param result optional pre-allocated carrier for point and vectors
|
|
131
131
|
*/
|
|
132
132
|
uvFractionToPointAndTangents(u, v, result) {
|
|
133
133
|
const u0 = 1.0 - u;
|
|
@@ -142,7 +142,7 @@ class BilinearPatch {
|
|
|
142
142
|
// v derivative ..
|
|
143
143
|
u0 * (this.point01.x - this.point00.x) + u * (this.point11.x - this.point10.x), u0 * (this.point01.y - this.point00.y) + u * (this.point11.y - this.point10.y), u0 * (this.point01.z - this.point00.z) + u * (this.point11.z - this.point10.z), result);
|
|
144
144
|
}
|
|
145
|
-
/**
|
|
145
|
+
/** If data[iB][pivotColumn] is larger in absolute value than data[iA][pivotColumn], then swap rows iA and iB. */
|
|
146
146
|
static conditionalPivot(pivotColumn, data, iA, iB) {
|
|
147
147
|
if (Math.abs(data[iB][pivotColumn]) > Math.abs(data[iA][pivotColumn])) {
|
|
148
148
|
const q = data[iA];
|
|
@@ -151,7 +151,7 @@ class BilinearPatch {
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
/**
|
|
154
|
-
* Compute the
|
|
154
|
+
* Compute the points of intersection with a ray.
|
|
155
155
|
* @param ray ray in space
|
|
156
156
|
* @returns 1 or 2 points if there are intersections, undefined if no intersections
|
|
157
157
|
*/
|
|
@@ -160,17 +160,17 @@ class BilinearPatch {
|
|
|
160
160
|
const vectorV = this.point01.minus(this.point00);
|
|
161
161
|
const vectorW = this.point11.minus(this.point10);
|
|
162
162
|
vectorW.subtractInPlace(vectorV);
|
|
163
|
-
//
|
|
164
|
-
// `ray.origin + t
|
|
165
|
-
//
|
|
166
|
-
// `0 = -ray.
|
|
167
|
-
//
|
|
163
|
+
// We seek t, u, v such that:
|
|
164
|
+
// `ray.origin + t*ray.direction = point00 + u*vectorU + v*vectorV + u*v*vectorW`
|
|
165
|
+
// For typical direction as x, the scalar equation with coefficient order for arrays is:
|
|
166
|
+
// `0 = -t*ray.direction.x + (point00.x - ray.origin.x) + u*vectorU.x + v*vectorV.x + u*v*vectorW.x`
|
|
167
|
+
// and this particular equation is invoked to compute t when u and v are known.
|
|
168
168
|
const coffs = [
|
|
169
169
|
new Float64Array([-ray.direction.x, this.point00.x - ray.origin.x, vectorU.x, vectorV.x, vectorW.x]),
|
|
170
170
|
new Float64Array([-ray.direction.y, this.point00.y - ray.origin.y, vectorU.y, vectorV.y, vectorW.y]),
|
|
171
|
-
new Float64Array([-ray.direction.z, this.point00.z - ray.origin.z, vectorU.z, vectorV.z, vectorW.z])
|
|
171
|
+
new Float64Array([-ray.direction.z, this.point00.z - ray.origin.z, vectorU.z, vectorV.z, vectorW.z]),
|
|
172
172
|
];
|
|
173
|
-
//
|
|
173
|
+
// swap rows so that the equation with largest ray.direction coefficient is first.
|
|
174
174
|
BilinearPatch.conditionalPivot(0, coffs, 0, 1);
|
|
175
175
|
BilinearPatch.conditionalPivot(0, coffs, 0, 2);
|
|
176
176
|
Polynomials_1.SmallSystem.eliminateFromPivot(coffs[0], 0, coffs[1], -1.0);
|
|
@@ -187,15 +187,11 @@ class BilinearPatch {
|
|
|
187
187
|
}
|
|
188
188
|
return undefined;
|
|
189
189
|
}
|
|
190
|
-
/**
|
|
191
|
-
* Returns the larger of the u-direction edge lengths at v=0 and v=1
|
|
192
|
-
*/
|
|
190
|
+
/** Returns the larger of the u-direction edge lengths at v=0 and v=1. */
|
|
193
191
|
maxUEdgeLength() {
|
|
194
192
|
return Geometry_1.Geometry.maxXY(this.point00.distance(this.point10), this.point01.distance(this.point11));
|
|
195
193
|
}
|
|
196
|
-
/**
|
|
197
|
-
* Returns the larger of the v-direction edge lengths at u=0 and u=1
|
|
198
|
-
*/
|
|
194
|
+
/** Returns the larger of the v-direction edge lengths at u=0 and u=1. */
|
|
199
195
|
maxVEdgeLength() {
|
|
200
196
|
return Geometry_1.Geometry.maxXY(this.point00.distance(this.point01), this.point10.distance(this.point11));
|
|
201
197
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BilinearPatch.js","sourceRoot":"","sources":["../../../src/geometry3d/BilinearPatch.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,4EAA0G;AAC1G,sEAAmE;AACnE,0CAAuC;AACvC,yDAAsD;AAEtD,2EAAwE;AACxE,uDAA4C;AAK5C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAa,aAAa;IASxB;;;;;;OAMG;IACH,YAAmB,OAAgB,EAAE,OAAgB,EAAE,OAAgB,EAAE,OAAgB;QACvF,IAAI,CA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C,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACxG,MAAM,KAAK,GAAG,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;gBACrC,MAAM,CAAC,IAAI,CAAC,IAAI,qDAA6B,CAC3C,yCAAmB,CAAC,sBAAsB,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,EACzD,+CAAuB,CAAC,oBAAoB,CAAC,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;aACnE;YACD,OAAO,MAAM,CAAC;SACf;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD;;OAEG;IACI,cAAc;QACnB,OAAO,mBAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAClG,CAAC;IACD;;OAEG;IACI,cAAc;QACnB,OAAO,mBAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAClG,CAAC;CACF;AA/LD,sCA+LC","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 Solid\r\n */\r\n\r\nimport { CurveAndSurfaceLocationDetail, UVSurfaceLocationDetail } from \"../bspline/SurfaceLocationDetail\";\r\nimport { CurveLocationDetail } from \"../curve/CurveLocationDetail\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { SmallSystem } from \"../numerics/Polynomials\";\r\nimport { UVSurface } from \"./GeometryHandler\";\r\nimport { Plane3dByOriginAndVectors } from \"./Plane3dByOriginAndVectors\";\r\nimport { Point3d } from \"./Point3dVector3d\";\r\nimport { Range3d } from \"./Range\";\r\nimport { Ray3d } from \"./Ray3d\";\r\nimport { Transform } from \"./Transform\";\r\n\r\n/**\r\n * * A Bilinear patch is defined by its 4 corner points.\r\n * * the corner points do not have to be coplanar\r\n *\r\n * * v direction (up)\r\n * |\r\n * |\r\n * |\r\n * point01---A1-----------point11\r\n * | | |\r\n * B0----X------------B1\r\n * | | |\r\n * point00--A0-----------point10 -----------> u direction\r\n *\r\n * * To evaluate aa point at (u,v), the following are equivalent:\r\n * * interpolate with u to get both A0 and A1, viz\r\n * * A0 = interpolate between point00 and point10 at fraction u\r\n * * A1 = interpolate between point01 and point11 at fraction u\r\n * * X = interpolate between A0 and A1 at fraction v\r\n * * interpolate first with v to get B0 and B1, viz\r\n * * B0 = interpolate between point00 and point01 at fraction v\r\n * * B1 = interpolate between point10 and point11 at fraction v\r\n * * X = interpolate between B0 and B1 at fraction u\r\n * * sum all at once as\r\n * * X = (1-u)* (1-v) *point00 + (1-u)*v * point01 + u * (1-v) *point10 + u* v * point11\r\n *\r\n * @internal\r\n */\r\nexport class BilinearPatch implements UVSurface {\r\n /** corner at parametric coordinate (0,0) */\r\n public point00: Point3d;\r\n /** corner at parametric coordinate (1,0) */\r\n public point10: Point3d;\r\n /** corner at parametric coordinate (0,1) */\r\n public point01: Point3d;\r\n /** corner at parametric coordinate (1,1) */\r\n public point11: Point3d;\r\n /**\r\n * Capture (not clone) corner points, in u direction at v=0, then in same direction at v=1\r\n * @param point00 Point at uv=0,0\r\n * @param point10 Point at uv=1,0\r\n * @param point10 Point at uv=0,1\r\n * @param point11 Point at uv=11\r\n */\r\n public constructor(point00: Point3d, point10: Point3d, point01: Point3d, point11: Point3d) {\r\n this.point00 = point00;\r\n this.point10 = point10;\r\n this.point01 = point01;\r\n this.point11 = point11;\r\n }\r\n /** clone (not capture) corners to create a new BilinearPatch\r\n * @param point00 Point at uv=0,0\r\n * @param point10 Point at uv=1,0\r\n * @param point10 Point at uv=0,1\r\n * @param point11 Point at uv=11\r\n */\r\n public static create(point00: Point3d, point10: Point3d, point01: Point3d, point11: Point3d) {\r\n return new BilinearPatch(point00.clone(), point10.clone(), point01.clone(), point11.clone());\r\n }\r\n\r\n /** create a patch with from xyz values of the 4 corners\r\n */\r\n public static createXYZ(x00: number, y00: number, z00: number,\r\n x10: number, y10: number, z10: number,\r\n x01: number, y01: number, z01: number,\r\n x11: number, y11: number, z11: number) {\r\n return new BilinearPatch(Point3d.create(x00, y00, z00),\r\n Point3d.create(x10, y10, z10),\r\n Point3d.create(x01, y01, z01),\r\n Point3d.create(x11, y11, z11));\r\n }\r\n\r\n /** return a clone with same coordinates */\r\n public clone(): BilinearPatch {\r\n return new BilinearPatch(\r\n this.point00.clone(),\r\n this.point10.clone(),\r\n this.point01.clone(),\r\n this.point11.clone());\r\n }\r\n /** test equality of the 4 points */\r\n public isAlmostEqual(other: BilinearPatch): boolean {\r\n return this.point00.isAlmostEqual(other.point00)\r\n && this.point10.isAlmostEqual(other.point10)\r\n && this.point01.isAlmostEqual(other.point01)\r\n && this.point11.isAlmostEqual(other.point11);\r\n }\r\n /** Apply the transform to each point */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n transform.multiplyPoint3d(this.point00, this.point00);\r\n transform.multiplyPoint3d(this.point10, this.point10);\r\n transform.multiplyPoint3d(this.point01, this.point01);\r\n transform.multiplyPoint3d(this.point11, this.point11);\r\n return true;\r\n }\r\n /**\r\n * return a cloned and transformed patch.\r\n * @param transform\r\n */\r\n public cloneTransformed(transform: Transform): BilinearPatch | undefined {\r\n const result = this.clone();\r\n result.tryTransformInPlace(transform);\r\n return result;\r\n }\r\n /** Extend a range by the range of the(optionally transformed) patch\r\n */\r\n public extendRange(range: Range3d, transform?: Transform) {\r\n if (transform) {\r\n range.extendTransformedPoint(transform, this.point00);\r\n range.extendTransformedPoint(transform, this.point10);\r\n range.extendTransformedPoint(transform, this.point01);\r\n range.extendTransformedPoint(transform, this.point11);\r\n } else {\r\n range.extendPoint(this.point00);\r\n range.extendPoint(this.point10);\r\n range.extendPoint(this.point01);\r\n range.extendPoint(this.point11);\r\n }\r\n }\r\n /** Evaluate as a uv surface\r\n * @param u fractional position in minor (phi)\r\n * @param v fractional position on major (theta) arc\r\n */\r\n public uvFractionToPoint(u: number, v: number, result?: Point3d): Point3d {\r\n const f00 = (1.0 - u) * (1.0 - v);\r\n const f10 = u * (1.0 - v);\r\n const f01 = (1.0 - u) * v;\r\n const f11 = u * v;\r\n return Point3d.create(\r\n f00 * this.point00.x + f10 * this.point10.x + f01 * this.point01.x + f11 * this.point11.x,\r\n f00 * this.point00.y + f10 * this.point10.y + f01 * this.point01.y + f11 * this.point11.y,\r\n f00 * this.point00.z + f10 * this.point10.z + f01 * this.point01.z + f11 * this.point11.z,\r\n result);\r\n }\r\n /** Evaluate as a uv surface, returning point and two derivative vectors.\r\n * @param u fractional position\r\n * @param v fractional position\r\n */\r\n public uvFractionToPointAndTangents(u: number, v: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\r\n const u0 = 1.0 - u;\r\n const v0 = 1.0 - v;\r\n const f00 = u0 * v0;\r\n const f10 = u * v0;\r\n const f01 = u0 * v;\r\n const f11 = u * v;\r\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(\r\n f00 * this.point00.x + f10 * this.point10.x + f01 * this.point01.x + f11 * this.point11.x,\r\n f00 * this.point00.y + f10 * this.point10.y + f01 * this.point01.y + f11 * this.point11.y,\r\n f00 * this.point00.z + f10 * this.point10.z + f01 * this.point01.z + f11 * this.point11.z,\r\n // u derivative ..\r\n v0 * (this.point10.x - this.point00.x) + v * (this.point11.x - this.point01.x),\r\n v0 * (this.point10.y - this.point00.y) + v * (this.point11.y - this.point01.y),\r\n v0 * (this.point10.z - this.point00.z) + v * (this.point11.z - this.point01.z),\r\n // v derivative ..\r\n u0 * (this.point01.x - this.point00.x) + u * (this.point11.x - this.point10.x),\r\n u0 * (this.point01.y - this.point00.y) + u * (this.point11.y - this.point10.y),\r\n u0 * (this.point01.z - this.point00.z) + u * (this.point11.z - this.point10.z),\r\n result);\r\n }\r\n /** if data[ib][pivotColumn] is larger (abs) than data[ia][pivotColumn] swap the iA and iB arrays */\r\n private static conditionalPivot(pivotColumn: number, data: Float64Array[], iA: number, iB: number) {\r\n if (Math.abs(data[iB][pivotColumn]) > Math.abs(data[iA][pivotColumn])) {\r\n const q = data[iA];\r\n data[iA] = data[iB];\r\n data[iB] = q;\r\n }\r\n }\r\n /**\r\n * Compute the (points of) intersection with a ray.\r\n * @param ray ray in space\r\n * @returns 1 or 2 points if there are intersections, undefined if no intersections\r\n */\r\n public intersectRay(ray: Ray3d): CurveAndSurfaceLocationDetail[] | undefined {\r\n const vectorU = this.point10.minus(this.point00);\r\n const vectorV = this.point01.minus(this.point00);\r\n const vectorW = this.point11.minus(this.point10);\r\n vectorW.subtractInPlace(vectorV);\r\n // coefficients of (each component of)\r\n // `ray.origin + t * ray.direction = point00 + u * vectorU + v * vectorV + u*v*vectorW`\r\n // for x as typical direction as x, the scalar equation with coefficient order for arrays is\r\n // `0 = -ray.origin.x * t + (point00.x - ray.origin.x) + u * vectorU.x + v * vectorV.x + u * v * vectorW.x`\r\n // (and that particular equation is invoked to isolate t when uv is known)\r\n const coffs = [\r\n new Float64Array([-ray.direction.x, this.point00.x - ray.origin.x, vectorU.x, vectorV.x, vectorW.x]),\r\n new Float64Array([-ray.direction.y, this.point00.y - ray.origin.y, vectorU.y, vectorV.y, vectorW.y]),\r\n new Float64Array([-ray.direction.z, this.point00.z - ray.origin.z, vectorU.z, vectorV.z, vectorW.z])];\r\n // bring the largest ray.direction coefficient to the 0 equation.\r\n BilinearPatch.conditionalPivot(0, coffs, 0, 1);\r\n BilinearPatch.conditionalPivot(0, coffs, 0, 2);\r\n SmallSystem.eliminateFromPivot(coffs[0], 0, coffs[1], -1.0);\r\n SmallSystem.eliminateFromPivot(coffs[0], 0, coffs[2], -1.0);\r\n const uvArray = SmallSystem.solveBilinearPair(\r\n coffs[1][1], coffs[1][2], coffs[1][3], coffs[1][4],\r\n coffs[2][1], coffs[2][2], coffs[2][3], coffs[2][4]);\r\n if (uvArray) {\r\n const result: CurveAndSurfaceLocationDetail[] = [];\r\n for (const uv of uvArray) {\r\n const t = -(coffs[0][1] + coffs[0][2] * uv.x + (coffs[0][3] + coffs[0][4] * uv.x) * uv.y) / coffs[0][0];\r\n const point = ray.fractionToPoint(t);\r\n result.push(new CurveAndSurfaceLocationDetail(\r\n CurveLocationDetail.createRayFractionPoint(ray, t, point),\r\n UVSurfaceLocationDetail.createSurfaceUVPoint(this, uv, point)));\r\n }\r\n return result;\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Returns the larger of the u-direction edge lengths at v=0 and v=1\r\n */\r\n public maxUEdgeLength(): number {\r\n return Geometry.maxXY(this.point00.distance(this.point10), this.point01.distance(this.point11));\r\n }\r\n /**\r\n * Returns the larger of the v-direction edge lengths at u=0 and u=1\r\n */\r\n public maxVEdgeLength(): number {\r\n return Geometry.maxXY(this.point00.distance(this.point01), this.point10.distance(this.point11));\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"BilinearPatch.js","sourceRoot":"","sources":["../../../src/geometry3d/BilinearPatch.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,4EAA0G;AAC1G,sEAAmE;AACnE,0CAAuC;AACvC,yDAAsD;AAEtD,2EAAwE;AACxE,uDAA4C;AAK5C,kCAAkC;AAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAa,aAAa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GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACxG,MAAM,KAAK,GAAG,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;gBACrC,MAAM,CAAC,IAAI,CAAC,IAAI,qDAA6B,CAC3C,yCAAmB,CAAC,sBAAsB,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,EACzD,+CAAuB,CAAC,oBAAoB,CAAC,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC,CAC/D,CAAC;aACH;YACD,OAAO,MAAM,CAAC;SACf;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,yEAAyE;IAClE,cAAc;QACnB,OAAO,mBAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAClG,CAAC;IACD,yEAAyE;IAClE,cAAc;QACnB,OAAO,mBAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAClG,CAAC;CACF;AAlMD,sCAkMC","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 Solid\r\n */\r\n\r\nimport { CurveAndSurfaceLocationDetail, UVSurfaceLocationDetail } from \"../bspline/SurfaceLocationDetail\";\r\nimport { CurveLocationDetail } from \"../curve/CurveLocationDetail\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { SmallSystem } from \"../numerics/Polynomials\";\r\nimport { UVSurface } from \"./GeometryHandler\";\r\nimport { Plane3dByOriginAndVectors } from \"./Plane3dByOriginAndVectors\";\r\nimport { Point3d } from \"./Point3dVector3d\";\r\nimport { Range3d } from \"./Range\";\r\nimport { Ray3d } from \"./Ray3d\";\r\nimport { Transform } from \"./Transform\";\r\n\r\n// cspell:word uparrow, rightarrow\r\n\r\n/**\r\n * A bilinear patch is a surface defined by its 4 corner points.\r\n * * The corner points do not have to be coplanar, but if they are, the quadrilateral should be convex to avoid a self-intersecting surface.\r\n * ```\r\n * equation\r\n * \\begin{matrix}\r\n * v\\text{-direction}\\\\\r\n * \\uparrow\\\\\r\n * \\text{point01} &\\cdots &\\text{A1} &\\cdots &\\text{point11}\\\\\r\n * \\vdots &&\\vdots &&\\vdots\\\\\r\n * \\text{B0} &\\cdots &\\text{X} &\\cdots &\\text{B1}\\\\\r\n * \\vdots &&\\vdots &&\\vdots\\\\\r\n * \\text{point00} &\\cdots &\\text{A0} &\\cdots &\\text{point10} &\\rightarrow~u\\text{-direction}\r\n * \\end{matrix}\r\n * ```\r\n * * To evaluate the point at (u,v), the following are equivalent:\r\n * * interpolate first with u then with v:\r\n * * A0 = interpolate between point00 and point10 at fraction u\r\n * * A1 = interpolate between point01 and point11 at fraction u\r\n * * X = interpolate between A0 and A1 at fraction v\r\n * * interpolate first with v then with u:\r\n * * B0 = interpolate between point00 and point01 at fraction v\r\n * * B1 = interpolate between point10 and point11 at fraction v\r\n * * X = interpolate between B0 and B1 at fraction u\r\n * * sum all at once:\r\n * * X = (1-u)(1-v)point00 + (1-u)(v)point01 + (u)(1-v)point10 + (u)(v)point11\r\n * @public\r\n */\r\nexport class BilinearPatch implements UVSurface {\r\n /** corner at parametric coordinate (0,0) */\r\n public point00: Point3d;\r\n /** corner at parametric coordinate (1,0) */\r\n public point10: Point3d;\r\n /** corner at parametric coordinate (0,1) */\r\n public point01: Point3d;\r\n /** corner at parametric coordinate (1,1) */\r\n public point11: Point3d;\r\n /**\r\n * Capture (not clone) corners to create a new BilinearPatch.\r\n * @param point00 Point at uv=0,0\r\n * @param point10 Point at uv=1,0\r\n * @param point10 Point at uv=0,1\r\n * @param point11 Point at uv=1,1\r\n */\r\n public constructor(point00: Point3d, point10: Point3d, point01: Point3d, point11: Point3d) {\r\n this.point00 = point00;\r\n this.point10 = point10;\r\n this.point01 = point01;\r\n this.point11 = point11;\r\n }\r\n /**\r\n * Clone (not capture) corners to create a new BilinearPatch.\r\n * @param point00 Point at uv=0,0\r\n * @param point10 Point at uv=1,0\r\n * @param point10 Point at uv=0,1\r\n * @param point11 Point at uv=1,1\r\n */\r\n public static create(point00: Point3d, point10: Point3d, point01: Point3d, point11: Point3d) {\r\n return new BilinearPatch(point00.clone(), point10.clone(), point01.clone(), point11.clone());\r\n }\r\n /** Create a patch from xyz values of the 4 corners. */\r\n public static createXYZ(\r\n x00: number, y00: number, z00: number,\r\n x10: number, y10: number, z10: number,\r\n x01: number, y01: number, z01: number,\r\n x11: number, y11: number, z11: number\r\n ) {\r\n return new BilinearPatch(\r\n Point3d.create(x00, y00, z00),\r\n Point3d.create(x10, y10, z10),\r\n Point3d.create(x01, y01, z01),\r\n Point3d.create(x11, y11, z11)\r\n );\r\n }\r\n /** Return a cloned patch. */\r\n public clone(): BilinearPatch {\r\n return new BilinearPatch(\r\n this.point00.clone(),\r\n this.point10.clone(),\r\n this.point01.clone(),\r\n this.point11.clone()\r\n );\r\n }\r\n /** Test equality of the 4 points. */\r\n public isAlmostEqual(other: BilinearPatch): boolean {\r\n return this.point00.isAlmostEqual(other.point00)\r\n && this.point10.isAlmostEqual(other.point10)\r\n && this.point01.isAlmostEqual(other.point01)\r\n && this.point11.isAlmostEqual(other.point11);\r\n }\r\n /** Apply the transform to each point. */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n transform.multiplyPoint3d(this.point00, this.point00);\r\n transform.multiplyPoint3d(this.point10, this.point10);\r\n transform.multiplyPoint3d(this.point01, this.point01);\r\n transform.multiplyPoint3d(this.point11, this.point11);\r\n return true;\r\n }\r\n /** Return a cloned and transformed patch. */\r\n public cloneTransformed(transform: Transform): BilinearPatch | undefined {\r\n const result = this.clone();\r\n result.tryTransformInPlace(transform);\r\n return result;\r\n }\r\n /** Extend a range by the range of the (optionally transformed) patch. */\r\n public extendRange(range: Range3d, transform?: Transform) {\r\n if (transform) {\r\n range.extendTransformedPoint(transform, this.point00);\r\n range.extendTransformedPoint(transform, this.point10);\r\n range.extendTransformedPoint(transform, this.point01);\r\n range.extendTransformedPoint(transform, this.point11);\r\n } else {\r\n range.extendPoint(this.point00);\r\n range.extendPoint(this.point10);\r\n range.extendPoint(this.point01);\r\n range.extendPoint(this.point11);\r\n }\r\n }\r\n /**\r\n * Convert fractional u and v coordinates to surface point\r\n * @param u fractional coordinate in u direction\r\n * @param v fractional coordinate in v direction\r\n * @param result optional pre-allocated point\r\n */\r\n public uvFractionToPoint(u: number, v: number, result?: Point3d): Point3d {\r\n const f00 = (1.0 - u) * (1.0 - v);\r\n const f10 = u * (1.0 - v);\r\n const f01 = (1.0 - u) * v;\r\n const f11 = u * v;\r\n return Point3d.create(\r\n f00 * this.point00.x + f10 * this.point10.x + f01 * this.point01.x + f11 * this.point11.x,\r\n f00 * this.point00.y + f10 * this.point10.y + f01 * this.point01.y + f11 * this.point11.y,\r\n f00 * this.point00.z + f10 * this.point10.z + f01 * this.point01.z + f11 * this.point11.z,\r\n result\r\n );\r\n }\r\n /** Evaluate as a uv surface, returning point and two derivative vectors.\r\n * @param u fractional coordinate in u direction\r\n * @param v fractional coordinate in v direction\r\n * @param result optional pre-allocated carrier for point and vectors\r\n */\r\n public uvFractionToPointAndTangents(u: number, v: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\r\n const u0 = 1.0 - u;\r\n const v0 = 1.0 - v;\r\n const f00 = u0 * v0;\r\n const f10 = u * v0;\r\n const f01 = u0 * v;\r\n const f11 = u * v;\r\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(\r\n f00 * this.point00.x + f10 * this.point10.x + f01 * this.point01.x + f11 * this.point11.x,\r\n f00 * this.point00.y + f10 * this.point10.y + f01 * this.point01.y + f11 * this.point11.y,\r\n f00 * this.point00.z + f10 * this.point10.z + f01 * this.point01.z + f11 * this.point11.z,\r\n // u derivative ..\r\n v0 * (this.point10.x - this.point00.x) + v * (this.point11.x - this.point01.x),\r\n v0 * (this.point10.y - this.point00.y) + v * (this.point11.y - this.point01.y),\r\n v0 * (this.point10.z - this.point00.z) + v * (this.point11.z - this.point01.z),\r\n // v derivative ..\r\n u0 * (this.point01.x - this.point00.x) + u * (this.point11.x - this.point10.x),\r\n u0 * (this.point01.y - this.point00.y) + u * (this.point11.y - this.point10.y),\r\n u0 * (this.point01.z - this.point00.z) + u * (this.point11.z - this.point10.z),\r\n result\r\n );\r\n }\r\n /** If data[iB][pivotColumn] is larger in absolute value than data[iA][pivotColumn], then swap rows iA and iB. */\r\n private static conditionalPivot(pivotColumn: number, data: Float64Array[], iA: number, iB: number) {\r\n if (Math.abs(data[iB][pivotColumn]) > Math.abs(data[iA][pivotColumn])) {\r\n const q = data[iA];\r\n data[iA] = data[iB];\r\n data[iB] = q;\r\n }\r\n }\r\n /**\r\n * Compute the points of intersection with a ray.\r\n * @param ray ray in space\r\n * @returns 1 or 2 points if there are intersections, undefined if no intersections\r\n */\r\n public intersectRay(ray: Ray3d): CurveAndSurfaceLocationDetail[] | undefined {\r\n const vectorU = this.point10.minus(this.point00);\r\n const vectorV = this.point01.minus(this.point00);\r\n const vectorW = this.point11.minus(this.point10);\r\n vectorW.subtractInPlace(vectorV);\r\n // We seek t, u, v such that:\r\n // `ray.origin + t*ray.direction = point00 + u*vectorU + v*vectorV + u*v*vectorW`\r\n // For typical direction as x, the scalar equation with coefficient order for arrays is:\r\n // `0 = -t*ray.direction.x + (point00.x - ray.origin.x) + u*vectorU.x + v*vectorV.x + u*v*vectorW.x`\r\n // and this particular equation is invoked to compute t when u and v are known.\r\n const coffs = [\r\n new Float64Array([-ray.direction.x, this.point00.x - ray.origin.x, vectorU.x, vectorV.x, vectorW.x]),\r\n new Float64Array([-ray.direction.y, this.point00.y - ray.origin.y, vectorU.y, vectorV.y, vectorW.y]),\r\n new Float64Array([-ray.direction.z, this.point00.z - ray.origin.z, vectorU.z, vectorV.z, vectorW.z]),\r\n ];\r\n // swap rows so that the equation with largest ray.direction coefficient is first.\r\n BilinearPatch.conditionalPivot(0, coffs, 0, 1);\r\n BilinearPatch.conditionalPivot(0, coffs, 0, 2);\r\n SmallSystem.eliminateFromPivot(coffs[0], 0, coffs[1], -1.0);\r\n SmallSystem.eliminateFromPivot(coffs[0], 0, coffs[2], -1.0);\r\n const uvArray = SmallSystem.solveBilinearPair(\r\n coffs[1][1], coffs[1][2], coffs[1][3], coffs[1][4],\r\n coffs[2][1], coffs[2][2], coffs[2][3], coffs[2][4]\r\n );\r\n if (uvArray) {\r\n const result: CurveAndSurfaceLocationDetail[] = [];\r\n for (const uv of uvArray) {\r\n const t = -(coffs[0][1] + coffs[0][2] * uv.x + (coffs[0][3] + coffs[0][4] * uv.x) * uv.y) / coffs[0][0];\r\n const point = ray.fractionToPoint(t);\r\n result.push(new CurveAndSurfaceLocationDetail(\r\n CurveLocationDetail.createRayFractionPoint(ray, t, point),\r\n UVSurfaceLocationDetail.createSurfaceUVPoint(this, uv, point))\r\n );\r\n }\r\n return result;\r\n }\r\n return undefined;\r\n }\r\n /** Returns the larger of the u-direction edge lengths at v=0 and v=1. */\r\n public maxUEdgeLength(): number {\r\n return Geometry.maxXY(this.point00.distance(this.point10), this.point01.distance(this.point11));\r\n }\r\n /** Returns the larger of the v-direction edge lengths at u=0 and u=1. */\r\n public maxVEdgeLength(): number {\r\n return Geometry.maxXY(this.point00.distance(this.point01), this.point10.distance(this.point11));\r\n }\r\n}\r\n"]}
|
|
@@ -328,7 +328,7 @@ export declare class GeodesicPathPoint {
|
|
|
328
328
|
private static _vectorCross?;
|
|
329
329
|
/** Evaluate the newton function and derivatives:
|
|
330
330
|
* `(UAB cross UCB) dot d1cross`
|
|
331
|
-
* with as the central data, UAB = vector from pointA to pointB, UCB = vector from pointC to
|
|
331
|
+
* with as the central data, UAB = vector from pointA to pointB, UCB = vector from pointC to pointB.
|
|
332
332
|
* * Return order is:
|
|
333
333
|
* * values[0] = the function
|
|
334
334
|
* * values[1] = derivative wrt pointA.phi
|
|
@@ -881,7 +881,7 @@ class GeodesicPathPoint {
|
|
|
881
881
|
}
|
|
882
882
|
/** Evaluate the newton function and derivatives:
|
|
883
883
|
* `(UAB cross UCB) dot d1cross`
|
|
884
|
-
* with as the central data, UAB = vector from pointA to pointB, UCB = vector from pointC to
|
|
884
|
+
* with as the central data, UAB = vector from pointA to pointB, UCB = vector from pointC to pointB.
|
|
885
885
|
* * Return order is:
|
|
886
886
|
* * values[0] = the function
|
|
887
887
|
* * values[1] = derivative wrt pointA.phi
|