[Arch/Draw/TechDraw] global style presets for line styles/patterns/weights, ways to improve

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
User avatar
doia
Posts: 251
Joined: Sat May 29, 2021 5:47 am
Location: Düsseldorf

[Arch/Draw/TechDraw] global style presets for line styles/patterns/weights, ways to improve

Post by doia »

I don’t know where to put this, so here is my Question: How to implement a preset system to individually set and change line styles, line patterns and line weights globally on the base FC app?

The current setup is IMHO cumbersome and leads to a slow workflow. And is not consisted throughout the app and across different workbenches:

- Set line definitions within Preferences -> Draft -> Visual Setting, but restricted to 3 line types with not easy to understand SVG line style definitions
- Load external line width group definition from Preferences -> TechDraw -> General which points to a LineGroup.csv file, only whiten this file is a description, how this affects line appearance
- Choose different line types for annotation within Preferences -> TechDraw -> Annotation, but restricted to 5 line types without possibility to customize
- Draft -> Style Setting dialog (which is only accessible via the menu line, no symbol in the tool bars) uses pixel instead of mm/inch and is restricted to 4 line patterns

Coming from Revit and AutoCad I’m used to define this either via layers and color settings or via a Line Style Manager:

Revit
- define custom line styles which are constructed from line weight, color and pattern
- line patterns can be individually set with a defined order of dash, dot and space
- line weights are set dependent on scale of the view, here complex and very fine grained steps are possible
- line color is a WYSIWYG process with a standard color choose, which also is able to save color presets (but somewhat limited)

AutoCad
- line patterns defined with a .lin file, e.g. acadiso.lin file
- single line patterns are loaded int to program via the Line Type Manager which also shows a preview
- color ans line weight are defined with the layer the line is on (by layer) but can be set individually as well

I would envision a FC globally system to manage line style presets, which then can be applied to whatever line just by picking the preset. And which could form a basis for line styles used by dimensions and annotations, display properties of lines within the 3D view.

- global setting for line patterns, line style
- ability to use external easy to understand definition files or SVG line patterns, but also ability to define within FC with a preview
- use weight based on view and printed paper result, e.g. if a line width is set to 0,25mm that would be the resulting line weight on a TechDraw paper
- use characters or numbers within a line, e.g. for a —x— line
- Maybe implement a Line Thickness visibility setting thin the app -> show only then lines or display line thickness as defined by line style

So, where would such a system best implemented code wise (App/Base/GUI?, not in Mod obviously)? What are your thoughts on this?

line style presets_FreeCAD-Revit-Autocad_menues.jpg
line style presets_FreeCAD-Revit-Autocad_menues.jpg (862.9 KiB) Viewed 2800 times
User avatar
thomas-neemann
Veteran
Posts: 11800
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE 🇩🇪
Contact:

Re: [Arch/Draw/TechDraw] global style presets for line styles/patterns/weights, ways to improve

Post by thomas-neemann »

doia wrote: Wed Sep 29, 2021 11:33 am
i am of the opinion that line widths and 2d drawings no longer have much significance in a 3d bim system. i often see the requirement to also produce 2d drawings for a 3d model, i am of the opinion that this is double work, then one can also do 3d omitting.
Gruß Dipl.-Ing. (FH) Thomas Neemann

https://www.youtube.com/@thomasneemann5 ... ry=freecad
User avatar
doia
Posts: 251
Joined: Sat May 29, 2021 5:47 am
Location: Düsseldorf

Re: [Arch/Draw/TechDraw] global style presets for line styles/patterns/weights, ways to improve

Post by doia »

@thomas thank you for your comment, but this is not the point and not very helpful. :roll: I'm sure there are lots of FreeCAD users (including me) who use lines in the TechDrawWB or DraftWB, who even use dimensions which are based on lines, or even use lines to represent the edges of a 3D body (at least the FC system does). Please do not hijack this thread for a rather opinion based discussion off topic.

I think lines and their representation styles are a fundamental function within a CAD system, be it 2D or 3D. And I think FC could use a system wide unified method to handle those lines and their pattern/color/width/styles. the question is, how to approach such an implementation the best way.
User avatar
thomas-neemann
Veteran
Posts: 11800
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE 🇩🇪
Contact:

Re: [Arch/Draw/TechDraw] global style presets for line styles/patterns/weights, ways to improve

Post by thomas-neemann »

doia wrote: Thu Sep 30, 2021 7:50 am ..... the question is, how to approach such an implementation the best way.
basically anyone can make changes to an open source system. or you can have it changed if you cannot program yourself.
Gruß Dipl.-Ing. (FH) Thomas Neemann

https://www.youtube.com/@thomasneemann5 ... ry=freecad
paullee
Veteran
Posts: 5097
Joined: Wed May 04, 2016 3:58 pm

Re: [Arch/Draw/TechDraw] global style presets for line styles/patterns/weights, ways to improve

Post by paullee »

In fact, making a well thought out and structured proposal is a good contribution.

Those who code can work on programming issues :D
User avatar
thomas-neemann
Veteran
Posts: 11800
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE 🇩🇪
Contact:

Re: [Arch/Draw/TechDraw] global style presets for line styles/patterns/weights, ways to improve

Post by thomas-neemann »

paullee wrote: Thu Sep 30, 2021 1:07 pm
I'm curious whether someone feels like doing such a huge task and whether it will be better in the end or whether many new bugs will arise
Gruß Dipl.-Ing. (FH) Thomas Neemann

https://www.youtube.com/@thomasneemann5 ... ry=freecad
paullee
Veteran
Posts: 5097
Joined: Wed May 04, 2016 3:58 pm

Re: [Arch/Draw/TechDraw] global style presets for line styles/patterns/weights, ways to improve

Post by paullee »

It's opensource. @vocx earlier also refactor the whole Draft workbench coding style :D
User avatar
doia
Posts: 251
Joined: Sat May 29, 2021 5:47 am
Location: Düsseldorf

Re: [Arch/Draw/TechDraw] global style presets for line styles/patterns/weights, ways to improve

Post by doia »

OK, here is my UX proposal. Ideas for the code side implementation approach follows.

The new feature would add a new Toolbar to the Standard App. Here one would manage all FC App wide preset setting. This would include line styles, line patterns and on a later stage maybe dimension styles, text styles, material styles and so on. In short any content which could be used across different work benches and which have the potential to be stored as presets.

For line patterns there would be an icon in the new Toolbar which opens a new dialog window Line Pattern Manager as an overlay. Overlay as this would make it clear to the user that he enters a separate workflow, which does interrupts the work on the model itself.

The user would see a list of available line patterns. A set of default line patterns could be included within each new FCStd file, but line patterns could also be deleted from a file, to strip it to the bare minimum. Only the Continous line as a standard could not be deleted.

new toolbar for presets with line pattern manager dialog window as overlay
new toolbar for presets with line pattern manager dialog window as overlay
211001_proposal_line pattern manager_mock-up_1.jpg (357.13 KiB) Viewed 2370 times

When a line pattern is selected in the list, options to edit the properties of this pattern become visible on the side. I would see the list of line patterns and the edit dialog in the same window as to minimize the switching between different dialog windows.
Line patterns then could be defined by a list of dashes/dots/spaces/maybe even utf-8 characters and a value for their respective length.

line pattern manager dialog to edit line pattern properties
line pattern manager dialog to edit line pattern properties
211001_proposal_line pattern manager_mock-up-2.jpg (387.78 KiB) Viewed 2370 times

So, that's my first idea. Let me know what you think.

I now need to read some source code to find the best way where to store line pattern definitions within a .FCStd file.
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: [Arch/Draw/TechDraw] global style presets for line styles/patterns/weights, ways to improve

Post by carlopav »

My 2 cents.
Since this proposal is not related only to Draft, Arch, Bim, you should better post it to "Open Discussion". If you agree, maybe @paullee could move the topic.

For my own sensibility and workflow the improvement you propose is really interesting, BUT:
- take into account that FreeCAD is modular, so how a global parameter is then used inside a workbench at the end only rely on the workbench implementation; for example consider what happened with Std::Part that was introduced in FC 0.17, it's still not completely supported in Draft and many people when I started working on supporting it in Draft did not even think that it was something mandatory to support.
- you have to convince the developers of at least 2 very different modules to merge the change and to adapt their code (or you can do it but you have to deal with both python and c++, and at the end should be accepted by them).
- you will have to provide backward compatibility for the objects (since i doubt this can be reached without modifying them);
- what you propose will modify the core: there could be opposition by all the people that do not care about visual style because for example they do not use them and will have a new toolbar that they do not need in the core (FEMers, Pathers, pure PartDesigners).
- there are tons of users that as soon as they hear the word Draft, they start shivering (there are several posts of complaints about they can't get rid of the grid and so...).
- I do not know if things like visual style really apply fully to 3d modelling, for example in BIM many times you could want to override the representation stile of the object to analize some properties of the model (this does not mean what you propose is less useful, but narrow its field of interest).

All in all I'm not discouraging you to try, and I also hope you can succeed, but at least make sure you will have fun trying!

feel free to ask if you need some advices on the code ;)

EDIT: Perhaps you could start with a super light implementation...
follow my experiments on BIM modelling for architecture design
paullee
Veteran
Posts: 5097
Joined: Wed May 04, 2016 3:58 pm

Re: [Arch/Draw/TechDraw] global style presets for line styles/patterns/weights, ways to improve

Post by paullee »

doia wrote: Wed Sep 29, 2021 11:33 am - Set line definitions within Preferences -> Draft -> Visual Setting, but restricted to 3 line types with not easy to understand SVG line style definitions
...
- Draft -> Style Setting dialog (which is only accessible via the menu line, no symbol in the tool bars) uses pixel instead of mm/inch and is restricted to 4 line patterns
carlopav wrote: Fri Oct 01, 2021 4:01 pm Since this proposal is not related only to Draft, Arch, Bim, you should better post it to "Open Discussion". If you agree, maybe @paullee could move the topic.
OK, the discussion is far beyond my comprehension, trying to move to Open Discussion :)

Done!
Post Reply