Assemble only inner loops from same style as outer loop. Fix arrows

for dimensions when viewed on edge. Add an angle measurement to the
text screen selection info.

[git-p4: depot-paths = "//depot/solvespace/": change = 2063]
This commit is contained in:
Jonathan Westhues 2009-11-01 03:09:05 -08:00
parent daeb0e8430
commit e74a655ffd
3 changed files with 24 additions and 4 deletions

View File

@ -275,11 +275,11 @@ void Constraint::DoLineWithArrows(Vector ref, Vector a, Vector b,
if(within > 0) LineDrawOrGetDistance(be, be.Plus(seg)); if(within > 0) LineDrawOrGetDistance(be, be.Plus(seg));
} }
LineDrawOrGetDistance(ae, ae.Plus(arrow.RotatedAbout(gn, theta))); LineDrawOrGetDistance(ae, ae.Plus(arrow.RotatedAbout(n, theta)));
LineDrawOrGetDistance(ae, ae.Plus(arrow.RotatedAbout(gn, -theta))); LineDrawOrGetDistance(ae, ae.Plus(arrow.RotatedAbout(n, -theta)));
arrow = arrow.ScaledBy(-1); arrow = arrow.ScaledBy(-1);
LineDrawOrGetDistance(be, be.Plus(arrow.RotatedAbout(gn, theta))); LineDrawOrGetDistance(be, be.Plus(arrow.RotatedAbout(n, theta)));
LineDrawOrGetDistance(be, be.Plus(arrow.RotatedAbout(gn, -theta))); LineDrawOrGetDistance(be, be.Plus(arrow.RotatedAbout(n, -theta)));
} }
void Constraint::DoEqualLenTicks(Vector a, Vector b, Vector gn) { void Constraint::DoEqualLenTicks(Vector a, Vector b, Vector gn) {

View File

@ -674,10 +674,14 @@ void SBezierLoopSetSet::FindOuterFacesFrom(SBezierList *sbl, SPolygon *spxyz,
loopsRemaining = true; loopsRemaining = true;
loop->tag = USED_LOOP; loop->tag = USED_LOOP;
outerAndInners.l.Add(loop); outerAndInners.l.Add(loop);
int auxA = 0;
if(loop->l.n > 0) auxA = loop->l.elem[0].auxA;
for(j = 0; j < sbls.l.n; j++) { for(j = 0; j < sbls.l.n; j++) {
SBezierLoop *inner = &(sbls.l.elem[j]); SBezierLoop *inner = &(sbls.l.elem[j]);
if(inner->tag != INNER_LOOP) continue; if(inner->tag != INNER_LOOP) continue;
if(inner->l.n < 1) continue;
if(inner->l.elem[0].auxA != auxA) continue;
Vector p = spuv.l.elem[j].AnyEdgeMidpoint(); Vector p = spuv.l.elem[j].AnyEdgeMidpoint();
if(spuv.l.elem[i].ContainsPointProjdToNormal(spuv.normal, p)) { if(spuv.l.elem[i].ContainsPointProjdToNormal(spuv.normal, p)) {

View File

@ -480,6 +480,22 @@ void TextWindow::DescribeSelection(void) {
Printf(true, " point " PT_AS_STR, COSTR(pp)); Printf(true, " point " PT_AS_STR, COSTR(pp));
Printf(true, " pt-ln distance = %Fi%s%E", Printf(true, " pt-ln distance = %Fi%s%E",
SS.MmToString(pp.DistanceToLine(lp0, lp1.Minus(lp0)))); SS.MmToString(pp.DistanceToLine(lp0, lp1.Minus(lp0))));
} else if(gs.n == 2 && gs.vectors == 2) {
Printf(false, "%FtTWO VECTORS");
Vector v0 = SK.GetEntity(gs.entity[0])->VectorGetNum(),
v1 = SK.GetEntity(gs.entity[1])->VectorGetNum();
v0 = v0.WithMagnitude(1);
v1 = v1.WithMagnitude(1);
Printf(true, " vectorA = " PT_AS_NUM, CO(v0));
Printf(false, " vectorB = " PT_AS_NUM, CO(v1));
double theta = acos(v0.Dot(v1));
Printf(true, " angle = %Fi%2%E degrees", theta*180/PI);
while(theta < PI/2) theta += PI;
while(theta > PI/2) theta -= PI;
Printf(false, " or angle = %Fi%2%E (mod 180)", theta*180/PI);
} else if(gs.n == 2 && gs.faces == 2) { } else if(gs.n == 2 && gs.faces == 2) {
Printf(false, "%FtTWO PLANE FACES"); Printf(false, "%FtTWO PLANE FACES");