OpenCAD · WebGL2 library for developers
OpenCAD 3D Viewer Core
This is a WebGL2-based 3D viewer library used by NC, STEP, and SKP viewers. It provides common functions to receive, display, select, and measure scenes created by an interpreter.



About this tool
A common library for OpenCAD that separates the code for parsing files from the code for rendering the display. It accepts a Scene3d scene—composed of triangular meshes, line segments, and points—and enables consistent manipulation and measurement functions across various types of viewers.
- Display
- WebGL2 shading, edges, wireframe and X-ray, shadows and fog, line and point drawing
- Operation
- Rotate, pan and zoom, touch controls, view cube and standard views, walking that follows the floor
- Selection
- BVH-based picking, an index that finds snap points quickly even among hundreds of thousands, per-group visibility and outline color, high-resolution image export
- Measure
- Two-point measurement that snaps to endpoints, midpoints, circle centers, intersections, perpendicular feet and axis directions, Shift direction lock and axes tracked from other points, minimum distance between faces
- Section
- Multiple section planes with cut-face fill, per-group origins that keep large coordinates from jittering
- Connection
- Scene3d scene format shared with NC·STEP·SKP interpreters, a refinement hook that lets apps move snapped points onto the exact curves and surfaces, and single-mesh updates (used for NC stock removal)
Developer integration
- Check installation/use examples and Scene3d types on GitHub.
- Attach Viewer3d to a screen element and pass the interpreted scene to setScene.
- Completed usage examples can be found under "Open Example" in the NC/STEP/SKP viewer.
Support and limitations
- This is a library for development; there is no dedicated site for opening files. Please use the appropriate viewer for each file format to inspect the actual files.
- File parsing functionality is not included in this core; it is handled by the respective NC, STEP, and SKP modules.
Use a browser that supports WebGL2 and JavaScript. OpenCAD is a personal open source project released under the MIT license.