THREE.ParametricGeometry(func ,slices,stacks) the func execute times
three.js:version:0.121 when I run this code,
new THREE.ParametricGeometry( func, 200, 10) var func(u, v, point){ console.log(u,v) }
result:
0 0 0.00001 0 0 0.00001 0.005 0 0.0049900000000000005 0 0.005 0.00001 0.01 0 0.00999 0 0.01 0.00001 0.015 0 0.01499 0 0.015 0.00001 0.02 0 0.01999 0 0.02 0.00001 0.025 0 ...
it look like a bad slice
when i run the similar code in version:0.74
new THREE.ParametricGeometry( func, 200, 10) var func(u, v){ console.log(u,v) } 0 0 0.005 0 0.01 0 0.015 0 0.02 0 0.025 0 0.03 0 0.035 0 0.04 0 0.045 0 0.05 0 0.055 0 0.06 0 0.065 0 ···
So why this happen, the 0.121 version cannot show the result well?
Answer
The additional calls of the parametric function were introduced with r85
in order to fix a normal computation bug. You can read more about this in the following PR: https://github.com/mrdoob/three.js/pull/11056
Apart from the normal data, other vertex information are not affected by this fix.