Hi Manuel,
for instance, I want to create spheres at the voxels' locations and make the ones touching the polygon red and the others gray.
Hi Manuel,
for instance, I want to create spheres at the voxels' locations and make the ones touching the polygon red and the others gray.
Thanks to both of you for your answers!
voxelResolution, minResolution :
maxon::Range: seems I have a lack of sleep
Last question (I hope),
Since the "object space" is divided into cells/voxels (based on the voxelResolution), is there any way to loop through all cells or get access to a specific one ?
Thanks again
First of all, thank you for your answer!
Just like I said in my previous post, I want to get more details on the VoxelResolution, and minResolution args.
Here an example of what I did to get bounding boxes of all polygons:
…
// voxelResolution The voxel resolution of the largest dimension.
// minResolution The minimal resolution of either dimension.
maxon::BaseArray<maxon::Range< Vector >> polyRanges;
auto result = voxRef.Init(currentObj, 10, 1, polyRanges);
…
This code works fine and polyRange is correctly populated.
As you can see, I set VoxelResultion to 10, it’s an arbitrary choice (Why 10 and not 100 or 1 ? … meh..). In the beginning I thought that this parameter is to define the voxel size, but since It’s an Integer parameter and the calculation time increases by increasing this number, I suppose that VoxelResultion is reacting more like a subdivision or a number of iterations, and in that case, what “Resolution and Dimension” the documentation is referring to?
And the same thing with the minResolution parameter…
On the other hand, the Init
method returns a list of maxon::Range elements, each one represents the bounding box of a polygon. But I don’t know how to exploit it.
Example:
If we have a polygon with 3 points A, B and C:
The maxon::range seems to store something like this:
_minValue: { min(A.x, B.x, C.x), min(A.y, B.y, C.y), min(A.z, B.z, C.z) }
_maxValue: { max(A.x, B.x, C.x), max(A.y, B.y, C.y), max(A.z, B.z, C.z) }
So, how to convert this to a classic Bounding Box data ( i.e a center + a radius) just like with GetMp()
and GetRad()
for an object...or maybe… I misunderstand something :/
Thank you.
Hi,
I continue my tests on the C4D API with the VoxelizationInterface, and I'm already stucked at the first method :(
MAXON_METHOD Result<Bool> Init (PolygonObject* polyObject, Int32 voxelResolution, Int32 minResolution, BaseArray< Range< Vector >> & polyRanges,
const Vector * pointOverride = nullptr, Boolprecise = false )
// Initializes the voxelization with a polygon object.
Parameters
[in] polyObject Pointer to the polygon object to be added to the voxelization.
[in] voxelResolution The voxel resolution of the largest dimension.
[in] minResolution The minimal resolution of either dimension.
[out] polyRanges Calculated bounding boxes for every polygon.
[in] pointOverride Override option for the polygon points. If not nullptr, these points will be used for the polygon vertices.
[in] precise If true, only the voxels touching a polygon will hold the specific polygon index. If false, all voxels touching the polygon AABB will hold the polygon index.
Returns
True if the voxelization was properly initialized, false otherwise.
Even after reading the description, I can't figure out what are exactly voxelResolution and minResolution, and how to interpret the maxon::range values (i.e min and max values) in an AABB context ?
Can somebody help me to understand this please ?
Thank you !!
Hi,
I'm trying to understand how to use the DistanceQueryInterface.
Does anyone have an example of this?
Thanks