Find more posts tagged with
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
}
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.
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.
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
Hey @tinh Thank you so much!!/emoticons/default_biggrin.png' srcset='/emoticons/biggrin@2x.png 2x' title=':D' width='20' />
/emoticons/default_biggrin.png' srcset='/emoticons/biggrin@2x.png 2x' title=':D' width='20' />
problem solved.
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