All Projects → andstor → voxelizer

andstor / voxelizer

Licence: MIT license
👾 Voxelization of 3D models

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to voxelizer

Qake
Qake voxel-engine demo
Stars: ✭ 100 (+212.5%)
Mutual labels:  threejs, voxel
Expo Voxel
🎮🌳 Voxel Terrain made in React Native. ∛
Stars: ✭ 169 (+428.13%)
Mutual labels:  threejs, voxel
Lume
Create CSS3D/WebGL applications declaratively with HTML. Give regular DOM elements shadow and lighting.
Stars: ✭ 445 (+1290.63%)
Mutual labels:  threejs, 3d-models
Dino3d
🦖 Google Chrome T-Rex Run! in 3D (WebGL experiment)
Stars: ✭ 263 (+721.88%)
Mutual labels:  threejs, voxel
mine.js
🌏 A voxel engine built with JS/TS/RS. (formerly mc.js) (maybe mine.ts? or even mine.rs?)
Stars: ✭ 282 (+781.25%)
Mutual labels:  threejs, voxel
Node Occ
build BREP Solids with OpenCascade and NodeJS - 3D Modeling
Stars: ✭ 202 (+531.25%)
Mutual labels:  threejs, 3d-models
Mine.js
🌏 A Minecraft-like voxel engine built in Javascript. (formerly mc.js)
Stars: ✭ 136 (+325%)
Mutual labels:  threejs, voxel
blockcraft-public
BlockCraft is a WebGL implementation of an infinite procedurally-generated voxel world that runs on the browser. This project originally spawned as a Minecraft Classic clone but has expanded to include multiplayer PvP, crafting, shaders and much more!
Stars: ✭ 22 (-31.25%)
Mutual labels:  threejs, voxel
ObjToSchematic
A tool to convert .obj files into Minecraft Schematics
Stars: ✭ 156 (+387.5%)
Mutual labels:  voxel, 3d-models
voxel-builder
Voxel-based 3D modeling application
Stars: ✭ 31 (-3.12%)
Mutual labels:  voxel, voxelization
PolyDraw
✳️ PTSource PolyDraw is a free 3D polygonal modeller for Windows x86 and x64, for creating or modifying 3D objects using a mesh of 3D points and parametric NURBS Curves .Exports and imports to over 40 formats including WebVR and 3D Printing.
Stars: ✭ 17 (-46.87%)
Mutual labels:  threejs, 3d-models
building-editor
3D model editor for building/architecture
Stars: ✭ 24 (-25%)
Mutual labels:  threejs, 3d-models
generative
Creative coding experiments
Stars: ✭ 71 (+121.88%)
Mutual labels:  threejs
threejs-dem-visualizer
Visualizing ASTER and LANDSAT satellite data using THREE.js
Stars: ✭ 35 (+9.38%)
Mutual labels:  threejs
three-to-cannon
Convert a THREE.Mesh to a CANNON.Shape.
Stars: ✭ 207 (+546.88%)
Mutual labels:  threejs
three-mithril-ts
THREE.js, Mithril.js, TypeScript starter project
Stars: ✭ 34 (+6.25%)
Mutual labels:  threejs
three-earth
画“地图”
Stars: ✭ 15 (-53.12%)
Mutual labels:  threejs
ecad-models
Random 3D models and such for CAD/ECAD
Stars: ✭ 18 (-43.75%)
Mutual labels:  3d-models
Photo-Sphere-Viewer
A JavaScript library to display Photo Sphere panoramas.
Stars: ✭ 1,198 (+3643.75%)
Mutual labels:  threejs
WebGL-Billiards
ThreeJS based 8-ball pool
Stars: ✭ 28 (-12.5%)
Mutual labels:  threejs

Voxelizer Logo

Voxelizer

Voxelization of 3D models

npm version Build Coverage Status Language grade: JavaScript

Voxelizer is a JavaScript voxelization engine for conducting voxelization of 3D models. It does so by leveraging three.js and allowing you to use it's wast ecosystem of file loaders, plugins, etc.

Examples - Documentation - Wiki - Migration

Table of Contents

Install

As NPM package

$ npm install voxelizer

Using a CDN

You can import the latest standalone UMD build from a CDN such as:

<script src="https://unpkg.com/voxelizer/lib/voxelizer.js"></script>

If you want a specific version, use https://unpkg.com/react-dropdown-tree-select@<version>/lib/voxelizer.js Visit unpkg.com for further details.

Peer Dependency

In order to avoid version conflicts in your project, you must install three.js as a peer dependency. Note that NPM doesn't install peer dependencies automatically. Instead it will generate a warning message with instructions on how to install them.

If you're using the CDN build, you'd also need to add the peer dependency to your application.

<script src="https://unpkg.com/three/build/..."></script>

Usage

Example

// Import via ES6 modules
import * as THREE from 'three';
import {Sampler, XMLExporter} from 'voxelizer';
// or UMD
const { Sampler, XMLExporter } = window.Voxelizer;


// Generate a yellow torus mesh to voxelize.
let geometry = new THREE.TorusGeometry( 10, 3, 16, 100 );
let material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
let torus = new THREE.Mesh( geometry, material );

// 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);

// Export result to XML.
const exporter = new XMLExporter()
exporter.parse(data, function (xml) {
  console.log(xml)
});

Import support

Voxelizer is able to load any mesh created with three.js. By doing so, one can make use of the around 40 📄 file loaders provided by three.js, including support for the popular glTF, OBJ and STL formats.

three.js classifies these loaders as "examples". Please see the three.js documentation for how to use these.

Following is an example of how to load and voxelize a glTF file:

import {GLTFLoader} from 'three/examples/jsm/loaders/GLTFLoader';

// Setup voxelizer.
// ...

const gltfloader = new GLTFLoader();
gltfloader.load('path/to/file.glb', function (data) {
  let mesh = data.scene;
  let data = sampler.sample(mesh, resolution);
  
  // Do something with the data.
  // ...
});

Export support

Several file types and data structures are supported for exporting the voxel data.

File formats

Data structures

License

Copyright © André Storhaug

Voxelizer is licensed under the MIT License.

Related

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].