Table of Contents

Class HelicalSurface

Namespace
CADability.GeoObject
Assembly
CADability.dll

A helical surface defined by an axis, a curve and a pitch. the curve and the axis must reside in a common plane. The curve is revolved around the axis while beeing moved in direction of the axis. The distance movement in direction of the aixs is "pitch" for one full turn.

public class HelicalSurface : ISurfaceImpl, ISurface, IOctTreeInsertable, ISerializable
Inheritance
HelicalSurface
Implements
Inherited Members
Extension Methods

Constructors

HelicalSurface(ICurve, GeoPoint, GeoVector, double, double, double, GeoPoint?)

Creates the helical surface swept by basisCurve revolving about the axis through axisLocation in direction axisDirection while it advances pitch along the axis per full turn. The u parameter is the rotation angle in radians, the v parameter is the position on the curve, running from curveStartParameter at its start point to curveEndParameter at its end point. The curve is projected into a plane through the axis, which is given by axisRefPoint or, when that is not provided, by the end point of the curve that is farther from the axis.

public HelicalSurface(ICurve basisCurve, GeoPoint axisLocation, GeoVector axisDirection, double pitch, double curveStartParameter, double curveEndParameter, GeoPoint? axisRefPoint = null)

Parameters

basisCurve ICurve

the curve to sweep; it is projected into the plane through the axis

axisLocation GeoPoint

a point on the axis

axisDirection GeoVector

direction of the axis

pitch double

the distance along the axis for one full turn (2π in u)

curveStartParameter double

v value of the start point of the curve, usually 0

curveEndParameter double

v value of the end point of the curve, usually 1

axisRefPoint GeoPoint?

optional point that, together with the axis, defines the plane the curve is projected into

Exceptions

SurfaceOfRevolutionException

when no plane through the axis can be determined, because both end points of the curve lie on the axis and the curve is not planar

HelicalSurface(SerializationInfo, StreamingContext)

Constructor for the legacy binary deserialization (ISerializable). Older files without the curve parameter offset are read with an offset of 0.

protected HelicalSurface(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo

the data of the object

context StreamingContext

the source of the deserialization

Properties

Axis

Returns the direction of the axis of revolution

public GeoVector Axis { get; }

Property Value

GeoVector

BasisCurve

Returns the curve that is rotated to form this surface

public ICurve BasisCurve { get; }

Property Value

ICurve

IsUPeriodic

Returns true, if this surface is periodic in the u direction (e.g. a cylinder) false otherwise.

public override bool IsUPeriodic { get; }

Property Value

bool

IsVPeriodic

Returns true, if this surface is periodic in the v direction (e.g. a torus) false otherwise.

public override bool IsVPeriodic { get; }

Property Value

bool

Location

Returns the location of the axis of revolution

public GeoPoint Location { get; }

Property Value

GeoPoint

Oriented

Returns true, if this surface divides the space into two parts. If the surfaces is Oriented Orientation(GeoPoint) returns a valid result

public override bool Oriented { get; }

Property Value

bool

Pitch

The distance the curve advances along the axis during one full turn (u = 2π). A negative pitch reverses the handedness of the helix.

public double Pitch { get; }

Property Value

double

UPeriod

Returns the u priod of this surface if it is u periodic 0.0 otherwise

public override double UPeriod { get; }

Property Value

double

VPeriod

Returns the v priod of this surface if it is v periodic 0.0 otherwise

public override double VPeriod { get; }

Property Value

double

XAxis

Returns the 0 position of the revolution

public GeoVector XAxis { get; }

Property Value

GeoVector

Methods

Clone()

Returns an identical but independant copy of this surface

public override ISurface Clone()

Returns

ISurface

CopyData(ISurface)

Copies the data of the given surface to this surface. The two surfaces are guaranteed to be of the same type. (Used after Clone() and Modify(ModOp) to restore the original values).

public override void CopyData(ISurface CopyFrom)

Parameters

CopyFrom ISurface

where to copy the data from

Derivation2At(GeoPoint2D, out GeoPoint, out GeoVector, out GeoVector, out GeoVector, out GeoVector, out GeoVector)

Returns the point, the two first derivations and the three second derivations of the surface at the provided parameter position.

public override void Derivation2At(GeoPoint2D uv, out GeoPoint location, out GeoVector du, out GeoVector dv, out GeoVector duu, out GeoVector dvv, out GeoVector duv)

Parameters

uv GeoPoint2D

Point in the parameter space

location GeoPoint

Resulting 3D point

du GeoVector

Resulting derivation in u

dv GeoVector

Resulting derivation in v

duu GeoVector
dvv GeoVector
duv GeoVector

FixedU(double, double, double)

Returns a curve where the u parameter of this surface is fixed and the v parameter starts a vmin and ends at vmax

public override ICurve FixedU(double u, double vmin, double vmax)

Parameters

u double
vmin double
vmax double

Returns

ICurve

FixedV(double, double, double)

Returns a curve where the v parameter of this surface is fixed and the u parameter starts a umin and ends at umax

public override ICurve FixedV(double v, double umin, double umax)

Parameters

v double
umin double
umax double

Returns

ICurve

GetMaximumExtent()

Returns the parameter domain of one full turn of the complete curve: u from 0 to 2π, v from the start to the end parameter of the curve. The surface itself is not bounded in u.

public BoundingRect GetMaximumExtent()

Returns

BoundingRect

the rectangle [0, 2π] × [curveStartParameter, curveEndParameter] in parameter space

GetModified(ModOp)

Returns a clone of this surface modified by the given ModOp.

public override ISurface GetModified(ModOp m)

Parameters

m ModOp

how to modify

Returns

ISurface

GetNaturalBounds(out double, out double, out double, out double)

Returns the natural bounds of the surface. The returned values may be infinite

public override void GetNaturalBounds(out double umin, out double umax, out double vmin, out double vmax)

Parameters

umin double
umax double
vmin double
vmax double

GetNormal(GeoPoint2D)

Returns the normal vector (perpendicular to the surface) at the given u/v point

public override GeoVector GetNormal(GeoPoint2D uv)

Parameters

uv GeoPoint2D

position of normal

Returns

GeoVector

normal vector

GetOffsetSurface(double)

Returns a surface that is "parallel" to this surface, i.e. each point on this surface corresponds a point on the returned surface that has the same (u,v) coordinates and has the 3d coordinates oft the point plus offset*Normal at this point

public override ISurface GetOffsetSurface(double offset)

Parameters

offset double

Offset to this surface

Returns

ISurface

The offset surface

GetPropertyEntry(IFrame)

Gets the IPropertyEntry to display this surface in the property grid (may be null)

public override IPropertyEntry GetPropertyEntry(IFrame frame)

Parameters

frame IFrame

Returns

IPropertyEntry

GetSafeParameterSteps(double, double, double, double, out double[], out double[])

Gets spans of the parameterspace that are guaranteed to contain only one inflection point. The returned intu should contain umin as first and umax as last value (same with v)

public override void GetSafeParameterSteps(double umin, double umax, double vmin, double vmax, out double[] intu, out double[] intv)

Parameters

umin double
umax double
vmin double
vmax double
intu double[]
intv double[]

GetZMinMax(Projection, double, double, double, double, ref double, ref double)

Gets the minimum and maximumm valus for the z-coordinate of a rectangular patch (in parametric space) of this surface under a certain projection

public override void GetZMinMax(Projection p, double umin, double umax, double vmin, double vmax, ref double zMin, ref double zMax)

Parameters

p Projection

the projection

umin double

left bound of the rectangular patch

umax double

right bound of the rectangular patch

vmin double

bottom bound of the rectangular patch

vmax double

top bound of the rectangular patch

zMin double

returned minimum

zMax double

returned maximum

Modify(ModOp)

Modifies this surface with the given operation

public override void Modify(ModOp m)

Parameters

m ModOp

how to modif

Orientation(GeoPoint)

Returns the orientation of the provided point. The sign of the result may be used to distinguish between inside and outside.

public override double Orientation(GeoPoint p)

Parameters

p GeoPoint

Returns

double

PointAt(GeoPoint2D)

Returns the 3-dimensional point at the given u/v point

public override GeoPoint PointAt(GeoPoint2D uv)

Parameters

uv GeoPoint2D

position

Returns

GeoPoint

point

ReverseOrientation()

Reverses the orientation of this surface. The normal vector will point to the other side after this operation. The returned ModOp2D determins how (u,v) coordinates of the parameter space have to be transformed to define the same 3d point.

public override ModOp2D ReverseOrientation()

Returns

ModOp2D

Transformation of the parameter space

SameGeometry(BoundingRect, ISurface, BoundingRect, double, out ModOp2D)

Returns true if this surface and the other surface are geometrically identical, i.e. describe the same surface in 3D space. The may have a different u/v system. The returned firstToSecond contains the ModOp to convert from the u/v system of the first surface to the second surface.

public override bool SameGeometry(BoundingRect thisBounds, ISurface other, BoundingRect otherBounds, double precision, out ModOp2D firstToSecond)

Parameters

thisBounds BoundingRect

Bounds for this surface

other ISurface

Other surface

otherBounds BoundingRect

Bounds of other surface

precision double

Required precision

firstToSecond ModOp2D

Transformation between different u/v systems

Returns

bool

True if the surfaces are geometrically equal

UDirection(GeoPoint2D)

Returns the direction at the given u/v point in direction of the u-axis

public override GeoVector UDirection(GeoPoint2D uv)

Parameters

uv GeoPoint2D

position

Returns

GeoVector

direction

VDirection(GeoPoint2D)

Returns the direction at the given u/v point in direction of the v-axis

public override GeoVector VDirection(GeoPoint2D uv)

Parameters

uv GeoPoint2D

position

Returns

GeoVector

direction