Geometry > Geometry Commands > Torus

Torus
Create a solid or surface torus in 3D.
Syntax
model.geom(<tag>).create(<ftag>,"Torus");
model.geom(<tag>).feature(<ftag>).set(property,<value>);
model.geom(<tag>).feature(<ftag>).getType(property);
Description
Use model.geom(<tag>).create(<ftag>,"Torus") to create a torus. The following properties are available:
Direction of the revolution axis. Vector has length 3 if axistype is cartesian, and length 2 if axistype is spherical.
x | y | z | cartesian | spherical
on | off
solid | surface
on | off
all | obj | dom | bnd | edg | pnt | off
Show selections, if selresult is on, of resulting objects in physics, materials, and so on, or in part instances. obj is not available in a component’s geometry. dom, bnd, and edg are not available in all features.
For information about the selresult and contributeto properties, see Selections of Geometric Entities.
Compatibility
model.geom(<tag>).create(<ftag>,"torus3") creates a solid torus.
model.geom(<tag>).create(<ftag>,"torus2") creates a surface torus.
The following properties are also available:
Alias for axis when axistype is spherical.
Alias for axis when axistype is cartesian.
x, y, z
The property const is no longer available.
Example
The following sequence generates a surface torus and a solid torus:
Code for use with Java
Model model = ModelUtil.create("Model1");
GeomSequence g = model.geom().create("geom1",3);
g.create("t2","Torus");
g.feature("t2").set("type","surface");
g.feature("t2").set("rmaj",2);
g.feature("t2").set("rmin",1);
 
g.create("t3","Torus");
g.feature("t3").set("rmaj",10);
g.feature("t3").set("rmin",2);
g.feature("t3").set("pos","0,0,-100");
g.feature("t3").set("axis","1,1,1");
g.feature("t3").set("rot",60);
g.run();
Code for use with MATLAB
model = ModelUtil.create('Model1');
g = model.geom.create('geom1',3);
g.create('t2','Torus');
g.feature('t2').set('type','surface');
g.feature('t2').set('rmaj',2);
g.feature('t2').set('rmin',1);
 
g.create('t3','Torus');
g.feature('t3').set('rmaj',10);
g.feature('t3').set('rmin',2);
g.feature('t3').set('pos','0,0,-100');
g.feature('t3').set('axis','1,1,1');
g.feature('t3').set('rot',60);
g.run;
See Also
 Cylinder