Feel free to download this geometrical driven dxf fretboard calculator. Instead of using a formula, I prefer driving the slot distances by use of geometry. Of course, it will be necessary to constrain the curves after having them imported. The procedure, how it has to be done with Siemens NX is described in the video below.
For a guitar fretboard, it is important to divide each octave into 12 parts – meaning you need 12 squares within half of the main scale distance. Those squares’ edges have to align a diagonal line as displayed in the video. Very important now: the 13. square’s edge length is half the value of the first square’s edge length. This can easily be constructed by using two additional curves, overlapping the first curve and having an equal length.