davidstutz / mesh-voxelization Goto Github PK
View Code? Open in Web Editor NEWC++ implementation for computing occupancy grids and signed distance functions (SDFs) from watertight meshes.
C++ implementation for computing occupancy grids and signed distance functions (SDFs) from watertight meshes.
The magnitude of the tensor should be(12311,32,32,32).
but got (5,32,32,32),and the h5 file has size 1.6GB.
its wired...
do you know why?
when i use the command
../bin/voxelize occ ../examples/input ../examples/output.h5
i meet this problem.
terminate called after throwing an instance of 'std::invalid_argument'
what(): stoi
Aborted (core dumped)
I am currently looking for a fast CPU based voxelizer for mesh files and wondering, whether your project might fit my needs. I want to start from STL files and be able to get the voxelized version as a numpy array for further processing. Do you think that would be worth the required effort or are there better alternatives?
Hi!
Thank you for your perfect work. I have a question that is there any way to turn the voxel into a triangle mesh?
Thank you very much.
../bin/voxelize occ ../examples/input ../examples/output.h5
i found that when filename like "a.off",failed ,invaild augument..............
It looks like it only supports naming files with Numbers
Whatever you put in, it's going to produce a cube.the filled.h5 file tensor is Most of them are 1.(>99%)
Hello!
First, thank you for your awesome job!
Currently I'm working on the auto-encoders of 3D voxels. As you have said,
Note that these are not "filled"; meaning that only the mesh surfaces are voxelized.
many datasets provide voxels that contain only the surfaces, leaving the inner part hollow. This make it very difficult for auto-encoders to catch the surfaces, since the surfaces are only 1-grid-thick. I hope some tools can help me to fill them automatically.
My question is that, is filling the inner part of a water-tight voxel
still an open-question? Is there any good idea to do it automatically?
Thanks.
Hi,
is there any plan on adding color to the voxels? Do you know of any library that generates voxels with color info?
thanks!
hello, i want to use PartNet, the file is .obj. could you please tell me how to translate it to .off?
thanks very much
I am receiving errors compiling without setting any extra C or CXX flags. Any idea how to get around this?
(Compiling with the latest unstable/stable 3.3.4 version of Eigen. Not sure if this is an Eigen issue or C++ issue).
Thanks!
Scanning dependencies of target read_hdf5
[ 25%] Building CXX object CMakeFiles/read_hdf5.dir/examples/read_hdf5.cpp.o
/Users/ruizhu/Documents/baidu/personal-code/car-fitting/data/mesh-voxelization-macos/examples/read_hdf5.cpp:57:11: error: no member named 'printError' in
'H5::FileIException'
error.printError();
~~~~~ ^
/Users/ruizhu/Documents/baidu/personal-code/car-fitting/data/mesh-voxelization-macos/examples/read_hdf5.cpp:63:11: error: no member named 'printError' in
'H5::DataSetIException'
error.printError();
~~~~~ ^
/Users/ruizhu/Documents/baidu/personal-code/car-fitting/data/mesh-voxelization-macos/examples/read_hdf5.cpp:69:11: error: no member named 'printError' in
'H5::DataSpaceIException'
error.printError();
~~~~~ ^
/Users/ruizhu/Documents/baidu/personal-code/car-fitting/data/mesh-voxelization-macos/examples/read_hdf5.cpp:118:11: error: no member named 'printError' in
'H5::FileIException'
error.printError();
~~~~~ ^
/Users/ruizhu/Documents/baidu/personal-code/car-fitting/data/mesh-voxelization-macos/examples/read_hdf5.cpp:124:11: error: no member named 'printError' in
'H5::DataSetIException'
error.printError();
~~~~~ ^
/Users/ruizhu/Documents/baidu/personal-code/car-fitting/data/mesh-voxelization-macos/examples/read_hdf5.cpp:130:11: error: no member named 'printError' in
'H5::DataSpaceIException'
error.printError();
~~~~~ ^
In file included from /Users/ruizhu/Documents/baidu/personal-code/car-fitting/data/mesh-voxelization-macos/examples/read_hdf5.cpp:10:
In file included from /Users/ruizhu/Documents/eigen-git-mirror/unsupported/Eigen/CXX11/Tensor:102:
/Users/ruizhu/Documents/eigen-git-mirror/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h:289:167: error: non-constant-expression cannot be narrowed from
type 'unsigned long long' to 'std::__1::array<long, 4>::value_type' (aka 'long') in initializer list [-Wc++11-narrowing]
...firstDimension, DenseIndex secondDimension, IndexTypes... otherDimensions) : Base({{firstDimension, secondDimension, otherDimensions...}}) {
^~~~~~~~~~~~~~~
/Users/ruizhu/Documents/eigen-git-mirror/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h:90:62: note: in instantiation of function template specialization
'Eigen::DSizes<long, 4>::DSizes<unsigned long long, unsigned long long>' requested here
EIGEN_DEVICE_FUNC TensorStorage(DenseIndex... indices) : m_dimensions(indices...) {
^
/Users/ruizhu/Documents/eigen-git-mirror/unsupported/Eigen/CXX11/src/Tensor/Tensor.h:342:11: note: in instantiation of function template specialization
'Eigen::TensorStorage<float, Eigen::DSizes<long, 4>, 1>::TensorStorage<long, unsigned long long, unsigned long long, unsigned long long>' requested here
: m_storage(firstDimension, otherDimensions...)
^
/Users/ruizhu/Documents/baidu/personal-code/car-fitting/data/mesh-voxelization-macos/examples/read_hdf5.cpp:45:13: note: in instantiation of function template
specialization 'Eigen::Tensor<float, 4, 1, long>::Tensor<unsigned long long, unsigned long long, unsigned long long>' requested here
dense = Eigen::Tensor<float, rank, Eigen::RowMajor>(dimsf[0], dimsf[1], dimsf[2], dimsf[3]);
^
/Users/ruizhu/Documents/eigen-git-mirror/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h:289:167: note: insert an explicit cast to silence this issue
...firstDimension, DenseIndex secondDimension, IndexTypes... otherDimensions) : Base({{firstDimension, secondDimension, otherDimensions...}}) {
^~~~~~~~~~~~~~~
static_cast<value_type>( )
/Users/ruizhu/Documents/eigen-git-mirror/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h:289:167: error: non-constant-expression cannot be narrowed from
type 'unsigned long long' to 'std::__1::array<long, 4>::value_type' (aka 'long') in initializer list [-Wc++11-narrowing]
...firstDimension, DenseIndex secondDimension, IndexTypes... otherDimensions) : Base({{firstDimension, secondDimension, otherDimensions...}}) {
^~~~~~~~~~~~~~~
/Users/ruizhu/Documents/eigen-git-mirror/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h:289:167: note: insert an explicit cast to silence this issue
...firstDimension, DenseIndex secondDimension, IndexTypes... otherDimensions) : Base({{firstDimension, secondDimension, otherDimensions...}}) {
^~~~~~~~~~~~~~~
static_cast<value_type>( )
/Users/ruizhu/Documents/eigen-git-mirror/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h:289:167: error: non-constant-expression cannot be narrowed from
type 'unsigned long long' to 'std::__1::array<long, 5>::value_type' (aka 'long') in initializer list [-Wc++11-narrowing]
...firstDimension, DenseIndex secondDimension, IndexTypes... otherDimensions) : Base({{firstDimension, secondDimension, otherDimensions...}}) {
^~~~~~~~~~~~~~~
/Users/ruizhu/Documents/eigen-git-mirror/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h:90:62: note: in instantiation of function template specialization
'Eigen::DSizes<long, 5>::DSizes<unsigned long long, unsigned long long, unsigned long long>' requested here
EIGEN_DEVICE_FUNC TensorStorage(DenseIndex... indices) : m_dimensions(indices...) {
^
/Users/ruizhu/Documents/eigen-git-mirror/unsupported/Eigen/CXX11/src/Tensor/Tensor.h:342:11: note: in instantiation of function template specialization
'Eigen::TensorStorage<float, Eigen::DSizes<long, 5>, 1>::TensorStorage<long, unsigned long long, unsigned long long, unsigned long long, unsigned long
long>' requested here
: m_storage(firstDimension, otherDimensions...)
^
/Users/ruizhu/Documents/baidu/personal-code/car-fitting/data/mesh-voxelization-macos/examples/read_hdf5.cpp:106:13: note: in instantiation of function
template specialization 'Eigen::Tensor<float, 5, 1, long>::Tensor<unsigned long long, unsigned long long, unsigned long long, unsigned long long>'
requested here
dense = Eigen::Tensor<float, rank, Eigen::RowMajor>(dimsf[0], dimsf[1], dimsf[2], dimsf[3], dimsf[4]);
^
/Users/ruizhu/Documents/eigen-git-mirror/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h:289:167: note: insert an explicit cast to silence this issue
...firstDimension, DenseIndex secondDimension, IndexTypes... otherDimensions) : Base({{firstDimension, secondDimension, otherDimensions...}}) {
^~~~~~~~~~~~~~~
static_cast<value_type>( )
/Users/ruizhu/Documents/eigen-git-mirror/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h:289:167: error: non-constant-expression cannot be narrowed from
type 'unsigned long long' to 'std::__1::array<long, 5>::value_type' (aka 'long') in initializer list [-Wc++11-narrowing]
...firstDimension, DenseIndex secondDimension, IndexTypes... otherDimensions) : Base({{firstDimension, secondDimension, otherDimensions...}}) {
^~~~~~~~~~~~~~~
/Users/ruizhu/Documents/eigen-git-mirror/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h:289:167: note: insert an explicit cast to silence this issue
...firstDimension, DenseIndex secondDimension, IndexTypes... otherDimensions) : Base({{firstDimension, secondDimension, otherDimensions...}}) {
^~~~~~~~~~~~~~~
static_cast<value_type>( )
/Users/ruizhu/Documents/eigen-git-mirror/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h:289:167: error: non-constant-expression cannot be narrowed from
type 'unsigned long long' to 'std::__1::array<long, 5>::value_type' (aka 'long') in initializer list [-Wc++11-narrowing]
...firstDimension, DenseIndex secondDimension, IndexTypes... otherDimensions) : Base({{firstDimension, secondDimension, otherDimensions...}}) {
^~~~~~~~~~~~~~~
/Users/ruizhu/Documents/eigen-git-mirror/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h:289:167: note: insert an explicit cast to silence this issue
...firstDimension, DenseIndex secondDimension, IndexTypes... otherDimensions) : Base({{firstDimension, secondDimension, otherDimensions...}}) {
^~~~~~~~~~~~~~~
static_cast<value_type>( )
11 errors generated.
make[2]: *** [CMakeFiles/read_hdf5.dir/examples/read_hdf5.cpp.o] Error 1
make[1]: *** [CMakeFiles/read_hdf5.dir/all] Error 2
make: *** [all] Error 2
When building the repo, I encountered several errors with the following error message:
‘class H5::FileIException’ has no member named ‘printError’; did you mean ‘printErrorStack’?
After tracing the code, I found that in read_hd5.cpp
and main.cpp
, there are calls to the printError
function, which turns out should be printErrorStack
. I fixed this locally and was able to build the executable. Maybe you want to update the repo to fix this issue.
Great thanks for sharing your code and it does help me a lot.
I follow the readme. first, scale off, and then generate. But it seems that it works really slow when generating 256^3 voxels (10 files more than 30min) does it work correctly? If not, what could be the problem?
Looking forward to your reply.
Hi @davidstutz ,
I am using this mesh-voxelization script to generate SDF volume with the ShapeNet dataset.
The model I tested is a watertight sofa model, but the result shows there is no interior value generated.
The value of the num_intersect variable is always even number.
Could you give me some suggestions or help in solving this weird situation?
Thank you very much for considering this matter.
The model I am using for testing is
ShapeNetCore.v2\ 04256520 \ 1037fd31d12178d396f164a988ef37cc \ models \ model_normalized.obj
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.