#include <CoreAPI.h>
public:
ThreadPrim() {
Diameter = 50;
Step = 10;
Turns = 10;
Profile = ThreadProfile::ThreadTriangle;
Clockwise = true;
}
float Diameter;
float Step;
int Turns;
bool Clockwise;
SERIALIZE() {
FSLIDER(Diameter, "%Diameter", 10, 100, 50, false);
FSLIDER(Step, "%Step", 0.2, 20, 10, false);
SLIDER(Turns, "%Turns", 3, 20);
REG_AUTO(Clockwise,"%ClockWise");
Enumerator* E = ENUM.Get("PROFILE");
if (E->GetAmount() == 0) {
E->Add("triangle");
E->Add("trapeze");
E->Add("Rectangular");
E->Add("Round");
E->Add("Persistent");
}
REG_DROPLIST(Profile,"Profile","PROFILE");
}
void build() {
auto voxId = Scene::sculptRoot().childCount();
auto current = Scene::sculptRoot().addChild("Thread" + str::ToString(voxId));
auto volume = current.Volume();
volume.toSurface();
}
};
EXPORT
int main() {
ui::toRoom("Sculpt");
ThreadPrim threadPrim;
threadPrim.ReadFromFile("data/Temp/thread.json");
threadPrim.WriteToFile("data/Temp/thread.json");
threadPrim.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
the rich dialog. You may customize it, show your custom parameters and custom buttons.
Definition CoreAPI.h:3811
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
thread primitive
Definition CorePrimAPI.h:2101
thread & diameter(const float d)
set the diameter of the thread.
thread & pitch(const float p)
set the pitch of the thread.
thread & turns(const int &n)
set the number of the thread turns.
thread & clockwise(const bool &cw)
set the clockwise flag of the thread.
thread & profile(const ThreadProfile &prf)
set the thread profile type.
The coat namespace used for most 3DCoat API calls except low-level internal structures.
Definition CoreAPI.h:43
ThreadProfile
thread profile types
Definition CorePrimAPI.h:2089