-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Radius selector #501
Comments
I think there is a potential method to extract radii. I can get the radius of the circles from the above code with: objs = part.faces(">Z").edges("%CIRCLE").vals()
for obj in objs:
print(obj._geomAdaptor().Circle().Radius()) I don't know enough about OCCT to know if this is the appropriate method, but ignorance is bliss so I'm happy to plow ahead and write a selector (and a bunch of tests for it) based off this method. |
I've run into the same thing before when selecting circles and just ended up using a box selector. It would be nice to have a shortcut for it. This is tangentially related to a discussion on Discord last week on selecting a circular edge by edge length. It seems like that would be complementary to this for when you're not dealing with a whole circle. You can calculate the edge length, and then select using a length tolerance. Below is the code that I put together, but as Adam rightly pointed out at the time, I went the long way around to get the length of the edge.
And here's what @shimwell ended up with after cleaning up my code. |
My cqkit library has a r = (
cq.Workplane("XY")
.circle(2)
.workplane(offset=3, centerOption="ProjectedOrigin")
.circle(3)
.loft()
)
rs = RadiusSelector(2)
assert r.edges(rs).size() == 1
rs = RadiusSelector(3)
assert r.edges(rs).size() == 1 |
Planning to make good use of that length selector and made an area selector in the same way that you taught me @jmwright . Thanks for your help. A radius selector sounds like a great idea. |
@marcus7070 do you want to backport the selector from cqkit then? |
Yes, I'll do that in the next few days. I see @michaelgale also used the |
OK, |
I think there is a need for a radius selector. All of CQ's current selectors work of the centre of an object or the bounding box. So if you have the following shape for example:
and you want to fillet just the outer edges and not the inner, the only selector that you can use is some ugly combination of bounding boxes.
A radius selector in the style of
DirectionNthSelector
would be a good addition IMHO.The text was updated successfully, but these errors were encountered: