3DCoat Python API
The 3DCoat Python API documentation.
Loading...
Searching...
No Matches
coat.prim Class Reference
Inheritance diagram for coat.prim:
coat.bolt coat.boltHead coat.box coat.cylinder coat.freeform coat.nut coat.screw coat.sphere coat.spiral coat.text coat.thread coat.washer

Public Member Functions

 __init__ (self)
 
any class_name (self)
 get the primitive class name.
 
prim name (self, str s)
 set the primitive object name.
 
any name (self)
 get the primitive object name.
 
 add (self, Volume v)
 add the prim into scene
 
 subtract (self, Volume v)
 subtract the prim from scene
 
 intersect (self, Volume v)
 intersect the prim into scene
 
 merge (self, Volume v, BoolOpType op)
 merge the prim into scene
 
Mesh mesh (self)
 get the mesh prim
 
prim color (self, int CL)
 assign the color to the primitive (in voxels)
 
prim color (self, float r, float g, float b, float a)
 assign the color to the primitive (in voxels)
 
prim color (self, float r, float g, float b)
 assign the color to the primitive (in voxels)
 
prim color (self, str colorid)
 assign the color to the primitive (in voxels)
 
prim gloss (self, float value)
 assign the gloss for the voxel primitive, it will work only if the color already assigned
 
prim roughness (self, float value)
 assign the roughness for the voxel primitive, it will work only if the color already assigned
 
prim metal (self, float value)
 the metalliclty value for the voxel primitive, it will work only if the color already assigned
 
prim opacity (self, float value)
 assign the opacity of the color over the voxel primitive.
 
prim details (self, float det_level)
 set the detail level
 
float details (self)
 get the detail level
 
prim transform (self, mat4 t)
 set the transform matrix
 
mat4 transform (self)
 get the transform matrix
 
prim scale (self, float scale)
 set the scale
 
prim scale (self, vec3 v)
 set the scale
 
vec3 scale (self)
 get the scale
 
prim translate (self, vec3 _pos)
 Set the primitive translation.
 
vec3 translate (self)
 get the primitive translation
 
prim translate (self, float x, float y, float z)
 Set the primitive translation.
 
prim x (self, float x)
 shift the primitive along the x - axis
 
prim y (self, float y)
 shift the primitive along the y - axis
 
prim z (self, float z)
 shift the primitive along the z - axis
 
prim auto_divide (self, float average_div)
 set the auto devide
 
prim step_divide (self, float step)
 set the step devide
 
prim fillet (self, float radius)
 set the fillet
 
float fillet_relative (self)
 calculates a fillet relative value (0..1).
 

Static Public Member Functions

 debug_on (bool isOn=True)
 indicates whether to turn on or off the debug mode.
 
 debug_clear ()
 clear the debug info for primitive operations
 
 push_transform (mat4 t)
 set the global transform matrix to all primitives
 
 push_translate (vec3 d)
 Set the translation to all primitives.
 
 push_scale (float scale)
 Set the scale to all primitives.
 
 push_scale (vec3 s)
 Set the scale to all primitives.
 
 push_details (float details_modulator)
 set the detail level to all primitives
 
 reset_transform ()
 reset the global transform matrix
 

Constructor & Destructor Documentation

◆ __init__()

Member Function Documentation

◆ add()

coat.prim.add ( self,
Volume v )

add the prim into scene

Parameters
vthe scene volume reference

◆ auto_divide()

prim coat.prim.auto_divide ( self,
float average_div )

set the auto devide

Parameters
average_divthe average divide factor
Returns
this prim reference

◆ class_name()

any coat.prim.class_name ( self)

get the primitive class name.

◆ color() [1/4]

prim coat.prim.color ( self,
float r,
float g,
float b )

assign the color to the primitive (in voxels)

Parameters
rred value 0..255
ggreen value 0..255
bblue value 0..255
Returns
the reference

◆ color() [2/4]

prim coat.prim.color ( self,
float r,
float g,
float b,
float a )

assign the color to the primitive (in voxels)

Parameters
rred value 0..255
ggreen value 0..255
bblue value 0..255
aalpha value 0..255
Returns
the reference

◆ color() [3/4]

prim coat.prim.color ( self,
int CL )

assign the color to the primitive (in voxels)

Parameters
CLcolor in hexadecimal form 0xAARRGGBB
Returns
the reference

◆ color() [4/4]

prim coat.prim.color ( self,
str colorid )

assign the color to the primitive (in voxels)

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"
Returns
the reference

◆ debug_clear()

coat.prim.debug_clear ( )
static

clear the debug info for primitive operations

◆ debug_on()

coat.prim.debug_on ( bool isOn = True)
static

indicates whether to turn on or off the debug mode.

Parameters
isOnif this parameter is true, the debug mode is on, otherwise the debug mode is off.

◆ details() [1/2]

float coat.prim.details ( self)

get the detail level

Returns
detail level

◆ details() [2/2]

prim coat.prim.details ( self,
float det_level )

set the detail level

Returns
prim reference

◆ fillet()

prim coat.prim.fillet ( self,
float radius )

set the fillet

Parameters
radiusthe fillet radius
Returns
this primitive reference

◆ fillet_relative()

float coat.prim.fillet_relative ( self)

calculates a fillet relative value (0..1).

Returns
fillet relative value

Reimplemented in coat.box, coat.cone, coat.cylinder, coat.ngon, and coat.tube.

◆ gloss()

prim coat.prim.gloss ( self,
float value )

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

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

◆ intersect()

coat.prim.intersect ( self,
Volume v )

intersect the prim into scene

Parameters
vthe scene volume reference

◆ merge()

coat.prim.merge ( self,
Volume v,
BoolOpType op )

merge the prim into scene

Parameters
vthe scene volume reference
opthe type of the merge

◆ mesh()

Mesh coat.prim.mesh ( self)

get the mesh prim

Returns
mesh object

◆ metal()

prim coat.prim.metal ( self,
float value )

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

Parameters
valuethe [0..1] metal value
Returns
the reference

◆ name() [1/2]

any coat.prim.name ( self)

get the primitive object name.

◆ name() [2/2]

prim coat.prim.name ( self,
str s )

set the primitive object name.

Parameters
sthe object name
Returns
the prim object reference

◆ opacity()

prim coat.prim.opacity ( self,
float value )

assign the opacity of the color over the voxel primitive.

The color should be assigned before you assign the opacity, for example p.color("red").opacity(0.5)

Parameters
valuethe opacity value [0..1]
Returns
the reference

◆ push_details()

coat.prim.push_details ( float details_modulator)
static

set the detail level to all primitives

Not implemented yet

Parameters
details_modulatordatail level

◆ push_scale() [1/2]

coat.prim.push_scale ( float scale)
static

Set the scale to all primitives.

Not implemented yet

Parameters
scalethe new scale factor

◆ push_scale() [2/2]

coat.prim.push_scale ( vec3 s)
static

Set the scale to all primitives.

Not implemented yet

◆ push_transform()

coat.prim.push_transform ( mat4 t)
static

set the global transform matrix to all primitives

Parameters
tthe matrix

◆ push_translate()

coat.prim.push_translate ( vec3 d)
static

Set the translation to all primitives.

Not implemented yet

Parameters
dthe new position of the primitives

◆ reset_transform()

coat.prim.reset_transform ( )
static

reset the global transform matrix

Not implemented yet

◆ roughness()

prim coat.prim.roughness ( self,
float value )

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

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

◆ scale() [1/3]

vec3 coat.prim.scale ( self)

get the scale

Returns
the scale 3d vector

◆ scale() [2/3]

prim coat.prim.scale ( self,
float scale )

set the scale

Parameters
scalethe scale factor
Returns
prim reference

◆ scale() [3/3]

prim coat.prim.scale ( self,
vec3 v )

set the scale

Parameters
vthe scale vector
Returns
this primitive reference

◆ step_divide()

prim coat.prim.step_divide ( self,
float step )

set the step devide

Parameters
stepthe step divide factor
Returns
primitive reference

◆ subtract()

coat.prim.subtract ( self,
Volume v )

subtract the prim from scene

Parameters
vthe scene volume reference

◆ transform() [1/2]

mat4 coat.prim.transform ( self)

get the transform matrix

Returns
matrix

◆ transform() [2/2]

prim coat.prim.transform ( self,
mat4 t )

set the transform matrix

Parameters
tthe matrix
Returns
prim reference

◆ translate() [1/3]

vec3 coat.prim.translate ( self)

get the primitive translation

Returns
primitive translation

◆ translate() [2/3]

prim coat.prim.translate ( self,
float x,
float y,
float z )

Set the primitive translation.

Parameters
xthe new x primitive position
ythe new y primitive position
zthe new z primitive position
Returns
this primitive reference

◆ translate() [3/3]

prim coat.prim.translate ( self,
vec3 _pos )

Set the primitive translation.

Parameters
_posthe new primitive position
Returns
this primitive reference

◆ x()

prim coat.prim.x ( self,
float x )

shift the primitive along the x - axis

Parameters
xthe x value
Returns
this primitive reference

◆ y()

prim coat.prim.y ( self,
float y )

shift the primitive along the y - axis

Parameters
ythe y value
Returns
this primitive reference

◆ z()

prim coat.prim.z ( self,
float z )

shift the primitive along the z - axis

Parameters
zthe z value
Returns
this primitive reference

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