Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The issue is right here</p> <pre><code> TriangleDynamic t1(p1 , newEdge1Mid , newEdge3Mid); subTriangles.push_back(t1); TriangleDynamic t2(newEdge1Mid, p2, newEdge2Mid); subTriangles.push_back(t2); TriangleDynamic t3(newEdge3Mid, newEdge2Mid, p3); subTriangles.push_back(t3); TriangleDynamic t4(newEdge1Mid, newEdge2Mid, newEdge3Mid); subTriangles.push_back(t4); t1.splitTriangleProject( currentLevel + 1, maxLevel, org, radius); t2.splitTriangleProject( currentLevel + 1, maxLevel, org, radius); t3.splitTriangleProject( currentLevel + 1, maxLevel, org, radius); t4.splitTriangleProject( currentLevel + 1, maxLevel, org, radius); </code></pre> <p>Note how you push a copy of the triangle into the subTriangles vector before you call splitTrangleProject.</p> <p>Thus the triangles in the vector did not have splitTriangleProject called on them.</p> <p>Move the pushbacks to the end of the code and it should work.</p> <pre><code> TriangleDynamic t1(p1 , newEdge1Mid , newEdge3Mid); TriangleDynamic t2(newEdge1Mid, p2, newEdge2Mid); TriangleDynamic t3(newEdge3Mid, newEdge2Mid, p3); TriangleDynamic t4(newEdge1Mid, newEdge2Mid, newEdge3Mid); t1.splitTriangleProject( currentLevel + 1, maxLevel, org, radius); t2.splitTriangleProject( currentLevel + 1, maxLevel, org, radius); t3.splitTriangleProject( currentLevel + 1, maxLevel, org, radius); t4.splitTriangleProject( currentLevel + 1, maxLevel, org, radius); subTriangles.push_back(t3); subTriangles.push_back(t2); subTriangles.push_back(t1); subTriangles.push_back(t4); </code></pre> <p>(Also, on another note, if this code starts getting slow it could be greatly sped up with a C++11 std::move. Don't go into pointers unless you have to.)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload