Skip to content

jmettraux/manowar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

manowar

A foolbox for ManifoldCAD .js

Manowar.slicedCylinder(h, r0, r1, angle, circularSegs, center)

Returns a truncated Manifold Cylinder.

let result = Manowar.slicedCylinder(10, 42, 35, 180 + 20, 8, true);
export default result;

Manowar.bezierPoints(pointArray, stepCount)

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);
  }));

Manowar.chainedHulls(manifoldArray)

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); })));

Manowar.chainedHull(manifoldArray)

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)); };

Manowar.radiatedHull(hubManifold, manifoldArray)

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); }));

LICENSE

MIT, see LICENSE.txt

About

foolbox for ManifoldCAD js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors