Documentation
¶
Overview ¶
Command cad shows the 3D work of Glutter 1.10 together (SPEC §27): a part in a viewport3d.View that the mouse and the touch orbit, pan and zoom, with a grid, the axes and the view cube; the four display modes (shaded, shaded with edges, wireframe and hidden line); a section plane that a slider moves, with its cap and the outline of the cut; a pick that shows the item, the triangle, the point of the world and the normal in a side panel; and a distance measured between two picks, drawn as a dimension line with an Anchored label. The part is made by code (a bracket of four pieces); "Sample" loads a gear from an STL file that is built into the program, and "Open" asks for an STL or OBJ file with the file dialog of package desktop (not on the web, where a page has no file dialog yet: there the sample is what opens).
Run it with: go run ./examples/cad
It needs a GPU renderer (Vulkan, Direct3D 12 or WebGPU); with another one the view shows its fallback, a line of text.
On Windows: go run ./cmd/glutter-windows run ./examples/cad. On the web: go run ./cmd/glutter-web serve ./examples/cad. On Android: go run ./cmd/glutter-android run ./examples/cad.
Environment: GLUTTER_BACKEND=x11|wayland (Linux) or win32 (Windows), GLUTTER_RENDERER=vulkan|d3d12|webgpu, GLUTTER_SCREENSHOT=<file.png>, GLUTTER_SCREENSHOT_AFTER=<duration>. In debug builds GLUTTER_DEV_CAD=proof starts with the bracket cut by a plane through its middle, drawn with its edges, and the top of a post picked (the state of the proof pictures).