Skip to content

Script error (RefineSubRoutine) when trying to build a mesh #4

@gujhack

Description

@gujhack

I've generated a list of Vector2 from a Voronoi generator.
Each Vector2 is a vertex of a Voronoi cell, ordered clockwise.
The triangulation builds a few meshes, then I get this error:

NullReferenceException: Object reference not set to an instance of an object
mattatz.Triangulation2DSystem.Triangulation2D.RefineSubRoutine (System.Single angle, System.Single threshold) (at Assets/scripts/Triangulation2D/Triangulation2D.cs:331)
mattatz.Triangulation2DSystem.Triangulation2D.Refine (System.Single angle, System.Single threshold) (at Assets/scripts/Triangulation2D/Triangulation2D.cs:320)
mattatz.Triangulation2DSystem.Triangulation2D.Triangulate (UnityEngine.Vector2[] points, System.Single angle, System.Single threshold) (at Assets/scripts/Triangulation2D/Triangulation2D.cs:181)
mattatz.Triangulation2DSystem.Triangulation2D..ctor (mattatz.Triangulation2DSystem.Polygon2D polygon, System.Single angle, System.Single threshold) (at Assets/scripts/Triangulation2D/Triangulation2D.cs:44)
Region..ctor (UnityEngine.Vector2 spawn, System.Collections.Generic.List`1[T] vertices) (at Assets/scripts/Region.cs:23)
VoronoiDemo.Generate () (at Assets/scripts/VoronoiDemo.cs:80)
VoronoiDemo.OnValidate () (at Assets/scripts/VoronoiDemo.cs:51)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions