Skip to content
Snippets Groups Projects
Commit d0d21bb3 authored by Brandon Lai-Cheong's avatar Brandon Lai-Cheong
Browse files

bug fix and refactor

parent 56ca6b82
No related branches found
No related tags found
No related merge requests found
......@@ -28,9 +28,7 @@ std::vector<Point> getPointsOnSide(const Edge &e, const std::vector<Point> intr,
std::vector<Triangle> unionizeTopAndBottom(const Triangle &top, const Triangle &bottom)
{
if (intersections(top, bottom).empty()) {
return {};
}
std::vector<Triangle> result;
TriangleEdges topEdges = TriangleEdges(top);
TriangleEdges botEdges = TriangleEdges(bottom);
......@@ -62,6 +60,9 @@ std::vector<Triangle> unionizeTopAndBottom(const Triangle &top, const Triangle &
std::vector<Triangle> unionize(const Triangle &t1, const Triangle &t2)
{
if (intersections(t1, t2).empty()) {
return {t1, t2};
}
if (t1.depth < t2.depth)
{
return unionizeTopAndBottom(t1, t2);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment