rgsouthall / vi-suite06

VI-Suite release for Blender 2.8
32 stars 8 forks source link

problem with exporting simulation values with VI CSV export #11

Closed ttsesm closed 3 years ago

ttsesm commented 3 years ago

I have the following simple scene:

image

I have the terrain plane subdivided to multiple quad faces. If I set only the terrain or the cube as a Light sensor then the VI CSV Export seems to export the values for all vertices correctly. If I select faces instead of vertices it seems that there is always one facet missing.

Now if I select vertices and set both the terrain and the cube as Light sensor then the output values for terrain are limited to the amount of vertices of the cube. Apparently to the smallest geometry of the scene. On the other hand if I select faces instead the output values are limited to the amount of the geometry with the less faces and always one facet missing.

rgsouthall commented 3 years ago

Thanks for the bug report. This should now be fixed in git.

ttsesm commented 3 years ago

Hi Ryan, Thanks for the update, I confirm that your last commit solves the issue with the missing face. However, there is still the issue when there are multiple Light sensor surfaces.

In the console I am correctly getting the correct points to be considered (with the print that you added in the last commit):

Per faces
Cube:
6
[Vector((0.0, 0.0, 2.8133926391601562)), Vector((0.0, -1.0, 1.8133926391601562)), Vector((-1.0, 0.0, 1.8133926391601562)), Vector((0.0, 0.0, 0.8133925199508667)), Vector((1.0, 0.0, 1.8133926391601562)), Vector((0.0, 1.0, 1.8133926391601562))]

Terrain:
22
[Vector((7.445186614990234, 7.445186614990234, 0.0)), Vector((-2.4817287921905518, 7.445186614990234, 0.0)), Vector((-2.4817287921905518, -2.4817287921905518, 0.0)), Vector((7.445186614990234, -2.4817287921905518, 0.0)), Vector((2.4817287921905518, -2.4817287921905518, 0.0)), Vector((2.4817287921905518, -7.445186614990234, 0.0)), Vector((7.445186614990234, -7.445186614990234, 0.0)), Vector((-7.445186614990234, -2.4817287921905518, 0.0)), Vector((-7.445186614990234, -7.445186614990234, 0.0)), Vector((-2.4817287921905518, -7.445186614990234, 0.0)), Vector((-7.445186614990234, 7.445186614990234, 0.0)), Vector((-7.445186614990234, 2.4817287921905518, 0.0)), Vector((-2.4817287921905518, 2.4817287921905518, 0.0)), Vector((2.4817287921905518, 7.445186614990234, 0.0)), Vector((2.4817287921905518, 2.4817287921905518, 0.0)), Vector((7.445186614990234, 2.4817287921905518, 0.0))]
Info: Simulation is finished

Per vertices
Cube:
8
[Vector((1.0, 1.0, 2.8133926391601562)), Vector((1.0, 1.0, 0.8133925199508667)), Vector((1.0, -1.0, 2.8133926391601562)), Vector((1.0, -1.0, 0.8133925199508667)), Vector((-1.0, 1.0, 2.8133926391601562)), Vector((-1.0, 1.0, 0.8133925199508667)), Vector((-1.0, -1.0, 2.8133926391601562)), Vector((-1.0, -1.0, 0.8133925199508667))]

Terrain:
33
[Vector((-9.926915168762207, -9.926915168762207, 0.0)), Vector((9.926915168762207, -9.926915168762207, 0.0)), Vector((-9.926915168762207, 9.926915168762207, 0.0)), Vector((9.926915168762207, 9.926915168762207, 0.0)), Vector((-9.926915168762207, 0.0, 0.0)), Vector((0.0, -9.926915168762207, 0.0)), Vector((9.926915168762207, 0.0, 0.0)), Vector((0.0, 9.926915168762207, 0.0)), Vector((0.0, 0.0, 0.0)), Vector((-9.926915168762207, -4.9634575843811035, 0.0)), Vector((4.9634575843811035, -9.926915168762207, 0.0)), Vector((9.926915168762207, 4.9634575843811035, 0.0)), Vector((-4.9634575843811035, 9.926915168762207, 0.0)), Vector((-9.926915168762207, 4.9634575843811035, 0.0)), Vector((-4.9634575843811035, -9.926915168762207, 0.0)), Vector((9.926915168762207, -4.9634575843811035, 0.0)), Vector((4.9634575843811035, 9.926915168762207, 0.0)), Vector((0.0, 4.9634575843811035, 0.0)), Vector((0.0, -4.9634575843811035, 0.0)), Vector((-4.9634575843811035, 0.0, 0.0)), Vector((4.9634575843811035, 0.0, 0.0)), Vector((4.9634575843811035, -4.9634575843811035, 0.0)), Vector((-4.9634575843811035, -4.9634575843811035, 0.0)), Vector((-4.9634575843811035, 4.9634575843811035, 0.0)), Vector((4.9634575843811035, 4.9634575843811035, 0.0))]
Info: Simulation is finished

But then below you can see that the exported values in the csv files from the VI CSV export node are limited to 6 and 8 values respectively based on the smaller geometry in the scene which in my case is the cube:

Per faces: image

here I would expect to have 22 values for the plane instead of just 6.

Per vertices: image

accordingly here I would expect 33 values for the plane instead of only 8.

I guess you might need to reformat the output structure, I think it would make more sense to concatenate the values row-wise instead of column-wise otherwise you will need to fill the empty cells with zeros or NaN's. Something like that should be sufficient:

image

what do you think?

ttsesm commented 3 years ago

Thanks Ryan, with your last commit it seems to work fine now.

image

I would argue though, that it would be nicer I believe to have the values concatenated row-wise instead of column-wise so that to avoid having these empty space between the different surfaces and I guess it would easier for someone to read the file as a point cloud from a text editor considering that the first 3 columns is gonna be always the x, y, z coordinates.

image

but I do not know, you might have something else in your mind.