In order to create a captive part, we're going to create a pocket in the middle of the larger part for the smaller part to be sit in.

But how will we get it in there, you ask? It's quite simple, actually. We pause the print midway through, insert the part to be embedded, and let the printer continue printing on top of it. No ship-in-a-bottle magic required!

While a variety of components can be embedded, it is important to consider how they will be oriented. Flat objects are generally easiest, as the print head must be able to clear the top of the embedded part. This should also be taken into consideration when orienting the larger part itself.

Minimizing the height of the embedded part in the Z-axis while creating your larger part in a way conducive to 3D printing is a skill that will take some practice. That said, once you have the skill mastered, the time invested into an intelligent design will prevent the need for multiple parts, complex creations, or adhesives.