I'd like to draw an example of a tridimensional mass-spring system in LaTeX (preferably with TikZ or Asymptote). See the example below:

Mass-spring system example from Gibson & Mirtich 1997

(this one was taken from the article by Gibson and Mirtich (1997) here)

If possible, I want the coils to be realistic, like the example here.

Minimal (partially working) example follows. I only need to connect the dots in each plane with springs to finish it:



    settings.tex = "lualatex";

    import three;
    settings.prc = false;
    settings.render = 0;


    currentprojection = orthographic(-1, 0.5, 0.5, up=Y);
    draw(unitbox, pink);

    for (int i = 0; i <= 3; ++i)
      for (int j = 0; j <= 3; ++j)
        // plane "X" in Unity
        dot((0, i/3, j/3), magenta);
        // plane "Y"
        dot((i/3, 1, j/3), red);
        // planz "Z"
        dot((i/3, j/3, 1), black);


Demo of a mass-spring system in Asymptote

How can I finish it?

  • If you name the coordinates (e.g. P\i.\j) you could connect them with decorations or shapes (circuitikz fancy inductor comes to mind). Aug 31, 2016 at 19:22
  • Alas, I cannot find asymptote.sty. Aug 31, 2016 at 19:28
  • You could try to give it three point perspective, to give it more realism.
    – Manuel
    Aug 31, 2016 at 19:33

1 Answer 1


Would you be happy with springs like these?




        amplitude = 1.5mm,
        pre length=1mm,
        post length=1mm,
    every node/.style={circle, draw}

\foreach \x in {0,4,...,12}{
    \foreach \y in {0,3,...,6}{
        \foreach \z in {0,3,6}{
                \node[fill=black!\z0] (n\x\y\z) at (\x,\y,\z) {};
                    \draw[decorate] (n\x\y\z) -- (n\lastx\y\z);
                    \draw[decorate] (n\x\y\z) -- (n\x\lasty\z);
                    \draw[decorate] (n\x\y\z) -- (n\x\y\lastz);



enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.