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
toSubstituteCylindricalSurfacethe periodic cylinder to replace
vmindoublethe smallest v value of the periodic cylinder that will be used
vmaxdoublethe 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
toCloneNonPeriodicCylindricalSurfacethe 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
toCylinderModOpmaps the unit cylinder (radius 1, axis = z axis) to this cylinder
vmindoublethe v value (position along the axis) of the periodic cylinder at the origin of the polar system; all used v values must be greater
usedAreaBoundingRect?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
infoSerializationInfothe data of the object
contextStreamingContextthe 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
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
Methods
Clone()
Returns an identical but independant copy of this surface
public override ISurface Clone()
Returns
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
CopyFromISurfacewhere 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
uvGeoPoint2DPoint in the parameter space
locationGeoPointResulting 3D point
duGeoVectorResulting derivation in u
dvGeoVectorResulting derivation in v
duuGeoVectordvvGeoVectorduvGeoVector
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
uvGeoPoint2DPoint in the parameter space
locationGeoPointResulting 3D point
duGeoVectorResulting derivation in u
dvGeoVectorResulting 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
Returns
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
Returns
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
Returns
GetModified(ModOp)
Returns a clone of this surface modified by the given ModOp.
public override ISurface GetModified(ModOp m)
Parameters
mModOphow to modify
Returns
GetNormal(GeoPoint2D)
Returns the normal vector (perpendicular to the surface) at the given u/v point
public override GeoVector GetNormal(GeoPoint2D uv)
Parameters
uvGeoPoint2Dposition 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
plPlaneSurfaceplane to intersect with
umindoubleminimum u value of the parameter space of this surface to consider
umaxdoublemaximum u value of the parameter space of this surface to consider
vmindoubleminimum v value of the parameter space of this surface to consider
vmaxdoublemaximum v value of the parameter space of this surface to consider
precisiondoublemaximum 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
curveICurvethe 3d curve to project onto this surface
precisiondoublemaximum allowed deviation of the resulting 2d curve (mapped onto the surface) from the provided curve
Returns
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
curve2dICurve2Dthe 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
uvGeoPoint2Dposition
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
pGeoPointpoint
Returns
- GeoPoint2D
position
ToString()
public override string ToString()
Returns
UDirection(GeoPoint2D)
Returns the direction at the given u/v point in direction of the u-axis
public override GeoVector UDirection(GeoPoint2D uv)
Parameters
uvGeoPoint2Dposition
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
uvGeoPoint2Dposition
Returns
- GeoVector
direction