Table of Contents

Class NonPeriodicCylindricalSurface

Namespace
CADability.GeoObject
Assembly
CADability.dll

A CylindricalSurface with a parameter space that has no seam: the (angle, axis position) system of the cylinder is replaced by polar coordinates in a plane, u = r·cos(angle), v = r·sin(angle) with r = axis position − vmin. vmin must lie below every axis position that is used, otherwise the mapping folds over. Make3D uses it for extrusions whose end curves cross the seam of the periodic cylinder. INonPeriodicSurfaceConversion converts points and 2d curves between the two parameter systems.

public class NonPeriodicCylindricalSurface : CylindricalSurface, ISurface, IOctTreeInsertable, ISurfaceOfRevolution, IExportStep, ISurfaceOfArcExtrusion, ISurfaceOfExtrusion, ICylinder, ISurfaceWithRadius, IJsonSerialize, INonPeriodicSurfaceConversion, ISerializable, IDeserializationCallback
Inheritance
NonPeriodicCylindricalSurface
Implements
Inherited Members
Extension Methods

Constructors

NonPeriodicCylindricalSurface(CylindricalSurface, double, double)

Creates the non-periodic version of toSubstitute for faces whose v values (positions along the axis) lie between vmin and vmax. The origin of the polar system is placed half the interval below vmin, so that all used points get a positive radius.

public NonPeriodicCylindricalSurface(CylindricalSurface toSubstitute, double vmin, double vmax)

Parameters

toSubstitute CylindricalSurface

the periodic cylinder to replace

vmin double

the smallest v value of the periodic cylinder that will be used

vmax double

the largest v value of the periodic cylinder that will be used

NonPeriodicCylindricalSurface(NonPeriodicCylindricalSurface)

Copy constructor: creates a surface with the same geometry and the same origin of the polar system as toClone.

public NonPeriodicCylindricalSurface(NonPeriodicCylindricalSurface toClone)

Parameters

toClone NonPeriodicCylindricalSurface

the surface to copy

NonPeriodicCylindricalSurface(ModOp, double, BoundingRect?)

Creates the surface from the transformation of the unit cylinder (see CylindricalSurface) and the v value of the periodic cylinder that corresponds to the origin of the polar system; used by GetModified(ModOp).

public NonPeriodicCylindricalSurface(ModOp toCylinder, double vmin, BoundingRect? usedArea = null)

Parameters

toCylinder ModOp

maps the unit cylinder (radius 1, axis = z axis) to this cylinder

vmin double

the v value (position along the axis) of the periodic cylinder at the origin of the polar system; all used v values must be greater

usedArea BoundingRect?

the part of the non-periodic parameter space that is actually used, if known

NonPeriodicCylindricalSurface(SerializationInfo, StreamingContext)

Constructor for the legacy binary deserialization (ISerializable): reads the cylinder from the base class and the origin of the polar system. Files are written in the JSON format now; the binary format is still read.

protected NonPeriodicCylindricalSurface(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo

the data of the object

context StreamingContext

the source of the deserialization

Properties

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

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

DerivationAt(GeoPoint2D, out GeoPoint, out GeoVector, out GeoVector)

Returns the point and the two derivations of the suface in a single call. It returns the same result as calling PointAt(GeoPoint2D), VDirection(GeoPoint2D) und VDirection(GeoPoint2D) succesively but is often faster than the three seperate calls.

public override void DerivationAt(GeoPoint2D uv, out GeoPoint location, out GeoVector du, out GeoVector dv)

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

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

GetLineIntersection(GeoPoint, GeoVector)

Returns the intersectionpoints of this surface with the line given by the parameters. Teh returned point are in the parametric (u/v) space of this surface.

public override GeoPoint2D[] GetLineIntersection(GeoPoint startPoint, GeoVector direction)

Parameters

startPoint GeoPoint

startpoint of the line

direction GeoVector

direction of the line

Returns

GeoPoint2D[]

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

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

GetPlaneIntersection(PlaneSurface, double, double, double, double, double)

Returns the intersection curve(s) of this surface with the given plane. An empty array is returned if there is no intersection. umin, umax, vmin, vmax define the Parameterspace of this surface (not of the PlaneSurface) for the intersection. It is also the periodic domain in which the 2d curve for this surface will be returned, if this surface is periodic. the resulting curves may exceed the area provided by umin, umax, vmin, vmax.

public override IDualSurfaceCurve[] GetPlaneIntersection(PlaneSurface pl, double umin, double umax, double vmin, double vmax, double precision)

Parameters

pl PlaneSurface

plane to intersect with

umin double

minimum u value of the parameter space of this surface to consider

umax double

maximum u value of the parameter space of this surface to consider

vmin double

minimum v value of the parameter space of this surface to consider

vmax double

maximum v value of the parameter space of this surface to consider

precision double

maximum allowed deviation of the resulting curves from the exact intersection

Returns

IDualSurfaceCurve[]

intersection curves

GetProjectedCurve(ICurve, double)

Returns the projection of the given curve in 2D coordinates. Should only be used for curves that are close to the surface.

public override ICurve2D GetProjectedCurve(ICurve curve, double precision)

Parameters

curve ICurve

the 3d curve to project onto this surface

precision double

maximum allowed deviation of the resulting 2d curve (mapped onto the surface) from the provided curve

Returns

ICurve2D

Make3dCurve(ICurve2D)

Returns a 3-dimensional curve from the given 2-dimensional curve. the 2-dimensional curve is interpreted in the u/v system of the surface.

public override ICurve Make3dCurve(ICurve2D curve2d)

Parameters

curve2d ICurve2D

the base curve

Returns

ICurve

corresponding 3-d curve

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

PositionOf(GeoPoint)

Returns the u/v position of the given point. It is assumed that the point is on the surface, if not the result is undetermined.

public override GeoPoint2D PositionOf(GeoPoint p)

Parameters

p GeoPoint

point

Returns

GeoPoint2D

position

ToString()

public override string ToString()

Returns

string

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