# Trapezoidal Pyramid

8 messages
Open this post in threaded view
|

## Trapezoidal Pyramid

 Ok, I'm trying to render a pretty simple shape here.  A trapezoidal pyramid.  Using the polyhedron function, it compiles and shows me a preview fine, but it won't render.  Can anybody see what I've done wrong? polyhedron(points=[[0,0,0],[17,0,0],[17,17,0],[0,17,0], [1.5,1.5,2],[15.5,1.5,2],[15.5,15.5,2],[1.5,15.5,2]], faces =[[0,1,2,3],[0,1,5,4],[1,2,6,5],[2,3,7,6], [3,0,4,7],[4,5,6,7]]);
Open this post in threaded view
|

## Re: Trapezoidal Pyramid

 Some of the faces are oriented the wrong way around which can be seen in the thrown-together view (they get a pinkish color when facing inwards). ( see http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#polyhedron ) try: polyhedron(points=[[0,0,0],[17,0,0],[17,17,0],[0,17,0], [1.5,1.5,2],[15.5,1.5,2],[15.5,15.5,2],[1.5,15.5,2]], faces =[[0,1,2,3],[4,5,1,0],[5,6,2,1],[6,7,3,2], [7,4,0,3],[7,6,5,4]]); An alternative way to create this object would be: linear_extrude(height = 2, scale = 14/17) square(17, center = true); -- Torsten
Open this post in threaded view
|

## Re: Trapezoidal Pyramid

 AHA!  Left hand rule got me.  Thanks alot!  I ended up going with 4 faceted cylinders, lol.
Open this post in threaded view
|

## Re: Trapezoidal Pyramid

 The two times I've had to do that I have done 2 seperate things (because I hate polyhedron()). The first time I did a hull of 2 parallel thin cubes. The second time I did a linear extrude of a cube.On Sun, Nov 23, 2014 at 4:22 PM, dalucero wrote:AHA!  Left hand rule got me.  Thanks alot!  I ended up going with 4 faceted cylinders, lol. -- View this message in context: http://forum.openscad.org/Trapezoidal-Pyramid-tp10202p10204.html Sent from the OpenSCAD mailing list archive at Nabble.com. _______________________________________________ OpenSCAD mailing list [hidden email] http://rocklinux.net/mailman/listinfo/openscad http://openscad.org - https://flattr.com/thing/121566 _______________________________________________ OpenSCAD mailing list [hidden email] http://rocklinux.net/mailman/listinfo/openscadhttp://openscad.org - https://flattr.com/thing/121566
Open this post in threaded view
|

## Re: Trapezoidal Pyramid

 In reply to this post by dalucero \$fn is rather handy (apart from adjusting quality), because you can use it to make pyramids and the like with the cylinder function. Then cut off the top: difference() {     rotate([0,0,45])     cylinder(d1=sqrt(pow(17,2)*2), d2=0, h=14.17, \$fn=4);         translate([0,0,2])     linear_extrude(h=14)     square([17,17], center=true); } :)
Open this post in threaded view
|

## Re: Trapezoidal Pyramid

 Wouldn't d2=_some non zero number_ be easier than difference()? > On 25 Nov 2014, at 9:01 am, Bananapeel <[hidden email]> wrote: > > \$fn is rather handy (apart from adjusting quality), because you can use it to > make pyramids and the like with the cylinder function. Then cut off the top: > > difference() > { >    rotate([0,0,45]) >    cylinder(d1=sqrt(pow(17,2)*2), d2=0, h=14.17, \$fn=4); > >    translate([0,0,2]) >    linear_extrude(h=14) >    square([17,17], center=true); > } > > :) > > > > -- > View this message in context: http://forum.openscad.org/Trapezoidal-Pyramid-tp10202p10215.html> Sent from the OpenSCAD mailing list archive at Nabble.com. > _______________________________________________ > OpenSCAD mailing list > [hidden email] > http://rocklinux.net/mailman/listinfo/openscad> http://openscad.org - https://flattr.com/thing/121566_______________________________________________ OpenSCAD mailing list [hidden email] http://rocklinux.net/mailman/listinfo/openscadhttp://openscad.org - https://flattr.com/thing/121566