3DCoat Core API
The 3DCoat API documentation.
No Matches

This example generates the surface figure that consists of capsule

// This example generates the surface figure that consists of capsule
#include <CoreAPI.h>
//@config: Debug
class CapsulePrim:public BaseClass {
CapsulePrim() {
Radius = 30;
Height = 200;
float Radius;
float Height;
// this is class registration, look dialogs example
FSLIDER(Radius, "%Radius", 10, 100, 30, false);
FSLIDER(Height, "%Height", 20, 200.0, 100, false);
void build() {
auto current = coat::Scene::sculptRoot().addChild("Capsule"+coat::str::ToString(voxId));
auto volume = current.Volume();
coat::capsule capsule;
int main() {
// get to sculpt room
CapsulePrim capsulePrim;
// load settings if exist
if(dlg.ok().cancel().params(&capsulePrim).show() == 1) {// ok pressed, buttons start from 1
// save settings
// build the figure
return 0;
Use this class for build a class for UI or serialization. see class_reg.h for details about the class...
Definition BaseClass.h:90
int childCount() const
returns the child elements count
SceneElement addChild(const char *name) const
add the child element of the same nature
static SceneElement sculptRoot()
get the root of all sculpt objects
The capsule.
Definition CorePrimAPI.h:1394
cylinder & radiusBottom(const float &r)
set the bottom radius.
cylinder & height(const float &_height)
set the height in the z-axis.
cylinder & radiusTop(const float &r)
set the top radius.
the rich dialog. You may customize it, show your custom parameters and custom buttons.
Definition CoreAPI.h:1493
dialog & params(BaseClass *params)
The important core feature. BaseClass allows to create the custom controls in the dialog....
dialog & ok()
add Ok button
dialog & cancel()
add Cancel button
int show()
Show the dialog. This is usually the last command in the chain.
prim & details(const float det_level)
set the detail level
void add(Volume &v)
add the prim into scene
static void toRoom(const char *name)
switch to the room