GreatLight CNC Machining Factory logo
CNC Machining
Rapid Prototyping
Materials
Industries
News
About GL

Get Instant Quote

3D printing design guide

How to Use Magnets in 3D Printed Models

This guide covers magnets in 3D printed models for parts that snap together and stay together: pocket sizing, polarity control, glue selection, and heat-set inserts. Written for design engineers and makers who need the joint to survive real handling, not just one demo.

Pocket clearance tablesPolarity controlGlue and heat-setPrint-then-insert
Magnets in 3D printed models seated in a closed pocket
Quick answer

Key takeaways

Pocket, then pausePrint a closed pocket and drop the magnet in at a pause, or leave the pocket open and glue it after.
Pocket 0.2 mm largerA round pocket about 0.2 mm over the magnet diameter seats by hand without cracking the wall.
Mark polarity before printingStack magnets on a steel screw, mark both faces with a paint pen, and keep the stack intact.
Adhesive is not optionalFriction alone fails after a few hundred cycles. Use cyanoacrylate or epoxy on the pocket floor.
Heat-set only in thick wallsPress-in inserts need at least 2.5 mm of surrounding material and a slow soldering iron.
Design first

Pick the magnet before you pick the pocket

Most failed magnet joints are decided at the CAD stage, not at the printer. A neodymium disc rated N35 to N42 gives the strongest pull for its size, but it is also brittle and chips if the pocket fights it. Nickel plating is standard and fine indoors; for humid or outdoor parts, look for epoxy-coated or stainless-housed versions.

Pull force falls off fast with distance. A N35 disc of Ø10 × 3 mm might hold 1.5 kg at zero gap and less than 300 g at 1 mm. Two magnets stacked in series double the thickness but do not double the pull. In most snap-fit covers, a pair of Ø6 × 2 mm discs is enough.

Temperature matters more than people expect. Standard N grades lose strength above roughly 80 °C, and a heated chamber or a hot-melt insert can push a pocket that far. Keep magnets at least 15 mm away from any hot end, heated bed edge, or insert you plan to melt in later.

  • 1
    N35 to N42Good pull per millimeter; brittle, so pocket walls must not squeeze.
  • 2
    Epoxy coatedBetter for humidity and wash-down parts than plain nickel.
  • 3
    Ø6 × 2 mm pairTypical size for small lids, trays and modular tiles.
Geometry

Pocket geometry and the clearances that hold

Print a round pocket 0.2 mm larger than the magnet diameter and 0.2 mm deeper than its thickness. A Ø10 × 3 mm disc goes into a Ø10.2 × 3.2 mm pocket. That gap absorbs the usual FDM tolerance of ±0.1 to ±0.2 mm and still leaves the magnet sitting below the surface for a clean joint.

If you want a flush face, print the pocket 0.1 mm deeper and cover the magnet with a 0.4 mm printed skin. Two perimeters at 0.2 mm layer height is enough. The skin costs you roughly 0.4 mm of gap, so size the magnet up if holding force is tight.

Wall thickness around the pocket should be at least 1.2 mm on FDM and 0.8 mm on resin. Thinner than that and the layer lines split when the magnet snaps in. Add a small chamfer at the pocket mouth if you are pressing magnets in by hand; it stops the corner of the magnet from shaving the wall.

  • 1
    +0.2 mm on diameterCovers printer tolerance without letting the magnet rattle.
  • 2
    +0.2 mm on depthLeaves room for adhesive under the magnet.
  • 3
    1.2 mm minimum wallThinner walls crack on press-in assembly.
Polarity

Polarity: the mistake that wastes a print

Magnets in 3D printed models fail most often because one pocket got the wrong pole. Before anything else, stack your magnets on a steel screw so they self-align, then mark the outward face of every magnet with a paint pen. Keep the stack together until each magnet is in its pocket.

A simpler rule works for two-part assemblies: all magnets on part A face the same way, all magnets on part B face the opposite way. If you flip one, the halves repel and no amount of glue fixes it. Test the pair outside the print before you commit to adhesive.

When you pause the print to insert magnets, drop them in with tweezers and check seating with a straight edge. A magnet sitting 0.3 mm proud will hit the nozzle on the next layer. If it does not sit flat, stop the print; a reprint costs less than a scrapped assembly.

  • 1
    Mark before you separateOne paint dot per outward face, applied while the stack is intact.
  • 2
    Mirror the patternPart A and part B use opposite outward poles.
Assembly

Gluing and heat-set methods compared

Cyanoacrylate gel is the default for PLA, PETG and ABS pockets. It fills the 0.2 mm gap, sets in under a minute, and does not need clamping. Epoxy gives a stronger bond on resin and on parts that see heat, but it needs 24 hours to reach full strength.

Heat-set inserts and press fits are a different approach: print the pocket slightly undersized, then warm the magnet and push it in with a soldering iron at 200 to 250 °C. This works well in thick resin walls, but it can crack thin FDM walls and it exposes the magnet to heat. Use it only when the surrounding material is at least 2.5 mm thick.

For parts that must stay clean, seal the pocket opening with a drop of epoxy after insertion. This keeps moisture out and stops the magnet from creeping toward the surface over hundreds of cycles. Do not use hot glue; it creeps under load and softens in a car interior.

  • 1
    CA gelFast, no clamp, good for most desktop prints.
  • 2
    Two-part epoxyStronger and heat resistant; 24 hours to cure.
  • 3
    Heat-setOnly in walls of 2.5 mm or more.
Testing

Checking holding force before you print ten of them

Print one test coupon with the exact pocket and magnet you plan to use. Measure the pull with a spring scale or a luggage scale hooked to the mating half. Record the number, then cycle the joint 50 times and measure again. A drop of more than 20 percent means the pocket is loose or the adhesive did not wet the floor.

Air gap is the biggest lever. Every 0.1 mm of printed skin or paint between the two magnets costs measurable force. If the joint feels weak, remove the cover skin before you change the magnet grade.

When the part is a functional assembly rather than a display model, plan a mechanical backup: a small lip, a screw, or a snap tab. Magnets should locate and hold, not carry the whole load. That single design habit removes most field failures.

  • 1
    Test coupon firstOne print tells you more than a pull-force table.
  • 2
    Cycle 50 timesHolding force should stay within 20 percent.
  • 3
    Add a backupA lip or tab takes shock loads off the magnet.
Step by step

Step by step: embedding magnets in a print

Work through these in order. Skipping the polarity step is the most common cause of a wasted print.

  • 1
    1. Measure the magnetUse calipers, not the catalog. Nickel plating adds 0.02 to 0.05 mm. Record diameter and thickness to 0.01 mm.
  • 2
    2. Size the pocketAdd 0.2 mm to diameter and 0.2 mm to depth. Keep walls at 1.2 mm minimum on FDM.
  • 3
    3. Add the pauseIn the slicer, insert a pause at the layer where the pocket roof begins. Confirm the height in the preview before exporting.
  • 4
    4. Mark polarityStack magnets on a steel screw, mark the outward faces with a paint pen, and keep the stack together.
  • 5
    5. Insert at the pausePlace magnets with tweezers, check they sit flush with a straight edge, then resume. Never let one sit proud.
  • 6
    6. Glue open pocketsFor print-then-insert designs, apply CA gel or epoxy to the pocket floor and press the magnet in. Wipe squeeze-out immediately.
  • 7
    7. Seal and cureAdd a thin epoxy cap over the opening and let it cure 24 hours before the part sees load.
  • 8
    8. Pull-test the pairCheck holding force, cycle the joint 50 times, and recheck. Adjust the pocket, not the magnet, if it drifts.
Decision table

Which embedding method fits your part

Pick the row that matches your wall thickness and production quantity.

MethodBest forWall thicknessWatch out for
Pause and insertClosed pockets, clean faces1.2 mm or moreNozzle hits a proud magnet
Print then glueOpen pockets, one-off parts1.0 mm or moreGlue squeeze-out on the face
Press fitResin parts, tight tolerance1.0 mm or moreCracks in brittle resin
Heat-set insertThick walls, repair work2.5 mm or moreHeat weakens N-grade magnets
Captive in resinSLA parts with smooth skins0.8 mm or moreMagnet shifts before cure
FAQs

Common questions

Do I need to pause the print to add magnets?

Only if you want a fully closed pocket. A pause at the roof layer lets you drop the magnet in and print over it, which hides the magnet completely.

Open pockets are easier: print the pocket, then glue the magnet in afterward. The joint is slightly less clean but far more forgiving on a first attempt.

How much clearance should a magnet pocket have?

Start with 0.2 mm over the magnet diameter and 0.2 mm over its thickness. That covers typical FDM tolerance of ±0.1 to ±0.2 mm.

If the magnet drops in loose enough to rattle, tighten to 0.1 mm. If it will not seat by hand, open the pocket rather than forcing it; forcing chips the nickel plating.

Will glue hold a magnet in a 3D printed part?

Yes, if the pocket floor is flat and clean. Cyanoacrylate gel bonds well to PLA, PETG and ABS and sets in under a minute.

Epoxy is stronger and more heat resistant but needs 24 hours. Avoid hot glue; it creeps under load and softens in a warm enclosure.

How do I stop magnets from going in the wrong way?

Stack the magnets on a steel screw so they self-align, then mark the outward face of each with a paint pen before you separate them.

For two-part assemblies, use the rule that all magnets in part A face one way and all magnets in part B face the other. Test the pair outside the print first.

Do magnets lose strength during printing?

Standard N-grade neodymium magnets lose strength above roughly 80 °C, so keep them away from the hot end and heated bed edge.

A normal FDM chamber at 40 to 60 °C is fine. If you heat-set a magnet with a soldering iron, expect some loss and size the magnet accordingly.

How many magnets does a snap-fit cover need?

Two magnets per corner pair is usually enough for a small lid or tray. A pair of Ø6 × 2 mm discs holds most desktop-size covers.

Larger panels need more pairs or bigger discs. Add a locating lip so the magnets only carry the closing force, not the shear load.

Need the housing machined instead of printed?

Send us your model and we will return a quotation with free DFM analysis within 12 hours.

12-hour quote100% inspectionNo minimum order quantity

Follow

More from GreatLight

We publish setup notes, tooling trials and inspection data from the factory floor.

FacebookTikTokYouTubeLinkedInInstagramThreadsPinterest

Trusted by engineers and manufacturers worldwide

Tesla Ford Motor Company BYD Auto Denso Magna International Boeing Airbus Medtronic KUKA FANUC