-
Notifications
You must be signed in to change notification settings - Fork 90
Only use voxels to construct a base element, then repeat it. #5227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Basically, applying the same idea as for cellular structures but for TPMS. This should drastically reduce memory consumption and improve performance.
source/MRVoxels/MRFillingSurface.cpp
Outdated
return res; | ||
const float period = 1.f / params.frequency; | ||
const auto voxelSize = getDimsAndSize( size, params.frequency, params.resolution ).size; | ||
const float minVoxelSize = std::min( voxelSize.x, std::min( voxelSize.y, voxelSize.z ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const float minVoxelSize = std::min( voxelSize.x, std::min( voxelSize.y, voxelSize.z ) ); | |
const float minVoxelSize = std::min( { voxelSize.x, voxelSize.y, voxelSize.z } ); |
} | ||
return res; | ||
|
||
MeshBuilder::uniteCloseVertices( result, maxVoxelSize ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is better to call uniteCloseVertices( result, 0 )
, or very small value if rounding errors are inevitable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The basic element is created from voxels, thus we cannot guarantee the precision smaller than the voxel size.
Basically, applying the same idea as for cellular structures but for TPMS. This should drastically reduce memory consumption and improve performance.