Table of Contents

Class Curves

Namespace
CADability.GeoObject
Assembly
CADability.dll

This class provides static methods concerning the interaction of two or more ICurve objects.

public class Curves
Inheritance
Curves
Inherited Members

Constructors

Curves()

public Curves()

Methods

Combine(ICurve, ICurve, double)

Tries to combine two curves. crv1 and crv2 must be correct oriented and the endpoint of crv1 mut be the start-point of crv2

public static ICurve Combine(ICurve crv1, ICurve crv2, double precision)

Parameters

crv1 ICurve
crv2 ICurve
precision double

Maximum distance between the endpoint of crv1 and the startpoint of crv2, also used as the tolerance when comparing the geometry of the curves

Returns

ICurve

the combined curve or null, if not possible

GetCommonPlane(ICurve, ICurve, out Plane)

Determines the common plane of the two curves. If there is a common plane, the Parameter CommonPlane gets the result ant the function returns true. Otherwise the function returns false.

public static bool GetCommonPlane(ICurve c1, ICurve c2, out Plane CommonPlane)

Parameters

c1 ICurve

first curve

c2 ICurve

second curve

CommonPlane Plane

the resulting common plane

Returns

bool

GetCommonPlane(GeoPoint, ICurve, out Plane)

Determines the commomn plane of a point and a curve. Returns the common plane in the parameter and true if there is such a plane. Returns false, if the point lies not in the plane. Precision

public static bool GetCommonPlane(GeoPoint p, ICurve c2, out Plane CommonPlane)

Parameters

p GeoPoint

The point

c2 ICurve

The curve

CommonPlane Plane

The common plane

Returns

bool

true, if there is a common plane, else false

GetCommonPlane(IList<ICurve>, out Plane)

Tries to find a plane that contains most of the given curves.

public static bool GetCommonPlane(IList<ICurve> curves, out Plane CommonPlane)

Parameters

curves IList<ICurve>

List of ICurves

CommonPlane Plane

Returns common plane

Returns

bool

Returns wether a common plan was found or not

Intersect(ICurve, ICurve, bool)

Returns the parameters of the intersection points of curve1 with curve2. Parameters are with respect to curve1. The two curves must reside in a common plane.

public static double[] Intersect(ICurve curve1, ICurve curve2, bool onlyInside)

Parameters

curve1 ICurve

First curve for intersection

curve2 ICurve

Second curve for intersection

onlyInside bool

if true, only intersction point that are actually on the curves are returned otherwise also intersection points on the extension of ther curves are returned

Returns

double[]

Parameters for the intersection points

Intersect(ICurve, ICurve, out double[], out double[], out GeoPoint[])

Calculates the intersection points of the two curves.

public static int Intersect(ICurve curve1, ICurve curve2, out double[] par1, out double[] par2, out GeoPoint[] intersection)

Parameters

curve1 ICurve

First curve

curve2 ICurve

Second curve

par1 double[]

Resulting parameters for the first curve

par2 double[]

Resulting parameters for the second curve

intersection GeoPoint[]

Three dimensional intersection points

Returns

int

Number of intersection points

NewtonMinDist(ICurve, ref double, ICurve, ref double)

Finds by Newton iteration a pair of parameters where the line connecting the two curves is perpendicular to both curves, i.e. a local minimum (or maximum) of the distance between the curves. Starting from the given parameters, the curves are replaced by their tangents and the closest points of the tangents (DistLL(GeoPoint, GeoVector, GeoPoint, GeoVector, out double, out double)) yield the next parameters. On closed curves the parameters wrap around. There is no iteration limit except that the iteration is given up when the parameters leave the range [0,1] three times, so the start values should be close to the solution.

public static bool NewtonMinDist(ICurve curve1, ref double par1, ICurve curve2, ref double par2)

Parameters

curve1 ICurve

first curve

par1 double

on input the start parameter on curve1, on output the parameter of the found point

curve2 ICurve

second curve

par2 double

on input the start parameter on curve2, on output the parameter of the found point

Returns

bool

true, if the iteration converged (both parameter changes below 1e-6); false if it diverged, the parameters are then meaningless

Overlapping(ICurve, ICurve, double, out double, out double, out double, out double)

Returns true if curve1 and curve2 are overlapping curves. The overlapping intervalls for both curves are returned in from1, to1, from2 and to2.

public static bool Overlapping(ICurve curve1, ICurve curve2, double precision, out double from1, out double to1, out double from2, out double to2)

Parameters

curve1 ICurve

First curve

curve2 ICurve

Second curve

precision double

Required precision

from1 double

Starting parameter for first curve

to1 double

Ending parameter for first curve

from2 double

Starting parameter for second curve

to2 double

Ending parameter for second curve

Returns

bool