ansys/pyansys-geometry

Bug located in arc_from_start_end_and_radius

Closed this issue ยท 1 comments

๐Ÿ” Before submitting the issue

  • I have searched among the existing issues
  • I am using a Python virtual environment

๐Ÿž Description of the bug

While trying to create an arc using the api Sketch.arc_from_start_end_and_radius, i get the following error "ValueError: The start and end points of the arc are not an equidistant from the center point."

๐Ÿ“ Steps to reproduce

`from ansys.geometry.core import launch_modeler
from ansys.geometry.core.sketch import Sketch
from ansys.geometry.core.math import (
Point2D,
Plane,
Point3D,
UNITVECTOR3D_X,
UNITVECTOR3D_Z,
)
from ansys.geometry.core.misc import UNITS, DEFAULT_UNITS, Angle, Distance
from ansys.geometry.core.designer import DesignFileFormat
from ansys.geometry.core.plotting import GeometryPlotter

modeler = launch_modeler(mode="geometry_service")

DEFAULT_UNITS.LENGTH = UNITS.mm

Create Base

sketch = Sketch()
sketch.arc_from_start_end_and_radius(
Point2D([0, 0]), Point2D([4.7, 4.7]), radius=Distance(4.7), clockwise=False
).segment_to_point(Point2D([4.7, 12])).segment_to_point(
Point2D([-25.3, 12])
).segment_to_point(
Point2D([-25.3, 0])
).segment_to_point(
Point2D([0, 0])
)

sketch.plot()
`

๐Ÿ’ป Which operating system are you using?

Windows

๐Ÿ“€ Which ANSYS version are you using?

2024R2

๐Ÿ Which Python version are you using?

3.10

๐Ÿ“ฆ Installed packages

Package                             Version
----------------------------------- -----------
aiohttp                             3.9.5
aiosignal                           1.3.1
ansys-api-dbu                       0.3.3
ansys-api-geometry                  0.4.4
ansys-api-meshing-prime             0.1.2.dev1
ansys-geometry-core                 0.6.5
ansys-meshing-prime                 0.5.0.dev10
ansys-tools-path                    0.4.0
ansys-tools-visualization-interface 0.2.6
appdirs                             1.4.4
async-timeout                       4.0.3
attrs                               23.2.0
beartype                            0.18.5
black                               24.4.2
cachetools                          5.3.2
certifi                             2023.11.17
charset-normalizer                  3.3.2
click                               8.1.7
colorama                            0.4.6
contourpy                           1.2.0
cycler                              0.12.1
fonttools                           4.46.0
frozenlist                          1.4.1
google-api-core                     2.14.0
google-api-python-client            2.109.0
google-auth                         2.24.0
google-auth-httplib2                0.1.1
googleapis-common-protos            1.61.0
grpcio                              1.59.3
grpcio-health-checking              1.48.2
httplib2                            0.22.0
idna                                3.6
kiwisolver                          1.4.5
matplotlib                          3.8.2
more-itertools                      10.3.0
msgpack                             1.0.8
multidict                           6.0.5
mypy-extensions                     1.0.0
numpy                               1.26.2
packaging                           23.2
pathspec                            0.12.1
Pillow                              10.1.0
Pint                                0.22
pip                                 23.3.1
platformdirs                        4.0.0
pooch                               1.8.0
protobuf                            3.20.3
pyasn1                              0.5.1
pyasn1-modules                      0.3.0
pyparsing                           3.1.1
python-dateutil                     2.8.2
pyvista                             0.43.10
requests                            2.31.0
rsa                                 4.9
scipy                               1.11.4
scooby                              0.9.2
semver                              3.0.2
setuptools                          65.5.0
six                                 1.16.0
tomli                               2.0.1
trame                               3.6.3
trame-client                        3.2.1
trame-server                        3.0.3
trame-vtk                           2.8.9
trame-vuetify                       2.6.1
typing_extensions                   4.8.0
uritemplate                         4.1.1
urllib3                             2.1.0
vtk                                 9.3.0
websockets                          12.0
wslink                              2.1.1
yarl                                1.9.4

Investigating this