I have uploaded a video showing a workaround for getting the tangent to a B-Spline at a given point:
Tangent to B-Spline.
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
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.
Sketcher: A way of drawing tangents to B-Splines
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
Sketcher: A way of drawing tangents to B-Splines
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
Re: Sketcher: A way of drawing tangents to B-Splines
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) ?
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) ?
Re: Sketcher: A way of drawing tangents to B-Splines
I don't know exactly the difference you are looking for. But I will allow myself to speculate on this: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) ?
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
- adrianinsaval
- Veteran
- Posts: 5551
- Joined: Thu Apr 05, 2018 5:15 pm
Re: Sketcher: A way of drawing tangents to B-Splines
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.
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
Re: Sketcher: A way of drawing tangents to B-Splines
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.
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.
Re: Sketcher: A way of drawing tangents to B-Splines
Yep, you are right. Thank you.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.
I made it that way because I was in "Part Design WB mode" when I made the tutorial.
Agree.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.
I have uploaded many FreeCAD video tutorials to my YouTube channel
Re: Sketcher: A way of drawing tangents to B-Splines
Hi,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.
Gonna take a look...
I have uploaded many FreeCAD video tutorials to my YouTube channel
Re: Sketcher: A way of drawing tangents to B-Splines
Just uploaded another version of the previous video explaining this details.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.
I have uploaded many FreeCAD video tutorials to my YouTube channel