Posts: 17
Threads: 9
Joined: Oct 2020
04-07-2022, 09:50 AM
Just noticed a issue when doing shape extrusion. We want to scale the resulting mesh depending on meta data on each the control point. Our approach was to use the TF of each control point and create a control point in the Multiplier X graph. But everything is slightly offset due to our input spline for the extrusion being a closed spline. If I untick the closed option on the input spline, the Multiplier X graph lines up perfectly. Is there any easy fix for this? Changing between source and self as reference seem to to absolutely nothing in this case.
Above is a image showing the issue with the offset due to having a closed spline. I'm assuming the issue stems from the closed spline having a extra segment, not being accounted for in the Multipler X graph.
Posts: 2,142
Threads: 95
Joined: Jun 2017
Hi
The issue is that the graph's X value is not the TF value of a point, but its relative distance, meaning the distance at that point divided by the length of the spline. The documentation is not clear about this, my bad. Will fix that for the next update.
Also, your message made me realize that displaying the Relative Distance in the CP's inspector would be very helpful. To do so, please go to CurvySplineSegmentEditor.cs, and replace the statement at line 420 with the following:
Code:
EditorGUILayout.HelpBox("Control Point TF: " + Target.TF.ToString() +
"\nControl Point Distance: " + Target.Distance.ToString() +
"\nControl Point Relative Distance: " + (Target.Distance / spline.Length).ToString() +
"\nSegment Length: " + Target.Length.ToString() +
"\nSegment Cache Points: " + Target.CacheSize.ToString() +
"\nSpline Length: " + spline.Length.ToString(), MessageType.Info);
Did this help?
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.
Posts: 17
Threads: 9
Joined: Oct 2020
Aha, was not expecting it to use a relative-distance system as almost all API stuff reference the TF values.
Added your suggested addition to the help box. Also using the same calculation in out graph-generator and everything now works as expected. Thanks!
Posts: 2,142
Threads: 95
Joined: Jun 2017
(04-08-2022, 07:16 AM)TurboHans Wrote: Aha, was not expecting it to use a relative-distance system as almost all API stuff reference the TF values.
Curvy Generators don't use TFs but relative distances. I get your confusion, things could have been done better. Will improve the situation little by little through the updates
Please consider leaving a
review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.