diff --git a/CHANGELOG.md b/CHANGELOG.md index 49ba5b5..1bf2719 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -69,6 +69,7 @@ Other new features: * New command-line interface, for batch exporting and more. * The graphical interface now supports HiDPI screens on every OS. * New option to lock Z axis to be always vertical, like in SketchUp. + * New button to hide all construction entities. * New link to match the on-screen size of the sketch with its actual size, "view → set to full scale". * When zooming to fit, constraints are also considered. diff --git a/res/CMakeLists.txt b/res/CMakeLists.txt index b9f2e25..4c96b47 100644 --- a/res/CMakeLists.txt +++ b/res/CMakeLists.txt @@ -208,6 +208,7 @@ add_resources( icons/graphics-window/trim.png icons/graphics-window/vert.png icons/text-window/constraint.png + icons/text-window/construction.png icons/text-window/edges.png icons/text-window/faces.png icons/text-window/occluded-visible.png diff --git a/res/icons/text-window/construction.png b/res/icons/text-window/construction.png new file mode 100644 index 0000000..35ddcb2 Binary files /dev/null and b/res/icons/text-window/construction.png differ diff --git a/src/drawentity.cpp b/src/drawentity.cpp index a5f86c4..0a1d0cd 100644 --- a/src/drawentity.cpp +++ b/src/drawentity.cpp @@ -158,6 +158,7 @@ bool Entity::IsVisible() const { if(IsPoint() && !SS.GW.showPoints) return false; if(IsNormal() && !SS.GW.showNormals) return false; + if(construction && !SS.GW.showConstruction) return false; if(!SS.GW.showWorkplanes) { if(IsWorkplane() && !h.isFromRequest()) { diff --git a/src/graphicswin.cpp b/src/graphicswin.cpp index 13c2df3..7e46b4a 100644 --- a/src/graphicswin.cpp +++ b/src/graphicswin.cpp @@ -380,6 +380,7 @@ void GraphicsWindow::Init() { showWorkplanes = false; showNormals = true; showPoints = true; + showConstruction = true; showConstraints = true; showShaded = true; showEdges = true; diff --git a/src/request.cpp b/src/request.cpp index 5046c01..13a77c3 100644 --- a/src/request.cpp +++ b/src/request.cpp @@ -145,12 +145,7 @@ void Request::Generate(IdList *entity, p.h = h.entity(i+((et != (Entity::Type)0) ? 1 : 0)); p.group = group; p.style = style; - if(type == Request::Type::ARC_OF_CIRCLE && i == 0) { - // mark arc center point as construction, since it shouldn't be included - // in bounding box calculation - p.construction = true; - } - + p.construction = e.construction; if(workplane.v == Entity::FREE_IN_3D.v) { p.type = Entity::Type::POINT_IN_3D; // params for x y z @@ -172,6 +167,7 @@ void Request::Generate(IdList *entity, n.h = h.entity(32); n.group = group; n.style = style; + n.construction = e.construction; if(workplane.v == Entity::FREE_IN_3D.v) { n.type = Entity::Type::NORMAL_IN_3D; n.param[0] = AddParam(param, h.param(32+0)); diff --git a/src/solvespace.cpp b/src/solvespace.cpp index 97bb384..409c7ed 100644 --- a/src/solvespace.cpp +++ b/src/solvespace.cpp @@ -996,6 +996,14 @@ BBox Sketch::CalculateEntityBBox(bool includingInvisible) { if(e.construction) continue; if(!(includingInvisible || e.IsVisible())) continue; + // arc center point shouldn't be included in bounding box calculation + if(e.IsPoint() && e.h.isFromRequest()) { + Request *r = SK.GetRequest(e.h.request()); + if(r->type == Request::Type::ARC_OF_CIRCLE && e.h.v == r->h.entity(1).v) { + continue; + } + } + if(e.IsPoint()) { includePoint(e.PointGetNum()); continue; diff --git a/src/textwin.cpp b/src/textwin.cpp index 4ae71d6..15b10eb 100644 --- a/src/textwin.cpp +++ b/src/textwin.cpp @@ -156,28 +156,31 @@ public: static SpacerButton spacerButton; static ShowHideButton workplanesButton = - { &(SS.GW.showWorkplanes), "workplane", "workplanes from inactive groups" }; + { &(SS.GW.showWorkplanes), "workplane", "workplanes from inactive groups" }; static ShowHideButton normalsButton = - { &(SS.GW.showNormals), "normal", "normals" }; + { &(SS.GW.showNormals), "normal", "normals" }; static ShowHideButton pointsButton = - { &(SS.GW.showPoints), "point", "points" }; + { &(SS.GW.showPoints), "point", "points" }; +static ShowHideButton constructionButton = + { &(SS.GW.showConstruction), "construction", "construction entities" }; static ShowHideButton constraintsButton = - { &(SS.GW.showConstraints), "constraint", "constraints and dimensions" }; + { &(SS.GW.showConstraints), "constraint", "constraints and dimensions" }; static FacesButton facesButton; static ShowHideButton shadedButton = - { &(SS.GW.showShaded), "shaded", "shaded view of solid model" }; + { &(SS.GW.showShaded), "shaded", "shaded view of solid model" }; static ShowHideButton edgesButton = - { &(SS.GW.showEdges), "edges", "edges of solid model" }; + { &(SS.GW.showEdges), "edges", "edges of solid model" }; static ShowHideButton outlinesButton = - { &(SS.GW.showOutlines), "outlines", "outline of solid model" }; + { &(SS.GW.showOutlines), "outlines", "outline of solid model" }; static ShowHideButton meshButton = - { &(SS.GW.showMesh), "mesh", "triangle mesh of solid model" }; + { &(SS.GW.showMesh), "mesh", "triangle mesh of solid model" }; static OccludedLinesButton occludedLinesButton; static Button *buttons[] = { &workplanesButton, &normalsButton, &pointsButton, + &constructionButton, &constraintsButton, &facesButton, &spacerButton, diff --git a/src/ui.h b/src/ui.h index cc47938..0ac02b6 100644 --- a/src/ui.h +++ b/src/ui.h @@ -768,6 +768,7 @@ public: bool showWorkplanes; bool showNormals; bool showPoints; + bool showConstruction; bool showConstraints; bool showTextWindow; bool showShaded; diff --git a/test/constraint/arc_line_tangent/normal.slvs b/test/constraint/arc_line_tangent/normal.slvs index bf31033..7572139 100644 Binary files a/test/constraint/arc_line_tangent/normal.slvs and b/test/constraint/arc_line_tangent/normal.slvs differ diff --git a/test/constraint/curve_curve_tangent/arc_arc.slvs b/test/constraint/curve_curve_tangent/arc_arc.slvs index 63489c4..6b90c57 100644 Binary files a/test/constraint/curve_curve_tangent/arc_arc.slvs and b/test/constraint/curve_curve_tangent/arc_arc.slvs differ diff --git a/test/constraint/curve_curve_tangent/arc_cubic.slvs b/test/constraint/curve_curve_tangent/arc_cubic.slvs index ac2548d..4e8be1b 100644 Binary files a/test/constraint/curve_curve_tangent/arc_cubic.slvs and b/test/constraint/curve_curve_tangent/arc_cubic.slvs differ diff --git a/test/constraint/equal_line_arc_len/normal.slvs b/test/constraint/equal_line_arc_len/normal.slvs index 8d54b96..1f7869e 100644 Binary files a/test/constraint/equal_line_arc_len/normal.slvs and b/test/constraint/equal_line_arc_len/normal.slvs differ diff --git a/test/constraint/pt_face_distance/normal.png b/test/constraint/pt_face_distance/normal.png index 9e827ed..c92fc4f 100644 Binary files a/test/constraint/pt_face_distance/normal.png and b/test/constraint/pt_face_distance/normal.png differ diff --git a/test/constraint/pt_face_distance/normal.slvs b/test/constraint/pt_face_distance/normal.slvs index 8ebd152..f2fd334 100644 Binary files a/test/constraint/pt_face_distance/normal.slvs and b/test/constraint/pt_face_distance/normal.slvs differ diff --git a/test/constraint/pt_face_distance/reference.png b/test/constraint/pt_face_distance/reference.png index 69c7a05..b01d4ea 100644 Binary files a/test/constraint/pt_face_distance/reference.png and b/test/constraint/pt_face_distance/reference.png differ diff --git a/test/constraint/pt_face_distance/reference.slvs b/test/constraint/pt_face_distance/reference.slvs index 894d7dd..2d89471 100644 Binary files a/test/constraint/pt_face_distance/reference.slvs and b/test/constraint/pt_face_distance/reference.slvs differ diff --git a/test/constraint/pt_on_face/normal.slvs b/test/constraint/pt_on_face/normal.slvs index 3ef79b8..7656071 100644 Binary files a/test/constraint/pt_on_face/normal.slvs and b/test/constraint/pt_on_face/normal.slvs differ diff --git a/test/request/arc_of_circle/normal.slvs b/test/request/arc_of_circle/normal.slvs index 07417f7..aaa6b8f 100644 Binary files a/test/request/arc_of_circle/normal.slvs and b/test/request/arc_of_circle/normal.slvs differ