3DCoat Core API
The 3DCoat API documentation.
Loading...
Searching...
No Matches
nut.cpp

This example generates the nut primitive.

// This example generates the nut primitive.
#include <CoreAPI.h>
using namespace coat;
//@config: Debug
EXPORT
int main() {
// get to sculpt room
coat::ui::toRoom("Sculpt");
// add new volume
auto current = coat::Scene::sculptRoot().addChild("nut"+coat::str::ToString(voxId));
auto volume = current.Volume();
// turn to surface
volume.toSurface();
// make the hexa nut primitive with spicified parameters and add it into scene
nut().setTypeData(NutHexaParams(200,80)).threadType(ThreadProfile::ThreadTriangle).threadDiameter(140).pitch(12).details(0.5).add(volume);
return 0;
}
Definition CorePrimAPI.h:2876
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
nut primitive
Definition CorePrimAPI.h:3333
nut & threadDiameter(const float &d)
set the hole thread diameter.
nut & threadType(const int &_t)
set the nut thread profile.
nut & setTypeData(void *data)
set the typed data.
nut & pitch(const float &p)
set the thread pitch.
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, bool Force=false)
switch to the room
The coat namespace used for most 3DCoat API calls except low-level internal structures.
Definition CoreAPI.h:43