How to find pairs of opposite surfaces to a specified surface

Altair Forum User
Altair Forum User
Altair Employee
edited October 2020 in Community Q&A

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' />

 

@tinh @vipin

 

Unable to find an attachment - read this blog

Answers

  • vipin_22401
    vipin_22401 Altair Community Member
    edited January 2019

    Hi,

     

    If you have surface normal vector and centroid, try intersect option in F8 panel. Then find nearest surfaces for newly created nodes.

    image.png.8678a709210ec5eace6b68caaff47b6e.png

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited January 2019

    Hi,

     

    If you have surface normal vector and centroid, try intersect option in F8 panel. Then find nearest surfaces for newly created nodes.

    <?xml version="1.0" encoding="UTF-8"?>image.png.8678a709210ec5eace6b68caaff47b6e.png

    Thanks for your reply.:D/emoticons/default_biggrin.png' srcset='/emoticons/biggrin@2x.png 2x' title=':D' width='20' />

    1. How to find nearest surfaces from newly created nodes?Is there any HyperMesh API to use?:o/emoticons/default_ohmy.png' srcset='/emoticons/ohmy@2x.png 2x' title=':o' width='20' />
    2. Is there any API to get node ids list created by *nodecreateatplanesintersection?hm_latestentityid nodes 0-99 is not very convenient.

    3. Just find that *linecreatenormaltogeom is a good method.:D/emoticons/default_biggrin.png' srcset='/emoticons/biggrin@2x.png 2x' title=':D' width='20' />

    4. How can I get line list created by *linecreatenormaltogeom?

  • vipin_22401
    vipin_22401 Altair Community Member
    edited January 2019

    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

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited January 2019

    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:rolleyes:/emoticons/default_rolleyes.gif' title=':rolleyes:' />

    1. 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)?
    2. 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.
    3. 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?
    4. These two APIs (hm_entityrecorder and *createmarklast) are really helpful.Much appreciated.<img class=" data-emoticon="" src="src" />/emoticons/default_laugh.png' title=':lol:' />

    <?xml version="1.0" encoding="UTF-8"?>slide0.png

  • vipin_22401
    vipin_22401 Altair Community Member
    edited January 2019

    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?:unsure:/emoticons/default_unsure.png' title=':unsure:' />

    3. It will be same like looping through each line length and find out shortest distance.

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited January 2019

    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?:unsure:/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.<img class=" data-emoticon="" src="src" />/emoticons/default_laugh.png' title=':lol:' />

    Thanks for your patient,you helped me a lot.<img class=" data-emoticon="" src="src" />/emoticons/default_laugh.png' title=':lol:' />