1
$\begingroup$

How do I add a base to the surface I'm trying to print?

Target machine is a Creality Ender 3 Pro.

I'm using numpy-stl and surf2stl to come up with the desired surface in python:

def SOquestion():
   pᵢs = [i / 100 for i in range(50, 96, 1)]
   pⱼs = pᵢs
   X, Y = np.meshgrid(pᵢs, pⱼs)
   Z = pₖGivenpᵢAndpⱼ(X, Y)

   stlFile = "surfaceOfCriticalValues.stl"
   surf2stl.write(stlFile, X, Y, Z)
   theMesh = mesh.Mesh.from_file(stlFile)

   plotFromStlFile(stlFile)

@np.vectorize
def pₖGivenpᵢAndpⱼ(pᵢ, pⱼ):
    a = pᵢ * pⱼ / ((1 - pᵢ) * (1 - pⱼ))
    return a / (a + 1)

I want this surface to be printable. I figure I could add the base to the mesh but I don't know how to draw all the triangles?

Surface3dPlot

$\endgroup$

2 Answers 2

2
$\begingroup$

You generated a single mesh surface from a mathematical formula. If you can export this surface, you have the first step to a 3D model!

To turn the mesh into a solid item, you are just a couple steps away:

  • Import the mesh into blender
  • swap into edit mode
  • [E] to extrude
    • input a value that puts the resulting offset copy well below the item
  • [s] to scale the selected vertices
    • [Z]
    • 0 to put them all on the sale Z height.
$\endgroup$
2
$\begingroup$

I don't know how surf2stl works, but in principle, given that you already have a way to make a single gridded surface, all you need to do is do that five more times:

  1. Generate the same grid mesh but with all Z values at 0 (or whatever you want the bottom surface to be) instead of your $p_k$ function value.
  2. For each of the four sides, generate a mesh that is only one row wide, along the Z axis; one edge has $Z=0$ and the other edge has $Z=p_k$, thus connecting the bottom to the top.

Make sure that the triangle winding order is correct (surfaces should be “facing outward”).

Then put all of these triangles in the same STL file and it will be printable.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .