Skip to content

Commit

Permalink
FIX: Create cone with same inner and outer radius (#5149)
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuelopez-ansys authored Sep 10, 2024
1 parent b8ed121 commit 0fa7740
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion _unittest/test_08_Primitives3D.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,6 @@ def test_24_create_cone(self):
assert o.object_type == "Solid"
assert o.is3d is True
assert not self.aedtapp.modeler.create_cone(axis, [1, 1], 20, 10, 5, name="MyCone", material="Copper")
assert not self.aedtapp.modeler.create_cone(axis, udp, 20, 20, 5, name="MyCone", material="Copper")
assert not self.aedtapp.modeler.create_cone(axis, udp, -20, 20, 5, name="MyCone", material="Copper")
assert not self.aedtapp.modeler.create_cone(axis, udp, 20, -20, 5, name="MyCone", material="Copper")
assert not self.aedtapp.modeler.create_cone(axis, udp, 20, 20, -5, name="MyCone", material="Copper")
Expand Down
9 changes: 3 additions & 6 deletions src/ansys/aedt/core/modeler/cad/primitives_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,14 +392,11 @@ def create_cone(self, orientation, origin, bottom_radius, top_radius, height, na
>>> from ansys.aedt.core import Hfss
>>> aedtapp = Hfss()
>>> cone_object = aedtapp.modeler.create_cone(orientation='Z',origin=[0, 0, 0],
... bottom_radius=2,top_radius=3,height=4,
... name="mybox",material="copper")
>>> cone_object = aedtapp.modeler.create_cone(orientation='Z', origin=[0, 0, 0],
... bottom_radius=2, top_radius=3, height=4,
... name="mybox", material="copper")
"""
if bottom_radius == top_radius:
self.logger.error("the ``bottom_radius`` and ``top_radius`` arguments must have different values.")
return False
if isinstance(bottom_radius, (int, float)) and bottom_radius < 0:
self.logger.error("The ``bottom_radius`` argument must be greater than 0.")
return False
Expand Down

0 comments on commit 0fa7740

Please sign in to comment.