Skip to content

Refactor code structure for improved readability and maintainability - #108

Merged
devaraj3 merged 1 commit into
mainfrom
feat/explode-view
Aug 27, 2026
Merged

Refactor code structure for improved readability and maintainability#108
devaraj3 merged 1 commit into
mainfrom
feat/explode-view

Conversation

@devaraj3

Copy link
Copy Markdown
Owner

Add Explode View for assembly files

Assembly parts explode along geometry-derived axes with a computed
disassembly order, rather than a naive radial spread.

How it works

  • Per-part exit axis: dominant cylinder axis for fastener-like parts,
    principal axis for body parts (bores excluded — a hole is where another
    part passes through, not an exit path), radial fallback otherwise
  • Disassembly order from a dependency graph: swept-bounding-box blocking
    plus interlock constraints derived from hole-occupancy (a part with
    something through its bore can't move until that part is out)
  • Headed-fastener detection forces head-first exit
  • Staged animation — parts move in dependency order, not simultaneously

UI

Toggle, 0–100% slider, Play/Reverse with correct enable/disable states.
Explode state resets on file change and the control is hidden for
non-assemblies.

Known limitations

Automatic ordering is reliable on simple mechanical assemblies (Knuckle
Joint: 5/5 clean) and degrades on denser ones (Stuffing Box: 7/13;
22-part sheet-metal enclosure: 6/22, where mutual blocking between bolts
and large panels cascades into cycle-fallback).

A manual override system (stage reorder, axis override, direction flip)
is implemented and verified but hidden behind
SHOW_EXPLODE_MANUAL_OVERRIDE_UI = false, pending an attempt at
contact-based direction derivation. If that doesn't improve on this
baseline, override should be re-enabled before this reaches users.

@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cad-viewer Ready Ready Preview Aug 27, 2026 6:02am

@devaraj3
devaraj3 merged commit aba62f9 into main Aug 27, 2026
6 checks passed
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.

1 participant