<p>Suppose I have the X, Y, and Z coordinates (either in a list or a function z = f(x,y)) that defines a shape as the one provided and I want to 3D print it with a solid bottom, is there an easy way to do this? If not, how can a functionally well-defined shape be put into a 3D modeling software like FreeCAD?</p>
<p><a href="https://i.stack.imgur.com/5bcSU.jpg" rel="nofollow noreferrer" title="3D graph"><img src="https://i.stack.imgur.com/5bcSU.jpg" alt="3D graph" title="3D graph" /></a></p>

[{'answer_id': 18193, 'author': 'R.. GitHub STOP HELPING ICE', 'author_id': 11157, 'author_profile': 'https://3dprinting.stackexchange.com/users/11157', 'pm_score': 2, 'selected': False, 'text': '<p>For stuff like this, OpenSCAD is your friend. There are several different approaches you could take:</p>\n<ol>\n<li><p>Generate an image file with grayscale color representing the height of the function on an XY grid, and use the <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Other_Language_Features#Surface" rel="nofollow noreferrer"><code>surface</code></a> feature to import it as a heightmap.</p>\n</li>\n<li><p>Write the function as a mathematical expression in OpenSCAD language, and write a module to generate a <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#polyhedron" rel="nofollow noreferrer"><code>polyhedron</code></a> by iterating over a sufficiently fine coordiante grid, sampling the function, and producing points and triangles.</p>\n</li>\n<li><p>Use a library someone else has already written for this purpose. I\'m not aware of specific ones but pretty sure there are quite a few.</p>\n</li>\n</ol>\n'}, {'answer_id': 18225, 'author': 'FarO', 'author_id': 2338, 'author_profile': 'https://3dprinting.stackexchange.com/users/2338', 'pm_score': 1, 'selected': False, 'text': '<p>Another option is to use <a href="https://fullcontrolgcode.com/" rel="nofollow noreferrer">Full Control Designer</a> where you can define the path using Excel formulas and it will generate the GCode for you.</p>\n'}, {'answer_id': 18294, 'author': 'Uwe', 'author_id': 29373, 'author_profile': 'https://3dprinting.stackexchange.com/users/29373', 'pm_score': 1, 'selected': False, 'text': '<p>You may generate a .stl file from your mathematical definition. You may write a program using a language of your choice to compute the .stl file.</p>\n<p>Your image shows a lot of rectangles, each rectangle may be described as two triangles. The .stl file is a (very long) list of all that triangles. Each triangle is defined by the X, Y, and Z coordinates of the three corners.</p>\n<pre><code>solid name\n\nfacet normal ni nj nk\n    outer loop\n        vertex v1x v1y v1z\n        vertex v2x v2y v2z\n        vertex v3x v3y v3z\n    endloop\nendfacet\n\nendsolid name\n</code></pre>\n<p>Each n or v is a floating-point number in sign-mantissa-&quot;e&quot;-sign-exponent format, e.g., &quot;2.648000e-002&quot;. The triangle vertices should be sorted using the &quot;right-hand rule&quot;, i.e. the vertices are listed in counter-clockwise order from outside.</p>\n<p>The normal vector ni nj nk is set to zero.</p>\n<p>The G-code file is generated from the .stl file using the slicing software for your 3D printer.</p>\n<p>See <a href="https://en.wikipedia.org/wiki/STL_(file_format)" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/STL_(file_format)</a> for details.</p>\n'}, {'answer_id': 18319, 'author': 'alecail', 'author_id': 18571, 'author_profile': 'https://3dprinting.stackexchange.com/users/18571', 'pm_score': 0, 'selected': False, 'text': '<p>Not sure what you\'re asking exactly, but you can use this workflow:</p>\n<ol>\n<li>SideFX Houdini: math function + STL file generation\n<a href="https://i.stack.imgur.com/28jr1.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/28jr1.jpg" alt="enter image description here" /></a>\n<a href="https://i.stack.imgur.com/E0Itn.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/E0Itn.jpg" alt="enter image description here" /></a></li>\n<li>(optional) FreeCAD: Import STL as mesh, do whatever you need to do in FreeCAD, export to STL\n<a href="https://i.stack.imgur.com/txRno.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/txRno.png" alt="enter image description here" /></a></li>\n<li>a slicer: import the STL and slice it.\n<a href="https://i.stack.imgur.com/Ofydl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ofydl.png" alt="enter image description here" /></a>\n<a href="https://i.stack.imgur.com/zCxgG.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zCxgG.jpg" alt="enter image description here" /></a></li>\n</ol>\n'}]
['https://3dprinting.stackexchange.com/questions/18189', 'https://3dprinting.stackexchange.com', 'https://3dprinting.stackexchange.com/users/31441/']