Open stla opened 5 years ago
Hello,
scale should be (bounds[1][i] - bounds[0][i]) / (dims[i]-1); instead of (bounds[1][i] - bounds[0][i]) / dims[i];
scale
(bounds[1][i] - bounds[0][i]) / (dims[i]-1)
(bounds[1][i] - bounds[0][i]) / dims[i];
Try for instance
var mesh = isosurface.surfaceNets([64,64,64], function(x,y,z) { return x*x + y*y + z*z - 1 }, [[-1,-1,-1], [1,1,1]])
This gives a truncated ball. Whereas the ball is perfect with dims[i]-1.
dims[i]-1
Another remark: n is not used in surfacenets.js.
n
surfacenets.js
Hello,
scale
should be(bounds[1][i] - bounds[0][i]) / (dims[i]-1)
; instead of(bounds[1][i] - bounds[0][i]) / dims[i];
Try for instance
This gives a truncated ball. Whereas the ball is perfect with
dims[i]-1
.