ManifoldCAD VS Code Extension
A VS Code extension bringing ManifoldCAD functionality to VS Code. It allows creation of .mfc and .manifoldcad files, containing scripts compatible with manifoldcad.org. It also adds a preview panel, allowing building the Manifold meshes and previewing them inside vscode. The preview panel should support all features of manifoldcad.org, such as coloring and animations.
Both desktop VS Code and vscode.dev (any web version) are supported.
This extension has been developed with support from Cookiecad.
Preview

Usage
- Open or create a
.mfc
or .manifoldcad
file in VS Code.
- A triple slash typescript import should automatically be added to the top of the file. This is what provides the TypeScript definitions for the Manifold API.
- Run the
Manifold: Open 3D Viewer
command from the Command Palette (Ctrl+Shift+P).
- Edit your code and save the file. See the results update live in the viewer.
What is Manifold?
Manifold is a high-performance library for creating and manipulating manifold triangle meshes. Manifold meshes represent solid objects and are essential for CAD, 3D printing, and advanced modeling workflows. The library guarantees robust mesh operations, supports mesh Booleans, smoothing, and arbitrary vertex properties, and is available for C++, TypeScript/JavaScript, and Python.
Features
- 3D Model Visualization: Instantly preview 3D meshes generated by your code in an interactive viewer.
- Animation Support: Visualize and scrub through mesh animations and transformations.
- Live Editing: See changes reflected in real time as you edit your code.
How It Works
The extension provides a custom viewer for .mfc
and .manifoldcad
files, opening a webview panel that renders your 3D models and animations. The webview is built with React and Vite, and leverages the Manifold WASM bindings for mesh generation.
Development
- Clone this repository and run
pnpm install
in the root directory.
- Now build the manifold library and copy the
manifold.js
and manifold.wasm
files into the src/webview/src/wasm/
directory.
- Build the webview by navigating to
src/webview/
and running:
pnpm install
pnpm build
- Build the extension:
pnpm compile
Launch the extension in a VS Code Extension Development Host.
A launch.json
configuration is provided, so inside VS Code, open the Debug panel, select "Launch Extension", and hit the green play button.
A new VS Code window will open with the extension loaded.
Or: build the .vsix package for distribution:
npx vsce package
See the package.json
scripts for more commands.
Learn More
Known Issues
Opening multiple .mfc files causes type errors to appear in the opened file due to the triple slash type import.
This is because the same context is shared between the opened files, and the typescript compiler sees multiple variables with the same name.
The solution is to only open one .mfc file at a time.