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!
chrisb
Veteran
Posts: 46875
Joined: Tue Mar 17, 2015 9:14 am

Re: B-Spline Constraints: Fully Funded! Thanks everybody!

Post by chrisb »

A spline on the other side worked well with two point on object constraints:
SnipScreenshot-5bb52a.png
SnipScreenshot-5bb52a.png (14.32 KiB) Viewed 816 times
Attachments
pointOnBSpline2.FCStd
(15.47 KiB) Downloaded 10 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
jnxd
Posts: 869
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: B-Spline Constraints: Fully Funded! Thanks everybody!

Post by jnxd »

chrisb wrote: Wed Jan 25, 2023 1:56 am @jnxd, @abdullah, do you want the issue reports here or do you want to have tickets?
Best to make an issue on Github. This thread has already gobbled up a lot of issues.

This issue may be caused by the weights being free. There's nothing stopping the weights from approaching zero.

As such, don't count on these point-on-curve to carry the shape of the B-spline. It may be better to just add a knot there. Note that even the longest B-spline only has finite degrees of freedom, so multiple points on the curve with their own separate constraints can quickly exhaust them.

[EDIT: Additional informtion] I think (in the long run) we should be using point-on-object with B-splines that are already well-constrained themselves. For more "the curve should pass through these particular points of importance", we should be using them as knots. This I believe will require control on the knot values in order to work smoothly.
My latest (or last) project: B-spline Constraints.
Consider supporting me on Github Sponsors or LiberaPay.
chrisb
Veteran
Posts: 46875
Joined: Tue Mar 17, 2015 9:14 am

Re: B-Spline Constraints: Fully Funded! Thanks everybody!

Post by chrisb »

chrisb wrote: Wed Jan 25, 2023 1:56 am ...
Strange: I wanted to simplify the file, but after reloading it all works. So no Github issue yet.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 46875
Joined: Tue Mar 17, 2015 9:14 am

Re: B-Spline Constraints: Fully Funded! Thanks everybody!

Post by chrisb »

And here I am back again. I moved the B-spline to the left of the point , and the issue showed again.
After moving again to the right and back to the left, the issue disappeared.

I don't create an issue yet. I will wait for other users to double check.
Attachments
pointOnBSplineLeft.FCStd
(10.1 KiB) Downloaded 8 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
abdullah
Veteran
Posts: 4688
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: B-Spline Constraints: Fully Funded! Thanks everybody!

Post by abdullah »

ppemawm wrote: Tue Jan 24, 2023 5:54 pm If you notice, in the video there is some LCS flipping in certain quadrants so apparently this attachment mode is not the best choice. I also tried the Z tangent to edge mode with the same disappointing results. This is a weakness in Sketcher that could use some development priority.
Very cool as always. When I grow up it would be great to be you :)

I have only basic incomplete knowledge of how Assembly 4 works. Though seeing that you use it, I start to be more motivated to learn.

I know that LCS are maps to parts, to then put parts on them. I understand from your explanation that the LCS flips (which for my untrained eye, I do not appreciate it in the video). This you attribute to the mapping type (which is a part feature, not a sketcher feature). Then, I am unsure if you say that the Sketcher has a weakness because the Part attachment code is not working as expected, or if you see something the sketcher does wrong that makes Part attachment code work as unintended.
abdullah
Veteran
Posts: 4688
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: B-Spline Constraints: Fully Funded! Thanks everybody!

Post by abdullah »

chrisb wrote: Wed Jan 25, 2023 10:14 am And here I am back again. I moved the B-spline to the left of the point , and the issue showed again.
After moving again to the right and back to the left, the issue disappeared.

I don't create an issue yet. I will wait for other users to double check.
Yes. It appears to happen because the weight is made zero. The constraints set a ratio of weight to weight. The BSpline is adapting almost imperceptibly with different values. Yet, when one is made zero, the proportion cannot be maintained and the artifact happens. I do not quite see a way to prevent it... will think about it.
User avatar
ppemawm
Posts: 927
Joined: Fri May 17, 2013 3:54 pm
Location: Manhattan New York

Re: B-Spline Constraints: Fully Funded! Thanks everybody!

Post by ppemawm »

Thank you for your kind comments. And, when I grow up maybe I'll learn Python so I can actually contribute to FreeCAD as you do impeccably.
abdullah wrote: Wed Jan 25, 2023 5:45 pm Then, I am unsure if you say that the Sketcher has a weakness because the Part attachment code is not working as expected, or if you see something the sketcher does wrong that makes Part attachment code work as unintended.
I was guessing that it has something to do with Sketcher. For some reason the LCS axis orientation flips 180 deg in different quadrants. I have had situations when the edge or vertex numbering changes with position which affects the LCS location. In this particular example it does not appear that any numbering in the sketch actually changes. So, perhaps it is some other culprit.

Assembly4 can use Sketcher as a sophisticated solver for complex (or simple) mechanism assemblies so having a robust master sketch and LCS attachment is critical for machine design if it has moving bodies. During design it is important to be able to check for collisions or to verify correct operation in all possible positions. Assembly4 provides a simple animator for this purpose. When combined with Expressions, Variables, and conditional statements, I dare say that virtually any machine can be accurately simulated.
abdullah wrote: Wed Jan 25, 2023 5:45 pm the LCS flips (which for my untrained eye, I do not appreciate it in the video).
Sorry, I should have made the LCS's visible for the video to make it more obvious. If you pay close attention to the links in the video you may see that they flip 90 deg around their long axis in various quadrants. Or, open the sketch in the file and exercise it with the animator (open the animator first then the sketch) or directly change the angle value in the Variables property.
"It is a poor workman who blames his tools..." ;)
abdullah
Veteran
Posts: 4688
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: B-Spline Constraints: Fully Funded! Thanks everybody!

Post by abdullah »

ppemawm wrote: Thu Jan 26, 2023 1:56 am Sorry, I should have made the LCS's visible for the video to make it more obvious. If you pay close attention to the links in the video you may see that they flip 90 deg around their long axis in various quadrants. Or, open the sketch in the file and exercise it with the animator (open the animator first then the sketch) or directly change the angle value in the Variables property.
And I could have seen the file attached at the end :lol:

Yes, I see the LCS is flipping...

I will try to look into it with more detail next week.

@Zolko

Is it possible for you to take a look to this file (if you can, you need a very recent master FreeCAD for the BSpline Point on object support)?

I have looked at the edges' orientation (both inside edit mode and in the shape) and I do not see it changing. I am obviously not looking at the right place. You might already have suffered it. Maybe you already have an idea of what might be happening?
User avatar
Jolbas
Posts: 147
Joined: Sat Mar 26, 2022 7:48 am
Location: Sweden

Re: B-Spline Constraints: Fully Funded! Thanks everybody!

Post by Jolbas »

@ppemawm @abdullah

The attachment of the LCS doesn't have enough references to be fully constrained and uses one of the global axis instead (a guess). Add the sketch center point as reference in the attachment editor and select OZY. Then Y axis will always point to the center.

Edit: I don't know how the guessing of the second axis in origin-axis-axis mode works.
User avatar
ppemawm
Posts: 927
Joined: Fri May 17, 2013 3:54 pm
Location: Manhattan New York

Re: B-Spline Constraints: Fully Funded! Thanks everybody!

Post by ppemawm »

abdullah wrote: Thu Jan 26, 2023 8:01 pm Yes, I see the LCS is flipping...
Jolbas wrote: Fri Jan 27, 2023 7:24 am The attachment of the LCS doesn't have enough references to be fully constrained...
Jolbas, you may be on to something. It probably does not behave properly because the LCS is not attached properly. So, I will do my homework and research attachment modes more thoroughly. If I still have a question I will raise it in a separate post in Open Discussion so as to not distract from JNXD's valuable B-spline achievements .

EDIT: Please be advised I have made this change to my file and it appears to be working as expected !! I will now try to extend this approach to a complete roller chain. See also viewtopic.php?p=656706#p656706
Last edited by ppemawm on Fri Feb 03, 2023 2:54 pm, edited 2 times in total.
"It is a poor workman who blames his tools..." ;)
Post Reply