opCreateCurvesOnFace() for parameters 0 and 1 fail?

EvanReese
EvanReese Member, Mentor Posts: 3,099 PRO

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
The Onsherpa | Reach peak Onshape productivity
www.theonsherpa.com

Best Answer

  • EvanReese
    EvanReese Member, Mentor Posts: 3,099 PRO
    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
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com

Answers

  • S1mon
    S1mon Member Posts: 4,636 PRO

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

    Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn

  • MichaelPascoe
    MichaelPascoe Member Posts: 2,965 PRO
    edited February 2025

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


    RENDERCAD - Photorealistic product rendering.
    CADSharp - Professional CAD + software consulting.

    ▚▞▚▞▚▞▚▞▚
  • EvanReese
    EvanReese Member, Mentor Posts: 3,099 PRO
    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
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com