B-Spline Constraints: Fully Funded! Thanks everybody!

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!
Post Reply
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: B-Spline Constraints: Looking for Crowdfunding

Post by jnxd »

CODING UPDATE: 08 September 2022

Not a Saturday, but there have been some significant developments this week, so an early coding update.

I'm pleased to announce that "Stage 1" of the project is complete! With recent changes, knot constraints now work on rational B-splines.

phpBB [video]


I invite you to try making some things with this now and give your opinions on the experience. Some concerns include, but aren't limited to:
  1. How responsive is Sketcher now? I kind of cheated in the above image in that there was only one degree of freedom, so dragging the weights was fairly smooth. With more degrees of freedom expect something like this (with 24 DOFs):
    phpBB [video]
    .
  2. Does dragging things around change too many things? One of the biggest advantages of B-splines is their local support, which in simple terms means that changing some part of the B-spline can be done without changing the entire spline. Before knot constraints, this was the case.
    phpBB [video]

    However, as you can see in the previous clip, dragging the pole weight is changing everything else as well. Of course this won't happen if we constrain things first, but are there users who could use this level of freedom?
  3. How well does this fulfill your use case? Being able to constrain knots is already quite powerful, but are there use cases still not fulfilled with it? For example, do you need tangency at knots?
As a reminder, you can test the feature now by building from the relevant branch on my fork, or Linux users can install the snap following these instructions.

What next?

So now that Stage 1 is completed, the next steps depend on user feedback. I was hoping to be ready with the required expressions for point-on-curve constraint by now, but unfortunately that's not the case. Meanwhile, tangency at knots seems almost certainly straightforward, so I could make it a "Stage 1.5". Lastly, I could instead go on a totally different direction and try to study the internals of the solver to see if it can be made more responsive and localized. This last idea is probably best discussed with @abdullah whenever he's back, since he created the solver.
Last edited by jnxd on Thu Sep 08, 2022 9:25 am, edited 1 time in total.
My latest (or last) project: B-spline Construction Project.
keithsloan52
Veteran
Posts: 2756
Joined: Mon Feb 27, 2012 5:31 pm

Re: B-Spline Constraints: Looking for Crowdfunding

Post by keithsloan52 »

How adaptable is this implementation?

I am thinking on the lines of :-
1) Could some elements of the code be used to edit 2D Bezier Curves in the Curves workbench?
2) Editing Curved Surface, Maybe two windows displaying 2D curves and a third displaying the 3D Surface formed from the 2D curve sections.
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: B-Spline Constraints: Looking for Crowdfunding

Post by jnxd »

keithsloan52 wrote: Thu Sep 08, 2022 7:54 am How adaptable is this implementation?

I am thinking on the lines of :-
1) Could some elements of the code be used to edit 2D Bezier Curves in the Curves workbench?
2) Editing Curved Surface, Maybe two windows displaying 2D curves and a third displaying the 3D Surface formed from the 2D curve sections.
The solver "planeGCS" itself is solely designed for 2D, so extension to 3D could be rather difficult. But if we have a 3D solver and we wanted to constrain a knot on the surface, that should be possible. The constraint would have to be reimplemented, but it should be more straightforward now.

Unfortunately I don't see how knot constraints relate to the points you mention.

1) Could you elaborate more on this? I haven't worked with Curves WB, but if the curves can be loaded into sketcher they can be edited. Working with Bezier curves is kind of a different paradigm for splines, which I haven't started working with. AFAICT, with Bezier splines, we can connect individual curves end to end and impose continuity at those connections. Those connections are exactly "knots" when seen through a B-splines perspective.

2) Are you talking of connecting between two 2D curves with a 3D surface?
My latest (or last) project: B-spline Construction Project.
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: B-Spline Constraints: Looking for Crowdfunding

Post by jnxd »

By the way, there are a few things I'd like to get going while waiting for feedback.

1. Someone on twitter suggested an appimage. We already have an automated snap build system ready, but installing those needs snap. Appimages, on the other hand, are a download and run solution. I need to learn how to make that. Bonus points for Windows builds.
2. Some UI improvements. It may be better to show knots, poles etc. with different colors or icons. I'm not a designer though, so I can't do this by myself. I had started a discussion here if anyone wants to get involved.
My latest (or last) project: B-spline Construction Project.
keithsloan52
Veteran
Posts: 2756
Joined: Mon Feb 27, 2012 5:31 pm

Re: B-Spline Constraints: Looking for Crowdfunding

Post by keithsloan52 »

jnxd wrote: Thu Sep 08, 2022 8:14 am
keithsloan52 wrote: Thu Sep 08, 2022 7:54 am How adaptable is this implementation?

Unfortunately I don't see how knot constraints relate to the points you mention.
The solver and constraints would NOT but I assume the Sketch work bench can at least work with Splines and you can alter the shape by dragging the control points ?

I started work on the ImportNURBS workbench to be able to import 3DM files i.e. from Rhino etc.The curves end up as TopoShapes

Now I have asked about what I would have to do to make these editable in the Curves Workbench but it seems all the Work benches involved
with various curves offer facilities to create but NOT edit. I am given various lines of technical problems but it seem to me the sketch workbench does not have such problems.
1) Could you elaborate more on this? I haven't worked with Curves WB, but if the curves can be loaded into sketcher they can be edited.
Don't really want to load into sketcher want a API that I can implement editing 2D curves by dragging control points
2) Are you talking of connecting between two 2D curves with a 3D surface?
If one could program editing a 2D curve, then I wonder if editing a 3D curve could be achiedved by 2 x 2D windows where control points can be dragged and a 3rd window where a 3D surface made from the 2D curves could be displayed.

But all would require access to an API to such things
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: B-Spline Constraints: Looking for Crowdfunding

Post by jnxd »

keithsloan52 wrote: Thu Sep 08, 2022 9:27 am
The solver and constraints would NOT but I assume the Sketch work bench can at least work with Splines and you can alter the shape by dragging the control points ?
So, thing is sketcher workbench is inherently tied to the solver. However I think you don't need sketcher if all you need to do is move control points. If you also want to maintain continuity, however, that's a different issue.
I started work on the ImportNURBS workbench to be able to import 3DM files i.e. from Rhino etc.The curves end up as TopoShapes

Now I have asked about what I would have to do to make these editable in the Curves Workbench but it seems all the Work benches involved
with various curves offer facilities to create but NOT edit. I am given various lines of technical problems but it seem to me the sketch workbench does not have such problems.
Could you point to where these problems are described?
1) Could you elaborate more on this? I haven't worked with Curves WB, but if the curves can be loaded into sketcher they can be edited.
Don't really want to load into sketcher want a API that I can implement editing 2D curves by dragging control points
See above.
2) Are you talking of connecting between two 2D curves with a 3D surface?
If one could program editing a 2D curve, then I wonder if editing a 3D curve could be achiedved by 2 x 2D windows where control points can be dragged and a 3rd window where a 3D surface made from the 2D curves could be displayed.

But all would require access to an API to such things
Note that for 3D the complexity does not add but multiplies. So if there are n poles in one direction and m poles in the perpendicular direction, the surface would have n*m poles.
My latest (or last) project: B-spline Construction Project.
keithsloan52
Veteran
Posts: 2756
Joined: Mon Feb 27, 2012 5:31 pm

Re: B-Spline Constraints: Looking for Crowdfunding

Post by keithsloan52 »

jnxd wrote: Thu Sep 08, 2022 10:00 am
Could you point to where these problems are described?
https://github.com/tomate44/CurvesWB/issues/59
2) Are you talking of connecting between two 2D curves with a 3D surface?
Note that for 3D the complexity does not add but multiplies. So if there are n poles in one direction and m poles in the perpendicular direction, the surface would have n*m poles.
I was thinking more on the lines if one has a curved surface, lets keep it simple and have a basic rectangular shape.
If I treat the opposite edges as two 2D splines in one window (that I can edit drag control points) and another window with
the other two 2D edges, display 3D in a third window, then maybe that would be a way I can edit a surface?

Also see this and following post https://forum.freecadweb.org/viewtopic. ... 76#p621776
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: B-Spline Constraints: Looking for Crowdfunding

Post by jnxd »

keithsloan52 wrote: Thu Sep 08, 2022 8:09 pm I was thinking more on the lines if one has a curved surface, lets keep it simple and have a basic rectangular shape.
If I treat the opposite edges as two 2D splines in one window (that I can edit drag control points) and another window with
the other two 2D edges, display 3D in a third window, then maybe that would be a way I can edit a surface?

Also see this and following post https://forum.freecadweb.org/viewtopic. ... 76#p621776
It seems kind of restrictive but doable. For one, the edge splines don't need to be on a plane. Secondly, there can be poles between the two splines. However, it may be a good start to see how well it works.
My latest (or last) project: B-spline Construction Project.
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: B-Spline Constraints: Looking for Crowdfunding

Post by jnxd »

FUNDING UPDATE: 13 September 2022

So this week I realized a mistake in my calculations, which led to me having to make a decision on how the sponsorship is counted. Let me try to explain.

I receive donations through Liberapay for two roles: one as myself, and one as a member of the FreeCAD Liberapay team. Now, I had decided early on that only the donations made to me directly would count for the fundraiser, because those sent to the team are not specifically designated to the project, and could have as well gone to one of the other well-deserving developers (the way Liberapay works is slightly complicated, and the transfer is directly done to individual developer's Paypal/Stripe account rather than to a team account).

However, last week I made a mistake by adding one payment aimed at the team to the fundraiser's tally. And that is where the decision comes in: do I remove that amount, or reconsider the previous amounts coming for my role in the team as project amounts? After a discussion with @Kunda1 and @yorik, I decided to do the latter. The justification is that donations to the team (and as such even those directly to the individual) are technically made for continued development of FreeCAD, and are not tied to a specific purpose. Most of my development since the start of the crowdfunding was for this project, so it makes sense to count the donations for it.

So, with that in mind...

Since the release of the fundraiser, I have received:

Github:
One time: $235
Monthly: $7

Liberapay:
Directly to me: $89 + €140 = ~$229
As part of FreeCAD Liberapay team: $74 + €30 = ~$104

Additional:
Pledged: $200 (upon implementation progress towards stage 2) + €250

All in all, this amounts to up to ~$1039/$3000 towards this project, assuming it takes 3 months to complete.

And we're past Goal 1! Well, we had been past the goal for a week already with the new consideration, but that's beside the point.

However, it does seem that donations have slowed down, with just $24 coming in last week. Hopefully they will catch up as further progress is made. My next step is to take a detour into "Stage 1.5" by supporting tangent constraints at knots. This will not only add more functionality to knot constraints, but the slope calculations will also potentially be useful in point-on-curve constraints.
My latest (or last) project: B-spline Construction Project.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: B-Spline Constraints: Looking for Crowdfunding

Post by adrianinsaval »

good luck! once a first PR is out we should do another marketing campaign IMO.
Post Reply