create_torus#
- Modeler3D.create_torus(origin, major_radius, minor_radius, axis=None, name=None, material=None, **kwargs)#
Create a torus.
- Parameters:
- origin
list
Center point for the torus in a list of
[x, y, z]
coordinates.- major_radius
float
Major radius of the torus.
- minor_radius
float
Minor radius of the torus.
- axis
str
,optional
Axis of revolution. The default is
None
, in which case the Z axis is used.- name
str
,optional
Name of the torus. The default is
None
, in which case the default name is assigned.- material
str
,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.- **kwargs
optional
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.
- origin
- Returns:
ansys.aedt.core.modeler.cad.object_3d.Object3d
or bool3D 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 parametermatname
allows you to set the material name of the sphere. The optional parametername
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")