Table of Contents

Class InterpolatedDualSurfaceCurve

Namespace
CADability
Assembly
CADability.dll

The intersection curve of two surfaces for which no exact analytic description exists, typically the 3d curve of an Edge between two faces. It is defined by the two surfaces and an array of base points, each given in 3d and in the 2d parameter space of both surfaces; between the base points the curve is interpolated and, where needed, refined by intersecting the surfaces again. The 2d curves on the two surfaces are provided by the nested InterpolatedDualSurfaceCurve.ProjectedCurve class.

public class InterpolatedDualSurfaceCurve : GeneralCurve, ISerializable, IFeedBack, ICloneable, IColorDef, ICurve, IGeoObject, ILayer, IStyle, IOctTreeInsertable, IComparable, ILineWidth, ILinePattern, IDualSurfaceCurve, IJsonSerialize, IExportStep, IJsonSerializeDone, IDeserializationCallback, IOrientation
Inheritance
InterpolatedDualSurfaceCurve
Implements
Inherited Members

Constructors

InterpolatedDualSurfaceCurve()

protected InterpolatedDualSurfaceCurve()

InterpolatedDualSurfaceCurve(ISurface, BoundingRect, ISurface, BoundingRect, GeoPoint, GeoPoint)

public InterpolatedDualSurfaceCurve(ISurface surface1, BoundingRect bounds1, ISurface surface2, BoundingRect bounds2, GeoPoint startPoint, GeoPoint endPoint)

Parameters

surface1 ISurface
bounds1 BoundingRect
surface2 ISurface
bounds2 BoundingRect
startPoint GeoPoint
endPoint GeoPoint

InterpolatedDualSurfaceCurve(ISurface, BoundingRect, ISurface, BoundingRect, GeoPoint[], List<GeoPoint2D>, List<GeoPoint2D>)

public InterpolatedDualSurfaceCurve(ISurface surface1, BoundingRect bounds1, ISurface surface2, BoundingRect bounds2, GeoPoint[] pts, List<GeoPoint2D> uvpts1 = null, List<GeoPoint2D> uvpts2 = null)

Parameters

surface1 ISurface
bounds1 BoundingRect
surface2 ISurface
bounds2 BoundingRect
pts GeoPoint[]
uvpts1 List<GeoPoint2D>
uvpts2 List<GeoPoint2D>

InterpolatedDualSurfaceCurve(ISurface, BoundingRect, ISurface, BoundingRect, List<GeoPoint>, List<GeoPoint2D>, List<GeoPoint2D>)

public InterpolatedDualSurfaceCurve(ISurface surface1, BoundingRect bounds1, ISurface surface2, BoundingRect bounds2, List<GeoPoint> pts, List<GeoPoint2D> uvpts1 = null, List<GeoPoint2D> uvpts2 = null)

Parameters

surface1 ISurface
bounds1 BoundingRect
surface2 ISurface
bounds2 BoundingRect
pts List<GeoPoint>
uvpts1 List<GeoPoint2D>
uvpts2 List<GeoPoint2D>

InterpolatedDualSurfaceCurve(SerializationInfo, StreamingContext)

protected InterpolatedDualSurfaceCurve(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo
context StreamingContext

Properties

CurveOnSurface1

public ICurve2D CurveOnSurface1 { get; }

Property Value

ICurve2D

CurveOnSurface2

public ICurve2D CurveOnSurface2 { get; }

Property Value

ICurve2D

Description

Returns a textual description of the GeoObject. Mainly used for debugging purposes

public override string Description { get; }

Property Value

string

EndDirection

The direction of the curve at the endpoint. If the curve is closed, this is the direction where the parameter is 1.0.

public override GeoVector EndDirection { get; }

Property Value

GeoVector

EndPoint

The endpoint of the curve. If the curve is closed, this is the point where the parameter is 1.0.

public override GeoPoint EndPoint { get; set; }

Property Value

GeoPoint

IsClosed

Determines, whether the curve is closed or open.

public override bool IsClosed { get; }

Property Value

bool

IsComposed

Returns true, if the curve is composed of other curves. Paths and Polylines are composed curves.

public override bool IsComposed { get; }

Property Value

bool

StartDirection

The direction of the curve at the start-point. If the curve is closed, this is the direction where the parameter is 0.0.

public override GeoVector StartDirection { get; }

Property Value

GeoVector

StartPoint

The start-point of the curve. If the curve is closed, this is the point where the parameter is 0.0.

public override GeoPoint StartPoint { get; set; }

Property Value

GeoPoint

SubCurves

Returns subcurves of composed curves. Paths and Polylines are composed curves.

public override ICurve[] SubCurves { get; }

Property Value

ICurve[]

Surface1

public ISurface Surface1 { get; }

Property Value

ISurface

Surface2

public ISurface Surface2 { get; }

Property Value

ISurface

Methods

Approximate(bool, double)

Returns a Path or a Polyline that approximates the curve with lines or lines and arcs.

public override ICurve Approximate(bool linesOnly, double maxError)

Parameters

linesOnly bool

true: no arcs, only lines

maxError double

Maximum derivation from the exact curve

Returns

ICurve

The Approximation

Clone()

Clones this GeoObject.

public override IGeoObject Clone()

Returns

IGeoObject

the cloned GeoObject

CloneModified(ModOp)

Returns a modified copy of this curve

public override ICurve CloneModified(ModOp m)

Parameters

m ModOp

modification

Returns

ICurve

modified copy

CopyGeometry(IGeoObject)

Copies the geometrical aspects of the given GeoObject to this GeoObject. Both objects must be of the same type. The attributes are not copied.

public override void CopyGeometry(IGeoObject ToCopyFrom)

Parameters

ToCopyFrom IGeoObject

GeoObject to copy from

DirectionAt(double)

Returns the direction of the curve at a specified point. The parameter position of the start-point is 0.0, the parameter position of the endpoint is 1.0. Directions of a position outside this interval may be undefined.

public override GeoVector DirectionAt(double Position)

Parameters

Position double

Position on the curve

Returns

GeoVector

The requested direction

FindSnapPoint(SnapPointFinder)

Asks the object to add its snap points (end points, centres, intersections...) of the kinds that spf asks for. The default implementation adds none; objects with geometry override it.

public override void FindSnapPoint(SnapPointFinder spf)

Parameters

spf SnapPointFinder

definition and collection of the snap points

GetBasePoints()

protected override double[] GetBasePoints()

Returns

double[]

GetBoundingCube()

Returns a bounding cube of the object. The object must fir into this cube. There may be a smaller cube that contains the object if it is to expensive to calculate the exact cube.

public override BoundingCube GetBoundingCube()

Returns

BoundingCube

the bounding cube

GetBoundingRect(bool)

public BoundingRect GetBoundingRect(bool onSurface1)

Parameters

onSurface1 bool

Returns

BoundingRect

GetExtent(double)

Gets the 3-dimensional extent of an object

public override BoundingCube GetExtent(double precision)

Parameters

precision double

Precision of the test

Returns

BoundingCube

The minmax cube

GetObjectData(IJsonWriteData)

Writes the data of this base class (user data, layer, style, user attributes and actuator) for the JSON serialization (IJsonSerialize). Derived classes override it, call the base implementation and add their own properties.

public override void GetObjectData(IJsonWriteData data)

Parameters

data IJsonWriteData

receives the data

GetObjectData(SerializationInfo, StreamingContext)

Writes the data of this object for the legacy binary serialization (ISerializable). Files are written in the JSON format (IJsonSerialize) now; the binary format is still read.

public override void GetObjectData(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo

receives the data

context StreamingContext

the destination of the serialization

GetPlanarState()

Determins the state of the curve in space. A curve may be either Planar (e.g. a cicle), NonPlanar (e.g. a polyline with vertices that dont shear a common plane) or UnderDetermined (e.g. a line defines a sheaf of planes (Ebenenbüschel))

public override PlanarState GetPlanarState()

Returns

PlanarState

GetPlane()

Determins the plane in which the curve resides. Throws CurveException if the curve's PlanarState is NonPlanar or UnderDetermined.

public override Plane GetPlane()

Returns

Plane

The plane

GetProjectedCurve(Plane)

Orthogonally projects this curve into the given plane. Returns the 2D curve in the coordinate system of the given plane.

public override ICurve2D GetProjectedCurve(Plane p)

Parameters

p Plane

The plane this curve will be projected on

Returns

ICurve2D

The 2D curve in the given plane

GetSelfIntersections()

Returns the self intersection position of this curve. The returned array contains pairs of parameter values. Each intersectionpoint corresponds to two parameters.

public override double[] GetSelfIntersections()

Returns

double[]

Parameters of the intersection points

InvalidateSecondaryData()

protected override void InvalidateSecondaryData()

IsInPlane(Plane)

Determines whether the curve resides in the given plane.

public override bool IsInPlane(Plane p)

Parameters

p Plane

The plane for the test

Returns

bool

true, when the curve resides in the plane

Modify(ModOp)

Modifies this GeoObject with the given modification operation (includes moving, rotating, reflecting, scaling etc.).

public override void Modify(ModOp m)

Parameters

m ModOp

Operation to be applied

PaintTo3D(IPaintTo3D)

Paints the object with the methods of paintTo3D: lines, triangles, text... The views implement IPaintTo3D (with OpenGL or GDI) and collect what the object paints in a display list, so this is called rarely, after PrepareDisplayList(double) has done the expensive work (triangulation, approximation).

public override void PaintTo3D(IPaintTo3D paintTo3D)

Parameters

paintTo3D IPaintTo3D

where to paint

PointAt(double)

Returns the point of the given position. The parameter position of the start-point is 0.0, the parameter position of the endpoint is 1.0. Points of a position outside this interval may be undefined. The correlation between the parameter Position and the resulting point may be not linear.

public override GeoPoint PointAt(double Position)

Parameters

Position double

Position on the curve

Returns

GeoPoint

The requested point

Position(GeoPoint, GeoVector, double)

Returns the smallest parameter value (l) where the provided line hits the object so that the point fromHere + l * direction is on or close to the object. The result may be negative. Return double.MaxValue if there is no such point.

public override double Position(GeoPoint fromHere, GeoVector direction, double precision)

Parameters

fromHere GeoPoint

Startpoint of the line

direction GeoVector

Direction of the line

precision double

Precision for the test

Returns

double

Position on the line

PositionAtLength(double)

Returns the parameter of the point at the given position. The position must be in the interval [0, Length]. The correlation between the parameter Position and the resulting position is linear. The result is usually used for PointAt(double) or DirectionAt(double).

public override double PositionAtLength(double position)

Parameters

position double

Position on the curve

Returns

double

The requested position

PositionOf(GeoPoint)

Returns the parametric position of the point on the curve. This function is inverse to DirectionAt(double). If the given point is not on the curve, the result is the position of a point on the curve, that is close to the given point, but not necessary of the closest point.

public override double PositionOf(GeoPoint p)

Parameters

p GeoPoint

Point, for which the position is requested

Returns

double

the requested position

PositionOf(GeoPoint, Plane)

Similar to the PointAt(double) method. Returns the same result, if the point is on the curve. If the point is not on the curve the problem is looked at in the given plane. i.e. the closest point on the projected 2d curve from the projected 2d point is used.

public override double PositionOf(GeoPoint p, Plane pl)

Parameters

p GeoPoint

Point, whos position is requested

pl Plane

Plane for the computation of the closest point

Returns

double

the requested position

PositionOf(GeoPoint, double)

Similar to PositionOf(GeoPoint). If the point is not on the curve and there are several solutions then the solution closest to the parameter prefer will be returned.

public override double PositionOf(GeoPoint p, double prefer)

Parameters

p GeoPoint

Point, for which the position is requested

prefer double

preferable solution close to this value

Returns

double

the requested position

Reverse()

Reverses the direction of the curve.

public override void Reverse()

SameGeometry(ICurve, double)

Returns true, if this curve and the provided curve describe the same curve in space (maybe opposite direction)

public override bool SameGeometry(ICurve other, double precision)

Parameters

other ICurve

The curve to be compared with

precision double

The required precision

Returns

bool

true, if geometrically equal

SetObjectData(IJsonReadData)

Reads the data written by GetObjectData(IJsonWriteData) back from the JSON serialization. Derived classes override it, call the base implementation and read their own properties. Objects referenced by the data may still be incomplete at this time, see IJsonSerializeDone.

public override void SetObjectData(IJsonReadData data)

Parameters

data IJsonReadData

provides the data

Split(double)

Splits the curve at the given position. The position must be in the interval 0..1 and the curve must not be closed. For closed curves Split(double, double).

public override ICurve[] Split(double Position)

Parameters

Position double

Where to split

Returns

ICurve[]

the splitted curve(s)

Split(double, double)

Splits the closed curve into two open curves at the given positions.

public override ICurve[] Split(double Position1, double Position2)

Parameters

Position1 double

first Position

Position2 double

second Position

Returns

ICurve[]

the splitted curve(s)

TangentPosition(GeoVector)

Returns a list of positions where the curve has the same or opposite direction as the given direction. Mainly used for visualisation purposes. If there are no such points (which is true in most cases) An empty array should be returned.

public override double[] TangentPosition(GeoVector direction)

Parameters

direction GeoVector

Returns

double[]

ToBSpline(double)

public BSpline ToBSpline(double precision)

Parameters

precision double

Returns

BSpline

Trim(double, double)

Modifies start and endpoint of this curve. StartPos must be less than EndPos. if StartPos is less than 0.0 or EndPos greater than 1.0 this only works for lines and (circular or elliptical) arcs.

public override void Trim(double StartPos, double EndPos)

Parameters

StartPos double

New start position

EndPos double

New end position