Magnets in 3D Prints: Pocket Geometry, Polarity and Heat Limits That Actually Hold

Magnets in 3D Prints: Pocket Geometry, Polarity and Heat Limits That Actually Hold

Magnets are the quietest way to make a printed part behave like a product. A lid that snaps shut with a satisfying click. A tool holder that grabs a wrench without a bracket. A removable panel with no visible fastener, no screw boss to strip, no clip to fatigue. The magnet does the work and the print just holds it.

That last part is where most designs go wrong. Holding a magnet is not the same as holding a screw. A magnet pulls on its own pocket from every direction at once, it loses strength as it heats, it can shatter under compression, it demagnetises if you get the temperature wrong, and if you install it backwards the part is scrap. This guide covers the whole chain: pocket geometry, insertion timing, polarity discipline, heat budget, retention maths and the failure modes that only show up six months later.

Why Printed Magnets Fail: The Four Mechanisms

Before the design rules, understand what you are defending against. Nearly every failed magnetic print traces back to one of these four.

Failure What happens Root cause
Pocket delamination Layer above the pocket lifts and the magnet launches out under load Only a few layers of material bridge the pocket roof; inter-layer bond is the weakest axis in FDM
Magnet fracture Neodymium cracks into pieces inside the pocket Grade N42 and above are brittle and sintered; press-fitting cold into a tight pocket in a stiff material does it
Permanent loss of strength Magnet still installed but noticeably weaker Exceeded max operating temperature during printing or hot-glue installation; partial demagnetisation is irreversible
Polarity scrap Magnet faces the wrong way; part repels instead of attracting No polarity convention in the workflow, and pockets are sealed so the magnet cannot be flipped

Note the asymmetry: three of the four are irreversible once the part is printed. You cannot un-delaminate a pocket, un-crack a sintered magnet, or restore lost remanence. Printed magnets reward getting the process right the first time more than almost any other feature.

Pocket Geometry: The Numbers That Matter

A magnet pocket is a blind hole with a roof, and that roof is a bridge. Treat it with the same caution as any other bridging feature.

Roof thickness

The single most important number is how much material sits between the magnet and the outside world. Too thin and it delaminates under magnetic pull; too thick and you lose effective holding force, because magnetic field strength falls off steeply with distance.

Roof thickness Result Verdict
1 layer (0.2 mm) Cosmetic closure only; pops open under any real load Never for a functional closure
2-3 layers (0.4-0.6 mm) Light duty: fridge magnets, small lids, alignment pins Acceptable with 5+ perimeters
0.8-1.2 mm The practical sweet spot for most functional closures Recommended default
1.5-2.0 mm Strong retention, but you may need to step up one magnet size For high-shock or safety-relevant holds

The rule of thumb: air gap and material both count as distance. A 6 mm diameter N42 disc rated at roughly 1.4 kg of pull on steel loses a large fraction of that through a 1 mm printed roof. If you need the rated force, either thin the roof or size the magnet up.

Pocket clearance and the glue gap

Do not design the pocket to the nominal magnet dimension. Sintered neodymium discs are not precision parts and typically vary by a few hundredths of a millimetre, and your printer adds its own dimensional error on top.

  • Dry-fit pause insertion: 0.15-0.25 mm radial clearance. Tight enough to align, loose enough to drop in without force.
  • Post-print insertion into a sealed pocket: 0.3-0.4 mm for glue. The gap is intentional; the adhesive is the retention, not the fit.
  • Never rely on interference fit in a stiff material. Pressing a brittle magnet into PLA or polycarbonate is the fastest way to crack it. If you want a press fit, do it in TPU where the material yields instead of the magnet.

Floor and walls

Give the pocket a floor of at least 3-4 layers (0.6-0.8 mm). Without it the magnet rests directly on infill and the roof bridges over an unsupported void, which is a delamination waiting to happen. Set the pocket region to solid or high-density infill for at least two perimeters around it, and raise perimeters locally to 4-6 walls so the pocket has real sidewalls rather than sparse infill walls.

Print-in-Place vs Pause-and-Insert

There are three ways to get a magnet inside a print and they are not interchangeable.

Method How it works Best for Watch out for
Pause and insert (captive) Slicer pauses at the roof layer; magnet dropped into the open pocket; print resumes and seals it Sealed, tamper-proof, no visible magnet; the default for production parts Magnet must be at the top of the print when the pause triggers; nothing can shift on resume
Open pocket, glue after Pocket is open to one face; magnet glued in after printing Prototypes, reworkable designs, parts where the magnet face must sit flush with the surface Adhesive gap changes the air gap; glue can wick onto the working face
Press fit after print Undersized pocket, magnet forced in Flexible materials only Brittle magnets crack; scrap rate is high

For pause-and-insert work, the magnet has to be the topmost feature at the pause layer. Design the pocket so it opens upward and the roof is printed over it. If you have magnets at several heights, slice the model with multiple pauses or split the part and assemble it.

Pause-and-insert checklist

  1. Model the pocket as a blind cavity opening upward, with 0.15-0.25 mm radial clearance.
  2. Slice, then move the pause to the layer before the roof starts - not the layer where the roof finishes.
  3. Add a small rim or shoulder if the magnet could slide sideways on resume; the nozzle passing over it will nudge a loose disc.
  4. Confirm magnet orientation with a marker or a stack of already-oriented magnets before the print starts, not during the pause.
  5. On resume, watch the first bridging layer. A magnet sitting proud of the pocket by even 0.3 mm will be hit by the nozzle.
  6. For high volumes, print a small alignment jig so every magnet goes in the same way - see the related guide on workshop jigs and fixtures.

Polarity: Build the Convention Before You Build the Part

Polarity errors are the most expensive mistake in this whole workflow because they are invisible until the two halves meet, and by then the pockets are sealed. A magnet stack kept as one oriented column, plus a written convention, eliminates the problem entirely.

  • Keep one master stack. Stack all your supply magnets into a single column so every magnet in it has the same orientation. Break magnets off that stack one at a time as you insert them.
  • Mark both halves at the same time. When inserting into a matching pair, do the top half and the bottom half in the same session with the pair physically facing each other.
  • Define the convention explicitly. For example: the marked face always points into the part, toward the print bed. Write it down on the project file, not in your head.
  • Test the closure after the pause, before the roof. This is the only moment where a mistake is still cheap to fix.
  • For polarity-critical assemblies, consider reversibility. A shallow open pocket with a glued magnet can be dug out and redone; a fully captive magnet cannot.

Heat: The Temperature Budget You Are Spending

Neodymium magnets do not have a single melting point; they have a temperature above which they permanently lose remanence. Exceed it and the magnet still looks perfect but is measurably weaker, and the loss does not come back.

Grade Max operating temp (approx.) Consequence of exceeding
N35 - N42 (standard) 80 C Irreversible loss; can be severe
N42SH - N45SH 150 C Higher cost, needed for heated environments
N48H and above 120 C+ Specialty grades for high-temp assemblies
Bonded / flexible magnet Often 60-80 C Weaker to begin with; sensitive to heat

Two practical dangers. First, hot-glue installation: a standard hot-glue gun runs well above 100 C and can partially demagnetise an N42 disc. Use a low-temperature adhesive or an epoxy that cures at room temperature. Second, printing directly onto a magnet: the nozzle is not the problem, but the bed and chamber are. Printing ASA in an actively heated chamber, or annealing a part with magnets already inside, can push a standard-grade magnet past its limit.

The correct sequence for heat-sensitive materials: anneal first, insert second. If the magnet has to be captive and the material needs annealing, split the part, anneal the shell, then assemble with adhesive. Related reading on the annealing trade-off is covered in the guides on dimensional accuracy and tolerances.

Which Material to Print the Pocket In

The pocket material affects three things: whether the pocket roof survives, how the magnet behaves thermally, and whether the pocket can flex instead of cracking the magnet.

Material Pocket behaviour Suitability
PLA Stiff, strong, but low heat resistance; good layer bonding Great for indoor closures and display pieces. Avoid hot cars and direct sun.
PETG Slightly flexible, resists cracking, moderate heat resistance The best all-round choice for magnetic pockets. Forgiving of minor gaps.
ABS Higher heat resistance, stiff, prone to warp on large flat pockets Good for warm environments; needs an enclosure.
ASA Like ABS but UV-stable Outdoor magnetic mounts and enclosure doors that see sunlight.
TPU Highly elastic, absorbs shock, no brittle fracture Use when the part will be dropped or the magnet is press-fitted. Low stiffness means the pocket must be thicker.
PETG-CF Stiffer and more dimensionally stable, but more abrasive and more brittle Precision alignment features; needs a hardened nozzle.

A practical pairing that works well: PETG pockets with PAUSE-inserted N42 discs. PETG's slight compliance buffers small tolerance errors, it tolerates the moderate heat of a warm enclosure, and it bonds well enough between layers to bridge a 1 mm roof reliably.

Retention: How Much Force Do You Actually Need?

Holding force is not a single number. It depends on the air gap, the steel or magnet on the other side, and the direction of the load. Size the magnet from the load, not from what fits.

  • Alignment only (no load): small 4x2 mm or 5x2 mm discs. They just keep two parts registered.
  • Light closure (lids, trays): 6x2 mm to 8x3 mm discs, two per closure.
  • Firm hold against vibration: 10x3 mm or larger, four per closure, or switch to a pair of magnets rather than magnet-to-steel.
  • Safety-relevant hold: do not use magnets as the primary retention. Use them for alignment and a mechanical latch for the load.

Two design notes that matter more than raw grade. First, magnet-to-magnet attraction is stronger than magnet-to-steel because the steel plate must be thick enough to saturate; thin steel wastes most of the field. Second, pull force is measured perpendicular to the face. Sliding shear loads and peeling loads are handled far worse, which is why a magnetic closure that resists straight pull can still slide open sideways. Add a mechanical shoulder or lip to take the shear, and let the magnet do only the clamping - the same principle that makes print-in-place mechanisms reliable.

Sealing, Corrosion and Weather

Raw neodymium magnets corrode. The nickel-copper-nickel plating on a standard disc is thin and will pit in humid or salty air, and once the plating is breached the magnet crumbles from the inside. Fully captive pockets with a sealed roof are inherently protected, which is one more argument for pause-and-insert over glued open pockets.

If the magnet face must be exposed, choose a coated or epoxy-sealed magnet and keep the exposure to a single face. For outdoor parts, combine a UV-stable shell such as ASA with a sealed pocket, and dry the filament before printing - trapped moisture blows pinholes through thin pocket walls and gives corrosion a path in. The guides on dimensional accuracy cover the fit side of this in more detail.

Design Review: Ten Checks Before You Print

  1. Is the magnet the topmost feature at the pause layer?
  2. Is the pocket roof at least 0.8 mm, and is that region printed solid with 4-6 perimeters?
  3. Is radial clearance 0.15-0.25 mm for a drop-in fit?
  4. Is there a 0.6-0.8 mm floor, so the roof is not bridging over infill?
  5. Is the polarity convention written down, with a single oriented master stack prepared?
  6. Is the magnet grade rated above the maximum temperature the part will see - including annealing and chamber temperature?
  7. Is the pull force two to three times the expected static load?
  8. Is there a mechanical shoulder to take shear and peel, not just the magnet?
  9. Could the part be dropped or shock-loaded? If so, is the pocket in a compliant material such as PETG or TPU rather than something brittle?
  10. If the magnet is exposed, is it coated, and will the shell survive UV and humidity?

The Half of the Problem Nobody Mentions

Magnetic retention is often chosen because it looks cleaner than a fastener. It is cleaner, but it is not simpler. A screw boss fails loudly and is repairable; a captive magnet fails silently as a slightly weaker pull, and the part has to be reprinted. The engineers who get good results from magnetic designs are the ones who treat the pocket as a structural feature with a stress budget, not as a hole with a magnet dropped in.

Get the roof thickness, the clearance, the polarity convention and the temperature budget right, and magnets become one of the most reliable features in functional 3D printing. Skip any one of them and you will find out months later, when the parts are already in service.

For the pocket material itself, start from a filament you can trust batch to batch - print quality problems in the pocket show up as retention problems in the field, not as visible defects on the bench. A solid understanding of part strength fundamentals is the right foundation before designing anything that has to hold a load.

Related reading: print-in-place and flexible hinges, tuning dimensional accuracy for PLA, PETG, ABS and TPU, and designing functional threads and inserts.


Resin Prints in Solvents, Oils and Caustics: What Survives and What Swells

Gears You Can Actually Print: Module, Backlash and Tooth Geometry That Hold Up