3DCoat Core API
The 3DCoat API documentation.
Loading...
Searching...
No Matches
coat::nut Class Reference

nut primitive More...

#include <CorePrimAPI.h>

Inheritance diagram for coat::nut:
coat::prim

Public Member Functions

 nut ()
 constructor.
 
 ~nut ()
 destructor.
 
nut & setTypeData (void *data)
 set the typed data.
 
void * getTypeData ()
 get the typed data.
 
nut & threadDiameter (const float &d)
 set the hole thread diameter.
 
float threadDiameter () const
 get the hole thread diameter.
 
nut & pitch (const float &p)
 set the thread pitch.
 
float pitch () const
 get the thread pitch.
 
nut & enableThread (const bool &f)
 set the enabled thread.
 
bool enableThread () const
 get the enabled thread.
 
nut & threadType (const int &_t)
 set the nut thread profile.
 
int threadType () const
 get the nut thread profile.
 
- Public Member Functions inherited from coat::prim
 prim ()
 constructs a new prim object.
 
str class_name ()
 get the primitive class name.
 
prim & name (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
 
prim & color (DWORD CL)
 assign the color to the primitive (in voxels)
 
prim & color (float r, float g, float b, float a)
 assign the color to the primitive (in voxels)
 
prim & color (float r, float g, float b)
 assign the color to the primitive (in voxels)
 
prim & color (const char *colorid)
 assign the color to the primitive (in voxels)
 
prim & gloss (float value)
 assign the gloss for the voxel primitive, it will work only if the color already assigned
 
prim & roughness (float value)
 assign the roughness for the voxel primitive, it will work only if the color already assigned
 
prim & metal (float value)
 the metalliclty value for the voxel primitive, it will work only if the color already assigned
 
prim & opacity (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)
 
prim & details (const float det_level)
 set the detail level
 
float details ()
 get the detail level
 
prim & transform (const mat4 &t)
 set the transform matrix
 
mat4 transform () const
 get the transform matrix
 
prim & scale (float scale)
 set the scale
 
prim & scale (const vec3 &v)
 set the scale
 
vec3 scale () const
 get the scale
 
prim & translate (const vec3 &_pos)
 Set the primitive translation.
 
vec3 translate () const
 get the primitive translation
 
prim & translate (float x, float y, float z)
 Set the primitive translation.
 
prim & x (float x)
 shift the primitive along the x - axis
 
prim & y (float y)
 shift the primitive along the y - axis
 
prim & z (float z)
 shift the primitive along the z - axis
 
prim & auto_divide (float average_div)
 set the auto devide
 
prim & step_divide (float step)
 set the step devide
 
prim & fillet (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

void release ()
 release the typed data
 
virtual cMeshContainer * create_mesh ()
 creates a mesh container for the nut.
 
- Protected Member Functions inherited from coat::prim
template<class T >
T & to_cast_this ()
 cast this prim to the obj type T
 
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

nut primitive

Examples
nut.cpp.

Member Function Documentation

◆ create_mesh()

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

creates a mesh container for the nut.

Returns
mesh pointer

Reimplemented from coat::prim.

◆ enableThread() [1/2]

bool coat::nut::enableThread ( ) const

get the enabled thread.

Returns
enabled flag

◆ enableThread() [2/2]

nut & coat::nut::enableThread ( const bool & f)

set the enabled thread.

Parameters
_fflag enabled
Returns
nut reference

◆ getTypeData()

void * coat::nut::getTypeData ( )

get the typed data.

Returns
pointer to the data

◆ pitch() [1/2]

float coat::nut::pitch ( ) const

get the thread pitch.

Returns
pitch

◆ pitch() [2/2]

nut & coat::nut::pitch ( const float & p)

set the thread pitch.

Parameters
_ppitch
Returns
nut reference
Examples
nut.cpp.

◆ setTypeData()

nut & coat::nut::setTypeData ( void * data)

set the typed data.

Parameters
datapointer to the data
Returns
nut reference
Examples
nut.cpp.

◆ threadDiameter() [1/2]

float coat::nut::threadDiameter ( ) const

get the hole thread diameter.

Returns
diameter

◆ threadDiameter() [2/2]

nut & coat::nut::threadDiameter ( const float & d)

set the hole thread diameter.

Parameters
_ddiameter
Returns
nut reference
Examples
nut.cpp.

◆ threadType() [1/2]

int coat::nut::threadType ( ) const

get the nut thread profile.

Returns
thread type value.

◆ threadType() [2/2]

nut & coat::nut::threadType ( const int & _t)

set the nut thread profile.

Parameters
_tprofile type value (triangle,trapeze,rectangular,round,persistent)
Returns
nut reference
Examples
nut.cpp.

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