Commit Graph
2 Commits
Author SHA1 Message Date
kodin00 d13b8f505e dev: configurable bind address for dev-server (--host)
Add a --host option to both dev-server.py entry points so the dev
server can be reached from other devices on the LAN (e.g. a headless
Raspberry Pi behind a firewall). Default stays 127.0.0.1 (localhost);
pass --host 0.0.0.0 (or ::) to expose it. When bound to a wildcard,
the script also prints the machine's LAN address to open.

Both scripts move to argparse, so --help documents the options and bad
input errors cleanly instead of tracebacking. The positional [port] is
unchanged for backwards compatibility (python3 dev-server.py 8080).

web/dev-server.py previously bound "" (all interfaces) by default; it
now defaults to 127.0.0.1 to match the safe-by-default principle and
the other entry point. Use --host 0.0.0.0 for the old behavior.

stdout is flushed before serve_forever() so the startup lines (and the
LAN hint) land immediately in a redirected log.

README documents the new option.
2026-09-22 13:07:02 +07:00
matthewtrahan 7e00ef4c5f Rotate the part, with the analysis following live (M2)
The user rotates; the tool only ever suggests. Adds a rotate gizmo snapping to
15 degrees, 90-degree buttons per world axis, reset, and click-a-face-to-lay-it-
on-the-plate, which is how people actually think about orientation and is much
faster than hunting for the pose on the rings.

Orientation is applied as a transform and never baked into the geometry, so a
hundred rotations accumulate no float error and the original file is always
recoverable. analyze() now takes a rotation matrix, re-seats the part on the
plate from the rotated bounds it already computes, and reports the rotated size.

This is cheap for a reason worth stating: vertex welding and face adjacency are
rotation-invariant, since turning a part cannot change which triangles touch. A
rotation therefore re-runs only the linear classify pass at 1-6ms, never the weld
at 28-119ms, which is what lets the readout track a live drag.

The readout now shows the whole problem the tool exists to solve. Standing a
Voron plate on edge takes it from 265mm2 of overhang and 3110mm2 of bed contact
to 1310mm2 and 73mm2 -- stronger layer orientation, but unprintable without help,
which is exactly why people print flat. Bed contact near zero turns amber, since
a tilted part resting on an edge is the case that requires a bed pad.

Adds dev-server.py because python3 -m http.server sends no Cache-Control and
browsers heuristically cache ES modules; editing a module and reloading then runs
the old code and looks exactly like a logic bug. Also fixes hidden panels showing
through: an author display rule outranks the UA stylesheet's [hidden] rule.
2026-07-24 21:05:15 -05:00