ansys / pyaedt

AEDT Python Client Package
https://aedt.docs.pyansys.com
MIT License
207 stars 127 forks source link

Adding a new segment to an existing polyline generates error #2491

Closed Arashpk closed 1 year ago

Arashpk commented 1 year ago

Before submitting the issue

Description of the bug

Adding a new segment to an existing polyline generates error

Steps To Reproduce

I have created a code to create a spiral geometry asa follows:

ind = hfss.modeler.create_spiral( internal_radius=innerRadius, spacing=wireThickness_um, turns=numberOfTurns, faces=NumberOfFaces, material="copper", name="Inductor1", ) ind.set_crosssection_properties(type="Circle", width=wireThickness_um)

Then I read the created points and make a first and last point variable

PolyLinePositions = [list(ele) for ele in ind.points] firstPoint = PolyLinePositions[0] lastPoint = PolyLinePositions[-1]

The target is to add a new line to the existing polyline with insert_segment method

new_point = [lastPoint[0], lastPoint[1], 100] position_lst = [lastPoint, new_point] ind .insert_segment(position_lst)

The ind.points, reads wrong values due to some numerical noise problem. For example here is the last value in the AEDT

image

And here is the read value

image

And because of that, the the insert_segment methos generates error because it cannot find the vertex

Which Operating System are you using?

Windows

Which Python version are you using?

3.7

Installed packages

aiodns==3.0.0 aiohttp==3.8.3 aiohttp-socks==0.7.1 aiosignal==1.2.0 appdirs==1.4.4 astor==0.8.1 asttokens==2.0.8 async-timeout==4.0.2 attrs==22.1.0 autopep8==1.7.0 backcall==0.2.0 beautifulsoup4==4.11.1 cchardet==2.1.7 certifi==2022.9.24 cffi==1.15.1 charset-normalizer==2.1.1 clean-text==0.6.0 clr-loader==0.2.5 colorama==0.4.6 contourpy==1.0.5 cycler==0.11.0 Cython==0.29.32 dataclasses==0.6 decorator==5.1.1 elastic-transport==8.4.0 elasticsearch==8.4.3 emoji==1.7.0 emot==3.1 et-xmlfile==1.1.0 executing==1.1.1 fake-useragent==0.1.11 fastrlock==0.8.1 filelock==3.8.0 fonttools==4.37.4 frozenlist==1.3.1 ftfy==6.1.1 geographiclib==1.52 geopy==2.2.0 googletransx==2.4.2 hazm==0.7.0 idna==3.4 imageio==2.25.0 ipython==8.5.0 jedi==0.18.1 joblib==1.2.0 kaleido==0.2.1 kiwisolver==1.4.4 langdetect==1.0.9 lxml==4.9.1 matplotlib==3.6.3 matplotlib-inline==0.1.6 multidict==6.0.2 nltk==3.3 numpy==1.23.4 oauthlib==3.2.1 openpyxl==3.1.0 packaging==21.3 pandas==1.5.0 pandasgui==0.2.13 parso==0.8.3 pickleshare==0.7.5 Pillow==9.2.0 plotly==5.10.0 plumbum==1.8.1 pooch==1.6.0 prompt-toolkit==3.0.31 psutil==5.9.4 pure-eval==0.2.2 pyaedt==0.6.45 pyarrow==10.0.0 pycares==4.2.2 pycodestyle==2.9.1 pycparser==2.21 Pygments==2.13.0 pynput==1.7.6 pyparsing==3.0.9 pypiwin32==223 PyQt5==5.15.7 PyQt5-Qt5==5.15.2 PyQt5-sip==12.11.0 PyQtWebEngine==5.15.6 PyQtWebEngine-Qt5==5.15.2 PySocks==1.7.1 pyTelegramBotAPI==4.10.0 python-dateutil==2.8.2 python-socks==2.0.3 pythonnet==3.0.1 pytz==2022.4 pyvista==0.38.1 pywin32==304 qtstylish==0.1.5 requests==2.28.1 requests-oauthlib==1.3.1 rpyc==5.3.0 schedule==1.1.0 scikit-learn==1.2.1 scipy==1.10.0 scooby==0.7.1 seaborn==0.12.2 six==1.16.0 sklearn==0.0.post1 snscrape==0.5.0.20230113 soupsieve==2.3.2.post1 stack-data==0.5.1 tenacity==8.1.0 threadpoolctl==3.1.0 toml==0.10.2 tqdm==4.64.1 traitlets==5.5.0 tweepy==4.10.1 twint @ git+https://github.com/twintproject/twint.git@e7c8a0c764f6879188e5c21e25fb6f1f856a7221 typing_extensions==4.4.0 urllib3==1.26.12 vtk==9.2.5 wcwidth==0.2.5 wordcloud==1.8.2.2 yarl==1.8.1

svandenb-dev commented 1 year ago

Problem due to Modeler dynamic limits. It's not actually a Payedt bug