This example generates the surface figure door stop that consists of half-sphere and cylinders
#include <CoreAPI.h>
EXPORT
int main() {
ui::toRoom("Sculpt");
auto scene = Scene::sculptRoot().addChild("Door Stop");
auto volume = scene.Volume();
volume.toSurface();
mat4 matrix = mat4::Identity;
float _diameter = 200;
float _baseheight = 10;
float _thickness = 16;
float _drill = 40;
matrix *= mat4::RotationX(-90);
return 0;
};
The cone.
Definition CorePrimAPI.h:1106
cone & diameter(const float &d)
set the value of diameter.
The cylinder.
Definition CorePrimAPI.h:876
cylinder & height(const float &_height)
set the height in the z-axis.
cylinder & diameter(const float &d)
set the diameter.
cylinder & radius(const float &r)
set the radius.
cylinder & sectorAngle(const float &angle)
set the angle for cylinder with sector.
prim & details(const float det_level)
set the detail level
void subtract(Volume &v)
subtract the prim from scene
prim & y(float y)
shift the primitive along the y - axis
prim & fillet(float radius)
set the fillet
prim & z(float z)
shift the primitive along the z - axis
void add(Volume &v)
add the prim into scene
prim & transform(const mat4 &t)
set the transform matrix
The sphere.
Definition CorePrimAPI.h:620
sphere & ring_to(const float &angle)
When sector is on, specifies the angle where the sphere ring ends.
sphere & slice_to(const float &angle)
When sector is on, specifies the angle where the sphere slice ends.
sphere & slice_from(const float &angle)
When sector is on, specifies the angle where the sphere slice begins.
sphere & sector_on(const bool &_switch)
set the flag to create a portion of sphere.
sphere & diameter(const float &d)
set the diameter of the sphere.
sphere & ring_from(const float &angle)
When sector is on, specifies the angle where the sphere ring begins.
The coat namespace used for most 3DCoat API calls except low-level internal structures.
Definition CoreAPI.h:43
comms::cMat4 mat4
4x4 float matrix, see the cMat4
Definition CoreAPI.h:59