#include <CoreAPI.h>
public:
HoneyComb() {
Radius = 80;
Height = 20;
Fillet = 1;
Size = 1;
}
float Radius;
float Height;
float Fillet;
int Size;
SERIALIZE() {
FSLIDER(Radius, "%Radius", 20, 100, 50, false);
FSLIDER(Height, "%Height", 5, 20, 10, false);
FSLIDER(Fillet, "%Fillet", 1, 5, 1, false);
SLIDER(Size, "Size", 1, 10);
}
void build() {
auto volume = current.
Volume();
float dx=Radius;
float dy=Radius*sqrt(3.0);
volume.toSurface();
for(int i=0;i<Size;i++)
for(int j=i;j<Size;j++)
}
};
EXPORT
int main() {
HoneyComb combs;
combs.ReadFromFile("data/Temp/HoneyComb.json");
combs.WriteToFile("data/Temp/HoneyComb.json");
combs.build();
};
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:91
SceneElement addChild(const char *name) const
add the child element of the same nature
static SceneElement sculptRoot()
get the root of all sculpt objects
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:3732
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.
The ngon.
Definition CorePrimAPI.h:1347
prim & details(const float det_level)
set the detail level
prim & fillet(float radius)
set the fillet
prim & translate(const vec3 &_pos)
Set the primitive translation.
T & Obj()
Get the primitive object reference.
Definition CorePrimAPI.h:264
static void toRoom(const char *name, bool Force=false)
switch to the room
comms::cVec3 vec3
3D - float vector, see the cVec3
Definition CoreAPI.h:50