Surface

class rhino3dm.Surface
IsSolid

bool: Gets a values indicating whether a surface is solid.

SetDomain(direction, domain)

Sets the domain in a direction.

Parameters:
  • direction (int) – 0 sets first parameter’s domain, 1 sets second parameter’s domain.
  • domain (rhino3dm.Interval) – A new domain to be assigned.
Returns:

True if setting succeeded, otherwise false.

Return type:

bool

Degree(direction)

Returns the maximum algebraic degree of any span (or a good estimate if curve spans are not algebraic).

Parameters:direction (int) – 0 gets first parameter’s domain, 1 gets second parameter’s domain.
Returns:The maximum degree.
Return type:int
SpanCount(direction)

Gets number of smooth nonempty spans in the parameter direction.

Parameters:direction (int) – 0 gets first parameter’s domain, 1 gets second parameter’s domain.
Returns:The span count.
Return type:int
PointAt(u, v)

Evaluates a point at a given parameter.

Parameters:
  • u (float) – evaluation parameters.
  • v (float) – evaluation parameters.
Returns:

Point3d.Unset on failure.

Return type:

rhino3dm.Point3d

FrameAt(u, v)

Computes the orient plane on a surface given a U and V parameter. This is the simple evaluation call with no error handling.

Parameters:
  • u (float) – A first parameter.
  • v (float) – A second parameter.
Returns:

tuple (bool, rhino3dm.Plane)

  • True if this operation succeeded; otherwise false.
  • A frame plane that will be computed during this call.

Return type:

(bool, rhino3dm.Plane)

Domain(direction)

Gets the domain in a direction.

Parameters:direction (int) – 0 gets first parameter, 1 gets second parameter.
Returns:An interval value.
Return type:rhino3dm.Interval
GetSpanVector(direction)

Gets array of span “knots”.

Parameters:direction (int) – 0 gets first parameter’s domain, 1 gets second parameter’s domain.
Returns:An array with span vectors; or None on error.
Return type:float[]
NormalAt(u, v)

Computes the surface normal at a point. This is the simple evaluation call - it does not support error handling.

Parameters:
  • u (float) – A U parameter.
  • v (float) – A V parameter.
Returns:

The normal.

Return type:

rhino3dm.Vector3d

IsClosed(direction)

Gets a value indicating if the surface is closed in a direction.

Parameters:direction (int) – 0 = U, 1 = V.
Returns:The indicating boolean value.
Return type:bool
IsPeriodic(direction)

Gets a value indicating if the surface is periodic in a direction (default is false).

Parameters:direction (int) – 0 = U, 1 = V.
Returns:The indicating boolean value.
Return type:bool
IsSingular(side)

True if surface side is collapsed to a point.

Parameters:side (int) – side of parameter space to test 0 = south, 1 = east, 2 = north, 3 = west.
Returns:True if this specific side of the surface is singular; otherwise, false.
Return type:bool
IsAtSingularity(u, v, exact)

Tests if a surface parameter value is at a singularity.

Parameters:
  • u (float) – Surface u parameter to test.
  • v (float) – Surface v parameter to test.
  • exact (bool) – If true, test if (u,v) is exactly at a singularity. If false, test if close enough to cause numerical problems.
Returns:

True if surface is singular at (s,t)

Return type:

bool

IsAtSeam(u, v)

Tests if a surface parameter value is at a seam.

Parameters:
  • u (float) – Surface u parameter to test.
  • v (float) – Surface v parameter to test.
Returns:

0 if not a seam, 1 if u == Domain(0)[i] and srf(u, v) == srf(Domain(0)[1-i], v) 2 if v == Domain(1)[i] and srf(u, v) == srf(u, Domain(1)[1-i]) 3 if 1 and 2 are true.

Return type:

int

IsoCurve(direction, constantParameter)

Gets isoparametric curve.

Parameters:
  • direction (int) – 0 first parameter varies and second parameter is constant e.g., point on IsoCurve(0,c) at t is srf(t,c) This is a horizontal line from left to right 1 first parameter is constant and second parameter varies e.g., point on IsoCurve(1,c) at t is srf(c,t This is a vertical line from bottom to top.
  • constantParameter (float) – The parameter that was constant on the original surface.
Returns:

An isoparametric curve or None on error.

Return type:

rhino3dm.Curve

ToNurbsSurface()

Gets a NURBS surface representation of this surface. Default tolerance of 0.0 is used.

Returns:NurbsSurface on success, None on failure.
Return type:NurbsSurface
ToNurbsSurface(tolerance)

Gets a NURBS surface representation of this surface. Default tolerance of 0.0 is used.

Returns:NurbsSurface on success, None on failure.
Return type:NurbsSurface
IsPlanar(tolerance)

Tests a surface to see if it is planar to zero tolerance.

Returns:True if the surface is planar (flat) to within RhinoMath.ZeroTolerance units (1e-12).
Return type:bool
IsSphere(tolerance)

Determines if the surface is a portion of a sphere within RhinoMath.ZeroTolerance.

Returns:True if the surface is a portion of a sphere.
Return type:bool
IsCylinder(tolerance)

Determines if the surface is a portion of a cylinder within RhinoMath.ZeroTolerance.

Returns:True if the surface is a portion of a cylinder.
Return type:bool
IsCone(tolerance)

Determines if the surface is a portion of a cone within RhinoMath.ZeroTolerance.

Returns:True if the surface is a portion of a cone.
Return type:bool
IsTorus(tolerance)

Determines if the surface is a portion of a torus within RhinoMath.ZeroTolerance.

Returns:True if the surface is a portion of a torus.
Return type:bool
GetSurfaceParameterFromNurbsFormParameter(nurbsS, nurbsT)

[todo] add documentation

GetNurbsFormParameterFromSurfaceParameter(surfaceS, surfaceT)

[todo] add documentation