import meshtools
import constants
fn mobius(r = 1, ratio = 0.5) {
var L = 2*r*ratio // Separation
var m = AreaMesh(fn(u,v) mobiusfn(u,v,r=r,ntwist=-1), -Pi..Pi:Pi/20,-L/2..L/2:L/10, closed=[false,false])
return m
}
fn mobiusfn(u,v, r = 1, ntwist=1){
var th = Matrix([cos(u), 0, sin(u)])
var twist = (cos(0.5*ntwist*u)*th + sin(0.5*ntwist*u)*Matrix([0,1,0]))
return r*th + v*twist
}
Compiling the following gives a consistency error
--Registers (7 in use)
r0 mobius [0]
r1 r [0] (captured)
r2 ratio [0]
r3 L [1]
r4 m [1]
r5 temporary [1]
r6 mobiusfn [1]
--End registers
Internal consistency error: Please contact developer. [Explanation: Incorrectly freed registers in compiling argument list.].
Reproduction script:
newconsitency.zip