Volumes can be created and edited with specific commands and functions provided in the maxon::VolumeToolsInterface.
  
  
  
  
 
  VolumeObject* volumeObjectA = nullptr;
  VolumeObject* volumeObjectB = nullptr;
  VolumeObject* resultVolume  = nullptr;
 
  {
    
 
    maxon::LegacyCommandDataRef 
context = maxon::LegacyCommandDataClasses::VOLUMEDATA().Create() 
iferr_return;
 
 
 
    data.
op = &sourceObjects;
 
 
 
    const auto command = maxon::CommandClasses::MESHTOVOLUME();
 
 
    if (
result.result.GetCount() == 2)
 
    {
      volumeObjectA = 
static_cast<VolumeObject*
>(
result.result[0]);
 
      volumeObjectB = 
static_cast<VolumeObject*
>(
result.result[1]);
 
    }
  }
 
  {
    
 
    maxon::LegacyCommandDataRef 
context = maxon::LegacyCommandDataClasses::VOLUMEDATA().Create() 
iferr_return;
 
 
 
    data.
op = &sourceObjects;
 
    
 
    const auto command = maxon::CommandClasses::BOOLE();
 
 
    if (
result.result.GetCount() == 1)
 
    {
      resultVolume = 
static_cast<VolumeObject*
>(
result.result[0]);
 
    }
  }
 
  {
    
 
    maxon::LegacyCommandDataRef 
context = maxon::LegacyCommandDataClasses::VOLUMEDATA().Create() 
iferr_return;
 
 
 
    data.
op = &sourceObjects;
 
 
    const auto command = maxon::CommandClasses::VOLUMETOMESH();
 
 
    if (
result.result.GetCount() == 1)
 
    {
      BaseObject* 
const object = 
result.result[0];
 
      doc->InsertObject(
object, 
nullptr, 
nullptr);
 
    }
  }
 
  
  VolumeObject::Free(resultVolume);
  VolumeObject::Free(volumeObjectA);
  VolumeObject::Free(volumeObjectB);
Definition: basearray.h:415
 
MAXON_ATTRIBUTE_FORCE_INLINE ResultRef< T > Append(ARG &&x)
Appends a new element at the end of the array and constructs it using the forwarded value.
Definition: basearray.h:627
 
PyObject PyObject * result
Definition: abstract.h:43
 
Py_UCS4 * res
Definition: unicodeobject.h:1113
 
GRIDSIZE
::Float Grid voxel cube size.
Definition: ge_prepass.h:1
 
BOOLETYPE
::Int32 The Boole type (union, difference, intersection).
Definition: ge_prepass.h:1
 
Int64 Int
signed 32/64 bit int, size depends on the platform
Definition: apibase.h:187
 
#define MAXON_SCOPE
Definition: apibase.h:2891
 
return OK
Definition: apibase.h:2740
 
COMMANDRESULT
Defines the result of the command after execution.
Definition: commandbase.h:37
 
@ OK
The command was executed properly.
 
void * context
Definition: pycapsule.h:49
 
const char * doc
Definition: pyerrors.h:226
 
#define iferr_return
Definition: resultbase.h:1531
 
Definition: volumecommands.h:24
 
BaseArray< cinema::BaseObject * > * op
Definition: volumecommands.h:40
 
    
  
  
  
 
  
                      {
 
                        
 
                        const Vector*   
const points = poly->GetPointR();
 
                        const CPolygon* const polys  = poly->GetPolygonR();
 
                        if (noPoints || noPolys)
 
                        
 
                        const Int32  pointCount = poly->GetPointCount();
 
                        const Int32  polyCount  = poly->GetPolygonCount();
 
                        const Matrix objectMatrix = poly->GetMg();
 
 
 
 
                        
 
                        
                        for (
Int32 pointIndex = 0; pointIndex < pointCount; ++pointIndex)
 
                          volPoints[pointIndex] = objectMatrix * points[pointIndex];
 
                        
 
                        
                        for (
Int32 polyIndex = 0; polyIndex < polyCount; polyIndex++)
 
                        {
 
                          if (polys[polyIndex].IsTriangle())
                            volPolys[polyIndex].SetTriangle();
                        }
 
                        if (thread == nullptr)
 
                      };
 
  
 
  const maxon::Volume volumeA = PolyToVolume(polyObjectA) 
iferr_return;
 
  const maxon::Volume volumeB = PolyToVolume(polyObjectB) 
iferr_return;
 
 
  
 
  
  if (mesh == nullptr)
 
  doc->InsertObject(mesh, 
nullptr, 
nullptr);
 
PyCompilerFlags * flags
Definition: ast.h:14
 
ResultMem Resize(Int newCnt, COLLECTION_RESIZE_FLAGS resizeFlags=COLLECTION_RESIZE_FLAGS::DEFAULT)
Resizes the array to contain newCnt elements. If newCnt is smaller than GetCount() all extra elements...
Definition: basearray.h:1217
 
Definition: resultbase.h:766
 
static StrongRef< const ThreadInterface > GetCurrentThread()
Definition: thread.h:366
 
bool Bool
boolean type, possible values are only false/true, 8 bit
Definition: apibase.h:180
 
COLLECTION_RESIZE_FLAGS
Flags for Resize(). Depending on the type of collection the flags might be ignored (except for ON_GRO...
Definition: collection.h:126
 
@ ON_GROW_UNINITIALIZED
Do not initialize added elements (usually PODs) when resizing the array (is supported by all collecti...
 
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:69
 
maxon::Int32 Int32
Definition: ge_sys_math.h:51
 
maxon::Mat3< maxon::Vector64 > Matrix
Definition: ge_math.h:159
 
maxon::Vec3< maxon::Float64, 1 > Vector
Definition: ge_math.h:140
 
The maxon namespace contains all declarations of the Maxon API.
Definition: autoweight.h:21
 
#define iferr_scope
Definition: resultbase.h:1396
 
Definition: volumetools.h:193
 
    
 
  
 
 
 
 
  
 
  
  VolumeObject* const volumeObject = VolumeObject::Alloc();
  if (volumeObject == nullptr)
 
  doc->InsertObject(volumeObject, 
nullptr, 
nullptr);
 
 
  
  volumeObject->SetVolume(volume);
T maxValue
The inclusive maximum boundary of this range. If the minimum boundary is not less than or equal to th...
Definition: range.h:257
 
T minValue
The inclusive minimum boundary of this range.
Definition: range.h:256
 
Float64 Float
Definition: apibase.h:196
 
Definition: volumetools.h:177
 
FIELDLAYER_FLAG flags
Definition: volumetools.h:180
 
const cinema::BaseDocument * doc
Definition: volumetools.h:184
 
Matrix extraTransform
Definition: volumetools.h:179
 
const cinema::FieldList * fieldList
Definition: volumetools.h:182
 
const cinema::BaseList2D * fieldOwner
Definition: volumetools.h:183