opSweep multiple edges

tonvis
tonvis Member Posts: 41 ✭✭
Can somebody please help me out, I tryed everything to obtain a full path along a set of edges.

line 373
            /*  ----------------------  Why does this not generate multiple edges

               opSweep(context, id + "sweep4", {
               "profiles" : sketchEntityQuery(id + "sketch8", EntityType.EDGE, "flat"),
               "path" : qCreatedBy(id + "sketch7", qEverything(EntityType.EDGE))

               });
             */

Many thanks for any support.



Answers

  • Jake_Rosenfeld
    Jake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646 image
    Hi @tonvis

    First issue:
    qCreatedBy(id + "sketch7", qEverything(EntityType.EDGE))
    is not a valid query, I think what you are trying to say might be:
    qCreatedBy(id + "sketch7", EntityType.EDGE)

    but by adding the following line of code, I can see what that resolves too:
    debug(context, qCreatedBy(id + "sketch7", EntityType.EDGE));


    You will need to be more discerning in your query to only capture the edges you want to sweep over.

    This seems to get what you want:
                const path = qUnion([
                            qCreatedBy(id + "helix4", EntityType.EDGE),
                            sketchEntityQuery(id + "sketch7", EntityType.EDGE, "arc2"),
                            sketchEntityQuery(id + "sketch7", EntityType.EDGE, "arc1"),
                            sketchEntityQuery(id + "sketch7", EntityType.EDGE, "offset1"),
                            sketchEntityQuery(id + "sketch7", EntityType.EDGE, "offset2")
                        ]);
    
                opSweep(context, id + "sweep4", {
                            "profiles" : sketchEntityQuery(id + "sketch8", EntityType.EDGE, "flat"),
                            "path" : path
                        });


    The "debug" call is very powerful to visually see what a query resolves to.  When I was working out the correct edges to select, I built up all the pieces of the qUnion in a call like this:
                debug(context, qUnion([
                            qCreatedBy(id + "helix4", EntityType.EDGE),
                            sketchEntityQuery(id + "sketch7", EntityType.EDGE, "arc2"),
                            sketchEntityQuery(id + "sketch7", EntityType.EDGE, "arc1"),
                            sketchEntityQuery(id + "sketch7", EntityType.EDGE, "offset1"),
                            sketchEntityQuery(id + "sketch7", EntityType.EDGE, "offset2")
                        ]));
    Which showed this nice helpful red highlight:

    Then I knew the query was ready to be passed into opSweep!
    Jake Rosenfeld - Modeling Team
  • tonvis
    tonvis Member Posts: 41 ✭✭
    Jake thanks for your help, I will give it a try.
    Featurescript is very nice , the scrips are very helpfull for anybody. The only problem  is  lack of examples. I study all I can find in publiced ones.
    Greetings  tonvis