You can use this as the starting point for a subdivision mesh, and get a much cleaner and more regular result than you do from an isosurfacing approach

Here’s a definition: subdgyroid.gh (15.9 KB)
Subdivision distorts the open edges, so here it generates a larger portion, then selects only the inner undistorted part to get a properly periodic unit. There’s a little script I wrote in there that lets it select faces in the subdivided mesh corresponding to particular parent triangles.

Wow, very nice! All the work I have been doing with TPMS is through isosurfaces and then clean and fix meshes, so this is a good alternative. Do you happen to know if there exists similar discretization of other TPMS, like Diamond for example?

You could also just apply Catmull-Clark subdivision to the simple quad mesh - this won’t give an exactly discrete minimal surface with planar faces like the Koebe polyhedron method linked above, and the faces won’t be planar, but it’s a fairly close approximation.

You can also do it with triangles using the same definition I posted for the gyroid, just with a different input.
This definition contains 2 different ways to triangulate this surface, depending how you want it to align with the boundaries: subd_diamond.gh (15.8 KB)

Hi Bobeng,
The P in TPMS stands for periodic - so the unit cell has to be a shape that can tile space, which a sphere doesn’t. Common ones aside from the cube are the rhombic dodecahedron, and the truncated octahedron. There are lots of examples on Ken Brakke’s page.

You can also certainly generate discrete minimal surfaces with all sorts of other boundary shapes if you don’t require them to be periodic.

The first one looks like someone has taken a regular periodic minimal surface and trimmed it with the bunny shaped boundary mesh. This should be possible with the Mesh Split component.
The second one looks like it has been stretched and mapped to the torus (and is no longer minimal).

Thanks a lot for your response Daniel. This is amazing!!. By the way, which part of your .gh file the contains the equation of Schwarz D so i can change to other minimal surface if possible?

In these examples the minimal surface comes from the initial mesh, which is internalised as the first component in the definition. In this thread I’ve posted these discretizations for the gyroid and Schwarz D surface. The Schwarz P surface also has a very simple discrete version.

I created this gyroid but I am not able to define the length, width and height. I will be glad if i can get help controlling the dimensions. Thanks. Gyroid.gh (16.9 KB)

Hi @bobeng1, it’s not clear to me what you are trying to do.
In the minsurf_trim file I posted above, the X input to the ArrBox component controls the size of the array of gyroid units. If you are trimming the result with some closed solid, the array needs to be bigger than the solid.