Click or drag to resize

TorusToRevSurface Method

Convert this torus to a surface of revolution representation. This is synonymous with calling RevSurface.CreateFromTorus().

Namespace:  Rhino.Geometry
Assembly:  RhinoCommon (in RhinoCommon.dll)
public RevSurface ToRevSurface()

Return Value

Type: RevSurface
A surface of revolution representation of this torus, or null on error.
using System;

partial class Examples
  public static Rhino.Commands.Result AddTorus(Rhino.RhinoDoc doc)
    const double major_radius = 4.0;
    const double minor_radius = 2.0;

    Rhino.Geometry.Plane plane = Rhino.Geometry.Plane.WorldXY;
    Rhino.Geometry.Torus torus = new Rhino.Geometry.Torus(plane, major_radius, minor_radius);
    Rhino.Geometry.RevSurface revsrf = torus.ToRevSurface();
    if (doc.Objects.AddSurface(revsrf) != Guid.Empty)
      return Rhino.Commands.Result.Success;
    return Rhino.Commands.Result.Failure;
import Rhino
import scriptcontext
import System.Guid

def AddTorus():
    major_radius = 4.0
    minor_radius = 2.0

    plane = Rhino.Geometry.Plane.WorldXY
    torus = Rhino.Geometry.Torus(plane, major_radius, minor_radius)
    revsrf = torus.ToRevSurface()

    if scriptcontext.doc.Objects.AddSurface(revsrf)!=System.Guid.Empty:
        return Rhino.Commands.Result.Success
    return Rhino.Commands.Result.Failure

if __name__=="__main__":
Version Information

Rhino for Mac

Supported in: 5.4

Rhino for Windows

Supported in: 6.27
See Also