Skip to content

ChatGPT 4.5 Deep Research generated Rhombicuboctahedron for Unity

License

Notifications You must be signed in to change notification settings

Arlorean/Rhombicuboctahedron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rhombicuboctahedron

ChatGPT 4.5 Deep Research generated Unity C# code to create a parametric Rhombicuboctahedron mesh.

Unity Screen Recording of Rhombicuboctahedron Parametric Mesh Wikipedia Rhombicuboctahedron Animated GIF
Unity Animation Wikipedia Animation

AI Generated Code

The Rhombicuboctahedron is well studied and is one of the 13 Archimedean Solids.

Given that, I thought this would be a slam dunk for modern AI, so I tested various AI models using this prompt:

Can you create me a Unity MonoBehaviour C# script that will procedurally create a Rhombicuboctahedron mesh where there is a parameter t that varies between 0 and 1 with 0 being the Rhombicuboctahedron as a perfect cube and 1 being the Rhombicuboctahedron as a perfect octahedron. I will call a ContextMenu method in the editor to call the method to generate the mesh. The game object is guaranteed to have a MeshFilter, MeshRenderer on it already and there is no need for a collider.

Results

Claude Sonnet 3.7 Grok 3 ChatGPT 4o
Gemini Flash 2.0 Gemini Deep Research ChatGPT Deep Research

Summary

Provider Model Score Notes
Anthropic Claude Sonnet 3.7 40% Close with faces and vertices but winding order was wrong
xAI Grok 3 25% Good first attempt but prompt revisions didn't help
OpenAI ChatGPT 4o 20% Poor start and prompt revisions didn't improve things
Google Gemini Flash 2.0 0% Unable to generate any compilable code
Google Gemini Deep Research 10% Promising research document but poor results
OpenAI ChatGPT Deep Research 95% Almost perfect, one compile error, only working solution

Gemini Flash 2.0

Google's Gemini Flash 2.0 model was unable to generate working code, despite many follow up prompts to get it to fix the code.

IndexOutOfRangeException: Index was outside the bounds of the array.
ProceduralRhombicuboctahedron.CalculateRhombicuboctahedronVerticesAndTriangles (System.Single t, UnityEngine.Vector3[]& vertices, System.Int32[]& triangles) (at Assets/Scripts/ProceduralRhombicuboctahedron.cs:53)
ProceduralRhombicuboctahedron.GenerateMesh () (at Assets/Scripts/ProceduralRhombicuboctahedron.cs:16)

Gemini Deep Research

The results returned a while later (10s of minutes, not sure exactly how long unfortunately) and it prepared a Google Document for me detailing all the sources and its thoughts and suggestions, together with "working code". Overall the presentation was great:

Gemini Deep Research Transcript

The code however was unable to generate anything close to a Rhombicuboctahedron and at best it managed to generate 24 vertices, 12 indices making 4 triangles. In other cases the results produced the same number of vertices and indices but the result degenerated to a line.

ChatGPT Deep Research 4.5

Oustanding results after 26 minutes of research and a single follow up prompt to fix a small compile error. All values of 't' from 0.0 (Cube) to 0.5 (Rhombicuboctahedron) to 1.0 (Regular Octahedron) produced the expected results with perfect face vertex winding order, vertex normals and with another small prompt it successfully added verteex colors as shown in the Unity screen recording GIF. It also generated me a Unity 6.0 URP Lit shader in order to render the vertex colors that were written into the mesh.

ChatGPT Deep Research Transcript

t=0.0 t=0.5 t=1.0

Hand Written Code

I manually wrote code using the Unity ProBuilder API with the Bevel feature, which was exactly what I needed, but then I also wanted full control over the Normals and UVs, and it was never obvious to me when I should call ProBuilderMesh.Refresh() and with what RefreshMask to get it to not override my custom normals and UVs. This took a few days to create and debug.

ProBuilder Bevel

Notes

The tests were performed during 19th-28th March 2025 using a paid subscription to Claude and ChatGPT, but not for Grok or Gemini.

The scoring system is my personal opinion on the experience and the results produced by each AI model.

The Rhombicuboctahedron.gif animated GIF file was created using the Unity Screen Recorder.

Unity Screen Recorder GIF
Unity Screen Recorder GIF

Unity Screen Recorder

Failed PNG image from pngtree.com