topskychen / voxelizer Goto Github PK
View Code? Open in Web Editor NEWA fast parallel CPU-based surface & solid voxelizer.
License: MIT License
A fast parallel CPU-based surface & solid voxelizer.
License: MIT License
I try to understand binvox or Rawvox. How do I convert it to the representation of the surface model?Like obj, or other common 3D formats.
Same as title. Since I want to know some detail about your work, it's better for me to read the technique in your paper, How can I find it?
Having prebuilt releases, especially for Windows would be nice.
Dear authors,
I would like to test/use your voxelizer code. However, I have several problems while compiling the code, it is related to the type "Vec3f". Here are errors:
/src/commons.h:47:24: error: unknown type name 'Vec3f'
inline void Fill(const Vec3f& vc, float ft[3]);
/src/commons.h:34: error: use of class template 'TriangleP' requires template arguments
/src/commons.h:35: error: use of class template 'Box' requires template arguments
...
Could you fix them ? Thank you !
Hello, under what license is this project released under ? I would like to study it and learn from it. Thank-you.
L used some stl file to test.But some stl file get errors,when l changed g_size to 128,it worked.what is the problem with that.
Hi there Chen! (@topskychen )
Very nice project!
The only issue I faced using your code was the program has random crashes, I tried to debug and find the issue sometimes getting voxel size (double)(*_halfUnit)[0] * 2
throw a null and sometimes (*_meshVoxLB)[0]
throws null error.
I searched over the net and it seems its an act of boost::asio.
Can you please take a look and try a fix?
Your app is extremely fast ( 2 million voxel in 200ms ) but it crash like 2 in 3 run.
Also a very small note, you mentioned in README :
It supports stl files only now.
But you're using assimp and it supports lots of formats.
It's enough to use inputmesh.obj instead of inputmesh.stl and it works just fine!
Regards,
Ultran
Hi Dear Qian (@topskychen )
First of all thanks a lot for your great support and great library!
These are a series of suggested features that are simple to implement but very useful and have been used in several powerful voxelizers, Using these capabilities, you can produce interesting meshes...
Voxel Size based voxelizer model so we have two options like GRID_SIZE_BASED
and VOXEL_SIZE_BASED
flags also it will be great if you add a Vector3 input like --size=(10 20 15) and if we select VOXEL_SIZE_BASED it will be used as voxel size , size parameter is Vector3 and Flag is a Byte :
And with Vector3 Input :
Bound Clipping : in this feature we have our original bounding box and a clipper one with a Vector3 input (parameter is Vector3) :
Tight Fit Mode : Tight fit voxelizing is such that we check whether the center point of each voxel is inside the mesh or outside it, and if it is outside, we remove it. (parameter is Boolean)
Voxel Meta Bit Flags : It's extremely helpful if we know which voxel is solid and which one is surface, It would be great if you can add a flag to each voxel like SURFACE_VOXEL and SOLID_VOXEL
(parameter is Byte) :
Voxel Spacing We take voxels and add a Vector3 space between them (parameter is Vector3) :
Voxels Transformation : A very good feature to edit and change voxels transformations using modifiers like 3D Noises , Perlin and stuff. This feature data can be kept as extra voxel meta data, so each voxel can have a pos , rotation and scale.
Perlin 3D Noises :
Face Aligning : A very interesting method to align solid and surface voxels on original mesh surface (parameter is Boolean) :
Row Offset Alternating : A simple but cool method to offset odd rows by a float value relative to voxel size. (parameter is Float) :
UV Mapping and Color Picking : In this method voxelizer keeps UV of original base mesh and also pick a color from input texture and store it in voxel meta data like vector VoxelColors or even can be stored in voxel itself :
Sphere UV before and after voxelization :
I made this images using a commercial voxelizer and All of them are doable and technically possible.
With these features, your voxelizer will be one of the best and can help a lot of people. I have not very knowledge in this field, but I will help you wherever I can and also I can also make it a plugin for 3D software like 3ds Max, Blender or Maya.
And if this features be added, it's going to be hard to use using a command liner I can make a good GUI for it too.
Thanks for reading,
Regards,
Ultran
Hi, when I make
in build
, I got these errors
[ 7%] Building CXX object bin/CMakeFiles/voxelizer.dir/voxelizerMain.cpp.o
In file included from /Users/YJ-work/Desktop/cpp_programs/voxelizer/src/voxelizerMain.cpp:7:
In file included from /Users/YJ-work/Desktop/cpp_programs/voxelizer/src/voxelizer.h:16:
In file included from /Users/YJ-work/Desktop/cpp_programs/voxelizer/src/commons.h:17:
In file included from /opt/local/include/fcl/collision.h:43:
In file included from /opt/local/include/fcl/collision_object.h:45:
In file included from /opt/local/include/fcl/ccd/motion_base.h:46:
In file included from /opt/local/include/fcl/BV/RSS.h:41:
/opt/local/include/fcl/math/constants.h:47:9: error: unknown type name 'constexpr'
constexpr FCL_REAL pi = FCL_REAL(3.141592653589793238462643383279502884197169399375...
^
/opt/local/include/fcl/math/constants.h:47:27: error: expected ';' after top level declarator
constexpr FCL_REAL pi = FCL_REAL(3.141592653589793238462643383279502884197169399375...
^
;
/opt/local/include/fcl/math/constants.h:50:9: error: unknown type name 'constexpr'
constexpr FCL_REAL phi = FCL_REAL(1.618033988749894848204586834365638117720309179805...
^
/opt/local/include/fcl/math/constants.h:50:27: error: expected ';' after top level declarator
constexpr FCL_REAL phi = FCL_REAL(1.618033988749894848204586834365638117720309179805...
^
;
In file included from /Users/YJ-work/Desktop/cpp_programs/voxelizer/src/voxelizerMain.cpp:7:
In file included from /Users/YJ-work/Desktop/cpp_programs/voxelizer/src/voxelizer.h:16:
In file included from /Users/YJ-work/Desktop/cpp_programs/voxelizer/src/commons.h:17:
In file included from /opt/local/include/fcl/collision.h:43:
In file included from /opt/local/include/fcl/collision_object.h:45:
In file included from /opt/local/include/fcl/ccd/motion_base.h:46:
/opt/local/include/fcl/BV/RSS.h:114:50: error: no member named 'pi' in namespace 'fcl::constants'
return (l[0] * l[1] * 2 * r + 4 * constants::pi * r * r * r);
~~~~~~~~~~~^
In file included from /Users/YJ-work/Desktop/cpp_programs/voxelizer/src/voxelizerMain.cpp:7:
In file included from /Users/YJ-work/Desktop/cpp_programs/voxelizer/src/voxelizer.h:16:
In file included from /Users/YJ-work/Desktop/cpp_programs/voxelizer/src/commons.h:18:
/opt/local/include/fcl/shape/geometric_shapes.h:142:29: error: no member named 'pi' in namespace
'fcl::constants'
return 4.0 * constants::pi * radius * radius * radius / 3.0;
~~~~~~~~~~~^
/opt/local/include/fcl/shape/geometric_shapes.h:180:36: error: no member named 'pi' in namespace
'fcl::constants'
const FCL_REAL pi = constants::pi;
~~~~~~~~~~~^
/opt/local/include/fcl/shape/geometric_shapes.h:207:23: error: no member named 'pi' in namespace
'fcl::constants'
return constants::pi * radius * radius *(lz + radius * 4/3.0);
~~~~~~~~~~~^
/opt/local/include/fcl/shape/geometric_shapes.h:212:56: error: no member named 'pi' in namespace
'fcl::constants'
FCL_REAL v_cyl = radius * radius * lz * constants::pi;
~~~~~~~~~~~^
/opt/local/include/fcl/shape/geometric_shapes.h:213:60: error: no member named 'pi' in namespace
'fcl::constants'
FCL_REAL v_sph = radius * radius * radius * constants::pi * 4 / 3.0;
~~~~~~~~~~~^
/opt/local/include/fcl/shape/geometric_shapes.h:247:23: error: no member named 'pi' in namespace
'fcl::constants'
return constants::pi * radius * radius * lz / 3;
~~~~~~~~~~~^
/opt/local/include/fcl/shape/geometric_shapes.h:290:23: error: no member named 'pi' in namespace
'fcl::constants'
return constants::pi * radius * radius * lz;
~~~~~~~~~~~^
12 errors generated.
make[2]: *** [bin/CMakeFiles/voxelizer.dir/voxelizerMain.cpp.o] Error 1
make[1]: *** [bin/CMakeFiles/voxelizer.dir/all] Error 2
make: *** [all] Error 2
How can I fix these?
l aready installed fcl from git.but l still get this error
-- Boost version: 1.63.0
-- Found the following Boost libraries:
-- atomic
-- thread
-- date_time
-- filesystem
-- system
-- unit_test_framework
-- checking for module 'fcl'
-- package 'fcl' not found
-- checking for module 'libfcl'
-- package 'libfcl' not found
CMake Error at CMakeLists.txt:32 (message):
Libfcl is required by Voxelizer
/root/src/fcl/build/lib/libfcl.so
/root/src/fcl/build/lib/libfcl.so.0.6
/root/src/fcl/build/lib/libfcl.so.0.6.0
/usr/local/lib64/libfcl.so
/usr/local/lib64/libfcl.so.0.6
/usr/local/lib64/libfcl.so.0.6.0
why????
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.