0

I am trying to create a "cup" shape (hollow with one end open) with octagonal prisms (using the polyhedron function). When I render my code, OpenSCAD does not render the bottom and inside faces. What am I doing wrong?

Thanks!

My Code:

difference() {
    polyhedron(points = [ [21.5,51.9,0],[51.9,21.5,0],
    [-21.5,51.9,0],[-51.9,21.5,0],
    [-21.5,-51.9,0],[-51.9,-21.5,0],
    [21.5,-51.9,0],[51.9,-21.5,0],
    [21.5,51.9,100],[51.9,21.5,100],
    [-21.5,51.9,100],[-51.9,21.5,100],
    [-21.5,-51.9,100],[-51.9,-21.5,100],
    [21.5,-51.9,100],[51.9,-21.5,100] ], faces = [
    [0,1,9,8],[2,0,8,10],[3,2,10,11],[5,3,11,13],
    [4,5,13,12],[6,4,12,14],[7,6,14,15],[1,7,15,9],
    [0,1,7,6,4,5,3,2],[8,9,15,14,12,13,11,10] ]);

    polyhedron(points = [ [19,49.4,5],[49.4,19,5],
    [-19,49.4,5],[-49.4,19,5],
    [-19,-49.4,5],[-49.4,-19,5],
    [19,-49.4,5],[49.4,-19,5],
    [19,49.4,100],[49.4,19,100],
    [-19,49.4,100],[-49.4,19,100],
    [-19,-49.4,100],[-49.4,-19,100],
    [19,-49.4,100],[49.4,-19,100] ], faces = [
    [0,1,9,8],[2,0,8,10],[3,2,10,11],[5,3,11,13],
    [4,5,13,12],[6,4,12,14],[7,6,14,15],[1,7,15,9],
    [0,1,7,6,4,5,3,2],[8,9,15,14,12,13,11,10] ]);
}

An image of my rendering problems:

enter image description here

ZuluDeltaNiner
  • 695
  • 2
  • 11
  • 26

1 Answers1

1

if you use polyhedron() you should always check the orientation of the faces as described here: documentation openscad

you will see, that in both cases the orientation of the bottom-face is wrong, here your inner polyhedron():

wrong orientated bottom-face

Replace [0,1,7,6,4,5,3,2] for the bottom-faces by [2,3,5,4,6,7,1,0] and you get your cup: enter image description here

Sevle
  • 3,014
  • 2
  • 17
  • 28
a_manthey_67
  • 3,498
  • 1
  • 12
  • 22
  • Thanks! I'm still learning and probably read that line on the wiki 3-4 times when I was building this, but somehow it slipped my mind. – ZuluDeltaNiner Jan 15 '16 at 01:29