

om_voxel_grid(voxels=arr_vox_3d, colors=(0.75,0.75,0.VoxelFuse is a Python library for processing multi-material 3D model data. # bug in simple_3dviz, the spacing is not uniform if the voxel array is not uniformĪrr_vox_3d = np.concatenate((arr_vox_3d, np.zeros((longest_axis-wx, wy, wz), dtype=np.bool)), axis=0)Īrr_vox_3d = np.concatenate((arr_vox_3d, np.zeros((longest_axis, longest_axis-wy, wz), dtype=np.bool)), axis=1)Īrr_vox_3d = np.concatenate((arr_vox_3d, np.zeros((longest_axis, longest_axis, longest_axis-wz), dtype=np.bool)), axis=2) Parser.add_argument('-c', action="store", dest="cfgfile", help='*.txt file with size info')Īrr_vox = np.fromfile(args.rawfile, dtype=np.uint8).astype(np.bool)Īrr_vox_3d = np.reshape(arr_vox, (wx,wy,wz), order='F') Parser.add_argument('-f', action="store", dest="rawfile", help='*.raw file') Parser = argparse.ArgumentParser(description='View *.raw files.') Project configurationĪ project is based on a *.xml file which comprehends how the mesh will be rasterized.įrom simple_3dviz.renderables import Meshįrom simple_ import LightToCamera Each byte is equal to the definition in the *.xml file (material_interior, material_shell).ĭuplicate vertices and interior faces are removed (as far as possible dependent on the export format).Ĭurrently, I work on merging of co-planar faces. obj: The output mesh may consist of two groups (shell and interior) if the rasterizer type supports it.

stl: An outer surface mesh of the voxel model is generated Models can be exported as hexahedral mesh (.stl. The voxelizer supports currently import of. Rasterization performance: i7 4770k (4 physical cores) based on the stanford bunny (112k faces). hollow is very fast, relatively memory efficient and yields a voxel shell. fast is optimzed for pure speed and yields a solid voxel model (shell and interior can be assigned) edge collisions, is optimized for a lower memory footprint (uses projections, quad trees)Īnd continues where most other voxelizers stop because of memory issues and is a nice trade-off regarding performance. There are three rasterizer implementations which are parallelized and probably (among?) the fastest CPU rasterizers around.

The -safe rasterizer implementation does not allocate a huge buffer array but safes plane-wise intersections.Įxport also avoid unnecessary buffering to allow exporting of huge models. In case of a raw voxel-byte export the the resulting array is equal to the global project bounding box and the components are embedded. Per shape the voxelizer can estimate surface and interior voxels and assign them separately with a desired value. The relative position of the resulting output hexahedral meshes to each other is equal to the relative position of the input meshes. This voxelizer is intended for use with complex models consisting of several shapes. vox (if size is within the 127 voxel boundary), 8 bit binary (.raw).

Now it can be used to convert meshes into solid or hollow hexahedron meshes: (*.stl), or voxel files. This project started as a funny playground for testing some c++20 compiler features (such as static checks for speed up). Stl|obj|raw|rle will create an "foo.stl", "foo.obj", "foo.raw" and "foo.rle" file in the result directory.
