diff --git a/src/confscreen.cpp b/src/confscreen.cpp index 2e7b228..940a0ef 100644 --- a/src/confscreen.cpp +++ b/src/confscreen.cpp @@ -70,6 +70,10 @@ void TextWindow::ScreenChangeExportOffset(int link, uint32_t v) { SS.TW.edit.meaning = Edit::EXPORT_OFFSET; } +void TextWindow::ScreenChangeArcDimDefault(int link, uint32_t v) { + SS.arcDimDefaultDiameter = !SS.arcDimDefaultDiameter; +} + void TextWindow::ScreenChangeFixExportColors(int link, uint32_t v) { SS.fixExportColors = !SS.fixExportColors; } @@ -344,6 +348,9 @@ void TextWindow::ShowConfiguration() { Printf(false, " %Fd%f%Ll%s edit newly added dimensions%E", &ScreenChangeImmediatelyEditDimension, SS.immediatelyEditDimension ? CHECK_TRUE : CHECK_FALSE); + Printf(false, " %Fd%f%Ll%s arc default is diameter%E", + &ScreenChangeArcDimDefault, + SS.arcDimDefaultDiameter ? CHECK_TRUE : CHECK_FALSE); Printf(false, ""); Printf(false, "%Ft autosave interval (in minutes)%E"); Printf(false, "%Ba %d %Fl%Ll%f[change]%E", diff --git a/src/constraint.cpp b/src/constraint.cpp index 64e9b33..705feec 100644 --- a/src/constraint.cpp +++ b/src/constraint.cpp @@ -237,7 +237,9 @@ void Constraint::MenuConstrain(Command id) { c.type = Type::DIAMETER; c.entityA = gs.entity[0]; Entity* arc = SK.GetEntity(gs.entity[0]); - if (arc->type == EntityBase::Type::ARC_OF_CIRCLE) { + if ((arc->type == EntityBase::Type::ARC_OF_CIRCLE) + && (!SS.arcDimDefaultDiameter)) + { c.other = true; } } else { diff --git a/src/solvespace.cpp b/src/solvespace.cpp index c6ab34a..c2ea033 100644 --- a/src/solvespace.cpp +++ b/src/solvespace.cpp @@ -69,6 +69,8 @@ void SolveSpaceUI::Init() { exportScale = settings->ThawFloat("ExportScale", 1.0); // Export offset (cutter radius comp) exportOffset = settings->ThawFloat("ExportOffset", 0.0); + // Dimensions on arcs default to diameter vs radius + arcDimDefaultDiameter = settings->ThawBool("ArcDimDefaultDiameter", false); // Rewrite exported colors close to white into black (assuming white bg) fixExportColors = settings->ThawBool("FixExportColors", true); // Export background color @@ -250,6 +252,8 @@ void SolveSpaceUI::Exit() { settings->FreezeFloat("ExportScale", exportScale); // Export offset (cutter radius comp) settings->FreezeFloat("ExportOffset", exportOffset); + // Rewrite the default arc dimension setting + settings->FreezeBool("ArcDimDefaultDiameter", arcDimDefaultDiameter); // Rewrite exported colors close to white into black (assuming white bg) settings->FreezeBool("FixExportColors", fixExportColors); // Export background color diff --git a/src/solvespace.h b/src/solvespace.h index d8d7b3d..7479dd8 100644 --- a/src/solvespace.h +++ b/src/solvespace.h @@ -573,6 +573,7 @@ public: double gridSpacing; double exportScale; double exportOffset; + bool arcDimDefaultDiameter; bool fixExportColors; bool exportBackgroundColor; bool drawBackFaces; diff --git a/src/ui.h b/src/ui.h index 0895007..ac9163c 100644 --- a/src/ui.h +++ b/src/ui.h @@ -442,6 +442,7 @@ public: static void ScreenShowEditView(int link, uint32_t v); static void ScreenGoToWebsite(int link, uint32_t v); + static void ScreenChangeArcDimDefault(int link, uint32_t v); static void ScreenChangeFixExportColors(int link, uint32_t v); static void ScreenChangeExportBackgroundColor(int link, uint32_t v); static void ScreenChangeBackFaces(int link, uint32_t v);