How to find pairs of opposite surfaces to a specified surface
Hello everyone! /emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' />
I now trying to find surface 2 and surface 3 that they are pairs of opposite surfaces to surface 1.
Suppose we get a virtual straight line cross centroid of surface 1 parallel to surface 1's normal vector,
I want to find first and second surfaces that have shortest distance to surface 1 alone the virtual line,
in this example ,they are surface 2 &3
'hm_measureshortestdistance' can only find surface 5 and surface 6 because they are closer than
surface 2&3 /emoticons/default_sad.png' srcset='/emoticons/sad@2x.png 2x' title=':(' width='20' />
I tried to Create temp node attached to surface 1 located in centroid(hm_getcentroid surfs) of surface 1,duplicate the temp node
and then project the duplicated node to solid surfs with normal option(*markprojectnormallytosurface) ,in order to get distance list of nodes,
the original temp node and duplicated nodes distance list.By using lsort -increasing -real $distancelist , I got first two distance and
find surface 2 & 3 that opposite to surface 1.
But.it's really complicated and the script runs really really slowly /emoticons/default_sad.png' srcset='/emoticons/sad@2x.png 2x' title=':(' width='20' />
Is there any efficient way to get surface 2 & 3?
I'm really really sorry that I'm not good at English.
Thanks in advance!Thanks for your Great patient! /emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' />
Answers
-
Hi,
If you have surface normal vector and centroid, try intersect option in F8 panel. Then find nearest surfaces for newly created nodes.
0 -
Altair Forum User said:
Thanks for your reply./emoticons/default_biggrin.png' srcset='/emoticons/biggrin@2x.png 2x' title=':D' width='20' />
- How to find nearest surfaces from newly created nodes?Is there any HyperMesh API to use?/emoticons/default_ohmy.png' srcset='/emoticons/ohmy@2x.png 2x' title=':o' width='20' />
-
Is there any API to get node ids list created by *nodecreateatplanesintersection?hm_latestentityid nodes 0-99 is not very convenient.
-
Just find that *linecreatenormaltogeom is a good method./emoticons/default_biggrin.png' srcset='/emoticons/biggrin@2x.png 2x' title=':D' width='20' />
-
How can I get line list created by *linecreatenormaltogeom?
0 -
1. Find node coordinates and use same option you were using. Hm_measureshortestdistance
2. Since you will be getting 2 new nodes. Use hm_latestentityid nodes 0 and hm_latestentiyid nodes 1 for node 1&2
3. This is an interesting option @qqtomcat/emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' />
4. Use hm_entityrecorder or *createmarklast
0 -
Altair Forum User said:
1. Find node coordinates and use same option you were using. Hm_measureshortestdistance
2. Since you will be getting 2 new nodes. Use hm_latestentityid nodes 0 and hm_latestentiyid nodes 1 for node 1&2
3. This is an interesting option @qqtomcat/emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' />
4. Use hm_entityrecorder or *createmarklast
Thanks for your reply/emoticons/default_rolleyes.gif' title=':rolleyes:' />
- How can I get two nodes shown in attachment?Should I use foreach command to loop intersect nodes list and get shortest distance(hm_measureshortestdistance)?
- Actually,I want to get the distance between surfaces 2&3/emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' />.Because these two surfaces are nearest to surface 1 along the virtual line mentioned before.
- Besides nodes intersection,is there any other way that can quickly get surface 2&3 distance?Do you think by using *linecreatenormaltogeom to get lines list from surface1 to surface 2&3&4&5&6&7 is an efficient method?
- These two APIs (hm_entityrecorder and *createmarklast) are really helpful.Much appreciated." data-emoticon="" src="src" />/emoticons/default_laugh.png' title='' />
0 -
1. Sure, you can loop through the distance and sort to find out shortest 2 distances. And use only the surfaces in that component while creating nodes, so that there will be only 2 nodes.
2. Why dont you retrieve the thickness from midsurface?/emoticons/default_unsure.png' title=':unsure:' />
3. It will be same like looping through each line length and find out shortest distance.
0 -
Altair Forum User said:
1. Sure, you can loop through the distance and sort to find out shortest 2 distances. And use only the surfaces in that component while creating nodes, so that there will be only 2 nodes.
2. Why dont you retrieve the thickness from midsurface?/emoticons/default_unsure.png' title=':unsure:' />
3. It will be same like looping through each line length and find out shortest distance.
2.Yes.I wrote some script to retrieve thickness from midsurface. But sometimes surfaces created by midsurface command may have Inaccurate thickness values or these surfaces have distortions.
So I may create midsurface manually and get surface thickness by some scripts." data-emoticon="" src="src" />/emoticons/default_laugh.png' title='' />
Thanks for your patient,you helped me a lot." data-emoticon="" src="src" />/emoticons/default_laugh.png' title='' />
0