Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calculate distance between control points.
#1
Big Grin 
First post and fairly new to curvy.

Any suggestions on how I could go about calculating the distance between two control points on the same spline? My plan is to dynamically create a control point at the mid point between two control points.

Thanks!
Reply
#2
(06-23-2017, 03:13 PM)_niceo Wrote: First post and fairly new to curvy.

Any suggestions on how I could go about the diet pills http://www.nahf.org/ calculating the distance between two control points on the same spline? My plan is to dynamically create a control point at the mid point between two control points.

Thanks!

Hi Nico, did you figure out how to do it?
Reply
#3
Each CP have a Length property as well as a Distance one. The latter tells the Distance from the start of spline.
So if you want to split a segment in half do something like:

Code:
var pos=spline.InterpolateByDistance(cp.Distance+cp.Length/2);
var newCP=spline.InsertAfter(cp);
newCP.position=pos;
Reply
#4
Thanks Jake. I assume this'll work like a charm.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to calculate curvature of spline jh092 3 61 08-01-2020, 04:51 PM
Last Post: _Aka_
  Max distance between points HTRCH 1 110 07-11-2020, 01:07 PM
Last Post: _Aka_
  Control points parenting briceio 2 218 06-18-2020, 04:12 AM
Last Post: briceio
  Control points close together causing mesh overlap amccraw 5 467 05-23-2020, 06:08 PM
Last Post: _Aka_

Forum Jump: