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
  Disable a spline's gizmo when not selected or disabled. mikechr2000 1 97 02-03-2025, 09:34 AM
Last Post: _Aka_
Information Questions regarding spline colliders and collisions with rigidbodies Spyboticer 7 354 01-20-2025, 12:25 PM
Last Post: _Aka_
  Extrude mesh along spline. New and confused user GhostStalker 3 122 01-02-2025, 09:58 AM
Last Post: _Aka_
  Newly created spline is invisible quickytools 7 224 12-21-2024, 10:14 AM
Last Post: _Aka_

Forum Jump: