Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constrained delaunay failing at PointTriangulationIntersection.TriangulationWalk #8

Open
johnetc opened this issue Oct 11, 2021 · 2 comments

Comments

@johnetc
Copy link

johnetc commented Oct 11, 2021

Hello. I'm trying to create a constrained delaunay graph using _Delaunay.ConstrainedBySloan and I'm getting the below error:

NullReferenceException: Object reference not set to an instance of an object
Habrador_Computational_Geometry.PointTriangulationIntersection.TriangulationWalk

_Habrador Computational Geometry Library/1. Intersection/PointTriangulationIntersection.cs:149

My parameters are in the right clockwise (or anti clockwise) direction so I'm not sure what I'm missing.

Is there anything you can suggest that might help? I couldn't see a functioning example for constrained delaunay other than the ear clipping one, and that seems to fail with more than one hole in a square hull. Thanks!

@korobetski
Copy link

Same for me, here is the complete error flow :

NullReferenceException: Object reference not set to an instance of an object
Habrador_Computational_Geometry.PointTriangulationIntersection.TriangulationWalk (Habrador_Computational_Geometry.MyVector2 p, Habrador_Computational_Geometry.HalfEdgeFace2 startTriangle, Habrador_Computational_Geometry.HalfEdgeData2 triangulationData, System.Collections.Generic.List`1[T] visitedTriangles) (at Assets/Plugin/Habrador/1. Intersection/PointTriangulationIntersection.cs:149)
Habrador_Computational_Geometry.DelaunayIncrementalSloan.InsertNewPointInTriangulation (Habrador_Computational_Geometry.MyVector2 p, Habrador_Computational_Geometry.HalfEdgeData2 triangulationData, System.Int32& missedPoints, System.Int32& flippedEdges) (at Assets/Plugin/Habrador/4. Triangulation/Delaunay/DelaunayIncrementalSloan.cs:98)
Habrador_Computational_Geometry.DelaunayIncrementalSloan.GenerateTriangulation (System.Collections.Generic.HashSet`1[T] points, Habrador_Computational_Geometry.HalfEdgeData2 triangulationData) (at Assets/Plugin/Habrador/4. Triangulation/Delaunay/DelaunayIncrementalSloan.cs:63)
Habrador_Computational_Geometry._Delaunay.PointByPoint (System.Collections.Generic.HashSet`1[T] points, Habrador_Computational_Geometry.HalfEdgeData2 triangleData) (at Assets/Plugin/Habrador/4. Triangulation/Delaunay/_Delaunay.cs:27)
Habrador_Computational_Geometry.DelaunayToVoronoiAlgorithm.GenerateVoronoiDiagram (System.Collections.Generic.HashSet`1[T] sites) (at Assets/Plugin/Habrador/5. Voronoi diagram/DelaunayToVoronoiAlgorithm.cs:17)
Habrador_Computational_Geometry._Voronoi.DelaunyToVoronoi (System.Collections.Generic.HashSet`1[T] sites) (at Assets/Plugin/Habrador/5. Voronoi diagram/_Voronoi.cs:13)

@xknmdss
Copy link

xknmdss commented Mar 6, 2024

same for me NullReferenceException: Object reference not set to an instance of an object
Habrador_Computational_Geometry.PointTriangulationIntersection.TriangulationWalk (Habrador_Computational_Geometry.MyVector2 p, Habrador_Computational_Geometry.HalfEdgeFace2 startTriangle, Habrador_Computational_Geometry.HalfEdgeData2 triangulationData, System.Collections.Generic.List1[T] visitedTriangles) (at Assets/Scripts/1. Intersection/PointTriangulationIntersection.cs:149) Habrador_Computational_Geometry.DelaunayIncrementalSloan.InsertNewPointInTriangulation (Habrador_Computational_Geometry.MyVector2 p, Habrador_Computational_Geometry.HalfEdgeData2 triangulationData, System.Int32& missedPoints, System.Int32& flippedEdges) (at Assets/Scripts/4. Triangulation/Delaunay/DelaunayIncrementalSloan.cs:98) Habrador_Computational_Geometry.DelaunayIncrementalSloan.GenerateTriangulation (System.Collections.Generic.HashSet1[T] points, Habrador_Computational_Geometry.HalfEdgeData2 triangulationData) (at Assets/Scripts/4. Triangulation/Delaunay/DelaunayIncrementalSloan.cs:63)
Habrador_Computational_Geometry._Delaunay.PointByPoint (System.Collections.Generic.HashSet1[T] points, Habrador_Computational_Geometry.HalfEdgeData2 triangleData) (at Assets/Scripts/4. Triangulation/Delaunay/_Delaunay.cs:27) Habrador_Computational_Geometry.ConstrainedDelaunaySloan.GenerateTriangulation (System.Collections.Generic.HashSet1[T] points, System.Collections.Generic.List1[T] hull, System.Collections.Generic.HashSet1[T] holes, System.Boolean shouldRemoveTriangles, Habrador_Computational_Geometry.HalfEdgeData2 triangleData) (at Assets/Scripts/4. Triangulation/Delaunay/ConstrainedDelaunaySloan.cs:40)
ProjectPointsToTerrain.CreateHighlightedArea (UnityEngine.Vector3[] boundaryPoints) (at Assets/ProjectPointsToTerrain.cs:146)
IconManager.OnClickCropIcon (Crop crop, UnityEngine.Transform transform, System.String areaId, System.Collections.Generic.List1[T] boundary) (at Assets/IconManager.cs:358) CropIconController.SpanSecondContent () (at Assets/CropIconController.cs:42) CropIconController.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at Assets/CropIconController.cs:36) UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at ./Library/PackageCache/[email protected]/Runtime/EventSystem/ExecuteEvents.cs:57) UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction1[T1] functor) (at ./Library/PackageCache/[email protected]/Runtime/EventSystem/ExecuteEvents.cs:272)
UnityEngine.EventSystems.EventSystem:Update() (at ./Library/PackageCache/[email protected]/Runtime/EventSystem/EventSystem.cs:530)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants