You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Otherwise looking at neighboring faces gets too complicated?
Every leaf is a single material thanks to Octree::from_voxels().
Construct volumes.
A volume is a set of sequence of face-sharing leaves.
Is my neighbor a leaf?
Yes: is it same material or not?
No: check the 4 children that share the same face.
Since the octree is weakly balanced, those should be leaves.
Need to make sure it already isn't in the current volume somehow!
Make a Vec of the leaves within the octree called Leaves.
Pop a leaf from Leaves into a new volume Vec.
Use neighboring faces to find neighbor leaves, moving them from Leaves into the volume.
Moving rather than copying ensures that volumes aren't repeated by starting from different leaves within the same volume. Also prevents volumes from sharing leaves, but that should happen anyway.
Once done with a leaf in the volume, repeat for each leaf in the volume.
Pushing them to the back will facilitate this naturally.
Once done with volume, start a new one with the next leaf in Leaves, repeat the above.
Defeature the volumes.
If any volume has less than specified minimum voxels:
Every leaf is homogeneous, so the number of voxels is 8^k.
.iter().map(|leaf| 8.powi(max_levels - 1 - leaf.level)).sum() on the volume Vec.
Change the volume material to "predominant neighboring material".
What does that mean exactly?
Does this have to be iterated on, similar to balancing?
Mesh the volumes. Either:
The octree is dualized.
The octree is converted back into a segmentation, which is meshed.
Need to implement Voxels::from_octree().
Can you ignore the larger leaves from the beginning, unless there is a good reason to always do all the volumes? What else could they be useful for? Option for separate blocks for all non-contiguous volumes? Option to generate nodesets and sidesets? Surface reconstruction algorithms? Thickening? Something else?
Is your feature request related to a problem? Please describe.
Segmentations sometimes contain small volumes (small groups of voxels) that should optionally be defeatured.
Describe the solution you'd like
Option to defeature volumes that contain less than <num, default=5 or 10> voxels.
NOTE: Could the octree implementation help with this? No balancing or pairing required!
Describe alternatives you've considered
Something like
recon3d
might take care of this beforehand, but possibly not.Additional context
Is generally useful to pre-process the segmentation this way before meshing.
The text was updated successfully, but these errors were encountered: