1 Star 1 Fork 1

河海大学CG实验室 / voxelization

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

README

This project's aim is to voxelize the *.ply 3D model. But only for ply files, all assimp support files can be voxelized.

Import formats

Autodesk ( .fbx ), Collada ( .dae ), glTF ( .gltf, .glb ), Blender 3D ( .blend ), 3ds Max 3DS ( .3ds ), 3ds Max ASE ( .ase ), Wavefront Object ( .obj ), Industry Foundation Classes (IFC/Step) ( .ifc ), XGL ( .xgl,.zgl ), Stanford Polygon Library ( .ply ), AutoCAD DXF ( .dxf ), LightWave ( .lwo ), LightWave Scene ( .lws ), Modo ( .lxo ), Stereolithography ( .stl ), DirectX X ( .x ), AC3D ( .ac ), Milkshape 3D ( .ms3d ), TrueSpace ( .cob,.scn )

Export voxel formats

numpy

A numpy array with shape of you appointed.Example: you give a vexel size of (100, 100, 100). It will return a numpy array with shape (100, 100, 100). Filename: imagename.npy

When you need to import it, using numpy.load(filename).

JSON

For more convenient usage, it export a json file. Just reshape the numpy array to (-1, ) . As it shown below:

    '[0,1,0,1]'

Filename: iamgename.json

binvox

A format of binvox, using binvox-rw-py to write out .binvox file to floder.

Using this format, you can easily got the result in eyes with viewvox.

Requires

Usage

>>> import voxelization
>>> voxelization.voxelization("134212_1.ply")
('Bounding box: ', 350.86337, 268.0675, 62.311089, 140.45639, 59.910782, -137.18449)
('x_edge: ', 1.0958697001139324, '\ny_edge: ', 1.0841495990753174, '\nz_edge: ', 0.99747787475585936, '\nedge: ', 1.0958697001139324)
('The mesh ', '0', ' has vertices: ', (53215, 3))
('The mesh', '0', ' process successfully in ', 530.8458249568939, 's')
calculate all meshes voxel finished!
array([[[0, 0, 0, ..., 0, 0, 0],
            ......
        [0, 0, 0, ..., 0, 0, 0]]], dtype=int8)
>>>

The file run.sh is the usage of the script batch_voxelization.py. You can change your arguments, and run it just use command bash run.sh in linux.

Show

There is some works of the app. Those screenshot pictures are using viewvox Application.

ply3 view3 ply4 view4

Requires Introduction

PyAssimp

PyAssimp can import and export many formats of 3-D models, very useful.

numpy

NumPy is the fundamental package for scientific computing with Python.

PyFlann

FLANN (Fast Library for Approximate Nearest Neighbors) is a library for performing fast approximate nearest neighbor searches. FLANN is written in the C++ programming language. FLANN can be easily used in many contexts through the C, MATLAB and Python bindings provided with the library.

空文件

简介

取消

发行版 (1)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
Python
1
https://gitee.com/CGL-HHUC/voxelization.git
git@gitee.com:CGL-HHUC/voxelization.git
CGL-HHUC
voxelization
voxelization
master

搜索帮助

14c37bed 8189591 565d56ea 8189591