1#![forbid(unsafe_code)]
2pub const UPDATED: &str = "2026-11-16";
22
23pub const RAW_JSON: &str = include_str!("../data/decks.json");
25
26pub const PRINT_DPI: u32 = 300;
28
29pub const BOLT_HOLE_COUNT: u8 = 8;
31
32pub static PRINT_FILES_INCLUDED: &[&str] = &["full-bleed-deck-png", "cut-outline-deck-png", "grip-tape-print-png"];
34
35#[derive(Debug, Clone, Copy, PartialEq)]
37pub struct DeckShape {
38 pub id: &'static str,
39 pub category: &'static str,
40 pub model: &'static str,
41 pub width_in: f64,
42 pub length_in: f64,
43 pub truck_axle: &'static str,
44 pub rider_use: &'static str,
45}
46
47pub static DECKS: &[DeckShape] = &[
49 DeckShape {
50 id: "popsicle-7-25",
51 category: "Popsicle",
52 model: "7.25\" Mini / Kids",
53 width_in: 7.27,
54 length_in: 29.8,
55 truck_axle: "7.25\"",
56 rider_use: "Kids and micro street",
57 },
58 DeckShape {
59 id: "popsicle-7-5",
60 category: "Popsicle",
61 model: "7.5\"",
62 width_in: 7.45,
63 length_in: 31.3,
64 truck_axle: "7.6\"",
65 rider_use: "Youth technical street",
66 },
67 DeckShape {
68 id: "popsicle-7-625",
69 category: "Popsicle",
70 model: "7.625\"",
71 width_in: 7.64,
72 length_in: 31.6,
73 truck_axle: "7.6\"",
74 rider_use: "Compact technical flip tricks",
75 },
76 DeckShape {
77 id: "popsicle-7-75",
78 category: "Popsicle",
79 model: "7.75\"",
80 width_in: 7.76,
81 length_in: 31.7,
82 truck_axle: "7.75\"",
83 rider_use: "Classic narrow street",
84 },
85 DeckShape {
86 id: "popsicle-7-875",
87 category: "Popsicle",
88 model: "7.875\"",
89 width_in: 7.8,
90 length_in: 31.9,
91 truck_axle: "7.75\" to 8.0\"",
92 rider_use: "Light street and ledges",
93 },
94 DeckShape {
95 id: "popsicle-8-0",
96 category: "Popsicle",
97 model: "8.0\"",
98 width_in: 8.01,
99 length_in: 32.3,
100 truck_axle: "8.0\"",
101 rider_use: "All-around street standard",
102 },
103 DeckShape {
104 id: "popsicle-8-25",
105 category: "Popsicle",
106 model: "8.25\"",
107 width_in: 8.28,
108 length_in: 32.6,
109 truck_axle: "8.25\"",
110 rider_use: "Street, park and wall art",
111 },
112 DeckShape {
113 id: "popsicle-8-5",
114 category: "Popsicle",
115 model: "8.5\"",
116 width_in: 8.45,
117 length_in: 33.0,
118 truck_axle: "8.5\"",
119 rider_use: "Transition, bowls and wide street",
120 },
121 DeckShape {
122 id: "popsicle-8-75",
123 category: "Popsicle",
124 model: "8.75\"",
125 width_in: 8.77,
126 length_in: 33.1,
127 truck_axle: "8.75\"",
128 rider_use: "Pools, ramps and cruising",
129 },
130 DeckShape {
131 id: "popsicle-9-0",
132 category: "Popsicle",
133 model: "9.0\"",
134 width_in: 9.01,
135 length_in: 34.0,
136 truck_axle: "9.0\"",
137 rider_use: "Vert, big bowls and wall sets",
138 },
139 DeckShape {
140 id: "popsicle-9-25",
141 category: "Popsicle",
142 model: "9.25\"",
143 width_in: 9.25,
144 length_in: 34.2,
145 truck_axle: "9.0\" to 9.25\"",
146 rider_use: "Wide pool and curb skating",
147 },
148 DeckShape {
149 id: "popsicle-9-5",
150 category: "Popsicle",
151 model: "9.5\"",
152 width_in: 9.5,
153 length_in: 34.4,
154 truck_axle: "9.5\"",
155 rider_use: "Extra-wide transition and display",
156 },
157 DeckShape {
158 id: "twin-tail",
159 category: "Shaped",
160 model: "Twin Tail 8.375\"",
161 width_in: 8.32,
162 length_in: 32.1,
163 truck_axle: "8.375\"",
164 rider_use: "True symmetrical switch street",
165 },
166 DeckShape {
167 id: "square-nose",
168 category: "Shaped",
169 model: "Square Nose",
170 width_in: 8.69,
171 length_in: 33.0,
172 truck_axle: "8.5\" to 8.75\"",
173 rider_use: "Slappy curbs and park",
174 },
175 DeckShape {
176 id: "bottle-tail",
177 category: "Shaped",
178 model: "Bottle Tail",
179 width_in: 8.01,
180 length_in: 31.5,
181 truck_axle: "8.0\" to 8.25\"",
182 rider_use: "Shaped street and cruiser",
183 },
184 DeckShape {
185 id: "egg",
186 category: "Shaped",
187 model: "Egg",
188 width_in: 9.68,
189 length_in: 32.6,
190 truck_axle: "8.75\" to 9.125\"",
191 rider_use: "Wide center with quick flip taper",
192 },
193 DeckShape {
194 id: "football",
195 category: "Shaped",
196 model: "Football",
197 width_in: 8.93,
198 length_in: 32.1,
199 truck_axle: "8.5\" to 8.75\"",
200 rider_use: "Tapered nose and tail transition",
201 },
202 DeckShape {
203 id: "retro-rocket",
204 category: "Shaped",
205 model: "Retro Rocket",
206 width_in: 8.51,
207 length_in: 31.9,
208 truck_axle: "8.5\"",
209 rider_use: "80s inspired park and ditch",
210 },
211 DeckShape {
212 id: "sledge",
213 category: "Shaped",
214 model: "Sledge",
215 width_in: 9.05,
216 length_in: 32.5,
217 truck_axle: "9.0\"",
218 rider_use: "Heavy pool and coping",
219 },
220 DeckShape {
221 id: "junior-sledge",
222 category: "Shaped",
223 model: "Junior Sledge",
224 width_in: 7.64,
225 length_in: 28.0,
226 truck_axle: "7.6\"",
227 rider_use: "Mid-size shaped park",
228 },
229 DeckShape {
230 id: "punk-nose",
231 category: "Shaped",
232 model: "Punk Nose (Pool)",
233 width_in: 9.13,
234 length_in: 33.3,
235 truck_axle: "9.0\"",
236 rider_use: "Deep pool riding",
237 },
238 DeckShape {
239 id: "old-school",
240 category: "Shaped",
241 model: "Old School",
242 width_in: 9.89,
243 length_in: 29.4,
244 truck_axle: "9.0\" to 10.0\"",
245 rider_use: "80s vert, bowl and collector art",
246 },
247 DeckShape {
248 id: "shredder",
249 category: "Shaped",
250 model: "Shredder",
251 width_in: 9.92,
252 length_in: 30.5,
253 truck_axle: "9.0\" to 9.5\"",
254 rider_use: "Directional park and bowl",
255 },
256 DeckShape {
257 id: "fish-tail",
258 category: "Shaped",
259 model: "Fish Tail",
260 width_in: 9.59,
261 length_in: 30.0,
262 truck_axle: "8.75\" to 9.125\"",
263 rider_use: "Boardwalk cruiser and surf style",
264 },
265 DeckShape {
266 id: "cruiser",
267 category: "Cruiser",
268 model: "Cruiser",
269 width_in: 7.88,
270 length_in: 29.3,
271 truck_axle: "8.0\"",
272 rider_use: "Daily city commuting with soft wheels",
273 },
274 DeckShape {
275 id: "mini-cruiser",
276 category: "Cruiser",
277 model: "Mini Cruiser",
278 width_in: 7.45,
279 length_in: 24.3,
280 truck_axle: "7.25\" to 7.6\"",
281 rider_use: "Backpack commuter board",
282 },
283 DeckShape {
284 id: "surfskate-swallowtail",
285 category: "Surfskate",
286 model: "Swallowtail",
287 width_in: 10.25,
288 length_in: 30.0,
289 truck_axle: "9.0\" surf truck",
290 rider_use: "Carving and surf training",
291 },
292 DeckShape {
293 id: "surfskate-squash",
294 category: "Surfskate",
295 model: "Squash Tail",
296 width_in: 10.0,
297 length_in: 31.0,
298 truck_axle: "9.0\" surf truck",
299 rider_use: "Bowl snaps and tight carves",
300 },
301 DeckShape {
302 id: "pintail",
303 category: "Longboard",
304 model: "Pintail",
305 width_in: 9.13,
306 length_in: 39.0,
307 truck_axle: "180mm RKP",
308 rider_use: "Classic carving longboard",
309 },
310 DeckShape {
311 id: "kicktail-longboard",
312 category: "Longboard",
313 model: "Kicktail",
314 width_in: 9.13,
315 length_in: 39.0,
316 truck_axle: "180mm RKP",
317 rider_use: "Freestyle and campus cruising",
318 },
319 DeckShape {
320 id: "drop-through",
321 category: "Longboard",
322 model: "Drop Through",
323 width_in: 9.05,
324 length_in: 36.3,
325 truck_axle: "180mm RKP",
326 rider_use: "Low-push distance and freeride",
327 },
328 DeckShape {
329 id: "drop-down",
330 category: "Longboard",
331 model: "Drop Down",
332 width_in: 9.6,
333 length_in: 38.0,
334 truck_axle: "180mm RKP",
335 rider_use: "Stable downhill and pushing",
336 },
337 DeckShape {
338 id: "dancer",
339 category: "Longboard",
340 model: "Dancer",
341 width_in: 10.0,
342 length_in: 46.0,
343 truck_axle: "180mm RKP",
344 rider_use: "Cross-stepping and board dancing",
345 }
346];
347
348fn norm(input: &str) -> String {
349 input
350 .chars()
351 .filter(|c| c.is_ascii_alphanumeric() || *c == '.')
352 .map(|c| c.to_ascii_lowercase())
353 .collect()
354}
355
356pub fn find_deck(query: &str) -> Option<&'static DeckShape> {
358 let q = norm(query);
359 if q.is_empty() {
360 return None;
361 }
362 for deck in DECKS {
363 if norm(deck.id) == q || norm(deck.model) == q {
364 return Some(deck);
365 }
366 }
367 for deck in DECKS {
368 if norm(deck.model).contains(&q) || norm(deck.id).contains(&q) {
369 return Some(deck);
370 }
371 }
372 None
373}
374
375pub fn by_category(category: &str) -> Vec<&'static DeckShape> {
377 let c = norm(category);
378 DECKS.iter().filter(|d| norm(d.category) == c).collect()
379}
380
381pub fn decks_near_width(width_in: f64, tolerance_in: f64) -> Vec<&'static DeckShape> {
383 if !width_in.is_finite() || !tolerance_in.is_finite() || tolerance_in < 0.0 {
384 return Vec::new();
385 }
386 DECKS
387 .iter()
388 .filter(|d| (d.width_in - width_in).abs() <= tolerance_in)
389 .collect()
390}
391
392#[cfg(test)]
393mod tests {
394 use super::*;
395
396 #[test]
397 fn resolves_decks_and_width_ranges() {
398 let d = find_deck("8.25\"").expect("8.25 deck");
399 assert_eq!(d.id, "popsicle-8-25");
400 let near = decks_near_width(8.5, 0.1);
401 assert_eq!(near.len(), 2);
402 assert_eq!(by_category("Longboard").len(), 5);
403 assert!(RAW_JSON.contains("popsicle-8-25"));
404 }
405}