[Sketcher] Distance to circle

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!
User avatar
paddle
Veteran
Posts: 1392
Joined: Mon Feb 03, 2020 4:47 pm

[Sketcher] Distance to circle

Post by paddle »

Distance/DistanceX/Y constrain currently does not accept the selection of circles.

However it would be expected to be able to make distance of a circle to a line, a circle to a point and a circle to a circle.
It's basically the same as circle mid point to line and circle mid point to point. But with minus the circle radius.

Why is it not implemented? Is it just not done or is there some mystical constraint-theory related nonsense that prevents its implementation?
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: [Sketcher] Distance to circle

Post by chrisb »

paddle wrote: Mon Jan 24, 2022 10:25 am mystical constraint-theory related nonsense
Not helpful wording.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
paddle
Veteran
Posts: 1392
Joined: Mon Feb 03, 2020 4:47 pm

Re: [Sketcher] Distance to circle

Post by paddle »

chrisb wrote: Mon Jan 24, 2022 5:03 pm Not helpful wording.
Yes sorry about that.
I kind of felt coming the comments like

"it's bad practice to make a distance to a circle and not to it's center and would encourage user to make bad decision..."
"It's useless you can already do distance to the center of the circle, you're so ignorant kiddo."
Which frustrated me in advance.
davidosterberg
Posts: 529
Joined: Fri Sep 18, 2020 5:40 pm

Re: [Sketcher] Distance to circle

Post by davidosterberg »

I think they are not implemented because it is a bit complex to implement and nobody has done it. Also because you can achieve the effect with the help of construction geometry.

I am currently working on something like this right now actually.I was originally thinking of this use case https://forum.freecadweb.org/viewtopic.php?f=3&t=49438 but I think it will generalize.
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: [Sketcher] Distance to circle

Post by GeneFC »

I use construction geometry, but I think a direct constraint would be useful.

(Don't fall out of your chair. :lol: )

Gene
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: [Sketcher] Distance to circle

Post by chrisb »

paddle wrote: Mon Jan 24, 2022 5:47 pm I kind of felt coming the comments like

"it's bad practice to make a distance to a circle and not to it's center and would encourage user to make bad decision..."
"It's useless you can already do distance to the center of the circle, you're so ignorant kiddo."
Which frustrated me in advance.
I don't think it's a bad idea, especially if it is implemented as you describe, because it will not be flipping.

But starting a topic in the first post in such a way is no good idea, as it shouts to the community to not dare to comment, and that you don't want to listen to criticism unless its hyping your idea.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
paddle
Veteran
Posts: 1392
Joined: Mon Feb 03, 2020 4:47 pm

Re: [Sketcher] Distance to circle

Post by paddle »

davidosterberg wrote: Mon Jan 24, 2022 6:12 pm I think they are not implemented because it is a bit complex to implement and nobody has done it. Also because you can achieve the effect with the help of construction geometry.

I am currently working on something like this right now actually.I was originally thinking of this use case https://forum.freecadweb.org/viewtopic.php?f=3&t=49438 but I think it will generalize.
Yes it's very similar.
How far did you went? Do you have a githug branch?
GeneFC wrote: Mon Jan 24, 2022 8:01 pm (Don't fall out of your chair. :lol: )
:D
Piero69
Posts: 473
Joined: Thu Jul 04, 2019 1:22 pm
Location: Parma - Italy

Re: [Sketcher] Distance to circle

Post by Piero69 »

i read all your suggestion and, yes, you look like a solidworks' (or ex) user.

FC schetcher has made more steps but it's still behindhand compared to SW one (you think that a basic tool as "offset" is still missing in FC schetcher). Commercial Cad as SW are designed for maximum productivity and power and all features, FC is growing up but still "amateur"
davidosterberg
Posts: 529
Joined: Fri Sep 18, 2020 5:40 pm

Re: [Sketcher] Distance to circle

Post by davidosterberg »

paddle wrote: Tue Jan 25, 2022 10:03 am Yes it's very similar.
How far did you went? Do you have a githug branch?
I have created the new constraint. It is not working yet. I have not yet looked at how to make the dimension handles be drawn in the sketch.
I have a branch in my local git repo. I will create a [WIP] PR so you can see. If you want to collaborate, perhaps you can contribute the changes that make drawing of the dimension in the sketch (since I imagine that you have figured out how that works in your other PRs)
User avatar
paddle
Veteran
Posts: 1392
Joined: Mon Feb 03, 2020 4:47 pm

Re: [Sketcher] Distance to circle

Post by paddle »

davidosterberg wrote: Tue Jan 25, 2022 11:48 am
paddle wrote: Tue Jan 25, 2022 10:03 am Yes it's very similar.
How far did you went? Do you have a githug branch?
I have created the new constraint. It is not working yet. I have not yet looked at how to make the dimension handles be drawn in the sketch.
I have a branch in my local git repo. I will create a [WIP] PR so you can see. If you want to collaborate, perhaps you can contribute the changes that make drawing of the dimension in the sketch (since I imagine that you have figured out how that works in your other PRs)
Yes please do.

On my end I played mostly with the tools creating the constraints. Which basically add a constrain using :

Code: Select all

                Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add point to line Distance constraint"));
                Gui::cmdAppObjectArgs(Obj, "addConstraint(Sketcher.Constraint('Distance',%d,%d,%d,%f)) ",
Which is a kind of python command that I don't know yet how it works. But somehow it must create a constraint in the vector :

Code: Select all

ViewProviderSketch *sketchgui->getSketchObject()->Constraints
Then if my understanding is correct, the solver needs to be able to handle the constraint type.

So you can create a distance constraint and put two circles as the parameters. It's just that the solver won't solve it. Is that right?
In which case question is : in which solver do we need to add support to this new kind of constraint ? Because if I'm not mistaken there're several solvers no?
Post Reply