Sketcher: Bezier curves

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Sketcher: Bezier curves

Post by NormandC »

I can also live with visible circles if it means having BSplines in the Sketcher as opposed to no BSpline at all. :D

Really, a button to toggle the visibility of the circles (if it's doable) would quite easily assuage my cleanliness issues. :lol:

I'll try to get some time aside to test this!
DeepSOIC wrote:Weight control in Sketcher BSplines can easily become a big feature point for FreeCAD.
Agreed, since as I wrote I think at least the mid-range commercial CAD software I know about don't have this.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Sketcher: Bezier curves

Post by triplus »

My first impression was things could easily get over-complex. But seeing how easy it has become to grasp the concept behind poles/weights in sketcher i feel it would be a shame if we wouldn't go after more. That is if @abdullah is preprepared to implement more of everything. As usually when you are confronted with some task you need to do you usually end up in a position where you need it all. :!:
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Sketcher: Bezier curves

Post by abdullah »

DeepSOIC wrote:Not something to become obsessed with! I very much like how you went straight into the most comprehensive BSpline support. Weight control in Sketcher BSplines can easily become a big feature point for FreeCAD.
Once upon a time, there was a Russian guy who gave the Sketcher solver a most generic tangency support by adding a not very widely known "Angle via point" constraint (yeah that strange thing that you can constraint an angle with a selection of three elements almost nobody knows about). Half angle, half tangency, half perpendicular (yes 3 halves, you can normalize later), apart from driving crazy other developers at first, this constrain forces every developer wanting to support a new type to write a function to return the normal at a point of the curve, and in return provides seamless tangency support among any supported curve. This is indeed FreeCAD's Sketcher core of complex tangencies/perpendicularities (e.g. arc of parabola to whatever).

Today, thanks to this, and for non-periodic BSplines with proper endpoint multiplicity, without almost writing any code, we get endpoint tangency of whatever to BSpline without any De Boor recursion or else:
bspline-endpoint-tangency.png
bspline-endpoint-tangency.png (13.98 KiB) Viewed 1328 times
For this, which I am sure will be very useful in the introduction of simple but powerful BSpline support and for your long term service to FreeCAD's Sketcher, I am honored to give you DeepSOIC, the highest award of FreeCAD's Sketcher, the BSpline-tangent-to-parabolic-arc-tangent-to-ellipse-arc-tangent-to-hyperbola-arc award (so that if you wish, you constrain its 18 DoF to shape it as you wish). Thanks for this gem.
sketcher-tangency-prize-DeepSOIC.png
sketcher-tangency-prize-DeepSOIC.png (19.72 KiB) Viewed 1328 times
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Sketcher: Bezier curves

Post by microelly2 »

triplus wrote:My first impression was things could easily get over-complex. But seeing how easy it has become to grasp the concept behind poles/weights in sketcher i feel it would be a shame if we wouldn't go after more. That is if @abdullah is preprepared to implement more of everything. As usually when you are confronted with some task you need to do you usually end up in a position where you need it all. :!:
I see a wide field of possibilities
I have done a demo for hyperboloids for a german forum thread
and I see the great power to design when the ribs(yellow area) and the backbone(pink area) are filled by sketcher bsplines.

https://youtu.be/P9m6O2fHbqs
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Sketcher: Bezier curves

Post by NormandC »

abdullah wrote:a most generic tangency support by adding a not very widely known "Angle via point" constraint (yeah that strange thing that you can constraint an angle with a selection of three elements almost nobody knows about).
Wait. What? :?

I'll be damned. Never knew this was possible :D (I see it was added to the wiki, I hadn't noticed :oops: )
abdullah wrote:I am honored to give you DeepSOIC, the highest award of FreeCAD's Sketcher, the BSpline-tangent-to-parabolic-arc-tangent-to-ellipse-arc-tangent-to-hyperbola-arc award
Might be a tiny bit long to write on the bronze plaque :lol:
microelly2 wrote:To get an idea whats behind weights and knots
https://youtu.be/H-_XNOpCQb4
Thanks for the video!
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Sketcher: Bezier curves

Post by DeepSOIC »

abdullah wrote:, I am honored to give you DeepSOIC, the highest award of FreeCAD's Sketcher, the BSpline-tangent-to-parabolic-arc-tangent-to-ellipse-arc-tangent-to-hyperbola-arc award (so that if you wish, you constrain its 18 DoF to shape it as you wish).
What a nice birthday present I just got :mrgreen:

That reminds me about the need to upgrade this system to support arbitrary point on BSpline, not just endpoints. That's going to be a big adventure.
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Sketcher: Bezier curves

Post by microelly2 »

NormandC wrote:
abdullah wrote:I am honored to give you DeepSOIC, the highest award of FreeCAD's Sketcher, the BSpline-tangent-to-parabolic-arc-tangent-to-ellipse-arc-tangent-to-hyperbola-arc award
Might be a tiny bit long to write on the bronze plaque :lol:
We should design a ring with this long word using the "Macro Circular Text" extension "Macro Helix Text" and then transform it as a Nurbs to fit the finger mesh of DeepSOIC. :ugeek:
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Sketcher: Bezier curves

Post by abdullah »

microelly2 wrote: I see a wide field of possibilities
I have done a demo for hyperboloids for a german forum thread
and I see the great power to design when the ribs(yellow area) and the backbone(pink area) are filled by sketcher bsplines.

https://youtu.be/P9m6O2fHbqs
You do cool things! Very nice video.
NormandC wrote:Wait. What? :?

I'll be damned. Never knew this was possible :D (I see it was added to the wiki, I hadn't noticed :oops: )
Well, if I had to bet, I would have said you were one of those who knew about it... after this my expectations of who actually knows about this are coming down a lot :lol:
NormandC wrote:Might be a tiny bit long to write on the bronze plaque
We may put BStPAtEAtHA (actually it is odd that it can more or less be pronounced)...
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Sketcher: Bezier curves

Post by triplus »

DeepSOIC wrote:What a nice birthday present I just got :mrgreen:
Happy birthday.
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Sketcher: Bezier curves

Post by abdullah »

DeepSOIC wrote:What a nice birthday present I just got
Happy birthday!
DeepSOIC wrote: That reminds me about the need to upgrade this system to support arbitrary point on BSpline, not just endpoints. That's going to be a big adventure.
Is notthat what you already did (with the help of a point, which is point on object on the curve)?. The problem is that I can not write the CalculateNormal for the whole curve without undue burden and I do not need it for STAGE 1 anyway.
microelly2 wrote:We should design a ring with this long word using the "Macro Circular Text" extension "Macro Helix Text" and then transform it as a Nurbs to fit the finger mesh of DeepSOIC.
ehhh, that sounds like a much better idea than the short form...
Post Reply