B-spline Construction Project

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Hologram
Posts: 201
Joined: Thu Nov 03, 2022 3:05 pm

Re: B-spline Construction Project

Post by Hologram »

jnxd wrote: Thu Feb 09, 2023 6:38 pm I definitely want to move into surface modelling (was the target of getting into B-splines), but for now there's much to do in 2D.
It's a really big topic, but we'll see how far the journey takes us ey? ;)
jnxd wrote: Thu Feb 09, 2023 6:38 pm Our biggest conflict of ideas seems to come from the fact that I'm looking at B-splines by themselves, while you are (rightfully) looking at them as a connector between two curves. My understanding was higher degree curves tend to misbehave a lot, but if classical wisdom mentions using them I'm wrong somewhere.
Things get even more complicated, because with surface modelling, you'll be taking curves to the 3rd dimension as well (and match them with other curves/ surfaces).

So when I say worse curvature, for product design, it means worse reflections. If the reflections of the product are less smooth, it looks less nice. If you are in doubt about something, try to look it up with the correct terminology on the McNeel forums or Alias forum. For example, single span vs multi-span
Image
Here's another explanation that may help you understand the idea behind the tools (from the Alias employee): https://forums.autodesk.com/t5/alias-fo ... -p/7828578.
Last edited by Hologram on Thu Feb 09, 2023 8:21 pm, edited 5 times in total.
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: B-spline Construction Project

Post by jnxd »

@Hologram, I just skimmed your previous post, but it may take me a little while to get to it. However, at this point I should say the suggestions are straying away from the topic of this thread. A post in "open discussions" would be more appropriate. In fact, perhaps it may already exist so please check for that.
My latest (or last) project: B-spline Construction Project.
Hologram
Posts: 201
Joined: Thu Nov 03, 2022 3:05 pm

Re: B-spline Construction Project

Post by Hologram »

jnxd wrote: Thu Feb 09, 2023 7:43 pm @Hologram, I just skimmed your previous post, but it may take me a little while to get to it. However, at this point I should say the suggestions are straying away from the topic of this thread. A post in "open discussions" would be more appropriate. In fact, perhaps it may already exist so please check for that.
Yeah, I understand. I'll change the header to off-topic. In summary, I just wanted to show you how the type of curve translates to 3d and the considerations this entails. Sorry, didn't mean to hi-jack the topic, if it makes you feel like that.
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: B-spline Construction Project

Post by jnxd »

Hologram wrote: Thu Feb 09, 2023 7:52 pm
Yeah, I understand. I'll change the header to off-topic. In summary, I just wanted to show you how the type of curve translates to 3d and the considerations this entails. Sorry, didn't mean to hi-jack the topic, if it makes you feel like that.
I appreciate that. Thing is, an open discussions thread will definitely keep your ideas in better spotlight as well. It's best to keep a thread about one particular topic, otherwise, it just becomes a hot mess where multiple conversations can be going on, and tracking one becomes difficult.
My latest (or last) project: B-spline Construction Project.
Hologram
Posts: 201
Joined: Thu Nov 03, 2022 3:05 pm

Re: B-spline Construction Project

Post by Hologram »

Ah okay, I understand, I'll move it to a new Open Discussion topic, here.
User avatar
jonasb
Posts: 162
Joined: Tue Dec 22, 2020 7:57 pm

Re: B-spline Construction Project

Post by jonasb »

Personally, I find the direction 2, aka "other forms of the spline" appealing. However, not with hermitian splines, but Bézier-splines i.e. a series of cubic Bézier curves. While maybe not suited for surface design (I have no stakes in that), it offers a very intuitive way of working with the curve -- with Inkscape as a prominent example.

So having an Inkscape-like curve tool in Sketcher would be a huge benefit for my kind of work. Personally I don't care if the result is then a series of Bézier curves instead of a single B-spline.

Another thing to consider: When using a sketch as means to animate an assembly, having a single hermitian spline would be a clear advantage over a series of Bézier curves. In the former case one can use the "Map Path" parameter to smoothly move an attachment offset along the curve.
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: B-spline Construction Project

Post by onekk »

jonasb wrote: Sat Feb 11, 2023 3:47 pm ...
But B-Spline, at the very end could be thought as a series of Bezier curves.

The point is the they are interconnected and share "control points".

Or at least most explanation about B-Spline, start from Bezier and show B-Spline as an extension of Bezier curves.

Or I'm missing something?

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
jonasb
Posts: 162
Joined: Tue Dec 22, 2020 7:57 pm

Re: B-spline Construction Project

Post by jonasb »

onekk wrote: Sun Feb 12, 2023 3:26 pm But B-Spline, at the very end could be thought as a series of Bezier curves.
When you have a series of Bézier curves, the resulting spline will interpolate all those control points where the Béziers met (where end of first is start of next). I.e. those control points lay on the spline. On a B-spline, the control points do generally not lay on the curve. This is the very reason why I personally find it much more easy to edit a (cubic bézier-)spline in Inkscape than a (B-)spline in Sketcher.
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: B-spline Construction Project

Post by onekk »

jonasb wrote: Sun Feb 12, 2023 5:08 pm ...
OK guessed the point.

You are speaking about direction2.

But I don't know as you have to deal with geometries supplied by OCCT how things could be made.

But I've seen some works done by some folks, that seems to be very appealing, like "Silk WB" or some work for an old FreeCAD contributor that sadly was not around anymore, but according to some other experts on the forum he has a "very peculiar way" to code so his work is very difficult to follow, and sadly some of his work is not available anymore on the net.

Regards

Carlo D.

Post amended to clarify my though and to correct some misunderstanding, sorry for any inconvenience.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: B-spline Construction Project

Post by jnxd »

jonasb wrote: Sat Feb 11, 2023 3:47 pm Personally, I find the direction 2, aka "other forms of the spline" appealing. However, not with hermitian splines, but Bézier-splines i.e. a series of cubic Bézier curves. While maybe not suited for surface design (I have no stakes in that), it offers a very intuitive way of working with the curve -- with Inkscape as a prominent example.

...

Another thing to consider: When using a sketch as means to animate an assembly, having a single hermitian spline would be a clear advantage over a series of Bézier curves. In the former case one can use the "Map Path" parameter to smoothly move an attachment offset along the curve.
That's an interesting take. As I mentioned, it's a little more complicated so I will only start looking at this from April. But it is definitely important to decide on a good new spline representation to implement, since this is a rather large commitment.

I also appreciate the fact you also posed a counterargument to your own point. As such, you probably already know that conversion from one to the other is always possible, so we might be able to make do with one or the other.
jonasb wrote: Sat Feb 11, 2023 3:47 pm So having an Inkscape-like curve tool in Sketcher would be a huge benefit for my kind of work. Personally I don't care if the result is then a series of Bézier curves instead of a single B-spline.
An inkscape-like tool maybe already possible with macros by changing knot multiplicity. Though I am often guilty of using "macro" as a word for some magic I imagine can be automated but haven't tried it myself. Also, I don't know how the inkscape tools exactly translate to B-spline terminology, so I need to work on that.

One major sacrifice I should note here is that this tool is designed for cubic splines. So far, I have been working with arbitrary degree splines. This is of course a limitation to take up, but at the same time this may lead to missing out on items that are typically used with cubic splines but extendable to other degrees.
My latest (or last) project: B-spline Construction Project.
Post Reply