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
crv1ICurvecrv2ICurveprecisiondoubleMaximum 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
Returns
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
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
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
curve1ICurveFirst curve for intersection
curve2ICurveSecond curve for intersection
onlyInsideboolif 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
curve1ICurveFirst curve
curve2ICurveSecond curve
par1double[]Resulting parameters for the first curve
par2double[]Resulting parameters for the second curve
intersectionGeoPoint[]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
curve1ICurvefirst curve
par1doubleon input the start parameter on
curve1, on output the parameter of the found pointcurve2ICurvesecond curve
par2doubleon 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
curve1ICurveFirst curve
curve2ICurveSecond curve
precisiondoubleRequired precision
from1doubleStarting parameter for first curve
to1doubleEnding parameter for first curve
from2doubleStarting parameter for second curve
to2doubleEnding parameter for second curve