V3 Alpha
Explore the next generation of MachineBlocks with V3 Alpha — an experimental, AI-first platform for developers and early adopters.
-
Install a coding agent
Install Cursor, or another coding agent that can edit a project on your computer. You will open the folder there and describe the brick in plain language. Download Cursor
-
Install Node.js
The MachineBlocks CLI runs on
Node.js. Install the current LTS release. Download Node.js -
Install OpenSCAD Desktop
V3 generates the models with OpenSCAD. Install OpenSCAD Desktop from the
Development Snapshots. Use a snapshot build, not the stable release. Development Snapshots -
Create a project folder
Create an empty folder and change into it. Name it however you like.
myfolderis only an example.terminal shellmkdir myfolder cd myfolder -
Initialize the project
In that folder, run
initwith a fully qualified name. The name is a reversed domain and must include abmlsegment.com.acme.bml.testis an example — use your own domain, thenbml, then a name for your bricks.terminal npxnpx @machineblocks/cli init com.acme.bml.testFor example
-
com.acme.bml.test -
com.mydomain.bml.mybricks -
de.whatever.bml.xyz.sub -
ca.dom.bml.abc
-
-
Open the folder
Open the folder in Cursor, or in the coding agent you installed. If you kept the example name, that folder is
myfolder. -
Describe the brick
In Cursor, open the Agent chat for this folder and describe the brick in one sentence: what it is, a detail such as the color, and the package it belongs to. The agent writes the BlockML file, then runs the compiler, which renders that file to OpenSCAD. For the example name
com.acme.bml.test, send:cursor promptCreate a red Brick 2x4 in the test package.The prompt asks for a red Brick 2x4 in the
testpackage. The agent creates it as a BlockML file with the extension.bml, namedBrick2x4. These files follow a Java-style package under theblocksfolder. That folder is the source root, in the same role assrcin a Java project, and the folders match the fully qualified name. Forcom.acme.bml.testthe file lands here:blocks BlockMLblocks/ └── com/ └── acme/ └── bml/ └── test/ └── Brick2x4.bmlThe agent then runs the compiler directly. Rendering from BlockML to OpenSCAD happens automatically, and the compiler is deterministic: the same
.bmlfile always produces the same.scadfile. The rendered file keeps the nameBrick2x4and uses the same package underblocks, with thebmlsegment replaced byscad.com.acme.bml.testis rendered ascom.acme.scad.test:blocks OpenSCADblocks/ └── com/ └── acme/ └── scad/ └── test/ └── Brick2x4.scad -
Open the SCAD file
Open the rendered
.scadfile in OpenSCAD Desktop to see the brick. For this example, that file isblocks/com/acme/scad/test/Brick2x4.scad. Open it from OpenSCAD, or from Cursor:In OpenSCAD, choose Open and select the file.
In Cursor, right-click
Brick2x4.scadand choosePreview in OpenSCAD.
Stay on the latest version
From the project folder, run this whenever you want to update the project to the latest MachineBlocks version.
npx @machineblocks/cli@latest update