Report the number of triangles and surfaces in the naked edges

check, hide the coordinate axes at the origin when normals are
hidden (but still show the coordinate axes at the bottom left of
the screen), and report point-line distance when a point and a line
are selected.

[git-p4: depot-paths = "//depot/solvespace/": change = 1973]
This commit is contained in:
Jonathan Westhues 2009-06-07 15:00:57 -08:00
parent 7a279c4e3f
commit 3e86050685
3 changed files with 29 additions and 5 deletions

View File

@ -348,6 +348,13 @@ void Entity::DrawOrGetDistance(void) {
case NORMAL_IN_2D: {
int i;
for(i = 0; i < 2; i++) {
if(i == 0 && !SS.GW.showNormals) {
// When the normals are hidden, we will continue to show
// the coordinate axes at the bottom left corner, but
// not at the origin.
continue;
}
hRequest hr = h.request();
double f = (i == 0 ? 0.4 : 1);
if(hr.v == Request::HREQUEST_REFERENCE_XY.v) {

View File

@ -426,7 +426,8 @@ void SolveSpace::MenuAnalyze(int id) {
case GraphicsWindow::MNU_NAKED_EDGES: {
SS.nakedEdges.Clear();
SMesh *m = &(SK.GetGroup(SS.GW.activeGroup)->displayMesh);
Group *g = SK.GetGroup(SS.GW.activeGroup);
SMesh *m = &(g->displayMesh);
SKdNode *root = SKdNode::From(m);
bool inters, leaks;
root->MakeCertainEdgesInto(&(SS.nakedEdges),
@ -441,12 +442,17 @@ void SolveSpace::MenuAnalyze(int id) {
"The mesh has naked edges (NOT okay, invalid)." :
"The mesh is watertight (okay, valid).";
char cntMsg[1024];
sprintf(cntMsg, "\r\n\r\nThe model contains %d triangles, from "
"%d surfaces.",
g->displayMesh.l.n, g->runningShell.surface.n);
if(SS.nakedEdges.l.n == 0) {
Message("%s\r\n\r\n%s\r\n\r\nZero problematic edges, good.",
intersMsg, leaksMsg);
Message("%s\r\n\r\n%s\r\n\r\nZero problematic edges, good.%s",
intersMsg, leaksMsg, cntMsg);
} else {
Error("%s\r\n\r\n%s\r\n\r\n%d problematic edges, bad.",
intersMsg, leaksMsg, SS.nakedEdges.l.n);
Error("%s\r\n\r\n%s\r\n\r\n%d problematic edges, bad.%s",
intersMsg, leaksMsg, SS.nakedEdges.l.n, cntMsg);
}
break;
}

View File

@ -441,6 +441,17 @@ void TextWindow::DescribeSelection(void) {
Printf(true, " vector = " PT_AS_NUM, CO(v));
double d = (p1.Minus(p0)).Dot(v);
Printf(true, " proj_d = %Fi%s", SS.MmToString(d));
} else if(gs.n == 2 && gs.lineSegments == 1 && gs.points == 1) {
Entity *ln = SK.GetEntity(gs.entity[0]);
Vector lp0 = SK.GetEntity(ln->point[0])->PointGetNum(),
lp1 = SK.GetEntity(ln->point[1])->PointGetNum();
Printf(false, "%FtLINE SEGMENT AND POINT%E");
Printf(true, " ln thru " PT_AS_STR, COSTR(lp0));
Printf(false, " " PT_AS_STR, COSTR(lp1));
Vector pp = SK.GetEntity(gs.point[0])->PointGetNum();
Printf(true, " point " PT_AS_STR, COSTR(pp));
Printf(true, " pt-ln distance = %Fi%s%E",
SS.MmToString(pp.DistanceToLine(lp0, lp1.Minus(lp0))));
} else if(gs.n == 2 && gs.faces == 2) {
Printf(false, "%FtTWO PLANE FACES");