A foolbox for ManifoldCAD .js
Returns a truncated Manifold Cylinder.
let result = Manowar.slicedCylinder(10, 42, 35, 180 + 20, 8, true);
export default result;Returns an array of points [ x, y, z ]
let ps = [ [ 0, 0, 0 ], [ 70, 10, 0 ], [ 60, 20, 0 ], [ 100, 100, 10 ] ];
let ps1 = Manowar.bezierPoints(ps, 10);
export default Manifold.union(
ps1.map(function(p, i) {
//console.log(`${i} > ${JSON.stringify(p)}`);
return Manifold.cylinder(5, 2, 2, 6, true).translate(p);
}));Returns an array of hulls.
let ps = [ [ 0, 0, 0 ], [ 70, 10, 10 ], [ 60, 20, 0 ], [ 100, 100, 40 ] ];
let ps1 = Manowar.bezierPoints(ps, 5);
export default Manifold.union(
Manowar.chainedHulls(
ps1.map(function(p, i) {
return Manifold.sphere(2, 36, true).translate(p); })));Returns a Manifold hull.
let ps = [ [ 0, 0, 0 ], [ 70, 10, 10 ], [ 60, 20, 0 ], [ 100, 100, 40 ] ];
let ps1 = Manowar.bezierPoints(ps, 5);
export default Manowar.chainedHull(
ps1.map(function(p, i) {
return Manifold.sphere(2, 36, true).translate(p); }));It's simply:
let chainedHull =
function(eltArray) { return Manifold.union(chainedHulls(eltArray)); };Compounds triangular hulls, radiating from the hubManifold, iterating with successive pairs from the manifoldArray.
let ps = [ [ 0, 0, 0 ], [ 70, 10, 10 ], [ 60, 20, 0 ], [ 100, 100, 40 ] ];
let ps1 = Manowar.bezierPoints(ps, 5);
export default Manowar.radiatedHull(
Manifold.sphere(2, 36, true).translate([ 100, 100, 0 ]),
ps1.map(function(p) { return Manifold.sphere(2, 36, true).translate(p); }));MIT, see LICENSE.txt