Facepunch / sbox-sdf

Library providing marching cubes / squares mesh generation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exception of type 'System.Exception' was thrown

bakscratch opened this issue · comments

Should be more reliable now, I'll keep this issue open for a bit to see if it comes up again.

I can get these pretty reliably in Grubs.

System.Exception: Exception of type 'System.Exception' was thrown.
   at Sandbox.Polygons.PolygonMeshBuilder.FindAboveSweepEdge(Edge& edge) in PolygonMeshBuilder.Fill.cs:line 190
   at Sandbox.Polygons.PolygonMeshBuilder.Fill_SplitIntoMonotonicPolygons() in PolygonMeshBuilder.Fill.cs:line 258
   at Sandbox.Polygons.PolygonMeshBuilder.Fill() in PolygonMeshBuilder.Fill.cs:line 17
   at Sandbox.Sdf.Sdf2DMeshWriter.WriteRenderMesh(Sdf2DLayer layer) in 2D/Sdf2DMeshWriter.cs:line 570
   at Sandbox.Sdf.Sdf2DMeshWriter.Write(Sdf2DArrayData data, Sdf2DLayer layer, Boolean renderMesh, Boolean collisionMesh) in 2D/Sdf2DMeshWriter.cs:line 438
   at Sandbox.Sdf.Sdf2DArray.WriteTo(Sdf2DMeshWriter writer, Sdf2DLayer layer, Boolean renderMesh, Boolean collisionMesh) in 2D/Sdf2DArray.cs:line 153
   at Sandbox.Sdf.Sdf2DChunk.OnUpdateMeshAsync() in 2D/Sdf2DChunk.cs:line 60

Reproduction steps:

  1. Boot up Grubs.
  2. In the Terrain Options, set Heightmap Amplitude and Frequency to approximately 3/4ths the length of the slider.
  3. Press Apply. If you don't get the error, try 2-3 more times.

I find I can get the error pretty regularly this way, but it is not consistent. And often, after experiencing the error once, it does not happen again until a Grubs gamemode restart.

image