Draft WB: Please confirm intended behaviours

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Draft WB: Please confirm intended behaviours

Post by Roy_043 »

catman wrote: Sun Jul 31, 2022 11:33 am I can offer this rationale
The exact height of the text depends on the font and of course on the characters in the text. To get a Draft_ShapeString with an exact height you can use this workaround:
  • Create a 'dummy' ShapeString with the correct font and the correct letter combination. Maybe just use "M" for the text?
  • Create a ShapeString with the label text.
  • Set its Size to the following expression: 10 * ShapeString.Size / ShapeString.Shape.BoundBox.YLength
    Where ShapeString is the name of the dummy text object and 10 the desired exact text height.
  • Optionally: Select the faces from the last object and invoke Std_LinkMakeRelative.
Attachments
Draft_ShapeString-Exact-Height.FCStd
(20.44 KiB) Downloaded 18 times
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Draft WB: Please confirm intended behaviours

Post by Roy_043 »

thomas-neemann wrote: Mon Aug 01, 2022 10:06 am the problem with the mesh remains (for me).
Confirmed. I'll try to fix that.
User avatar
thomas-neemann
Veteran
Posts: 11800
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE 🇩🇪
Contact:

Re: Draft WB: Please confirm intended behaviours

Post by thomas-neemann »

Roy_043 wrote: Tue Aug 02, 2022 11:49 am ...
Confirmed. I'll try to fix that.
thank you very much
Gruß Dipl.-Ing. (FH) Thomas Neemann

https://www.youtube.com/@thomasneemann5 ... ry=freecad
catman
Posts: 412
Joined: Fri Jan 11, 2019 10:42 pm

Re: Draft WB: Please confirm intended behaviours

Post by catman »

Roy_043 wrote: Tue Aug 02, 2022 11:47 am
catman wrote: Sun Jul 31, 2022 11:33 am I can offer this rationale
The exact height of the text depends on the font and of course on the characters in the text. To get a Draft_ShapeString with an exact height you can use this workaround:
Thanks very much for your workaround. Its always good to have some alternatives to do things in FreeCAD.
Apologies, I should have specified text size better. It was not about a single letter, but the max height of any glyp. I measure it pratically with a very high and low letter, e.g. "Òq".


The last days I spent to find more solutions. I did not really find a way to do what I wanted with FreeCAD. TechDraw did not really work and re-reading your post I now understand you meant to create the drawing in TechDraw in the first place. This no different from using Inkscape. I need to get the 3D view to look as the final product and allow interaction between parts and artwork, e.g. render round pockets on a part. I found a way to do my parts by using Draft with the "A" tool and manually cleaning up the result in Inkscape. The 3D assembly only works from far away (bugs aside).

It seems not many gave feedback yet for using Draft to create artwork for the 3D which I find sad. Here is a list of things I found worth considering because I think Draft is the best place to have this capabiltiy. First I thought we need a new workbench like "Labeling WB" but it would have such a high overlap with Draft that I think it would be a bad choice.


If this lists sounds very negative, please be assured its not meant like that. Its just a summary list of things where I think Draft can be improved to be used more intuitive. I hope some things are minor changes and well worth the effort. The line width issue I am sure is quite major, but imho deserves discussion.
One thing I struggled with a lot were the edit modes. The wiki nor tutorials helped to resolve my confusion and it took a while to really understand the concept.I thought a lot about it and I think my suggestions can improve usability without breaking current modes. What is really excellent about these modes is the status bar texts giving really helpful info through the steps. They provide life-saving feedback that a click might have missed the expected result.

  • Move Mode (M,V) is limited to one objet and one task. (T) option allows to remove the one-task limitation, but must be set each time. (T) option should be remembererd and the help text changed to "Command will not finish this part until you press the command button again". "(M) Multiple Parts" should be added to do what (T) does plus 1 Click to another part does close Move (ESC) and open Move (M,V) for the new part. (M) option should be remembererd and the help text should say ""Command will not finish until you press the command button again". The Tool icon should be ToggleButton not PushButton showing the state.
  • Rotate mode (R,O); same as for Move
  • Edit Mode (D,E) is limited to one object. 1 Click to another object should Close(O) and select the other object (D,E). The mode is left with explicit Close (O). The Tool icon should be ToggleButton not PushButton.
  • SubElement Highlight (H,S) is limited to one object. 1 Click to another object should unselect (H,S) the current object and select (H,S) the new object. The mode is left with explicit unselect (H,S). The Tool icon should be ToggleButton not PushButton.
  • Commands "A" and "S" do very similar things, but their property views differ. They could share the following in Properties/Data: Label, Text, FontSelection or FontPath (mutually exclusive), Font height. "S" has additional Tracking and MakeFace
  • Line Width should be a Data property. To be fully backwards compatible the default should export as today and set to "Hairline" which is what you explained. Any setting in mm (or inch) should be exports in the SVG as style, e.g. "stroke-width:1mm" or "stroke-width:0.1in". In SVG that works for other objects like circle, rectangle, bslpine etc. That way the export is correct. This could be Settings/Preferences/ImportExport/SVG/ExportStyle="Translated(for print&display)"
  • Line Width could also be displayed in 3D correctly: "Hairline" is as today, any other disables "Properties/View/LineWidth" (which is px only) and renders the lines as per dimension. Observed: imported SVG with line width 5mm creates Properties/View/LineWidth=18.9 ( so the value is interpreted) but does not show as a fixed dimension.
  • Export to SVG creates multiple data with layers. Its easy to see in Inkscape/XML dialog. A text in a structure PartContainer/Layer/Sublayer appears 3 times in the SVG data: 1x in root, 1x in Layer and 1x Sublayer.
  • Export layers should be exported so that they show as "Layers" in Inkscape. Currently the are not.
  • Draft has display problem in Assemblies. Some test and lines do not appear. I need to upload a test showing this
  • Switching visibilty in some cases exclue objects (at least when layers are involved). I need to upload a test showing this
Edit: forgot one important point:
  • Box Selection Mode for selecting several parts in 3D. EDIT:solved. Its available with <Shift-B>
Sorry for the long post
Last edited by catman on Wed Aug 03, 2022 2:12 pm, edited 1 time in total.
gbParametric
Posts: 23
Joined: Wed Apr 20, 2022 9:06 pm

Re: Draft WB: Please confirm intended behaviours

Post by gbParametric »

catman wrote: Wed Aug 03, 2022 10:08 am ..
I like your suggestions, other softwares work in similar way, so it would be more intuitive for new users.
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Draft WB: Please confirm intended behaviours

Post by Roy_043 »

catman wrote: Wed Aug 03, 2022 10:08 am Move Mode (M,V) is limited to one object
That is not correct. Try pre-selecting objects:

https://wiki.freecadweb.org/Draft_Move wrote:1. Optionally select one or more objects, or one or more subelements of Draft Lines or Draft Wires.
The same goes for all other commands where you have mentioned this limitation.

catman wrote: Wed Aug 03, 2022 10:08 am(T) option allows to remove the one-task limitation, but must be set each time.
That is a known issue: https://forum.freecadweb.org/viewtopic.php?f=23&t=59520

catman wrote: Wed Aug 03, 2022 10:08 amCommands "A" and "S" do very similar things
That is not correct. Draft_Text is intended for annotation. Draft_ShapeString is not. ShapeStrings are intended as paths for further modeling operations.

catman wrote: Wed Aug 03, 2022 10:08 amBox Selection Mode for selecting several parts in 3D
That is already available: Std_BoxSelection.
catman
Posts: 412
Joined: Fri Jan 11, 2019 10:42 pm

Re: Draft WB: Please confirm intended behaviours

Post by catman »

Here is a made-up test file of a device with a front plate and simple artwork. I really like the visual impact colored 2D artwork has in the 3D view in larger scenes. :D

Try to rework the graphics to match moving the right hole 10mm upwards. Then I think the benefit of the suggested improvements is a bit more obvious.
Draft has snap points that do not adhere and no rectangle select. One change and many other lines must be corrected. The outer line should be 5mm, but its not. It will vary with distance. To get a correct line size, today each line must be replaced with a filled rectangle, each above rectangle must be replaced by 2 offset rectangles and upgraded to a face. Same for arcs, or splines. If any of those needs to change it gets quite complex. Now imagine a more realistic case with circular scales 0-10 with lines in 0.5 intervals like a volume knob on a stereo amplifier... Thats why I think outlines are no solution and real line widths are needed. As this really is a trivial example everything in there should really be only very few clicks.

TestProject.png
TestProject.png (17.65 KiB) Viewed 753 times

The file is the best way I found so far to use Draft to make things like that. I'd love to get suggestions for improvement.
You can use the project to see the disapearing lines issue (see below)

The project has 3 files. One is the assembly using Asm3 workbench. The other a dummy for a device and the third for the part with the artwork. You open the "TestFileDraftWb_Asm.FCStd" and it will load the others automatically. In the file "TestFileDraftWb.FCStd" is the PartDesign body with the artwork.
The design uses layering which 4 layers with different graphical settings like text color or line widths.

catman wrote: Wed Aug 03, 2022 10:08 am
  • Draft has display problem in Assemblies. Some test and lines do not appear. I need to upload a test showing this
  • Switching visibilty in some cases exclude objects (at least when layers are involved).
I think I found the cause of trouble I had with these. One workaround is already in the file. I cleand up all dependency errors, so the effects of the second bullet point can not be seen in the file.

First seems common: dependency graph erors. Somehow (I can not reproduce it yet) when I am editing parts they suddenly start behaving strange. Feels like they fall "off" the workplane by loosing some invisible property. At least in the dependency graph the part shows a red line. Such parts are invisible in the assmbly and they also not covered by the visibility switch with <space> (thats how I detect them). Maybe one possible cause is that I have tried to connect lines to wires. That did not quite often not work when shapes were not added. I had things like lines that were moved when I moved by moving a totally different line. Trying to recover I also used Upgrade/Downgrade a lot. Maybe somewhere there is the root cause of trouble.
However, I could repair the dependency graph issues by drag/drop them in the tree out of their layer and back. Sometimes I had to do it a few times, mostly it works directly. I think this is a very nasty bug waiting for someone to be able to fully reproduce it.


The other issue is Z-fighting. Open the "TestFileDraftWb.FCStd" file and select the proxy workplane. All artwork is gone. If you rotate the part a tiny bit its back. With zooming out the lines will vanish in the assembly view as well.
The problem is a missing z-Offset. The most natural way to define the workplane (select a face and click the workplane button) does not allow to set an offset. And its quite tedious to modiy all parts later.
The workaround I used is to put all Draw object to a Part contains. Adding here 0.1mm in Z brings the artwork back and resolves most zoom issues as well.
A imho perfect future solution could be a new feature: an optional workplane object. It would have a transformation and can be mapped or remapped like a sketch. It has a width and height and quick access to the grid properties which is bould by the width and height settings. The difference to the normal workplane is that the z-coordinate is always 0. You can not by accident loose parts outside the working plane. Its helpful when its clear that all drawing must be done in a single plane anyway. No more loosing parts to other z-levels by accident.


My suggestion would be to add information to the wiki. Maybe we should add a section "Usage".
* "strange behaviour": This was causing many issues in my files. I'd say its bugs yet, talk about how to "check the dependency graph", how to detect faulty parts and how to recover. Any other way to recover?
* "Vanishing lines": tell about obvervations, solve by "offset" and what to do to add it later. Suggests Part Container.
* SVG ougtput. List the issues (even when fixed because older versions have them)
* "line width" For people coming form othr Vector tools the info about no scaled line width

I have seen that people became quite upset by me just adding content, so I mostly stopped it (I'm aware my text are longer than most). So I am prepared to wite somthing, but Draft WB people, please say if you have special wishes, Won't write without comments.
Attachments
TestFileDraftWb.zip
(124.09 KiB) Downloaded 15 times
catman
Posts: 412
Joined: Fri Jan 11, 2019 10:42 pm

Re: Draft WB: Please confirm intended behaviours

Post by catman »

Roy_043 wrote: Wed Aug 03, 2022 12:28 pm
catman wrote: Wed Aug 03, 2022 10:08 am Move Mode (M,V) is limited to one object
That is not correct. Try pre-selecting objects:
Well, it is :) . What you mean is to move multiple objects at the same time. that works. I mean to move different objects one after the other. Try the file "TestFileDraftWb.FCStd" and make one line in the center (with the dot) say 10mm longer. You have to move everything aound it, but each in a different direction. Thats what I mean.

Roy_043 wrote: Wed Aug 03, 2022 12:28 pm
catman wrote: Wed Aug 03, 2022 10:08 amCommands "A" and "S" do very similar things
That is not correct. Draft_Text is intended for annotation. Draft_ShapeString is not. ShapeStrings are intended as paths for further modeling operations.
I do not see a contradiction. Functionally they both to the same: provide text output. Obviously you can do different things with it depending what input your next part of the pipeline needs. For some uses you can use either one. Technically, one outputs the TTS paths, the other leaves that to the renderer (either Coin or Inkscape if its exported). But the resulting text dimensions should still be the same if your inputs are the same. And since i was talking about the inputs, I think its not relevant if their output mode differs, is it? Or do you mean the consequence of people doing different things with it resulted in putting the font select property by design in one case in View and in the other case in Data?

Roy_043 wrote: Wed Aug 03, 2022 12:28 pm
catman wrote: Wed Aug 03, 2022 10:08 amBox Selection Mode for selecting several parts in 3D
That is already available: Std_BoxSelection.
Thats cool, thanks, did not know that. Just noted some WBs have it other not. We should add that to the Wiki for sure.
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Draft WB: Please confirm intended behaviours

Post by Roy_043 »

catman wrote: Wed Aug 03, 2022 1:32 pm Try to rework the graphics to match moving the right hole 10mm upwards.
I see only one problem: because of the nesting in a Std_Part, Std_BoxSelection cannot be used. So you have to select 10 objects individually. These can be moved in a single move operation. All that then remains is to lengthen the vertical line between the black circles and perhaps shorten the rightmost vertical line. Select them both, call Draft_Edit, and manipulate the desired nodes. Pretty simple and straightforward I think.

catman wrote: Wed Aug 03, 2022 1:32 pmDraft has snap points that do not adhere
Don't know what you mean here. AFAICT snapping works.

catman wrote: Wed Aug 03, 2022 1:32 pm My suggestion would be to add information to the wiki. Maybe we should add a section "Usage".
Yours is really a corner application of FreeCAD and much of what you say there is not related to the Draft Workbench (with the exception of SVG export). Maybe creating a tutorial is more suitable?

catman wrote: Wed Aug 03, 2022 2:11 pmI mean to move different objects one after the other.
That would be problematic in terms of pre-selection. Note that there is a keyboard shortcut.

catman wrote: Wed Aug 03, 2022 2:11 pmBut the resulting text dimensions should still be the same if your inputs are the same.
One of the issues is that these objects are based on different 3rd party software components.

catman wrote: Wed Aug 03, 2022 2:11 pmJust noted some WBs have it other not.
Box selection is available in all workbenches.
catman
Posts: 412
Joined: Fri Jan 11, 2019 10:42 pm

Re: Draft WB: Please confirm intended behaviours

Post by catman »

Roy_043 wrote: Wed Aug 03, 2022 3:56 pm
catman wrote: Wed Aug 03, 2022 1:32 pm Try to rework the graphics to match moving the right hole 10mm upwards.
I see only one problem: because of the nesting in a Std_Part, Std_BoxSelection cannot be used. So you have to select 10 objects individually. These can be moved in a single move operation. All that then remains is to lengthen the vertical line between the black circles and perhaps shorten the rightmost vertical line. Select them both, call Draft_Edit, and manipulate the desired nodes. Pretty simple and straightforward I think.
I was trying to give your a simple example of tasks that can not be done in a single groupe operation. Maybe I did not take the time to select a better one. :cry: The point I am trying to make - and I so not seem to get the point across - is that its not the best usabilty to do_ "M,V click-click-click O, "M,V click-click-click O", "M,V click-click-click O", "M,V click-click-click O", "M,V click-click-click O" if you just want to touch 25 different places in a design. As you say below this is problematic in terms of pre-selections. Yes. that is exactly what I mean: there are use cases when pre-selection is not the answer. But if you read carefully my suggestions again, my suggestion is about how this can be solved. Its very similar to what you have implemented with the T option.
Roy_043 wrote: Wed Aug 03, 2022 3:56 pm
catman wrote: Wed Aug 03, 2022 2:11 pmI mean to move different objects one after the other.
That would be problematic in terms of pre-selection. Note that there is a keyboard shortcut.
The proposal would just make this possible.

Roy_043 wrote: Wed Aug 03, 2022 3:56 pm
catman wrote: Wed Aug 03, 2022 1:32 pmDraft has snap points that do not adhere
Don't know what you mean here. AFAICT snapping works.
Many tools (e.g. power point) have snap and they work permanent. Its like a temporary wire. Snap a circle to a line and drag the line and you will move line and circle without the need to select both. That works with any number of parts. This is what I meant.
Roy_043 wrote: Wed Aug 03, 2022 3:56 pm
catman wrote: Wed Aug 03, 2022 1:32 pm My suggestion would be to add information to the wiki. Maybe we should add a section "Usage".
Yours is really a corner application of FreeCAD and much of what you say there is not related to the Draft Workbench (with the exception of SVG export). Maybe creating a tutorial is more suitable?
May be. But that would be a reason to not do a tutorial but only some small notes.

Roy_043 wrote: Wed Aug 03, 2022 3:56 pm
catman wrote: Wed Aug 03, 2022 2:11 pmBut the resulting text dimensions should still be the same if your inputs are the same.
One of the issues is that these objects are based on different 3rd party software components.
Yes. but the way TTS letters are converted to paths is a standard. So the result is the same? Does that mean you think its a bad idea to move the font setting to the same place?
Post Reply