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

Re: B-Spline Constraints: Almost Done! Help Reach Goal!

Post by jnxd »

Bernard19 wrote: Thu Oct 20, 2022 5:01 pm I take advantage of your work on B SPline.
My question is when a BSpline is used as an external geometry. We only have end points to lean on and a line. The idea would be to position and snap a point on the line. This possibility is not currently supported, it seems to me. May be there is already a possibility but I don't know it.
By "end points and a line" do you mean the end points and the B-spline itself? I know that internal geometry of an external geometry is still not visible. But I believe I did fix point-on-curve constraint on external geometry.

Could you elaborate further? Maybe an example and a file?
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: Almost Done! Help Reach Goal!

Post by jnxd »

I created a new branch that contains all the as-yet-unmerged B-spline features so that all can be tested when put together. I also plan to push any new features to this branch so that people don't have to keep jumping branches/snaps in the future (for as long as possible: I have been told the FreeCAD-snap CI deleted builds after some time).

The branch is here: https://github.com/AjinkyaDahale/FreeCA ... e-features
The snap: https://github.com/FreeCAD/FreeCAD-snap/pull/65

In case someone wants to use just a single feature (for whatever reason), please build from their respective branches directly, or contact me if needed.
My latest (or last) project: B-spline Construction Project.
User avatar
Bernard19
Posts: 887
Joined: Sun Feb 20, 2022 7:16 pm

Re: B-Spline Constraints: Almost Done! Help Reach Goal!

Post by Bernard19 »

@jnxd
Just 2 sketches. Skt 1: Bspline. Skt 2: a line. I select the B Spline and it's not possible to catch the B Spline and the point with the ContraintPointOnObjet.
Thanks for your help
Attachments
Capture d’écran 2022-10-21 095844.jpg
Capture d’écran 2022-10-21 095844.jpg (20.53 KiB) Viewed 60971 times
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: B-Spline Constraints: Almost Done! Help Reach Goal!

Post by jnxd »

Bernard19 wrote: Fri Oct 21, 2022 7:59 am @jnxd
Just 2 sketches. Skt 1: Bspline. Skt 2: a line. I select the B Spline and it's not possible to catch the B Spline and the point with the ContraintPointOnObjet.
Thanks for your help
OK. That the feature is coded, but it is not merged in "master" yet; you can get the build from the post above yours if you want to try it faster (and are in the position to do so).

By the way, I see that you say two sketches, but in your screenshot I only see one (without an external geometry). By "sketch" do you mean edge? Or do you mean a B-spline on one sketch, and that made an external edge in the second? Either case is supported, but I'm just asking about terminology.
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: Almost Done! Help Reach Goal!

Post by jnxd »

Here's a little write-up of the equations involved in the constraints I implemented in this project. Please read @abdullah's book on the solver architecture first, or it won't make too much sense.
Attachments
bspline-constraints.pdf
(155 KiB) Downloaded 119 times
My latest (or last) project: B-spline Construction Project.
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: B-Spline Constraints: Almost Done! Help Reach Goal!

Post by abdullah »

jnxd wrote: Sun Oct 23, 2022 3:53 pm Here's a little write-up of the equations involved in the constraints I implemented in this project.
I quick-read the document and seems plausible.

Which PR do you want to have reviewed the first one?
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: B-Spline Constraints: Almost Done! Help Reach Goal!

Post by jnxd »

abdullah wrote: Mon Oct 24, 2022 8:34 pm
jnxd wrote: Sun Oct 23, 2022 3:53 pm Here's a little write-up of the equations involved in the constraints I implemented in this project.
I quick-read the document and seems plausible.

Which PR do you want to have reviewed the first one?
If you're comfortable with the equations maybe jump directly to https://github.com/FreeCAD/FreeCAD/pull/7607. The changes in #7484 are already in there so if #7607 gets merged we close #7484.
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 »

CODING UPDATE 27 OCTOBER 2022

I just did some experimentation on tangent-to-B-spline, and the good news is it seems to be working.
phpBB [video]

The bad news is that it probably deviates significantly from the traditional solver architecture. Specifically, it needs creation of solver variables that do not have counterparts in the sketcher side. For this reason, I was hesitant on sharing this for now, but I eventually did.

The code is in this branch, but I don't expect to work further on this until the present stuff is reviewed and merged.
My latest (or last) project: B-spline Construction Project.
chrisb
Veteran
Posts: 53924
Joined: Tue Mar 17, 2015 9:14 am

Re: B-Spline Constraints: Almost Done! Help Reach Goal!

Post by chrisb »

You see me in awe!
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: B-Spline Constraints: Looking for Crowdfunding

Post by abdullah »

Hi Ajinkya,

I am reviewing/testing this:
https://github.com/FreeCAD/FreeCAD/pull/7607

I have this sketch:
Screenshot_20221107_141717.png
Screenshot_20221107_141717.png (15.6 KiB) Viewed 59805 times
I have selected the line, selected the knot and hit tangency constraint. FreeCAD hang. I killed it after 5 minutes.

In a second attempt, it solved but did not update the 3D View. After dragging the B-Spline, it briefly appeared a tangent line on the knot position, only to reduce the line to a point and hang again (killed after 2 minutes):
Screenshot_20221107_142416.png
Screenshot_20221107_142416.png (187.78 KiB) Viewed 59805 times
I did some other tests with the line closer to tangent (as opposed of closer to normal as above). Then it did not hang.

It is important for me to know if you can reproduce these issues, as I may be using a different solver configuration (advanced solver parameters), as I did not expect GCS to hang FreeCAD.
Post Reply