Jump to content
qqtomcat

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.

Thanks in advance!Thanks for your Great patient! :)

 

@tinh @vipin

 

slide0.bmp

Share this post


Link to post
Share on other sites
9 hours ago, vipin said:

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

Thanks for your reply.:D

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

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

Share this post


Link to post
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 this post


Link to post
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_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

Thanks for your reply: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:).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.:lol:

slide0.png

Share this post


Link to post
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?:unsure:

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

Share this post


Link to post
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?: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.:lol:

Thanks for your patient,you helped me a lot.:lol:

vipin likes this

Share this post


Link to post
Share on other sites

Join the conversation

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

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...