deniz.in

Markets

Weather

Loading weather

· via Hacker News – Front Page (native)

Halfspace is an experimental WebGPU IDE for solid modeling with distance fields

Matt Keeter's Halfspace is an experimental solid-modeling IDE built on implicit distance fields and the Fidget kernel, with near-real-time WebGPU rasterization in the browser and mesh export.

Halfspace is an experimental WebGPU IDE for solid modeling with distance fields

What Halfspace is

Matt Keeter has published Halfspace, an experimental IDE for solid modeling built on distance fields, along with a live demo that runs in the browser on WebGPU (a native build also exists). The project page, which reached the Hacker News front page, describes the tool as a showcase application for Fidget, the implicit-surface geometry kernel Keeter has been developing since 2022. Work on Halfspace itself began in April 2025, and Keeter is at pains to note the code was written the traditional way — his write-up opens by stating that it was not "vibe-coded."

Inside the GUI, models are rasterized in near-real time and can be exported either as images or as triangle meshes. Modeling combines pre-defined primitives with hand-written scripts. Keeter cautions that the demo works best on a desktop: mobile Safari still has WebGPU problems, and the pan, tilt and zoom interactions are not yet designed for multitouch.

From assembly to an IDE

Keeter's motivation comes from a tension he has noticed while working with implicit surfaces. At the lowest level, all you get are x, y and z coordinates, and turning those into shapes is, in his comparison, like writing assembly: low-level, powerful and annoying. The conventional cure is abstraction — a standard library of shapes and transformations such as sphere, box, translate and scale that compiles down to the low-level representation. A less common cure, which he admires in Kartik Agaram's Mu project for x86 assembly, is to keep the low-level layer but wrap it in better tooling.

Halfspace pursues both paths. It ships a small but growing standard library, while also making it easy to build models incrementally: a complex shape can be split into smaller pieces that are parameterized and visualized individually.

Distance fields in the foreground

By solid modeling, Keeter means objects with a definitive inside and outside — the property required for physical output, given his background in CAD/CAM with an emphasis on 3D printing. Most CAD software instead relies on boundary-representation kernels that stitch individual surfaces into a solid body, a problem he describes as tremendously hard; the intersection of two NURBS surfaces, for instance, may have no closed-form solution. His alternative, pursued since his Master's thesis, is geometry kernels based on implicit surfaces, which he argues can be written and fully understood by a single person or a small team, making them a good fit for personal-scale fabrication software.

Although Fidget could be used purely at the constructive-solid-geometry layer — primitives combined with union, intersection and difference — Halfspace deliberately puts the underlying distance fields in the foreground. Keeter illustrates why with two sawtooth-wave fields that have identical signs at every point in space: the first contains a jump discontinuity, flipping from inside to outside without ever crossing zero. Because Fidget computes normals via automatic differentiation, the normals across that boundary point the wrong way, producing visibly incorrect shading on a model cabin's shingles. Showing the field values themselves makes such problems easy to diagnose, and even suggests fixes: adjusting the sawtooth's gradient so it stays uniform can improve mesh quality downstream, even though Fidget does not require it for correctness.

Experimental by design, cross-platform by choice

Keeter is blunt that relying on Halfspace in any load-bearing capacity would be a risky decision. The project is a vehicle for iterating on software architecture, and he expects to break things aggressively along the way. At the same time, he targets both web and native platforms, arguing that in an era of supply-chain attacks, sharing a web link is far better for onboarding and casual use than asking people to compile and run your code.

The "Halfspace stack" he has assembled for combined native and web delivery is almost entirely Rust: wasm-bindgen for web builds, egui with egui_dock for the dockable GUI, wgpu for both interface rendering and GPU compute, and Rhai for scripting. Rayon and wasm-bindgen-rayon serve two roles — speeding up parallel algorithms and providing a thread pool for short-lived background tasks, since threads cannot be spawned on the web — alongside a long tail of supporting libraries. Keeter says he has complaints about every layer, but finds it remarkable that the whole combination works.

Halfspace has also driven concrete kernel improvements. The biggest so far is ongoing work on fidget-wgpu, motivated by web performance: the native build was pleasantly fast, but rasterizing on the CPU through the browser ran too slowly to keep up with interaction.

Why it matters

Halfspace is a compact demonstration of three converging ideas. First, WebGPU compute is now credible enough to put a real CAD-adjacent workload — implicit-function evaluation, rasterization and meshing — into a browser tab with nothing to install. Second, it argues for geometry kernels small enough for one person to fully understand, an alternative to the opaque boundary-representation kernels that dominate commercial CAD, and one that matters for personal fabrication and open tooling. Third, its distance-field-first authoring model treats the mathematical representation not as a hidden implementation detail but as something the user can inspect and debug, closer to how programmers examine intermediate values than to how most CAD tools expose geometry. As an experiment its interfaces may not survive, but the demo alone makes the case.

  • #cad
  • #webgpu
  • #rust
  • #graphics
  • #3d-modeling

Related posts