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.
Part Draft
fastwayjim
Member, OS Professional, Mentor Posts: 220 PRO
So, my first stab at FS is going to be a "Part Draft" feature. I just want to query for a neutral plane, and a body - and I want the feature to split the body with the plane, then draft both sides.
I figured I'd start with the draft, then incorporate the split. I could get the draft working when I queried for the faces, but I'm having trouble getting FS to automatically find the faces. Here's the code
If I just query for draftFaces, I can get the draft to work, so I think there's something wrong with my intersect/filter?
Thanks for the help!
I figured I'd start with the draft, then incorporate the split. I could get the draft working when I queried for the faces, but I'm having trouble getting FS to automatically find the faces. Here's the code
If I just query for draftFaces, I can get the draft to work, so I think there's something wrong with my intersect/filter?
Thanks for the help!
Tagged:
0
Comments
In order to get the pull direction correct on both sides, the body needs to be split, and the second draft needs the direction flipped, then a union to put it back together. I'm going to do it all in one feature!
Linked[in]
See this paragraph in the docs for a slightly longer explanation.
qIntersectsPlane filters out entities from whatever is passed in as the first argument. The query I wrote asks "which of the bodies returned by draftBody intersect the neutral plane?" whereas what you want is "which of the faces owned by draftBody intersect the neutral plane". To do that, use
qOwnedByBody(definition.draftBody, EntityType.FACE) instead of definition.draftBody.
Linked[in]
Here's the code, I just used the qSplitBy to get the faces for the draft, and then I used a qUnion to get them both for the boolean. Is this a good/clean/smart way to do it?
Linked[in]
Linked[in]
Linked[in]
You can omit the "targets" : qUnion([]) line -- it's not required in this case as per the opBoolean documentation.
One more suggestion: for putting code into the forum, you can use the "code" option in the paragraph menu instead of pasting an image -- that way people can copy/paste your code e.g. to try it out or to reuse pieces.
Enjoy!
Linked[in]
Linked[in]