Extreme lag on generating the preview mesh of GH geometry

On my computer, Grasshopper hangs ~5 minutes generating the preview mesh. Though it is rapid if you disable GH preview and directly bake the geometry. The problem appears on both Rhino 5 SR14, Rhino 6 SR3.

https://drive.google.com/open?id=1f3sbOT47l1OkcUTsdJAETcf-_vZBSwSw

During the hang, the stack trace looks like this:

   at UnsafeNativeMethods.ON_Brep_CreateMesh3(IntPtr pConstBrep, IntPtr meshes, IntPtr pConstMeshParameters)
   at UnsafeNativeMethods.ON_Brep_CreateMesh3(IntPtr pConstBrep, IntPtr meshes, IntPtr pConstMeshParameters)
   at Rhino.Geometry.Mesh.CreateFromBrep(Brep brep, MeshingParameters meshingParameters)
   at Grasshopper.Kernel.Types.GH_Brep.DrawViewportMeshes(GH_PreviewMeshArgs args) in C:\dev\grasshopper\1.0\root\src\GH_Brep.vb:line 307
   at Grasshopper.Kernel.GH_Param`1.Preview_DrawMeshes(IGH_PreviewArgs args) in C:\dev\grasshopper\1.0\root\src\GH_Param.vb:line 1991
   at Grasshopper.Kernel.GH_Component.DrawViewportMeshes(IGH_PreviewArgs args) in C:\dev\grasshopper\1.0\root\src\GH_Component.vb:line 1289
   at Grasshopper.Kernel.GH_Document.PreviewPostDrawObjects(Object sender, DrawEventArgs e) in C:\dev\grasshopper\1.0\root\src\GH_Document.vb:line 1089
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at Rhino.Display.DisplayPipeline.OnPostDrawObjects(IntPtr pPipeline, IntPtr pConduit)
   at UnsafeNativeMethods.CRhinoDoc_Redraw(Int32 docId)
   at UnsafeNativeMethods.CRhinoDoc_Redraw(Int32 docId)
   at Grasshopper.Instances.RedrawAll() in C:\dev\grasshopper\1.0\root\src\GH_InstanceServer.vb:line 1109
   at Grasshopper.GUI.GH_DocumentEditor.ShadedButton_Click(Object sender, EventArgs e) in C:\dev\grasshopper\1.0\root\src\GH_DocumentEditor.vb:line 2657
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at Grasshopper.GUI.GH_Toolstrip.WndProc(Message& m) in C:\dev\grasshopper\1.0\root\src\GH_Toolstrip.vb:line 45
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

There is a known problem with preview meshing taking forever if your geometry is very far from origin.

You think it might be the same issue?

1 Like

Yes. You are right. Thank you for the prompt reply!
I could include the solution in my knowledgebase.

Thanks Keyu,

I’ve added this discussion to the report, it’s currently assigned to Steve, but he’ll be on the road for a bit longer so I don’t know when this will get investigated in earnest.