Skip to content

Commit

Permalink
Merge pull request #69 from Forceflow/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Forceflow authored Jul 21, 2022
2 parents 8ad0804 + 8147850 commit 8101efa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Build Status](https://travis-ci.org/Forceflow/cuda_voxelizer.svg?branch=master)](https://travis-ci.org/Forceflow/cuda_voxelizer) ![](https://img.shields.io/github/license/Forceflow/cuda_voxelizer.svg) [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/Forceflow)

# cuda_voxelizer v0.4.13
# cuda_voxelizer v0.4.14
A command-line tool to convert polygon meshes to (annotated) voxel grids.
* Supported input formats: .ply, .off, .obj, .3DS, .SM and RAY
* Supported output formats: .binvox, .obj, morton ordered grid
Expand Down Expand Up @@ -30,8 +30,8 @@ Program options:
![output_examples](https://raw.githubusercontent.com/Forceflow/cuda_voxelizer/main/img/output_examples.jpg)

## Building
The build process is aimed at 64-bit executables. It might be possible to build for 32-bit as well, but I'm not actively testing/supporting this.
You can build using CMake, or using the provided Visual Studio project. Since November 2019, cuda_voxelizer also builds on [Travis CI](https://travis-ci.org/Forceflow/cuda_voxelizer), so check out the [yaml config file](https://github.com/Forceflow/cuda_voxelizer/blob/main/.travis.yml) for more Linux build support.
The build process is aimed at 64-bit executables. It's probably possible to build for 32-bit as well, but I'm not actively testing/supporting this.
You can build using CMake, or using the provided Visual Studio project. Since 2022, cuda_voxelizer builds via [Github Actions](https://github.com/Forceflow/cuda_voxelizer/actions) as well, check the .[yml config file](https://github.com/Forceflow/cuda_voxelizer/blob/main/.github/workflows/autobuild.yml) for more info.

### Dependencies
The project has the following build dependencies:
Expand All @@ -44,7 +44,7 @@ The project has the following build dependencies:

After installing dependencies, do `mkdir build` and `cd build`, followed by:

For Windows with Visual Studio 2019:
For Windows with Visual Studio:
```powershell
$env:CUDAARCHS="your_cuda_compute_capability"
cmake -A x64 -DTrimesh2_INCLUDE_DIR:PATH="path_to_trimesh2_include" -DTrimesh2_LINK_DIR:PATH="path_to_trimesh2_library_dir" ..
Expand All @@ -63,7 +63,7 @@ cmake --build . --parallel number_of_cores

### Build using Visual Studio project (Windows)

A Visual Studio 2019 project solution is provided in the `msvc`folder. It is configured for CUDA 11, but you can edit the project file to make it work with lower CUDA versions. You can edit the `custom_includes.props` file to configure the library locations, and specify a place where the resulting binaries should be placed.
Project solutions for Visual Studio 2019 and 2022 are provided in the `msvc`folder. They are configured for CUDA 11, but you can edit the project file to make it work with lower CUDA versions. You can edit the `custom_includes.props` file to configure the library locations, and specify a place where the resulting binaries should be placed.

```
<TRIMESH_DIR>C:\libs\trimesh2\</TRIMESH_DIR>
Expand Down
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "cpu_voxelizer.h"

using namespace std;
string version_number = "v0.4.13";
string version_number = "v0.4.14";

// Forward declaration of CUDA functions
float* meshToGPU_thrust(const trimesh::TriMesh *mesh); // METHOD 3 to transfer triangles can be found in thrust_operations.cu(h)
Expand All @@ -44,7 +44,7 @@ bool solidVoxelization = false;
void printHeader(){
fprintf(stdout, "## CUDA VOXELIZER \n");
cout << "CUDA Voxelizer " << version_number << " by Jeroen Baert" << endl;
cout << "github.com/Forceflow/cuda_voxelizer - mail@jeroen-baert.be" << endl;
cout << "github.com/Forceflow/cuda_voxelizer - mail (at) jeroen-baert (dot) be" << endl;
}

void printExample() {
Expand Down
6 changes: 3 additions & 3 deletions src/voxelize.cu
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ __global__ void voxelize_triangle(voxinfo info, float* triangle_data, unsigned i
n_zx_e1 = -n_zx_e1;
n_zx_e2 = -n_zx_e2;
}
float d_xz_e0 = (-1.0f * glm::dot(n_zx_e0, glm::vec2(v0.z, v0.x))) + glm::max(0.0f, info.unit.x*n_zx_e0[0]) + glm::max(0.0f, info.unit.z*n_zx_e0[1]);
float d_xz_e1 = (-1.0f * glm::dot(n_zx_e1, glm::vec2(v1.z, v1.x))) + glm::max(0.0f, info.unit.x*n_zx_e1[0]) + glm::max(0.0f, info.unit.z*n_zx_e1[1]);
float d_xz_e2 = (-1.0f * glm::dot(n_zx_e2, glm::vec2(v2.z, v2.x))) + glm::max(0.0f, info.unit.x*n_zx_e2[0]) + glm::max(0.0f, info.unit.z*n_zx_e2[1]);
float d_xz_e0 = (-1.0f * glm::dot(n_zx_e0, glm::vec2(v0.z, v0.x))) + glm::max(0.0f, info.unit.z*n_zx_e0[0]) + glm::max(0.0f, info.unit.x*n_zx_e0[1]);
float d_xz_e1 = (-1.0f * glm::dot(n_zx_e1, glm::vec2(v1.z, v1.x))) + glm::max(0.0f, info.unit.z*n_zx_e1[0]) + glm::max(0.0f, info.unit.x*n_zx_e1[1]);
float d_xz_e2 = (-1.0f * glm::dot(n_zx_e2, glm::vec2(v2.z, v2.x))) + glm::max(0.0f, info.unit.z*n_zx_e2[0]) + glm::max(0.0f, info.unit.x*n_zx_e2[1]);

// test possible grid boxes for overlap
for (int z = t_bbox_grid.min.z; z <= t_bbox_grid.max.z; z++){
Expand Down

0 comments on commit 8101efa

Please sign in to comment.