Hi Jake .. Thanks for replying.
I somehow tried your suggestion, but it doesn't seem to work for me. Also I couldn't find anywhere in the docs the autoCP you mentioned. Maybe I'm doing somethiing wrong.
[i]By executing this code ( and if I was able to set autoCP ) I should get an exact clone according to your guidance , but I don't. See result.jpg attached.
However I'm not sure if you understood me in the first place ( also attached another schematic to make it visual ). I want to take spline AB( having just 2 points A & B ). Clone it, and then move point B to a newly interpolated position from the original spline. Can move point B or create a new one C , doesn't matter. But then I want the control points of point B ( mean the handles ), to be repositioned so that the shape stays exactly the same as the original( well.. the part we are cloning not the whole of teh original shape) . So if i set a clone with tf = 0.3 only 0.3 ( 30% ) of it will be cloned preservving the shape.
The problem lies within the position of the handles. They have to be repositioned/interpolated aswell. Both handles A-OUT & B-IN ( or C-IN ) should be repositioned in order to keep the shape the same. No problem for handle A-OUT ( Already did this one ). Only C-IN ( B-IN ) is the problem for me right now.
Can I do it easily with your lib( maybe some hidden or undocumented method ) or I should calculate it myself ?
Btw .. All of the types suit my needs ( prefer using beziers ).
Thanks again.[/i]
I somehow tried your suggestion, but it doesn't seem to work for me. Also I couldn't find anywhere in the docs the autoCP you mentioned. Maybe I'm doing somethiing wrong.
Code:
void split(){
if( lineSrc && lineSrc.Length > 0 ) Debug.Log( lineSrc.Length.ToString () );
else return;
clonePath( lineSrc , 0.7f );
}
CurvySpline clonePath( CurvySpline source , float tf ){
CurvySpline clone = CurvySpline.Create( source );
// clone.AutoCp = false; // can't find it in the docs
Vector3 points = new Vector3[ source.ControlPoints.Count ];
for (int i = 0; i < source.ControlPoints.Count; i++)
points [i] = source.ControlPoints [i].Position;
clone.Add( points );
clone.RefreshImmediately();
return clone;
}[/i][/i]
However I'm not sure if you understood me in the first place ( also attached another schematic to make it visual ). I want to take spline AB( having just 2 points A & B ). Clone it, and then move point B to a newly interpolated position from the original spline. Can move point B or create a new one C , doesn't matter. But then I want the control points of point B ( mean the handles ), to be repositioned so that the shape stays exactly the same as the original( well.. the part we are cloning not the whole of teh original shape) . So if i set a clone with tf = 0.3 only 0.3 ( 30% ) of it will be cloned preservving the shape.
The problem lies within the position of the handles. They have to be repositioned/interpolated aswell. Both handles A-OUT & B-IN ( or C-IN ) should be repositioned in order to keep the shape the same. No problem for handle A-OUT ( Already did this one ). Only C-IN ( B-IN ) is the problem for me right now.
Can I do it easily with your lib( maybe some hidden or undocumented method ) or I should calculate it myself ?
Btw .. All of the types suit my needs ( prefer using beziers ).
Thanks again.[/i]