@moicad/sdk Documentation

← Back to Home

Navigation

Search

Quick Start

Installation

npm install @moicad/sdk

Basic Usage - Shape API

import { Shape } from '@moicad/sdk';

// Create a simple house
const house = Shape.cube(20)
  .union(Shape.pyramid([20, 20, 15]).translate([0, 0, 10]))
  .color('brown');

// Get geometry for 3D printing
const geometry = house.getGeometry();
console.log('Vertices:', geometry.vertices.length);
console.log('Volume:', house.getVolume());

Basic Usage - Functional API

import { cube, pyramid, translate, union } from '@moicad/sdk';

// Create same house functionally
const house = union(
  cube(20),
  translate([0, 0, 10], pyramid([20, 20, 15]))
);

// Apply color
const coloredHouse = color('brown', house);

Features

🎯 Fluent API

Chainable methods for readable, maintainable code

⚡ High Performance

10-20x faster than OpenSCAD with manifold-3d engine

🔒 Type Safe

Full TypeScript support with IntelliSense

📐 OpenSCAD Compatible

98-99% language compatibility for easy migration

🎨 3D Viewport

Built-in Three.js visualization and rendering

📦 Cross Platform

Works in browser and Node.js environments