Piece hollow in preview, solid after rendering

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Piece hollow in preview, solid after rendering

amundsen
Hello,

I have a piece in two parts. Both are meant to be hollow. However, the
smaller one (the "ceiling") is solid rather than hollow after rendering (see
pictures). Also, I have some "PolySet has nonplanar faces. Attempting
alternate construction." warnings as well as a "UI-WARNING: Object may not
be a valid 2-manifold and may need repair!" error message. However with the
same warnings (but without the error message) on a similar design I remember
that the rendering went right.

What's wrong?

Thank you in advance.

use <scad-utils/transformations.scad>
use <list-comprehension-demos/sweep.scad>

// tolerance is used to reduce thickness of ceiling on each side
wave_height = 20;
ceiling_thickness = 3;
wall_thickness = 3;
ceiling_wall_thickness = 2;
floor_thickness = 3;
global_thickness = 20;
r_outer = 80 - global_thickness;
r_inner = 80 - global_thickness + wall_thickness;
ravine_thickness = global_thickness - 2 * wall_thickness;
s = 10; // wave height multiplier
height = 100;
step = 1;// decrease to 0.1 when rendering but be patient
n_waves = 6;
rings_height =6;
rings_thickness = 3;
separation_height = height + 60;
tolerance = 0.5;
m = 360/(2 * n_waves);
$fn = 10;

shape_outer = [[0,0,0], [global_thickness,0,0], [global_thickness,height,0],
[0,height,0]];
shape_inner = [[0,0,0], [ravine_thickness,0,0], [ravine_thickness,height,0],
[0,height,0]];
shape_ring_inner = [[0,0,0],[rings_thickness,rings_height/2,0],
[rings_thickness,rings_height,0], [0, rings_height,0]];
shape_ceiling = [[0,0,0], [ravine_thickness-2*tolerance,0,0],
[ravine_thickness-2*tolerance,1,0], [0,1,0]];
shape_ceiling_inner = [[0,0,0],
[ravine_thickness-2*tolerance-2*ceiling_wall_thickness,0,0],
[ravine_thickness-2*tolerance-2*ceiling_wall_thickness,1,0], [0,1,0]];

// main part
path_outer = [for (a=[0:step:360-step])
    rotation([90,0,a]) *
translation([r_outer,wave_height+s*sin(a*n_waves),0]) * scaling([1,1, 1])
];
// ravine
path_inner = [for (a=[0:step:360-step])
    rotation([90,0,a]) *
translation([r_inner,wave_height+s*sin(a*n_waves)+wall_thickness,0]) *
scaling([1,1,1])
];
// inner ring
path_ring_inner = [for (a=[0:step:360-step])
    rotation([90,0,a]) *
translation([r_inner,height+wave_height/2-ceiling_thickness-rings_height,0])
* scaling([1,1,1])
];
// outer ring
path_ring_outer = [for (a=[0:step:360-step])
    rotation([90,0,a]) *
translation([r_outer+global_thickness-wall_thickness,height+wave_height/2-ceiling_thickness-rings_height,0])
* scaling([-1,1,1])
];

// ceiling
path_ceiling = [for (a=[0:step:360-step])
    rotation([90,0,a]) * translation([r_inner+tolerance,0,0]) *
scaling([1,s+s*sin(a*n_waves)+ceiling_thickness,1])
];

// ceiling_ravine
path_ceiling_inner = [for (a=[0:step:360-step])
    rotation([90,0,a]) *
translation([r_inner+tolerance+ceiling_wall_thickness,0,0]) *
scaling([1,s+s*sin(a*n_waves),1])
];

// main part
difference() {
        sweep(shape_outer, path_outer, true);
        sweep(shape_inner, path_inner, true);
}
// inner rings
sweep(shape_ring_inner, path_ring_inner, true);
sweep(shape_ring_inner, path_ring_outer, true);

// ceiling
translate([0,0, separation_height]) {
        difference() {
        sweep(shape_ceiling, path_ceiling, true);
        sweep(shape_ceiling_inner, path_ceiling_inner, true);
        }
}

<http://forum.openscad.org/file/t2715/Capture_d%E2%80%99%C3%A9cran_%2836%29.png>
<http://forum.openscad.org/file/t2715/Capture_d%E2%80%99%C3%A9cran_%2835%29.png>





--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Piece hollow in preview, solid after rendering

amundsen
I solved the issue.

I have edited this line:
// ceiling
path_ceiling = [for (a=[0:step:360-step])
    rotation([90,0,a]) * translation([r_inner+tolerance,0,0]) *
scaling([1,s+s*sin(a*n_waves)+ceiling_thickness,1])
];

I have added some thickness to make sure the part removed in the
difference() operation goes over the top of the main part. Now the code is:
// ceiling
path_ceiling = [for (a=[0:step:360-step])
    rotation([90,0,a]) * translation([r_inner+tolerance,0,0]) *
scaling([1,s+s*sin(a*n_waves)+ceiling_thickness+2,1])
];




--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org