Sketcher: A way of drawing tangents to B-Splines

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
User avatar
jruiz
Posts: 479
Joined: Tue Oct 28, 2014 1:07 pm
Contact:

Sketcher: A way of drawing tangents to B-Splines

Post by jruiz »

I have uploaded a video showing a workaround for getting the tangent to a B-Spline at a given point:
Tangent to B-Spline.

phpBB [video]

I was wondering If the involved calculations could be used to add this feature to Constrain tangent tool of the Sketcher.

PS: An extended Spanish version of the video can be watched in the following:
Solution to problem 4
phpBB [video]

Where, apart from my solution to tangent to B-Spline there are two another ones from two user of Telegram's Spanish group of FreeCAD.
Last edited by jruiz on Tue Jun 21, 2022 12:53 pm, edited 4 times in total.
I have uploaded many FreeCAD video tutorials to my YouTube channel
User avatar
NewJoker
Veteran
Posts: 3014
Joined: Sun Oct 11, 2020 7:49 pm

Re: Sketcher: A way of drawing tangents to B-Splines

Post by NewJoker »

Thank you for sharing this. There was a discussion about workarounds for this limitation here: https://forum.freecadweb.org/viewtopic.php?f=3&t=67197

Maybe you know the practical differences between endpoint tangency and tangency to B-spline edge ? In which cases is endpoint tangency not sufficient and tangency to B-spline edge must be utilized (with a workaround like this) ?
User avatar
jruiz
Posts: 479
Joined: Tue Oct 28, 2014 1:07 pm
Contact:

Re: Sketcher: A way of drawing tangents to B-Splines

Post by jruiz »

NewJoker wrote: Tue Jun 21, 2022 10:48 am Thank you for sharing this. There was a discussion about workarounds for this limitation here: https://forum.freecadweb.org/viewtopic.php?f=3&t=67197

Maybe you know the practical differences between endpoint tangency and tangency to B-spline edge ? In which cases is endpoint tangency not sufficient and tangency to B-spline edge must be utilized (with a workaround like this) ?
I don't know exactly the difference you are looking for. But I will allow myself to speculate on this:
Maybe that knowing the math form of the B-Spline in addition to the coordinates at the endpoints ease the calculation of tangent lines there. I suppose that when in the edge at an "arbitrary" point, an interpolation has to be done. This would require to know the values of the coefficients defining the B-spline at that region which depend on the nodes "beside" that "arbitrary" point.
I have uploaded many FreeCAD video tutorials to my YouTube channel
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Sketcher: A way of drawing tangents to B-Splines

Post by adrianinsaval »

interesting method, I don't see the need for making a separate sketch with a closed profile for extruding though since directly extruding the standalone spline would have worked too.

Edit: actually I just checked and you can even get away with just making a subshapebinder for the cut, much cleaner tree and possibly more resilient to toponaming problem. A sinlge sketch is not accepted for the persistent cut though, @uwestoehr is this an artificially imposed limitation? I would think so considering the cut of just the binder works, perhaps we should consider removing it.
Attachments
splineTangent.FCStd
(12.23 KiB) Downloaded 13 times
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Sketcher: A way of drawing tangents to B-Splines

Post by jnxd »

Hi @jruiz, @NewJoker and anyone else interested.

I am working on this problem in a more formal way so that the results can be merged into sketcher itself. I am trying to make this a funded project. If interested you can take a look at https://forum.freecadweb.org/viewtopic.php?f=9&t=71130.

So far, I have been able to make constraints on knot position possible. Theoretically, it should also be possible to constrain tangents at knots. My target is to support "true" point-on-curve so that the point can move along the spline freely.
My latest (or last) project: B-spline Construction Project.
User avatar
jruiz
Posts: 479
Joined: Tue Oct 28, 2014 1:07 pm
Contact:

Re: Sketcher: A way of drawing tangents to B-Splines

Post by jruiz »

adrianinsaval wrote: Mon Jun 27, 2022 11:10 pm interesting method, I don't see the need for making a separate sketch with a closed profile for extruding though since directly extruding the standalone spline would have worked too.
Yep, you are right. Thank you.
I made it that way because I was in "Part Design WB mode" when I made the tutorial. :D
adrianinsaval wrote: Mon Jun 27, 2022 11:10 pm Edit: actually I just checked and you can even get away with just making a subshapebinder for the cut, much cleaner tree and possibly more resilient to toponaming problem. A sinlge sketch is not accepted for the persistent cut though, @uwestoehr is this an artificially imposed limitation? I would think so considering the cut of just the binder works, perhaps we should consider removing it.
Agree.
I have uploaded many FreeCAD video tutorials to my YouTube channel
User avatar
jruiz
Posts: 479
Joined: Tue Oct 28, 2014 1:07 pm
Contact:

Re: Sketcher: A way of drawing tangents to B-Splines

Post by jruiz »

jnxd wrote: Wed Aug 24, 2022 9:11 am Hi @jruiz, @NewJoker and anyone else interested.

I am working on this problem in a more formal way so that the results can be merged into sketcher itself. I am trying to make this a funded project. If interested you can take a look at https://forum.freecadweb.org/viewtopic.php?f=9&t=71130.

So far, I have been able to make constraints on knot position possible. Theoretically, it should also be possible to constrain tangents at knots. My target is to support "true" point-on-curve so that the point can move along the spline freely.
Hi,
Gonna take a look...
I have uploaded many FreeCAD video tutorials to my YouTube channel
User avatar
jruiz
Posts: 479
Joined: Tue Oct 28, 2014 1:07 pm
Contact:

Re: Sketcher: A way of drawing tangents to B-Splines

Post by jruiz »

adrianinsaval wrote: Mon Jun 27, 2022 11:10 pm interesting method, I don't see the need for making a separate sketch with a closed profile for extruding though since directly extruding the standalone spline would have worked too.

Edit: actually I just checked and you can even get away with just making a subshapebinder for the cut, much cleaner tree and possibly more resilient to toponaming problem. A sinlge sketch is not accepted for the persistent cut though, @uwestoehr is this an artificially imposed limitation? I would think so considering the cut of just the binder works, perhaps we should consider removing it.
Just uploaded another version of the previous video explaining this details.
phpBB [video]
I have uploaded many FreeCAD video tutorials to my YouTube channel
Post Reply