[StructLayout(LayoutKind.Sequential, Pack = 8, Size = 136)] [Serializable] public struct Sphere : IEpsilonComparable<Sphere>
Represents the plane and radius values of a sphere.

Constructors

Sphere

#Since v5.0
public Sphere(Plane equatorialPlane, double radius)
Initializes a new sphere given the plane of the equator circle and radius.
equatorialPlane (Plane)A plane that will be intersecting the sphere at the same distance from both poles (parameterization singularities).
radius (double)A radius value.

Sphere

#ExampleSince v5.0
public Sphere(Point3d center, double radius)
Initializes a new sphere given center point and radius.
center (Point3d)A center point.
radius (double)A radius value.

Properties

BoundingBox

#Since v5.0
public BoundingBox BoundingBox { get; }
Gets the world aligned bounding box for this Sphere. If the Sphere is Invalid, an empty box is returned.

Center

#Since v5.0
public Point3d Center { get; set; }
Gets or sets the center point of the sphere.

Diameter

#Since v5.0
public double Diameter { get; set; }
Gets or sets the diameter for this sphere.

EquatorialPlane

#Since v6.0
public Plane EquatorialPlane { get; set; }
Gets or sets the Equatorial plane for this sphere.

EquitorialPlane

#Since v5.0
[EditorBrowsable(EditorBrowsableState.Never)] public Plane EquitorialPlane { get; set; }
obsoleteThis property has been replaced by Equ*A*torialPlane.
Gets or sets the Equatorial plane for this sphere.

IsValid

#Since v5.0
public bool IsValid { get; }
Gets a value that indicates whether the sphere is valid.

NorthPole

#Since v5.0
public Point3d NorthPole { get; }
Gets the point at the North Pole of the sphere.

This is the parameterization singularity that can be obtained, at V value +Math.Pi/2.

Radius

#Since v5.0
public double Radius { get; set; }
Gets or sets the Radius for this sphere.

SouthPole

#Since v5.0
public Point3d SouthPole { get; }
Gets the point at the South Pole of the sphere.

This is the parameterization singularity that can be obtained, at V value -Math.Pi/2.

Unset

#Since v5.0
public static Sphere Unset { get; }
Gets a sphere with invalid members.

Methods

ClosestParameter

#Since v5.0
[ConstOperation] public bool ClosestParameter(Point3d testPoint, out double longitudeRadians, out double latitudeRadians)
Finds the angle parameters on this sphere that are closest to a test point.
testPoint (Point3d)Point to project onto the sphere.
longitudeRadians (out double)The longitudinal angle (in radians; 0.0 to 2pi) where the sphere approaches testPoint best.
latitudeRadians (out double)The latitudinal angle (in radians; -0.5pi to +0.5pi) where the sphere approaches testPoint best.
true on success, false on failure. This function will fail if the point it coincident with the sphere center.

ClosestPoint

#Since v5.0
[ConstOperation] public Point3d ClosestPoint(Point3d testPoint)
Returns point on sphere that is closest to given point.
testPoint (Point3d)Point to project onto Sphere.
Point on sphere surface closest to testPoint.

EpsilonEquals

#Since v5.4
[ConstOperation] public bool EpsilonEquals(Sphere other, double epsilon)
Check that all values in other are within epsilon of the values in this
other (Sphere)
epsilon (double)
EpsilonEquals

FitSphereToPoints

#Since v5.0
public static Sphere FitSphereToPoints(IEnumerable<Point3d> points)
Attempts to fit a sphere to a collection of points.
points (IEnumerable<Point3d>)Points to fit. The collection must contain at least three points.
The Sphere that best approximates the points or Sphere.Unset on failure.

LatitudeDegrees

#Since v5.0
[ConstOperation] public Circle LatitudeDegrees(double degrees)
Computes the parallel at a specific latitude angle.

The angle is specified in degrees.

degrees (double)An angle in degrees for the meridian.
A circle.

LatitudeRadians

#Since v5.0
[ConstOperation] public Circle LatitudeRadians(double radians)
Computes the parallel at a specific latitude angle.

The angle is specified in radians.

radians (double)An angle in radians for the parallel.
A circle.

LongitudeDegrees

#Since v5.0
[ConstOperation] public Circle LongitudeDegrees(double degrees)
Computes the meridian at a specific longitude angle.

The angle is specified in degrees.

degrees (double)An angle in degrees.
A circle.

LongitudeRadians

#Since v5.0
[ConstOperation] public Circle LongitudeRadians(double radians)
Computes the meridian at a specific longitude angle.

The angle is specified in radians.

radians (double)An angle in radians.
A circle.

NormalAt

#Since v5.0
[ConstOperation] public Vector3d NormalAt(double longitudeRadians, double latitudeRadians)
Computes the normal at a specific angular location on the sphere.
longitudeRadians (double)A number within the interval [0, 2pi].
latitudeRadians (double)A number within the interval [-pi/2, pi/2].
A vector.

PointAt

#Since v5.0
[ConstOperation] public Point3d PointAt(double longitudeRadians, double latitudeRadians)
Evaluates the sphere at specific longitude and latitude angles.
longitudeRadians (double)A number within the interval [0, 2pi].
latitudeRadians (double)A number within the interval [-pi/2,pi/2].
A point value.

Rotate

#Since v5.0
public bool Rotate(double angleRadians, Vector3d axisOfRotation, Point3d centerOfRotation)
Rotates this sphere about a point and an axis.
angleRadians (double)Rotation angle (in Radians)
axisOfRotation (Vector3d)Axis of rotation.
centerOfRotation (Point3d)Center of rotation.
true on success; false on failure.

Rotate

#Since v5.0
public bool Rotate(double angleRadians, Vector3d axisOfRotation)
Rotates the sphere about the center point.
angleRadians (double)Angle of rotation (in radians)
axisOfRotation (Vector3d)Rotation axis.
true on success; false on failure.

Rotate

#Since v5.0
public bool Rotate(double sinAngle, double cosAngle, Vector3d axisOfRotation, Point3d centerOfRotation)
Rotates this sphere about a point and an axis.
sinAngle (double)sin(angle)
cosAngle (double)cod(angle)
axisOfRotation (Vector3d)Axis of rotation.
centerOfRotation (Point3d)Center of rotation.
true on success; false on failure.

Rotate

#Since v5.0
public bool Rotate(double sinAngle, double cosAngle, Vector3d axisOfRotation)
Rotates this sphere about the center point.
sinAngle (double)sin(angle)
cosAngle (double)cos(angle)
axisOfRotation (Vector3d)The direction of the axis of rotation.
true on success; false on failure.

ToBrep

#Since v5.0
[ConstOperation] public Brep ToBrep()
Converts this sphere is it Brep representation

ToNurbsSurface

#Since v5.0
[ConstOperation] public NurbsSurface ToNurbsSurface()
Converts this sphere to its NurbsSurface representation. This is synonymous with calling NurbsSurface.CreateFromSphere().
A nurbs surface representation of this sphere or null.

ToRevSurface

#Since v5.0
[ConstOperation] public RevSurface ToRevSurface()
Converts this Sphere to a RevSurface representation. This is synonymous with calling RevSurface.CreateFromSphere().
A surface of revolution representation of this sphere or null.

Transform

#Since v5.0
public bool Transform(Transform xform)
Transforms this sphere. Note that non-similarity preserving transformations cannot be applied to a sphere as that would result in an ellipsoid.
xform (Transform)Transformation matrix to apply.
true on success, false on failure.

Translate

#Since v5.0
public bool Translate(Vector3d delta)
Moves this sphere along a motion vector.
delta (Vector3d)Motion vector.
true on success; false on failure.