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.

difficulties with circular pattern of an opSphere

björn_britzbjörn_britz Member Posts: 14 EDU
I have difficulties doing a circular pattern of operations, especially with the opSphere operation.

Don't know what's wrong and Onshape says regeneration complete. Any suggestions?


document link:


Thanks!

Best Answers

  • Jake_RosenfeldJake_Rosenfeld Posts: 1,418
    edited October 2018 Accepted Answer
    @"björn_britz"

    A couple issues here.  It is useful for debugging FeatureScript to use the 'monitor' functionality in the FS console.  Open the console by pressing the '{✓}' at the top of the screen, and then press the "monitor" button next to the part studio you want to monitor.

    By doing this I first found that there was an issue with your sketch plane definition:


    I think this ends up being o.k. on the backend, but you should really be defining those as:
    plane(vector(0 * inch, 0 * inch, definition.Width / 4), vector(0, 0, 1));
    Otherwise the x and y values of the vector are unitless and the z value has a distance unit, which is not optimal for the system.

    The main problem here is the problem with the axis of the circular pattern:


    It would be nice if the system could accept definition.axis as a `Line`, but unfortunately (because `circularPattern` is a feature, and `definition.axis` actually represents a selection box in circular pattern's feature dialog) you must pass a Query in for that parameter.

    The easiest way to get around this would be to do something like:
    opFitSpline(context, id + "axis", { "points" : [origin, origin + (vector(0, 0, 1) * inch)] });
    const axis = qCreatedBy(id + "axis", EntityType.EDGE);
    And then use that `axis` as `definition.axis`.

    Hopefully this makes sense.  Let me know if you have additional questions.
    Jake Rosenfeld - Modeling Team

Answers

  • MBartlett21MBartlett21 Member Posts: 1,686 EDU
    Try looking up the documentation of getRemainderPatternTransform https://cad.onshape.com/FsDoc/library.html#getRemainderPatternTransform-Context-map
    MB - I make FeatureScripts:View FeatureScripts
  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,418
    edited October 2018 Accepted Answer
    @"björn_britz"

    A couple issues here.  It is useful for debugging FeatureScript to use the 'monitor' functionality in the FS console.  Open the console by pressing the '{✓}' at the top of the screen, and then press the "monitor" button next to the part studio you want to monitor.

    By doing this I first found that there was an issue with your sketch plane definition:


    I think this ends up being o.k. on the backend, but you should really be defining those as:
    plane(vector(0 * inch, 0 * inch, definition.Width / 4), vector(0, 0, 1));
    Otherwise the x and y values of the vector are unitless and the z value has a distance unit, which is not optimal for the system.

    The main problem here is the problem with the axis of the circular pattern:


    It would be nice if the system could accept definition.axis as a `Line`, but unfortunately (because `circularPattern` is a feature, and `definition.axis` actually represents a selection box in circular pattern's feature dialog) you must pass a Query in for that parameter.

    The easiest way to get around this would be to do something like:
    opFitSpline(context, id + "axis", { "points" : [origin, origin + (vector(0, 0, 1) * inch)] });
    const axis = qCreatedBy(id + "axis", EntityType.EDGE);
    And then use that `axis` as `definition.axis`.

    Hopefully this makes sense.  Let me know if you have additional questions.
    Jake Rosenfeld - Modeling Team
  • björn_britzbjörn_britz Member Posts: 14 EDU

    Thank you! it works just fine now.

    But I also had to set the parameter "equalSpace" : true for the pattern.


  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,418
    @"björn_britz"

    Oops! sorry about that!  Yes, 4 instances at 360 degrees with equal spacing ON is the same as 4 instances at 90 degrees with equal spacing OFF (if that makes sense).  Basically equal spacing chooses whether the instances are all spaced between 0 and `angle` (ON) or each spaced at `angle` further than the last (OFF).
    Jake Rosenfeld - Modeling Team
  • björn_britzbjörn_britz Member Posts: 14 EDU

    Now I'm trying to merge parts 1,2,3 and 4. I tried with "defaultScope": false and "booleanScope": Query but I couldn't manage to make it work. Any suggestions?

  • björn_britzbjörn_britz Member Posts: 14 EDU

    oh right, my bad.
    It works now!
  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,418
    Great to hear!
    Jake Rosenfeld - Modeling Team
Sign In or Register to comment.