Table of Contents

Class InterpolatedDualSurfaceCurve.ProjectedCurve

Namespace
CADability
Assembly
CADability.dll

The 2d curve of an InterpolatedDualSurfaceCurve in the parameter space of one of its two surfaces, returned by CurveOnSurface1 and CurveOnSurface2. It has no geometry of its own but is evaluated from the base points and surfaces of the 3d curve, so it always stays consistent with it; it serves as the 2d curve of an Edge on the faces of the intersected surfaces.

public class InterpolatedDualSurfaceCurve.ProjectedCurve : GeneralCurve2D, ICurve2D, IQuadTreeInsertable, ISerializable, IJsonSerialize
Inheritance
InterpolatedDualSurfaceCurve.ProjectedCurve
Implements
Inherited Members

Constructors

ProjectedCurve()

protected ProjectedCurve()

ProjectedCurve(InterpolatedDualSurfaceCurve, ProjectedCurve)

public ProjectedCurve(InterpolatedDualSurfaceCurve curve3d, InterpolatedDualSurfaceCurve.ProjectedCurve toCloneFrom)

Parameters

curve3d InterpolatedDualSurfaceCurve
toCloneFrom InterpolatedDualSurfaceCurve.ProjectedCurve

ProjectedCurve(InterpolatedDualSurfaceCurve, bool)

public ProjectedCurve(InterpolatedDualSurfaceCurve curve3d, bool onSurface1)

Parameters

curve3d InterpolatedDualSurfaceCurve
onSurface1 bool

ProjectedCurve(InterpolatedDualSurfaceCurve, bool, bool)

public ProjectedCurve(InterpolatedDualSurfaceCurve curve3d, bool onSurface1, bool reversed)

Parameters

curve3d InterpolatedDualSurfaceCurve
onSurface1 bool
reversed bool

ProjectedCurve(SerializationInfo, StreamingContext)

protected ProjectedCurve(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo
context StreamingContext

Properties

EndDirection

The direction of the curve at the end point (see EndDirection). This base implementation returns the normalized direction at the last base point of the triangulation.

public override GeoVector2D EndDirection { get; }

Property Value

GeoVector2D

EndPoint

The end point of the curve (see EndPoint). This base implementation takes it from the last base point of the triangulation; setting it only replaces that base point and leaves the underlying geometry unchanged, which is acceptable for small corrections only. Curves with their own data override it.

public override GeoPoint2D EndPoint { get; set; }

Property Value

GeoPoint2D

IsClosed

Tells whether the curve is closed (see IsClosed). This base implementation tests whether StartPoint and EndPoint coincide according to IsEqual(GeoPoint2D, GeoPoint2D).

public override bool IsClosed { get; }

Property Value

bool

StartDirection

The direction of the curve at the start point (see StartDirection). This base implementation returns the normalized direction at the first base point of the triangulation.

public override GeoVector2D StartDirection { get; }

Property Value

GeoVector2D

StartPoint

The start point of the curve (see StartPoint). This base implementation takes it from the first base point of the triangulation; setting it only replaces that base point and leaves the underlying geometry unchanged, which is acceptable for small corrections only. Curves with their own data override it.

public override GeoPoint2D StartPoint { get; set; }

Property Value

GeoPoint2D

Methods

Clone()

Returns an independent copy of this curve of the same type. Modifying the copy does not affect this curve.

public override ICurve2D Clone()

Returns

ICurve2D

the copy

CloneReverse(bool)

Returns a copy of this curve (see Clone()) which is reversed when reverse is true, i.e. start point and end point are exchanged and the parameter runs the other way round.

public override ICurve2D CloneReverse(bool reverse)

Parameters

reverse bool

true to reverse the copy, false to copy it as it is

Returns

ICurve2D

the copy

Copy(ICurve2D)

Copies the data of the given object to this object. Both objects must be of the same type.

public override void Copy(ICurve2D toCopyFrom)

Parameters

toCopyFrom ICurve2D

Copies the data of this object

DirectionAt(double)

Returns the direction of the curve at the provided normalized position.

public override GeoVector2D DirectionAt(double par)

Parameters

par double

Returns

GeoVector2D

The direction

GetModified(ModOp2D)

Returns a ICurve which is this curve modified by m. The curve can be of different type, e.g. a Circle may return an Ellpse

public override ICurve2D GetModified(ModOp2D m)

Parameters

m ModOp2D

Returns

ICurve2D

GetObjectData(IJsonWriteData)

public void GetObjectData(IJsonWriteData data)

Parameters

data IJsonWriteData

GetTriangulationBasis(out GeoPoint2D[], out GeoVector2D[], out double[])

Supplies the base points of the triangulation (see MakeTriangulation()): a list of parameters, ascending from 0.0 to 1.0, with the points and the directions of the curve at them. Between two consecutive base points the curve must be free of kinks, and it should bend to one side only, so that the triangle spanned by the two points and their tangents encloses that piece of the curve; the knots of a spline or the quadrant points of an arc are typical choices. GetInflectionPoints() and Length use the same basis to bracket their numerical work. The default implementation takes the parameters 0.0, 0.25, 0.5, 0.75 and 1.0 with the normalized DirectionAt(double).

protected override void GetTriangulationBasis(out GeoPoint2D[] points, out GeoVector2D[] directions, out double[] parameters)

Parameters

points GeoPoint2D[]

the base points on the curve

directions GeoVector2D[]

the directions of the curve at the base points

parameters double[]

the normalized parameters of the base points, ascending

Move(double, double)

Move the curve by the given offset

public override void Move(double x, double y)

Parameters

x double
y double

PointAt(double)

Returns the point of the curve at the provided normalized position

public override GeoPoint2D PointAt(double par)

Parameters

par double

Returns

GeoPoint2D

The point

PositionOf(GeoPoint2D)

Returns the position of point p on the curve: 0.0 corresponds to the StartPoint 1.0 to the EndPoint

public override double PositionOf(GeoPoint2D p)

Parameters

p GeoPoint2D

Returns

double

Reverse()

Reverses the direction of this curve

public override void Reverse()

SetObjectData(IJsonReadData)

public void SetObjectData(IJsonReadData data)

Parameters

data IJsonReadData

ToBspline(double)

public BSpline2D ToBspline(double precision)

Parameters

precision double

Returns

BSpline2D

Trim(double, double)

Returns a new curve of the same type which is the part of this curve between the two normalized parameters. The curve itself remains unchanged. Normally StartPos is less than EndPos; for a closed curve (Circle2D, Ellipse2D) reversed parameters select the part that runs across the start point of the curve, for other curves the behaviour depends on the type (a Line2D or Arc2D returns the part in reversed direction).

public override ICurve2D Trim(double StartPos, double EndPos)

Parameters

StartPos double

parameter of the start of the part

EndPos double

parameter of the end of the part

Returns

ICurve2D

the trimmed curve, or null when the result would be degenerate (e.g. an arc with zero sweep)

TryPointDeriv2At(double, out GeoPoint2D, out GeoVector2D, out GeoVector2D)

Returns the point and the first two derivatives of the curve with respect to the normalized parameter at position (see TryPointDeriv2At(double, out GeoPoint2D, out GeoVector2D, out GeoVector2D)). This base implementation only provides the point and DirectionAt(double) as first derivative, sets the second derivative to the null vector and returns false; curves that know their second derivative override it.

public override bool TryPointDeriv2At(double position, out GeoPoint2D point, out GeoVector2D deriv, out GeoVector2D deriv2)

Parameters

position double

the normalized parameter

point GeoPoint2D

the point at the parameter

deriv GeoVector2D
deriv2 GeoVector2D

the second derivative, the null vector when not available

Returns

bool

true if the second derivative is available, false otherwise