3D Bezier angle at point

Does anyone knows how to calculate angle at a particular point in 3D bezier curve ?

For example, consider there’s a ring to be inserted in BezierCurve. So can I get angles that ring makes in order for it to be parallel to the Bezier curve ?

By “ring” do you mean a circle, or an annulus?

By “parallel”, do you mean:

  1. a circle that is tangent to the curve – the circumference of the circle touches the curve at one point?
  2. OR: the centerpoint of the circle lies on the curve?
  3. or something else?

Maybe share a drawing.

By “ring”, I do mean ‘annulus’ or torus.

By “parallel”, I mean the center of that annulus lies on the curve and also that annulus follows the curve. So if the curve is bent at 45degrees, I want that annulus to bet at 45 degrees. Hope I was able to make my point this time :sweat_smile:. Only problem I am facing right now is that I have implemented Bezier curve in 3D space, am not able to get around that angle thing in 3D space.

Maybe you need to use PTF? (Parallel Transport Frames). That’s what you use to generate tubes and avoiding sudden flips of those rings in the middle of the tube. I think both HeMesh and ToxicLibs provide tube generation. I have ported this addon from C++ to Java in the past: https://github.com/neilmendoza/ofxPtf (I think I had to invert the matrices to make it work in Processing).

Is that the kind of thing you want to do?

2 Likes

Yes, this is what I was looking for. Thanks for helping me out of this sinkhole. But it will take me few days to digest this Physics ! BTW you should also port ofxPtf to Javascript too. Thanks for the help mate !