diff --git a/drawconstraint.cpp b/drawconstraint.cpp index b648288..a9b6c26 100644 --- a/drawconstraint.cpp +++ b/drawconstraint.cpp @@ -275,11 +275,11 @@ void Constraint::DoLineWithArrows(Vector ref, Vector a, Vector b, if(within > 0) LineDrawOrGetDistance(be, be.Plus(seg)); } - LineDrawOrGetDistance(ae, ae.Plus(arrow.RotatedAbout(gn, theta))); - LineDrawOrGetDistance(ae, ae.Plus(arrow.RotatedAbout(gn, -theta))); + LineDrawOrGetDistance(ae, ae.Plus(arrow.RotatedAbout(n, theta))); + LineDrawOrGetDistance(ae, ae.Plus(arrow.RotatedAbout(n, -theta))); arrow = arrow.ScaledBy(-1); - LineDrawOrGetDistance(be, be.Plus(arrow.RotatedAbout(gn, theta))); - LineDrawOrGetDistance(be, be.Plus(arrow.RotatedAbout(gn, -theta))); + LineDrawOrGetDistance(be, be.Plus(arrow.RotatedAbout(n, theta))); + LineDrawOrGetDistance(be, be.Plus(arrow.RotatedAbout(n, -theta))); } void Constraint::DoEqualLenTicks(Vector a, Vector b, Vector gn) { diff --git a/srf/curve.cpp b/srf/curve.cpp index 698d1cd..058402a 100644 --- a/srf/curve.cpp +++ b/srf/curve.cpp @@ -674,10 +674,14 @@ void SBezierLoopSetSet::FindOuterFacesFrom(SBezierList *sbl, SPolygon *spxyz, loopsRemaining = true; loop->tag = USED_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++) { SBezierLoop *inner = &(sbls.l.elem[j]); 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(); if(spuv.l.elem[i].ContainsPointProjdToNormal(spuv.normal, p)) { diff --git a/textwin.cpp b/textwin.cpp index dd74877..ff223c4 100644 --- a/textwin.cpp +++ b/textwin.cpp @@ -480,6 +480,22 @@ void TextWindow::DescribeSelection(void) { 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.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) { Printf(false, "%FtTWO PLANE FACES");