GH2: Curvature Display faults (NullReferenceException)

Hi David,

This is a GH2 bug report generated by Claude. Over here we are testing GH1 to GH2 conversions of scripts I made in the past and Claude does a very useful job for this.

@stevebaer, @brian, @CallumSykes, @Gijs , is it an idea that McNeel creates a Discourse place where we can upload posts generated by an AI agent? And that your AI agent is able to examine them?

This is the bug:

The Curvature Display component faults on the attached ship hull surface. On a sphere and on a plane it works fine.

Curvature Display fault - hull surface.ghz (19.1 KB)

Hull surface (Rhino 8 format).3dm (15.5 KB)

To reproduce

  1. Open the attached .ghz (the surface is internalised in a Surface parameter).
  2. The surface is connected to Curvature Display > Shape, all other inputs are default.

Result: the component turns red and gives no mesh.
Expected: a mesh coloured by curvature.

Error

NullReferenceException: Object reference not set to an instance of an object.
   at DisplayComponents.Analysis.CurvatureShader.HarvestCurvature(Surface surface, Mesh mesh, CurvatureKind kind, Double[]& k)
   at DisplayComponents.Analysis.CurvatureShader.ShapeToMesh(Object shape, Double absoluteTolerance, Double angularTolerance, CurvatureKind kind, Double[]& k)
   at DisplayComponents.Analysis.CurvatureShader.Process(IDataAccess access)
   at Grasshopper2.Components.Component.ComputeInternal(Solution solution, CallStack stack)
   at Grasshopper2.Doc.ActiveObject.ComputeAndAssign(ObjectSolutionState state, Solution solution, CallStack stack)

Possible cause
The surface is a single untrimmed NURBS surface, degree 3 x 3, 10 x 9 control points, model units mm (about 100 m long). At one corner (u = max, v = min, point 92399.1, 0, 0) the first derivative in the U direction is almost zero (length about 2e-5). At exactly that corner RhinoCommon Surface.CurvatureAt(u, v) returns null; everywhere else it returns a value. My guess is that HarvestCurvature does not check for a null result.

This kind of corner is normal in ship hull surfaces. Grasshopper 1 colours the same surface by Gaussian curvature without problems.

System
Rhino 9.1.26300.6001 (build date 27 Oct 2026), Grasshopper 2 from the same build, Windows 11 (10.0.26200).

_SystemInfo:
Rhino 9 SR1 2026-10-27 (Rhino 9, 9.1.26300.06001, Git hash:master @ d4917e26aa263f8c01aa5cc598b4c2d06e13e913)
License type: Not For Resale Lab, build 2026-10-27
License details: Cloud Zoo

Windows 11 (10.0.26200 SR0.0) or greater (Physical RAM: 31GB)
.NET 10.0.15

Computer platform: DESKTOP

Standard graphics configuration using DirectX
Primary display: NVIDIA RTX A2000 (NVidia) Memory: 6GB, Driver date: 7-10-2026 (M-D-Y). DirectX(11)

Accelerated graphics device with 4 adapter port(s)

  • Windows Main Display attached to adapter port #0
  • Secondary monitor attached to adapter port #1

Secondary graphics devices.
Intel(R) Graphics (Intel) Memory: 18GB, Driver date: 8-24-2026 (M-D-Y).

Integrated graphics device with 4 adapter port(s)

  • There are no monitors attached to this device!

DirectX Settings
Safe mode: Off

OpenBLAS: OpenBLAS 0.3.30 DYNAMIC_ARCH NO_AFFINITY Haswell MAX_THREADS=64.

Rhino plugins that do not ship with Rhino

Rhino plugins that ship with Rhino
C:\Program Files\Rhino 9\Plug-ins\Commands.rhp “Commands” 9.1.26300.6001
C:\Program Files\Rhino 9\Plug-ins\rdk.rhp “Renderer Development Kit”
C:\Program Files\Rhino 9\Plug-ins\RhinoAI\net8.0\RhinoAI.rhp “RhinoAI” 9.1.26300.6001
C:\Program Files\Rhino 9\Plug-ins\3dxRhino.9.rhp “3DxRhino.9”
C:\Program Files\Rhino 9\Plug-ins\AnimationTools.rhp “AnimationTools”
C:\Program Files\Rhino 9\Plug-ins\UpdatesAndStatistics\UpdatesAndStatistics.rhp “UpdatesAndStatistics” 9.1.26300.6001
C:\Program Files\Rhino 9\Plug-ins\RhinoRenderCycles.rhp “Rhino Render” 9.1.26300.6001
C:\Program Files\Rhino 9\Plug-ins\rdk_etoui.rhp “RDK_EtoUI” 9.1.26300.6001
C:\Program Files\Rhino 9\Plug-ins\NamedSnapshots.rhp “Snapshots”
C:\Program Files\Rhino 9\Plug-ins\MeshCommands.rhp “MeshCommands” 9.1.26300.6001
C:\Program Files\Rhino 9\Plug-ins\IronPython\RhinoDLR_Python.rhp “IronPython” 9.1.26300.6001
C:\Program Files\Rhino 9\Plug-ins\RhinoCycles.rhp “RhinoCycles” 9.1.26300.6001
C:\Program Files\Rhino 9\Plug-ins\Grasshopper\GrasshopperPlugin.rhp “Grasshopper” 9.1.26300.6001
C:\Program Files\Rhino 9\Plug-ins\Displacement.rhp “Displacement”
C:\Program Files\Rhino 9\Plug-ins\SectionTools.rhp “SectionTools”

Thanks,
Gerard

Hey @Gerard,

Thanks for reporting!

Have you had issues opening the GH1 scripts in GH2 and its conversion feature?

I almost wonder if we should create an MCP or extend the existing MCP so you can have Claude upload error reports somewhere like we have for our crash reports and skip the humans entirely :wink: .

YT : RH-100617 Curvature Display NullReferenceException

exactly, that’s my idea too. With some proper instructions for the users who run an Agent for doing so.

Yes, it does a great job and then there are many details that I train my Agent to update my scripts.
We can make a report about what we found if you like.

AH so it’s a collab of both to get it all working and sorted, but ultimately you can make what you need to work, work? :slight_smile:

Well, I just posted this about our overall findings with Rhino 9 and GH1 and GH2: