Add a button to hide construction entities.

Also, mark not just curves, but also points and normals derived from
construction requests as construction.

Also, don't always mark arc center point as construction just to
exclude it from chord tolerance bounding box calculation; instead,
special-case it there.
This commit is contained in:
whitequark 2019-05-23 16:06:24 +00:00
parent e67f967933
commit 50c004b679
19 changed files with 26 additions and 14 deletions

View File

@ -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.

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 739 B

View File

@ -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()) {

View File

@ -380,6 +380,7 @@ void GraphicsWindow::Init() {
showWorkplanes = false;
showNormals = true;
showPoints = true;
showConstruction = true;
showConstraints = true;
showShaded = true;
showEdges = true;

View File

@ -145,12 +145,7 @@ void Request::Generate(IdList<Entity,hEntity> *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,hEntity> *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));

View File

@ -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;

View File

@ -161,6 +161,8 @@ static ShowHideButton normalsButton =
{ &(SS.GW.showNormals), "normal", "normals" };
static ShowHideButton pointsButton =
{ &(SS.GW.showPoints), "point", "points" };
static ShowHideButton constructionButton =
{ &(SS.GW.showConstruction), "construction", "construction entities" };
static ShowHideButton constraintsButton =
{ &(SS.GW.showConstraints), "constraint", "constraints and dimensions" };
static FacesButton facesButton;
@ -178,6 +180,7 @@ static Button *buttons[] = {
&workplanesButton,
&normalsButton,
&pointsButton,
&constructionButton,
&constraintsButton,
&facesButton,
&spacerButton,

View File

@ -768,6 +768,7 @@ public:
bool showWorkplanes;
bool showNormals;
bool showPoints;
bool showConstruction;
bool showConstraints;
bool showTextWindow;
bool showShaded;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB