# How to find pairs of opposite surfaces to a specified surface

## Recommended Posts

Hello everyone!

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

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

Is there any efficient way to get surface 2 & 3?

I'm really really sorry that I'm not good at English.

slide0.bmp

##### Share on other sites

Hi,

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

tinh likes this

##### Share on other sites
9 hours ago, vipin said:

Hi,

If you have﻿ surfac﻿e normal﻿ vector and centroi﻿d, try intersect ﻿option in F8 panel. Then ﻿find nearest surfaces for newly created nodes.

1. How to find nearest surfaces from newly created nodes?Is there any HyperMesh API to use?
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.

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

##### Share on other sites

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

4. Use hm_entityrecorder or *createmarklast

##### Share on other sites
2 hours ago, vipin 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_la﻿teste﻿﻿ntityid nodes 0 and hm_latestentiyid nodes 1 for node 1&2

3. This is an interesting option @qqtomcat

4. Use hm_entityrecorder or *createmarklast

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.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.

##### Share on other sites

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?

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

##### Share on other sites
13 hours ago, vipin 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﻿?

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.

Thanks for your patient,you helped me a lot.

vipin likes this

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.