LUMBER STACK GENERATOR – OPENSCAD SCRIPT VERSION 3 WHAT THIS IS This is a fully parametric OpenSCAD script that generates realistic 3D models of stacked lumber for model railroads and dioramas. The script simulates real sawmill stacking practices, including: - Layered dimensional lumber - Cross-wise "stickers" between layers - Hand-stacked randomness - Optional simulated wood grain - Optional hollow interior to reduce print time and material usage - Separate removable top "cap" for large hollow stacks The stack can be generated in HO (1:87), O (1:48), or N (1:160) scale. WHAT IS OPENSCAD? OpenSCAD is a free, open-source, script-based 3D modeling program. Instead of drawing shapes manually, you define models using code and adjustable parameters. This makes it ideal for creating fully parametric designs that can be easily resized, customized, and regenerated. OpenSCAD is available for Windows, Mac, and Linux. Download it here: https://openscad.org/ WHAT ARE "STICKERS"? In lumber stacking, "stickers" are the small boards placed crosswise between each layer of lumber. Their purpose is to: - Create air gaps between layers - Allow proper airflow - Help the lumber dry evenly In this model, stickers are automatically generated between layers at adjustable spacing and size. HOW TO USE 1. Install OpenSCAD. 2. Open the .scad file. 3. Open the "Customizer" panel (right side of the screen). 4. Adjust parameters as desired. 5. Press F6 to render. 6. Export as STL. 7. Slice and print. PARAMETER OVERVIEW BASIC PARAMETERS MODEL_SCALE Select modeling scale. Options: HO, O, N BOARD DIMENSIONS BOARD_THICKNESS_IN Thickness of each board (real-world inches). BOARD_WIDTH_IN Width of each board (real-world inches). BOARD_LENGTH_FT Length of each board (real-world feet). Example: 2 x 6 x 12 lumber is entered as: 2 (thickness) 6 (width) 12 (feet) STACK SIZE BOARDS_PER_LAYER Number of boards placed side-by-side in each layer. BOARD_LAYERS Total number of board layers in the stack. These determine overall stack width and height. STICKER SIZE STICKER_HEIGHT_IN Sticker thickness (real inches). STICKER_WIDTH_IN Sticker width (real inches). STICKER_OVERHANG_IN How far stickers extend past the stack on each side (real inches). STICKER_SPACING_IN Distance between stickers along the board length (real inches). STICKER_END_MARGIN_IN Distance from each end of the stack to the first sticker (real inches). HOLLOW MODE (BASIC TOGGLE) HOLLOW Enables hollow interior mode for large stacks to reduce material usage and print time. When enabled: - The interior is structurally hollowed while maintaining realistic outer boards. - A separate top "cap" is generated to complete the stack. HAND STACKING PARAMETERS RANDOM_SEED Change this number to generate a different layout. BOARD_END_OVERHANG_IN Maximum allowed overhang at board ends (real inches). BOARD VARIATION (MODEL MM) BOARD_JITTER_X_MM Side-to-side offset variation. BOARD_JITTER_Y_MM Lengthwise offset variation. BOARD_JITTER_Z_MM Small vertical variation. BOARD_ROT_DEG Small rotation variation (degrees). STICKER VARIATION STICKER_JITTER_X_MM Side-to-side variation. STICKER_JITTER_Y_MM Lengthwise variation. STICKER_SPACING_JITTER_IN Random variation in sticker spacing (real inches). WOOD GRAIN PARAMETERS ENABLE_GRAIN Turn wood grain on or off. GRAIN_DEPTH_MM Depth of engraved grain. (0.03 to 0.10 for resin, 0.08 to 0.15 for FDM) GRAIN_LINE_WIDTH_MM Width of each grain groove. GRAIN_LINES_PER_BOARD Number of grain lines per board. GRAIN_WIGGLE_MM Amount of sideways grain variation. GRAIN_MARGIN_MM Distance from board edges where grain will not appear. HOLLOWING PARAMETERS HOLLOW_MIN_WIDTH_BOARDS Minimum boards per layer before hollowing activates. HOLLOW_MIN_LAYERS Minimum layers before hollowing activates. HOLLOW_WALL_MM Thickness of internal support walls. HOLLOW_FULL_BOTTOM_LAYERS Number of fully solid layers at bottom. HOLLOW_FULL_TOP_LAYERS Number of fully solid layers printed separately as a cap. STICKER_BOX_OVERLAP_MM How much sticker ends overlap internal support walls. ADVANCED PARAMETERS FUSE_EPS_MM Small overlap value to ensure solids fuse properly. ADD_FUSION_SLAB Adds a thin slab under the base to help prevent non-manifold warnings. FUSION_SLAB_THICKNESS_MM Thickness of the fusion slab. FUSION_SLAB_INSET_MM Inset amount so slab does not protrude past edges. BOARD_GAP_MM Small visible gap between adjacent boards. EDGE_RADIUS_MM Radius used to soften board edges. $FN Curve smoothness. INCLUDE_TOP_STICKERS Adds stickers above the top layer. STICKERS_ARE_CUBES When true, stickers render as cubes (faster rendering). When false, stickers have rounded edges (slower render). PRINTING NOTES - Hollow mode significantly reduces material usage. - Wood grain is subtle. Dry brushing and washes enhance realism. - The top "cap" is designed to blend seamlessly with the hollow base. - Print directly on the bed with no supports and no brim - I use an Ender Pro 3 with the following settings: - 0.4 nozzel - Layer Height - 0.16 - 10% infill VERSION HISTORY VERSION 3 - Added hollow stack mode with structural internal box - Added separate printable top cap - Added simulated wood grain - Improved rendering performance - Improved manifold reliability - Added Customizer organization