create_equationbased_curve#

Modeler3D.create_equationbased_curve(x_t=0, y_t=0, z_t=0, t_start=0, t_end=1, num_points=0, name=None, xsection_type=None, xsection_orient=None, xsection_width=1, xsection_topwidth=1, xsection_height=1, xsection_num_seg=0, xsection_bend_type=None, **kwargs)[source]#

Create an equation-based curve.

Parameters:
x_tstr or float

Expression for the X-component of the curve as a function of "_t". For example, "3 * cos(_t)".

y_tstr or float

Expression for the Y-component of the curve as a function of "_t"

z_tstr or float

Expression for the Z-component of the curve as a function of "_t"

t_startstr or float

Starting value of the parameter "_t".

t_endstr or float

Ending value of the parameter "_t".

num_pointsint, optional

Number of vertices on the segmented curve. The default is 0, in which case the curve is non-segmented.

namestr, optional

Name of the created curve in the 3D modeler. The default is None, in which case the default name is assigned.

xsection_typestr, optional

Type of the cross-section. Choices are "Line", "Circle", "Rectangle", and "Isosceles Trapezoid". The default is None.

xsection_orientstr, optional

Direction of the normal vector to the width of the cross-section. Choices are "X", "Y", "Z", and "Auto". The default is None, in which case the direction is set to "Auto".

xsection_widthfloat or str, optional

Width or diameter of the cross-section for all types. The default is 1.

xsection_topwidthfloat or str, optional

Top width of the cross-section for type "Isosceles Trapezoid" only. The default is 1.

xsection_heightfloat or str

Height of the cross-section for types "Rectangle" and "Isosceles Trapezoid" only. The default is 1.

xsection_num_segint, optional

Number of segments in the cross-section surface for types "Circle", "Rectangle", and "Isosceles Trapezoid". The default is 0. The value must be 0 or greater than 2.

xsection_bend_typestr, optional

Type of the bend for the cross-section. The default is None, in which case the bend type is set to "Corner". For the type "Circle", the bend type should be set to "Curved".

**kwargsoptional

Additional keyword arguments may be passed when creating the primitive to set properties. See pyaedt.modeler.cad.object3d.Object3d for more details.

Returns:
pyaedt.modeler.cad.object3d.Object3d

3D object.

References

>>> oEditor.CreateEquationCurve

Examples

The following example shows how to create an equation- based curve in HFSS. The required parameters are cs_plane, position, major_radius, ratio, and is_covered. The cs_plane parameter provides the plane that the ellipse is designed on. The position parameter provides the origin of the ellipse. The major_radius parameter provides the radius of the ellipse. The ratio parameter is a ratio between the major radius and minor radius of the ellipse. The is_covered parameter is a flag indicating if the ellipse is covered.

The optional parameter matname allows you to set the material name of the ellipse. The optional parameter name allows you to assign a name to the ellipse.

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

>>> from pyaedt import Hfss
>>> aedtapp = Hfss()
>>> eq_xsection = self.aedtapp.modeler.create_equationbased_curve(x_t="_t",
...                                                               y_t="_t*2",
...                                                               num_points=200,
...                                                               z_t=0,
...                                                               t_start=0.2,
...                                                               t_end=1.2,
...                                                               xsection_type="Circle")