[OpenSCAD] Functional OpenSCAD, working with vertex data

Carsten Arnholm arnholm at arnholm.org
Tue Jan 30 15:07:56 EST 2018


On 30. jan. 2018 20:35, Antonio Bueno wrote:
> Any insight in why the first hull() (the one with explicit union()) is 
> faster (16s*) than the second one (26s)?

Implicit or explicit union takes time. You are doing both in this case.

Why not simplify. Shorter, easier code. And faster.

size=30;
radius=1;
$fn=60;
hull() {
     translate([-size/2, -size/2, -size/2]) sphere(radius);
     translate([+size/2, -size/2, -size/2]) sphere(radius);
     translate([+size/2, +size/2, -size/2]) sphere(radius);
     translate([-size/2, +size/2, -size/2]) sphere(radius);

     translate([-size/2, -size/2, +size/2]) sphere(radius);
     translate([+size/2, -size/2, +size/2]) sphere(radius);
     translate([+size/2, +size/2, +size/2]) sphere(radius);
     translate([-size/2, +size/2, +size/2]) sphere(radius);
}

Carsten Arnholm





More information about the Discuss mailing list