Table of Contents

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

points IArray<GeoPoint>
apex GeoPoint
axis GeoVector
theta double
precision double
cs ConicalSurface

Returns

double

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

curve1 ICurve2D
spar1 double
epar1 double
curve2 ICurve2D
spar2 double
epar2 double
par1 double
par2 double
ip GeoPoint2D

Returns

bool

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

surface ISurface
curve ICurve
surfaceBounds BoundingRect
uOnCurveMin double
uOnCurveMax double
uvOnSurface GeoPoint2D
uOnCurve double
ip GeoPoint

Returns

bool

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

surface ISurface
curve ICurve
uvOnSurface GeoPoint2D
uOnCurve double
ip GeoPoint

Returns

bool

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

surface ISurface
curve ICurve
surfaceBounds BoundingRect
uOnCurveMin double
uOnCurveMax double
uvOnSurface GeoPoint2D
uOnCurve double
ip GeoPoint

Returns

bool

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

surface ISurface
curve ICurve
uvOnSurface GeoPoint2D
uOnCurve double
ip GeoPoint

Returns

bool

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

points IArray<GeoPoint>
center GeoPoint
axis GeoVector
radius double
precision double
cs CylindricalSurface

Returns

double

LineFit(IEnumerable<GeoPoint>, double, out GeoPoint, out GeoVector)

public static double LineFit(IEnumerable<GeoPoint> points, double precision, out GeoPoint location, out GeoVector direction)

Parameters

points IEnumerable<GeoPoint>
precision double
location GeoPoint
direction GeoVector

Returns

double

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

points IEnumerable<GeoPoint>
location GeoPoint
normal GeoVector

Returns

bool

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

surface ISurface
p3d GeoPoint
res GeoPoint2D
mindist double

Returns

bool

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

surface ISurface
p3d GeoPoint
res GeoPoint2D
mindist double

Returns

bool

QuadricFit(IArray<GeoPoint>)

public static double QuadricFit(IArray<GeoPoint> points)

Parameters

points IArray<GeoPoint>

Returns

double

QuadricFitOld(IArray<GeoPoint>)

public static double QuadricFitOld(IArray<GeoPoint> points)

Parameters

points IArray<GeoPoint>

Returns

double

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

surface1 ISurface
surface2 ISurface
surface3 ISurface
uv1 GeoPoint2D
uv2 GeoPoint2D
uv3 GeoPoint2D
ip GeoPoint

Returns

bool

SurfacesIntersectionLM(Polynom, Polynom, Polynom, ref GeoPoint)

public static bool SurfacesIntersectionLM(Polynom surface1, Polynom surface2, Polynom surface3, ref GeoPoint ip)

Parameters

surface1 Polynom
surface2 Polynom
surface3 Polynom
ip GeoPoint

Returns

bool

Test()

public static void Test()

TestPlaneFit(IArray<GeoPoint>, out Plane)

public static double TestPlaneFit(IArray<GeoPoint> points, out Plane plane)

Parameters

points IArray<GeoPoint>
plane Plane

Returns

double

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

points IArray<GeoPoint>
center GeoPoint
axis GeoVector
minrad double
precision double
ts ToroidalSurface

Returns

double