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

bolt primitive More...

#include <CorePrimAPI.h>

Inheritance diagram for coat::bolt:
coat::prim

Classes

struct  Info
 Holds the general information about bolt parameters. More...
 

Public Member Functions

 bolt ()
 constructor.
 
bolthead (const boltHead &_h)
 set the head object.
 
const boltHeadhead () const
 get the head object.
 
boltdiameter (const float &_d)
 set the bolt diameter.
 
float diameter ()
 get the bolt diameter.
 
boltpitch (const float &_p)
 set the thread pitch.
 
float pitch ()
 get the thread pitch.
 
boltthreadHeight (const float &_h)
 set the thread height.
 
float threadHeight ()
 get the thread height.
 
boltlength (const float &_l)
 set the bolt length.
 
float length ()
 get the bolt length.
 
boltthreadLength (const float &_l)
 set the thread length.
 
float threadLength ()
 get the thread length.
 
boltthreadType (const int &_t)
 set the screw thread profile.
 
int threadType ()
 get the screw thread profile.
 
boltunderhead (const int &_uh)
 set the under head type.
 
int underhead ()
 get the under head type.
 
boltuwidth (const int &_uw)
 set the underhead width.
 
float uwidth ()
 get the underhead width.
 
boltuheight (const int &_uh)
 set the underhead height.
 
float uheight ()
 get the underhead height.
 
boltnutType (const int &_t)
 set the nut type.
 
int nutType ()
 get the nut type.
 
boltnutLocation (const float &_loc)
 set the nut location on the bolt.
 
float nutLocation ()
 get the nut location on the bolt.
 
boltnutHeight (const float &_h)
 set the nut height on the bolt.
 
float nutHeight ()
 get the nut height on the bolt.
 
- 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 bolt.
 
- 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

bolt primitive

Examples
bolt_rim.cpp.

Member Function Documentation

◆ create_mesh()

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

creates a mesh container for the bolt.

Returns
mesh pointer

Reimplemented from coat::prim.

◆ diameter() [1/2]

float coat::bolt::diameter ( )

get the bolt diameter.

Returns
diameter

◆ diameter() [2/2]

bolt & coat::bolt::diameter ( const float &  _d)

set the bolt diameter.

Parameters
_ddiameter
Returns
bolt reference
Examples
bolt_rim.cpp.

◆ head() [1/2]

const boltHead & coat::bolt::head ( ) const

get the head object.

Returns
head obj reference

◆ head() [2/2]

bolt & coat::bolt::head ( const boltHead _h)

set the head object.

Parameters
_hhead obj reference
Returns
bolt reference
Examples
bolt_rim.cpp.

◆ length() [1/2]

float coat::bolt::length ( )

get the bolt length.

Parameters
lengthvalue

◆ length() [2/2]

bolt & coat::bolt::length ( const float &  _l)

set the bolt length.

Parameters
_llength
Returns
bolt reference
Examples
bolt_rim.cpp.

◆ nutHeight() [1/2]

float coat::bolt::nutHeight ( )

get the nut height on the bolt.

Returns
location value

◆ nutHeight() [2/2]

bolt & coat::bolt::nutHeight ( const float &  _h)

set the nut height on the bolt.

Parameters
_hheight value
Returns
bolt reference

◆ nutLocation() [1/2]

float coat::bolt::nutLocation ( )

get the nut location on the bolt.

Returns
location value

◆ nutLocation() [2/2]

bolt & coat::bolt::nutLocation ( const float &  _loc)

set the nut location on the bolt.

Parameters
_loclocation value
Returns
bolt reference

◆ nutType() [1/2]

int coat::bolt::nutType ( )

get the nut type.

Returns
type value

◆ nutType() [2/2]

bolt & coat::bolt::nutType ( const int &  _t)

set the nut type.

Parameters
_ttype value (see nut::Type enumarate)
Returns
bolt reference

◆ pitch() [1/2]

float coat::bolt::pitch ( )

get the thread pitch.

Returns
pitch

◆ pitch() [2/2]

bolt & coat::bolt::pitch ( const float &  _p)

set the thread pitch.

Parameters
_ppitch
Returns
bolt reference
Examples
bolt_rim.cpp.

◆ threadHeight() [1/2]

float coat::bolt::threadHeight ( )

get the thread height.

Returns
height value

◆ threadHeight() [2/2]

bolt & coat::bolt::threadHeight ( const float &  _h)

set the thread height.

Parameters
_hheight
Returns
bolt reference

◆ threadLength() [1/2]

float coat::bolt::threadLength ( )

get the thread length.

Returns
length

◆ threadLength() [2/2]

bolt & coat::bolt::threadLength ( const float &  _l)

set the thread length.

Parameters
_llength
Returns
bolt reference
Examples
bolt_rim.cpp.

◆ threadType() [1/2]

int coat::bolt::threadType ( )

get the screw thread profile.

Returns
thread type value.

◆ threadType() [2/2]

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

set the screw thread profile.

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

◆ uheight() [1/2]

float coat::bolt::uheight ( )

get the underhead height.

Returns
height value

◆ uheight() [2/2]

bolt & coat::bolt::uheight ( const int &  _uh)

set the underhead height.

Parameters
_uhheight
Returns
bolt reference

◆ underhead() [1/2]

int coat::bolt::underhead ( )

get the under head type.

Returns
under head type value

◆ underhead() [2/2]

bolt & coat::bolt::underhead ( const int &  _uh)

set the under head type.

Parameters
_uhtype value (0-cylinder,1-rect)
Returns
bolt reference

◆ uwidth() [1/2]

float coat::bolt::uwidth ( )

get the underhead width.

Returns
width value

◆ uwidth() [2/2]

bolt & coat::bolt::uwidth ( const int &  _uw)

set the underhead width.

Parameters
_uwwidth
Returns
bolt reference

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