create_polyhedron#

Modeler3D.create_polyhedron(orientation=None, center=(0.0, 0.0, 0.0), origin=(0.0, 1.0, 0.0), height=1.0, num_sides=12, name=None, material=None, **kwargs)[source]#

Create a regular polyhedron.

Parameters:
orientationoptional

Axis of rotation of the starting point around the center point. The default is None, in which case the Z axis is used.

centerlist, optional

List of [x, y, z] coordinates for the center position. The default is (0.0, 0.0, 0.0).

originlist, optional

List of [x, y, z] coordinates for the starting position. The default is (0.0, 0.0, 0.0).

heightfloat, optional

Height of the polyhedron. The default is 1.0.

num_sidesint, optional

Number of sides of the polyhedron. The default is 12.

namestr, optional

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

materialstr, optional

Name of the material. The default is None, in which the default material is assigned.

Returns:
bool, pyaedt.modeler.cad.object3d.Object3d

3D object or False if it fails.

References

>>> oEditor.CreateRegularPolyhedron

Examples

The following examples shows how to create a regular polyhedron in HFSS. The required parameters are cs_axis that provides the direction axis of the polyhedron, center_position that provides the center of the polyhedron, start_position of the polyhedron, height of the polyhedron and num_sides to determine the number of sides. The parameter matname is optional and allows to set the material name of the polyhedron. The parameter name is optional and allows to give a name to the polyhedron. This method applies to all 3D applications: HFSS, Q3D, Icepak, Maxwell 3D, Mechanical.

>>> from pyaedt import Hfss
>>> aedtapp = Hfss()
>>> ret_obj = aedtapp.modeler.create_polyhedron(orientation='X',center=[0, 0, 0],
...                                             origin=[0,5,0],height=0.5,num_sides=8,
...                                             name="mybox",material="copper")