Nihilistic Pool Man

    @react-cad/core
    TypeScript icon, indicating that this package has built-in type declarations

    0.19.2 • Public • Published

    @react-cad/core

    Core ReactCAD WebAssembly library, providing primitives for constructing the shape tree and a viewer to render shape trees into an HTML canvas.

    The viewer code is derived from the Open CASCADE WebGL Sample application.

    Usage

      import reactCadCore from "@react-cad/core";
    
      const core = await reactCadCore();
      const cube = core.createCADNode("box");
      cube.setSize([2, 2, 2]);
    
      core.renderSTEP(cube).then(contents => fs.writeFileSync("cube.step", contents));;

    Use on the web requires more complex loading. See @react-cad/storybook-framework for a webpack example. One you have the core object:

      const cube = core.createCADNode("box");
      cube.setSize([2, 2, 2]);
    
      const canvas = document.getElementById("my-canvas");
      const view = core.createView(canvas);
    
      core.renderNodeAsync(cube, view);

    See src/react-cad-core.d.ts for the TypeScript API.

    Keywords

    none

    Install

    npm i @react-cad/core

    DownloadsWeekly Downloads

    20

    Version

    0.19.2

    License

    LGPL-2.1-only

    Unpacked Size

    27 MB

    Total Files

    14

    Last publish

    Collaborators

    • react.cad.dev
    • react.cad.bot