1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
//! A design's printable cutting sequence as a single self-contained HTML string.
//!
//! Printable HTML, no new dependency, prints straight from the browser -- and the
//! standalone 2D faceting diagram (PNG bytes) that shares its rendering pipeline.
//!
//! Everything here is a pure function of `&Design` + `&[SolvedTier]` (+ the caller's
//! [`SheetDetails`]): [`render_cut_diagram`] and [`render_cut_views`] (mesh ->
//! `indicatrix_solid::diagram2d` raster -> PNG bytes in memory) and
//! [`cutting_sheet_document_with`] (the views plus [`SheetLayout`], built from
//! [`indicatrix_cut_core::Design::cutting_sheet`]'s own rows -> one HTML string).
//! Nothing touches a file system, dialog or clock: the desktop writes the bytes to
//! a picked path, the web app hands them to a browser download, and the export date
//! is text the caller supplies.
//!
//! # Layout
//!
//! The printed sheet follows the owner's fantasy-cut template: header, Facet Data, Size
//! Data, Design Data, four views, comments, then a Pavilion and a Crown section. The
//! counts, ratios and rows are computed once in [`SheetLayout`]; the HTML and the text
//! sheet are both written from it.
//!
//! # Pavilion/Crown sections
//!
//! A row's section comes from the solver's own `classify_blocks`
//! (`design.meet_tier_inputs()` in, one `Block` per tier out, aligned with the cutting
//! sheet's one-row-per-tier order) -- never derived from the sign of a formatted angle
//! string. The girdle rows are part of the Pavilion section.
//!
//! # Model-unit vs. mm masts
//!
//! The "Mast (mm)" column only appears when
//! [`indicatrix_cut_core::Design::girdle_diameter_mm`] is set -- not when the mm
//! conversion actually resolves. A design with a stated girdle diameter that
//! currently fails to close still shows the column, with `"-"` cells, rather than
//! silently reverting to a model-units-only sheet.
pub use ;
pub use ;
pub use ;
pub use ;
/// Three-panel diagram resolution of the standalone [`render_cut_diagram`] embed.
///
/// The printed sheet itself no longer embeds this picture: it shows the four views of
/// [`SHEET_VIEW_WIDTH`] x [`SHEET_VIEW_HEIGHT`].
pub const SHEET_DIAGRAM_WIDTH: u32 = 900;
/// See [`SHEET_DIAGRAM_WIDTH`].
pub const SHEET_DIAGRAM_HEIGHT: u32 = 360;
/// Resolution of each of the four views on a printed cutting sheet.
///
/// Two views per row on A4, so each prints about 90 mm wide at roughly 160 dpi, while the
/// four `data:` URIs together keep the HTML file a few hundred KB.
pub const SHEET_VIEW_WIDTH: u32 = 560;
/// See [`SHEET_VIEW_WIDTH`].
pub const SHEET_VIEW_HEIGHT: u32 = 440;
/// The standalone diagram export's resolution -- print-quality (roughly 150 DPI at
/// A4 landscape width) rather than the cutting sheet's own smaller embed.
pub const DIAGRAM_EXPORT_WIDTH: u32 = 1800;
/// See [`DIAGRAM_EXPORT_WIDTH`].
pub const DIAGRAM_EXPORT_HEIGHT: u32 = 720;
/// The complete cutting instructions as the HTML string a caller writes or downloads.
///
/// With the four views when the design currently closes, and the header words from
/// [`SheetDetails::from_design`]: exactly [`cutting_sheet_document_with`] with those details.
/// `custom` is threaded through to the printed refractive index.
///
/// # Panics
///
/// Same alignment contract as [`indicatrix_cut_core::Design::cutting_sheet`]:
/// `solved` must have one entry per tier `design` currently has, in the same order.
/// [`cutting_sheet_document`] with explicit header `details` (title, author, date, shape,
/// comments, ranges). Pure: it reads no clock, so the date is whatever `details.date_text`
/// says.
///
/// # Panics
///
/// Same alignment contract as [`cutting_sheet_document`].
/// The cutting instructions as plain text, under plain headings.
///
/// The blocks are the HTML sheet's (header, Facet Data, Size Data, Design Data, comments,
/// Pavilion, Crown). The four views are pictures and appear only in the HTML.
///
/// # Panics
///
/// Same alignment contract as [`cutting_sheet_document`].
/// The standalone diagram export: the 2D diagram alone at print resolution
/// ([`DIAGRAM_EXPORT_WIDTH`] x [`DIAGRAM_EXPORT_HEIGHT`]), PNG-encoded.
///
/// # Errors
///
/// When `design` does not currently close to a solid (nothing to diagram -- named
/// explicitly rather than silently producing a blank/stale image).