3DCoat Core API
The 3DCoat API documentation.
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
coat::freeform Class Reference

freeform primitive More...

#include <CorePrimAPI.h>

Inheritance diagram for coat::freeform:
coat::prim

Classes

struct  ffElement
 
struct  ffInfo
 

Public Types

typedef list< vec3Points3D
 
typedef list< ffElementffObjsList
 

Public Member Functions

 freeform ()
 constructor
 
 freeform (const char *_ffname, const char *_ffsubname)
 constructor
 
 ~freeform ()
 destructor
 
freeformsymx (const bool &x)
 Enable the XYZ-mirror symmetry.
 
freeformsymy (const bool &y)
 Enable the XYZ-mirror symmetry.
 
freeformsymz (const bool &z)
 Enable the XYZ-mirror symmetry.
 
freeformsize (float x, float y, float z)
 set the free form size

 
freeformsize (const vec3 &v)
 set the free form size
 
freeformffname (const char *name)
 set the free form name.
 
const char * ffname () const
 get the free form name.
 
freeformffsubname (const char *name)
 set the free form sub name.
 
const char * ffsubname () const
 get the free form sub name.
 
freeformSetPoint (int i, const vec3 &point)
 set the knot point of the primitive.
 
int CountPoints () const
 get the account of the knot points
 
void ResetPoints ()
 reset the knot points
 
list< str > * ffSubNamesList ()
 get the sub names for current free form name.
 
list< str > * ffSubNamesList (const str &ffName)
 get the sub names for specified free form name.
 
ffObjsList & objsList ()
 gets the object's list.
 
Points3D & ffControlPoints ()
 get the knot(control) points of the primitive.
 
- Public Member Functions inherited from coat::prim
 prim ()
 constructs a new prim object.
 
str class_name ()
 get the primitive class name.
 
primname (const char *s)
 set the primitive object name.
 
str name () const
 get the primitive object name.
 
void add (Volume &v)
 add the prim into scene
 
void subtract (Volume &v)
 subtract the prim from scene
 
void intersect (Volume &v)
 intersect the prim into scene
 
void merge (Volume &v, const BoolOpType op)
 merge the prim into scene
 
Mesh mesh ()
 get the mesh prim
 
primcolor (DWORD CL)
 assign the color to the primitive (in voxels)
 
primcolor (float r, float g, float b, float a)
 assign the color to the primitive (in voxels)
 
primcolor (float r, float g, float b)
 assign the color to the primitive (in voxels)
 
primcolor (const char *colorid)
 assign the color to the primitive (in voxels)
 
primgloss (float value)
 assign the gloss for the voxel primitive, it will work only if the color already assigned
 
primroughness (float value)
 assign the roughness for the voxel primitive, it will work only if the color already assigned
 
primmetal (float value)
 the metalliclty value for the voxel primitive, it will work only if the color already assigned
 
primopacity (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)
 
primdetails (const float det_level)
 set the detail level
 
float details ()
 get the detail level
 
primtransform (const mat4 &t)
 set the transform matrix
 
mat4 transform () const
 get the transform matrix
 
primscale (float scale)
 set the scale
 
primscale (const vec3 &v)
 set the scale
 
vec3 scale () const
 get the scale
 
primtranslate (const vec3 &_pos)
 Set the primitive translation.
 
vec3 translate () const
 get the primitive translation
 
primtranslate (float x, float y, float z)
 Set the primitive translation.
 
primx (float x)
 shift the primitive along the x - axis
 
primy (float y)
 shift the primitive along the y - axis
 
primz (float z)
 shift the primitive along the z - axis
 
primauto_divide (float average_div)
 set the auto devide
 
primstep_divide (float step)
 set the step devide
 
primfillet (float radius)
 set the fillet
 
template<typename T >
T & Obj ()
 Get the primitive object reference.
 
template<typename T >
bool isAs ()
 Check the prim's type.
 
virtual float fillet_relative ()
 calculates a fillet relative value (0..1).
 

Protected Member Functions

virtual cMeshContainer * create_mesh ()
 creates a mesh container for the screw.
 
- Protected Member Functions inherited from coat::prim
template<class T >
T & to_cast_this ()
 cast this prim to the obj type T
 
virtual cMeshContainer * create_mesh ()
 abstract method to create a mesh container.
 
void merge_debug (Volume &vol, Mesh &mesh)
 merge the mesh debug into scene
 

Additional Inherited Members

- Static Public Member Functions inherited from coat::prim
static void debug_on (bool isOn=true)
 indicates whether to turn on or off the debug mode.
 
static void debug_clear ()
 clear the debug info for primitive operations
 
static void push_transform (const mat4 &t)
 set the global transform matrix to all primitives
 
static void push_translate (const vec3 &d)
 Set the translation to all primitives.
 
static void push_scale (float scale)
 Set the scale to all primitives.
 
static void push_scale (const vec3 &s)
 Set the scale to all primitives.
 
static void push_details (float details_modulator)
 set the detail level to all primitives
 
static void reset_transform ()
 reset the global transform matrix
 
- Protected Attributes inherited from coat::prim
prim_this
 

Detailed Description

freeform primitive

Examples
ffBlob.cpp, ffCube.cpp, and ffCylinder.cpp.

Constructor & Destructor Documentation

◆ freeform()

coat::freeform::freeform ( const char *  _ffname,
const char *  _ffsubname 
)

constructor

Parameters
_ffnamefree form name
_ffsubnamefree form subname

Member Function Documentation

◆ CountPoints()

int coat::freeform::CountPoints ( ) const

get the account of the knot points

Returns
count of points
Examples
ffCube.cpp, and ffCylinder.cpp.

◆ create_mesh()

virtual cMeshContainer * coat::freeform::create_mesh ( )
protectedvirtual

creates a mesh container for the screw.

Returns
mesh pointer

Reimplemented from coat::prim.

◆ ffControlPoints()

Points3D & coat::freeform::ffControlPoints ( )

get the knot(control) points of the primitive.

Returns
the points reference
Examples
ffCube.cpp, and ffCylinder.cpp.

◆ ffname() [1/2]

const char * coat::freeform::ffname ( ) const

get the free form name.

Returns
the name

◆ ffname() [2/2]

freeform & coat::freeform::ffname ( const char *  name)

set the free form name.

set of names {"Cube","Patch,"Blob","Round","Ring",Torus","Tube2","Tube3","Disc","Cylinder"}

Parameters
namethe name string
Returns
the freeform reference

◆ ffsubname() [1/2]

const char * coat::freeform::ffsubname ( ) const

get the free form sub name.

Returns
the name

◆ ffsubname() [2/2]

freeform & coat::freeform::ffsubname ( const char *  name)

set the free form sub name.

Parameters
namethe name string
Returns
the freeform reference
Examples
ffCylinder.cpp.

◆ ffSubNamesList() [1/2]

list< str > * coat::freeform::ffSubNamesList ( )

get the sub names for current free form name.

Parameters
ffNamefree form name
Returns
the pointer to list string of sub names
Examples
ffBlob.cpp.

◆ ffSubNamesList() [2/2]

list< str > * coat::freeform::ffSubNamesList ( const str ffName)

get the sub names for specified free form name.

Parameters
ffNamefree form name
Returns
the pointer to list string of sub names

◆ objsList()

ffObjsList & coat::freeform::objsList ( )

gets the object's list.

Returns
objs list reference

◆ SetPoint()

freeform & coat::freeform::SetPoint ( int  i,
const vec3 point 
)

set the knot point of the primitive.

Parameters
ipoint index
pointthe coordinates of the point
Returns
the freeform reference
Examples
ffCube.cpp, and ffCylinder.cpp.

◆ size() [1/2]

freeform & coat::freeform::size ( const vec3 v)

set the free form size

Parameters
vvector size
Returns
freeform reference

◆ size() [2/2]

freeform & coat::freeform::size ( float  x,
float  y,
float  z 
)

set the free form size

Parameters
xsize in the x - axis
ysize in the y - axis
zsize in the z - axis
Returns
freeform reference
Examples
ffBlob.cpp.

◆ symx()

freeform & coat::freeform::symx ( const bool &  x)

Enable the XYZ-mirror symmetry.

Parameters
xtrue to enable x-symmetry, false to disable
Returns
freeform reference

◆ symy()

freeform & coat::freeform::symy ( const bool &  y)

Enable the XYZ-mirror symmetry.

Parameters
ytrue to enable y-symmetry, false to disable
Returns
freeform reference

◆ symz()

freeform & coat::freeform::symz ( const bool &  z)

Enable the XYZ-mirror symmetry.

Parameters
ztrue to enable z-symmetry, false to disable
Returns
freeform reference

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