Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to calculate curvature of spline
#1
Hi there,

Please can you help, I'm trying to create a spline between two points but with a certain curvature. This would be at runtime (if that matters).

My example, suppose I have a curved train track piece. I know the start point of the piece, and I know the end point of the piece, and I know the radius or curve of the piece. How then would I "bend" my spline so it connects the start/end points and matches the curve of the track piece?

I don't think I can use Conform Path because the collider is a box collider around the whole piece so it doesn't match the size or curve of the piece.

Thank you for your time

John
Reply
#2
Hi,
By using Bézier splines (set the Interpolation parameter in a spline to Bezier), you can set the handles at each control point, allowing you to set precisely the shape you want. The handles' positions and the control points' positions are what define a shape of a Bézier spline. You can look on the internet about how to represent the shape you desire as a Bézier spline, then use the found formulas to set the right values on your Curvy spline. For example, here is how to define a circle: https://spencermortensen.com/articles/bezier-circle/
Keep in mind that Curvy already comes with a pre-made shapes, including circles. You can create them using the Create button in the toolbar: https://curvyeditor.com/documentation/toolbar#create
Did this help?
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply
#3
Hi and thank you for the quick response.

Yes this is very helpful.

John
Reply
#4
You are welcome. Feel free to leave a review on the asset store, that helps. Thanks and have a nice day
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Method of scattering objects along spline joebain 1 3 11-26-2024, 03:20 PM
Last Post: _Aka_
  Curvy Line Renderer for UI Spline? gekido 5 13 10-29-2024, 10:19 AM
Last Post: _Aka_
  Calculate corner strength derkoi 1 3 08-31-2024, 08:22 AM
Last Post: _Aka_
  Nested Spline Volume Spot Instantiation merobbins5 3 7 07-26-2024, 09:58 AM
Last Post: _Aka_

Forum Jump: