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

The spiral. More...

#include <CorePrimAPI.h>

Inheritance diagram for coat::spiral:
coat::prim

Public Member Functions

 spiral ()
 constructs a new spiral object.
 
 spiral (const float &out_radius, const float &in_radius, const float &_sstep, const float &nturns)
 constructs a new spiral object.
 
spiralradius (const float &r)
 set the outer radius of the spiral.
 
float radius () const
 get the outer radius.
 
spiralprofile_radius (const float &r)
 set the profile radius.
 
float profile_radius () const
 get the profile radius.
 
spiraldiameter (const float &d)
 set the outer diameter of the spiral.
 
float diameter () const
 get the outer diameter.
 
spiralprofile_diameter (const float &d)
 set the profile diameter.
 
float profile_diameter () const
 get the profile diameter.
 
spiralturns (const int nturns)
 set the number of turns.
 
int turns () const
 get the number of turns.
 
spiralstep (const float &vstep)
 set the spiral step.
 
float step () const
 get the spiral step.
 
spiralprofile_type (const SpiralProfile type)
 set the type of profile (circle or rectangle).
 
spiralprofile_rect (const float width, const float height)
 set the dimensions for the rectangle profile.
 
spiralclock_wise (const bool &clockWise)
 set the clockwise direction of the spiral.
 
bool clock_wise () const
 get the clokwise direction of the spiral.
 
float profile_height () const
 get the profile height for rectangle profile.
 
float profile_width () const
 get the profile width for rectangle profile.
 
spiralslices (const int &nslices)
 set the number of slices in the mesh.
 
int slices () const
 get the number of slices in the mesh.
 
spiralrings (const int &nrings)
 set the number of rings in the mesh.
 
int rings () const
 get the number of rings in the mesh.
 
spiralcaps (const int &ncaps)
 set the number of caps in the mesh.
 
int caps () const
 get the number of caps in the mesh.
 
- 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 spiral.
 
- 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

The spiral.

Examples
spiral.cpp.

Constructor & Destructor Documentation

◆ spiral()

coat::spiral::spiral ( const float & out_radius,
const float & in_radius,
const float & _sstep,
const float & nturns )

constructs a new spiral object.

Parameters
out_radiusouter radius
in_radiusprofle radius
_sstepspiral step
nturnsthe number of turns

Member Function Documentation

◆ caps() [1/2]

int coat::spiral::caps ( ) const

get the number of caps in the mesh.

Returns
number of caps

◆ caps() [2/2]

spiral & coat::spiral::caps ( const int & ncaps)

set the number of caps in the mesh.

Parameters
ncapsnumber of caps.
Returns
spiral reference

◆ clock_wise() [1/2]

bool coat::spiral::clock_wise ( ) const

get the clokwise direction of the spiral.

Returns
the clokwise direction( true or false)

◆ clock_wise() [2/2]

spiral & coat::spiral::clock_wise ( const bool & clockWise)

set the clockwise direction of the spiral.

Parameters
clockWisethe indicator of the clockwise direction
Returns
spiral reference

◆ create_mesh()

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

creates a mesh container for the spiral.

Returns
mesh pointer

Reimplemented from coat::prim.

◆ diameter() [1/2]

float coat::spiral::diameter ( ) const

get the outer diameter.

Returns
outer diameter

◆ diameter() [2/2]

spiral & coat::spiral::diameter ( const float & d)

set the outer diameter of the spiral.

Parameters
ddiameter value
Returns
spiral reference

◆ profile_diameter() [1/2]

float coat::spiral::profile_diameter ( ) const

get the profile diameter.

Returns
profile diameter

◆ profile_diameter() [2/2]

spiral & coat::spiral::profile_diameter ( const float & d)

set the profile diameter.

Parameters
ddiameter value
Returns
spiral reference

◆ profile_height()

float coat::spiral::profile_height ( ) const

get the profile height for rectangle profile.

Returns
the profile height

◆ profile_radius() [1/2]

float coat::spiral::profile_radius ( ) const

get the profile radius.

Returns
profile radius

◆ profile_radius() [2/2]

spiral & coat::spiral::profile_radius ( const float & r)

set the profile radius.

Parameters
rradius value
Returns
spiral reference
Examples
spiral.cpp.

◆ profile_rect()

spiral & coat::spiral::profile_rect ( const float width,
const float height )

set the dimensions for the rectangle profile.

Parameters
widththe width value
heightthe height value
Returns
spiral reference
Examples
spiral.cpp.

◆ profile_type()

spiral & coat::spiral::profile_type ( const SpiralProfile type)

set the type of profile (circle or rectangle).

Parameters
typeprofile type
Returns
spiral reference
Examples
spiral.cpp.

◆ profile_width()

float coat::spiral::profile_width ( ) const

get the profile width for rectangle profile.

Returns
the profile width

◆ radius() [1/2]

float coat::spiral::radius ( ) const

get the outer radius.

Returns
outer radius

◆ radius() [2/2]

spiral & coat::spiral::radius ( const float & r)

set the outer radius of the spiral.

Parameters
rradius value
Returns
spiral reference
Examples
spiral.cpp.

◆ rings() [1/2]

int coat::spiral::rings ( ) const

get the number of rings in the mesh.

Returns
number of rings

◆ rings() [2/2]

spiral & coat::spiral::rings ( const int & nrings)

set the number of rings in the mesh.

Parameters
nringsnumber of rings.
Returns
spiral reference

◆ slices() [1/2]

int coat::spiral::slices ( ) const

get the number of slices in the mesh.

Returns
number of slices

◆ slices() [2/2]

spiral & coat::spiral::slices ( const int & nslices)

set the number of slices in the mesh.

Parameters
nslicesnumber of slices.
Returns
spiral reference

◆ step() [1/2]

float coat::spiral::step ( ) const

get the spiral step.

Returns
step value

◆ step() [2/2]

spiral & coat::spiral::step ( const float & vstep)

set the spiral step.

Parameters
vstepstep value
Returns
spiral reference
Examples
spiral.cpp.

◆ turns() [1/2]

int coat::spiral::turns ( ) const

get the number of turns.

Returns
turns count

◆ turns() [2/2]

spiral & coat::spiral::turns ( const int nturns)

set the number of turns.

Parameters
nturnsturns count
Returns
spiral reference
Examples
spiral.cpp.

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