ansys / pyansys-geometry

A Python wrapper for Ansys Geometry Services
https://geometry.docs.pyansys.com/
MIT License
38 stars 11 forks source link

Incorrect point connectivity in sketch /trapezoid.py #1349

Closed JimmyHe0527 closed 1 month ago

JimmyHe0527 commented 1 month ago

🔍 Before submitting the issue

🐞 Description of the bug

The point connectivity when creating a trapezoidal sketch profile seems to be incorrect: image

When inspecting the source code (src/ansys/geometry/core/sketch/trapezoid.py, lines 141-144), the connectivity order 1->2->3->4 ->1is used. Based on the point coordinates defined in lines 117-132, the correct order should be: 1->2->4->3->1

📝 Steps to reproduce

sketch.trapezoid(width=Distance(1), height=Distance(0.5), slant_angle=Angle( 90 , unit=UNITS.degrees) ) sketch.plot()

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

2024 R2, SP1

🐍 Which Python version are you using?

3.10

📦 Installed packages

aiohappyeyeballs==2.3.5
aiohttp==3.10.1
aiosignal==1.3.1
ansys-api-dbu==0.3.4
ansys-api-geometry==0.4.6
ansys-geometry-core==0.6.6
ansys-tools-path==0.6.0
ansys-tools-visualization-interface==0.4.0
anyio==4.4.0
appdirs==1.4.4
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
arrow==1.3.0
asttokens==2.4.1
async-lru==2.0.4
async-timeout==4.0.3
attrs==24.2.0
Babel==2.15.0
beartype==0.18.5
beautifulsoup4==4.12.3
bleach==6.1.0
certifi==2024.7.4
cffi==1.17.0
charset-normalizer==3.3.2
click==8.1.7
colorama==0.4.6
comm==0.2.2
contourpy==1.2.1
cycler==0.12.1
debugpy==1.8.5
decorator==5.1.1
defusedxml==0.7.1
exceptiongroup==1.2.2
executing==2.0.1
fastjsonschema==2.20.0
flexcache==0.3
flexparser==0.3.1
fonttools==4.53.1
fqdn==1.5.1
frozenlist==1.4.1
grpcio==1.65.4
grpcio-health-checking==1.65.4
h11==0.14.0
httpcore==1.0.5
httpx==0.27.0
idna==3.7
ipykernel==6.29.5
ipython==8.26.0
ipywidgets==8.1.3
isoduration==20.11.0
jedi==0.19.1
Jinja2==3.1.4
json5==0.9.25
jsonpointer==3.0.0
jsonschema==4.23.0
jsonschema-specifications==2023.12.1
jupyter-events==0.10.0
jupyter-lsp==2.2.5
jupyter_client==8.6.2
jupyter_core==5.7.2
jupyter_server==2.14.2
jupyter_server_terminals==0.5.3
jupyterlab==4.2.4
jupyterlab_pygments==0.3.0
jupyterlab_server==2.27.3
jupyterlab_widgets==3.0.11
kiwisolver==1.4.5
MarkupSafe==2.1.5
matplotlib==3.9.1.post1
matplotlib-inline==0.1.7
mistune==3.0.2
more-itertools==10.4.0
msgpack==1.0.8
multidict==6.0.5
nbclient==0.10.0
nbconvert==7.16.4
nbformat==5.10.4
nest-asyncio==1.6.0
notebook_shim==0.2.4
numpy==2.0.1
overrides==7.7.0
packaging==24.1
pandocfilters==1.5.1
parso==0.8.4
pillow==10.4.0
Pint==0.24.3
platformdirs==4.2.2
pooch==1.8.2
prometheus_client==0.20.0
prompt_toolkit==3.0.47
protobuf==5.27.3
psutil==6.0.0
pure_eval==0.2.3
pycparser==2.22
Pygments==2.18.0
pyparsing==3.1.2
python-dateutil==2.9.0.post0
python-json-logger==2.0.7
pyvista==0.44.1
pywin32==306
pywinpty==2.0.13
PyYAML==6.0.2
pyzmq==26.1.0
referencing==0.35.1
requests==2.32.3
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rpds-py==0.20.0
scipy==1.14.0
scooby==0.10.0
semver==3.0.2
Send2Trash==1.8.3
six==1.16.0
sniffio==1.3.1
soupsieve==2.5
stack-data==0.6.3
terminado==0.18.1
tinycss2==1.3.0
tomli==2.0.1
tornado==6.4.1
traitlets==5.14.3
trame==3.6.3
trame-client==3.2.1
trame-server==3.0.3
trame-vtk==2.8.9
trame-vuetify==2.6.2
types-python-dateutil==2.9.0.20240316
typing_extensions==4.12.2
uri-template==1.3.0
urllib3==2.2.2
vtk==9.3.1
wcwidth==0.2.13
webcolors==24.6.0
webencodings==0.5.1
websocket-client==1.8.0
websockets==12.0
widgetsnbextension==4.0.11
wslink==2.1.1
yarl==1.9.4
RobPasMue commented 1 month ago

Thanks for opening this issue @JimmyHe0527 - looking into it!

RobPasMue commented 1 month ago

Interesting... If you reduce the slant angle to a value like 35, everything works. I have to review the mathematics I think... Thanks for bringing this up. I will follow up here as soon as I have some news!