[Sketcher] snapping discussion
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
Re: [Sketcher] snapping discussion
I stand corrected then.
- adrianinsaval
- Veteran
- Posts: 5548
- Joined: Thu Apr 05, 2018 5:15 pm
Re: [Sketcher] snapping discussion
I won't question Gene's role as moderator as I feel he does a very good job, but moderators are people too so not without fault, IMO it's ok to call out someone's behavior even if they are a moderator
Re: [Sketcher] snapping discussion
I won't argue any points about my behavior, but I will comment further on the "creeping elegance".
I believe that Paddle stated there was a fairly short deadline for the first pass.
I have seen a number of projects over the years get bogged down by continuous additions. (The addon suggestion above will not be the last one.)
Make a plan, execute, and get some output. The elegance can come later.
Gene
I believe that Paddle stated there was a fairly short deadline for the first pass.
I have seen a number of projects over the years get bogged down by continuous additions. (The addon suggestion above will not be the last one.)
Make a plan, execute, and get some output. The elegance can come later.
Gene
Re: [Sketcher] snapping discussion
You are of course very right here with this very general statement. That's why I didn't say that it is not allowed to criticize a moderator. Yet I stand to my view, that a newbie should not start shooting immediately, but rather dig in the archives to see more of the whole picture. That's even what I do in such cases if I don't know the user well enough.adrianinsaval wrote: ↑Wed Feb 08, 2023 9:40 pm moderators are people too so not without fault, IMO it's ok to call out someone's behavior even if they are a moderator
If unsure a post can still be reported and then a moderator can look at it.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: [Sketcher] snapping discussion
The only thing I'll say is that it definitely was not the moment to call a moderator, the comment was nothing too serious for that. Sometimes, very short sentences without context can be interpreted as snarky even when well intended. And the history was that a previous thread on the sketcher offset started going downhill fast after one such comment. To me this is way more drama then necessary, I'm out.chrisb wrote: ↑Thu Feb 09, 2023 5:02 amYou are of course very right here with this very general statement. That's why I didn't say that it is not allowed to criticize a moderator. Yet I stand to my view, that a newbie should not start shooting immediately, but rather dig in the archives to see more of the whole picture. That's even what I do in such cases if I don't know the user well enough.adrianinsaval wrote: ↑Wed Feb 08, 2023 9:40 pm moderators are people too so not without fault, IMO it's ok to call out someone's behavior even if they are a moderator
If unsure a post can still be reported and then a moderator can look at it.
Re: [Sketcher] snapping discussion
Yes I agree, I fell regularly enough in the trap of adding more and more to a PR. Though a few times suggestions were easy to add and really made sense. So it's still ok to hear them out.
Anyway, let's not get sidetracked. I still need to find how to snap to parabolas and hyperbolas (without talking about bspline) and it seems quite difficult.
Currently for hyperbola, how to find the point on the hyperbola close to mouse pointer. I posted on stack exchange the problem in details : https://math.stackexchange.com/question ... arby-point
If it inspires someone with hyperbola knowledge
Support me on Patreon: https://www.patreon.com/FreeCadDevDiary
FreeCad Dev Diary channel:[/b] https://www.youtube.com/channel/UCGMTmJ ... NiPSSEhBHA
FreeCad Dev Diary channel:[/b] https://www.youtube.com/channel/UCGMTmJ ... NiPSSEhBHA
Re: [Sketcher] snapping discussion
The parabola snapping is solved. Big thanks to Glorious Erin who solved it on stackoverflow.
Now onto parabolas.
Now onto parabolas.
Support me on Patreon: https://www.patreon.com/FreeCadDevDiary
FreeCad Dev Diary channel:[/b] https://www.youtube.com/channel/UCGMTmJ ... NiPSSEhBHA
FreeCad Dev Diary channel:[/b] https://www.youtube.com/channel/UCGMTmJ ... NiPSSEhBHA
Re: [Sketcher] snapping discussion
Isn't this what you are looking for:
GeomCurve::closestParameter(const Base::Vector3d& point, double &u)
+
GeomCurve::pointAtParameter(double u);
That would work for all curves.
Edit: It is GeomCurve, not Geometry.
Re: [Sketcher] snapping discussion
I am redoing another PR now, so it will take me some time before I can move to this one right away.paddle wrote: ↑Tue Feb 07, 2023 8:56 pm Ok so it works as expected and it is mostly (see PR) done.
@abdullah I posted a draft PR so that you can see if the architecture match the expectations :
https://github.com/FreeCAD/FreeCAD/pull/8387
By then, your PR will be likely finished.
Remember: One feature. Just one feature at a time.
- Have your feature tested thoroughly.
- When you are finished with the functionality, read your code. Try to look for code improvements. Be critical.
Re: [Sketcher] snapping discussion
Holy moly. It works, it's so simple.
Code: Select all
double pointParam;
auto curve = static_cast<const Part::GeomCurve*>(geo);
curve->closestParameter(pointToOverride, pointParam);
pointToOverride = curve->pointAtParameter(pointParam);
Support me on Patreon: https://www.patreon.com/FreeCadDevDiary
FreeCad Dev Diary channel:[/b] https://www.youtube.com/channel/UCGMTmJ ... NiPSSEhBHA
FreeCad Dev Diary channel:[/b] https://www.youtube.com/channel/UCGMTmJ ... NiPSSEhBHA