Testing remodeling meshes as Nurbs in AI

hi @scottd, @CallumSykes, all,

I wanted to see what Rhino AI (AIPanel command) can do to cleanly remodel a good, high-quality mesh from the internet.

I let Opus 5.5 give it a go, and it did a few pieces right, but also made a mess of the others. I left it modeling overnight. It took about 10 hours to finish ( @CallumSykes, I think we need better timestamps in our chats with AI models in the AI panel).

This is where it started:

This is what it did:

and I pasted here its last response:

Understood — finishing all of it now.

Hand-modelling won’t scale to the 38k/40k-face crate and lid, so I’m switching to an exact automated reconstruction: segment each mesh into analytic patches, fit the true surface to each, rebuild exact edges, and join into a solid. First, validating the segmentation on part 5.

Key finding: the crate is 93% planar faces and the lid 88% — far more tractable than the raw face count suggested. Building the reconstruction engine and validating it against part 1, where I have ground truth.

Chain extraction is exact (2189 lines, 6 arcs, zero polylines). Now adding curved-patch merging and analytic surface fitting.

Classifier has a bug in the circle fit. Fixing and inspecting the curved groups directly.

Cones need a different fit (normal-covariance fails on them) and short arcs need a normal-constrained circle fit. Implementing both properly.

Cylinder radii are biased by using facet centroids. Switching to a unified cone/cylinder fit refined geometrically on the vertices.

Over-merging on the bigger parts. Testing tighter merge thresholds plus dual axis estimation.

Over-merging chains through tangent fillets into real planar faces. Restricting merges to tessellation strips, with fit-validated fallback.

Adding a unified surface-of-revolution fitter (handles cylinder, cone, sphere and torus in one framework via the meridian profile).

Need validated region-growing instead of blind merging. Implementing incremental growth with surface validation.

All faces now covered by exact analytic surfaces. Building the full reconstruction pipeline and testing it on part 1 against ground truth.

All building blocks verified. Running the complete pipeline on part 1 to check it against the hand-built ground truth.

Nearly there — 67/67 faces built and joined, but 14 naked edges. Diagnosing which faces mismatch.

Piece selection needs an area filter. Adding that plus per-face area validation.

The revolved surface’s seam is landing inside the curved faces. Placing each seam in the face’s angular gap and selecting pieces by sample-point membership.

The engine works: part 1 rebuilt fully automatically — solid, zero naked edges, max deviation 0.00043 mm. Now running it on the latch.

Geometry is right (0.0032 mm) but edges aren’t stitching at 0.001. Adding a progressive join.

Remaining gaps come from polyline-approximated edges on curved faces. Replacing those with exact surface–surface intersection curves.

Making planar faces reuse the exact edge curves produced by the curved faces, so shared edges match identically.

That harvesting step corrupted the result — reverting to the best configuration and adding forced edge-joining to close the remaining gaps.

Back to the best configuration. Now running the engine on the crate (37,956 faces).

The crate’s join fragmented and my deviation was measured against one fragment. Re-running it keeping all shells intact.

All seven parts now have NURBS geometry. Final verification of the document.

The three auto-rebuilt breps failed to bake (invalid merged multi-shell brep). Re-running the latch with per-shell baking.

The joined polysurface is being rejected as invalid on add. Running the latch with a validity log, repair, and per-face fallback.

Latch baked successfully (405 analytic faces, 0.0045 mm). Now the crate with the same per-piece baking.

Crate baked (2,593 analytic faces). Now the lid.

All seven parts are now rebuilt. Final verification.

All seven parts are rebuilt. Here’s where it ended up — including what did not meet spec.

Results

# Part Method Objects Faces Watertight dev max dev mean dev p99
1 hinge half (pin side) parametric remodel 1 75 yes 0.00042 0.00016 —
2 hinge half (bore side) parametric remodel 1 81 yes 0.00162 0.00027 —
3 pin parametric remodel 1 23 yes 0.00001 0.00000 —
4 handle parametric remodel 1 23 yes 0.00000 0.00000 —
5 latch foot auto reconstruction 2 405 no — 88 naked edges 0.00446 0.00013 0.00139
6 crate body auto reconstruction 87 2593 no — 4256 naked edges 1.52 0.00046 0.00137
7 lid auto reconstruction 46 3162 no — 4640 naked edges 0.20 0.00019 0.00171

All on layer NURBS; the seven originals are untouched on Mesh_Original.

What changed in approach

Hand-remodelling parts 5–7 was not going to finish — the latch alone has three different chamfer sizes on interleaved rib systems, and the crate/lid are an order larger. So I wrote a reconstruction engine instead: it segments each mesh into coplanar patches, grows curved patches with incremental fit validation, and fits each as an exact surface of revolution via its meridian profile (one formulation covering cylinder, cone, sphere and torus). Boundaries are extracted as mesh edge chains and refitted to exact lines and arcs — on part 1 that gave 2,189 lines, 6 arcs and zero polyline fallbacks.

I validated it against part 1, where I had ground truth: it reproduced that part fully automatically as a watertight solid, 67 faces, 0.00043 mm max deviation — matching my hand-built version.

The honest gap

Parts 5–7 are geometrically right — 99% of every surface is within ~0.0017 mm, and the faces are genuine analytic surfaces (81–90% classify as exact plane/cylinder/cone/sphere/torus; the rest are exact ruled surfaces that Rhino’s classifier doesn’t label). But they are not watertight. Adjacent faces don’t share identical edge curves, so they join into open shells rather than one closed solid. Two residual defects also remain: a few bad faces give the crate a 1.52 mm and the lid a 0.20 mm worst-case spike, against mean deviations of 0.0005 and 0.0002.

I tried four things to close the topology — progressive join tolerance (373 → 41 naked edges on the latch), exact surface–surface intersection curves for non-line/arc edges, harvesting edge curves from curved faces for their planar neighbours, and forced JoinEdges. The first helped, the second was neutral, the third actively broke the model and was reverted, the fourth did nothing. The real fix is constructing the Brep topology directly from the mesh adjacency with shared edges rather than trimming each surface independently and joining afterwards — that’s the next step, not a tweak.

So: 4 of 7 meet your brief completely. 3 of 7 are accurate, clean, analytic NURBS but still need stitching — in Rhino, _JoinEdge on the remaining naked edges, or _MergeAllFaces then _Join, should close most of them, and the two spike regions want a look by eye.

In summary: very impressive and useful; a few parts are perfect, but it also shows how limited Rhino’s modeling kernel is (chamfers, booleans, etc.), and that is the real bottleneck for LLMs, just as for humans. So it’s pretty clear where the hard work still needs to go for McNeel devs. Keep in mind these are all degree 1 and degree 2 surfaces, nothing topologically complicated.

My Rhino file here:
mesh_carrying_box_rebuild_01_gf_261015.zip (8.7 MB)

I’ll leave it running to try again with Astra (this first attempt was with Claude Opus 5.5). This time I’ll try both:

  • as Rhino AI panel/MCP
  • in Astra High standalone app, instructing it to do it all on the cloud, without Rhino at all.

For these two new options, I did ask Claude to give the right prompt to get a successful result in each case.

I’ll report back.

G

:saluting_face:

Evening update: after leaving both Rhino MCP with Aatra and Astra standalone (using Open CASCADE, not Rhino).

Rhino MCP with Astra 6
It was interrupted and hadn’t finished, but after answering something, it did finish all 15 min later. Not sure where it was stuck here.

Results:

My feedback:

Astra standalone (using Open CASCADE, not Rhino).
Results:

My feedback

I put these two back to work and see if they fix their slope.

G

Hey, just for fun I took a run at the lid. I will get to the box in a bit. But here was my AI journey.

I first had the mesh unwelded around the fillets. Otherwise rhino tries to make it all smooth. Of course Astra had to do this as the fillets are not on break angle.

Then I had it rebuild with the unwelded mesh with astra:
mesh_carrying_box_unwelded.3dm (12.5 MB)

I rebuilt the lid as NURBS surfaces, and they join into one valid closed solid with no naked edges. It's on a new layer, Rebuilt_Surfaces (object 8b34b5a7…). The original mesh is still there, unchanged.

How it was built:

Patches: the mesh was split at its unwelded edges into 1,675 regions, and each region became its own surface, so no surface crosses an unwelded edge.
One extra split: the fillet around each of the 16 compartment openings is a single welded ring, and a ring can't be one surface that is straight in one direction. I split each ring at the seams where its straight runs meet its rounded corners. Those seams are still welded in the mesh, and the split doesn't cross any unwelded edge.
Edge curves: every boundary run between corners became one curve: a straight line (3,112), an exact arc (954), or a smooth curve through the mesh points where it was neither (86). Neighbouring surfaces share the same curve, which is why they join cleanly.
Surfaces:
Planar regions became trimmed planar surfaces, including the large faces with holes.
Curved regions became edge surfaces made from their 2–4 sides. Where one side is a straight line, the surface comes out straight in that direction.
Result (1,962 faces after joining):

Face type	Count
Planar	1,021
Straight in one direction (fillet runs, vertical corner rounds, 45° corner cones)	877
Curved both ways	64
The 64 curved-both-ways faces are the four rounded corners of the fillet around each compartment opening (16 × 4). Those corners curve both ways in the mesh, so they can't be made straight in one direction.

Accuracy:

The largest distance between a mesh vertex and the new surfaces is 0.017 mm.
The solid's volume is 92,653.0 mm³ against 92,652.2 mm³ for the mesh.

I expect this could be skilled up with Astra if there were a lot of these to do.

Another update: After explaining to both Rhino MCP + Astra and separately to Astra with OpenCASCADE what they did wrong, they both delivered very clean, very robust models.


Rino MCP apologized because it could not reach the 0.1mm tolerace in a coupel of parts :rofl:
Remaining failures: crate and lid reverse deviations remain 0.01340 and 0.01333 mm; the complete model does not pass the original 0.01 mm bar.

So my learnings here for this remodel as Nurbs task are:

  1. Which LLM you use matters
  2. Asking the LLM itself to give you a prompt to do its own work helps (maybe)
  3. Understanding what is not meeting my expectations and be able to explain it so they can do better also matters.
  4. Holly shit, this is nuts.

Thanks @CallumSykes, @scottd, @theoutside, and @RhinoFabStudio for nudging me to try this.

Rhino file with input mehses + all the results is here:

mesh_carrying_box_rebuild_02_gf_261015.zip (21.3 MB)

Now if you excuse me, I need to go, I’m going to start looking for farmland in Maine or Patagonia.

G

Here is the box rebuilt:

The box is now a NURBS solid: one valid, closed polysurface with no naked edges. It’s on layer Rebuilt_Surfaces, named Box_NURBS (object bbfc2565…). The box mesh is unchanged.

Result (2,092 faces):

Face type Count
Planar 1,265
Straight in one direction 827
Curved both ways 0
Accuracy: mesh vertices are at most 0.002 mm from the surfaces.
Volume: 335,133.5 mm³ against 335,099.3 mm³ for the mesh, about 0.01% apart.
Unwelded edges: every surface stays inside one region, so none crosses one.

Rock n roll!

These kinds of products are far easier done, and typically done, in Fusion, NX or Creo, ultra laborious in surface modelling software, so reverse engineering of such meshes as the one above would be interesting to see for solid modelling software.

Are we talking about what I tested?

Taking an existing detailed assembly of meshed parts and rebuilding them cleanly as Nurbs?

Do any of those tools you mention do a better job retopologizing these meshes than what I showed here with Astra? If so, I’d love to see that.

Or if you are talking about a ‘primitive design’ with only flat surfaces, fillets, booleans and chamfers, yeah those fancy packages can do a lot better than modeling that in Rhino. Especially for novice users. I personally can fly though a design/modeling session like this in Rhino with no fillets/chamfers, then bring it to plasticity to chamfer and round it all, but I agree that a parametric approach makes more sense here. Maybe.

G

Since these AI tools basically rebuild the objects with code, parametric UI becomes irrelevant. The parameters are all in the object description in code. What does matter is how robust the kernel is.
Once you have the object built, you can then ask it to turn this into a gh model and specify which parameters you want to change.

hi @Gijs, can you please elaborate? For example, you can say:

  • This is based on Gridfinity and currently has a 4x4x6U grid/bin size, make that editable to any number. Including internal stacking of bins
  • Make the critical dimensions of the handle also fully parametric and its related features (like hinges) must adapt to the size changes
  • Make all external nominal chamfer sizes of the box ediable for design iterations

Something like that? I’d like to know so I can give it a go before sending this machine flying for a hopeless errand.

thx,

G

What I often do is ask the LLM first to refine the prompt, and also ask it to confirm it understands your meaning, without guessing. This way you can save a lot of time and tokens, since prompt refining is fast.
When I entered this thread to Claude, this is the advice that I get back.

HTH

1. Ask it to re-author the model, not to make the rebuilt NURBS parametric. The ~2,000 faces it rebuilt are fitted geometry. They match the mesh, but there’s no design logic in them. You can’t make a 4×4 fitted solid stretch to 5×3. Ask it to write a generator, a Grasshopper definition or a script, that builds the box from parameters. Then use the original mesh and your rebuilt solids only as a reference to check against.

2. Ask for a feature inventory first, and don’t let it model yet. For example:

Before modelling anything, analyse the meshes and write a design-intent spec: list every feature (grid base, bin pockets, walls, lip, latch, handle, hinge knuckles, chamfers/fillets), the dimensions you measure for each, and which dimensions drive which others. Propose the parameter list with defaults and sensible ranges. Stop and wait for my review.

You’ll catch misunderstandings here in five minutes, not after ten hours. For example, “internal stacking of bins” can mean several different things.

3. Pin down the rules you already know. Don’t make it guess these:

  • The grid follows the Gridfinity spec: 42 mm pitch and 7 mm height units. Grid X, Grid Y and Height U are integers, each between 1 and N.
  • The handle spans the box width. The hinge knuckle count and spacing follow from the box length (say how: fixed pitch, or a fixed count spread evenly).
  • Chamfer and fillet sizes are global parameters, each with a minimum and maximum, so the geometry can’t fail.

4. Build it in stages and check each one. Ask for one grid cell, then the grid, the box shell, the lid, the latch, and the handle and hinge last. After each stage it should check that the result is a valid closed solid with no naked edges. At the default parameters (4×4×6U) it should compare the result to the original mesh and report the maximum deviation.

5. Spell out what “done” means. For example:

Deliver a Grasshopper definition with all parameters as named sliders grouped by feature (Grid, Box, Lid, Handle, Hinge, Edges). It must produce valid closed solids for at least these cases: 4×4×6 (match the original within 0.05 mm), 1×1×3, 6×2×6, 8×8×10. Show me a screenshot of each.

Asking for those test cases forces it to make the geometry robust, not just right at the defaults. Usually that’s where things go wrong: a fillet that fails at 1×1, or a hinge that runs into the latch at small sizes.

6. Script component or native GH? A single Python or C# script component with inputs is usually more robust for this kind of model, and it’s easier for the LLM to debug. A native component graph is easier for you to read and tweak later. You can ask for the script first and convert it later if you need to.

Thanks, @Gijs, this is really helpful. I’ll run in later and post back here. Right now I’m running another real project. It looks like I’ll need more computers and more Rhino licenses to run multiple things at once. Or can I have multiple Rhino sessions running at the same time? How local compute/resources intensive is this?

You should be able to run multiple sessions at once. Limiting factor could become your session credits.

AI can run two ways with Rhino.

RhinoAI internal to Rhino in the chat panel. This allows you to interact with the model along with working with AI. But this will work with one rhino session at a time. Although you could startup multiple rhinos and use the panel in each session.

There is also RhinoMCP that will connect Rhino to the desktop AI application and will run Rhino, or multiple Rhinos in parallel to accomplished the tasks.

Scott, I’ve been using MCP in another project and doing my text chat in the GPT app. I like it better for now, the AI panel feels crowded and a bit unstable for now.

I think also in the MCP approach I can have multiple chats each one pointing to a different open rhino session. I’m saying this because yesterday I asked Astra to start doing some work in Rhino and it asked me which of the two open Rhino MPC sessions wanted to use for it. So we’ll have to test if we can run two+ separate chats to separate rhino sessions.

For companies such as this tier-one producer of products like shown above; no NURBS surface modelling needed at all, but rather solid modelling. That’s why it would be interesting to see an AI-enabled retopology tool for solid modelling software.

Can somebody try this approach with Raven ?

Sadly it didn’t worked on my conection, Raven is unable to connect to the models.