<p>Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.</p></p><strong>First time visiting? Here are some places to start:</strong></p><ol style="list-style:inherit;margin-left:25px;"><li>Looking for a certain topic? Check out the <a href="https://forum.onshape.com/categories">categories filter</a> or use Search (upper right).</li><li>Need support? <a href="https://forum.onshape.com/post/question/community-support">Ask a question</a> to our <a href="https://forum.onshape.com/categories/community-support">Community Support</a> category.</li><li>Please submit support tickets for bugs but you can request improvements in the <a href="https://forum.onshape.com/categories/product-feedback">Product Feedback category</a>.</li><li>Be respectful, on topic and if you see a problem, Flag it.</li></ol><p>If you would like to contact our Community Manager personally, feel free to <a href="https://forum.onshape.com/profile/6/LouGallo">send a private message</a> or <a href="mailto:lgallo@onshape.com">an email</a>.
</p>

difficulties with circular pattern of an opSphere

björn_britz
bjö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_Rosenfeld
    Jake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646 image
    edited October 2018 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

  • MBartlett21
    MBartlett21 Member, OS Professional, Developers Posts: 2,064 ✭✭✭✭✭
    Try looking up the documentation of getRemainderPatternTransform https://cad.onshape.com/FsDoc/library.html#getRemainderPatternTransform-Context-map
    mb - draftsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • Jake_Rosenfeld
    Jake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646 image
    edited October 2018 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_britz
    bjö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_Rosenfeld
    Jake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646 image
    @"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_britz
    bjö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_britz
    björn_britz Member Posts: 14 EDU

    oh right, my bad.
    It works now!
  • Jake_Rosenfeld
    Jake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646 image
    Great to hear!
    Jake Rosenfeld - Modeling Team