feat: STL export (STLOUT / EXPORTSTL command)

Exports all tessellated 3D mesh models in the current drawing to a
binary STL file via a save-file dialog. Normals are taken from the
MeshModel where available, otherwise computed from triangle vertices.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-04-08 00:46:05 +03:00
commit 25b91bc09e
6 changed files with 145 additions and 1 deletions

View file

@ -435,6 +435,11 @@ pub enum Message {
DataExtractionSave(String),
/// Path chosen (or None = cancelled).
DataExtractionSaveResult(String, Option<std::path::PathBuf>),
// ── STL export ────────────────────────────────────────────────────────
/// Trigger STL export: collect meshes and show save dialog.
StlExport,
/// Callback after the user picks (or cancels) the STL save path.
StlExportPath(Option<std::path::PathBuf>),
}
impl H7CAD {