create_sphere#
- Modeler3D.create_sphere(position, radius, name=None, matname=None, **kwargs)[source]#
Create a sphere.
- Parameters:
- position
list
List of
[x, y, z]
coordinates for the center position of the sphere.- radius
float
Radius of the sphere.
- name
str
,optional
Name of the sphere. The default is
None
, in which case the default name is assigned.- matname
str
,optional
Name of the material. The default is
None
, in which case the default material is assigned.
- position
- Returns:
- bool,
pyaedt.modeler.cad.object3d.Object3d
3D object or
False
if it fails.
- bool,
References
>>> oEditor.CreateSphere
Examples
This example shows how to create a sphere in HFSS. The required parameters are
position
, which provides the center of the sphere, andradius
, which is the radius of the sphere. The optional parametermatname
allows you to set the material name of the sphere. The optional parametername
allows to assign a name to the sphere.This method applies to all 3D applications: HFSS, Q3D, Icepak, Maxwell 3D, and Mechanical.
>>> from pyaedt import Hfss >>> aedtapp = Hfss() >>> ret_object = aedtapp.modeler.create_sphere(position=[0,0,0], radius=2, ... name="mysphere", matname="copper")