Class BoxedSurfaceExtension
- Namespace
- CADability
- Assembly
- CADability.dll
Experimental numerical algorithms based on the MathNet optimizers (Newton, Levenberg-Marquardt, trust region): positions of points on surfaces, intersections of curves and surfaces and fitting of planes, lines, cones, tori, cylinders and quadrics to points. Most of them are alternatives to the methods of GaussNewtonMinimizer and are only kept for comparison; ConeFit(IArray<GeoPoint>, GeoPoint, GeoVector, double, double, out ConicalSurface) is used when a shell is reconstructed from a triangulation. Internal helper, not an entry point of the API.
public static class BoxedSurfaceExtension
- Inheritance
-
BoxedSurfaceExtension
- Inherited Members
Methods
ConeFit(IArray<GeoPoint>, GeoPoint, GeoVector, double, double, out ConicalSurface)
public static double ConeFit(IArray<GeoPoint> points, GeoPoint apex, GeoVector axis, double theta, double precision, out ConicalSurface cs)
Parameters
pointsIArray<GeoPoint>apexGeoPointaxisGeoVectorthetadoubleprecisiondoublecsConicalSurface
Returns
CurveIntersection2D(ICurve2D, double, double, ICurve2D, double, double, ref double, ref double, ref GeoPoint2D)
public static bool CurveIntersection2D(ICurve2D curve1, double spar1, double epar1, ICurve2D curve2, double spar2, double epar2, ref double par1, ref double par2, ref GeoPoint2D ip)
Parameters
curve1ICurve2Dspar1doubleepar1doublecurve2ICurve2Dspar2doubleepar2doublepar1doublepar2doubleipGeoPoint2D
Returns
CurveSurfaceIntersection(ISurface, ICurve, BoundingRect, double, double, ref GeoPoint2D, ref double, out GeoPoint)
public static bool CurveSurfaceIntersection(ISurface surface, ICurve curve, BoundingRect surfaceBounds, double uOnCurveMin, double uOnCurveMax, ref GeoPoint2D uvOnSurface, ref double uOnCurve, out GeoPoint ip)
Parameters
surfaceISurfacecurveICurvesurfaceBoundsBoundingRectuOnCurveMindoubleuOnCurveMaxdoubleuvOnSurfaceGeoPoint2DuOnCurvedoubleipGeoPoint
Returns
CurveSurfaceIntersection(ISurface, ICurve, ref GeoPoint2D, ref double, out GeoPoint)
public static bool CurveSurfaceIntersection(ISurface surface, ICurve curve, ref GeoPoint2D uvOnSurface, ref double uOnCurve, out GeoPoint ip)
Parameters
surfaceISurfacecurveICurveuvOnSurfaceGeoPoint2DuOnCurvedoubleipGeoPoint
Returns
CurveSurfaceIntersectionDL(ISurface, ICurve, BoundingRect, double, double, ref GeoPoint2D, ref double, out GeoPoint)
public static bool CurveSurfaceIntersectionDL(ISurface surface, ICurve curve, BoundingRect surfaceBounds, double uOnCurveMin, double uOnCurveMax, ref GeoPoint2D uvOnSurface, ref double uOnCurve, out GeoPoint ip)
Parameters
surfaceISurfacecurveICurvesurfaceBoundsBoundingRectuOnCurveMindoubleuOnCurveMaxdoubleuvOnSurfaceGeoPoint2DuOnCurvedoubleipGeoPoint
Returns
CurveSurfaceIntersectionLM(ISurface, ICurve, ref GeoPoint2D, ref double, out GeoPoint)
public static bool CurveSurfaceIntersectionLM(ISurface surface, ICurve curve, ref GeoPoint2D uvOnSurface, ref double uOnCurve, out GeoPoint ip)
Parameters
surfaceISurfacecurveICurveuvOnSurfaceGeoPoint2DuOnCurvedoubleipGeoPoint
Returns
CylinderFit(IArray<GeoPoint>, GeoPoint, GeoVector, double, double, out CylindricalSurface)
public static double CylinderFit(IArray<GeoPoint> points, GeoPoint center, GeoVector axis, double radius, double precision, out CylindricalSurface cs)
Parameters
pointsIArray<GeoPoint>centerGeoPointaxisGeoVectorradiusdoubleprecisiondoublecsCylindricalSurface
Returns
LineFit(IEnumerable<GeoPoint>, double, out GeoPoint, out GeoVector)
public static double LineFit(IEnumerable<GeoPoint> points, double precision, out GeoPoint location, out GeoVector direction)
Parameters
pointsIEnumerable<GeoPoint>precisiondoublelocationGeoPointdirectionGeoVector
Returns
PlaneFit(IEnumerable<GeoPoint>, out GeoPoint, out GeoVector)
Fit a plane through a number of points. This is working, but has a bad performance. Better use Plane.FromPoints
public static bool PlaneFit(IEnumerable<GeoPoint> points, out GeoPoint location, out GeoVector normal)
Parameters
pointsIEnumerable<GeoPoint>locationGeoPointnormalGeoVector
Returns
PositionOfLM(ISurface, GeoPoint, ref GeoPoint2D, out double)
Find the (u,v)-position for the provided point on a surface. Using the LevenbergMarquardtMinimizer from MathNet. Slower than the NewtonMinimizer but working with first tests. It is said that it is more robust.
public static bool PositionOfLM(ISurface surface, GeoPoint p3d, ref GeoPoint2D res, out double mindist)
Parameters
surfaceISurfacep3dGeoPointresGeoPoint2Dmindistdouble
Returns
PositionOfMN(ISurface, GeoPoint, ref GeoPoint2D, out double)
Find the (u,v)-position for the provided point on a surface. Using the NewtonMinimizer from MathNet. Faster than LevenbergMarquardtMinimizer. Surfaces need second derivatives.
public static bool PositionOfMN(ISurface surface, GeoPoint p3d, ref GeoPoint2D res, out double mindist)
Parameters
surfaceISurfacep3dGeoPointresGeoPoint2Dmindistdouble
Returns
QuadricFit(IArray<GeoPoint>)
public static double QuadricFit(IArray<GeoPoint> points)
Parameters
Returns
QuadricFitOld(IArray<GeoPoint>)
public static double QuadricFitOld(IArray<GeoPoint> points)
Parameters
Returns
SurfacesIntersectionLM(ISurface, ISurface, ISurface, ref GeoPoint2D, ref GeoPoint2D, ref GeoPoint2D, ref GeoPoint)
public static bool SurfacesIntersectionLM(ISurface surface1, ISurface surface2, ISurface surface3, ref GeoPoint2D uv1, ref GeoPoint2D uv2, ref GeoPoint2D uv3, ref GeoPoint ip)
Parameters
surface1ISurfacesurface2ISurfacesurface3ISurfaceuv1GeoPoint2Duv2GeoPoint2Duv3GeoPoint2DipGeoPoint
Returns
SurfacesIntersectionLM(Polynom, Polynom, Polynom, ref GeoPoint)
public static bool SurfacesIntersectionLM(Polynom surface1, Polynom surface2, Polynom surface3, ref GeoPoint ip)
Parameters
Returns
Test()
public static void Test()
TestPlaneFit(IArray<GeoPoint>, out Plane)
public static double TestPlaneFit(IArray<GeoPoint> points, out Plane plane)
Parameters
Returns
TorusFit(IArray<GeoPoint>, GeoPoint, GeoVector, double, double, out ToroidalSurface)
public static double TorusFit(IArray<GeoPoint> points, GeoPoint center, GeoVector axis, double minrad, double precision, out ToroidalSurface ts)
Parameters
pointsIArray<GeoPoint>centerGeoPointaxisGeoVectorminraddoubleprecisiondoubletsToroidalSurface