create_torus#

Modeler3D.create_torus(center, major_radius, minor_radius, axis=None, name=None, material_name=None, **kwargs)[source]#

Create a torus.

Parameters:
centerlist

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.

material_namestr, 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 pyaedt.modeler.cad.object3d.Object3d for more details.

Returns:
bool, pyaedt.modeler.cad.object3d.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 pyaedt import Hfss
>>> hfss = Hfss()
>>> origin = [0, 0, 0]
>>> torus = hfss.modeler.create_torus(center=origin, major_radius=1,
...                                   minor_radius=0.5, axis="Z",
...                                    name="mytorus", material_name="copper")