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.

opCreateCurvesOnFace() for parameters 0 and 1 fail?

EvanReeseEvanReese Member, Mentor Posts: 2,269 ✭✭✭✭✭

Even the native Isoparametric Curve feature can't do a parameter of 0 or 1 on a periodic surface (for example: to get the circular end of a cylinder). Does anyone know a decent workaround?

Evan Reese

Best Answer

  • EvanReeseEvanReese Member, Mentor Posts: 2,269 ✭✭✭✭✭
    Answer ✓

    Thanks fellas. Here's what I ended up coming up with. Since my case is somewhat narrow I don't have to worry about dealing with trimmed surfaces and I know that the only 2 edges a periodic surface will have are the ones I need.

    function getEdgesOfPeriodicSurface(context is Context, face is Query) returns array
    {
    var paramPoints = evFaceTangentPlanes(context, {
            "face" : face,
            "parameters" : [vector(0, 0), vector(1, 1)]
        });
    
    return [qContainsPoint(edges, paramPoints[0].origin), qContainsPoint(edges, paramPoints[1].origin)];
    }
    
    Evan Reese

Answers

  • S1monS1mon Member Posts: 3,188 PRO

    A guess: split the cylinder in halves, and create two curves?

  • MichaelPascoeMichaelPascoe Member Posts: 2,110 PRO
    edited February 20

    Could you use evFacePeriodicity and evApproximateBSplineSurface to get the underlying surface then get get the curve from that?


    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   Learn How to FeatureScript Here 🔴
  • EvanReeseEvanReese Member, Mentor Posts: 2,269 ✭✭✭✭✭
    Answer ✓

    Thanks fellas. Here's what I ended up coming up with. Since my case is somewhat narrow I don't have to worry about dealing with trimmed surfaces and I know that the only 2 edges a periodic surface will have are the ones I need.

    function getEdgesOfPeriodicSurface(context is Context, face is Query) returns array
    {
    var paramPoints = evFaceTangentPlanes(context, {
            "face" : face,
            "parameters" : [vector(0, 0), vector(1, 1)]
        });
    
    return [qContainsPoint(edges, paramPoints[0].origin), qContainsPoint(edges, paramPoints[1].origin)];
    }
    
    Evan Reese
Sign In or Register to comment.