# Partwright > AI-driven parametric CAD in the browser. Modeling engines: JavaScript (manifold-3d mesh API, incl. `api.sdf` signed-distance fields and `api.params`), OpenSCAD (.scad), BREP (replicad/OpenCASCADE solids with selective fillets/chamfers and STEP export), and voxel. All interaction is via the `window.partwright` console API. `window.mainifold` is a legacy alias. ## Entrypoint Navigate to `/editor` -- you drive the tool programmatically via `window.partwright`, and see your geometry by calling the render tools (below), so there is no tab to click. ## Quickstart ```js partwright.help() // List all available methods await partwright.createSession("name") // Start a named session (uses active language) await partwright.runAndSave(code, "v1 - description", { isManifold: true, maxComponents: 1 // Validate before saving }) // JS code must end with: return ; // SCAD code uses standard OpenSCAD syntax (no return) ``` `await` every async method. Without `await` you'll inspect a Promise object instead of the actual result. ## Verify visually after structural changes Stats alone miss warped roofs, twisted spires, and wrong proportions: ```js partwright.renderView({ elevation: 0, azimuth: 0, ortho: true }) // front partwright.renderView({ elevation: 0, azimuth: 90, ortho: true }) // right partwright.renderView({ elevation: 90, ortho: true }) // top ``` Or call `await partwright.renderViews({ views: "box" })` for a single composite of all six faces (front, back, left, right, top, bottom) -- the all-faces check. ## Resuming a session ```js await partwright.openSession(id) const ctx = await partwright.getSessionContext() // ctx.notes -- [REQUIREMENT]/[DECISION]/[FEEDBACK] context from prior work // ctx.versions -- prior versions with geometry summary // ctx.agentHints.recentErrors -- last 5 validation errors (avoid repeating them) ``` ## Tagging faces with color For a flat axis-aligned face, derive the seed from the bounding box: ```js const bb = partwright.getBoundingBox(); await partwright.paintRegion({ point: [(bb.min[0]+bb.max[0])/2, (bb.min[1]+bb.max[1])/2, bb.max[2]], normal: [0, 0, 1], // outward-pointing normal of the top face color: [1, 0, 0], // RGB 0..1 name: "Top", }) // Save an uncolored baseline first -- re-running new geometry invalidates the painted triangle indices (call clearColors() before changing the model). // Check {error} on the return and confirm with listRegions(). ``` For organic shapes, code-authored features, or anything where flood-fill is unreliable, prefer `paintByLabels` (when you author the model with `api.label(...)`), `paintNear` / `paintInBox` (coordinate-driven), or `paintPreview` to dry-run a selector. See `/ai.md#color-regions`. ## Language switching ```js partwright.getActiveLanguage() // -> 'manifold-js' or 'scad' await partwright.setActiveLanguage('scad') // Switch to OpenSCAD ``` ## Docs - [Full API reference and workflow guide](/ai.md) - [What's new — recently shipped features](/whats-new) - `partwright.help()` in the browser console for live method discovery