dannystaple/OpenSCAD-Parts-Library — pull request #1 by powtac (2013-02-07 14:58:34+00:00)
Title: Update pyramid.scad

There is a display bug when using difference() together with polyhedron() and when the model is "insideout". See https://github.com/openscad/openscad/issues/228

Changed the triangles direction into counter-clockwise.

Test:
module pyramid(w, l, h) {
mw = w/2;
ml = l/2;
polyhedron(points = [
[0, 0, 0],
[w, 0, 0],
[0, l, 0],
[w, l, 0],
[mw, ml, h]
], triangles = [
[4, 1, 0],
[4, 3, 1],
[4, 2, 3],
[4, 0, 2],
//base
[0, 1, 2],
[2, 1, 3]
]);
}

// Test:
difference() {
pyramid(61,18,200);
translate([0,0,3]) cube([61,18,200]);
}