Replies: 3 comments 1 reply
-
It is possible to create new files. var slicerFile = new ChituboxFile();
// Populate all settings here: resolution, display size, layer height, bottom count, etc
slicerFile.Resolution = size; //eg
slicerFile.Display = size; //eg
slicerFile.LayerHeight = 0.05f; //eg
// ...
// ...
slicerFile.LayerManager.AllocateAndSetFromMat(mat[]); // Set from a mat list
// OR:
slicerFile.LayerManager.Init(count or layers[]); // Init from a count or a layer array, decodes use this method with number and init each layer
// Then:
slicerFile.SaveAs("my_new_file.ctb"); Dont forget that you will need to populate all other settings, such as resolution, display, etc before hand that's why load a dummy model is easier. Note: The Init method will not notify file from layer changes and should only be used when reading back a file that don't require recaulculations or resets, use AllocateAndSetFromMat is safer and will auto compute some fields. You can also do SlicerFile.SuppressRebuildPropertiesWork(() =>
{
SlicerFile.LayerHeight = (float)LayerHeight;
SlicerFile.BottomExposureTime = (float)BottomExposure;
SlicerFile.ExposureTime = (float)NormalExposure;
SlicerFile.BottomLayerCount = BottomLayers;
SlicerFile.LayerManager.Init(count);
// Parallel loop each created/loaded Mat and and set to layer index
Parallel.For(0, count, ....) ....
}, true); That method will mute all notifications, and when exit will recalculate and sanitize everything |
Beta Was this translation helpful? Give feedback.
-
Perfect - thanks! |
Beta Was this translation helpful? Give feedback.
-
It seems that to create a new file I first need a dummy or host file which I can then manipulate. Is this correct or is it possible to create new files (CTB v3 in what I'm attempting) from a set of layer mats?
Beta Was this translation helpful? Give feedback.
All reactions