[Sketcher] Distance to circle

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?

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.

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.

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

(Don’t fall out of your chair. :laughing: )

Gene

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.

Yes it’s very similar.
How far did you went? Do you have a githug branch?

:smiley:

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”

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 :

                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 :

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?

Nope. I have done what is needed for the solver to understand the constraint. But I have not done anything to the ViewProvider yet. I think I need to handle how the dimensional constraint should be visualized on the screen.

PR here (work in progress):
https://github.com/FreeCAD/FreeCAD/pull/5439

Looks good. I don’t know the structure of this part of the code so I’m won’t be very usefull. I know mostly how the constrain tool works up to the gui::command function.

Hi,
FYI I’m working on the implementation of the circle to circle distance constraint. The general cases and the concentric one are treat.

See https://github.com/FreeCAD/FreeCAD/pull/8745

I plane to write line to circle and point to circle too.

Distance circle-to-circle is merged. Congratulations.

chrisb

Be advised that this has been merged and now is an option, and questions will surely arise in the help forum…

Thank you abdullah and openBrain for the help with this first substantial commit I write. :slight_smile:

Nice work flachyjoe!

Waiting for it to come to the distro :smiley: .

great! unfortunately since over a month a new build is a chimera :smiley:


I have just seen that the revision number hasn’t changed, but it seems to have been updated yesterday. My version dates from the 4th of march and has revision number 32198. The same was published yesterday.

Has the problem with build system has been solved?

I remember that there were some problem in “conda build systems” that will make the build fails with newer versions of some library.

I’m using actually an adrianinsaval version for Arch Linux so I can’t use conda build and AppImages for master anymore, but I remember some error reports somewhere in the install and compile forum.

Regards

Carlo D.