3DCoat  3D-COAT 4.9.xx
3DCoat is the one application that has all the tools you need to take your 3D idea from a block of digital clay all the way to a production ready, fully textured organic or hard surface model.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
coat::Volume Class Reference

The class allows to operate over voxels/surface on the relatively low-level. More...

#include <CoreAPI.h>

Public Member Functions

bool valid () const
 checks if object is valid More...
 
bool isSurface () const
 Check if in surface mode. More...
 
bool isVoxelized () const
 Check if in voxel mode. More...
 
void toSurface ()
 turn to surface mode, the triangles will be tangentially relaxed More...
 
void toVoxels ()
 turn to voxels, auto-voxelize More...
 
void mergeMesh (const Mesh &mesh, const mat4 &transform=mat4::Identity, BoolOpType op=BOOL_MERGE)
 merge the mesh into scene More...
 
VolumemakeVoxelFigure (std::function< float(vec3)> densityFunction, const list< vec3 > &growCenters, bool Subtract=false, bool useTempLocation=false, bool overHidden=false)
 This function is fast (generally realtime) way to fill the volume with voxels. Voxel Brush Engune completely based on this routine. More...
 
float getExactDencity (int x, int y, int z, bool fromBackup, cache &cache_ref)
 returns the exact voxel density in local space at the exact integer location More...
 
float getInterpolatedValue (const vec3 &pos, bool fromBackup)
 returns interolated voxels density More...
 

Detailed Description

The class allows to operate over voxels/surface on the relatively low-level.

Member Function Documentation

float coat::Volume::getExactDencity ( int  x,
int  y,
int  z,
bool  fromBackup,
cache &  cache_ref 
)

returns the exact voxel density in local space at the exact integer location

Parameters
xX-coordinate
yY-coordinate (up)
zZ-coordinate
fromBackuptake the values from the backup (kept before the modifications started)
definethe variable coat::Volume::cache and pass there (in sae thread) to speed up access;
Returns
the density 0..1
float coat::Volume::getInterpolatedValue ( const vec3 pos,
bool  fromBackup 
)

returns interolated voxels density

Parameters
posposition in local space
fromBackuptake from the backup
Returns
linearly interplated value of the density
bool coat::Volume::isSurface ( ) const

Check if in surface mode.

Returns
true if in surface mode
bool coat::Volume::isVoxelized ( ) const

Check if in voxel mode.

Returns
true if in voxel mode
coat::Volume & coat::Volume::makeVoxelFigure ( std::function< float(vec3)>  densityFunction,
const list< vec3 > &  growCenters,
bool  Subtract = false,
bool  useTempLocation = false,
bool  overHidden = false 
)

This function is fast (generally realtime) way to fill the volume with voxels. Voxel Brush Engune completely based on this routine.

Parameters
densityFunctionthe function should return the value 0..1, where 0 means empty, 1-filled, 0.5 means we are on the surface. Be careful, function should be limited in space. Coordinates passed in volume's local space.
growCentersthe list of points where function is not zero - that are grow centers
Subtracttrue if you need to subtract, in this case you return value that will be subtracted from the volume
useTempLocationif true all your modifications will be applied after you will finish all chnages
overHiddenif true the function will work as Hide tool (Subtract taken into account)
Returns
returns itself for the chain-like reference.
void coat::Volume::mergeMesh ( const Mesh mesh,
const mat4 transform = mat4::Identity,
BoolOpType  op = BOOL_MERGE 
)

merge the mesh into scene

Parameters
meshthe Mesh rference
transformthe transform applied
opthe type of the merge

References coat::BOOL_ADD, and coat::BOOL_MERGE.

void coat::Volume::toSurface ( )

turn to surface mode, the triangles will be tangentially relaxed

void coat::Volume::toVoxels ( )

turn to voxels, auto-voxelize

bool coat::Volume::valid ( ) const

checks if object is valid

Returns
true if the volume exists

The documentation for this class was generated from the following files: