Skip to content

Commit 83d1c68

Browse files
committed
Fixed bug in stl re-voxelization (erreneous trails of cells behind moving objects) by adding 2 cells of bounding-box tolerance
1 parent ea5cc19 commit 83d1c68

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lbm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ void LBM_Domain::voxelize_mesh_on_device(const Mesh* mesh, const uchar flag, con
184184
Memory<float3> p1(device, mesh->triangle_number, 1u, mesh->p1);
185185
Memory<float3> p2(device, mesh->triangle_number, 1u, mesh->p2);
186186
Memory<float> bounding_box_and_velocity(device, 16u);
187-
const float x0=mesh->pmin.x, y0=mesh->pmin.y, z0=mesh->pmin.z, x1=mesh->pmax.x, y1=mesh->pmax.y, z1=mesh->pmax.z; // use bounding box of mesh to speed up voxelization
187+
const float x0=mesh->pmin.x-2.0f, y0=mesh->pmin.y-2.0f, z0=mesh->pmin.z-2.0f, x1=mesh->pmax.x+2.0f, y1=mesh->pmax.y+2.0f, z1=mesh->pmax.z+2.0f; // use bounding box of mesh to speed up voxelization; add tolerance of 2 cells for re-voxelization of moving objects
188188
bounding_box_and_velocity[ 0] = as_float(mesh->triangle_number);
189189
bounding_box_and_velocity[ 1] = x0;
190190
bounding_box_and_velocity[ 2] = y0;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy