MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / pythonAddVoxelsToScene

Function pythonAddVoxelsToScene

source/mrviewerpy/MRPythonScene.cpp:253–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251#ifndef MRMESH_NO_OPENVDB
252
253void pythonAddVoxelsToScene( const MR::VdbVolume& model, const std::string& name )
254{
255 MR::CommandLoop::runCommandFromGUIThread( [&] ()
256 {
257 auto newObject = std::make_shared<MR::ObjectVoxels>();
258 newObject->construct( model );
259 auto bins = newObject->histogram().getBins();
260 auto minMax = newObject->histogram().getBinMinMax( bins.size() / 3 );
261 (void)newObject->setIsoValue( minMax.first ); //TODO: process potential error
262 newObject->setName( name );
263 MR::SceneRoot::get().addChild( newObject );
264 } );
265}
266
267MR_ADD_PYTHON_CUSTOM_DEF( mrviewerpy, SceneVoxels, [] ( pybind11::module_& m )
268{

Callers

nothing calls this directly

Calls 6

getBinMinMaxMethod · 0.80
setIsoValueMethod · 0.80
addChildMethod · 0.80
getFunction · 0.50
constructMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected