Sketcher: Dashed construction geometry

My first time posting in the forum, I mostly lurk in the FreeCAD Discord server, apologies if I got anything wrong :smiley:

Most other CAD software display construction geometry sketch elements with a “dashed” appearance. This makes it easier for the eyes to notice the final shape of the sketch and just looks much better in general. And this change should now be very simple to implement since the groundwork seems to be already done with the 0.21 Sketcher “visual layers” feature. Everything on “Layer 1” is displayed dashed. So the only change required to implement this would be to create a preference that puts every construction geometry to Layer 1 by default.

Below is a screenshot of an example sketch in 0.21 (construction lines were moved to Layer 1 manually)
Screenshot_20230802_003314.png

I too would like to see this be a preference (set to the suggested layer behavior by default).

This has alrady been discussed several times. I’m glad to hear you find it easy to implement.

Kind of a rude way to respond to a newcomer to the forums, who brought a valid (non bitching) suggestion to the table. This would be highly beneficial for individuals who are color deficient.

I didn’t want to be rude and I actually don’t see where I was. If you remember the old discussions: there was never much argument against it. It was just difficult to implement, because the dashes would have been applied to all lines.

And what’s wrong with being glad to see it to be easily implemented? As far as I remember has Abdullah introduced the layers for such things (among others).

Tone and sarcasm are difficult to interpret through text. Perhaps I misread your post, my apologies.

Wouldn’t it be easy to automatically move the construction lines to that layer?
And when you make it a normal line it moves back to active layer?

I definitely agree that it would be good to use the new layers functionality and that dashed Layer 1 to introduce optional dashed construction lines. Btw. sometimes dash-dotted lines could also be useful to indicate symmetry axes.

However, it would be necessary to fix the behavior (inconsistent size) of dashed lines when zooming first:

dashed lines.png

I agree that dashed lines would be best for construction. And also perhaps a default color that is easier on the eye but that’s another discussion.

I can try to make it happen. So my suggestion is the following please comment :

  • Layer 0 is renamed Normal geometries

  • Layer 1 is renamed Construction geometries

  • Construction geometries (and internal alignment?) are automatically put in layer 1.

  • Normal geometries are automatically put in layer 0.

  • If user change from normal to construction or reverse, change the layer automatically.

  • If the user change manually the layer, let him do it without changing the type of geometry.

Then later maybe we can expand the layer system :

  • Add a ‘Layer’ taskbox in sketcher. This taskbox would have a listwidget with layers and enable users to add layers, change name and so on.

Slightly offtopic, however I believe constraints/symbols should be drawn on a nonconfigurable ‘top layer’ to avoid selection problems in crowded sketches.

Renaming them is a great idea imo, the current “Layer 0/1” names seem like a temporary thing anyway. The other items on the list seem like logical changes as well. And the future taskbox for adding and managing layers is also a great idea.

paddle As always sounds like a good idea!

I think we should consider the future in anything we do now and not do something that could paint ourselves into a corner.

In particular, noting that the zero-indexing of Constraints and reference thereof in formulas always seems to cause people difficulties, perhaps normal geometry should be on layer 1 and construction geometry on layer zero.

That might be smoother for the future, as when extra layer capability is added, it expands downwards (i.e. layer 2, 3 etc.) and if you want to do something with construction geometry, you go upwards (to layer zero).

How about external references: should they be on a separate layer too?

Concerning dashed lines (which I like): is there some control possible where the dashes will be, so that point-on-object constraints are preferably on a dash and not in the void?

A general solution to that might be difficult. If you fix the dash and void lengths, you could have three point-on-object constraints that are spaced such that one of them always falls on a void. I think it would mean recalculating the setting out of the dashes every time you add something to the line or drag it around (and with dragging, recalculate every other line that is joined to what you are dragging).


The external geometry observation is a good one. Right now you cannot move external geometry to another layer, it has to be on layer zero.

It would be good to list all current categories of ‘stuff’ and then make some rational allocation of layers. That would also include consideration of where we would put future stuff

We have:

Normal geometry
Construction geometry
External geometry
Hidden - and this is conceptually different to the above three as all or any of the three can be hidden.

You are right, and there is no need to think about it any further. It should only be taken care that the voids are not too long.

Solidworks fixes the dashed lune issue end point by using different dash.
It’s a long line then a very short then again a long.
Screenshot_20230803-101335_Firefox_1.png

:laughing: Good one! :laughing:

Sounds good. Perhaps, construction geometry should, when it is assigned to a different layer, be set to sub-layer of layer 1. So construction lines and regular geometry will always be part of the same base-layer and any layer assignments/ changes will put the geometry in sub-layers.

The advantage is:

  • You can toggle all construction geometries or normal geometries on/off from the top layer.
  • FreeCAD does the layer management for you

Optionally, you could make it so that any layer created within layer 0 for normal geometries is also added to layer 1 for construction geometries and vice versa.

External references could be on a new base layer as well.

Fusion 360 uses view dependent dash sizes. So if you zoom in, the lines will always appear the same. So if the linetype you define for construction lines has small enough dashes, they’ll remain small enough when zoomed in. There is no constraint in void problem this way.
Construction lines.gif