Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Control points close together causing mesh overlap
#1
I'm using Curvy to generate tubes from predefined data that dictates the control points and the handle vectors, and I've run into an issue with some of the points that are very close together.  With these points, I'm fairly sure the mesh generated from each points extends past the middle and then back towards itself, and it creates a weird spot on the tube.  I've attached a picture of the mesh and of the underlying spline path (which doesn't exhibit the same behavior), as well as a picture where I set the cross range length to a very small number so you can see the mesh crossing over more clearly. I was wondering if there is something I can do to prevent this from occurring, unfortunately I can't modify the input points and vectors at all to tweak the results.

If necessary, I can try to generate a set of data to replicate the issue, but I can't post the current data I'm using.


Attached Files Thumbnail(s)
           
Reply
#2
Hi,
I believe this is because the Bezier handles are way too long for that segment's length. Maybe it's not visible on the spline gizmo's because the points are too close? Try displaying apprixmation points, maybe it will be visible then.
Can you please confirm that reducing the length of the bezier handles fixes the issue?
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.
Reply
#3
That does fix it, but with my current code, it creates another problem where the other segment connecting through that control point (that's not too close) gets pulled in and no longer looks correct.  It's been a little while since I actually wrote this code, so I'm trying to remember exactly what I did, but I remember that I had to essentially tune it to match what I needed.  For context, this is engineering data, and in addition to the points and vectors, I have a slack value, which I was unable to apply directly with Curvy, so I tweaked a scaling variable for the handles in my code (shown below) until it visually matched what I needed.

Is it possible to set the handles asymmetrically so I can check if a control point is too close to the one before or after it, and adjust the handle just on that side of the control point?

Code:
CurvySplineSegment segment = wireSpline.Add();
segment.SetLocalPosition(position);
segment.AutoHandles = false;
Vector3 handleOut = vector;
handleOut.Normalize();
handleOut *= SLACK_SCALING;
Vector3 handleIn = -handleOut;
segment.SetBezierHandles(0.025f, handleIn, handleOut);
Reply
#4
Yes you can set the handles asymmetrically, whether though the API or through the editor
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply
#5
Ah perfect, that solved it! I'm not sure why I was under the impression they had to be symmetric, but this is an easy fix now, thanks!
Reply
#6
You are welcome
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to generate gameobject on the control point Yang Yi 0 1 Yesterday, 11:43 AM
Last Post: Yang Yi
  Can Deform Mesh shrink as well as stretch? davelloyd 1 3 Yesterday, 11:16 AM
Last Post: _Aka_
  Is it possible to make the face at the end of mesh? Chanon 3 6 11-14-2024, 04:38 PM
Last Post: _Aka_
  Mesh deform - baby guide jmh1804 7 12 08-22-2024, 07:18 AM
Last Post: _Aka_

Forum Jump: