# HG changeset patch # User ark # Date 1794915434 -3600 # Node ID 4b89f95689a8d30265c57b98e1abadde6a392e84 # Parent ac8f2ecb6c1861dd76c0ec39345c633bde70951e preview: turn the model so the front faces the default camera part_view turns the preview 90 degrees about z so the front faces -y. preview_cut now removes the +x half of the turned model, the right half seen from the front, which keeps the hinge and latch profiles in the cut face. Exports are not turned. diff -r ac8f2ecb6c18 -r 4b89f95689a8 main.scad --- a/main.scad Tue Nov 17 12:32:19 2026 +0100 +++ b/main.scad Tue Nov 17 12:37:14 2026 +0100 @@ -1,11 +1,12 @@ // hinged box with filament hinge at the back and a hinged latch in front. // sized by its inner dimensions, e.g. for standing notepad paper. // x runs front (-x) to back (+x), y left to right, z up. +// the preview turns the model 90 degrees so the front faces -y. /* [part selection] */ // part to show or export part = "all"; // [all, body, lid, latch] -// cut away the -y half in preview +// cut away the +x half in preview, the right half seen from the front preview_cut = false; // show a content mockup in each cell in the assembly view preview_content = false; @@ -521,13 +522,16 @@ if (preview_content && $preview) _content(); } +// in preview, turn the model so its front faces the default camera at -y, +// and with preview_cut remove the +x half, the right half seen from the +// front. exports stay unturned module part_view() { cut_s = max(out_x/2 + latch_front_u, top_z) + (preview_lid_angle > 0 ? out_x : 0) + 1; - if ($preview && preview_cut) + if ($preview) difference() { - children(); - translate([-cut_s, -cut_s, -cut_s]) cube([2*cut_s, cut_s, 2*cut_s]); + rotate([0, 0, 90]) children(); + if (preview_cut) translate([0, -cut_s, -cut_s]) cube([cut_s, 2*cut_s, 2*cut_s]); } else children();