Corgi Splines - Extremely fast and easy spline editor and jobified spline access.

Hmm outside of the scripts provided, not really. Is there anything in particular that you think the documentation could clarify to make learning the API simpler? For now, you could glance over the scripts included (for example, the editor scripts or the procedural meshing scripts - as well as the car follow example scripts)

Another small update:

2 Likes

Hi funkyCoty,

thanks for the package! I decided to give it a try a few days ago and I like it. It’s very performant - perfect for my procedural generation :slight_smile:
My question may be silly and I don’t await a perfect solution out of the box, but since you seem to understand a lot about the subject I decided to ask.
I’m generating a random path and have a few test criteria for it. Like
a) the spline (planar) mustn’t intersect.
b) the closest projected points must have at least a gap of X.

Right now I’m using a control grid (in form of a R-channel texture), marking regions “dirty” and testing for it when generating further.

When you hear intersection test of planar spline, does a simpler method come to your mind?

have a nice weekend

Do you mean you want to test if the spline is intersecting itself? Sorry I’m not fully understanding the question, haha.

Yes exactly, that’s my intention :smile:
But because it’s also important to have control over how close together spline segments can come, a control grid is so far the best my mind came up with ^^

Hey funkyCoty, it’s me again… ^^

How would I sample just one segment (in terms of “controlpoint to controlpoint”) of the spline?
Or even X segments, but specified by controlpoint start index and end index?
Say, I wanna consider the spline as a whole (regardless of interpolation mode) but in a job only sample points from index 3 to index 4 for example…

In the jobbified examples I see that I always have to update the whole DistanceCache

            var distance = ControlSpline.UpdateDistanceProjectionsData();
            ControlSpline.UpdateNative();

…and then in the job I also have to work on the whole spline:

    public struct SampleSplinePartJobParallel : IJobParallelFor
    {
        // Output
        [WriteOnly]
        public NativeArray<SplinePoint> sampledPoints;

        public float sampleDistance;

        // Spline data
        [ReadOnly] public NativeArray<SplinePoint> Points;
        [ReadOnly] public NativeArray<float> DistanceCache;
        [ReadOnly] public float DistanceCacheLength;
        public SplineMode Mode;
        public Space SplineSpace;
        public Matrix4x4 localToWorldMatrix;
        public Matrix4x4 worldToLocalMatrix;
        public bool ClosedSpline;

        public void Execute(int index)
        {
            //TODO: From to Distance and when not true, just do nothing, maybe??
            
            float d = sampleDistance * index;
            var t = Spline.JobSafe_ProjectDistance(DistanceCache, d);
            var projectedPoint = Spline.JobSafe_GetPoint(Points, Mode, SplineSpace, localToWorldMatrix, ClosedSpline, t);
            sampledPoints[index] = projectedPoint;
        }
    }

Is there a way I can specify a start index and end index of the NativeArray I am caching and sampling?

kind regards
Michael

Small update going through, a user found an issue that I isolated to being a precision issue with really long splines, so I fixed that. Also added a little video to the page with an example from an old side project I was working on, looks a little nicer than the current videos.

Update coming through…

Update just pushed to the Asset Store:

Preview of new features: