3DCoat Python API
The 3DCoat Python API documentation.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
coat.Volume Class Reference

Public Member Functions

 __init__ (self)
 
 __init__ (self, tb=Any)
 
 __init__ (self, vo=Any)
 
 __init__ (self, vol=Volume)
 
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
 
 enableVoxelsColoring (enable=bool)
 enable or disable the voxel-based coloring.
 
 color (CL=int)
 set the default color to fill voxels if the voxel coloring enabled
 
 color (r=float, g=float, b=float, a=float)
 assign the color for the voxel operations
 
 color (r=float, g=float, b=float)
 assign the color for the voxel operations
 
 color (colorid=str)
 assign the color for the voxel operations
 
 gloss (value=float)
 assign the gloss for the voxel operations, it will work only if the color already assigned
 
 roughness (value=float)
 assign the roughness for the voxel operations, it will work only if the color already assigned
 
 metal (value=float)
 the metalliclty value for the voxel operations, it will work only if the color already assigned
 
 mergeMesh (self, mesh=Mesh, transform=mat4, op=BoolOpType)
 merge the mesh into scene
 
 insertMesh (self, mesh=Mesh, transform=mat4)
 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, transform=mat4)
 add the mesh to volume (boolean)
 
 subtractMesh (self, mesh=Mesh, transform=mat4)
 subtract the mesh from volume (boolean)
 
 intersectWithMesh (self, mesh=Mesh, transform=mat4)
 intersect the volume with the mesh (boolean)
 
 mergeMeshWithTexture (self, mesh=Mesh, transform=mat4, op=BoolOpType)
 merge the mesh with facture, the volume polygons will be hidden, just the texture will be shown (like leafs in TreesGenerator)
 
float getExactDencity (self, x=int, y=int, z=int, fromBackup=bool, cache_ref=Any)
 returns the exact voxel density in local space at the exact integer location
 
float getInterpolatedValue (self, pos=vec3, fromBackup=bool)
 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 calcLocalScaceAABB (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, cx=int, cy=int, cz=int, create=bool, backup=bool)
 get the cell by cell coordinates, each cell is 8 #8 #8
 
Any attributes (self, cx=int, cy=int, cz=int, create=bool, backup=bool)
 get the cell attributes by cell coordinates, each cell is 8 #8 #8, generally it is kept as VolumeCell::Attr
 
 dirty (self, cx=int, cy=int, cz=int)
 mark the cell as dirty.
 
 setOpacity (self, Opacity=float)
 set the volume opacity
 
 relaxGpu (self, center=vec3, Radius=float, degree=float)
 fast voxel-based relax within the sphere with the gradual falloff.
 
 relaxVoxels (self, count=int)
 relax the whole volume, works only for voxels
 
 relaxSurface (self, degree=float, tangent=bool, keep_sharp_boolean_edges=bool)
 relax the object in surface mode
 
 relaxOpenEdges (self, nTimes=int)
 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, shaderName=str)
 set the shader for the Volume
 
 setBoolShaderProperty (self, property=str, value=bool)
 set the shader for the Volume
 
 setFloatShaderProperty (self, property=str, value=float)
 set the shader for the Volume
 
 setColorShaderProperty (self, property=str, value=int)
 set the shader for the Volume
 
 closeHoles (self, maxSize=int)
 Close the holes.
 
bool checkIfMoldingLicenseAvailable ()
 check if molding allowed
 
 setMoldingParams (direction=vec3, tapering_angle=float, undercuts_density=float, decimation_limit_millions=float, perform_subtraction=bool)
 set the parameters for the molding
 
 removeUndercuts (self)
 remove undercuts for the current volume
 
 basRelief (self, start_point=vec3)
 perform the bas-relief for the current volume
 
 setAutomaticMoldingBox ()
 set the molding bound box to be automatic
 
 setMoldingBox (width=float, length=float, thickness=float)
 set the molding bound box to be user-defined, not automatic
 
 setMoldingBorder (width=float)
 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
 
 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, operation=int)
 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
 

Constructor & Destructor Documentation

◆ __init__() [1/4]

coat.Volume.__init__ (   self)

◆ __init__() [2/4]

coat.Volume.__init__ (   self,
  tb = Any 
)

◆ __init__() [3/4]

coat.Volume.__init__ (   self,
  vo = Any 
)

◆ __init__() [4/4]

coat.Volume.__init__ (   self,
  vol = Volume 
)

Member Function Documentation

◆ addMesh()

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

add the mesh to volume (boolean)

Parameters
meshthe mesh reference
transformthe transform applied

◆ assignLiveBooleans()

coat.Volume.assignLiveBooleans (   self,
  operation = int 
)

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,
  shaderName = str 
)

set the shader for the Volume

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

◆ attributes()

Any coat.Volume.attributes (   self,
  cx = int,
  cy = int,
  cz = int,
  create = bool,
  backup = bool 
)

get the cell attributes by cell coordinates, each cell is 8 #8 #8, generally it is kept as VolumeCell::Attr

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 VolumeCellAttrib

◆ automaticMolding()

coat.Volume.automaticMolding (   self)

perform the automatic molding

◆ basRelief()

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

perform the bas-relief for the current volume

Parameters
start_pointthe cut point

◆ calcLocalScaceAABB()

boundbox coat.Volume.calcLocalScaceAABB (   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,
  cx = int,
  cy = int,
  cz = int,
  create = bool,
  backup = bool 
)

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 ( )

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,
  maxSize = int 
)

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 (   CL = int)

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

◆ color() [2/4]

coat.Volume.color (   colorid = str)

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"

◆ color() [3/4]

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

assign the color for the voxel operations

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

◆ color() [4/4]

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

assign the color for the voxel operations

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

◆ curveBasedMolding()

coat.Volume.curveBasedMolding (   self)

perform the curve-based mold

◆ dirty()

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

mark the cell as dirty.

This is required if you

Parameters
cx
cy
cz

◆ enableVoxelsColoring()

coat.Volume.enableVoxelsColoring (   enable = bool)

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,
  x = int,
  y = int,
  z = int,
  fromBackup = bool,
  cache_ref = Any 
)

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,
  pos = vec3,
  fromBackup = bool 
)

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 (   value = float)

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,
  transform = mat4 
)

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,
  transform = mat4 
)

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,
  transform = mat4,
  op = BoolOpType 
)

merge the mesh into scene

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

◆ mergeMeshWithTexture()

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

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 (   value = float)

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,
  center = vec3,
  Radius = float,
  degree = float 
)

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,
  nTimes = int 
)

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

Parameters
nTimesamount of iterations

◆ relaxSurface()

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

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,
  count = int 
)

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 (   value = float)

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 ( )

set the molding bound box to be automatic

◆ setBoolShaderProperty()

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

set the shader for the Volume

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

◆ setColorShaderProperty()

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

set the shader for the Volume

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

◆ setFloatShaderProperty()

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

set the shader for the Volume

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

◆ setMoldingBorder()

coat.Volume.setMoldingBorder (   width = float)

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 (   width = float,
  length = float,
  thickness = float 
)

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 (   direction = vec3,
  tapering_angle = float,
  undercuts_density = float,
  decimation_limit_millions = float,
  perform_subtraction = bool 
)

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,
  Opacity = float 
)

set the volume opacity

Parameters
Opacitythe 0..1 opacity value

◆ subtractMesh()

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

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: