Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Options

evaluateSpline: Parameter at index 0 is outside the knot vector

I used a Split feature on a curve (helix) entity, and wanted to then subdivide this split version of the entity into line segments. However, I got the below error. Is this because the curve needs to in an ideal world be reparameterised between 0 and 1? Has the split operation done some funky business where it's almost treating it like a trimmed surface, and now no longer exists in the domain of the curve? I couldn't initially see anything in the FS documentation to fix this.

@evaluateSpline: Parameter at index 0 is outside the knot vector.
Tagged:

Answers

  • Options
    GregBrownGregBrown Member, Onshape Employees Posts: 104
    Correct, you'll often see knot vectors with domains other than [0.0 ....1.0] - particularly when trim, project etc operations have been performed. You'll likely have to do a bit of rescaling of the parameter you pass into the evaluation.
  • Options
    Jonathan_HutchinsonJonathan_Hutchinson Member Posts: 64 PRO
    Hey Greg, thanks for the quick response. I think we spoke in London briefly at the Design Alliance.

    The hack I did was then using a path instead (FS: evPathTangentLines to evaluate point at parameters) which was a bit more clunky I suppose, but seemed to be the workaround to reset to 0-1 again. Is there an option somewhere else to reparameterise or, as you mention, rescale the parameter before subsequent operations without Paths?
  • Options
    Jacob_CorderJacob_Corder Member Posts: 126 PRO
    If you want to normalize the not array, i use this

    export function normalizeKnotArray(knots is array)returns array
    {
        var ret = knots;
        var minKnot = ret[0];      
        var ct =size(knots);
        if(minKnot !=0)
        {
            //resets knots to start at 0
            for(var j=0;j<ct;j+=1)
            {
                ret[j] = ret[j] - minKnot;
            }
        }
        var newMax = ret[ct-1];
      
        if(newMax!=1)
        {
            //normalizing the max knot to be 1 and all others scaled in between.
              var mult = (1/newMax);
            for(var j=0;j<ct;j+=1)
            {
                ret[j] = ret[j] * mult; 
            }
        }
        return ret; 
    }

Sign In or Register to comment.