create_torus#

Modeler3D.create_torus(origin, major_radius, minor_radius, axis=None, name=None, material=None, **kwargs)#

Create a torus.

Parameters:
originlist

Center point for the torus in a list of [x, y, z] coordinates.

major_radiusfloat

Major radius of the torus.

minor_radiusfloat

Minor radius of the torus.

axisstr, optional

Axis of revolution. The default is None, in which case the Z axis is used.

namestr, optional

Name of the torus. The default is None, in which case the default name is assigned.

materialstr, optional

Name of the material. The default is None, in which case the default material is assigned. If the material name supplied is invalid, the default material is assigned.

**kwargsoptional

Additional keyword arguments may be passed when creating the primitive to set properties. See ansys.aedt.core.modeler.cad.object_3d.Object3d for more details.

Returns:
bool, ansys.aedt.core.modeler.cad.object_3d.Object3d

3D object or False if it fails.

References

>>> oEditor.CreateTorus

Examples

Create a torus named "mytorus" about the Z axis with a major radius of 1 , minor radius of 0.5, and a material of "copper". The optional parameter matname allows you to set the material name of the sphere. The optional parameter name allows you to give a name to the sphere.

This method applies to all 3D applications: HFSS, Q3D, Icepak, Maxwell 3D, and Mechanical.

>>> from ansys.aedt.core import Hfss
>>> hfss = Hfss()
>>> origin = [0, 0, 0]
>>> torus = hfss.modeler.create_torus(origin=origin,major_radius=1,minor_radius=0.5,
...                                   axis="Z",name="mytorus",material="copper")