fn peresechenie obj1 obj2=
(
res=false; if(IsValidNode obj1 and IsValidNode obj2)then
(
if(superclassof obj1==GeometryClass and superclassof obj2==GeometryClass )then
(
max modify mode;select obj1;
vs=volumeselect();vs.level=2;vs.type=1;vs.method=0;vs.volume=3;
vs.name="intersect_temp"; vs.Node=obj2;addmodifier obj1 vs;
theMesh = snapshotasmesh obj1; fs_ba=getFaceSelection theMesh; delete theMesh;
if fs_ba.numberSet!=0 then res=true
for i=1 to obj1.modifiers.count do
if(obj1.modifiers[i].name=="intersect_temp")then (deleteModifier obj1 i;exit)
)--if(superclassof obj1==GeometryClass and superclassof obj2==GeometryClass )then
)--if(IsValidNode obj1 and IsValidNode obj2)then
res
)--fn peresecenie obj1 obj2=
-----------------------------
if peresechenie $box1 $box2 then a=1