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

Generate the surface figure "glass"

// Generate the surface figure "glass"
#include <CoreAPI.h>
//@config: Debug
using namespace coat;
EXPORT
int main() {
// get to sculpt room
coat::ui::toRoom("Sculpt");
// add new volume
auto current = coat::Scene::sculptRoot().addChild("glass");
auto volume = current.Volume();
// turn to surface
volume.toSurface();
// add the solid glass using bezie points
lathe().add_point(vec2(0.991,0.512),0)
.add_point(vec2(0.813,0.506),0)
.add_point(vec2(0.657,0.420),0)
.add_point(vec2(0.524,0.131),0)
.add_point(vec2(0.191,0.110),0)
.add_point(vec2(0.098,0.310),0)
.add_point(vec2(0.008,0.313),0)
.size(vec3(270,270,270))
.add(volume);
// subtract sphere from solid glass
sphere().diameter(260).y(150.0).subtract(volume);
return 0;
}
SceneElement addChild(const char *name) const
add the child element of the same nature
static SceneElement sculptRoot()
get the root of all sculpt objects
box & size(const vec3 &_size)
set the box size
lathe primitive
Definition CorePrimAPI.h:1848
lathe & add_point(const vec2 &point, int st)
add the point into curve
void subtract(Volume &v)
subtract the prim from scene
prim & y(float y)
shift the primitive along the y - axis
void add(Volume &v)
add the prim into scene
The sphere.
Definition CorePrimAPI.h:620
sphere & diameter(const float &d)
set the diameter of the sphere.
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
comms::cVec3 vec3
3D - float vector, see the cVec3
Definition CoreAPI.h:50
comms::cVec2 vec2
2D - vector, see the cVec2
Definition CoreAPI.h:56