An idea for a script to create pockets

Next
 From:  ed (EDDYF)
8152.1 
With a new 3D Printer on the way in January, I’m getting several projects designed in MoI in advance.

A common design element in 3D printed parts are pockets to hold metal items such as small bearings, nuts, and heat-set threaded inserts, to name a few.

My current project has 20 heat-set threaded brass inserts. To create the pockets I create a solid object in the shape of the pocket, duplicate the object 20 times, rotate and place the objects individually as needed, and Boolean-diff.

I’d like to save some effort and let the computer do most of the work. My thought is to make pre-defined 3DM objects for Boolean-diff in a directory. (Much like Max’s object library). The objects would get designed such that the top is always orientated up.

On the model I’d like to select multiple points or corners of 2D curves, pick a single object from the library (by selecting the name from a drop-down menu), and have the corresponding pockets created automatically.

The scrip would need to automatically orient the top of the object to be on the same plane as the 2D curve that contains the selected point.

So in actual usage I envision looking at the side view of a cube for example. Select the four edges of the cube’s face, Ctrl-C, Ctrl-V to create 4 curves from those edges. Join the 4 edges into a closed curve. Offset the curve by 25mm and show points. Select the four corner points of this offset curve and pick the desired object from the menu. The script orients the object’s top to the face of the cube and Boolean-diff to create the 4 pockets.

Maybe I’m missing an easier workflow. At any rate, I’m looking for a way to simply pick one or more points, pick an object, and make pockets from that object. All without duplicating, rotating, and positioning objects individually.

Any ideas? Is it possible with a script?

Ed Ferguson

Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
8152.2 In reply to 8152.1 
Hi Ed, if you have the cutting object saved in its own 3DM file positioned around the origin and oriented upwards, you might try using the "ImportPart" command to bring it in - that's available by right clicking the File > Import button or by setting up a shortcut key with ImportPart as the command name.

When you run ImportPart it will be similar to running the Transform > Orient command for placing the object, except the base point will be automatically picked as the origin point in the file. That may save you some steps.

I'm not sure it's very feasible to do what you're describing with a script currently, things like analyzing an object to determine its normals, so that part of the script that you're describing would be difficult to do right now I think.

I want to add in a function for "Depth limited" booleans so you could use a curve as a cutting object but give it a depth to cut by rather than just cutting all the way through like it does now, would that help? Hopefully I'll be able to work on that for v4.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  ed (EDDYF)
8152.3 In reply to 8152.2 
Thanks Michael -

I'll try a workflow that involves the Copy-Move command along with the Alignment tools.

"Depth limited" booleans are a good idea for the future.

In my case, the blind holes usually have stepped diameters, so I have to boolean with a corresponding solid.

Ed Ferguson
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All