Change fudging when I select edges to generate a section from the
shell. That seems less prone generating stray lines, though it does sometimes generate gaps. [git-p4: depot-paths = "//depot/solvespace/": change = 1876]
This commit is contained in:
parent
816a1ee8b4
commit
69cf8d6484
2
dsc.h
2
dsc.h
@ -47,7 +47,7 @@ public:
|
|||||||
Vector n2, double d2);
|
Vector n2, double d2);
|
||||||
|
|
||||||
double Element(int i);
|
double Element(int i);
|
||||||
bool Equals(Vector v);
|
bool Equals(Vector v, double tol=LENGTH_EPS);
|
||||||
bool EqualsExactly(Vector v);
|
bool EqualsExactly(Vector v);
|
||||||
Vector Plus(Vector b);
|
Vector Plus(Vector b);
|
||||||
Vector Minus(Vector b);
|
Vector Minus(Vector b);
|
||||||
|
10
mesh.cpp
10
mesh.cpp
@ -588,9 +588,9 @@ void SKdNode::FindEdgeOn(Vector a, Vector b, int *n, int *nOther,
|
|||||||
|
|
||||||
if(tr->tag == cnt) continue;
|
if(tr->tag == cnt) continue;
|
||||||
|
|
||||||
if((a.EqualsExactly(tr->b) && b.EqualsExactly(tr->a)) ||
|
if((a.Equals(tr->b, KDTREE_EPS) && b.Equals(tr->a, KDTREE_EPS)) ||
|
||||||
(a.EqualsExactly(tr->c) && b.EqualsExactly(tr->b)) ||
|
(a.Equals(tr->c, KDTREE_EPS) && b.Equals(tr->b, KDTREE_EPS)) ||
|
||||||
(a.EqualsExactly(tr->a) && b.EqualsExactly(tr->c)))
|
(a.Equals(tr->a, KDTREE_EPS) && b.Equals(tr->c, KDTREE_EPS)))
|
||||||
{
|
{
|
||||||
(*n)++;
|
(*n)++;
|
||||||
if(tr->meta.face != m.face) {
|
if(tr->meta.face != m.face) {
|
||||||
@ -643,7 +643,9 @@ void SKdNode::MakeCertainEdgesInto(SEdgeList *sel, bool emphasized) {
|
|||||||
FindEdgeOn(a, b, &n, &nOther, tr->meta, cnt++);
|
FindEdgeOn(a, b, &n, &nOther, tr->meta, cnt++);
|
||||||
if(n != 1) {
|
if(n != 1) {
|
||||||
if(!emphasized) {
|
if(!emphasized) {
|
||||||
if(n == 0) sel->AddEdge(a, b);
|
if(n == 0 && (a.Minus(b).Magnitude()) > KDTREE_EPS) {
|
||||||
|
sel->AddEdge(a, b);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// dbp("hanging: n=%d (%.3f %.3f %.3f) (%.3f %.3f %.3f)",
|
// dbp("hanging: n=%d (%.3f %.3f %.3f) (%.3f %.3f %.3f)",
|
||||||
// n, CO(a), CO(b));
|
// n, CO(a), CO(b));
|
||||||
|
10
util.cpp
10
util.cpp
@ -290,13 +290,13 @@ double Vector::Element(int i) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Vector::Equals(Vector v) {
|
bool Vector::Equals(Vector v, double tol) {
|
||||||
// Quick axis-aligned tests before going further
|
// Quick axis-aligned tests before going further
|
||||||
double dx = v.x - x; if(dx < -LENGTH_EPS || dx > LENGTH_EPS) return false;
|
double dx = v.x - x; if(dx < -tol || dx > tol) return false;
|
||||||
double dy = v.y - y; if(dy < -LENGTH_EPS || dy > LENGTH_EPS) return false;
|
double dy = v.y - y; if(dy < -tol || dy > tol) return false;
|
||||||
double dz = v.z - z; if(dz < -LENGTH_EPS || dz > LENGTH_EPS) return false;
|
double dz = v.z - z; if(dz < -tol || dz > tol) return false;
|
||||||
|
|
||||||
return (this->Minus(v)).MagSquared() < LENGTH_EPS*LENGTH_EPS;
|
return (this->Minus(v)).MagSquared() < tol*tol;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Vector::EqualsExactly(Vector v) {
|
bool Vector::EqualsExactly(Vector v) {
|
||||||
|
Loading…
Reference in New Issue
Block a user