Find nearby surfaces

vipin_22401
vipin_22401 Altair Community Member
edited October 2020 in Community Q&A

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.

Answers

  • tinh
    tinh Altair Community Member
    edited June 2018

    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

  • vipin_22401
    vipin_22401 Altair Community Member
    edited June 2018

    Hi tinh,

     

    How do i assign thickness to surface? right now the hm_collisioncheck is returning all surface ids i selected initially.

  • tinh
    tinh Altair Community Member
    edited June 2018

    Hi VIpin

    try assigning thickness to component storing the surface

    Could you show your codes?

  • vipin_22401
    vipin_22401 Altair Community Member
    edited June 2018

    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?

  • tinh
    tinh Altair Community Member
    edited June 2018

    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

    }

  • vipin_22401
    vipin_22401 Altair Community Member
    edited June 2018

    Hi @tinh

    I am not getting any output, i think there is no thickness for surfaces in my model.

    Please tell me how to update thickness for surface components.

  • tinh
    tinh Altair Community Member
    edited June 2018

    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!

  • vipin_22401
    vipin_22401 Altair Community Member
    edited June 2018

    Hi @tinh

     

    The problem is assigning thickness to surfaces. 

    I am not able to find that option.

  • tinh
    tinh Altair Community Member
    edited June 2018

    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

  • vipin_22401
    vipin_22401 Altair Community Member
    edited June 2018

    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.     

    Unable to find an attachment - read this blog

  • tinh
    tinh Altair Community Member
    edited June 2018

    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.     

     

     

    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

     

    Unable to find an attachment - read this blog

  • vipin_22401
    vipin_22401 Altair Community Member
    edited June 2018

    Hey @tinh  Thank you so much!!:D/emoticons/default_biggrin.png' srcset='/emoticons/biggrin@2x.png 2x' title=':D' width='20' />:D/emoticons/default_biggrin.png' srcset='/emoticons/biggrin@2x.png 2x' title=':D' width='20' />

    problem solved.