This macro may be used to find out, what END is closer to PANE (or all other types) that is intersects SCTN.
We use clash tool, to find out at what point we have collision and than check which end is closer to it.
!sctn = =23584/6386
!pane = =23584/6854DESCLASH
REM OBST ALL
OBST $!pane
CHECK $!sctn
EXITvar !allClashes CLASH COUNT CLASHES
if(!allClashes.real().eq(0))then
return
endif
var !ClashPos CLASH 1 POSITION
AID CLEAR ALLif(!sctn.poss.distance(!clashPos.position()) lt !sctn.pose.distance(!clashPos.position()))then
$p POSS – Position: $!<sctn.poss>
AID TEXT ‘POSS’ AT $!<sctn.poss>
else
$p POSE – Position: $!<sctn.pose>
AID TEXT ‘POSE’ AT $!<sctn.pose>
endif