Some time ago, i wrote some Klipper macros to pause a print and move the
head out of the way, to allow a nut/whatever to be inserted, and then
carry on printing. I recently needed to encapsulate some small neodymium
magnets into some hooks, so that caution notices could be attached to
metal clad switchgear. Easy enough, except as my printer nozzle is
hardened steel, there would be problems trying to finish the print after
the magnets were inserted. I have no intention of messing about with
epoxy resins or glues for holding magnets to plastic.
I've attached some code that produces small magnet holders, with a ring
for attaching thread/wire/whatever. It will take any size cylindrical
magnet, needs no supports when printing, and once the magnet is
inserted, then the plug is a snug fit and can be pressed in with pliers.
The wall thickness and clearance values are fine for my printer, using
PET-G filament, but may need to be different for a more brittle
material, such as PLA. With a layer height of 0.2 or 0.28 mm, and 0.4 mm
nozzle, it only takes a few minutes to print. Print them solid (in
Cura, setting 'wall line count' to 50, will do that good enough).
Have fun measuring your magnets using steel calipers 😉