5#define to_scast_obj(T,obj) static_cast<T*>(obj)
10 using namespace comms;
11 typedef One2DCurve curve2d;
263 template <
typename T>
264 T&
Obj() {
return to_cast_this<T>(); }
269 template <
typename T>
270 bool isAs() {
return dynamic_cast<const T*
>(
this) != NULL; }
308 static mat4 _ovTransform;
309 static float _ovDetails;
310 static bool _prmDebug;
319 virtual void average_devide() { ; }
325 float filletRadiusRelative(
float rmax);
339 template <
typename T> T& _src(T* s) {
340 auto* t =
dynamic_cast<T*
>(_this);
363 box(
float sizeX,
float sizeY,
float sizeZ);
474 virtual void average_devide();
491 torus(
const float& ringRadius,
const float& crossSectionRadius);
498 torus(
const vec3& pos,
const float& ringRadius,
const float& crossSectionRadius);
607 float _crossSectionRadius;
615 virtual void average_devide();
791 virtual void average_devide();
871 virtual void average_devide();
889 cylinder(
const float& height,
const float& radiusTop,
const float& radiusBottom,
const float& fillet=0.0);
898 cylinder(
const vec3& posTop,
const vec3& posBottom,
const float& radiusTop,
const float& radiusBottom,
const float& fillet=0.0);
1088 vec3 _positionBottom;
1090 float _radiusBottom;
1093 float _bottomCapScale;
1097 virtual void average_devide();
1118 cone(
const float& height,
const float& radiusBottom,
const float& fillet = 0.0);
1126 cone(
const vec3& posTop,
const vec3& posBottom,
const float& radiusBottom,
const float& fillet = 0.0);
1164 virtual void average_devide();
1181 tube(
const float& height,
const float& radiusTop,
const float& radiusBottom);
1189 tube(
const float& height,
const float& radiusTop,
const float& radiusBottom,
const float& fillet);
1198 tube(
const float& height,
const float& radiusTop,
const float& radiusBottom,
const float& relativeHoleRadius,
const float& fillet);
1207 tube(
const vec3& posTop,
const vec3& posBottom,
const float& radiusTop,
const float& radiusBottom,
const float& relativeHoleRadius);
1217 tube(
const vec3& posTop,
const vec3& posBottom,
const float& radiusTop,
const float& radiusBottom,
const float& relativeHoleRadius,
const float& fillet);
1252 float _relativeHoleRadius;
1257 virtual void average_devide();
1274 gear(
const float& height,
const float& radiusTop,
const float& radiusBottom);
1284 gear(
const float& height,
const float& radiusTop,
const float& radiusBottom,
float depth,
float sharpness = 0.5,
const int& order = 16);
1294 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);
1341 virtual void average_devide();
1360 ngon(
const float& height,
const float& radiusTop,
const float& radiusBottom,
const int& order);
1369 ngon(
const float& height,
const float& radiusTop,
const float& radiusBottom,
const float& fillet,
const int& order);
1378 ngon(
const vec3& posTop,
const vec3& posBottom,
const float& radiusTop,
const float& radiusBottom,
const int& order);
1406 capsule(
const float& height,
const float& radiusTop,
const float& radiusBottom);
1414 capsule(
const vec3& posTop,
const vec3& posBottom,
const float& radiusTop,
const float& radiusBottom);
1425 virtual void average_devide();
1454 spiral(
const float& out_radius,
const float& in_radius,
const float& _sstep,
const float& nturns);
1598 float _profile_radius;
1599 float _profile_width;
1600 float _profile_height;
1606 virtual void average_devide();
1616 StrikeThrough = 1 << 2
1665 Font(
const char* _fname,
const int& _st);
1727 FontInfo& info() {
return _finfo; }
1728 const FontInfo& info()
const {
return _finfo; }
1839 bool _invertBending;
1935 str bottomBumpTexture;
1936 str strencilTexture;
1937 str bottomStrencilTexture;
1938 float basicThickness;
1939 float bumpThickness;
1941 float topBottomWeight;
2082 ParamInfo& paramInfo() {
return _paramInfo; }
2083 const ParamInfo& paramInfo()
const {
return _paramInfo; }
2093 ThreadRectangular = 2,
2095 ThreadPersistent = 4
2313 float _diameterBottom;
2329 SecurityHexSocket = 5,
2519 operator void* ()
const;
2561 operator void* ()
const;
2585 LambParams(
float _l,
float _dtop,
float _dbottom,
float _hh,
float _h,
float _thick);
2625 operator void* ()
const;
2628 float _diameterBottom;
2679 operator void* ()
const;
2680 float _shoulderDiameter;
2681 float _shoulderHeight;
2682 float _inRingDiameter;
2683 float _outRingDiameter;
2723 operator void* ()
const;
2725 float _inRingDiameter;
2726 float _outRingDiameter;
2850 operator void* ()
const;
3095 float _holeDiameter;
3176 float _diameterBottom;
3281 float _inRingDiameter;
3282 float _outRingDiameter;
3326 float _holderDiameter;
3410 float _threadDiameter;
3417 enum ThreadSurface {
3606 const Info& info()
const;
3756 const Info& info()
const;
3868 float _innerDiameter;
3869 float _outerDiameter;
3870 float _conusDiameter;
4019 void SetObjectPaths();
4025 const ffInfo& info()
const;
struct of the EyeParams data
Definition CorePrimAPI.h:2689
EyeParams & thickness(float _t)
set the thickness.
EyeParams & outRingDiameter(float _d)
set the outer ring diameter.
EyeParams & inRingDiameter(float _d)
set the inner ring diameter.
EyeParams(float _thick, float _d1, float _d2)
constructor.
Definition CorePrimAPI.h:1643
Font(const char *_fname, const int &_st)
constructs a new font object.
Font(const FontInfo &_finfo)
constructs a new font object.
int weight() const
get the font weight
int style() const
get the font style
Font(const char *_fname)
constructs a new font object.
Font & weight(const int &weight)
set the font weight
int size() const
get the font size
Font & size(const int &_size)
set the font size
Font & name(const char *_fname)
set the font name
Font()
The Font class specifies a query for a font used for drawing text.
Font & style(const int st)
set the style of the font
void select()
selects a font object into the viewport
const char * name() const
get the font name
Holds the general information about font.
Definition CorePrimAPI.h:1635
HeadBaseParams struct of the head data.
Definition CorePrimAPI.h:2492
HeadBaseParams()
constructor.
HeadBaseParams & diameter(float _d)
set the diameter.
HeadBaseParams(float _d, float _h)
constructor.
HeadBaseParams & height(float _h)
set the height.
class HeadParams
Definition CorePrimAPI.h:2444
HeadParams(int _type, void *_param)
constructor.
void release()
release the data
void * getData() const
get the head data
HeadParams & setData(int _type, void *param)
set the parameters data with specified type.
void copy(const HeadParams &h)
copies the HeadParams object
struct of the LambParams data
Definition CorePrimAPI.h:2570
LambParams & length(float _l)
set the length.
LambParams & height(float _h)
set the height.
LambParams & headHeight(float _h)
set the head height.
LambParams & diameterTop(float _d)
set the top diameter.
LambParams & thickness(float _t)
set the thickness.
LambParams & diameterBottom(float _d)
set the bottom diameter.
LambParams(float _l, float _dtop, float _dbottom, float _hh, float _h, float _thick)
constructor.
The mesh reference.
Definition CoreAPI.h:407
Definition CorePrimAPI.h:2903
NutAcornParams & facetHeight(const float &_h)
set the facet height.
virtual NutHeadBaseParams * copy(NutHeadBaseParams *p=nullptr)
copies the NutAcornParams object.
NutAcornParams()
constructor.
NutAcornParams(float d, float h, float h1)
constructor.
float facetHeight() const
get the facet height.
Definition CorePrimAPI.h:3285
NutClampLever & length(const float &_l)
set the length.
virtual NutHeadBaseParams * copy(NutHeadBaseParams *p=nullptr)
copies the NutClampLever object.
float length() const
get the length.
float holderDiameter() const
get the diameter of the holder.
NutClampLever & holderDiameter(const float &_d)
set the diameter of the holder.
NutClampLever()
constructor.
NutClampLever(float d, float h)
constructor.
Definition CorePrimAPI.h:2982
NutFlangeParams(float d, float h)
constructor.
float facetHeight() const
get the height.
float facetWidth() const
get the width.
NutFlangeParams()
constructor.
NutFlangeParams & facetWidth(const float &w)
set the width.
virtual NutHeadBaseParams * copy(NutHeadBaseParams *p=nullptr)
copies the NutFlangeParams object.
NutFlangeParams(float d, float h, float fw, float fh)
constructor.
NutFlangeParams & facetHeight(const float &h)
set the facet height.
Definition CorePrimAPI.h:2812
NutHeadBaseParams & type(int t)
set the nut type.
NutHeadBaseParams & height(const float &h)
set the height.
float height() const
get the height.
NutHeadBaseParams & diameter(const float &d)
set the diameter.
int type() const
set the nut type.
virtual NutHeadBaseParams * copy(NutHeadBaseParams *p=nullptr)
copies the object.
float diameter() const
get the diameter.
NutHeadBaseParams()
constructor.
NutHeadBaseParams(NutType t, float d, float h)
constructor.
Definition CorePrimAPI.h:2876
NutHexaParams()
constructor.
NutHexaParams(float d, float h)
constructor.
Definition CorePrimAPI.h:3100
float length() const
get the length.
NutLambParams & diameterBottom(const float &_d)
set the bottom diameter.
NutLambParams & diameterTop(const float &_d)
set the top diameter.
float diameterBottom() const
get the bottom diameter.
NutLambParams(float d, float h)
constructor.
NutLambParams()
constructor.
NutLambParams & headHeight(const float &_h)
set the head height.
float headHeight() const
get the head height.
float thickness() const
get the thickness.
virtual NutHeadBaseParams * copy(NutHeadBaseParams *p=nullptr)
copies the NutLambParams object.
float diameterTop() const
get the top diameter.
NutLambParams & thickness(const float &_t)
set the thickness.
NutLambParams & length(const float &_l)
set the length.
Definition CorePrimAPI.h:2937
NutLowAcornParams()
constructor.
NutLowAcornParams(float d, float h, float h1)
constructor.
Definition CorePrimAPI.h:2890
Definition CorePrimAPI.h:3035
NutRadialParams & holeDepth(const float &d)
set the hole depth.
float holeDepth() const
get the hole depth.
int holePlace() const
get the hole place.
float holeDiameter() const
set the hole diameter.
NutRadialParams(float d, float h, float d1, float d2)
constructor
virtual NutHeadBaseParams * copy(NutHeadBaseParams *p=nullptr)
copies the radial object.
NutRadialParams & holeDiameter(const float &d)
set the hole diameter.
NutRadialParams(float d, float h)
constructor.
NutRadialParams()
constructor.
NutRadialParams & holePlace(const int &place)
set the hole place (0 - face, 1 - side).
Definition CorePrimAPI.h:3240
NutRimParams & inRingDiameter(const float &_d)
set the inner ring diameter.
virtual NutHeadBaseParams * copy(NutHeadBaseParams *p=nullptr)
copies the NutRimParams object.
NutRimParams(float d, float h)
constructor.
NutRimParams & outRingDiameter(const float &_d)
set the outer ring diameter.
NutRimParams()
constructor.
float inRingDiameter() const
get the inner ring diameter.
float outRingDiameter() const
get the outer ring diameter.
Definition CorePrimAPI.h:2952
NutSelfLockParams()
constructor.
NutSelfLockParams(float d, float h, float h1)
constructor.
Definition CorePrimAPI.h:3183
NutSlitsParams & width(const float &w)
set the width.
virtual NutHeadBaseParams * copy(NutHeadBaseParams *p=nullptr)
copies the NutSlitsParams object.
float length() const
get the length.
NutSlitsParams & length(const float &l)
set the length.
float width() const
get the width.
int count() const
get the count of NutSlitsParams.
NutSlitsParams & count(const int &n)
set the count of NutSlitsParams.
NutSlitsParams()
constructor.
NutSlitsParams(float d, float h)
constructor.
Definition CorePrimAPI.h:2967
NutTShapedParams()
constructor.
NutTShapedParams(float d, float h, float h1)
constructor.
struct of the RimParams data
Definition CorePrimAPI.h:2637
RimParams & shoulderDiameter(float _d)
set the shoulder diameter.
RimParams & inRingDiameter(float _d)
set the inner ring diameter.
RimParams & outRingDiameter(float _d)
set the outer ring diameter.
RimParams(float _d, float _h, float _d1, float _d2)
constructor.
RimParams & shoulderHeight(float _h)
set the shoulder height.
The scene element, like sculpt object or curve.
Definition CoreAPI.h:1627
class of the slits
Definition CorePrimAPI.h:2354
Slit & height(const float &_h)
set the height.
Slit(float w, float h, float d, SlitType t)
slit constructor.
Slit & type(const int &_t)
set the slit type.
int type() const
get the slit type.
float height() const
get the height.
float width() const
get the width.
Slit & depth(const float &_d)
set the depth.
float depth() const
get the depth.
Slit & width(const float &_w)
set the width.
struct of the TShapedParams data
Definition CorePrimAPI.h:2527
TShapedParams & diameter(float _d)
set the diameter.
TShapedParams(float _d, float _h, float _w)
constructor.
TShapedParams & height(float _h)
set the height.
TShapedParams & width(float _w)
set the width.
TShapedParams()
constructor.
The class allows to operate over voxels/surface on the relatively low-level.
Definition CoreAPI.h:1929
bolt head primitive
Definition CorePrimAPI.h:2731
virtual cMeshContainer * create_mesh()
creates a mesh container for the bolt head.
const HeadParams & head() const
get the const HeadParams object.
boltHead & head(const int &_type, void *data)
set the head object with specified type and data.
Slit & slit()
get the slit object.
const Slit & slit() const
get the const slit object.
boltHead & slit(const Slit &_s)
set the slit object.
boltHead & head(const HeadParams &_h)
set the head object.
HeadParams & head()
get the HeadParams object.
bolt primitive
Definition CorePrimAPI.h:3426
int threadType()
get the screw thread profile.
bolt & nutHeight(const float &_h)
set the nut height on the bolt.
const boltHead & head() const
get the head object.
bolt & pitch(const float &_p)
set the thread pitch.
float pitch()
get the thread pitch.
virtual cMeshContainer * create_mesh()
creates a mesh container for the bolt.
bolt & uheight(const int &_uh)
set the underhead height.
bolt & underhead(const int &_uh)
set the under head type.
float threadLength()
get the thread length.
bolt & head(const boltHead &_h)
set the head object.
bolt & diameter(const float &_d)
set the bolt diameter.
bolt & threadHeight(const float &_h)
set the thread height.
bolt & nutType(const int &_t)
set the nut type.
float nutLocation()
get the nut location on the bolt.
bolt & threadType(const int &_t)
set the screw thread profile.
float diameter()
get the bolt diameter.
float length()
get the bolt length.
bolt & nutLocation(const float &_loc)
set the nut location on the bolt.
bolt & length(const float &_l)
set the bolt length.
int underhead()
get the under head type.
float uwidth()
get the underhead width.
float uheight()
get the underhead height.
float nutHeight()
get the nut height on the bolt.
bolt & uwidth(const int &_uw)
set the underhead width.
int nutType()
get the nut type.
float threadHeight()
get the thread height.
bolt & threadLength(const float &_l)
set the thread length.
The box.
Definition CorePrimAPI.h:348
box(float sizeX, float sizeY, float sizeZ)
constructs a new box object.
box(const vec3 &pos, const vec3 &size)
constructs a new box object.
box & axis(const vec3 &directionX, const vec3 &directionY, const vec3 &directionZ)
set the x, y and z direction
vec3 axis_y()
get the y-axis
box & size(const vec3 &_size)
set the box size
box & divide(int nx, int ny, int nz)
set the number deviding
box & size(float x, float y, float z)
set the box size
vec3 axis_x()
get the x-axis
virtual cMeshContainer * create_mesh()
creates a mesh container for the box.
box & axis(const vec3 &directionX)
set the x-direction
virtual float fillet_relative()
calculates a fillet relative value (0..1).
box(const vec3 &size)
constructs a new box object.
void init()
initialize the default parameters
box & reset_axis()
reset the x, y and z direction
box & axis(const vec3 &directionX, const vec3 &directionY)
set the x and y direction
vec3 axis_z()
get the z-axis
vec3 size() const
get the box size.
box()
constructs a new box object.
box(const vec3 &pos, const vec3 &size, float fillet)
constructs a new box object.
The capsule.
Definition CorePrimAPI.h:1394
capsule(const vec3 &posTop, const vec3 &posBottom, const float &radiusTop, const float &radiusBottom)
constructs a new capsule object.
capsule()
constructs a new capsule object.
capsule(const float &height, const float &radiusTop, const float &radiusBottom)
constructs a new capsule object.
virtual cMeshContainer * create_mesh()
creates a mesh container for the capsule.
The cone.
Definition CorePrimAPI.h:1106
float fillet_relative() override
calculates a fillet relative value (0..1).
cone & diameter(const float &d)
set the value of diameter.
cone(const vec3 &posTop, const vec3 &posBottom, const float &radiusBottom, const float &fillet=0.0)
constructs a new cone object.
float radius() const
get the value of radius.
cone()
constructs a new cone object.
cone & radius(const float &r)
set the value of radius.
virtual cMeshContainer * create_mesh()
creates a mesh container for the cone.
float diameter() const
get the value of diameter.
cone(const float &height, const float &radiusBottom, const float &fillet=0.0)
constructs a new cone object.
The cylinder.
Definition CorePrimAPI.h:876
cylinder & radiusBottom(const float &r)
set the bottom radius.
cylinder & positionTop(const vec3 &pos)
set the top position.
cylinder & diameterTop(const float &d)
set the top diameter.
float bottomCapScale() const
get the bottom cap scale.
cMeshContainer * getCylinderPrim(bool iscone=false)
get a mesh container for the cylinder without account of fillet.
int rings() const
get the number of rings in the mesh.
mat4 getLTransform()
get a transform matrix between standard cylinder and cylinder with custom parameters
cylinder & bottomCapScale(const float &scale)
set the bottom cap scale.
int caps() const
get the number of caps in the mesh.
vec3 positionTop() const
get the top position.
float radius() const
get the radius.
int slices() const
get the number of slices in the mesh.
float diameter() const
get the diameter.
cylinder & height(const float &_height)
set the height in the z-axis.
float topCapScale() const
get the top cap scale.
cylinder & radiusTop(const float &r)
set the top radius.
vec3 positionBottom() const
get the bottom position.
cylinder & topCapScale(const float &scale)
set the top cap scale.
cylinder()
constructs a new cylinder object.
cylinder & diameter(const float &d)
set the diameter.
float diameterTop() const
get the top diameter.
float sectorAngle() const
get the sector angle.
cylinder & slices(const int &nslices)
set the number of slices in the mesh.
virtual cMeshContainer * create_mesh()
creates a mesh container for the cylinder.
float radiusBottom() const
get the bottom radius.
cylinder & radius(const float &r)
set the radius.
cylinder(const float &height, const float &radiusTop, const float &radiusBottom, const float &fillet=0.0)
constructs a new cylinder object.
cylinder & diameterBottom(const float &r)
set the bottom diameter.
virtual float fillet_relative()
calculates a fillet relative value (0..1).
cylinder & rings(const int &nrings)
set the number of rings in the mesh.
cylinder & positionBottom(const vec3 &pos)
set the bottom position.
cylinder(const vec3 &posTop, const vec3 &posBottom, const float &radiusTop, const float &radiusBottom, const float &fillet=0.0)
constructs a new cylinder object.
cylinder & caps(const int &ncaps)
set the number of caps in the mesh.
float radiusTop() const
get the top radius.
float height() const
get the height.
cylinder & sectorAngle(const float &angle)
set the angle for cylinder with sector.
float diameterBottom() const
get the bottom diameter.
The ellipse.
Definition CorePrimAPI.h:797
ellipse & axis(const vec3 &directionX, const vec3 &directionY=vec3::AxisY, const vec3 &directionZ=vec3::AxisZ)
set the axis x, y and z direction
ellipse(const vec3 &size)
constructs a new ellipse object.
virtual void density_subdiv(int &slices, int &rings)
calculates the density-based subdivisions.
vec3 size() const
get the size of the ellipse.
ellipse & size(const vec3 &_size)
set the size of the ellipse.
ellipse & reset_axis()
reset the x, y and z directions
virtual cMeshContainer * create_mesh()
creates a mesh container for the ellipse.
ellipse(const vec3 &pos, float rx, float ry, float rz)
constructs a new ellipse object.
ellipse(const vec3 &pos, const vec3 &size)
constructs a new ellipse object.
ellipse()
constructs a new ellipse object.
void init()
initializing of the ellipse.
The gear.
Definition CorePrimAPI.h:1262
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 & sharpness(const float &sharp)
set the sharpness value.
float depth() const
get the depth value.
virtual cMeshContainer * create_mesh()
creates a mesh container for the gear.
gear & depth(const float &__depth)
set the depth value.
gear & order(const int &nteeth)
set the number of teeth in gear.
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()
constructs a new gear object.
float sharpness() const
get the depth value.
int order() const
get the number of teeth in gear.
gear(const float &height, const float &radiusTop, const float &radiusBottom)
constructs a new gear object.
image primitive
Definition CorePrimAPI.h:1926
image & topTexture(const char *_texture)
set the top texture
image()
constructs a new image object.
float bumpThickness() const
get the bump thickness of image
float sizeInScene() const
get the size of image in the scene
str bottomTexture() const
get the bottom texture
float taperAngle() const
get the angle of tapering of image
image & topBumpTexture(const char *_texture)
set the top bump texture
image & topBottomWeight(const float &weight)
set the weight of the top and bottom image
image & sizeInScene(const float &_size)
set the size of image in the scene
image & taperAngle(const float &_angle)
set the angle of tapering
image & strencilTexture(const char *_texture)
set the strencil texture
image & bottomBumpTexture(const char *_texture)
set the bottom bump texture
str bottomBumpTexture() const
get the bottom bump texture
image & bottomStrencilTexture(const char *_texture)
set the bottom strencil texture
float topBottomWeight() const
get the weight of the top and bottom image
str strencilTexture() const
get the strencil texture
str topBumpTexture() const
get the top bump texture
image & bottomTexture(const char *_texture)
set the bottom texture
image & bumpThickness(const float &_thickness)
set the bump thickness of image
float basicThickness() const
get the basic thickness of image
str topTexture() const
get the top texture
image & basicThickness(const float &_thickness)
set the basic thickness of image
virtual cMeshContainer * create_mesh()
creates a mesh container for the image.
str bottomStrencilTexture() const
get the bottom strencil texture
lathe primitive
Definition CorePrimAPI.h:1848
lathe()
constructs a new lathe object.
pointState
enumeration of the point state for a lathe profile.
Definition CorePrimAPI.h:1854
lathe & type(const lathe::Type &t)
set the lathe type
virtual cMeshContainer * create_mesh()
creates a mesh container for the text.
~lathe()
object destructor.
curve2d * profile() const
get the pointer to the profile
lathe & add_point(const vec2 &point, int st)
add the point into curve
lathe::Type type() const
get the lathe type.
lathe & reset()
reset the curve points
lathe & clear()
clear points of the profile
Type
enumeration of the lathe type.
Definition CorePrimAPI.h:1865
The ngon.
Definition CorePrimAPI.h:1347
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.
virtual cMeshContainer * create_mesh()
creates a mesh container for the ngon.
virtual float fillet_relative()
calculates a fillet relative value (0..1).
ngon(const vec3 &posTop, const vec3 &posBottom, const float &radiusTop, const float &radiusBottom, const int &order)
constructs a new gear object.
nut primitive
Definition CorePrimAPI.h:3333
float threadDiameter() const
get the hole thread diameter.
nut & enableThread(const bool &f)
set the enabled thread.
nut & threadDiameter(const float &d)
set the hole thread diameter.
float pitch() const
get the thread pitch.
virtual cMeshContainer * create_mesh()
creates a mesh container for the nut.
int threadType() const
get the nut thread profile.
nut & threadType(const int &_t)
set the nut thread profile.
bool enableThread() const
get the enabled thread.
nut & setTypeData(void *data)
set the typed data.
void * getTypeData()
get the typed data.
nut & pitch(const float &p)
set the thread pitch.
void release()
release the typed data
The abstract prim class.
Definition CorePrimAPI.h:15
static void debug_on(bool isOn=true)
indicates whether to turn on or off the debug mode.
Mesh mesh()
get the mesh prim
prim & color(DWORD CL)
assign the color to the primitive (in voxels)
prim & opacity(float value)
assign the opacity of the color over the voxel primitive. The color should be assigned before you ass...
void merge_debug(Volume &vol, Mesh &mesh)
merge the mesh debug into scene
void intersect(Volume &v)
intersect the prim into scene
static void debug_clear()
clear the debug info for primitive operations
static void reset_transform()
reset the global transform matrix
prim & roughness(float value)
assign the roughness for the voxel primitive, it will work only if the color already assigned
prim & color(float r, float g, float b, float a)
assign the color to the primitive (in voxels)
static void push_translate(const vec3 &d)
Set the translation to all primitives.
prim & details(const float det_level)
set the detail level
prim & metal(float value)
the metalliclty value for the voxel primitive, it will work only if the color already assigned
prim()
constructs a new prim object.
prim & name(const char *s)
set the primitive object name.
prim & x(float x)
shift the primitive along the x - axis
prim & color(const char *colorid)
assign the color to the primitive (in voxels)
void subtract(Volume &v)
subtract the prim from scene
static void push_transform(const mat4 &t)
set the global transform matrix to all primitives
static void push_scale(float scale)
Set the scale to all primitives.
prim & y(float y)
shift the primitive along the y - axis
prim & gloss(float value)
assign the gloss for the voxel primitive, it will work only if the color already assigned
prim & fillet(float radius)
set the fillet
vec3 scale() const
get the scale
prim & step_divide(float step)
set the step devide
prim & z(float z)
shift the primitive along the z - axis
prim & scale(const vec3 &v)
set the scale
void merge(Volume &v, const BoolOpType op)
merge the prim into scene
static void push_details(float details_modulator)
set the detail level to all primitives
virtual cMeshContainer * create_mesh()
abstract method to create a mesh container.
Definition CorePrimAPI.h:287
virtual float fillet_relative()
calculates a fillet relative value (0..1).
prim & translate(const vec3 &_pos)
Set the primitive translation.
prim & color(float r, float g, float b)
assign the color to the primitive (in voxels)
mat4 transform() const
get the transform matrix
prim & translate(float x, float y, float z)
Set the primitive translation.
str name() const
get the primitive object name.
vec3 translate() const
get the primitive translation
T & to_cast_this()
cast this prim to the obj type T
Definition CorePrimAPI.h:282
str class_name()
get the primitive class name.
prim & auto_divide(float average_div)
set the auto devide
T & Obj()
Get the primitive object reference.
Definition CorePrimAPI.h:264
static void push_scale(const vec3 &s)
Set the scale to all primitives.
float details()
get the detail level
bool isAs()
Check the prim's type.
Definition CorePrimAPI.h:270
void add(Volume &v)
add the prim into scene
prim & transform(const mat4 &t)
set the transform matrix
prim & scale(float scale)
set the scale
screw primitive
Definition CorePrimAPI.h:3613
screw & uwidth(const int &_uw)
set the underhead width.
float uwidth()
get the underhead width.
float length()
get the screw length.
float uheight()
get the underhead height.
screw & pitch(const float &_p)
set the screw thread step(pitch).
float threadLength()
get the screw thread length.
screw & underhead(const int &_uh)
set the underhead type.
int underhead()
get the underhead type.
float threadDiameter()
get the thread diameter.
screw & threadDiameter(const float &_d)
set the thread diameter.
screw & head(const boltHead &_h)
set the bolt head object.
screw & threadHeight(const float &_h)
set the screw thread height.
screw & uheight(const int &_uh)
set the underhead height.
float pitch()
get the screw thread step(pitch).
screw & length(const float &_l)
set the screw length.
screw & diameter(const float &_d)
set the screw diameter.
float threadHeight()
get the screw thread height.
virtual cMeshContainer * create_mesh()
creates a mesh container for the screw.
float diameter()
get the screw diameter.
screw & threadLength(const float &_l)
set the screw thread length.
const boltHead & head() const
get the bolt head object.
The sphere.
Definition CorePrimAPI.h:620
float slice_to() const
get the angle where the sphere slice ends.
sphere & ring_to(const float &angle)
When sector is on, specifies the angle where the sphere ring ends.
float slice_from() const
get the angle where the sphere slice begins.
float ring_from() const
get the angle where the sphere ring begins.
sphere & slice_to(const float &angle)
When sector is on, specifies the angle where the sphere slice ends.
sphere(float radius)
constructs a new sphere object with radius.
float ring_to() const
get the angle where the sphere ring ends.
sphere & sub_division(const int subdiv)
set the degree for subdivision in the mesh.
sphere()
constructs a new sphere object.
sphere & slice_from(const float &angle)
When sector is on, specifies the angle where the sphere slice begins.
int slices() const
get the number of slices in the mesh.
sphere::DivisionMode sub_div_mode() const
get the division mode for the mesh.
float radius() const
get the radius of the sphere.
int sub_division() const
get the degree of subdivision triangular or cubic division of the sphere.
DivisionMode
division modes
Definition CorePrimAPI.h:625
sphere & sector_on(const bool &_switch)
set the flag to create a portion of sphere.
sphere & radius(const float &r)
set the radius of the sphere.
sphere & slices(const int &_slices)
set the number of slices in the mesh.
int rings() const
get the number of rings in the mesh.
virtual void density_subdiv(int &slices, int &rings)
calculates the density-based subdivisions.
sphere & diameter(const float &d)
set the diameter of the sphere.
sphere & sub_div_mode(const sphere::DivisionMode &divmode)
set the division mode for the mesh.
sphere(const vec3 &pos, float radius)
constructs a new sphere object with position and radius.
bool sector_on() const
get the flag of creating a portion of sphere. Default = false.
sphere & rings(const int &_rings)
set the number of rings in the mesh.
float diameter() const
get the diameter of the sphere.
sphere & ring_from(const float &angle)
When sector is on, specifies the angle where the sphere ring begins.
virtual cMeshContainer * create_mesh()
creates a mesh container for the sphere.
The spiral.
Definition CorePrimAPI.h:1441
float diameter() const
get the outer diameter.
int slices() const
get the number of slices in the mesh.
spiral(const float &out_radius, const float &in_radius, const float &_sstep, const float &nturns)
constructs a new spiral object.
int turns() const
get the number of turns.
spiral()
constructs a new spiral object.
spiral & turns(const int nturns)
set the number of turns.
int caps() const
get the number of caps in the mesh.
int rings() const
get the number of rings in the mesh.
float profile_height() const
get the profile height for rectangle profile.
float step() const
get the spiral step.
spiral & clock_wise(const bool &clockWise)
set the clockwise direction of the spiral.
spiral & profile_rect(const float width, const float height)
set the dimensions for the rectangle profile.
float profile_width() const
get the profile width for rectangle profile.
float profile_radius() const
get the profile radius.
spiral & diameter(const float &d)
set the outer diameter of the spiral.
float profile_diameter() const
get the profile diameter.
spiral & rings(const int &nrings)
set the number of rings in the mesh.
spiral & caps(const int &ncaps)
set the number of caps in the mesh.
spiral & radius(const float &r)
set the outer radius of the spiral.
spiral & profile_diameter(const float &d)
set the profile diameter.
spiral & profile_radius(const float &r)
set the profile radius.
float radius() const
get the outer radius.
virtual cMeshContainer * create_mesh()
creates a mesh container for the spiral.
spiral & profile_type(const SpiralProfile type)
set the type of profile (circle or rectangle).
spiral & slices(const int &nslices)
set the number of slices in the mesh.
bool clock_wise() const
get the clokwise direction of the spiral.
spiral & step(const float &vstep)
set the spiral step.
text primitive
Definition CorePrimAPI.h:1735
text()
constructs a new text object.
text & font(const Font &f)
set the text font
text & depth(const float &d)
set the text depth in the pixels
float width() const
get the text width
text & extraRotation(const float &rotation)
set the rotate angle around the x-axis.
float invertBending() const
get the invert of the text bending.
text(const char *s)
constructs a new text object.
float bendRadius() const
get the bend radius.
float extraRotation() const
get the rotate angle around the x-axis.
virtual cMeshContainer * create_mesh()
creates a mesh container for the text.
text & string(const char *s)
set the text's string.
void update_mesh(cMeshContainer *mc)
update the mesh container for the text.
float depth() const
get the text depth
text & bendRadius(const float &radius)
set the bend radius.
text & width(const float &w)
set the text width in the pixels
str string() const
get the text's string.
Font font() const
get the font object
text & invertBending(const bool &_binvert)
set the invert of the text bending.
thread primitive
Definition CorePrimAPI.h:2101
float height() const
get the height of the thread.
thread & close(const bool &b)
set the closed thread.
thread & diameter(const float d)
set the diameter of the thread.
thread & pitch(const float p)
set the pitch of the thread.
float stub() const
get the stub length of the thread.
float pitch() const
set the pitch of the thread.
thread & stub(const float &l)
set the stub length of the thread.
thread & height(const float &h)
set the height of the thread.
int turns() const
get the number of the thread turns.
thread & turns(const int &n)
set the number of the thread turns.
bool close() const
set the closed thread.
float diameter() const
get the diameter of the thread.
virtual cMeshContainer * create_mesh()
creates a mesh container for the thread.
bool clockwise() const
get the clockwise of the thread.
thread & clockwise(const bool &cw)
set the clockwise flag of the thread.
ThreadProfile profile() const
get the thread profile type.
thread & profile(const ThreadProfile &prf)
set the thread profile type.
thread stud primitive
Definition CorePrimAPI.h:2225
bool enableThread() const
get the indicator of the enabled thread.
threadStud & length(const float &l)
set the stud length.
float diameterTop() const
get the top diameter of the thread.
float threadLength() const
get the length of the thread.
float diameter() const
get the diameter of the thread.
threadStud & diameter(const float &d)
set the diameter of the thread.
threadStud & bodyType(const ThreadStudBodyType &bt)
set the body type.
ThreadStudBodyType bodyType() const
get the body type.
threadStud & diameterBottom(const float &d)
set the bottom diameter of the thread.
float diameterBottom() const
get the bottom diameter of the thread.
float length() const
get the length of the stud.
threadStud & diameterTop(const float &d)
get the top diameter of the thread.
virtual cMeshContainer * create_mesh()
creates a mesh container for the thread stud.
threadStud & enableThread(const bool &enable)
enabled or disabled thread in the stud.
The torus.
Definition CorePrimAPI.h:480
float rings_angle() const
get the angle for torus rings
int rings() const
get the number of rings in the mesh.
virtual cMeshContainer * create_mesh()
creates a mesh container for the torus.
torus & section_diameter(const float §ion_d)
set the cross section diameter.
torus & rings(const int &_rings)
set the number of rings in the mesh.
torus(const vec3 &pos, const float &ringRadius, const float &crossSectionRadius)
constructs a new torus object.
float section_diameter() const
get the cross section diameter.
torus & section_radius(const float §ion_r)
set the cross section radius.
torus & rings_angle(const float &angle)
When sector is on, specifies the angle for torus rings. Default = 360 degrees.
float radius() const
get the ring radius.
float section_radius() const
get the cross section radius.
torus()
constructs a new torus object.
bool sector_on() const
get the flag of creating a portion of torus. Default = false.
int slices() const
get the number of slices in the mesh.
torus & sector_on(const bool &_switch)
set the flag to create a portion of torus.
torus & radius(const float &r)
set the ring radius.
torus(const float &ringRadius, const float &crossSectionRadius)
constructs a new torus object.
torus & diameter(const float &d)
set the ring diameter.
torus & slices_angle(const float &angle)
When sector is on, specifies the angle for torus slices. Default = 360 degrees.
float diameter() const
get the ring diameter.
torus & slices(const int &_slices)
set the number of slices in the mesh.
float slices_angle() const
get the angle for torus slices
The tube.
Definition CorePrimAPI.h:1169
tube(const float &height, 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.
tube(const float &height, const float &radiusTop, const float &radiusBottom, const float &fillet)
constructs a new tube object.
tube & thickness(const float &w)
set the wall thickness value.
float thickness() const
get the relative value of the hole radius.
tube(const vec3 &posTop, const vec3 &posBottom, const float &radiusTop, const float &radiusBottom, const float &relativeHoleRadius, const float &fillet)
constructs a new tube object.
float fillet_relative() override
calculates a fillet relative value (0..1).
tube(const float &height, const float &radiusTop, const float &radiusBottom)
constructs a new tube object.
tube()
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.
virtual cMeshContainer * create_mesh()
creates a mesh container for the tube.
float relativeHoleRadius() const
get the relative value of the hole radius.
washer primitive
Definition CorePrimAPI.h:3763
float height() const
get the washer height.
washer & facet(const bool &_f)
indicates the facet usage.
washer & outerDiameter(const float &_d)
set the outer diameter.
float thickness() const
get the washer thickness.
washer::Type type() const
get the washer type.
float innerDiameter() const
get the inner diameter.
washer & conusDiameter(const float &_d)
set the diameter of the conus washer.
Type
enumeration the types of the washer
Definition CorePrimAPI.h:3768
bool facet() const
get the facet flag.
washer & thickness(const float &_s)
set the washer thickness.
virtual cMeshContainer * create_mesh()
creates a mesh container for the washer.
washer & innerDiameter(const float &_d)
set the inner diameter.
float conusDiameter() const
get the diameter of the conus washer.
float outerDiameter() const
get the outer diameter.
washer & type(washer::Type _t)
set the washer type.
washer & height(const float &_h)
set the washer height.
The coat namespace used for most 3DCoat API calls except low-level internal structures.
Definition CoreAPI.h:43
SlitType
enumeration the slit types
Definition CorePrimAPI.h:2322
comms::cVec3 vec3
3D - float vector, see the cVec3
Definition CoreAPI.h:50
BoolOpType
Boolean operations type.
Definition CoreAPI.h:87
ThreadStudBodyType
thread body type
Definition CorePrimAPI.h:2217
FontStyle
Enumeration of the string drawing styles.
Definition CorePrimAPI.h:1612
comms::cVec2 vec2
2D - vector, see the cVec2
Definition CoreAPI.h:56
comms::cMat4 mat4
4x4 float matrix, see the cMat4
Definition CoreAPI.h:59
SpiralProfile
The profile type of the spiral.
Definition CorePrimAPI.h:1431
NutType
enumeration the types of the nut
Definition CorePrimAPI.h:2794
comms::cRect rect
rect float, see the cRect
Definition CoreAPI.h:73
ThreadProfile
thread profile types
Definition CorePrimAPI.h:2089
BoltHeadType
enumeration the types of the bolt head
Definition CorePrimAPI.h:2423
comms::cList< X > list
the array template, see cList
Definition CoreAPI.h:70
comms::cStr str
the string that is compatible with the 3DCoat engine, see the cStr
Definition CoreAPI.h:67
Holds the general information about bolt parameters.
Definition CorePrimAPI.h:3435
Holds the general information about image parameters.
Definition CorePrimAPI.h:1931
Holds the general information about bolt parameters.
Definition CorePrimAPI.h:3618