@@ -82,13 +82,23 @@ def create_box(self, position, dimensions_list, name=None, matname=None):
82
82
83
83
Examples
84
84
--------
85
+ This example shows how to create a box in HFSS.
86
+ The required parameters are ``position`` that provides the origin of the
87
+ box and ``dimensions_list`` that provide the box sizes.
88
+ The optional parameter ``matname`` allows you to set the material name of the box.
89
+ The optional parameter ``name`` allows you to assign a name to the box.
90
+
91
+ This method applies to all 3D applications: HFSS, Q3D, Icepak, Maxwell 3D, and
92
+ Mechanical.
85
93
86
94
>>> from pyaedt import hfss
87
95
>>> hfss = Hfss()
88
96
>>> origin = [0,0,0]
89
97
>>> dimensions = [10,5,20]
90
- >>> #Material and name are not mandatory fields
91
- >>> box_object = hfss.modeler.primivites.create_box(origin, dimensions, name="mybox", matname="copper")
98
+ >>> box_object = hfss.modeler.primivites.create_box(position=origin,
99
+ ... dimensions_list=dimensions,
100
+ ... name="mybox",
101
+ ... matname="copper")
92
102
93
103
"""
94
104
if len (position ) != 3 :
@@ -145,9 +155,21 @@ def create_cylinder(self, cs_axis, position, radius, height, numSides=0, name=No
145
155
146
156
Examples
147
157
--------
158
+ This example shows how to create a cylinder in HFSS.
159
+ The required parameters are ``cs_axis``, ``position``, ``radius``, and ``height``. The
160
+ ``cs_axis`` parameter provides the direction axis of the cylinder. The ``position``
161
+ parameter provides the origin of the cylinder. The other two parameters provide
162
+ the radius and height of the cylinder.
163
+
164
+ The optional parameter ``matname`` allows you to set the material name of the cylinder.
165
+ The optional parameter ``name`` allows to assign a name to the cylinder.
166
+
167
+ This method applies to all 3D applications: HFSS, Q3D, Icepak, Maxwell 3D, and
168
+ Mechanical.
169
+
148
170
>>> from pyaedt import Hfss
149
171
>>> aedtapp = Hfss()
150
- >>> cylinder_object = aedtapp.modeler.. create_cylinder(cs_axis='Z', position=[0,0,0],
172
+ >>> cylinder_object = aedtapp.modeler.create_cylinder(cs_axis='Z', position=[0,0,0],
151
173
... radius=2, height=3, name="mycyl",
152
174
... matname="vacuum")
153
175
@@ -220,6 +242,14 @@ def create_polyhedron(
220
242
221
243
Examples
222
244
--------
245
+ The following examples shows how to create a regular polyhedron in HFSS.
246
+ The required parameters are cs_axis that provides the direction axis of the polyhedron,
247
+ center_position that provides the center of the polyhedron, start_position of the polyhedron,
248
+ height of the polyhedron and num_sides to determine the number of sides.
249
+ The parameter matname is optional and allows to set the material name of the polyhedron.
250
+ The parameter name is optional and allows to give a name to the polyhedron.
251
+ This method applies to all 3D applications: HFSS, Q3D, Icepak, Maxwell 3D, Mechanical.
252
+
223
253
>>> from pyaedt import Hfss
224
254
>>> aedtapp = Hfss()
225
255
>>> ret_obj = aedtapp.modeler.create_polyhedron(cs_axis='X', center_position=[0, 0, 0],
@@ -257,7 +287,7 @@ def create_cone(self, cs_axis, position, bottom_radius, top_radius, height, name
257
287
cs_axis : str
258
288
Axis of rotation of the starting point around the center point.
259
289
The default is ``None``, in which case the Z axis is used.
260
- center_position : list, optional
290
+ position : list, optional
261
291
List of ``[x, y, z]`` coordinates for the center position
262
292
of the bottom of the cone.
263
293
bottom_radius : float
@@ -285,6 +315,20 @@ def create_cone(self, cs_axis, position, bottom_radius, top_radius, height, name
285
315
286
316
Examples
287
317
--------
318
+ This example shows how to create a cone in HFSS.
319
+ The required parameters are ``cs_axis``, ``position``, ``bottom_radius``, and
320
+ ``top_radius``. The ``cs_axis`` parameter provides the direction axis of
321
+ the cone. The ``position`` parameter provides the starting point of the
322
+ cone. The ``bottom_radius`` and ``top_radius`` parameters provide the
323
+ radius and `eight of the cone.
324
+
325
+ The optional parameter ``matname`` allows you to set the material name of the cone.
326
+ The optional parameter ``name`` allows you to assign a name to the cone.
327
+
328
+ This method applies to all 3D applications: HFSS, Q3D, Icepak, Maxwell 3D, and
329
+ Mechanical.
330
+
331
+
288
332
>>> from pyaedt import Hfss
289
333
>>> aedtapp = Hfss()
290
334
>>> cone_object = aedtapp.modeler.create_cone(cs_axis='Z', position=[0, 0, 0],
@@ -349,6 +393,16 @@ def create_sphere(self, position, radius, name=None, matname=None):
349
393
350
394
Examples
351
395
--------
396
+ This example shows how to create a sphere in HFSS.
397
+ The required parameters are ``position``, which provides the center of the sphere, and
398
+ ``radius``, which is the radius of the sphere. The optional parameter ``matname``
399
+ allows you to set the material name of the sphere. The optional parameter
400
+ ``name`` allows to assign a name to the sphere.
401
+
402
+ This method applies to all 3D applications: HFSS, Q3D, Icepak, Maxwell 3D, and
403
+ Mechanical.
404
+
405
+
352
406
>>> from pyaedt import Hfss
353
407
>>> aedtapp = Hfss()
354
408
>>> ret_object = aedtapp.modeler.create_sphere(position=[0,0,0], radius=2,
@@ -409,11 +463,17 @@ def create_torus(self, center, major_radius, minor_radius, axis=None, name=None,
409
463
Examples
410
464
--------
411
465
Create a torus named ``"mytorus"`` about the Z axis with a major
412
- radius of 1, minor radius of 0.5, and a material of ``"copper"``.
466
+ radius of 1 , minor radius of 0.5, and a material of ``"copper"``.
467
+ The optional parameter ``matname`` allows you to set the material name of the sphere.
468
+ The optional parameter ``name`` allows you to give a name to the sphere.
469
+
470
+ This method applies to all 3D applications: HFSS, Q3D, Icepak, Maxwell 3D, and
471
+ Mechanical.
472
+
413
473
>>> from pyaedt import Hfss
414
474
>>> hfss = Hfss()
415
475
>>> origin = [0, 0, 0]
416
- >>> torus = hfss.modeler.create_torus(origin, major_radius=1,
476
+ >>> torus = hfss.modeler.create_torus(center= origin, major_radius=1,
417
477
... minor_radius=0.5, axis="Z",
418
478
... name="mytorus", material_name="copper")
419
479
@@ -686,6 +746,29 @@ def create_circle(
686
746
687
747
>>> oEditor.CreateCircle
688
748
749
+ Examples
750
+ --------
751
+ The following example shows how to create a circle in HFSS.
752
+ The required parameters are ``cs_plane``, ``position``, ``radius``,
753
+ and ``num_sides``. The ``cs_plane`` parameter provides the plane
754
+ that the circle is designed on. The ``position`` parameter provides
755
+ the origin of the circle. The ``radius`` and ``num_sides`` parameters
756
+ provide the radius and number of discrete sides of the circle,
757
+
758
+ The optional parameter ``matname`` allows you to set the material name
759
+ of the circle. The optional parameter ``name`` allows you to assign a name
760
+ to the circle.
761
+
762
+ This method applies to all 3D applications: HFSS, Q3D, Icepak, Maxwell 3D,
763
+ and Mechanical.
764
+
765
+ >>> from pyaedt import Hfss
766
+ >>> aedtapp = Hfss()
767
+ >>> circle_object = aedtapp.modeler.create_circle(cs_plane='Z', position=[0,0,0],
768
+ ... radius=2, num_sides=8, name="mycyl",
769
+ ... matname="vacuum")
770
+
771
+
689
772
"""
690
773
non_model_flag = ""
691
774
if non_model :
@@ -741,6 +824,31 @@ def create_ellipse(self, cs_plane, position, major_radius, ratio, is_covered=Tru
741
824
742
825
>>> oEditor.CreateEllipse
743
826
827
+ Examples
828
+ --------
829
+ The following example shows how to create an ellipse in HFSS.
830
+ The required parameters are ``cs_plane``, ``position``, ``major_radius``,
831
+ ``ratio``, and ``is_covered``. The ``cs_plane`` parameter provides
832
+ the plane that the ellipse is designed on. The ``position`` parameter
833
+ provides the origin of the ellipse. The ``major_radius`` parameter provides
834
+ the radius of the ellipse. The ``ratio`` parameter is a ratio between the
835
+ major radius and minor radius of the ellipse. The ``is_covered`` parameter
836
+ is a flag indicating if the ellipse is covered.
837
+
838
+ The optional parameter ``matname`` allows you to set the material name
839
+ of the ellipse. The optional parameter ``name`` allows you to assign a name
840
+ to the ellipse.
841
+
842
+ This method applies to all 3D applications: HFSS, Q3D, Icepak, Maxwell 3D,
843
+ and Mechanical.
844
+
845
+ >>> from pyaedt import Hfss
846
+ >>> aedtapp = Hfss()
847
+ >>> ellipse = aedtapp.modeler.create_ellipse(cs_plane='Z', position=[0,0,0],
848
+ ... major_radius=2, ratio=2, is_covered=True, name="myell",
849
+ ... matname="vacuum")
850
+
851
+
744
852
"""
745
853
szAxis = GeometryOperators .cs_plane_to_axis_str (cs_plane )
746
854
XStart , YStart , ZStart = self ._pos_with_arg (position )
@@ -833,6 +941,35 @@ def create_equationbased_curve(
833
941
834
942
>>> oEditor.CreateEquationCurve
835
943
944
+
945
+ Examples
946
+ --------
947
+ The following example shows how to create an equation- based curve in HFSS.
948
+ The required parameters are ``cs_plane``, ``position``, ``major_radius``,
949
+ ``ratio``, and ``is_covered``. The ``cs_plane`` parameter provides
950
+ the plane that the ellipse is designed on. The ``position`` parameter
951
+ provides the origin of the ellipse. The ``major_radius`` parameter provides
952
+ the radius of the ellipse. The ``ratio`` parameter is a ratio between the
953
+ major radius and minor radius of the ellipse. The ``is_covered`` parameter
954
+ is a flag indicating if the ellipse is covered.
955
+
956
+ The optional parameter ``matname`` allows you to set the material name
957
+ of the ellipse. The optional parameter ``name`` allows you to assign a name
958
+ to the ellipse.
959
+
960
+ This method applies to all 3D applications: HFSS, Q3D, Icepak, Maxwell 3D,
961
+ and Mechanical.
962
+
963
+ >>> from pyaedt import Hfss
964
+ >>> aedtapp = Hfss()
965
+ >>> eq_xsection = self.aedtapp.modeler.create_equationbased_curve(x_t="_t",
966
+ ... y_t="_t*2",
967
+ ... num_points=200,
968
+ ... z_t=0,
969
+ ... t_start=0.2,
970
+ ... t_end=1.2,
971
+ ... xsection_type="Circle")
972
+
836
973
"""
837
974
x_section = self ._crosssection_arguments (
838
975
type = xsection_type ,
@@ -913,6 +1050,33 @@ def create_helix(
913
1050
914
1051
>>> oEditor.CreateHelix
915
1052
1053
+ Examples
1054
+ --------
1055
+ The following example shows how to create a polyline and then create an helix from the polyline.
1056
+ This method applies to all 3D applications: HFSS, Q3D, Icepak, Maxwell 3D, and
1057
+ Mechanical.
1058
+
1059
+ >>> from pyaedt import Hfss
1060
+ >>> aedtapp = Hfss()
1061
+ >>> udp1 = [0, 0, 0]
1062
+ >>> udp2 = [5, 0, 0]
1063
+ >>> udp3 = [10, 5, 0]
1064
+ >>> udp4 = [15, 3, 0]
1065
+ >>> polyline = aedtapp.modeler.create_polyline(
1066
+ ... [udp1, udp2, udp3, udp4], cover_surface=False, name="helix_polyline"
1067
+ ... )
1068
+
1069
+ >>> helix_right_turn = aedtapp.modeler.create_helix(
1070
+ ... polyline_name=polyline.name,
1071
+ ... position=[0, 0, 0],
1072
+ ... x_start_dir=0,
1073
+ ... y_start_dir=1.0,
1074
+ ... z_start_dir=1.0,
1075
+ ... num_thread=1,
1076
+ ... right_hand=True,
1077
+ ... radius_increment=0.0,
1078
+ ... thread=1.0,
1079
+ ... )
916
1080
"""
917
1081
if not polyline_name or polyline_name == "" :
918
1082
raise ValueError ("The name of the polyline cannot be an empty string." )
@@ -958,7 +1122,7 @@ def convert_segments_to_line(self, object_name):
958
1122
959
1123
Parameters
960
1124
----------
961
- object_name : int, str, or Object3d
1125
+ object_name : int, str, or :class:`pyaedt.modeler.cad.object3d. Object3d`
962
1126
Specified for the object.
963
1127
964
1128
Returns
@@ -971,6 +1135,15 @@ def convert_segments_to_line(self, object_name):
971
1135
972
1136
>>> oEditor.ChangeProperty
973
1137
1138
+ Examples
1139
+ --------
1140
+
1141
+ >>> from pyaedt import Hfss
1142
+ >>> aedtapp = Hfss()
1143
+ >>> edge_object = aedtapp.modeler.create_object_from_edge("my_edge")
1144
+ >>> aedtapp.modeler.generate_object_history(edge_object)
1145
+ >>> aedtapp.modeler.convert_segments_to_line(edge_object.name)
1146
+
974
1147
"""
975
1148
this_object = self ._resolve_object (object_name )
976
1149
edges = this_object .edges
0 commit comments