$fn = 64; // --- Parameters --- stand_width = 60; // Width of the stand slot_depth = 25; // Depth of the canvas slot (fits standard canvas frames) thickness = 8; // Thickness of the walls and base lip_height = 20; // Height of the front retaining lip back_height = 110; // Total height of the backrest tilt_angle = 15; // Backward tilt angle of the canvas (degrees) min_base_length = 95; // Minimum depth of the base for stability // --- Calculations --- // Calculate the coordinates for the angled backrest L = back_height - thickness; p5_x = thickness + slot_depth; p5_y = thickness; p4_x = p5_x + L * sin(tilt_angle); p4_y = p5_y + L * cos(tilt_angle); p3_x = p4_x + thickness * cos(tilt_angle); p3_y = p4_y - thickness * sin(tilt_angle); // Ensure the base is always long enough to support the angled back base_length = max(min_base_length, p3_x + 15); // --- Geometry --- // Extruding the 2D profile. // Note: It is generated on its side, which is the optimal orientation // for 3D printing without supports and for maximum layer strength. linear_extrude(height = stand_width, convexity = 3) { polygon(points=[ [0, 0], // Bottom front [base_length, 0], // Bottom back [base_length, thickness], // Top back of base [p3_x, p3_y], // Top back of backrest [p4_x, p4_y], // Top front of backrest [p5_x, p5_y], // Bottom front of backrest (back of slot) [thickness, thickness], // Front of slot (back of lip) [thickness, lip_height], // Top back of lip [0, lip_height] // Top front of lip ]); }