Interactive Preview & Customizer
3D preview with OpenSCAD rendering on parameter changes.
Loading preview...
step 100
step 100
step 100
step 10
step 10
step 50
step 50
step 5
step 5
step 10
step 1
step 15
step 50
step 1
step 2
step 0.5
WASM compiler loads on first parameter change.
Prompt
Tenho um foço quadrado no meu apartamento que se subir, para na laje, ele possui 4 paredes, porém uma delas tem uma abertura semelhante a uma porta. Ele tem 1m x 1m x 4m sendo 1 de largura, 1 cumprimento 4 de altura. Tendo como base isso, simule o ambiente e crie uma escada em formato espiral que seja capaz de subir para a laje
OpenSCAD Code
// Spiral Staircase in a 1m x 1m x 4m Shaft with Entryway and Slab Opening
// Modeled in millimeters (1m = 1000mm, 4m = 4000mm)
/* [Shaft Dimensions] */
shaft_width = 1000; // [800:100:1500] Width (X)
shaft_depth = 1000; // [800:100:1500] Depth (Y)
shaft_height = 4000; // [2500:100:5000] Height (Z)
wall_thickness = 100; // [50:10:200] Wall thickness
slab_thickness = 150; // [100:10:300] Ceiling slab thickness
/* [Door Opening] */
door_width = 800; // [600:50:950] Door width
door_height = 2100; // [1800:50:2400] Door height
/* [Spiral Staircase] */
pole_radius = 60; // [40:5:100] Central column radius
tread_thickness = 40; // [25:5:60] Tread thickness
stair_radius = 450; // [350:10:480] Outer radius of spiral stair
num_steps = 22; // [16:1:28] Total number of steps
total_rotation = 495; // [360:15:720] Total rotation in degrees (~1.375 turns)
/* [Baluster & Handrail] */
include_railing = true;
railing_height = 850; // [700:50:1000] Handrail height above tread
post_radius = 12; // [8:1:20] Handrail baluster post radius
rail_radius = 20; // [12:2:30] Handrail tube radius
/* [Display Options] */
show_cutaway = true; // Cutaway of front walls to clearly view interior
$fn = 36;
step_rise = shaft_height / num_steps;
step_angle = total_rotation / num_steps;
module shaft_structure() {
difference() {
union() {
// Main shaft walls
translate([-shaft_width/2 - wall_thickness, -shaft_depth/2 - wall_thickness, 0])
cube([shaft_width + 2*wall_thickness, shaft_depth + 2*wall_thickness, shaft_height]);
// Top slab
translate([-shaft_width/2 - wall_thickness - 200, -shaft_depth/2 - wall_thickness - 200, shaft_height])
cube([shaft_width + 2*wall_thickness + 400, shaft_depth + 2*wall_thickness + 400, slab_thickness]);
// Bottom floor
translate([-shaft_width/2 - wall_thickness - 200, -shaft_depth/2 - wall_thickness - 200, -slab_thickness])
cube([shaft_width + 2*wall_thickness + 400, shaft_depth + 2*wall_thickness + 400, slab_thickness]);
}
// Inner shaft void
translate([-shaft_width/2, -shaft_depth/2, -1])
cube([shaft_width, shaft_depth, shaft_height + 2]);
// Top slab exit opening (quarter circle / corner cutout to step onto the roof)
translate([-10, -10, shaft_height - 1])
cube([shaft_width/2 + 20, shaft_depth/2 + 20, slab_thickness + 2]);
// Doorway opening on South wall (-Y)
translate([-door_width/2, -shaft_depth/2 - wall_thickness - 10, 0])
cube([door_width, wall_thickness + 20, door_height]);
// Cutaway for visibility if enabled (removes East wall + half South wall)
if (show_cutaway) {
translate([0, -shaft_depth/2 - wall_thickness - 210, -slab_thickness - 10])
cube([shaft_width/2 + wall_thickness + 220, shaft_depth + 2*wall_thickness + 420, shaft_height + slab_thickness + 20]);
}
}
}
module single_tread() {
// Pie-wedge shaped tread
difference() {
cylinder(r = stair_radius, h = tread_thickness);
// Central column cutout
translate([0,0,-1])
cylinder(r = pole_radius, h = tread_thickness + 2);
// Trim wedge angle
rotate([0, 0, step_angle])
translate([-stair_radius*1.5, 0, -1])
cube([stair_radius*3, stair_radius*3, tread_thickness + 2]);
rotate([0, 0, 180])
translate([-stair_radius*1.5, 0, -1])
cube([stair_radius*3, stair_radius*3, tread_thickness + 2]);
}
// Collar around central post for structural support
cylinder(r = pole_radius + 15, h = step_rise);
}
module spiral_staircase() {
// Central pole
cylinder(r = pole_radius, h = shaft_height + slab_thickness);
// Steps
for (i = [0 : num_steps - 1]) {
translate([0, 0, i * step_rise])
rotate([0, 0, i * step_angle]) {
single_tread();
// Railing post on outer edge of each tread
if (include_railing) {
rotate([0, 0, step_angle * 0.7])
translate([stair_radius - 30, 0, tread_thickness]) {
cylinder(r = post_radius, h = railing_height);
// Sphere cap / handrail node
translate([0, 0, railing_height])
sphere(r = rail_radius);
}
}
}
}
// Continuous handrail segments connecting baluster nodes
if (include_railing) {
for (i = [0 : num_steps - 2]) {
hull() {
rotate([0, 0, i * step_angle + step_angle * 0.7])
translate([stair_radius - 30, 0, i * step_rise + tread_thickness + railing_height])
sphere(r = rail_radius);
rotate([0, 0, (i + 1) * step_angle + step_angle * 0.7])
translate([stair_radius - 30, 0, (i + 1) * step_rise + tread_thickness + railing_height])
sphere(r = rail_radius);
}
}
}
}
// @name Shaft Structure with Door and Slab
shaft_structure();
// @name Spiral Staircase
spiral_staircase();


