voxelizer
voxelizer copied to clipboard
Example on the readme is not working with current three.js version
The example code is not working with the current three.js version: (0.168.0)
The following code:
// Generate a yellow torus mesh to voxelize.
let geometry = new TorusGeometry(10, 3, 16, 100)
let material = new MeshBasicMaterial({ color: 0xffff00 })
let torus = new Mesh(geometry, material)
geometry.compute
// Setup Voxelizer.
let options = {
fill: false,
color: true,
}
const sampler = new Sampler('raycast', options)
// Voxelize torus.
const resolution = 10
let data = sampler.sample(torus, resolution)
console.log(data)
Throws this error:
child.geometry.computeFaceNormals is not a function
It seems computeFaceNormals() can be removed without issues according to this three.js migretion guide
BufferGeometry.computeFaceNormals() has been removed. The method was not implemented and just a stub. Calling it did not affect the geometry.
There may be more outdated function calls