Description

NURB Torus


BobCAD API supports 2 different table key definition formats for flexibility in coding.

Keys

The following Keys can be created inside a table to form a torus:

Format 1 Keys

  • xOrigin - double value of the X coordinate of the center of the torus
  • yOrigin - double value of the Y coordinate of the center of the torus
  • zOrigin - double value of the Y coordinate of the center of the torus

Format 2 Keys

  • Origin - a table consisting of 3 double positions representing X,Y,Z coordinates of the center of the torus

Keys in both Format 1 and 2

  • Type="SplineCurve" - Defines this table as a torus entity type
  • MajorRadius - the radius of the circular revolution axis
  • MinorRadius - the radius of the circle that is revolved around the center axis

Example

Format 1


--Minimal definition

myTorus = { Type="Torus", xOrigin=25.0, yOrigin=30.0, zOrigin=20.0, MajorRadius=30.0, MinorRadius=5.0 }


--Complete definition

myTorus = { CmdName="My Torus", Type="Cylinder", xOrigin=25, yOrigin=30, zOrigin=20, MajorRadius=30.0, MinorRadius=5.0, Layer="Layer Name", Color="Blue" }


Format 2


--Minimal definition

myTorus = { Type="Torus", Origin={0.0,0.0,0.0}, MajorRadius=30.0, MinorRadius=5.0 }


--Complete definition

myTorus = { CmdName="My Torus", Type="Cylinder", Origin={0.0,0.0,0.0}, MajorRadius=30.0, MinorRadius=5.0, Layer="Layer Name", Color="Blue" }