Skip to content

Moving objects and interaction with airflow #42

Answered by SLGY
SLGY asked this question in Q&A
Discussion options

You must be logged in to vote

Well I did manage to code that all correctly as an array (see below) if anyone is interested. It still relies on 'voxelize_mesh' which is much slower, obviously. But voxelizing a hull creates a hollow mesh and creates weird nternal flow/noise 🤷‍♂️

std::atomic_bool revoxelizing = false;
void revoxelize(LBM *lbm, Mesh* mesh) { // voxelize new frames in detached thread in parallel while LBM is running
	for (uint n = 0u; n < lbm->get_N(); n++) lbm->flags[n] &= ~TYPE_S; // clear flags
	lbm->voxelize_mesh(mesh, TYPE_S); // voxelize rotated mesh in lbm.flags
	revoxelizing = false; // indicate new voxelizer thread has finished
}

void main_setup() {
	const uint L = 512+128;
	const float knots = 1000

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Zkkzkkzkk
Comment options

Answer selected by SLGY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants