Resumen
We describe a framework to assemble permanent-magnet cubes in 3D-printed frames to construct dipole, quadrupole, and solenoid magnets, whose field, in the absence of iron, can be calculated analytically in three spatial dimensions. Rotating closely spaced dipoles and quadrupoles in opposite directions allows us to adjust the integrated strength of a multipole. The contributions of unwanted harmonics were calculated and found to be moderate. We then combined multiple magnets to construct beam-line modules: a chicane, a triplet cell, and a solenoid focusing system.