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

This example generates the washer primitives (flat,grover,quard)

// This example generates the washer primitives (flat,grover,quard)
#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("washer"+coat::str::ToString(voxId));
auto volume = current.Volume();
// turn to surface
volume.toSurface();
//create the flat washer
washer().type(washer::Type::Flat).innerDiameter(100).outerDiameter(200).thickness(15).facet(true).details(0.2).add(volume);
//create the grover washer
washer().type(washer::Type::Grover).innerDiameter(100).outerDiameter(200).thickness(15).height(40).x(-300).details(0.2).add(volume);
//create the quard washer
washer().type(washer::Type::Quard).innerDiameter(70).outerDiameter(200).thickness(15).z(300).details(0.2).add(volume);
}
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
prim & details(const float det_level)
set the detail level
prim & x(float x)
shift the primitive along the x - axis
prim & z(float z)
shift the primitive along the z - axis
void add(Volume &v)
add the prim into scene
static void toRoom(const char *name, bool Force=false)
switch to the room
washer primitive
Definition CorePrimAPI.h:3763
washer & facet(const bool &_f)
indicates the facet usage.
washer & outerDiameter(const float &_d)
set the outer diameter.
washer & thickness(const float &_s)
set the washer thickness.
washer & innerDiameter(const float &_d)
set the inner diameter.
washer & type(washer::Type _t)
set the washer type.
washer & height(const float &_h)
set the washer height.
The coat namespace used for most 3DCoat API calls except low-level internal structures.
Definition CoreAPI.h:43