Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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_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!
0
Best Answers
-
@"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 Team1 -
@björn_britz
I took a look at your document, and it looks like you're trying to do these boolean operations on `opExtrude`? `opExtrude` does not have a boolean option. The `extrude` function (and therefore the extrude feature of the part studio) has those boolean options by way of first calling `opExtrude` to make the necessary extrusions, and then `opBoolean` to to boolean everything together. You could switch to using `extrude` if you want, but my suggestion would just be to collect all the bodies you want to joint together and call `opBoolean` on them.
Take note that if the bearings and the retaining ring only touch at one point, the boolean will fail because of that singularity (this would be a non-manifold body, which we do not support). You may have to overbuild the spheres if this is the case.Jake Rosenfeld - Modeling Team5
Answers
-
Try looking up the documentation of
getRemainderPatternTransformhttps://cad.onshape.com/FsDoc/library.html#getRemainderPatternTransform-Context-map1 -
@"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 Team1 -
Thank you! it works just fine now.But I also had to set the parameter "equalSpace" : true for the pattern.
0 -
@"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 Team0 -
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?
0 -
@björn_britz
I took a look at your document, and it looks like you're trying to do these boolean operations on `opExtrude`? `opExtrude` does not have a boolean option. The `extrude` function (and therefore the extrude feature of the part studio) has those boolean options by way of first calling `opExtrude` to make the necessary extrusions, and then `opBoolean` to to boolean everything together. You could switch to using `extrude` if you want, but my suggestion would just be to collect all the bodies you want to joint together and call `opBoolean` on them.
Take note that if the bearings and the retaining ring only touch at one point, the boolean will fail because of that singularity (this would be a non-manifold body, which we do not support). You may have to overbuild the spheres if this is the case.Jake Rosenfeld - Modeling Team5 -
0
-
Great to hear!Jake Rosenfeld - Modeling Team0


