Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions third_party/voxelize/src/udf_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,12 @@ __device__ void updateUDF(Triangle t, int* udf, const int DIM, const float thres
Point3D queryPoint = {(float)i/(DIM-1) - 0.5, (float)j/(DIM-1) - 0.5, (float)k/(DIM-1) -0.5};
float distance = pointToTriangleDistance(queryPoint, t.v0, t.v1, t.v2);
float distance2 = pointToTriangleDistance(queryPoint, t.v0, t.v1, t.v2, true);
if (distance < threshold / DIM or distance2 < threshold / DIM){
//distance = distance2;
int int_dist = (int)(distance * 10000000);
atomicMin(&udf[idx], int_dist);
}
}
if (distance < threshold / DIM || distance2 < threshold / DIM){
//distance = distance2;
int int_dist = (int)(distance * 10000000);
atomicMin(&udf[idx], int_dist);
}
}

}
}
Expand All @@ -211,4 +211,3 @@ void compute_valid_udf_cuda(float* vertices, int* faces, int* udf, int numTriang
// Launch the kernel
compute_udf_kernel<<<gridSize, blockSize>>>(vertices, faces, udf, numTriangles, DIM, threshold);
}