@jbroll/jscad-fluent
v0.7.1
Published
Chainable TypeScript wrapper around JSCAD's modeling API for 2D and 3D geometry, with named anchors from [jscad-anchors](https://github.com/jbroll/jscad-anchors) for placing parts against each other.
Readme
jscad-fluent
Chainable TypeScript wrapper around JSCAD's modeling API for 2D and 3D geometry, with named anchors from jscad-anchors for placing parts against each other.
It covers @jscad/modeling's model-building API: primitives, booleans,
transforms, every extrusion, expansions, hulls, modifiers, measurements,
curves, vector text, and the maths and utils helpers, so model code needs no
modeling import.
const jf = require('@jbroll/jscad-fluent')
const hole = jf.cylinder({ radius: 2, height: 10 })
.withAnchors({ axis: { origin: [0, 0, 2.5], z: [0, 0, 1] } })
.translate([10, 0, 0])
const plate = jf.cuboid({ size: [40, 40, 5] })
.subtract(hole, { carry: { bolt1: hole } })
.colorize(jf.colors.css.steelblue)
const bolt = jf.cylinder({ radius: 1.8, height: 20 })
.attachTo(plate, 'bolt1.axis', 'bottom', { overlap: 5 })Install
npm install @jbroll/jscad-fluentnpm also installs jscad-anchors and
the @jbroll/jscad-modeling fork.
See docs/install.md. In a page, load
dist/jscad-fluent.browser.js after modeling's browser build; it defines
jscadFluent.
Docs
License
MIT
