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

The ngon. More...

#include <CorePrimAPI.h>

Inheritance diagram for coat::ngon:
coat::gear coat::tube coat::cylinder coat::prim

Public Member Functions

 ngon ()
 constructs a new ngon object.
 
 ngon (const float &height, const float &radiusTop, const float &radiusBottom, const int &order)
 constructs a new ngon object.
 
 ngon (const float &height, const float &radiusTop, const float &radiusBottom, const float &fillet, const int &order)
 constructs a new ngon object.
 
 ngon (const vec3 &posTop, const vec3 &posBottom, const float &radiusTop, const float &radiusBottom, const int &order)
 constructs a new gear object.
 
virtual float fillet_relative ()
 calculates a fillet relative value (0..1).
 
- Public Member Functions inherited from coat::gear
 gear ()
 constructs a new gear object.
 
 gear (const float &height, const float &radiusTop, const float &radiusBottom)
 constructs a new gear object.
 
 gear (const float &height, const float &radiusTop, const float &radiusBottom, float depth, float sharpness=0.5, const int &order=16)
 constructs a new gear object.
 
 gear (const vec3 &posTop, const vec3 &posBottom, const float &radiusTop, const float &radiusBottom, float depth=0.1, float sharpness=0.5, const int &order=16)
 constructs a new gear object.
 
gear & depth (const float &__depth)
 set the depth value.
 
float depth () const
 get the depth value.
 
gear & sharpness (const float &sharp)
 set the sharpness value.
 
float sharpness () const
 get the depth value.
 
gear & order (const int &nteeth)
 set the number of teeth in gear.
 
int order () const
 get the number of teeth in gear.
 
- Public Member Functions inherited from coat::tube
 tube ()
 constructs a new tube object.
 
 tube (const float &height, const float &radiusTop, const float &radiusBottom)
 constructs a new tube object.
 
 tube (const float &height, const float &radiusTop, const float &radiusBottom, const float &fillet)
 constructs a new tube object.
 
 tube (const float &height, const float &radiusTop, const float &radiusBottom, const float &relativeHoleRadius, const float &fillet)
 constructs a new tube object.
 
 tube (const vec3 &posTop, const vec3 &posBottom, const float &radiusTop, const float &radiusBottom, const float &relativeHoleRadius)
 constructs a new tube object.
 
 tube (const vec3 &posTop, const vec3 &posBottom, const float &radiusTop, const float &radiusBottom, const float &relativeHoleRadius, const float &fillet)
 constructs a new tube object.
 
tube & relativeHoleRadius (const float &r)
 set the relative value of the hole radius.
 
float relativeHoleRadius () const
 get the relative value of the hole radius.
 
tube & thickness (const float &w)
 set the wall thickness value.
 
float thickness () const
 get the relative value of the hole radius.
 
float fillet_relative () override
 calculates a fillet relative value (0..1).
 
- Public Member Functions inherited from coat::cylinder
 cylinder ()
 constructs a new cylinder object.
 
 cylinder (const float &height, const float &radiusTop, const float &radiusBottom, const float &fillet=0.0)
 constructs a new cylinder object.
 
 cylinder (const vec3 &posTop, const vec3 &posBottom, const float &radiusTop, const float &radiusBottom, const float &fillet=0.0)
 constructs a new cylinder object.
 
cylinder & positionTop (const vec3 &pos)
 set the top position.
 
vec3 positionTop () const
 get the top position.
 
cylinder & positionBottom (const vec3 &pos)
 set the bottom position.
 
vec3 positionBottom () const
 get the bottom position.
 
cylinder & radiusTop (const float &r)
 set the top radius.
 
float radiusTop () const
 get the top radius.
 
cylinder & radiusBottom (const float &r)
 set the bottom radius.
 
float radiusBottom () const
 get the bottom radius.
 
cylinder & radius (const float &r)
 set the radius.
 
float radius () const
 get the radius.
 
cylinder & diameterTop (const float &d)
 set the top diameter.
 
float diameterTop () const
 get the top diameter.
 
cylinder & diameterBottom (const float &r)
 set the bottom diameter.
 
float diameterBottom () const
 get the bottom diameter.
 
cylinder & diameter (const float &d)
 set the diameter.
 
float diameter () const
 get the diameter.
 
cylinder & height (const float &_height)
 set the height in the z-axis.
 
float height () const
 get the height.
 
cylinder & sectorAngle (const float &angle)
 set the angle for cylinder with sector.
 
float sectorAngle () const
 get the sector angle.
 
cylinder & topCapScale (const float &scale)
 set the top cap scale.
 
float topCapScale () const
 get the top cap scale.
 
cylinder & bottomCapScale (const float &scale)
 set the bottom cap scale.
 
float bottomCapScale () const
 get the bottom cap scale.
 
cylinder & slices (const int &nslices)
 set the number of slices in the mesh.
 
int slices () const
 get the number of slices in the mesh.
 
cylinder & rings (const int &nrings)
 set the number of rings in the mesh.
 
int rings () const
 get the number of rings in the mesh.
 
cylinder & caps (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.
 
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.
 

Protected Member Functions

virtual cMeshContainer * create_mesh ()
 creates a mesh container for the ngon.
 
- Protected Member Functions inherited from coat::cylinder
cMeshContainer * getCylinderPrim (bool iscone=false)
 get a mesh container for the cylinder without account of fillet.
 
mat4 getLTransform ()
 get a transform matrix between standard cylinder and cylinder with custom parameters
 
- 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 ngon.

Examples
Dumbbell.cpp, and HoneyComb.cpp.

Constructor & Destructor Documentation

◆ ngon() [1/3]

coat::ngon::ngon ( const float & height,
const float & radiusTop,
const float & radiusBottom,
const int & order )

constructs a new ngon object.

Parameters
heightngon height
radiusToptop radius
radiusBottombottom radius
orderthe number of sides

◆ ngon() [2/3]

coat::ngon::ngon ( const float & height,
const float & radiusTop,
const float & radiusBottom,
const float & fillet,
const int & order )

constructs a new ngon object.

Parameters
heightngon height
radiusToptop radius
radiusBottombottom radius
filletfillet radius
orderthe number of sides

◆ ngon() [3/3]

coat::ngon::ngon ( const vec3 & posTop,
const vec3 & posBottom,
const float & radiusTop,
const float & radiusBottom,
const int & order )

constructs a new gear object.

Parameters
posToptop position
posBottombottom position
radiusToptop radius
radiusBottombottom radius
orderthe number of teeth

Member Function Documentation

◆ create_mesh()

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

creates a mesh container for the ngon.

Returns
mesh pointer

Reimplemented from coat::gear.

◆ fillet_relative()

virtual float coat::ngon::fillet_relative ( )
virtual

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

Returns
fillet relative value

Reimplemented from coat::cylinder.


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