Closed wjsjtu123 closed 4 months ago
Hi @wjsjtu123,
when you load an .stl
mesh, by default the (rotation) center of the mesh is set to the center of its bounding box. This is correct for 2- or 4-bladed propellers, but fails for 3- or 5-bladed propellers; their rotation center is offset from the bounding box center. Here an illustration:
You can figure out this offset with some geometry.
The solution is to manually correct the position of the mesh center, with
float3 offset = float3(...);
propeller->set_center(propeller->get_bounding_box_center()+offset);
The specified mesh center is used as the rotation center during lbm.voxelize_mesh_on_device(propeller, ...)
and propeller->rotate(...)
.
Kind regards, Moritz
When performing a propeller rotational motion, I define a rotational motion around the x-axis with a rotational speed of 4145r/min, but in the voxelized motion, instead of following a fixed x-axis, the propeller will rotate periodically off-center, what is the cause of this, and how can I fix it? My code is as follows