# BaroCSS CAD > The AI-Native Browser CAD — a pure-TypeScript B-rep & NURBS CAD Studio, AI Copilot with Cmd+K 3D Spatial Pin, Generative Variant Explorer, BaroCSS Review, WebGPU renderer, and structured MCP server. Zero WASM. ## Quick AI Context Endpoints - [SDK Reference & Runnable Samples](/llms-sdk.txt): `@barocss/cad`, `@barocss/cad-model`, `@barocss/cad-react/sdk`, `@barocss/gpu`, `@barocss/viewer` - [MCP & Agent Tool Contract](/llms-mcp.txt): All 132 `cad-mcp` / `cad-cli` / WebMCP actions, autonomy levels (L1–L4), and refusal patterns - [Full Documentation Corpus](/llms-full.txt): Consolidated public markdown documentation ## Interactive Browser Apps - [5-Workspace CAD Studio](/app/): Zero-install pure-TypeScript B-Rep CAD Studio + Quick-Fit mode - [BaroCSS Review](/review/): Shareable 3D/2D `.bcad` pull-request reviewer with Before/After diffs and 2D HLR fallback ## 1-Command MCP Setup ```bash claude mcp add barocss-cad -- node apps/cad-studio/scripts/cad-mcp.mjs --doc ./part.bcad ``` ## Documentation Map ### Introduction - [What BaroCSS CAD is](/) - [Hardware showcase](/showcase/): Explore real manufacturable workflows you can design, inspect, and export right in your browser — from parametric brackets and WebGPU manufacturability checks to 6-axis robotic arms exported directly - [Compare CAD tools](/compare/): Modern browser and AI-native CAD tools solve very different parts of the hardware engineering stack. This page compares **BaroCSS CAD** against the leading emerging and established CAD platforms on fa - [Getting started](/guide/getting-started): Design, prompt, and export your first manufacturable part in 60 seconds — right in the browser with pure TypeScript and WebGPU, zero WASM install. - [Embedding & self-hosting](/guide/embedding): BaroCSS CAD ships as a **100% static client-side bundle** — no backend geometry servers, no database migrations, and no WebAssembly build quirks. You can embed interactive 3D CAD directly inside docum - [Browser support & FAQ](/guide/faq): BaroCSS CAD runs **100% client-side in your browser** with zero WebAssembly download. Graphics rendering adapts automatically to each browser's capabilities: - [Concepts](/guide/concepts): A few rules run through every part of BaroCSS CAD. Knowing them makes the rest of these pages, and the studio's messages, easier to read. - [Robot motion](/guide/robot-motion): Physics supports [continuous primitive rotation](/packages/physics/profiles-and-lifecycle#isolated-noncubic-rotor) for admitted boxes, spheres and capsules. This does not qualify connected robot joint - [How it works](/how/): BaroCSS CAD is not a black-box C++ binary — every B-rep Boolean, rolling-ball fillet, NURBS evaluator, exact HLR projection, and WebGPU pass is open TypeScript. Across **26 deep dives** and **77 inter ### CAD - [CAD](/packages/cad/): The CAD kernel. It is a boundary-representation (B-rep) modeller with NURBS curves and surfaces, written in TypeScript, with no WebAssembly and no external geometry library. The studio, the document m - [Modeling API](/packages/cad/modeling): A part is a `barocss-cad-part` document: - [B-rep, robustness and refusals](/packages/cad/robustness): Each solid output is a B-rep: surfaces, boundary curves and the topology that joins them. Native faces retain their surfaces; mesh inputs retain faceted faces. The Boolean algorithm depends on that re - [Exchange formats](/packages/cad/formats): These functions work on caller-supplied data. They do not open files, download results or save a document. Keep the report with the result; a report object is not the file content. - [CAD Projection (2D HLR)](/packages/cad-projection/): Headless, deterministic CPU hidden-line CAD geometry projection with exact SVG vector export and CPU-rendered PNG output — with **zero browser, GPU, DOM, canvas, React, or Studio dependencies**. - [CAD Interop (Three / Babylon / GLB)](/packages/cad-interop/): `@barocss/cad-interop` bridges exact `@barocss/cad` B-Rep geometry and native face/curve packets into third-party WebGL/WebGPU scene graphs (**Three.js**, **Babylon.js**, **Pixi3D**) and binary **glTF - [CAD Worker (Web Workers & Variants)](/packages/cad-worker/): `@barocss/cad-worker` moves heavy B-Rep evaluation, mass properties, 2D proposal callouts, robotics workspace sweeps, and parallel generative variants off the browser main thread using standard Web Wo - [Object API](/packages/api): > **Quick jump:** [Start with CAD Model API](#start-with-the-cad-model-api) · [Interactive 3D API Results](#see-actual-api-results) · [CAD Kernel Part](#parts) · [Studio / Model Part](#studio-parts) · - [Booleans of curved solids](/how/boolean): This page opens up the Boolean of two curved B-reps — the path [B-rep, robustness and refusals](/packages/cad/robustness#_3-curved-b-reps-intersect-the-surfaces-and-trim-their-face-domains) names *int - [NURBS curves and surfaces](/how/nurbs): The kernel's free-form geometry is NURBS: non-uniform rational B-splines. A curve is a list of control points, a weight for each and a knot vector; a surface is a grid of control points with a knot ve - [Tessellating a B-rep for display](/how/tessellation): A B-rep stores exact geometry: planes, cylinders and NURBS patches, bounded by exact curves. A screen, an STL file or a mesh Boolean needs triangles instead. `tessellateBrep(brep, { segmentsPerQuarter - [Volume, centroid and inertia](/how/mass-properties): A part's mass properties are its volume, its mass, its centre of mass (the centroid) and its inertia tensor about that centre. The kernel returns them from `massPropertiesOf(output, density)` and `bre - [Fillets: the rolling ball](/how/fillets): A fillet rounds an edge. Its surface is the one a ball of radius r sweeps as it rolls along the edge, touching both of the edge's faces. The kernel never edits the faces in place. It builds a *tool*, - [Exact arithmetic for planar solids](/how/exact-boolean): When both bodies of a Boolean have only planar faces and straight edges, the kernel uses the polyhedral path of [B-rep, robustness and refusals](/packages/cad/robustness#_2-planar-polyhedra-split-clas - [Hidden lines for drawings](/how/hidden-lines): A drawing view shows a part as lines: its edges and its outline, solid where they can be seen and dashed where something stands in front of them. `projectBrepHiddenLines(breps, view, options)` makes s - [Booleans of upright extrusions](/how/prismatic): Most parts start as sketches extruded straight up: a plate, a boss on it, a pocket, a hole. Every face of such a body is a horizontal plane, a vertical plane or a vertical cylinder. The kernel keeps t - [Meshes, native tools and the BVH](/how/mesh-boolean): An STL, OBJ or scanned part comes into the kernel as a *mesh body*: a closed triangle mesh kept as triangles, its faces regions of the mesh (*facet faces*), not one face per triangle and not a smooth - [Closest points on curves and surfaces](/how/closest-point): Given a point, which point of a curve or a surface lies nearest to it? The kernel and the studio's model ask this whenever a 3D point has to be read in a face's own parameters, or a distance from a cu - [Where a curve meets a plane](/how/curve-roots): Several kernel operations need the points where a curve crosses a plane: where a curve enters a planar face (`intersectCurveWithPlanarFaceMaterial`), or where it leaves a convex loop of lines in a pla - [Threads, gears and springs](/how/threads-gears): Gears, threads and springs are not drawn as sketches and extrusions. The kernel builds each one as a B-rep straight from its defining geometry, in `packages/barocss-cad/src/machine/`: the involute of - [Subdivision surfaces as exact B-splines](/how/subd): A subdivision (SubD) body starts as a *cage*: a coarse mesh of quads whose vertices a person or an agent moves. The smooth surface is what the cage becomes when it is subdivided again and again, by th - [Sheet metal: bends and the flat pattern](/how/sheet-metal): A sheet-metal part is cut flat from a sheet of one thickness and then bent. Its model has two jobs: build the bent part as an exact solid, and give back the *flat pattern*, the outline to cut before b - [Mesh processing: simplify, repair, offset](/how/mesh-processing): An STL, OBJ or scanned part reaches the kernel as a triangle mesh, and it is rarely ready to use. A scan has far more triangles than its shape needs. An exported file can have cracks between triangles - [Tolerances and numbers](/how/tolerance): The kernel computes with binary64 numbers, and binary64 rounds. Two computations of the same point rarely agree to the last bit, so a test such as "do these two curve ends meet?" or "does this point l - [What makes a B-rep valid](/how/validity): A solid in the kernel is a *B-rep* (boundary representation): a set of records that describe its boundary, from the body down to its faces, edges and vertices. Every operation that makes a body return - [Reading STEP and IGES](/how/import): Parts made in other CAD systems arrive as exchange files. This page opens up how the kernel reads them: - [How results are checked](/how/verification): A kernel result is a body of thousands of numbers. A test that runs the kernel again and compares it with itself proves only that it repeats. Each check on this page compares a result with something e ### CAD Model - [CAD Model](/packages/cad-model/): For joint timing, pose sampling and the boundary with dynamics, see [Robot motion](/guide/robot-motion). - [Solving sketch constraints](/how/sketch-solver): A sketch is drawn by hand, so its points are never exactly where its constraints say: an edge meant to be horizontal leans a little, a length is 36.1 mm instead of 40. The solver moves the points unti - [Names that survive edits](/how/naming): A part is a list of features. Later features point at faces and edges of earlier results: a fillet names the edges it rounds, a face fillet, a draft or a thread names faces, a face split names the fac - [Lofts, sweeps and revolves](/how/loft-sweep): Most solids start as a flat profile, a closed loop of lines and arcs in a sketch. The features on this page turn such profiles into faces and solids: `revolve` turns one about an axis, `extrude` with - [Text from font outlines](/how/text): **Text** makes a new, independent solid from a supplied static TrueType font. The document keeps the original text, font bytes and dimensions. Editing the feature rebuilds its geometry from that sourc - [Assemblies, robots and drawings](/how/cad-model): Three things the document model does on top of the kernel's solids: it places parts by their mates, reads a mated assembly as a robot and moves it, and lays out a drawing with its dimensions. The code - [Machining, printing and moulding checks](/how/manufacturing-previews): A part that can be modelled cannot always be made. A mould has to open, a print has to stand on its layers, a cutter has to reach the surface it cuts. The manufacturability report checks a part agains ### CAD React - [CAD React](/packages/cad-react/): `@barocss/cad-react` is a private workspace package. It describes CAD geometry with ordinary React components, lowers the committed geometry to the existing [CAD Model](/packages/cad-model/) document, - [Components and props](/packages/cad-react/components): Import these components from `@barocss/cad-react`. Coordinates and lengths are in millimetres. Profiles are local XY geometry; extrusion and transforms lower to the existing Model operations. A React - [Part](/packages/cad-react/components/part): The model root and declaration lifecycle. Part is a logical React element, not a native feature node or a visible canvas. - [Rectangle](/packages/cad-react/components/rectangle): A closed axis-aligned profile in the local XY plane. The compiler lowers it to a native sketch-storage record when a consumer needs it; the logical component is a profile producer, not a solid. - [Circle](/packages/cad-react/components/circle): A closed circular profile in local XY. It lowers to existing sketch storage for extrusion, not to a solid hole feature by itself. - [Polygon](/packages/cad-react/components/polygon): `Polygon` declares one closed planar profile from an ordered list of points. It lowers to the existing Model polygon sketch storage. It adds no Boolean, tolerance, triangulation or geometry-repair alg - [Loop](/packages/cad-react/components/loop): D509 implements Loop, LineSegment, ArcSegment, Profile, Outer and Voids. The existing thirteen logical elements remain; the package now has nineteen. The 76 source-checkpoint controls (65 reused with - [LineSegment](/packages/cad-react/components/line-segment): D509 implements Loop, LineSegment, ArcSegment, Profile, Outer and Voids. The existing thirteen logical elements remain; the package now has nineteen. The 76 source-checkpoint controls (65 reused with - [ArcSegment](/packages/cad-react/components/arc-segment): D509 implements Loop, LineSegment, ArcSegment, Profile, Outer and Voids. The existing thirteen logical elements remain; the package now has nineteen. The 76 source-checkpoint controls (65 reused with - [Profile](/packages/cad-react/components/profile): D509 implements Loop, LineSegment, ArcSegment, Profile, Outer and Voids. The existing thirteen logical elements remain; the package now has nineteen. The 76 source-checkpoint controls (65 reused with - [Outer](/packages/cad-react/components/outer): D509 implements Loop, LineSegment, ArcSegment, Profile, Outer and Voids. The existing thirteen logical elements remain; the package now has nineteen. The 76 source-checkpoint controls (65 reused with - [Voids](/packages/cad-react/components/voids): D509 implements Loop, LineSegment, ArcSegment, Profile, Outer and Voids. The existing thirteen logical elements remain; the package now has nineteen. The 76 source-checkpoint controls (65 reused with - [Extrude](/packages/cad-react/components/extrude): Turns one supported closed profile into a solid using the existing Model extrusion. Sketch lowering is internal storage; there is no public sketch prop. - [Revolve](/packages/cad-react/components/revolve): Revolve turns one closed profile into a solid through the existing CAD Model revolve node. Provide a profile, a sketch axis and an angle. The result is a solid that other operations can use. The selec - [Union](/packages/cad-react/components/union): Joins realized solid operands in declared order through existing Model union nodes. The React group may lower to more than one native node. - [Difference](/packages/cad-react/components/difference): Subtracts an ordered list of solid tools from one solid target. Difference is logical composition and can lower to multiple existing native difference nodes. - [Target](/packages/cad-react/components/target): Selects the single solid operand for its parent Difference. Target is a logical slot and creates no native feature node of its own. - [Tools](/packages/cad-react/components/tools): Groups the ordered solid cutters for Difference. Tools is a logical slot, not a native feature or a union of its children. - [Definitions](/packages/cad-react/components/definitions): Declares reusable profiles and solids without adding independent Part outputs. It is a logical registry group, not a native modeling operation. - [Translate](/packages/cad-react/components/translate): Places one solid with the existing Model body-translation node. It adds the authored XYZ offset to the parent solid in model coordinates; no frontend transform math is introduced. - [Rotate](/packages/cad-react/components/rotate): Rotates one solid with the existing Model body-rotation node. The component declares parameters; native backend code performs the transformation. - [Hole](/packages/cad-react/components/hole): Cuts one solid with the existing native Hole operation. Import Hole and HoleProps from @barocss/cad-react. This is a private workspace API. - [References and compiler](/packages/cad-react/references): Native IDs are generated automatically. Use a typed object ref when another branch must consume declared geometry. A handle describes a supported kind; it does not contain synchronous evaluated CAD ge - [React CAD SDK (/sdk)](/packages/cad-react/sdk): While the root `@barocss/cad-react` entry provides declarative JSX geometry authoring (``, ``, ``), **`@barocss/cad-react/sdk`** ships ready-to-mount React components and hooks fo - [Engine and Viewer](/packages/cad-react/engine-viewer): The package does not create a Worker or ship an engine client. Supply an existing implementation of `EnginePort`, a provenance-aware mass merger and a Viewer sink. Give one ModelHost exclusive evaluat - [Examples](/packages/cad-react/examples): These examples use current public package exports. The repository examples provide the complete injected-engine application: `packages/barocss-cad-react/examples/App.tsx`, `Bracket.tsx`, `TransformApp - [CAD Model support map](/packages/cad-react/support-map): CAD React is the first adapter subset, not a complete React facade over CAD Model. The D509 implementation has nineteen logical elements: six operation adapters (Extrude, Revolve, Union, Difference, T - [Support boundaries](/packages/cad-react/limits): The package is private workspace source, version `0.0.0`. Current code accepts more parameter combinations than have independent actual geometry evidence. Keep declaration support, controlled tests, r ### Physics - [Physics](/packages/physics/): Physics advances an admitted numerical model from initial state and applied loads. The caller supplies the clock and displays each accepted state. The rigid world uses spheres, boxes and capsules. It - [Units and frames](/packages/physics/units-and-frames): Declare the unit system and coordinate frame before you connect a Robot, a CAD proxy and a Physics world. Convert each value once at its boundary. Do not convert Physics output again before you use it - [Profiles and lifecycle](/packages/physics/profiles-and-lifecycle): Choose the numerical profile before creating a world. A larger body-count limit does not enable all smaller-profile features. Admission limits describe allowed inputs; numerical evidence covers the na - [Host integration](/packages/physics/host-integration): Use one Physics World for one simulation. CAD, rendering and React do not own another numerical World. This page describes the current unreleased branch and the host boundary. CAD React is owned by a ### GPU - [GPU](/packages/gpu/): The studio's WebGPU viewer, and a small CSS-shaped scene and material language. It depends only on `@barocss/cad`. - [Rendering a model on the GPU](/how/gpu): The studio's viewport draws a part with `@barocss/gpu`'s viewer when the browser has WebGPU. The kernel hands it triangles; the viewer turns them into pixels: shadows, lit surfaces, edges, section cap ### Studio - [Studio](/studio/): BaroCSS CAD Studio is the browser application for parametric B-Rep modeling, AI-assisted design, kinematic assemblies, 2D engineering drawings, DFM inspection, and WebGPU rendering. - [Tour of the studio](/studio/tour): Studio uses a focused **3-panel layout** built around five task-intent workspaces: - [Quick-Fit and Casual Studio](/studio/quick-fit): Not every hardware change requires opening a full feature tree or sketch solver. BaroCSS CAD provides two streamlined paths for fitting an existing parametric design to new dimensions: **Quick-Fit** i - [BaroCSS Review](/studio/review): **BaroCSS Review** is the standalone read-only review application for inspecting CAD designs and approval bundles in any browser. Share `.bcad` documents so teammates, mechanical leads, and manufactur - [Modeling](/studio/modeling): Use this guide to choose the next modeling step. The detailed pages explain each tool and its supported inputs. - [Sketches](/studio/sketches): A sketch is a flat profile on a plane. Features such as extrude, revolve and sweep are made from it. - [Part features](/studio/features): Every command adds a feature to the part's history. Each feature is kept as data — its kind, its values and what it is built on — so the part can be edited and rebuilt. Start a command from its key, f - [Parameters and configurations](/studio/parameters): A parameter is a named size the part depends on, such as `C = 3`. A feature's value can be bound to it, so changing the parameter changes every feature that uses it. A configuration is a saved set of - [Frames and weldments](/studio/frames): A frame is a set of structural members along a skeleton, each member a body of its own. The members share their section, and their joints are cut to fit. - [Assemblies and robots](/studio/assembly-workflows): Use this guide to place reusable parts and decide whether the assembly can move. Assembly placement and robot motion have different support limits. - [Assemblies and mates](/studio/assemblies): An assembly is a document that places other parts as instances, positioned by mates or by typed values. The document's own bodies are the **base part**. - [Robots](/studio/robots): For joint timing, pose sampling and the boundary with dynamics, see [Robot motion](/guide/robot-motion). - [Drawings and manufacturing](/studio/drawing-workflows): Make a sheet from the current model, check its references, and prepare files for a recipient. Review the BOM and manufacturing report as separate results. - [Drawings](/studio/drawings): The **Drawing** tab turns the part, or the assembly, into a dimensioned sheet. The sheet is computed from the model, so it follows every change; the dimensions and notes you add are kept with it. - [BOM and quotes](/studio/bom): **BOM** in the top bar opens the bill of materials of the part or the assembly. - [Manufacturing](/studio/manufacturing): A part is checked against the process you choose. Rules use the model's geometry and measurements; some printing checks also use its mesh. A check says what it cannot judge instead of passing it. - [Shop rows](/studio/rows): BaroCSS has no standards built in: no thread table, no fastener catalogue, no bearing list, no casting allowances. Sizes like these depend on the edition of a standard and on what your supplier stocks - [Display and rendering](/studio/display-workflows): Inspect the model with display modes, sections and previews. Choose a live raster image or a frozen path-traced still when you need a picture. Keep the editable model and any report separately from th - [Display, sections and analysis](/studio/display): Everything on this page changes how the model is shown, never the model itself. Its controls are: - [Rendering](/studio/rendering): The **Render** workspace sets how the part looks in a picture: its appearances, the lights, the background and the camera. It can also add props and animate the part. - [Files and projects](/studio/file-workflows): Keep an editable model and prepare the files that another application needs. Use project versions to keep past document states. Keep export source records beside the files they describe. - [Files and exports](/studio/files): **Save** writes the part as a `.bcad` file. It holds the model's history, so it reopens editable. A document with no mesh blob references is written as plain JSON. This includes older documents with m - [Projects and versions](/studio/projects): A project stores your parts, immutable version snapshots, branches, and merge history. BaroCSS CAD supports local folders, browser OPFS storage with crash-safe write-ahead logging (WAL), and optional ### Viewer - [Viewer](/packages/viewer/): `@barocss/viewer` is currently used from source. ### AI agent - [Designing with the agent](/agent/): BaroCSS CAD's AI Copilot works directly on the live `.bcad` document using the exact same parametric modeling, drawing, DFM, and inspection commands you use in Studio. Every geometry edit is validated - [Variant Explorer & Self-Verification](/agent/variants): BaroCSS CAD combines parallel background evaluation with closed-loop visual inspection so AI-assisted edits stay fast, comparable, and geometrically sound. - [Tools (v2 actions)](/agent/tools): The agent works through one tool contract, `barocss-cad-tools-v2`. The chat, [`cad-mcp`](/agent/cli) and [`cad-cli`](/agent/cli) all serve this list and nothing else. It has 13 tools: - [cad-mcp and cad-cli](/agent/cli): The studio's tools also run outside the browser: - [Proposals and autonomy](/agent/proposals): The agent changes your part in one of two ways: - [AI-Ready Docs (/llms.txt)](/agent/ai-ready): BaroCSS CAD documentation is structured for both human engineers and AI coding agents (Claude Code, Cursor, Windsurf, Codex, and custom MCP clients). Every public page ships a one-click **Copy for AI* ### Reference - [Refusal codes](/reference/refusals): When BaroCSS CAD can't do something correctly, it refuses and says why. A refusal leaves the part as it was. This page lists the codes refusals carry. - [The .bcad document](/reference/document): A `.bcad` file holds one studio document: the part's model and everything else saved with it. The document model reads and writes it (`@barocss/cad-model/engine/doc` and `engine/container`). - [Rows file formats](/reference/rows): Rows are JSON files a person supplies: in the studio's **Library**, or attached in the chat. [Shop rows](/studio/rows) explains why, and what uses each kind. - [Limits](/reference/limits): What isn't supported, or is refused, gathered from the other pages. Each item links to where it is explained. - [How it is verified](/reference/verification): Claims about supported behaviour name their checks and limits. Planned work and source-only candidates are identified separately. This page describes checks from the kernel up to the studio in a brows - [Physics verification](/reference/physics-verification): This page records bounded numerical evidence available on this independent development branch. It does not clear the existing Physics, Studio or manufacturing HOLDs. Historical two-hinge and eight-box