Skip to main content
The kernel keeps the document’s history. A mark is a point in that history that you can go back to.

Marks

After rollback, the box is back at the origin and extra is gone from the document.
  • rollback() takes the document back to the mark: shapes, placements, the tree, and bodies made or disposed after it. The mark stays live, so you can roll back to it again. Later marks are released.
  • release() ends the mark. Release every mark that you no longer need: a live mark keeps old revisions in memory.
  • A released mark throws InvalidMark.
  • OpenGeometry.markStats() returns { liveMarks, retainedRevisions }.
A body that is disposed while a mark is live is hidden, not freed, so a rollback can bring it back. It is freed when no mark can bring it back.

Transactions

OpenGeometry.transaction(fn) runs fn between a mark and its release. If fn throws, it rolls back first, then throws again:
The rebuild throws InvalidParameter, so the subtraction is rolled back too.
  • fn must be synchronous. A function that returns a promise throws InvalidParameter.
  • { dryRun: true } always rolls back. Use it to test whether a group of edits works, and to read values on the way.
Last modified on November 10, 2026