3DCoat Python API
The 3DCoat Python API documentation.
Loading...
Searching...
No Matches
coat.Volume Class Reference

Public Member Functions

 __init__ (self)
 
 __init__ (self, any tb)
 
 __init__ (self, any vo)
 
 __init__ (self, Volume vol)
 
bool valid (self)
 checks if object is valid
 
bool isSurface (self)
 Check if in surface mode.
 
bool isVoxelized (self)
 Check if in voxel mode.
 
 toSurface (self)
 turn to surface mode, the triangles will be tangentially relaxed
 
 toVoxels (self)
 turn to voxels, auto-voxelize
 
 mergeMesh (self, Mesh mesh, mat4 transform=mat4.Identity, BoolOpType op=BoolOpType.BOOL_MERGE)
 merge the mesh into scene
 
 insertMesh (self, Mesh mesh, mat4 transform=mat4.Identity)
 insert the mesh into the volume, in case of voxels this is identical to addMesh, in case of surface, mesh will be inserted without booleans
 
 addMesh (self, Mesh mesh, mat4 transform=mat4.Identity)
 add the mesh to volume (boolean)
 
 subtractMesh (self, Mesh mesh, mat4 transform=mat4.Identity)
 subtract the mesh from volume (boolean)
 
 intersectWithMesh (self, Mesh mesh, mat4 transform=mat4.Identity)
 intersect the volume with the mesh (boolean)
 
 mergeMeshWithTexture (self, Mesh mesh, mat4 transform=mat4.Identity, BoolOpType op=BoolOpType.BOOL_MERGE)
 merge the mesh with facture, the volume polygons will be hidden, just the texture will be shown (like leafs in TreesGenerator)
 
float getExactDencity (self, int x, int y, int z, bool fromBackup, any cache_ref)
 returns the exact voxel density in local space at the exact integer location
 
float getInterpolatedValue (self, vec3 pos, bool fromBackup)
 returns interolated voxels density
 
int getPolycount (self)
 get the volume triangles count
 
float getVolume (self)
 get the volume of this object in world coordinates
 
float getSquare (self)
 reg the square of this object in world coordinates
 
boundbox calcLocalSpaceAABB (self)
 Calculate the Axis - Aligned Bound Box of the object in local space.
 
boundbox calcWorldSpaceAABB (self)
 Calculate the Axis - Aligned Bound Box of the object in world space.
 
any tree (self)
 returns the low-level object (VoxTreeBranch) for all low-level operations
 
any vo (self)
 returns the low-level object (VolumeObject) for all low-level operations
 
any cell (self, int cx, int cy, int cz, bool create, bool backup)
 get the cell by cell coordinates, each cell is 8*8*8
 
 dirty (self, int cx, int cy, int cz)
 mark the cell as dirty.
 
 setOpacity (self, float Opacity)
 set the volume opacity
 
 relaxGpu (self, vec3 center, float Radius, float degree)
 fast voxel-based relax within the sphere with the gradual falloff.
 
 relaxVoxels (self, int count)
 relax the whole volume, works only for voxels
 
 relaxSurface (self, float degree, bool tangent=False, bool keep_sharp_boolean_edges=False)
 relax the object in surface mode
 
 relaxOpenEdges (self, int nTimes)
 relax the open edges of the mesh, it is applicable only to the surface mode
 
SceneElement inScene (self)
 Get the Volume placement in the scene.
 
 clear (self)
 Clear and pass to the Undo queue.
 
 clearNoUndo (self)
 Clear quickly, without affecting the Undo queue.
 
 assignShader (self, str shaderName)
 set the shader for the Volume
 
 setBoolShaderProperty (self, str property, bool value)
 
 setFloatShaderProperty (self, str property, float value)
 
 setColorShaderProperty (self, str property, int value)
 
 closeHoles (self, int maxSize)
 Close the holes.
 
 removeUndercuts (self)
 remove undercuts for the current volume
 
 basRelief (self, vec3 start_point=vec3.Zero)
 perform the bas-relief for the current volume
 
 generateMoldingCurves (self)
 generate the automatic molding curves
 
 automaticMolding (self)
 perform the automatic molding
 
 curveBasedMolding (self)
 perform the curve-based mold
 
 subtractWithoutUndecuts (self)
 subtract the current undercutted object from the preliminary generated molding shapes
 
SceneElement generateMoldingTest (self)
 generate the figure that fills the gap between the molding shapes
 
SceneElement findMoldingTop (self)
 find the top molding shape (that was previously generated)
 
SceneElement findMoldingBottom (self)
 find the bottom molding shape (that was previously generated)
 
SceneElement findMoldingTest (self)
 find the test molding test shape (that was previously generated)
 
 removeMoldingShapes (self)
 remove all molding intermediate shapes, tests, etc.
 
 assignLiveBooleans (self, int operation)
 Apply the live booleans over the sculpt mesh, it is available for voxels only.
 
 collapseBollTree (self)
 collapse the boolean tree, it is available for this volume
 

Static Public Member Functions

 enableVoxelsColoring (bool enable=True)
 enable or disable the voxel-based coloring.
 
 color (int CL)
 set the default color to fill voxels if the voxel coloring enabled
 
 color (float r, float g, float b, float a)
 assign the color for the voxel operations
 
 color (float r, float g, float b)
 assign the color for the voxel operations
 
 color (str colorid)
 assign the color for the voxel operations
 
 gloss (float value)
 assign the gloss for the voxel operations, it will work only if the color already assigned
 
 roughness (float value)
 assign the roughness for the voxel operations, it will work only if the color already assigned
 
 metal (float value)
 the metalliclty value for the voxel operations, it will work only if the color already assigned
 
bool checkIfMoldingLicenseAvailable ()
 check if molding allowed
 
 setMoldingParams (vec3 direction, float tapering_angle=0, float undercuts_density=1.0, float decimation_limit_millions=10, bool perform_subtraction=True)
 set the parameters for the molding
 
 setAutomaticMoldingBox ()
 set the molding bound box to be automatic
 
 setMoldingBox (float width, float length, float thickness)
 set the molding bound box to be user-defined, not automatic
 
 setMoldingBorder (float width=0)
 set the molding border around the parting line to fade to the plane, if it is zero, the final shape will not fade to plane
 

Constructor & Destructor Documentation

◆ __init__() [1/4]

coat.Volume.__init__ ( self)

◆ __init__() [2/4]

coat.Volume.__init__ ( self,
any tb )

◆ __init__() [3/4]

coat.Volume.__init__ ( self,
any vo )

◆ __init__() [4/4]

coat.Volume.__init__ ( self,
Volume vol )

Member Function Documentation

◆ addMesh()

coat.Volume.addMesh ( self,
Mesh mesh,
mat4 transform = mat4.Identity )

add the mesh to volume (boolean)

Parameters
meshthe mesh reference
transformthe transform applied

◆ assignLiveBooleans()

coat.Volume.assignLiveBooleans ( self,
int operation )

Apply the live booleans over the sculpt mesh, it is available for voxels only.

Parameters
operation0 - stop live booleans, 1 - subtract from the parent, 2 - intersect, 3 - union

◆ assignShader()

coat.Volume.assignShader ( self,
str shaderName )

set the shader for the Volume

Parameters
shaderNamethe shader name as it is shown in the shader's hint

◆ automaticMolding()

coat.Volume.automaticMolding ( self)

perform the automatic molding

◆ basRelief()

coat.Volume.basRelief ( self,
vec3 start_point = vec3.Zero )

perform the bas-relief for the current volume

Parameters
start_pointthe cut point

◆ calcLocalSpaceAABB()

boundbox coat.Volume.calcLocalSpaceAABB ( self)

Calculate the Axis - Aligned Bound Box of the object in local space.

Returns
the boundary as comms.cBounds

◆ calcWorldSpaceAABB()

boundbox coat.Volume.calcWorldSpaceAABB ( self)

Calculate the Axis - Aligned Bound Box of the object in world space.

Returns
the boundary as comms.cBounds

◆ cell()

any coat.Volume.cell ( self,
int cx,
int cy,
int cz,
bool create,
bool backup )

get the cell by cell coordinates, each cell is 8*8*8

Parameters
cxcell x
cycell y
czcell z
createpass true if you want to create the cell if it does not exist
backupdrop the cell to backup (if not already dropped)
Returns
the pointer to the VolumeCell

◆ checkIfMoldingLicenseAvailable()

bool coat.Volume.checkIfMoldingLicenseAvailable ( )
static

check if molding allowed

Returns
true if the molding license available

◆ clear()

coat.Volume.clear ( self)

Clear and pass to the Undo queue.

◆ clearNoUndo()

coat.Volume.clearNoUndo ( self)

Clear quickly, without affecting the Undo queue.

◆ closeHoles()

coat.Volume.closeHoles ( self,
int maxSize )

Close the holes.

Parameters
maxSizemax hole size (edges over the primeter)

◆ collapseBollTree()

coat.Volume.collapseBollTree ( self)

collapse the boolean tree, it is available for this volume

◆ color() [1/4]

coat.Volume.color ( float r,
float g,
float b )
static

assign the color for the voxel operations

Parameters
rred value 0..255
ggreen value 0..255
bblue value 0..255

◆ color() [2/4]

coat.Volume.color ( float r,
float g,
float b,
float a )
static

assign the color for the voxel operations

Parameters
rred value 0..255
ggreen value 0..255
bblue value 0..255
aalpha value 0..255

◆ color() [3/4]

coat.Volume.color ( int CL)
static

set the default color to fill voxels if the voxel coloring enabled

◆ color() [4/4]

coat.Volume.color ( str colorid)
static

assign the color for the voxel operations

Parameters
coloridthe color in any suitable form: "RGB", "ARGB", "RRGGBB", "AARRGGBB", "#RGB", "#ARGB", "#RRGGBB", "#AARRGGBB", any web-color common name as "red", "green", "purple", google "webcolors"

◆ curveBasedMolding()

coat.Volume.curveBasedMolding ( self)

perform the curve-based mold

◆ dirty()

coat.Volume.dirty ( self,
int cx,
int cy,
int cz )

mark the cell as dirty.

This is required if you

◆ enableVoxelsColoring()

coat.Volume.enableVoxelsColoring ( bool enable = True)
static

enable or disable the voxel-based coloring.

It is applied wherever possible - merging models, brushing, creating parametric voxel figures, etc

Parameters
enabletrue to enable

◆ findMoldingBottom()

SceneElement coat.Volume.findMoldingBottom ( self)

find the bottom molding shape (that was previously generated)

Returns
the bottom shape reference

◆ findMoldingTest()

SceneElement coat.Volume.findMoldingTest ( self)

find the test molding test shape (that was previously generated)

Returns
the test shape reference

◆ findMoldingTop()

SceneElement coat.Volume.findMoldingTop ( self)

find the top molding shape (that was previously generated)

Returns
the top shape reference

◆ generateMoldingCurves()

coat.Volume.generateMoldingCurves ( self)

generate the automatic molding curves

◆ generateMoldingTest()

SceneElement coat.Volume.generateMoldingTest ( self)

generate the figure that fills the gap between the molding shapes

Returns
the generated scene element reference

◆ getExactDencity()

float coat.Volume.getExactDencity ( self,
int x,
int y,
int z,
bool fromBackup,
any 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)
cache_refdefine the variable coat.VolumeCache and pass there (in same thread) to speed up access;
Returns
the density 0..1

◆ getInterpolatedValue()

float coat.Volume.getInterpolatedValue ( self,
vec3 pos,
bool fromBackup )

returns interolated voxels density

Parameters
posposition in local space
fromBackuptake from the backup
Returns
linearly interplated value of the density

◆ getPolycount()

int coat.Volume.getPolycount ( self)

get the volume triangles count

Returns
triangles count

◆ getSquare()

float coat.Volume.getSquare ( self)

reg the square of this object in world coordinates

Returns
square

◆ getVolume()

float coat.Volume.getVolume ( self)

get the volume of this object in world coordinates

Returns
volume

◆ gloss()

coat.Volume.gloss ( float value)
static

assign the gloss for the voxel operations, it will work only if the color already assigned

Parameters
valuethe [0..1] value of the gloss

◆ inScene()

SceneElement coat.Volume.inScene ( self)

Get the Volume placement in the scene.

Returns
the SceneElement

◆ insertMesh()

coat.Volume.insertMesh ( self,
Mesh mesh,
mat4 transform = mat4.Identity )

insert the mesh into the volume, in case of voxels this is identical to addMesh, in case of surface, mesh will be inserted without booleans

Parameters
meshthe mesh reference
transformthe transform applied

◆ intersectWithMesh()

coat.Volume.intersectWithMesh ( self,
Mesh mesh,
mat4 transform = mat4.Identity )

intersect the volume with the mesh (boolean)

Parameters
meshthe mesh reference
transformthe transform applied

◆ isSurface()

bool coat.Volume.isSurface ( self)

Check if in surface mode.

Returns
true if in surface mode

◆ isVoxelized()

bool coat.Volume.isVoxelized ( self)

Check if in voxel mode.

Returns
true if in voxel mode

◆ mergeMesh()

coat.Volume.mergeMesh ( self,
Mesh mesh,
mat4 transform = mat4.Identity,
BoolOpType op = BoolOpType.BOOL_MERGE )

merge the mesh into scene

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

◆ mergeMeshWithTexture()

coat.Volume.mergeMeshWithTexture ( self,
Mesh mesh,
mat4 transform = mat4.Identity,
BoolOpType op = BoolOpType.BOOL_MERGE )

merge the mesh with facture, the volume polygons will be hidden, just the texture will be shown (like leafs in TreesGenerator)

Parameters
meshthe mesh that refers texture
transformthe transform applied
opthe boolean operation

◆ metal()

coat.Volume.metal ( float value)
static

the metalliclty value for the voxel operations, it will work only if the color already assigned

Parameters
valuethe [0..1] metal value

◆ relaxGpu()

coat.Volume.relaxGpu ( self,
vec3 center,
float Radius,
float degree )

fast voxel-based relax within the sphere with the gradual falloff.

It works only in voxel mode.

Parameters
centerthe center of
Radiusthe radius of the influence
degreethe relax degree, < 1

◆ relaxOpenEdges()

coat.Volume.relaxOpenEdges ( self,
int nTimes )

relax the open edges of the mesh, it is applicable only to the surface mode

Parameters
nTimesamount of iterations

◆ relaxSurface()

coat.Volume.relaxSurface ( self,
float degree,
bool tangent = False,
bool keep_sharp_boolean_edges = False )

relax the object in surface mode

Parameters
degreethe degree of smoothing, it may be >1 for the stronger relax
tangentuse tangent relax
keep_sharp_boolean_edgeskeep the sharp edges appeared due to bolean operations

◆ relaxVoxels()

coat.Volume.relaxVoxels ( self,
int count )

relax the whole volume, works only for voxels

Parameters
countthe count of relax steps

◆ removeMoldingShapes()

coat.Volume.removeMoldingShapes ( self)

remove all molding intermediate shapes, tests, etc.

◆ removeUndercuts()

coat.Volume.removeUndercuts ( self)

remove undercuts for the current volume

◆ roughness()

coat.Volume.roughness ( float value)
static

assign the roughness for the voxel operations, it will work only if the color already assigned

Parameters
valuethe [0..1] value of the roughness

◆ setAutomaticMoldingBox()

coat.Volume.setAutomaticMoldingBox ( )
static

set the molding bound box to be automatic

◆ setBoolShaderProperty()

coat.Volume.setBoolShaderProperty ( self,
str property,
bool value )

◆ setColorShaderProperty()

coat.Volume.setColorShaderProperty ( self,
str property,
int value )

◆ setFloatShaderProperty()

coat.Volume.setFloatShaderProperty ( self,
str property,
float value )

◆ setMoldingBorder()

coat.Volume.setMoldingBorder ( float width = 0)
static

set the molding border around the parting line to fade to the plane, if it is zero, the final shape will not fade to plane

Parameters
widththe width in mm or other default units

◆ setMoldingBox()

coat.Volume.setMoldingBox ( float width,
float length,
float thickness )
static

set the molding bound box to be user-defined, not automatic

Parameters
widththe width of the box
lengththe length of the box
thicknessthe thickness of the box

◆ setMoldingParams()

coat.Volume.setMoldingParams ( vec3 direction,
float tapering_angle = 0,
float undercuts_density = 1.0,
float decimation_limit_millions = 10,
bool perform_subtraction = True )
static

set the parameters for the molding

Parameters
directionthe molding direction
tapering_anglethe tapering angle in degrees
undercuts_densitythe additional density for the undercuts
decimation_limit_millionsdecimate the final shape if it has triangles count more than this value
perform_subtractionset false if no need to subtract the molding from the molding shapes

◆ setOpacity()

coat.Volume.setOpacity ( self,
float Opacity )

set the volume opacity

Parameters
Opacitythe 0..1 opacity value

◆ subtractMesh()

coat.Volume.subtractMesh ( self,
Mesh mesh,
mat4 transform = mat4.Identity )

subtract the mesh from volume (boolean)

Parameters
meshthe mesh reference
transformthe transform applied

◆ subtractWithoutUndecuts()

coat.Volume.subtractWithoutUndecuts ( self)

subtract the current undercutted object from the preliminary generated molding shapes

◆ toSurface()

coat.Volume.toSurface ( self)

turn to surface mode, the triangles will be tangentially relaxed

◆ toVoxels()

coat.Volume.toVoxels ( self)

turn to voxels, auto-voxelize

◆ tree()

any coat.Volume.tree ( self)

returns the low-level object (VoxTreeBranch) for all low-level operations

Returns
the VoxTreeBranch* pointer

◆ valid()

bool coat.Volume.valid ( self)

checks if object is valid

Returns
true if the volume exists

◆ vo()

any coat.Volume.vo ( self)

returns the low-level object (VolumeObject) for all low-level operations

Returns
the VolumeObject* pointer

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