Closed andrewrgarcia closed 1 year ago
vxm.Goxel()
now automatically updates hashblocks
voxel dictionary with the colors from the imported .txt file on the form {index: [ #rrggbb, 1]} after call, i.e. :
gox = vxm.Goxel('your-imported-file.txt')
# automatically updated hashblocks dictionary! no need for gox.update_colors anymore (deprecated)
array = gox.importfile() # turn txt file to array
Updated strategy which transfer voxel colors from Goxel
to Model
structure:
'load array to voxelmap Model'
model = vxm.Model(array)
'draw with same voxel colors as original external file '
model.hashblocks = gox.hashblocks
model.draw('voxels')
Keeping this issue open as it may be automated further beyond the current strategy.
commit 75106fe closes issue
Currently, external files are imported into a voxelmap (vxm) model by the
vxm.Goxel()
structure. For this, its functionvxm.Goxel().update_colors()
must be used to map the RRGGBB hexanumerical voxel colors of the imported file to a specific integer, i.e. :If the voxel coloring is intended to be made the same in the Python voxel draw as in the original model, they must then be defined, once again, in the
vxm.Model()
structure with itsvxm.Model().customadd()
function:Develop a medium which automatically defines the voxel colors of the external file into the Model structure by default. i.e. gox.update_colors('8f563b',1) --> model.customadd(1,'#8f563b'); ...