[New feature] Shapestrings in PartDesign or Sketcher

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
davidosterberg
Posts: 529
Joined: Fri Sep 18, 2020 5:40 pm

[New feature] Shapestrings in PartDesign or Sketcher

Post by davidosterberg »

Would it not be a nice feature if Sketcher had a text feature. It would be simple to place the sketch where you want, and pad /pocket tool could be used to achieve the desired effect? All within PartDesign.

Edit:
There is now a PR (https://github.com/FreeCAD/FreeCAD/pull/4255).
Please join the discussion if this is how it should be done!
demo1.gif
demo1.gif (569.16 KiB) Viewed 5974 times
Last edited by davidosterberg on Thu Jan 07, 2021 11:53 pm, edited 2 times in total.
chrisb
Veteran
Posts: 53785
Joined: Tue Mar 17, 2015 9:14 am

Re: Shapestrings are frustrating

Post by chrisb »

On first sight this looks intriguing, but things become more difficult when going into the details, and some questions arise:

You talk about Sketcher and then about PartDesign. Where should it finally be?

If in Sketcher, it makes only sense if it does in a single step what is now done via Draft->ShapeString + ConvertToSketch. That means it is not possible to alter the text after creation.

If in PartDesign, it could be handled like a unit, similar to the Draft ShapeString, except, that it is directly placed inside of the active body.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
davidosterberg
Posts: 529
Joined: Fri Sep 18, 2020 5:40 pm

Re: Shapestrings are frustrating

Post by davidosterberg »

chrisb wrote: Wed Dec 30, 2020 11:06 am You talk about Sketcher and then about PartDesign. Where should it finally be?
My thought was Sketcher, but you are right that there is a choice to be made.
chrisb wrote: Wed Dec 30, 2020 11:06 am If in Sketcher, it makes only sense if it does in a single step what is now done via Draft->ShapeString + ConvertToSketch.
Well, it could also be made much more user friendly. It could have a nice font dialog, for example with preview.
chrisb wrote: Wed Dec 30, 2020 11:06 am That means it is not possible to alter the text after creation.
Hmm, yes. Solving that would require some changes to Sketcher.
Just dreaming here. One way to solve that would be to introduce a new geometry type in Sketcher (lets call it Text). This Text object could mostly behave like a line segment, with respect to constraining it (i.e for location). But there would also be a special text constraint, that you double click on to alter the text.

I am still brainstorming here, and have not thought deeply about how to make it happen.
chrisb
Veteran
Posts: 53785
Joined: Tue Mar 17, 2015 9:14 am

Re: Shapestrings are frustrating

Post by chrisb »

I have thought about such new text elemensts as well. But then Sketcher is rather abused for Assembly purposes than for sketching. Thus I would leave those text elements outside of Sketcher. Perhaps the new Sketcher is better suited to unify such things.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
davidosterberg
Posts: 529
Joined: Fri Sep 18, 2020 5:40 pm

Re: Shapestrings are frustrating

Post by davidosterberg »

chrisb wrote: Wed Dec 30, 2020 1:28 pm I have thought about such new text elemensts as well. But then Sketcher is rather abused for Assembly purposes than for sketching. Thus I would leave those text elements outside of Sketcher. Perhaps the new Sketcher is better suited to unify such things.
Yes, maybe you are right. And it would be painful to implement also (because of how Sketcher is implemented adding a new element type results in https://en.wikipedia.org/wiki/Shotgun_surgery, as described here: https://forum.freecadweb.org/viewtopic.php?f=10&t=53829).

Chris, I feel like I am hijacking this thread, that was about Draft ShapeString, and changing it to be about Sketcher and PartDesign and possibly a new tool there. Maybe this part of the conversation can be moved to the PD forum?
chrisb
Veteran
Posts: 53785
Joined: Tue Mar 17, 2015 9:14 am

Re: Shapestrings in PartDesign or Sketcher

Post by chrisb »

Done.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
davidosterberg
Posts: 529
Joined: Fri Sep 18, 2020 5:40 pm

Re: Shapestrings in PartDesign or Sketcher

Post by davidosterberg »

So I am starting to warm up to the idea of having the feature in PartDesign.

My idea:
- The location of the Text is controlled by a sketch. Where you have a construction line where you want the text to be, and in the orientation you like.
- You select the sketch and press the Text tool
- Now you can setup your text in a nice task dialog
- Either the end result is that the text is imprinted on support face of the sketch, or perhaps you have the option to create a pad/pocket directly from the dialog. Not sure.
chrisb
Veteran
Posts: 53785
Joined: Tue Mar 17, 2015 9:14 am

Re: Shapestrings in PartDesign or Sketcher

Post by chrisb »

I think it would fit better into the existing concept if the alignment was handled by AttachmentOffset. Then you can use, but are not obliged to use a sketch.
Furthermore it would well fit into the concept, if it is padded or pocketed separately. Otherwise you would have to duplicate all the options available - through all, up to face, reversed, symmetric, ... - as well. And perhaps you even want to revolve, sweep or loft the text.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
davidosterberg
Posts: 529
Joined: Fri Sep 18, 2020 5:40 pm

Re: Shapestrings in PartDesign or Sketcher

Post by davidosterberg »

chrisb wrote: Thu Dec 31, 2020 1:44 pm I think it would fit better into the existing concept if the alignment was handled by AttachmentOffset. Then you can use, but are not obliged to use a sketch.
Not sure if I understand this. Maybe I don't understand how the AttachmentOffset can be utilized. What would the user experience/workflow be like?
chrisb
Veteran
Posts: 53785
Joined: Tue Mar 17, 2015 9:14 am

Re: Shapestrings in PartDesign or Sketcher

Post by chrisb »

davidosterberg wrote: Thu Dec 31, 2020 6:54 pm What would the user experience/workflow be like?
Having a ShapeString and a line of a sketch I can attach the ShapeString to that line, e.g. normal to an end of the line. If I want to align it along the line, I turn it by 90°. If I want it to be in the middle, I set MapPath to 0.5. Etc.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply