Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Partial curve
#3
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.


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]
[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]


Attached Files Thumbnail(s)
       
Reply


Messages In This Thread
Partial curve - by drememy - 11-15-2014, 08:39 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  snap to the curve created by the curvy splines segment points ShiroeYamamoto 3 11 04-02-2024, 02:24 PM
Last Post: _Aka_
  Can Curve Spline be used for an in game level editor. Lupos 30 71 06-03-2023, 10:58 AM
Last Post: _Aka_
Bug Extrusion and scale curve issues Sacryn 3 15 04-08-2022, 12:30 PM
Last Post: _Aka_
  Autogenerate bezier curve with a given direction AnAsianPanda 3 554 08-06-2021, 09:08 AM
Last Post: _Aka_

Forum Jump: