[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

Re: Shapestrings in PartDesign or Sketcher

Post by davidosterberg »

hyarion wrote: Thu Jan 07, 2021 11:13 pm The problem I see with adding a feature to PD, that we're already discussing might be better to implement another way is: if we remove later, it will break users' files, and I don't think that is something we want to do. So we either need to maintain this functionality or make a way to migrate the features created when we create a better system.
agreed

hyarion wrote: Thu Jan 07, 2021 11:13 pm So if I understand your implementation davidosterberg, then it would be to remove the extrude operation and leave it with a 2d object and let the user create a pad/pocket out of the resulting shape.
Well, yes. But I think that is a waste of the users time. What he will want 99% of the time is embossed or recessed text. If he wants something else he can import an svg in Sketcher and do what he wants.

hyarion wrote: Thu Jan 07, 2021 11:13 pm It's common practise to let users choose if they want to embed fonts or not. adobe illustrator does it the same way when exporting pdf files. either way it's not you as a developer or freecad as a software that breaks any licenses, it will be the user who embeds the font that will be in trouble.
I agree. We could explore this option.
hyarion
Posts: 139
Joined: Fri Jun 26, 2020 6:08 pm

Re: Shapestrings in PartDesign or Sketcher

Post by hyarion »

davidosterberg wrote: Thu Jan 07, 2021 11:49 pm
hyarion wrote: Thu Jan 07, 2021 11:13 pm So if I understand your implementation davidosterberg, then it would be to remove the extrude operation and leave it with a 2d object and let the user create a pad/pocket out of the resulting shape.
Well, yes. But I think that is a waste of the users time. What he will want 99% of the time is embossed or recessed text. If he wants something else he can import an svg in Sketcher and do what he wants.
While I agree that you shouldn't throw in extra unnecessary steps, I also think that it's good to keep the number of tools down. Too many buttons also wastes users time trying to find the correct one. This is not a problem at the moment, but it could be later if more similar tool are added. (similar to cisc vs risc)

This type of workflow optimisation might be a good fit for an addon or macro.
chrisb
Veteran
Posts: 53785
Joined: Tue Mar 17, 2015 9:14 am

Re: [New feature] Shapestrings in PartDesign or Sketcher

Post by chrisb »

The question of embedding fonts should be discussed independently. And if they are embedded, they shure should not be embedded only here, but in Draft workbench too.

There are old discussions about that topic, I think it were legal implications which stopped following this path further.
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 »

There are strong arguments for reimplementing this in Sketcher. I can add another. Creo, SolidWorks and Fusion360 all have the text tool as part og the Sketch tools.

I am ok, with closing this one, in favor of a Sketcher based tool. Oh well. I was hoping for a quick fix and on to the next one.
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Shapestrings in PartDesign or Sketcher

Post by abdullah »

davidosterberg wrote: Thu Jan 07, 2021 10:20 pm
abdullah wrote: Thu Jan 07, 2021 8:05 pm I do not get to decide whether a PR will not be merged. I am an equal, just have worked for FreeCAD longer. You do not need to look up to me. I am here to help where I can.
We are equals as men, but due to merit your opinion holds stronger than mine here. Nothing wrong with that.
It should not be that way. I think something is wrong with that. For me the opinion/idea has the merit rather than the person proposing it. Let's debunk it with an example: I propose a new feature that requires a web camera for FreeCAD pointing to the user, and if he or she stops blinking every 5 seconds, FreeCAD will freeze. I would understand that you are of the opinion that that is nuts and a nonsense (although it may lead to better eye health). Do you honestly thing that my such opinion would hold stronger?... maybe for an add-on :lol:

We should stop judging people just because of what they have done in the past. There must be merit in the ideas. There must be weight in the arguments. One should be critical of its own ideas (and it is something I have seen you doing to your own ideas, which I find great). It is not easy to defend one's own ideas and at the same time be critical of them, as when one critisises its own, some regard them worthless without evaluation. Nevertheless, to less philosophical matters...
davidosterberg wrote: Thu Jan 07, 2021 10:20 pm
abdullah wrote: Thu Jan 07, 2021 8:05 pm You rightly point out that construction lines are used as references in several PD features, but generally it deals with the transformation itself, rather than the location of the object. If you want to argue that the line defines a transformation in the text object, I would reply it is far fetched argument.
Why far fetched? It is exacly what it is a the construction line translates into a rotation and a translation, and the length will be used to pre-select a font size. All the information in the sketch is used, 1-1 mapping.
My argument is not whether it serves its purpose. Rather whether it is appropriate. I concede that all the information is used and you have demonstrated it works.

One could modify the pad feature so that it takes a second sketch with a construction line showing the direction of padding and length instead of selecting this information from the feature task list. This is one example that purport to show that one sketch for just one line may not be the most appropriate idea. I would say that, if implemented as other tools are, you would have a drop box with some directions relating to planes or axes and some external reference which could be a datum line.
davidosterberg wrote: Thu Jan 07, 2021 10:20 pm
abdullah wrote: Thu Jan 07, 2021 8:05 pm I am not convinced that this third category responds to a natural extension or new use case. Rather, shame on me if I am wrong, to the convenience of implementation.
The principle of using the sketch as a transformation is already used by the Hole feature. It is not a new category in PD.
I have never took the time to explore this feature, so I may be substantially off here. If understood well, a sketch is intended to support several holes (several transformations). While not consistent with the rest of the tools, my guess is that this support for a plurality of transformations better justifies the use of a Sketch as base for the feature.
davidosterberg wrote: Thu Jan 07, 2021 10:20 pm
abdullah wrote: Thu Jan 07, 2021 8:05 pm Then the only disadvantage I see is that, as it is the case with primitives in general, they are not 2D shapes and the remaining tools of PD can not be leveraged on them with the flexibility that can be attained with 2D shapes. This point was raised by hyarion.
If you read further up in the thread, you will see that I initially argued for a sketch based solution. Almost identical to Hyarion's suggestion. It is therefore weird to sit on this side of the argument, :D

What was brought up by @chrisb (as I understood him) was that Text was not a natural extension of Sketcher. How ironic that this is now the argument used against having Text in PD :). None the less I agree to the benefits of having text in sketcher. I would welcome a Text tool in sketcher when that becomes available (I might even work on it). But why does it exclude Text in PD, when the feature is so close to be finished? Of course it has to be maintained, but I don't see that as a large task, in comparison to having a user friendly tool now.
Well, maybe it is not. You considered an initial idea (sketch base solution). You evaluated it and did a cost-benefit analysis. You reached an outcome (better go feature). You received feedback. You put forward the arguments used in your cost-benefit analysis. You reevaluate your position with the further feedback. It looks to me pretty much what a very reasonable person would do. For me it holds way much more intrinsic value that shouting out I am right (which thankfully is not your style).

Chrisb has a very good knowledge of what a CAD software should be and should do. He is invaluable in developing a feature... unfollowing my own advise I do look up to Chrisb :lol:

Chrisb's comment may be motivated by not finding an appropriate integration between the text tool and rest of the sketcher. Sometimes it is about finding the right integration. Something that seems inconsistent may become cool if a good integration is found.

To the latter question. You are right to point out that a Sketcher text tool does not technically exclude text in PD. As much as a cube primitive (box primitive) does not exclude a padded square/rectangle. But better not open that can of worms, as there are some users that regret the day primitives where added to PartDesign. I do not see a great code maintenance effort associated to it. If I understand other commenters, the question is rather how many tools should we end up having and whether we would consider the PD obsolete if the Sketch based on existed (or not). If (and only if) we want one tool not to confuse the user and we want the PD one obsolete when the Sketcher one appears, then we might have problem.

While I do understand the preference to have a tool "now" (and certainly it is not difficult to salivate with your screenshot for those who ever wanted to put a text in PartDesign and went the Draft-Part-PartDesign route, me included), it may make sense to make a small break to re-evaluate alternatives.
davidosterberg wrote: Thu Jan 07, 2021 10:20 pm
abdullah wrote: Thu Jan 07, 2021 8:05 pm Regarding alternatives, there are two ideas that pop-out of my mind (without having given them too much regard, to be honest):
1. Create the ability to incorporate 2D objects to PD, where the text is a 2D object. In a very bad implementation that only serves to illustrate the point a TextSketchObject is a class derived from the Sketcher::SketchObject, where the solver is nullified and you get a text at the origin (it may well be the parent class of the Sketcher Part::Part2DObject instead, not thought through).
Initial reaction is that this would be a bigger deviation from current PD. That would be something new.
Currently, my favourite option for text is "option 3" which I am still developing in my head. But I think it is worth pursuing this argument about "option 1".

Almost everytime a general idea is introduced is a ground-shaking idea because flexibility rarely comes without substantial change. I tend to look into the flexibility that a new idea can afford us. Then, the idea can be evaluated fairly with its alternatives and may win or not.
davidosterberg wrote: Thu Jan 07, 2021 10:20 pm
abdullah wrote: Thu Jan 07, 2021 8:05 pm 2. Add the ability to include text in the sketcher.
Yes, why not. As long as it can be done without adding a new switch case to every member of SketchObject.
Thanks for the hints. I will have a look when time allows.
I will try to think/produce a framework within a couple of days (I won't implement the whole feature), but the presence of this framework may help you sway your decision whether you want to pursue a pure PD solution, or you want to implement it sketcher based based on the new framework.
chrisb
Veteran
Posts: 53785
Joined: Tue Mar 17, 2015 9:14 am

Re: Shapestrings in PartDesign or Sketcher

Post by chrisb »

abdullah wrote: Fri Jan 08, 2021 6:45 am unfollowing my own advise I do look up to Chrisb :lol:
And following your own advice I can say that you are wrong! I know who I am looking up to, and that makes your statement impossible.

You are right that it isn't important who says something compared to what he says. But of course we may know from the past, to whom we should listen to, and whos arguments should be investigated thoroughly.

Both of these arguments count, by the way, also or especially for the often seen statement "product XYZ does it that way". The argument itself is worth nothing, but it is worth to investigate what is achieved with it in the other program.

Now for the topic: The idea behind my arguments is that I am all for a streamlined integration of new stuff. It should either behave like the other tools, or, if the new approach is better, the other tools should be adapted. This doesn't have to happen all at once, because that would kill most approaches immediately.

So for me the question is: What is a ShapeString really, and I admit, that I am not - or no longer - sure about it. Additionally the answer depends on how it is implemented. In the following I use "pad" as a synonyme for pad, pocket, ...

1) A ShapeString is another primitive. It has its own coordinate system which can be used for attachments. This includes the possibility to attach it to a sketch or to parts of it using edges and vertices.
Streamlining with other primitives ends when it comes to pads and pockets and friends: Unlike other primitives it can be padded as a whole, while the other primitives allow such only on flat faces.

2) A ShapeString is a set of geometric elements, more or less constrained in a certain way. This would have the same meaning as a ShapeString created in Draft workbench plus a conversion to a sketch. For such ShapeStrings no later editing of the text would be possible.

3) ShapeStrings are new primitives. This is similar to 1), with all the attachment possibilities, but such objects can offer additional possibilities

4) ShapeStrings are new geometric elements in the Sketcher. They would have at least 2 points, but could offer very well all points and lines they have. They text could be changed, which could mean, that constraints using it can become invalid. Issues similar to the topological naming have to dealt with (or not). Implementing such ShapeStrings could start with a two-reference-points solution which could be expanded to revealing more details of the geometry.
Sketches using such ShapeStrings can or cannot be padded, depending on the well known conditions for sketches.
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: Fri Jan 08, 2021 11:01 am The often seen statement "product XYZ does it that way". The argument itself is worth nothing,
1) Having some kind of shared metaphor for a CAD software helps everyone. For new users FreeCAD will feel intuitive. For long time users, it helps with transitioning to alternative softwares. With your thinking, why should all cars come with steering wheels and accelerator to the right of the brake pedal? Every car make and model could have a different system :D.
2) The commerical software have UI/UX professionals in their staff, they also are representing the state of the art in CAD software.

The argument is hardly worthless.
chrisb
Veteran
Posts: 53785
Joined: Tue Mar 17, 2015 9:14 am

Re: [New feature] Shapestrings in PartDesign or Sketcher

Post by chrisb »

Hehe, citing out of context! The second part of that paragraph is what is important - which you just proved right.
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: [New feature] Shapestrings in PartDesign or Sketcher

Post by davidosterberg »

chrisb wrote: Fri Jan 08, 2021 1:53 pm Hehe, citing out of context! The second part of that paragraph is what is important - which you just proved right.
Fair enough. I did not think you highlighted the value of standardization enough. But in my second point there is some overlap with your statement. So I apologize for misrepresenting.

Getting back to the topic, I will add another category to your list:

5. ShapeStrings are objects that don't quite fit the existing concepts in PD or Sketcher. They are elements that are needed by the user (similar to holes, helix sweeps, etc). They can go in either Sketcher or PD depending on what is more convenient.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: [New feature] Shapestrings in PartDesign or Sketcher

Post by uwestoehr »

My 2 cents:
- Draft's ShapeString is not easy to use -> the selection if the font is a nightmare on Windows and also the placement setting needs some time.
- therefore having a ShapeString in PartDesign would be nice

- to use the full features of PD, however, the feature should maybe be part of Sketcher so that the resulting sketch can be extruded or it should be possible to have it as sketcher objects that cannot be modified like a sketch (being just a fixed sketch)
- the reason is that I want to be able to extrude the Text using the Pad feature (using a direction I like) and the Loft feature (for example the upper end should be larger than the start).
Post Reply