Jump to content

Recommended Posts

Hi all,

 

Is there any command available to find surfaces which are very close to each other. I have 2 components and there are some locations where the surfaces are really close(like contacts), need to find these surface ids without any manual selection.

Share this post


Link to post
Share on other sites

Hi Vipin,

try using hm_collisioncheck (refer to hm help)

set output for mark_id_pene_surfs

you may need to set an appropriate thickness for surface component

Share this post


Link to post
Share on other sites

Hi tinh

 

*createmark surfs 1 "displayed"
hm_collisioninit
hm_collisionentitycreate surfs 1 0 1 0 0 0 0 0 0
hm_collisioncheck 0 0 0 1 0 0
hm_collisionend
hm_highlightmark surfs 1 "low"

 

right now my code looks like this. I cant find any option to assign surface thickness! how to do that?

Share this post


Link to post
Share on other sites

Hi Vipin,

maybe the example given in hm help is wrong!

Below code is working in my hm2017, please try it (T1 is thickness of surfs in comp1, T2... comp2):

proc p_GetContactSurfs {CompId1 T1 CompId2 T2} {

   hm_collisioninit

   *createmark surfs 1 "by comp id" $CompId1

   hm_collisionentitycreate surfs 1 0 10 $T1 0 0 0 0 1

   *createmark surfs 1 "by comp id" $CompId2

   hm_collisionentitycreate surfs 1 0 10 $T2 0 0 0 0 1

   hm_collisioncheck 0 0 0 1 0 0 0

   hm_collisionend

   hm_highlightmark surfs 1 low

   hm_getmark surfs 1

}

Pandurang likes this

Share this post


Link to post
Share on other sites

Really? 

T1 and T2 are thickness values to apply to surfs

in my test:

comp1 (ID 1001) has surfs 1 2 3 4 5 6 7 8 9 10

comp2 (ID 1002) has surfs 11 12 13 14 15 16 17 18 19 20

 

I invoked:

p_GetContactSurfs 1001 1.0 1002 1.0

 

it worked!

Share this post


Link to post
Share on other sites

This command will assign thickness to the surfs

hm_collisionentitycreate surfs 1 0 10 $T1 0 0 0 0 1

 

in hm help, it says add 10 will add thickness to outside of surfs

maybe your surface normal is inward

could you try with number "30" - will add thickness to both inside and outside of surfs

Share this post


Link to post
Share on other sites

proc p_GetContactSurfs {CompId1 T1 CompId2 T2} {

   hm_collisioninit

   *createmark surfs 1 "by comp id" $CompId1

   hm_collisionentitycreate surfs 1 0 30 $T1 0 0 0 0 1

   *createmark surfs 1 "by comp id" $CompId2

   hm_collisionentitycreate surfs 1 0 30 $T2 0 0 0 0 1

   hm_collisioncheck 0 0 0 1 0 0 0

   hm_collisionend

   hm_highlightmark surfs 1 low

   hm_getmark surfs 1

}

p_GetContactSurfs 1 1.0 2 1.0

 

Can you please try on this model, I dont know what is going wrong.     find_nearby_surface.hm

Share this post


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

proc p_GetContactSurfs {CompId1 T1 CompId2 T2} {

   hm_collisioninit

   *createmark surfs 1 "by comp id" $CompId1

   hm_collisionentitycreate surfs 1 0 30 $T1 0 0 0 0 1

   *createmark surfs 1 "by comp id" $CompId2

   hm_collisionentitycreate surfs 1 0 30 $T2 0 0 0 0 1

   hm_collisioncheck 0 0 0 1 0 0 0

   hm_collisionend

   hm_highlightmark surfs 1 low

   hm_getmark surfs 1

}

p_GetContactSurfs 1 1.0 2 1.0

 

Can you please try on this model, I dont know what is going wrong.     find_nearby_surface.hm

 

 

No no Vipin, a critical bug at the second "hm_collisionentitycreate", the last argument must be "2" instead of "1"

 

it is group id of surfs that will be pushed into hm_collisioncheck

 

I test your model, it return surfs 4 9 3 2,  (thickness option 10 or 30 are all OK)

 

please try again and announce me

 

vipin and Pandurang like 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...