# Golberg Icosahedral

Hi
I’m looking for some code to display these objects in 3D:

mainly the Icosahedral ones.

Before implementing by this I was wondering if someone already did that with babylon.js ? (couldn’t find anything in the playground except https://www.babylonjs-playground.com/#7LLRFM#2 which does
only GP(m,0))

any hint/pointer would be appreciated

thx!

2 Likes

I think that @JohnK or @jerome could be interested by the question

bump? I really am interested in this too

Hi @Juvenius_Drakonius and welcome to the forum. Now I am back in the game I will have a look at what I can do. It may take some time.

First step using an existing method for a truncated icosahedral GP(1, 1) Babylon.js Playground

1 Like

yes the method for creating a fix coordinate mesh poly given the vertex data is fine and easy, what KGersen was referring to is a code that can generate the GP(m,n) geometry. That code can generate a fix GP(m,0) given the m, it starts from a base icosahedron as a templete then divides it
I haven’t firgured out how to adapt that code to be a GP(m,n) type of poly generator. It would be amazing to do it…

On the other hand I was thinking of using the BABYLON.Mesh.CreateIcoSphere as a starter template of the geometry to make the hexasphere since it makes all the facets on the right locations, it just needs to combine the vertices in to the appropriate m,n hexaspheres.

Anyways if anybody wants to work making this, I would gladly join since this is way above my skill level.

The approach is:

1. Generate the FaceTs with BABYLON.Mesh.CreateIcoSphere
2. Extract the subdivision nodes, vertices, facets data
3. Determine what vertex data are part of the the given the GP(m,p) pentagons and hexagons.
4. Make the pentagons and hexagons accordingly.

Having a CreateHexaSphere (Geodesic polyhedron
) method would be a great addition to the babylon js .

I did say this was a first step and it would take some time. Currently I am working on producing GP(m, 0) from its geodesic dual. Then will work on using the dual kis operator to produce GP(m, m). After that will see what GP(m, n) can be produced.

1 Like

cool cool! if you need any help, cheering…or just a DJ with some flow music to get the code going let me know. I did enjoy a lot figuring stuff out, figuring out this got me in to babylon js…so for sure im in! let me know.

hi JohnK and thx for looking at this.

If you’re still in the ‘research phase’ and not coding yet:
I found someone using an alternative method to the usual “conway operators” method (aka what we usually do with http://antiprism.com/ or polyHédronisme )

it’s capsid (in this site h,k display a GP(h,k) when “hex” is the geometry)

The author is Daniel Antonio Negrón.

He’s from the “bio virus” world (in demand these days…) and he’s using Caspar-Klug theory to generate these hex layouts. So it’s not 3D objects per se but he’s projecting on a 3D object every frame so may be his technic can be reused to generate a 3D GP mesh instead. He can also do trihex, snubhex and other geometries.

He has a simple presentation here: capsid/poster.pdf at master · dnanto/capsid · GitHub

Porting parts of Antiprism in BJS could also be another approach (may be using wasm and keeping C code instead of porting code to TS/JS). But I looked at Antiprism code = not simple !

I currently use Antiprism to generate GP objects like this:

``````Class I - GP(m,0) :
geodesic -c m,0 ico  | pol_recip | antiview (or off2obj to export)
Class II - GP(m,m) :
geodesic -c m,m ico  | pol_recip | antiview
or convert a Class I to Class II :
geodesic -c m,0 ico  | pol_recip | conway z | antiview
``````

Been able to do this generation step in the browser with BJS would be very nice.

1 Like

Next Step -using an icosahedron (Geodesic Polyhedron GD(1, 0)) create its dual a Goldberg Polyhedron GP(1, 0) a dodecahedron https://www.babylonjs-playground.com/#S753J0#1

To follow use GD(1, 0) to create GD(2, 0), GD(3, 0) etc and hence their duals GP(2, 0), GP(3, 0) etc;

Developing the prototype.

This PG https://www.babylonjs-playground.com/#S753J0#2, uses an icosahedron GD(1, 0) (red and solid) and subdivides each face into equilateral triangles as shown in white wireframe to produce GD(m, 0) for some integer m, the radius is inactive in this PG, enter a value for m on line 218.

In this PG https://www.babylonjs-playground.com/#S753J0#3 the lines mapping it to a sphere (134 to 140) are uncommented so the radius parameter is now active.

EDIT now found missing facets in two PGs above. Working on it.

Currently the conversion from a geodesic to goldberg is not working https://www.babylonjs-playground.com/#S753J0#4. It may take a few days to correct.

this idea is a bit out there on the weeds, but could you get the mesh from CreateIcoSphere method, and make the polygons from the facets there?

Possibly but using a mesh to get the facets has the same issue as for the base icosahedron as below.

The mesh for the icosahedron is drawn using 60 vertices whereas in theory only 12 are needed to describe the icosahedron see https://www.babylonjs-playground.com/#S753J0#5

Working with the minimum data set rather than extracting it from a mesh makes doing the work more straightforward.

yeah building the mesh from scratch is the best option to be precise. The thing i haven’t raped my head is how to build the pentagons and hexagons with the displacement in plane of the icosahedron facet so to have the m,n [Goldberg–Coxeter construction - Wikipedia ].

I can make the icosahedron, i divide it in to facets, i cant stich the edges to hexes and pentagons the sequence still eludes me that is where the magic happens.

This version seems to work. The original icosahedron poke through at the pentagon faces

Next step tidy up the PG a bit.

A bit tidier https://www.babylonjs-playground.com/#S753J0#8 (errors for larger m)

EDIT PG #8 corrected https://www.babylonjs-playground.com/#S753J0#52

that’s a somewhat truncated icosahedron alight poking out

Yes useful to find the pentagons Have added a tidier version. Now to work on GP(m, n)

The problem with the GP(m,n) is the rotation of the plane that it need to be tessellated in all faces. You could start with m=n since the max it can be moved, you could never go higher than m=n or lower than m,0 (0,n is like a mirror inverted of m,0) in the rotation (0 to π/5).

@Juvenius_Drakonius Creates GD(m, m) and GP(m, m) from it https://www.babylonjs-playground.com/#S753J0#9

EDIT Corrected PG https://www.babylonjs-playground.com/#S753J0#50 (I hope)