3DCoat Python API
The 3DCoat Python API documentation.
|
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 | |
coat.Volume.__init__ | ( | self | ) |
coat.Volume.__init__ | ( | self, | |
any | tb ) |
coat.Volume.__init__ | ( | self, | |
any | vo ) |
coat.Volume.__init__ | ( | self, | |
Volume | vol ) |
add the mesh to volume (boolean)
mesh | the mesh reference |
transform | the transform applied |
coat.Volume.assignLiveBooleans | ( | self, | |
int | operation ) |
Apply the live booleans over the sculpt mesh, it is available for voxels only.
operation | 0 - stop live booleans, 1 - subtract from the parent, 2 - intersect, 3 - union |
coat.Volume.assignShader | ( | self, | |
str | shaderName ) |
set the shader for the Volume
shaderName | the shader name as it is shown in the shader's hint |
coat.Volume.automaticMolding | ( | self | ) |
perform the automatic molding
coat.Volume.basRelief | ( | self, | |
vec3 | start_point = vec3.Zero ) |
perform the bas-relief for the current volume
start_point | the cut point |
boundbox coat.Volume.calcLocalSpaceAABB | ( | self | ) |
Calculate the Axis - Aligned Bound Box of the object in local space.
boundbox coat.Volume.calcWorldSpaceAABB | ( | self | ) |
Calculate the Axis - Aligned Bound Box of the object in world space.
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
cx | cell x |
cy | cell y |
cz | cell z |
create | pass true if you want to create the cell if it does not exist |
backup | drop the cell to backup (if not already dropped) |
|
static |
check if molding allowed
coat.Volume.clear | ( | self | ) |
Clear and pass to the Undo queue.
coat.Volume.clearNoUndo | ( | self | ) |
Clear quickly, without affecting the Undo queue.
coat.Volume.closeHoles | ( | self, | |
int | maxSize ) |
Close the holes.
maxSize | max hole size (edges over the primeter) |
coat.Volume.collapseBollTree | ( | self | ) |
collapse the boolean tree, it is available for this volume
|
static |
assign the color for the voxel operations
r | red value 0..255 |
g | green value 0..255 |
b | blue value 0..255 |
|
static |
assign the color for the voxel operations
r | red value 0..255 |
g | green value 0..255 |
b | blue value 0..255 |
a | alpha value 0..255 |
|
static |
set the default color to fill voxels if the voxel coloring enabled
|
static |
assign the color for the voxel operations
colorid | the color in any suitable form: "RGB", "ARGB", "RRGGBB", "AARRGGBB", "#RGB", "#ARGB", "#RRGGBB", "#AARRGGBB", any web-color common name as "red", "green", "purple", google "webcolors" |
coat.Volume.curveBasedMolding | ( | self | ) |
perform the curve-based mold
coat.Volume.dirty | ( | self, | |
int | cx, | ||
int | cy, | ||
int | cz ) |
mark the cell as dirty.
This is required if you
|
static |
enable or disable the voxel-based coloring.
It is applied wherever possible - merging models, brushing, creating parametric voxel figures, etc
enable | true to enable |
SceneElement coat.Volume.findMoldingBottom | ( | self | ) |
find the bottom molding shape (that was previously generated)
SceneElement coat.Volume.findMoldingTest | ( | self | ) |
find the test molding test shape (that was previously generated)
SceneElement coat.Volume.findMoldingTop | ( | self | ) |
find the top molding shape (that was previously generated)
coat.Volume.generateMoldingCurves | ( | self | ) |
generate the automatic molding curves
SceneElement coat.Volume.generateMoldingTest | ( | self | ) |
generate the figure that fills the gap between the molding shapes
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
x | X-coordinate |
y | Y-coordinate (up) |
z | Z-coordinate |
fromBackup | take the values from the backup (kept before the modifications started) |
cache_ref | define the variable coat.VolumeCache and pass there (in same thread) to speed up access; |
float coat.Volume.getInterpolatedValue | ( | self, | |
vec3 | pos, | ||
bool | fromBackup ) |
returns interolated voxels density
pos | position in local space |
fromBackup | take from the backup |
int coat.Volume.getPolycount | ( | self | ) |
get the volume triangles count
float coat.Volume.getSquare | ( | self | ) |
reg the square of this object in world coordinates
float coat.Volume.getVolume | ( | self | ) |
get the volume of this object in world coordinates
|
static |
assign the gloss for the voxel operations, it will work only if the color already assigned
value | the [0..1] value of the gloss |
SceneElement coat.Volume.inScene | ( | self | ) |
Get the Volume placement in the scene.
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
mesh | the mesh reference |
transform | the transform applied |
intersect the volume with the mesh (boolean)
mesh | the mesh reference |
transform | the transform applied |
bool coat.Volume.isSurface | ( | self | ) |
Check if in surface mode.
bool coat.Volume.isVoxelized | ( | self | ) |
Check if in voxel mode.
coat.Volume.mergeMesh | ( | self, | |
Mesh | mesh, | ||
mat4 | transform = mat4.Identity, | ||
BoolOpType | op = BoolOpType.BOOL_MERGE ) |
merge the mesh into scene
mesh | the Mesh reference |
transform | the transform applied |
op | the type of the merge |
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)
mesh | the mesh that refers texture |
transform | the transform applied |
op | the boolean operation |
|
static |
the metalliclty value for the voxel operations, it will work only if the color already assigned
value | the [0..1] metal value |
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.
center | the center of |
Radius | the radius of the influence |
degree | the relax degree, < 1 |
coat.Volume.relaxOpenEdges | ( | self, | |
int | nTimes ) |
relax the open edges of the mesh, it is applicable only to the surface mode
nTimes | amount of iterations |
coat.Volume.relaxSurface | ( | self, | |
float | degree, | ||
bool | tangent = False, | ||
bool | keep_sharp_boolean_edges = False ) |
relax the object in surface mode
degree | the degree of smoothing, it may be >1 for the stronger relax |
tangent | use tangent relax |
keep_sharp_boolean_edges | keep the sharp edges appeared due to bolean operations |
coat.Volume.relaxVoxels | ( | self, | |
int | count ) |
relax the whole volume, works only for voxels
count | the count of relax steps |
coat.Volume.removeMoldingShapes | ( | self | ) |
remove all molding intermediate shapes, tests, etc.
coat.Volume.removeUndercuts | ( | self | ) |
remove undercuts for the current volume
|
static |
assign the roughness for the voxel operations, it will work only if the color already assigned
value | the [0..1] value of the roughness |
|
static |
set the molding bound box to be automatic
coat.Volume.setBoolShaderProperty | ( | self, | |
str | property, | ||
bool | value ) |
coat.Volume.setColorShaderProperty | ( | self, | |
str | property, | ||
int | value ) |
coat.Volume.setFloatShaderProperty | ( | self, | |
str | property, | ||
float | value ) |
|
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
width | the width in mm or other default units |
|
static |
set the molding bound box to be user-defined, not automatic
width | the width of the box |
length | the length of the box |
thickness | the thickness of the box |
|
static |
set the parameters for the molding
direction | the molding direction |
tapering_angle | the tapering angle in degrees |
undercuts_density | the additional density for the undercuts |
decimation_limit_millions | decimate the final shape if it has triangles count more than this value |
perform_subtraction | set false if no need to subtract the molding from the molding shapes |
coat.Volume.setOpacity | ( | self, | |
float | Opacity ) |
set the volume opacity
Opacity | the 0..1 opacity value |
subtract the mesh from volume (boolean)
mesh | the mesh reference |
transform | the transform applied |
coat.Volume.subtractWithoutUndecuts | ( | self | ) |
subtract the current undercutted object from the preliminary generated molding shapes
coat.Volume.toSurface | ( | self | ) |
turn to surface mode, the triangles will be tangentially relaxed
coat.Volume.toVoxels | ( | self | ) |
turn to voxels, auto-voxelize
any coat.Volume.tree | ( | self | ) |
returns the low-level object (VoxTreeBranch) for all low-level operations
bool coat.Volume.valid | ( | self | ) |
checks if object is valid
any coat.Volume.vo | ( | self | ) |
returns the low-level object (VolumeObject) for all low-level operations