Sphere

class rhino3dm.Sphere
Sphere(center, radius)

Initializes a new sphere given center point and radius.

Parameters:
  • center (rhino3dm.Point3d) – A center point.

  • radius (float) – A radius value.

IsValid

bool: Gets a value that indicates whether the sphere is valid.

Diameter

float: Gets or sets the diameter for this sphere.

Radius

float: Gets or sets the Radius for this sphere.

Center

rhino3dm.Point3d: Gets or sets the center point of the sphere.

NorthPole

rhino3dm.Point3d: 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.

SouthPole

rhino3dm.Point3d: 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.

LatitudeRadians(radians)

Computes the parallel at a specific latitude angle. The angle is specified in radians.

Parameters:

radians (float) – An angle in radians for the parallel.

Returns:

A circle.

Return type:

Circle

LatitudeDegrees(degrees)

Computes the parallel at a specific latitude angle. The angle is specified in degrees.

Parameters:

degrees (float) – An angle in degrees for the meridian.

Returns:

A circle.

Return type:

Circle

LongitudeRadians(radians)

Computes the meridian at a specific longitude angle. The angle is specified in radians.

Parameters:

radians (float) – An angle in radians.

Returns:

A circle.

Return type:

Circle

LongitudeDegrees(degrees)

Computes the meridian at a specific longitude angle. The angle is specified in degrees.

Parameters:

degrees (float) – An angle in degrees.

Returns:

A circle.

Return type:

Circle

PointAt(longitudeRadians, latitudeRadians)

Evaluates the sphere at specific longitude and latitude angles.

Parameters:
  • longitudeRadians (float) – A number within the interval [0, 2pi].

  • latitudeRadians (float) – A number within the interval [-pi/2,pi/2].

Returns:

A point value.

Return type:

rhino3dm.Point3d

NormalAt(longitudeRadians, latitudeRadians)

Computes the normal at a specific angular location on the sphere.

Parameters:
  • longitudeRadians (float) – A number within the interval [0, 2pi].

  • latitudeRadians (float) – A number within the interval [-pi/2, pi/2].

Returns:

A vector.

Return type:

rhino3dm.Vector3d

ClosestPoint(testPoint)

Returns point on sphere that is closest to given point.

Parameters:

testPoint (rhino3dm.Point3d) – Point to project onto Sphere.

Returns:

Point on sphere surface closest to testPoint.

Return type:

rhino3dm.Point3d

ClosestParameter(testPoint)

Finds the angle parameters on this sphere that are closest to a test point.

Parameters:

testPoint (rhino3dm.Point3d) – Point to project onto the sphere.

Returns:

tuple (bool, float, float)

  • True on success, False on failure. This function will fail if the point it coincident with the sphere center.

  • The longitudinal angle (in radians; 0.0 to 2pi) where the sphere approaches testPoint best.

  • The latitudinal angle (in radians; -0.5pi to +0.5pi) where the sphere approaches testPoint best.

Return type:

(bool, float, float)

ToBrep()

Converts this sphere is it Brep representation

Return type:

rhino3dm.Brep

ToNurbsSurface()

Converts this sphere to its NurbsSurface representation. This is synonymous with calling NurbsSurface.CreateFromSphere().

Returns:

A nurbs surface representation of this sphere or null.

Return type:

NurbsSurface

Encode()

[todo] add documentation

static Decode(jsonObject)

[todo] add documentation