# Another polyhedron with missing faces

4 messages
Open this post in threaded view
|

## Another polyhedron with missing faces

 Hello, I think I have missing faces in my polyhedron because I am unable to compute a difference or something similar with an other object. However, the plain polyhedron looks fine so I don't know where my bug is located. Thank you very much for your help. Andreas lenX=100; lenY=200; sizeX = 100; sizeY = 100; lenTot=lenX*lenY; cntX=3; cntY=5; amplitude=10; wallSize=3; function generator(x,y) = amplitude*sin(x*360*cntX/lenX)*sin(y*360*cntY/lenY); function p(x,y,z) = x+y*lenX+z*lenX*lenY; // x1y1 x1y2 x1y3, ... , x2y1, ... //Start 2. X Point 2 //Start 2. Y Point lenX //Start 2. Level: lenX*lenY points = [     for(y = [0:lenY-1]) for(x = [0:lenX-1]) [x*sizeX/lenX,y*sizeY/lenY,generator(x,y) - wallSize/2] ,     for(y = [0:lenY-1]) for(x = [0:lenX-1]) [x*sizeX/lenX,y*sizeY/lenY,generator(x,y) + wallSize/2],         ]; faces = [     for(x = [0:lenX-2]) for(y = [0:lenY-2]) [p(x,y,0),p(x,y+1,0),p(x+1,y+1,0),p(x+1,y,0)],     for(x = [0:lenX-2]) for(y = [0:lenY-2]) [p(x,y,1),p(x,y+1,1),p(x+1,y+1,1),p(x+1,y,1)],     for(x = [0:lenX-2]) [p(x,0,0),p(x+1,0,0),p(x+1,0,1),p(x,0,1)],     for(x = [0:lenX-2]) [p(x,lenY-1,0),p(x+1,lenY-1,0),p(x+1,lenY-1,1),p(x,lenY-1,1)],     for(y = [0:lenY-2]) [p(0,y,0),p(0,y+1,0),p(0,y+1,1),p(0,y,1)],     for(y = [0:lenY-2]) [p(lenX-1,y,0),p(lenX-1,y+1,0),p(lenX-1,y+1,1),p(lenX-1,y,1)],         ]; difference(){     polyhedron(points,faces,convexity = 20);     cube([sizeX/2,sizeY/2,wallSize*10]); } -- Sent from: http://forum.openscad.org/_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: Another polyhedron with missing faces

 On Wed, Dec 4, 2019 at 12:12 AM AndreasG4r <[hidden email]> wrote:Hello, I think I have missing faces in my polyhedron because I am unable to compute a difference or something similar with an other object. However, the plain polyhedron looks fine so I don't know where my bug is located. Thank you very much for your help. Andreas lenX=100; lenY=200; sizeX = 100; sizeY = 100; lenTot=lenX*lenY; cntX=3; cntY=5; amplitude=10; wallSize=3; function generator(x,y) = amplitude*sin(x*360*cntX/lenX)*sin(y*360*cntY/lenY); function p(x,y,z) = x+y*lenX+z*lenX*lenY; // x1y1 x1y2 x1y3, ... , x2y1, ... //Start 2. X Point 2 //Start 2. Y Point lenX //Start 2. Level: lenX*lenY points = [     for(y = [0:lenY-1]) for(x = [0:lenX-1]) [x*sizeX/lenX,y*sizeY/lenY,generator(x,y) - wallSize/2] ,     for(y = [0:lenY-1]) for(x = [0:lenX-1]) [x*sizeX/lenX,y*sizeY/lenY,generator(x,y) + wallSize/2],         ]; faces = [     for(x = [0:lenX-2]) for(y = [0:lenY-2]) [p(x,y,0),p(x,y+1,0),p(x+1,y+1,0),p(x+1,y,0)],     for(x = [0:lenX-2]) for(y = [0:lenY-2]) [p(x,y,1),p(x,y+1,1),p(x+1,y+1,1),p(x+1,y,1)],     for(x = [0:lenX-2]) [p(x,0,0),p(x+1,0,0),p(x+1,0,1),p(x,0,1)],     for(x = [0:lenX-2]) [p(x,lenY-1,0),p(x+1,lenY-1,0),p(x+1,lenY-1,1),p(x,lenY-1,1)],     for(y = [0:lenY-2]) [p(0,y,0),p(0,y+1,0),p(0,y+1,1),p(0,y,1)],     for(y = [0:lenY-2]) [p(lenX-1,y,0),p(lenX-1,y+1,0),p(lenX-1,y+1,1),p(lenX-1,y,1)], ]; difference(){     polyhedron(points,faces,convexity = 20);     cube([sizeX/2,sizeY/2,wallSize*10]); } -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org