Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Make connection between 2 control points
#1
Hi,  
 So If I've already got a spline with say 3 control points, then I want to connect a 2nd spline to the first but between the 2nd and 3rd control point ( CP0001 & CP0002 ) 
how could I do that please.

Regards
Reply
#2
Hi,
You can connect control points only at control points. So in your case, you will have to create a control point at the desired position and then make the connection at that level.
Did this help?
Also, the Shift and Subdivide tools in the toolbar might help in your task
Have a nice day
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply
#3
Hi. I just wondered if there was a built in way if doing that.
As what i want to achieve will be at runtime what i could do is store the info of each control point then redraw the spline but adding the new connection control point at the appropriate place, ie if between cp 1 and 2 the new control point would become cp0002 then all subsequent control points would be one number higher it'd that makes sense.
Reply
#4
Hi,
The Subdivide tool is the built-in way but it will add the new CP halfway in between the existing two CPs.
The Shift tool is the built-in way to move a CP on the spline between its neighboring CPs
Other than this, you will have to use the API to do what you described
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply
#5
Hi again, I've almost achieved what I want to achieve. Hopefully just one more question :
If I want to add a connection to say CP0003 and I've got 7 control points ( so I cant use last visible control point ) how could I do that ?

Cheers
Reply
#6
Hi,
You can access the third cp like this
yourSpline.ControlPointsList[3]
CurvyConnection is the class for creating connections
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply
#7
thanks
Reply
#8
You are welcome
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply
#9
Sorry for even more questions but this is what I'm doing
( seg is a CurvySplineSegment)

Code:
tempExisting_spline_toJoin.ControlPointsList[4].Connection.AddControlPoints (seg);

The above control point does have a connection, when I run this it doesn't give any errors but also doesn't add the control point to the connection.

EDIT : seg is already part of another connection, could that be the reason it wont become part of the above connection ?
Reply
#10
Yes, it is because it is already in a connection. It is the same behaviour as the connect tool in the UI. I should make the method return an error message to make things clear
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  OnAfterControlPointAdded - Control Point is null jh092 5 2,247 02-04-2025, 09:31 PM
Last Post: _Aka_
  Create Mesh Node, Make Static Options rickgplus 1 1,389 01-23-2025, 10:12 AM
Last Post: _Aka_
  How to generate gameobject on the control point Yang Yi 1 1,163 12-10-2024, 10:14 PM
Last Post: _Aka_
  Anomalous connection handling SAMYTHEBIGJUICY 1 959 12-04-2024, 05:08 PM
Last Post: _Aka_

Forum Jump: