fixed collision detection in initialization

This commit is contained in:
2025-10-26 19:45:32 -07:00
parent 2f0647caf3
commit d0a060f404
3 changed files with 60 additions and 22 deletions

View File

@@ -0,0 +1,17 @@
function c = geometryIntersects(g1, g2)
c = false;
% Check if g2 contains g1
for jj = 1:size(g1.edges, 1)
if g2.containsLine(g1.vertices(g1.edges(jj, 1), 1:3), g1.vertices(g1.edges(jj, 2), 1:3))
c = true;
return;
end
end
% Check if g1 contains g2
for jj = 1:size(g2.edges, 1)
if g1.containsLine(g2.vertices(g2.edges(jj, 1), 1:3), g2.vertices(g2.edges(jj, 2), 1:3))
c = true;
return;
end
end
end