This example generates the surface figure dumb-bell with usage of the debug mode
#include <CoreAPI.h>
EXPORT
int main() {
ui::toRoom("Sculpt");
auto voxId = Scene::sculptRoot().childCount();
auto current = Scene::sculptRoot().addChild("Dumbbell" + str::ToString(voxId));
auto volume = current.Volume();
prim::debug_on(true);
volume.toSurface();
float _height = 80;
float _radius = 8;
float _rotate = 90;
float _fscale = 4;
float _detail = 0.5;
float _shift_R = _height/2 + _height/8;
float _shift_L = _height/2 - _height/8;
mat4 matrix = mat4::Scaling(_fscale) * mat4::RotationZ(_rotate) * mat4::RotationX(_rotate);
matrix = mat4::Scaling(_fscale) * mat4::RotationY(-_rotate);
prim::debug_on(false);
return 0;
}
Definition CorePrimAPI.h:1643
The cylinder.
Definition CorePrimAPI.h:876
cylinder & height(const float &_height)
set the height in the z-axis.
cylinder & radius(const float &r)
set the radius.
The ngon.
Definition CorePrimAPI.h:1347
prim & details(const float det_level)
set the detail level
prim & name(const char *s)
set the primitive object name.
prim & fillet(float radius)
set the fillet
prim & translate(const vec3 &_pos)
Set the primitive translation.
void add(Volume &v)
add the prim into scene
prim & transform(const mat4 &t)
set the transform matrix
text primitive
Definition CorePrimAPI.h:1735
text & font(const Font &f)
set the text font
text & depth(const float &d)
set the text depth in the pixels
text & string(const char *s)
set the text's string.
text & width(const float &w)
set the text width in the pixels
tube & relativeHoleRadius(const float &r)
set the relative value of the hole radius.
The coat namespace used for most 3DCoat API calls except low-level internal structures.
Definition CoreAPI.h:43
comms::cVec3 vec3
3D - float vector, see the cVec3
Definition CoreAPI.h:50
comms::cMat4 mat4
4x4 float matrix, see the cMat4
Definition CoreAPI.h:59