The rule for when to keep coplanar surfaces was very wrong; fix it.
[git-p4: depot-paths = "//depot/solvespace/": change = 1740]
This commit is contained in:
parent
0ad8644df4
commit
1909d4c520
|
@ -1189,9 +1189,12 @@ void GraphicsWindow::Paint(int w, int h) {
|
|||
SBsp3 *pb = SBsp3::FromMesh(mb);
|
||||
|
||||
SMesh br; ZERO(&br);
|
||||
br.flipNormal = true; br.keepCoplanar = false;
|
||||
br.flipNormal = true;
|
||||
br.keepCoplanar = false;
|
||||
br.AddAgainstBsp(mb, pa);
|
||||
br.flipNormal = false; br.keepCoplanar = false;
|
||||
|
||||
br.flipNormal = false;
|
||||
br.keepCoplanar = false;
|
||||
br.AddAgainstBsp(ma, pb);
|
||||
|
||||
dbp("triangles in = %d %d out = %d", ma->l.n, mb->l.n, br.l.n);
|
||||
|
|
7
mesh.cpp
7
mesh.cpp
|
@ -104,10 +104,10 @@ void SBsp3::InsertInPlane(bool pos2, STriangle *tr, SMesh *m) {
|
|||
}
|
||||
ll = ll->more;
|
||||
}
|
||||
|
||||
if(m->flipNormal && !pos2 && (!onFace || !sameNormal)) {
|
||||
|
||||
if(m->flipNormal && ((!pos2 && !onFace) || (onFace && !sameNormal))) {
|
||||
m->AddTriangle(tr->c, tr->b, tr->a);
|
||||
} else if(!(m->flipNormal) && (pos2 ||
|
||||
} else if(!(m->flipNormal) && ((pos2 && !onFace) ||
|
||||
(onFace && sameNormal && m->keepCoplanar)))
|
||||
{
|
||||
m->AddTriangle(tr->a, tr->b, tr->c);
|
||||
|
@ -153,6 +153,7 @@ alt:
|
|||
} else {
|
||||
// I suppose this actually is allowed to happen, if the coplanar
|
||||
// face is the leaf, and all of its neighbors are earlier in tree?
|
||||
dbp("insert in plane");
|
||||
InsertInPlane(false, tr, instead);
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue
Block a user