0.2.0 • Published 4 years ago

jsxcad v0.2.0

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
4 years ago

Logo

JSXCAD

JSXCAD is a new way of "writing" 3DCAD like a code. It offers familiar JSX syntax that is transpiling into OpenJSCAD.

Conversion

Users beware: JSXCAD is under the alpha stage. Many APIs are missing. Please do not attempt to deploy it on your production environment unless you are fully aware of what it means.

Install

Install jsxcad via npm.

npm install -g jsxcad

Usage

Write your 3D model and save it as logo.jsx.

import JSXCAD, {Union, Difference, Intersection, Cube, Sphere} from 'jsxcad';

const OpenJSCADLogo = (
  <>
    <Union>
      <Difference>
        <Cube size={3} center={true} />
        <Sphere r={2} center={true} />
      </Difference>
      <Intersection>
        <Sphere r={1.3} center={true} />
        <Cube size={2.1} center={true} />
      </Intersection>
    </Union>
  </>
);

export default JSXCAD.render(OpenJSCADLogo);

Compile logo.jsx with jsxcad command.

jsxcad -f stl -o ./logo.stl ./logo.jsx

Now you got logo.stl!