Weld seams between gyroid meshes


I made the gyroid below from a tutorial. The model is a 4x4 box array, so 4 gyroids aligned to each other:

However, the edges don’t quite match, so there are small slivers here and there:

My question: Can I somehow get the edges better aligned/welded? The aim is to get a 3D-printable model.

The model was made with Milipede and Weaverbird.
Gyroid.gh (12.6 KB)


Gyroid_re.gh (13.5 KB) I’ve added Mesh WeldVertices from meshedit plugin.
It’ll allow you to weld mesh vertices within a given tolerance.


Nice, that works perfect. Thanks a lot!

For a quite different way of approaching this…
Some time ago I discovered a way to discretize the gyroid using only 1 type of triangle.

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.

There was actually a paper published recently on this discrete form of the Gyroid:

I found it a few years earlier though! :


Really interesting approach! I will look into this, as it would be very useful for making 3D-printable objects in general. Thanks for your input.

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?

There does indeed. You can form a discrete minimal version of the Diamond (Schwarz D surface) by rearranging the faces of a rhombic dodecahedron.

I posted here an example of subdividing and optimising this to make a discrete minimal surface:

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)


Great stuff! Many thanks!

I noticed most of these TPMS are generated only in cubes or rectangular forms. Is there a way to change the boundary to a sphere maybe?

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.

Thanks for your reply Daniel. However, I’m talking of models like the attached. Is there a way to generate such models?

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).

Here’s an example of the first approach:

minsurf_trim.gh (84.4 KB)


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.

1 Like

how do I change:

i) The type of minimal surface used ie. into a gyroid or schwarz p using their equations.
ii)The boundary mesh into another shape

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)

@DanielPiker can you help me with this?

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.