Skip to content

feat: Constraint debug overlay (WIP)#46

Draft
ladvoc wants to merge 12 commits into
mainfrom
ladvoc/constraint-debug
Draft

feat: Constraint debug overlay (WIP)#46
ladvoc wants to merge 12 commits into
mainfrom
ladvoc/constraint-debug

Conversation

@ladvoc

@ladvoc ladvoc commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator

Adds a constraint debug overlay modeled after DCEL debug overlay.

Screenshot 2026-06-08 at 8 13 04 AM

Comment on lines +129 to +131
// Stable key vertices used for endpoint resolution and inferred constraints.
// Unlike vertexIds, this does not receive inserted split vertices.
constraintVertexIds: ConstraintVertexIds;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh, very nice - this will also really come in handy in reconstrain, and I think allow for some latent bugs to be fixed in there in the vertex id -> sheet position mapping step!

Comment thread src/lib/sheet/Sheet.ts
Comment on lines 69 to +74
this.dcelDebugView = globalThis?.localStorage
? globalThis?.localStorage.getItem('cad2d-dcel-debug-view') === 'true'
: false;
this.constraintDebugView = globalThis?.localStorage
? globalThis?.localStorage.getItem('cad2d-constraint-debug-view') === 'true'
: false;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW - you maybe have come across this already but it but next.js really doesn't like this whole localStorage lookup pattern like this when server rendering. Honestly I really would like to just disable server rendering all together, I don't see it ever being important for this app. I think keeping this consistent for now with what already exists is good but if you have any better ideas here let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants