diff --git a/file.cpp b/file.cpp index 701e021..a1a80f9 100644 --- a/file.cpp +++ b/file.cpp @@ -92,6 +92,7 @@ const SolveSpace::SaveTable SolveSpace::SAVED[] = { { 'g', "Group.predef.negateV", 'b', &(SS.sv.g.predef.negateV) }, { 'g', "Group.visible", 'b', &(SS.sv.g.visible) }, { 'g', "Group.suppress", 'b', &(SS.sv.g.suppress) }, + { 'g', "Group.relaxConstraints", 'b', &(SS.sv.g.relaxConstraints) }, { 'g', "Group.remap", 'M', &(SS.sv.g.remap) }, { 'g', "Group.impFile", 'P', &(SS.sv.g.impFile) }, { 'g', "Group.impFileRel", 'P', &(SS.sv.g.impFileRel) }, diff --git a/mouse.cpp b/mouse.cpp index e60aaff..ace4162 100644 --- a/mouse.cpp +++ b/mouse.cpp @@ -910,6 +910,9 @@ void GraphicsWindow::MouseLeave(void) { toolbarHovered = 0; PaintGraphics(); } + if(pending.operation == DRAGGING_POINT) { + ClearPending(); + } } void GraphicsWindow::SpaceNavigatorMoved(double tx, double ty, double tz, diff --git a/sketch.h b/sketch.h index 4ac9e6a..c3cb479 100644 --- a/sketch.h +++ b/sketch.h @@ -101,6 +101,7 @@ public: hGroup opB; bool visible; bool suppress; + bool relaxConstraints; bool clean; bool vvMeshClean; diff --git a/system.cpp b/system.cpp index 9cbe5a0..4711002 100644 --- a/system.cpp +++ b/system.cpp @@ -312,6 +312,13 @@ void System::WriteEquationsExceptFor(hConstraint hc, Group *g) { if(c->group.v != g->h.v) continue; if(c->h.v == hc.v) continue; + if(g->relaxConstraints && c->type != Constraint::POINTS_COINCIDENT) { + // When the constraints are relaxed, we keep only the point- + // coincident constraints, and the constraints generated by + // the entities and groups. + continue; + } + c->Generate(&eq); } // And the equations from entities diff --git a/textscreens.cpp b/textscreens.cpp index da97708..d575cd9 100644 --- a/textscreens.cpp +++ b/textscreens.cpp @@ -252,6 +252,15 @@ void TextWindow::ScreenChangeSuppress(int link, DWORD v) { SS.GenerateAll(); SS.GW.ClearSuper(); } +void TextWindow::ScreenChangeRelaxConstraints(int link, DWORD v) { + SS.UndoRemember(); + + Group *g = SK.GetGroup(SS.TW.shown.group); + g->relaxConstraints = !(g->relaxConstraints); + SS.MarkGroupDirty(g->h); + SS.later.generateAll = true; + SS.later.showTW = true; +} void TextWindow::ScreenChangeRightLeftHanded(int link, DWORD v) { SS.UndoRemember(); @@ -448,6 +457,14 @@ void TextWindow::ShowGroupInfo(void) { (!sup ? "" : "no"), (!sup ? "no" : "")); } + bool relax = g->relaxConstraints; + Printf(true, "%FtSOLVING%E %Fh%f%Ll%s%E%Fs%s%E / %Fh%f%Ll%s%E%Fs%s%E", + &TextWindow::ScreenChangeRelaxConstraints, + (!relax ? "" : "with all constraints"), + (!relax ? "with all constraints" : ""), + &TextWindow::ScreenChangeRelaxConstraints, + (relax ? "" : "no"), (relax ? "no" : "")); + if(g->type == Group::EXTRUDE || g->type == Group::LATHE || g->type == Group::SWEEP || diff --git a/ui.h b/ui.h index b8e2dc0..6821790 100644 --- a/ui.h +++ b/ui.h @@ -152,6 +152,7 @@ public: static void ScreenChangeMeshCombine(int link, DWORD v); static void ScreenChangeMeshOrExact(int link, DWORD v); static void ScreenChangeSuppress(int link, DWORD v); + static void ScreenChangeRelaxConstraints(int link, DWORD v); static void ScreenChangeRightLeftHanded(int link, DWORD v); static void ScreenChangeHelixParameter(int link, DWORD v); static void ScreenColor(int link, DWORD v); diff --git a/wishlist.txt b/wishlist.txt index 8a4ce73..733f588 100644 --- a/wishlist.txt +++ b/wishlist.txt @@ -3,6 +3,7 @@ multi-drag ----- some kind of import +filled contours for export wireframe export faster triangulation interpolating splines