-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mesh selection #2207
Mesh selection #2207
Conversation
Co-authored-by: Jamil Hajjar <[email protected]>
Fixing tests Updating slightly some examples
Simplying some stuff
for more information, see https://pre-commit.ci
Using pv.PolyData for kps Speeding up `get_volumes` by smart mapping areas to volumes. We only call once `generate_surface` which is expensive.
Adding tests
Codecov Report
@@ Coverage Diff @@
## main #2207 +/- ##
==========================================
+ Coverage 86.39% 87.72% +1.33%
==========================================
Files 45 45
Lines 7977 8410 +433
==========================================
+ Hits 6892 7378 +486
+ Misses 1085 1032 -53 |
This PR will need manual testing. Pinging @clatapie @mikerife @mcMunich @pmaroneh for manual testing. Example code for testing: from ansys.mapdl.core import launch_mapdl
import numpy as np
mapdl = launch_mapdl(start_instance=False)
mapdl.clear()
mapdl.prep7()
mapdl.block(0, 1, 0, 1, 0, 1)
mapdl.block(-2, 0, -2, 0, 1, 2)
mapdl.asel("s", "P")
mapdl.vsel("s", "P")
mapdl.lsel("s", "P") # I didn't test this one. |
Updated PR description |
The
Apart from that, the other commands run fine on my local installation:
|
LSEL is fixed. Please @clatapie check it out again please. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I can try to add areas/lines with some sort of transparency... I can look into this. Did you @mcMunich try using "R", "A", etc?? For instance: mapdl.lsel("s", vmin=2)
mapdl.lsel("r", "P") # Check there is a line already selected) |
As the title.
This PR should enable mesh interactive picking when using
mapdl.%XSEL%("%Y%", "P")
where%XSEL%
is a selection command such asvsel
, orasel
. It should work also withesel
andlsel
but I didn't test it. The commandsksel
andnsel
were already implemented in another PR (#1123).%Y%
is a selection type, meaningS
for new selection,R
for reselecting,U
for unselecting andA
for adding.When issued for example
mapdl.vsel("s", "P")
, it should show a window:I rather you do not read much of the following, the window shown should be self-explanatory
with the volumes being pickable using the right button.
You can change between selecting and unselecting mode pressing the key
U
.Finally, when closing the window, you should get back an array with the ids of the entities selected:
Notes
A
.