This page is for architects, designers, makers, writers and anyone curious about what this kernel is, what it is for and how it goes about its work. It uses no code. If you want to build on it, the developer guides start where this page stops.
The Commonplace kernel is a modeling kernel for architecture based on paper surfaces. It describes buildings and objects made the way most buildings are actually made: from material that arrives flat. Plywood, steel plate, sheet metal, glass, card and the boards of concrete formwork can be bent in one direction at a time but cannot stretch, and the kernel's surfaces follow the same rule. Every such surface can be laid back out flat, exactly, as a pattern to cut.
Four ideas run through everything below:
It is free and open source, written in TypeScript, and runs in a web browser or in Node, with no native code and no server of its own.
Every 3D design program has two halves. The half you see is the interface: the tools, the cursor, the snapping, the panels, the rendered view. The half you don't see keeps the model itself: which faces exist, which edges bound them, which faces touch, what is inside a solid and what is outside, and what happens to all of that when you cut a hole or pull a face out by a meter.
That second half is the kernel. It answers questions like "if I subtract this box from that wall, what is left?" and "is this shape a closed solid?", and it refuses to do anything that would leave the model broken. A kernel has no screen of its own. Someone builds a design tool, a viewer, a fabrication script or a configurator on top of it.
A small number of kernels sit under most of the world's design software, and nearly all of them were built for mechanical engineering: machined parts, castings, fillets between curved faces. This one was built for a different job, and the rest of this page is about what that job asks of a kernel.
A curved plywood wall, a rolled steel canopy, a folded metal stair, a glass facade, a concrete shell poured against bent formwork: each one starts as a sheet, and the sheet can bend in one direction at a time but cannot stretch. Paper behaves the same way, which is where the name comes from. Roll a sheet of paper into a tube or a cone and it works. Try to wrap it over a ball and it wrinkles.
The surfaces a builder meets fall into three families:
The kernel's tools make surfaces from these families, and every face knows which family it belongs to. That one fact drives much of what follows: whether a face can be cut from one sheet, how it lays flat, and what happens to it when it is cut, thickened or folded. When a form a designer wants belongs to none of them, as most forms don't, the families become the materials for building it, in one of four ways.
Many modelers that show a curved wall actually store a polygon: a cylinder becomes a ring of 24 or 48 thin flat strips. That is fine for a picture and poor for building. A cutting pattern taken from the facets is only roughly the shape of the real panel, measurements drift, and two curved parts never quite meet.
This kernel keeps each curved face as the true surface: a cylinder is a cylinder, with its axis and radius. The triangles you see on screen are drawn from that surface for display only. Measuring, picking a point, cutting and unrolling all read the surface itself. So when the kernel unrolls a conical lampshade, the result is a true sector of a ring, with every length on the page equal to the length on the shade.
In everyday terms, a tool built on the kernel can:
Each of these keeps a face in its family where it can: a sheet pushed to a thickness is still paper on both sides, and a window cut through a curved panel leaves faces that still unroll exactly. Where an edit would carry a face out of its family, the kernel either changes the face to the family it now belongs to and says so, or refuses.
Few designed forms are a single flat sheet or a single cylinder. A dome, a wave, a twisted tower or a faceted shell has to be built somehow from material that arrives flat, and deciding how is one of the central decisions in designing it. Builders have four main answers, and a single design often uses several:
| Way | How it works | What is exact | What is given up |
|---|---|---|---|
| Bend | Panels bent from flat sheet, each a developable surface. | Every panel unrolls exactly. | Only forms that curve one way at a time. |
| Rule | Surfaces swept by straight lines, built from straight boards, sections or cables. | The surface, and every straight line on it. | The surface cannot be cut from one sheet. |
| Fold | The form broken into flat facets joined at creases. | Every facet is flat; every crease is a straight hinge. | The form is approximated by its facets. |
| Strip | A surface that cannot unroll cut into narrow strips that nearly do. | The strips' outlines and the stretch they need. | Each strip stretches a little; the kernel says how much. |
The kernel supports each of these, keeps track of which one a face uses, and lays the result of any of them out flat as a pattern to cut. The next four sections take them in turn.
Bending is the most direct way: the panel is the sheet, curved. The kernel makes developable faces in several ways. A curve swept along a straight direction makes a general cylinder; swept toward a point, a general cone; the lines tangent to a curve in space sweep out a third kind of developable, a tangent surface, which is how a canopy blade or a twisting ribbon can still be cut from flat stock. A profile of straight lines turned about an axis makes cylinders, cones and flat rings, as on a lathe.
Bent panels stay paper through the edits that follow. A sheet pushed to a thickness keeps its far side the exact offset of the near one, with ruled walls between, so both sides still unroll. A window cut through a curved wall leaves faces on the wall's own surfaces, and the wall's pattern comes out with the hole in place. A curved face that an edit would twist into something that cannot develop is refused unless the twist is asked for.
Some forms cannot be bent from sheet but can still be built from straight pieces. Take a flat rectangle and lift one corner. The four edges stay straight, but the surface between them can no longer be flat: it becomes a saddle. That saddle is a hyperbolic paraboloid, a hypar, and it is the best-known ruled surface that is not a paper surface.
A hypar is ruled twice over. Through every point on it run two straight lines that lie wholly in the surface, one from each family, so it can be built from straight members in either direction: straight boards of formwork, straight steel sections, a net of straight cables. That is why architects have used it for most of a century, from Félix Candela's thin concrete shells in Mexico to timber roofs and folded-plate canopies. What it cannot be is bent from one flat sheet. Lay a sheet of card over a hypar and it will not sit down without stretching or creasing.
The kernel treats the hypar as a face in its own right, and keeps both of its truths, ruled and not developable, in view:
A hypar has four sides, but faces in a building rarely stop at four. How the kernel treats a face depends on how many edges bound it and what it is asked to do:
Folding builds a form from flat facets. A folded-plate roof, a faceted shell, a folded steel stair and a pleated screen are all one sheet, or a few, broken along straight creases, so every piece stays flat while the whole takes on depth and stiffness. Curved forms can be approached the same way, by finer and finer facets, or folded directly along a curved crease.
Folding paper is an old craft in China and Japan, and origami, its Japanese form, is where much of the modern mathematics of folding comes from. Toshikazu Kawasaki and Jun Maekawa each found a rule that every point where creases meet must obey for the sheet to fold flat. Kōryō Miura's fold, the Miura-ori, packs a sheet into a pattern of parallelograms that opens and closes in one motion and has been used to deploy solar panels in space. Tomohiro Tachi worked out how to simulate folding with rigid panels, and Jun Mitani how to fold along curves. Erik Demaine and Joseph O'Rourke's Geometric Folding Algorithms (2007) gathered the field's results in one book, and Marshall Bern and Barry Hayes proved in 1996 that deciding whether an arbitrary crease pattern folds flat is, in general, intractable.
The kernel treats a folded sheet as one sheet of paper, with every panel flat and every crease a hinge. Folding also connects to the other ways: a flat face pushed out of plane can crease into flat pieces instead of twisting into a hypar, and every solid can be unfolded into a net and folded back up. What it does today:
What it does not do yet: sheets with more than one curved crease, and design methods such as tree-based crease design, fold-and-cut, and folding a crease pattern to cover a given 3D shape are not built. The thickness model handles folds that do not stack many layers at one point; flat-folding thick material with many layers at a vertex is a later step.
Every part made from sheet begins as a pattern on a flat sheet, whichever of the ways above shaped it, and working out that pattern is old craft. Philibert de l'Orme's Le premier tome de l'architecture (1567) shows how to cut the stones of a trompe, a conical vault in a corner, from templates traced off the unrolled cone. Albrecht Dürer's Underweysung der Messung (1525) was the first printed book to show solids unfolded into nets, flat patterns you cut out and fold up. The kernel does the same work, exactly and on any shape:
Exact surfaces and exact patterns are only as good as the arithmetic underneath them. A computer stores a number such as a coordinate as a binary fraction with about sixteen significant digits (a "floating-point" number), and almost every calculation rounds its result in the last digit. Two routes to the same corner can land a few billionths apart, and a face meant to be perfectly flat can end up a hair out of plane after it is rotated. Every modeling kernel has to settle two questions because of this: when are two nearly equal things the same thing, and how does it make yes-or-no decisions (is this point above the plane or below it?) when the numbers are slightly blurred?
The kernels behind most mechanical CAD answer the first question with fixed tolerances, set in model units. Their published defaults:
resabs, 10⁻⁶ of a unit by default, and sets a second
value, resnor, 10⁻¹⁰, as the ratio of the smallest meaningful
quantity to the largest (ACIS documentation, "Tolerance Variables").
Together they put the working range between 10⁻⁶ and 10⁴ units.Both also carry "tolerant" edges and vertices with larger tolerances of their own, to hold together geometry imported from systems that worked to a coarser precision.
This works well for what those kernels were built for: machined parts of a known range of sizes, in known units. The cost is that precision is tied to a unit and a size. A model drawn in millimeters and the same model in meters are a thousandfold apart in what counts as "the same point", and a model much larger or much smaller than the intended range runs out of room. Architecture runs from a 2 mm hinge pin to a site plan a kilometer across, often in one model.
This kernel takes two different steps, both drawn from published computational geometry rather than from CAD practice.
Tolerances are relative to size. Where the kernel's own arithmetic produces two points (two cuts meeting at a corner, say), they are the same point when they are closer than one billionth of the size of whatever is being edited, its bounding-box diagonal. Where a person draws, the band is looser: points closer than one millionth of the model's size join, a setting the tool built on the kernel can adjust. Either way, the hinge pin and the site plan get the same relative precision, and units do not matter: the kernel never needs to know whether a model is in millimeters, feet or meters. Each tolerance is tagged with what it measures. Lengths scale with the size, areas with its square, volumes with its cube, and angles and ratios (which have no size) stay fixed.
Decisions are exact. The questions that decide the shape of the model, such as which side of a plane a point is on, whether four points lie in one plane, or which way a loop turns, are answered exactly, not compared against a tolerance. The kernel uses adaptive-precision arithmetic, published by Jonathan Shewchuk in 1997 and long used in mesh generation. It first computes the answer quickly in ordinary floating point, together with a proven bound on the rounding error. When the bound shows the sign of the answer cannot be wrong, which is nearly always, it stops there. When the answer is too close to call, it recomputes it with numbers held as exact sums of floating-point parts, which carry no rounding at all, and takes that sign. A near-flat face, a point a billionth off a plane, or a model rotated by an awkward angle gets the same decision every time, instead of one that flips with the rounding.
Coordinates themselves stay ordinary floating-point numbers; only the decisions are exact. The one place approximation remains is in deciding which points are the same, and there the size-relative tolerances apply. The arithmetic the exact decisions rely on (adding, subtracting and multiplying, rounded to nearest) is fixed by the JavaScript standard, so those decisions come out the same in every browser and on every machine.
What this buys a designer: a model does not quietly tear because two faces rounded apart, the same edit gives the same result whether the model sits near the origin or a kilometer away, and when the geometry really is too close to call, the kernel refuses with a reason instead of guessing.
All of the above adds up to a short list of promises a tool built on the kernel can rely on:
The kernel is checked against these promises in layers: every tool has its own tests, and the worked examples in the main guides run as tests; a checker with a published list of rules inspects every model an edit leaves, and an edit that breaks a rule is refused; long runs of random edits every night look for the cases nobody thought to test; and public collections of CAD test files, from many sources, are read and combined to check the results hold up on real-world geometry.
Keeping those promises has a price, and today it is paid in speed. The kernel is not fast. It is fast enough to explore with: drawing, pushing faces, folding a sheet and laying it flat happen while you watch on models of the size in the testbed's examples, each of which runs in under two seconds. But heavier work is slow, and it is worth saying plainly how slow.
On the public test files the kernel is checked against, run one at a time on an ordinary four-core server, the typical case (read the file, make a few edits, check the result) takes about a fifth of a second. One in ten takes more than three seconds. The hardest, large imported mechanical parts with hundreds of curved faces, take many minutes, and a few take twenty. Combining two curved solids, such as two crossing cylinders, can take a second or more where a mature kernel answers in milliseconds.
Some of the reasons are choices, and some are simply where the work is:
Speed is the most likely thing to improve. The usual remedies are known: moving the hottest arithmetic to compiled code, running independent work in parallel, caching what an edit did not change, and replacing general solvers with direct formulas for the common surfaces. None of them changes what the kernel promises, only how long it takes to keep the promise.
STEP is the common exchange format of engineering CAD. The kernel reads and writes it for two practical reasons. Reading lets you place manufactured parts an architect buys rather than models, such as plumbing fixtures or furniture from a maker's catalog, in a model for context. Writing sends parts to fabrication, such as cabinet parts to a CNC mill. STEP is a way in and out, not the point.
The testbed runs the kernel in your browser. Each example is a short
script you can read and change, and the result is drawn beside it, with
any flat patterns laid out next to the model. It is at
https://commonplace-technologies.github.io/kernel/testbed/; open an
example by adding ?example= and its name, such as
https://commonplace-technologies.github.io/kernel/testbed/?example=trompe.
From a copy of the repository, npm run testbed:kernel starts it at
http://localhost:3310.
Each of these follows a thread of this page:
| Example | What it shows |
|---|---|
A trompe after de l'Orme (trompe) |
A conical vault in a corner, cut into stones, with each stone's template unrolled. |
Dürer's nets (durer-nets) |
Eight classical solids, each unfolded into one flat net. |
The Melencolia solid (melencolia) |
The stone in Dürer's engraving Melencolia I (1514), and its net. |
A folding screen (screen) |
One sheet, six panels, folded mountain and valley in turn. |
A turned floor lamp (lamp) |
Base, stem and shade turned from profiles, every piece unrolled flat. |
A chair in one ribbon (chair) |
A side chair bent from one strip of board, and the strip laid flat. |
A canopy blade (canopy) |
A curved blade made from a curve's tangent lines. |
A curved wall with an opening (opening) |
A window cut through a curved wall, laid flat with the hole in place. |
You can also describe a model in words and let an AI agent such as Claude build it with the kernel, look at it, and export it, with no code: see Build models with an AI agent.
The kernel is built around one question a builder asks of every surface: can it be cut from a sheet, and if so, what is the pattern? The answer shapes everything else. Surfaces belong to known families and stay exact. A shape that cannot come from one sheet, like the hypar, is still a first-class face, honestly labeled. A form is built by bending, ruling, folding or stripping, often several at once, and each is supported and laid back out flat as a pattern to cut, following masons, draftsmen and paper folders from the sixteenth century to the mathematics of origami. Underneath, size-relative tolerances and exact decisions keep the geometry sound at any scale, and every edit either succeeds completely or is refused with a reason.
What it gives up for now is speed, and some reach: sheets with several curved creases and some origami design methods are still to come, and large imported mechanical parts are slow. Those limits are stated here, and every known defect is listed in the repository with a test that shows it, so each can be checked as it closes.
I studied architecture at The Cooper Union, where George Chaikin introduced me to computational geometry. His lesson, that cutting corners always works, stayed with me: a few simple steps, done exactly and repeated, can make a smooth curve. Since then I have kept meeting the same gap. The tools designers draw with treat a surface as something to show on a screen, while the people who build it have to cut it from flat stock. This kernel is my attempt to close that gap, so that the question a builder asks, can this be cut from a sheet and what is the pattern, is part of the geometry from the first line drawn. Commonplace is, for now, just me. The kernel is open source so that others can build on it, check it and make it better.