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.

oploft connections

graham_lockgraham_lock Member Posts: 160 PRO

Hi,

Is there an example anywhere showing how to use connections with opLoft?

I have an array of sketch regions, an array of faces on which the sketches are drawn but I'm struggling to get the correct parameter set?

Thank you.

Answers

  • S1monS1mon Member Posts: 3,039 PRO

    I don't know if this would help, but what happens when you create a regular loft feature through the same set of sketch regions? If you look at the "show code" view for the tab, does that offer any clues?

  • graham_lockgraham_lock Member Posts: 160 PRO

    Thank you for your reply.

    I’ve already tried that, I can see the arrays are made up of qUnions but the actual entities are difficult to trace.

    Hopefully there’s a documented sample somewhere if not then I guess it’s back to the compressed code view.

  • graham_lockgraham_lock Member Posts: 160 PRO

    So I’ve tried using loft instead of opLoft directly.

    It’s close I think but not working.

    loft(context, id,

            {

                    "bodyType" : ExtendedToolBodyType.SOLID,

                    "operationType" : NewBodyOperationType.NEW,

                    "surfaceOperationType" : NewSurfaceOperationType.NEW,

                    "sheetProfilesArray" : [

                        { "sheetProfileEntities" : qUnion([profileSubqueries[0]]) },

                        { "sheetProfileEntities" : qUnion([profileSubqueries[1]]) },

                        { "sheetProfileEntities" : qUnion([profileSubqueries[2]]) },

                        { "sheetProfileEntities" : qUnion([profileSubqueries[3]]) }

                    ],

                    "matchConnections" : true,

                    "connections" : [

                            {

                            "connectionEntities" : qUnion([                           

                                    qAdjacent(profileSubqueries[0], AdjacencyType.EDGE, EntityType.EDGE),

                                    qAdjacent(profileSubqueries[1], AdjacencyType.EDGE, EntityType.EDGE),

                                    qAdjacent(profileSubqueries[2], AdjacencyType.EDGE, EntityType.EDGE),

                                    qAdjacent(profileSubqueries[3], AdjacencyType.EDGE, EntityType.EDGE)

                                ]),

                            "connectionEdgeQueries" : qUnion([

                                qAdjacent(profileSubqueries[0], AdjacencyType.EDGE, EntityType.EDGE),

                                qAdjacent(profileSubqueries[1], AdjacencyType.EDGE, EntityType.EDGE),

                                qAdjacent(profileSubqueries[2], AdjacencyType.EDGE, EntityType.EDGE),

                                qAdjacent(profileSubqueries[3], AdjacencyType.EDGE, EntityType.EDGE)

                                ]),

                               "connectionEdgeParameters" : { 'value' : [0.5, 0.5, 0.5, 0.5] }.value

                        }

                    ]

                }

            );

    profileSubqueries contain the sketch regions to loft.

    This image shows what the above connections are supposed to correct. The connections are to the sketch circle profiles.

    If I manually loft without connections I get:

    This image shows the manual loft with connections to the sketch circle profiles - which is what my code should be doing.

    Any thoughts appreciated.

    Thank you.

  • S1monS1mon Member Posts: 3,039 PRO

    How are the sketched circles created in the first place? If they're all oriented the same way, there should be no need for connections - it should just work.

    I don't know if this will help in this case, but sometimes splitting a closed curve - such as a circle - into two curves can make loft behave better. If all the circles are two 180 degree arcs with the end points at 12 and 6 o'clock, loft should just work without manually giving it connections.

  • graham_lockgraham_lock Member Posts: 160 PRO

    Thank you for your reply.

    The sketches are created in FS on the faces of the parts using skEllipse. They are all oriented the same way with the same diameter.

    A manual loft does indeed seem to work if the the circles are split into two arcs as you suggested.

    I can look at changing my FS to draw arcs but hopefully somebody from OS can shed some light on using the connections parameters, since they are documented.

  • graham_lockgraham_lock Member Posts: 160 PRO

    Using arcs seems to work:

    Thank you again for the suggestion.

    I won't mark this as answered just yet as I'm hoping we can crack connections!

  • EvanReeseEvanReese Member, Mentor Posts: 2,186 ✭✭✭✭✭

    What does it look like if you add a debug point to the 0 parameter on each circle? I'm curious if they are lined up or not.

    Evan Reese
  • graham_lockgraham_lock Member Posts: 160 PRO

    Thank you for your reply.

    A different config but similar problems:

  • graham_lockgraham_lock Member Posts: 160 PRO

    Here's a manual loft using FS produced sketches with and without connections applied:

    So it's not an issue with opLoft per se.

Sign In or Register to comment.