What would be the best way to close this up using the ruby API?

I’m trying to figure out how to close this component up to make it look like the below picture but I am not having much luck.

exmple1.skp (100.4 KB)

The edges of the 2 openings are not on the same plane, so automatic closure using edge.find_faces is not going to work.

The two bump outs need to be connected in some way that you know the vertices will connect.
(You haven’t told us what the “rules” are, just an image, so we don’t have a clue.)

And what is to be done for the bottom surface where the notch is ?

exmple2.skp (110.5 KB)

Create the extra “hook” geometry as a solid group, move it into place in the corner, and combine using Outer Shell boolean.

EDIT: Actually you can put the group instance in the right place and then add geometry.
It just must be outside the other component’s entities so that the boolean operation will work.

Sorry the bottom should be notched too. I tried find faces already but I couldn’t get that to work. The second group thing you made looks promising. I have attached an skp that is the goal that I am going for although it has more lines than I would like it to have. How did you seperate the top and bottom parts?
goal.skp (119.5 KB)

I entered the component, then window selected, CTRL+X, exited the component and CTRL+Paste.

Then I had to cleanup the component because it lost faces.
I also had to add the side and bottom faces for the “hook” shape.

Try to think about getting to the goal in baby steps. removing a notch on the bottom could be a last step.

Ah, I see. I can do it in the window as well but I am trying to do this using the API. I so far have just been using the bottom points to create a solid and using outer shell it to combine the two, but it does leave the weird looking overhangs like you see in the first post.

It looks to me like the “hook” solid was positioned too low.

The way this is built is from a followme method. I solved this issue by using a square geometry following the triangular geometry and subtracting that out of the second group. Then I followed that up with an outershell to achieve the desired shape.

It’s probably hard to follow without pictures but the code I wrote is a little too convoluted to throw on here.

1 Like