# Polygon in 3D space?

11 messages
Open this post in threaded view
|

## Polygon in 3D space?

 Hello, I'm relatively new to OpenScad and are working on my first bigger project right now. There the following question came up for which I tried to search for existing discussions here, without success Is it possible to place a polygon in 3D space and not only on the x/y-plane? I would like to have a polygon with its vertices (points) at defined coordinates in 3D space (x,y,z) and then to linearextrude this polygon. Do I have to use a polyhedron instead? If I got it correctly from the polyhedron description it cannot be flat, so I have to "linearextrude" it myself by placing all the vertices at the correct positions in 3D space and not only my known vertices of the base face. Any ideas? Thanks a lot in advance, Thomas -- 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: Polygon in 3D space?

 You can linear_extrude() a polygon to make a flat polyhedron that can be placed in 3D space.On 11 October 2017 at 21:39, thomas-hn wrote:Hello, I'm relatively new to OpenScad and are working on my first bigger project right now. There the following question came up for which I tried to search for existing discussions here, without success Is it possible to place a polygon in 3D space and not only on the x/y-plane? I would like to have a polygon with its vertices (points) at defined coordinates in 3D space (x,y,z) and then to linearextrude this polygon. Do I have to use a polyhedron instead? If I got it correctly from the polyhedron description it cannot be flat, so I have to "linearextrude" it myself by placing all the vertices at the correct positions in 3D space and not only my known vertices of the base face. Any ideas? Thanks a lot in advance, Thomas -- 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
Open this post in threaded view
|

## Re: Polygon in 3D space?

 In reply to this post by thomas-hn I'm far from a wizard when it comes to openSCAD, but terminology and application is important. For the purposes of this discussion, one must consider that a polygon is a multi-sided shape on a flat plane. Once created using the polygon command, one can rotate it in 3-space. If you extrude it as part of the operation, you can rotate it as well. Moving to another part of your question, if your objective is a solid that is going to have specific points in space, you can pick any three to make a plane and use those points to create polyhedra. I'm not sure about your reference suggesting that the polyhedron description not be flat, as the wiki specifies that "faces" must be in the same plane, which implies that they are flat. When you suggest to use linear_extrude, do you require/desire to have vertical sides prior to any rotation? -- 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: Polygon in 3D space?

Open this post in threaded view
|

## Re: Polygon in 3D space?

Open this post in threaded view
|

## Re: Polygon in 3D space?

 In reply to this post by Hypher This sounds like an interesting solution, thanks However, has anyone an even simpler solution? Hypher wrote > The best way to do what you want is probably: > Given your set of 3d points, compute a transform so they all lay on the > plane > Use polygon() to render that set of points > Use linear_extrude() to create a 3d shape from those points > Apply the inverse of the original transform to put the 3d shape into place -- 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: Polygon in 3D space?

 Well, if you don't mind the extra faces, this is pretty simple:hull() for(p=[[2,2,2], [2,8,8], [7,2,2], [7,8,8]]) translate(p) cube(0.000002, true);Something funny. My first try was without the for, and it worked with cubes as small as 1E-99, but with the for loop, it doesn't work with cubes of size 1E-6.2017-10-11 23:30 GMT+02:00 thomas-hn :This sounds like an interesting solution, thanks However, has anyone an even simpler solution? Hypher wrote > The best way to do what you want is probably: > Given your set of 3d points, compute a transform so they all lay on the > plane > Use polygon() to render that set of points > Use linear_extrude() to create a 3d shape from those points > Apply the inverse of the original transform to put the 3d shape into place -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org -- Regards from Spain,Antonio _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: Polygon in 3D space?

Open this post in threaded view
|

## Re: Polygon in 3D space?

 In reply to this post by thomas-hn On 2017-10-11 22:39, thomas-hn wrote: > Is it possible to place a polygon in 3D space and not only on the > x/y-plane? As others have indicated, a polygon is a 2d entity that by definition in OpenSCAD exists in the XY plane. This could be seen as a specialization of the mathematical term "polygon". You may perhaps want to look at OpenSCAD polyhedron instead, which uses 3d coordinates. It is supposed to have flat faces that are in fact mathematical polygons. Carsten Arnholm _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org