C++ implmentation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "mesh.h" | |
void Mesh::set(const Eigen::MatrixXf &V_, const Eigen::MatrixXi &F_) { | |
V = V_; | |
F = F_; | |
computeNormals(); | |
computeAdjacencyMatrix(); | |
computeEdgeLength(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "opengl.h" | |
void OpenGL::initBuffers() { | |
glGenVertexArrays(1, &vaoMesh); | |
glBindVertexArray(vaoMesh); | |
glGenBuffers(1, &vboVertices); | |
glGenBuffers(1, &vboNormals); | |
glGenBuffers(1, &vboUVs); | |
glGenBuffers(1, &vboFaces); |
Use C++ dynamic library from Node.js with node-ffi
$ g++ -dynamiclib -o libhello.dylib hello.cpp
$ ls
libhello.dylib hello.cpp hello.js
$ node hello.js
hello world
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<craft> | |
<info> | |
<title>Untitled</title> | |
</info> | |
<param name="h" type="int" default="20" | |
label="height of the cylinder"/> | |
<param name="n" type="int" default="3" | |
label="number of spheres"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<craft> | |
<info> | |
<title>Untitled</title> | |
</info> | |
<param name="h" type="int" default="20" | |
label="height of the cylinder"/> | |
<param name="n" type="int" default="3" | |
label="number of spheres"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<craft> | |
<info> | |
<title>Gear</title> | |
</info> | |
<craft name="sun-layout" module="sun-layout"/> | |
<param name="diameter" default="10" type="int"/> | |
<param name="teeth" default="10" type="int"/> | |
<param name="center_diameter" default="1.5" type="int"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<craft name="chair"> | |
<param name="length" type="int" default="15"/> | |
<param name="legHeight" type="int" default="14"/> | |
<stack l="alignX(0%)" color="peru"> | |
<!-- Back --> | |
<stack spacing="-13"> | |
<stack spacing="-4"> | |
<cylinder height="1" radius="6" | |
t="rotateY(90) |