Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
andstor committed Apr 4, 2019
1 parent c2ad1e0 commit 1fc9a2d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ new Voxelizer()
### Example
```js
const Voxelizer = require('voxelizer');
const vox = new Voxelizer(options);
const voxelizer = new Voxelizer();

let path3DModel = './path/to/file.obj';

vox.loadOBJ(path3DModel).then((object) => {
voxelizer.loadOBJ(path3DModel).then((object) => {
const resolution = 10;
let matrix = vox.sample(object, resolution);
let matrix = voxelizer.sample(object, resolution);
console.log(matrix);
});

Expand All @@ -50,7 +50,8 @@ vox.loadOBJ(path3DModel).then((object) => {
[⬆ back to top](#voxelizer)

## API
The Voxelizer class also support multiple optional configurations. These should be passed as an object to the Voxelizer class object. If no manual configurations are set, default options are used.

### Voxelizer()

### voxelizer.loadOBJ(path)
- **path**:
Expand All @@ -66,7 +67,7 @@ Load 3D model.
### voxelizer.sample(object, resolution)
- **object**:
- Type: `Object`
- The 3D model to be sampled. Needs to be an [Object3D](https://threejs.org/docs/#api/en/core/Object3D).
- The 3D model to be sampled. Needs to be an [Object3D](https://threejs.org/docs/#api/en/core/Object3D) object.

- **resolution**:
- Type: `Number`
Expand All @@ -93,7 +94,6 @@ Enter the Voxelizer directory and run the build script:
npm run build
```


## License

Voxelizer is licensed under the [MIT License](https://github.com/andstor/voxelizer/blob/master/LICENSE).
Expand Down
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ class Voxelizer {
}

handleIntersects(intersects) {
let treshold = 0.000000001; // TODO implement a treshold to prevent multiple readings in face corner.
let treshold = 0.000000001; // TODO implement a treshold to prevent
// multiple readings in face corner.

let matrix = [];
let numSteps = this.depth / this.step;
Expand Down

0 comments on commit 1fc9a2d

Please sign in to comment.