Closed dfkki123508 closed 1 year ago
You can use VOLUME_PRODUCT_ID
as *method
to get volumetric element fills with the instance id in the model.
Alternatively, the approach I typically use is to revoxelize elements individually and check for overlap. That's essentially what we do here. https://github.com/opensourceBIM/voxelization_toolkit/blob/master/voxec.h#L1119
Performance for the 2nd option is obviously worse, but it's more flexible and deals with overlaps.
Thanks for the quick response! Finally I got it running. I had to switch from threaded_processor
to the single threaded one and init a chunked_voxel_storage
of type voxel_uint32_t
before the calculation.
// ...
std::unique_ptr<fill_volume_t> method = std::make_unique<VOLUME_PRODUCT_ID>();
chunked_voxel_storage<voxel_uint32_t> local_storage(x1, y1, z1, voxelsize, voxelCount_x, voxelCount_y, voxelCount_z,
chunksize);
processor *voxelization_processor = new processor(&local_storage, [](int p) {});
voxelization_processor->process(geometries->begin(), geometries->end(), *method, output(MERGED()));
// Iterate a retrieve IfcElement Ids
for (set_voxel_iterator it = local_storage.begin(); it != local_storage.end(); ++it) {
// Value contains IfcElement Id
uint32_t value;
it.value(&value);
}
My code in essence:
Thanks!
BR David