Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Infinite loop in FixedDistance mesh generation
#9
I'm just looking into this issue.

Edit: Ok, guess it's solved. Locate and replace CurvySpline.DistanceToSegment() with

Code:
public CurvySplineSegment DistanceToSegment(float distance, out float localDistance)
    {
        distance = Mathf.Clamp(distance,0, Length);
        localDistance = 0;
        CurvySplineSegment seg = mSegments[0];
        if (distance == Length) {
            seg = this[Count - 1];
            localDistance = seg.Distance + seg.Length;
            return seg;
        }
            
        
        while (seg && seg.Distance+seg.Length < distance) {
            seg = NextSegment(seg);
        }
        if (seg == null)
            seg = this[Count - 1];
        localDistance = distance - seg.Distance;
        return seg;
    }

Hopefully that will fix it for all times!

Jake

PS: @Voxelboy: I removed your attached scene, because it contains the full Curvy package. Please be more careful next time! This is a public forum...
Reply


Messages In This Thread

Possibly Related Threads…
Thread Author Replies Views Last Post
  Incorrect mesh alignment after extrusion on curved path Thinkurvy 10 21 04-17-2024, 10:57 AM
Last Post: _Aka_
  Adjust radius of generated mesh via script? Shackman 1 4 03-26-2024, 01:12 PM
Last Post: _Aka_
  Not seeing mesh extended after following YT PaulM 1 3 02-02-2024, 12:01 PM
Last Post: _Aka_
  Trigger Zones along Spline Mesh dlees9191 1 5 01-05-2024, 10:18 AM
Last Post: _Aka_

Forum Jump: