Skip to main content

3D BitSet container

1 reply [Last post]
fmicchetti
Offline
Joined: 2006-11-09

Hi,

right now I am working on a translator which has to take a trianlge strips shape (any kind of shape) and translate it into a 3D shape made only of cubes 1x1x1.

To do this I create a Vector < Vector < Vector < BitSet > > > 3D container class with set/get ( int x, int y, int z ) methods.

Then I check for intersections of triangle strips and unit cubes (iterating on the 3D Container) and switch the flags on for the cubes which intersect the triangles.

After filling the container I simply create cubes from point x, y, z to point x+1, y+1, z+1, if container.get ( x, y, z ) is marked.

Do you think I should use some other type of data structure for doing this (or maybe a better method)?

I, sometimes, need to use a scale factor on the triangles shape if it is too little, and of course my container grows very big.

Thanks.

Francesco.

I'll post some pics tomorrow to show what I do (since I might have not been to clear, eheh)

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
fmicchetti
Offline
Joined: 2006-11-09

mhhh.... was just thinking... maybe if I store in memory only vertexes turned on?

like Vector < Integer > xCoords, yCoords, zCoords?

less comfortable, but less memory consuming I guess.

What you think?

Francesco.