Table of Contents

Class SphericalSurfaceNP

Namespace
CADability.GeoObject
Assembly
CADability.dll

A spherical surface with a non periodic u/v system. It also has no poles. It cannot represent a whole sphere, there must be some part which is outside the usable area. The center, xAxis, yAxis and zAxis define a coordinate system. The plane defined by (center, xAxis and yAxis) is the equator plane of the sphere, (center+zAxis) is the north pole. (center-zAxis) is the south pole, which may not be part of the used area. The u/v system is the u/v system of the equator area. The point of the sphere for a provided u/v point is the projection of this point from the south pole to the surface. All circular arcs on the sphere (e.g. planar intersections) are elliptical arcs in the u/v system (or lines, when they pass the north pole)

public class SphericalSurfaceNP : ISurfaceImpl, ISurface, IOctTreeInsertable, IJsonSerialize, ISerializable, ISphere, ISurfaceWithRadius
Inheritance
SphericalSurfaceNP
Implements
Inherited Members
Extension Methods

Constructors

SphericalSurfaceNP()

protected SphericalSurfaceNP()

SphericalSurfaceNP(GeoPoint, GeoVector, GeoVector, GeoVector)

public SphericalSurfaceNP(GeoPoint center, GeoVector xAxis, GeoVector yAxis, GeoVector zAxis)

Parameters

center GeoPoint
xAxis GeoVector
yAxis GeoVector
zAxis GeoVector

SphericalSurfaceNP(GeoPoint, double, bool, ICurve[])

Constructs a non periodic spherical surface with center and radius. The z-axis will be oriented so that the "south pole" falls into an unused part of the sphere. The edges are orientedCurves bound the sphere so that when you walk along the curve (outwardOriented==true: on the outside, false: on the inside of the sphere), the used surfaces is on the left side of the curve. The curves must all be connected and define one or more closed loops on the surface.

public SphericalSurfaceNP(GeoPoint center, double radius, bool outwardOriented, ICurve[] orientedCurves)

Parameters

center GeoPoint
radius double
outwardOriented bool

true: the center is on the inside, false: the center is on the outside of the surface

orientedCurves ICurve[]

SphericalSurfaceNP(SerializationInfo, StreamingContext)

protected SphericalSurfaceNP(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo
context StreamingContext

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

OutwardOriented

True when the normal of the surface points away from the center, i.e. the solid is inside the sphere; false when it points towards the center (a spherical cavity).

public bool OutwardOriented { get; }

Property Value

bool

UvChangesWithModification

True when Modify(ModOp) (e.g. a rotation) changes the u/v parameter system in a way that 2d curves on the surface are no longer valid afterwards. This is the case for the non-periodic surfaces (CylindricalSurfaceNP, ConicalSurfaceNP, SphericalSurfaceNP), whose parameter system is bound to the global axes; Edge recomputes the 2d curves of its faces after a modification when this is true. False for the elementary surfaces, which carry their parameter system with them.

public override bool UvChangesWithModification { 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 p, out GeoVector du, out GeoVector dv, out GeoVector duu, out GeoVector dvv, out GeoVector duv)

Parameters

uv GeoPoint2D

Point in the parameter space

p GeoPoint
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

GetExtrema()

Returns an array of points in parametric space where there are extrema in direction of x-, y- or z-axis. The normal vector in a extremum is parallel to one of the axis and the surface has a relative maximum or minimum in this direction.

public override GeoPoint2D[] GetExtrema()

Returns

GeoPoint2D[]

s.a.

GetImplicitPolynomial()

Returns the implicit form of the surface: a polynomial in x, y and z which is zero exactly for the points of the surface and whose value approximates the (signed) distance of a point from the surface. It is used to speed up intersections and distance computations with other surfaces. The base implementation returns null; the elementary surfaces (e.g. CylindricalSurface, ToroidalSurface) override it.

public override Polynom GetImplicitPolynomial()

Returns

Polynom

The implicit polynomial, or null when not available for this type of surface

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

GetObjectData(IJsonWriteData)

public void GetObjectData(IJsonWriteData data)

Parameters

data IJsonWriteData

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

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

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

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

SetObjectData(IJsonReadData)

public void SetObjectData(IJsonReadData data)

Parameters

data IJsonReadData

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