# Adding a gap to a boolean difference for printing

Apologies if this is covered elsewhere. I looked through the docs and didn’t see it.

I’m producing some parts for 3-D printing some of which will screw together and some be a push fit. Boolean differencing looks like a great solution (particularly elegant for the screw thread female component) but the advice from the printing company is to leave a gap, say 0.5mm, so that parts will actually push/screw together rather than having an exact sized component being too big to push in.

Is there a way to do this neatly in Rhino? I’m thinking of some made-up command like “Make this hollow cylinder in the solid 0.5mm bigger in radius but leave everything else in the solid unaltered”.

I’m wary of just dragging points in case I accidentally create an oval shape and parts start to fit badly.

Could you let me know what you think? Many thanks.

Phil

This is tricky but possible… the issues that are tricky are all the geometry conditions I’m imagining might exist in your model like keeping an exterior wall in place while only scaling an interior threaded surface. If you have a model you can upload of at least the female threaded portion that would be helpful. I’m imagining needing to extract the thread surfaces and use Scale2D on them from an origin point coincident with the center of the bottom plane of the part. Then remodel the flat surface which bridges the inner thread to the outer wall.

I think maybe an offset of the thread surfaces, on both sides, ideally.

-Pascal

Thanks, Brian and Pascal. I did some experiments and came up with something that I think works. Let me know what you think.

I have two problems to solve

1. A cuboid shaped rod that moves vertically up and down in a slot. As discussed, this can’t be an exact boolean diff otherwise the rod is likely to be such a tight fit it won’t move at all.

The solution is, I think

• make a copy of the rod
• extrude the left face to the left by 0.5mm
• extrude the right face to the right by 0.5mm
• use the copy for the boolean diff
• delete the copy
1. A screw thread needs to rotate freely without sticking
• wrap a helix around a cylinder with center at 0
• make a copy
• select the copy using a window (so helix and cylinder are selected)
• use Scale2D, selecting the origin as the centre, the point (say) 4,0,0 as the first point and 4.25,0,0 as the second point
• this enlarges the bolt and helix
• now build up the thread profile with a half-circle as described in the YouTube video (do this for both the original and the copy)
• use the copy when doing the boolean difference to make the female part
• delete the copy

I’m thinking it’s best to build up the thread profile after the Scale2D, otherwise the thread profile itself would be enlarged, which I don’t think I want.

Best regards

Phil

I still think that strictly speaking, offsetSrf will get you a more consistent set of surfaces than scale for the threads- they are not equivalent…

-Pascal

Thanks. I didn’t try offsetSrf. When I did it just now, I noticed that it offsets the top and bottom as well as the side of the cylinder, which isn’t what I want as I’m presuming that would stretch the thread slightly along the axis. Is there a way you know of to select just the cylinder side for the offset so the cylinder gets wider but not longer?

If I understand the problem, what I think you need to do to do it right is to build the object using offsets of the ‘ideal’ thread surfaces, and any surfaces where you need clearance, rather than mess with scaling afterwards which, depending on the situation, is going to result in inconsistent clearances.If that matters, of course- it may not, much.

-Pascal

Thanks, Pascal. I’ll keep experimenting with offsets as I go. There’s going to be some initial experimenting with the 3D printing, anyway, as I’m presuming the suggestion of 0.5mm gap is an approximation.

Phil

all my models i do with rhino are printed and i know exactly what you are talking about and what the print company is looking for. offsetsrf is what you want. a .005" offset will usually give you a fit that has no slop to it but the parts can slide together. .007" is a little more free moving and .010" will give you an easy free movement with just a little wiggle room. offsetsrf doesnt stretch anything. it simply encapsulates your model with a surface which follows the contours of the original surface. it makes you that copy which you can use to boolean with then delete the copy.

actually, it’s scaling that will stretch the threads (angles will change… relationships between the parts will change… etc)

offsetting will maintain all the angles and whatnot and just make the parts bigger/smaller… if you don’t want to offset vertically (re: your picture) don’t include the top&bottom surfaces in your offset selection.