designengrlab / miconvexhull Goto Github PK
View Code? Open in Web Editor NEWA .Net fast convex hull library for 2, 3, and higher dimensions.
Home Page: http://designengrlab.github.io/MIConvexHull/
License: MIT License
A .Net fast convex hull library for 2, 3, and higher dimensions.
Home Page: http://designengrlab.github.io/MIConvexHull/
License: MIT License
I was wondering if a contributor could tell me:
Thank you for your time and for this project.
To test the API of this lib, I created input data that was not sufficent for creating an actual convex hull. This resulted in an exception. In my opinion a result object that can be in a faulted state is far more usefull when using a library like this one.
E.g.:
public enum ConvexHullCreationResultType
{
Success,
NotEnoughVerticiesForDimension,
}
public class ConvexHullCreationResult
{
//this could be null
public ConvexHull<TVertex, TFace> Result { get; }
public ConvexHullCreationResultType Outcome { get; }
}
Would you be interested in adding an API like that?
I'd like to use this library and would rather help designing and implementing such an API, than using a wrapper.
I'm trying to use MIConvexHull to generate a triangulation for scattered 2D data for heightmap, and I've apparently reduced the problem to this minimal cases:
[Test]
public void TestMi1()
{
var vertices = new List<Vertex>
{
new Vertex(1, 0.5),
new Vertex(0, 1),
new Vertex(0, 0),
new Vertex(1, 0)
};
DelaunayTriangulation<Vertex, Cell>.Create(vertices);
}
[Test]
public void TestMi2()
{
var vertices2 = new List<Vertex>
{
new Vertex(1, 1),
new Vertex(0, 1),
new Vertex(0, 0),
new Vertex(1, 0)
};
DelaunayTriangulation<Vertex, Cell>.Create(vertices2);
}
TestMi1 passes, but TestMi2 fails with
The input data is degenerate. It appears to exist in 3 dimensions,
but it is a 2 dimensional set (i.e. the point of collinear, coplanar, or co-hyperplanar.)
What's going on here ?
Suggest the mathhelper methods esp VectorBetweenVertices become static it should provide superior inlining,.
Sorry if this is a newbie question, but can you tell me why the DelaunayTriangulation method returns a list of cells with four vertices when I pass it a 3D surface?
MIConvexHull.pfx file is missing. Project can't be building.
the algo fails regularly for me with about 10 dimensions and 100 vertices. not sure if it relates to other known issues like co-linearity
Hi,
The program below is throwing exception like:
System.IndexOutOfRangeException: Index was outside the bounds of the array. at MIConvexHull.MathHelper.CalculateFacePlane(ConvexFaceInternal face, Double[] center) in C:\Users\Muti\Desktop\MIConvexHull\MIConvexHull.NET Standard\ConvexHull\MathHelper.cs:line 118
`using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
public static class Tools { public static int DBG = 0; }
static void Main(string[] args)
{
var dbg = Tools.DBG;
List<Point> points = new List<Point>();
foreach (var x in Enumerable.Range(1, 3))
foreach (var y in Enumerable.Range(1, 3))
foreach (var z in Enumerable.Range(1, 3))
foreach (var t in Enumerable.Range(1, 3))
points.Add(new Point(x, y, z, t));
var hull = MIConvexHull.ConvexHull.Create(points);
if (hull is null)
dbg = Tools.DBG;
var hullResult = hull.Result;
if (hullResult is null)
dbg = Tools.DBG;
var hullPoints = hullResult.Points.ToList();
if (hullPoints is null)
dbg = Tools.DBG;
}
public class Point : MIConvexHull.IVertex
{
private double[] Values = new double[] { };
public Point(double a, double b, double c, double d)
{
Values = new double[] { a, b, c, d };
}
public double[] Position
{
get
{
return Values;
}
}
}
}
}
`
Hi,
Is it possible to use this library for constrainted delunay triangulation? I've tried MIConvexHull and it is generating just the convex hull by default. Looking at the code it doesn't seem to have support for that.
Is it be possible to add that functionality to this library? If so, how hard would it be? Could you provide any suggestions where to look for that logic or how can i implement that?
I've looked at Triangle, Triangle.NET and they seems to be much more comlex compared to what i need. My input is a set of points that never contain any holes, but they have concavities. (basically shapes represented by their boundaries) My understanding about doing this so far is, that i need to convert my vertices to a PSGL somehow, then it could be given as an input for the constrainted triangulation. I pretty much need the output as a list of triangles, which you already provide. (always 2D) I need to maintain the code, therefore i would prefer to avoid the usage of any complex libraries if possible.
Thanks in advance.
Cheers,
Kristof
I have a normal C#/.Net 4.6.1 project. If I install NuGet package 1.1.16.905 everything works fine. If I install Nuget package 1.1.17.214 I get the error message that I've pasted at the bottom whenever I use anything from the MIConvexHull package.
It seems you've accidentally added a dependency to a .net core version of the assembly System.Runtime
to the normal .Net package. I've tried to look around if I could solve the problem for you, but I don't see any .nuspec files in the repository.
System.IO.FileNotFoundException was unhandled
FileName=System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
FusionLog==== Pre-bind state information ===
LOG: DisplayName = System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
LOG: Appbase = file:///D:/Projects/C#/TexMorph/TexMorph/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : MIConvexHull.NET Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\Projects\C#\TexMorph\TexMorph\bin\Debug\TexMorph.vshost.exe.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: Attempting download of new URL file:///D:/Projects/C#/TexMorph/TexMorph/bin/Debug/System.Runtime.DLL.
LOG: Attempting download of new URL file:///D:/Projects/C#/TexMorph/TexMorph/bin/Debug/System.Runtime/System.Runtime.DLL.
LOG: Attempting download of new URL file:///D:/Projects/C#/TexMorph/TexMorph/bin/Debug/System.Runtime.EXE.
LOG: Attempting download of new URL file:///D:/Projects/C#/TexMorph/TexMorph/bin/Debug/System.Runtime/System.Runtime.EXE.
HResult=-2147024894
Message=Could not load file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Source=TexMorph.Viewer
StackTrace:
at TexMorph.Viewer.Layers.DeformationMesh.Triangulate(IList`1 vertices)
at TexMorph.Viewer.Layers.DeformationMesh.Render(Vector2 bottomLeft, Vector2 topRight) in D:\Projects\C#\TexMorph\TexMorph.Viewer\Layers\DeformationMesh.cs:line 56
at TexMorph.Viewer.Layers.LayerBatcher.Draw(OrthographicCamera camera) in D:\Projects\C#\TexMorph\TexMorph.Viewer\Layers\LayerBatcher.cs:line 55
at TexMorph.Viewer.RenderLoop.Draw(GameTime gameTime) in D:\Projects\C#\TexMorph\TexMorph.Viewer\RenderLoop.cs:line 64
at MonoGame.Framework.WpfInterop.WpfGame.Render(GameTime time)
at MonoGame.Framework.WpfInterop.D3D11Host.OnRendering(Object sender, EventArgs eventArgs)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at TexMorph.App.Main()
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
So I tried to find Delaunay Triangle for a set of 134 points. After getting the list of triangular cells, I tried to plot them on Python, but the result is incorrect. Did I miss something when trying to execute CreateDelaunay()?
private static IEnumerable<DefaultTriangulationCell> DelaunayTriangulation(Dictionary<Point, double> dataForInterpolation)
{
List vertices = new List();
foreach (var item in dataForInterpolation)
{
vertices.Add(new Vertex(item.Key.X, item.Key.Y));
}
var delaunayTriangles = Triangulation.CreateDelaunay<Vertex, DefaultTriangulationCell>(vertices).Cells;
return delaunayTriangles;
}
Why is there a "new" requirement? IVertex2D only has read-only properties, so a constructor with parameters is necessary, whilst a parameterless constructor (the result of "new" requirement) is pointless, unless you do some hefty reflection tricks...
Found that the FindInitialPoints() method in the ConvexHullAlgorithm.Initialize script, at line 500, was not correctly throwing an error when a degenerate set of data was found. We found that this was due to the conditional if the if statement " && IsLifted"
While ConvexHull.Create
has an overload which accepts tolerance, Triangulation.CreateDelaunay
does not. Would be nice to have that.
I'm using the Voronoi portion of this and was wondering if it is possible to generate the data structure so that the TCell knows which of the TEdges it is bounded by. It seems like I can get out a list of the original points with who it's neighbors are, and a list of all edges on the graph.
Hi,
Is there any way to know the index of hull points index regarding input points.
In the image below, on the left you see input points and on the right convex hull as mesh and its vertices.
For sure hull vertices are indexed differently than original points.
But is there any way to know that the hull.Point[4] is the first point of input points?
I generate convex hull like this:
var vertices = CreateHullVertices(x);
ConvexHull<DefaultVertex,DefaultConvexFace<DefaultVertex>> hull = ConvexHull.Create(vertices);
Mesh mesh = new Mesh();
var convexHullVertices = hull.Points.ToArray();
foreach(DefaultVertex pt in hull.Points){
double[] pos = pt.Position;
mesh.Vertices.Add(new Point3d(pos[0], pos[1], pos[2]));
}
foreach( DefaultConvexFace<DefaultVertex> f in hull.Faces){
int a = Array.IndexOf(convexHullVertices, f.Vertices[0]);
int b = Array.IndexOf(convexHullVertices, f.Vertices[1]);
int c = Array.IndexOf(convexHullVertices, f.Vertices[2]);
mesh.Faces.AddFace(a, b, c);
}
It'd be great to have MIConvexHull NuGet package strong-named (signed).
I believe I have found a very simple case for which a delaunay triangulation cannot be calculated. The points used are:
(-1, -1),
(-1, 1),
(1, -1),
(1, 1)
I believe any square across (0, 0) will cause a ConvexHullGenerationException to be thrown when calling DelaunayTriangulation<...>.Create(..);
Hi,
I was wondering if the API provides for run-time modification of vertices (particularly in the case of the 2d Delaunay and Voronoi diagrams), so that vertices can be added or removed individually without baking the entire mesh again? I haven't found anything in the repo so far indicating support for this though. Am I missing something, or has it not been implemented? And if not, are there any plans in the future to implement this feature? Thanks in advance.
Hello! :-)
Currently, I am making some experiments with your convex hull lib.
When I try your eifelturm sample, this works perfectly, as you can seen in the following pictures.
If I try to simplify another CAD like this one (monkey head) below, it does not output the result that i am expect. What do you think - is it a problem of your algorithm, or is this probem somewhere else?
Convex Hull
Thanks in adavance,
Dominik
Hi.
I have a 2D rectangle for which the convex hull is calculated (which should be equal to the rectangle), but one face is missing and instead one face is duplicated.
The triangulation of the rectangle is correct.
A unit test is attached (it's a C# file, but Github only accepts .txt).
MIConvexHullTest.txt
Version: 1.1.17.1019
Thank you for your help and effort :)
Hi, I want to retrieve the triangles on the convex hull but the triangulation method (Triangulation.CreateDelaunay) on the 3D hull points returns both internal & external triangles. Is there some way we could only filter the triangles on the hull surface ?
I am trying to create an open surface reconstruction from a point cloud.
My code looks like this:
IList<CHVertex> verticies = new List<CHVertex>();
var test = Triangulation.CreateDelaunay(verticies);
verticies has 520 data points that I have validated.
Stacktrace is:
at MIConvexHull.ConvexHullAlgorithm.CalculateVertexCentriod(IList`1 vertexIndices) in C:\Users\campmatt\source\repos\MIConvexHull\MIConvexHull.NET Standard\ConvexHull\ConvexHullAlgorithm.Initialize.cs:line 491
This is the line 491.
What could be causing this?
I have added a file with my raw data points.
point cloud.txt
Hi, first off, many thanks for the great work in this library!
We've been using it in an open-source library called RefineryToolkits and have found an issue that we wanted to discuss.
It seems that ConvexHull
fails to be created when the input points are co-linear
. Specifically, this line of code does not throw, but returns a null when points are co-linear.
var convexHull = MIConvexHull.ConvexHull.Create(vertices);
Below is a list of points with the coordinates that highlighted the failure during a recent hackathon :
X 260 Y 600
X 285 Y 600
X 310 Y 600
X 335 Y 600
To solve this in short-term, we are adding a co-linearity check in our library and handle that case separately, but was wondering if it's something that you'd like to address in the MIConvexHull
library itself so everyone has access to the fix ?
Let us know 👍
As you know, most of 3D applications in C# are using struct
for Vertex
or Vector
. Because it does not generate garbage at all in most cases.
However, In this situation, cannot access the member X, Y, Z with byte offset. Such as 0 for X, 1 for Y etc. If really need to access the member by index and must avoid switch
, use array instead even though it will be a garbage.
I wonder that, the MIConvexHull really need array for the vertex?
I can see the IVertex
interface. It should work as reference and a struct
will be boxed which has implemented the interface.
But, should avoid boxing/unboxing as well in performance critical situation.
I suggest that adding a struct Vertex
the MIConvexHull own, or use a single double
collection for whole vertices.
I have a weird thing going, I guess I'm doing something wrong.
I ask the library to perform a Delaunay triangulation on 4 points (by the way, it's a pity it cannot do that for 3 points...). But only one cell is produced.
Input data:
(0,0)
(0,-2)
(-0.71,-1.5)
(-0.71,-0.5)
Output data contains the last 3 points, not (0,0).
And another thing - if I change the order of the last two points in the input, no cell is produced whatsoever. Does triangulation depend on the order of the points? If so, how can I determine the order in a 2D or 3D world?
P.S. Don't bother about TestPoint3D
, I project the 3D points onto a plane, and the 2D coordinates are projection coordinates.
I believe that the .vs contains user-specific information and it doesn't need to be part of the GitHub repo.
first of all : thanks for your lib.
Question: is there any built in function to determine if a point is inside a 3D convex polygon ?
Thanks for your kind reply in advance,
Péter
Hello
I was comparing the output from two cases
I see that the hull created in cases I and II are different with slightly different number of points. Is this expected from the quickHull algortihm ?
I have generated several convex hulls with various meshes.
It works fine in most cases but sometimes unknown error returned from Create()
.
Because of ArgumentException
it tells key duplication of a dictionary or hashmap.
Strange thing is that if try to generate again, generation being success even though passing same vertices what was used in previous call.
List<double[]> sources = new List<double[]>(sourcePositions.Count);
sources.AddRange(from p in sourcePositions select new double[] { p.X, p.Y, p.Z });
ConvexHullCreationResult<DefaultVertex, DefaultConvexFace<DefaultVertex>> result = ConvexHull.Create(sources); // Sometimes fail.
if (null == result.Result)
{
System.Diagnostics.Debug.WriteLine(result.ErrorMessage);
result = ConvexHull.Create(sources); // Almost success.
}
I'm using NuGet and the Create()
catch all of exceptions so I cannot provide more information such as stack trace. I think, removing that catch
is better if you don't have proper solution.
I'm trying to implement your delaunay triangulation in my code, but everytime i build it visual studio shows me this error
The input data is degenerate. It appears to exist in 4 dimensions, but it is a 3 dimensional set (i.e. the point of collinear, coplanar, or co-hyperplanar.)
Here is the code I'm using
DefaultVertex[] v = new DefaultVertex[5];
v[0] = new DefaultVertex();
v[0].Position = new double[3] { 5.1, 5.8, 0.0 };
v[1] = new DefaultVertex();
v[1].Position = new double[3] { 7.0, 2.8, 0.0 };
v[2] = new DefaultVertex();
v[2].Position = new double[3] { 4.8, 0.1, 0.0 };
v[3] = new DefaultVertex();
v[3].Position = new double[3] { 1.5, 1.4, 0.0 };
v[4] = new DefaultVertex();
v[4].Position = new double[3] { 1.7, 4.9, 0.0 };
ITriangulation<DefaultVertex, DefaultTriangulationCell<DefaultVertex>> r = Triangulation.CreateDelaunay(v);
Hi.
Thanks for the great library. I was going to use it to triangulate sets of lat/lang values. Unfortunately the algorithm throws a NullReferenceException in CalculateVertexCentroid because vertexIndices is null. Turns out that variance between points is too small (in my case longitude changes in 38.3536 - 38.3668 range, and latitude in even smaller range). If I multiply the values by 10000 triangulation runs just fine.
Is this the intended/expected behaviour?
The algorithm is too complex for me to figure out if there is a more elegant solution than the one I use.
I tried to do triangulation of 3d cube.
List<IVertex> vertices = new List<IVertex>();
vertices.Add(new Vertex(-10, -10, -10));
vertices.Add(new Vertex(10, -10, -10));
vertices.Add(new Vertex(-10, 10, -10));
vertices.Add(new Vertex(10, 10, -10));
vertices.Add(new Vertex(-10, -10, 10));
vertices.Add(new Vertex(10, -10, 10));
vertices.Add(new Vertex(-10, 10, 10));
vertices.Add(new Vertex(10, 10, 10));
var result = Triangulation.CreateDelaunay<IVertex>(vertices).Cells;
but get en exception "Failed to find initial simplex shape with non-zero volume. While data appears to be in 4 dimensions, the data is all co-planar (or collinear, co-hyperplanar) and is representable by fewer dimensions."
It's pretty simple triangulation, but why it failed?
When triangulating a cube, you should get 5 or 6 triangles.
Then i was changed one vertex coordinate (-10, -10, -10) to (-10, -10, -9) .
And it worked, but. It get one additional squre shape cell,
But i got six triangle, and one square, i'm confused.
When triangulating a cube, you should get 5 or 6 triangles.
Shape1:
10 : 10 : 10
10 : -10 : -10
10 : 10 : -10
-10 : -10 : -9
Shape2:
10 : 10 : 10
-10 : 10 : -10
-10 : 10 : 10
-10 : -10 : -9
Shape3:
10 : 10 : 10
-10 : -10 : 10
10 : -10 : 10
-10 : -10 : -9
Shape4:
-10 : -10 : -9
-10 : 10 : -10
10 : 10 : -10
10 : 10 : 10
Shape5:
-10 : -10 : -9
10 : -10 : -10
10 : -10 : 10
10 : 10 : 10
Shape6:
-10 : -10 : -9
-10 : -10 : 10
-10 : 10 : 10
10 : 10 : 10
Shape7:
10 : 10 : -10
10 : -10 : -10
-10 : 10 : -10
-10 : -10 : -9
I tried rectangular parallelepiped and get similar result
AssemblyVersion: 1.1.19.1018
Hi, is this library compatible with Net Core 1.0 ? Im trying to install it but got some errors. Thanks
The convex hull generator seems to like to fail with certain combinations of 3D vertices at certain positions. This is just one example of vertices that cause this to happen.
interestingly enough, offsetting these vertices to another position seems to allow the convex huller to work just fine. I am running the latest version of the library, taken directly from the github master branch.
Error message:
Failed to find initial simplex shape with non-zero volume. While data appears to be in 3 dimensions, the data is all co-planar (or collinear, co-hyperplanar) and is representable by fewer dimensions.
Hi, I have noticed that someone previously asked to get the nuget package signed and you had responded saying that it had been done. However, the package you are distributing on nuget.org is still not signed - when I download and try to build it into my signed solution, Visual Studio complains. Please could you look into this?
Hello.
There seems to an issue with DetermineDimension() in ConvexHullAlgorithm.Initialize.cs.
It uses NumberOfVertices as an indexer:
dimensions.Add(Vertices[r.Next(NumberOfVertices)].Position.Length);
which is taken from array length of input.
If random produces a maximum number - an out of range exception will be produced because array indexer is 0 based. It probably should be
dimensions.Add(Vertices[r.Next(NumberOfVertices-1)].Position.Length);
Thank you.
Hello all! I know this really isnt a forum, and is actually an issue thingy. I was actually looking for help converting the seventh solution (Delaunay Generation) to Unity, using their Mesh System. Could i possibly get help from the developer itself?
I must either do this or convert the generated Visual Studio Model3DClass to a .fbx / .dae / .obj file.
Any help?
Hello together,
i want to try the project, because i am searching a algorithm for dealunay-triangulation. So I want to compile the project, but it did not work. The solution does not compile out of the box. I do not konw hat could be wrong.
I attached the output-error-message from the compile as image.
I use Microsoft Visual Studio Community 2017 Version 15.6.7
Can you help me please.
Thank you
I'm having a bit of trouble understanding what VoronoiMesh is actually giving me.
Example:
List<DefaultVertex> anchors = new List<DefaultVertex>();
anchors.Add(new DefaultVertex() {Position = new double[]{-1, 1}});
anchors.Add(new DefaultVertex() {Position = new double[]{-1, -1}});
anchors.Add(new DefaultVertex() {Position = new double[]{1, -1}});
anchors.Add(new DefaultVertex() {Position = new double[]{1, 1}});
anchors.Add(new DefaultVertex() {Position = new double[]{0, 0}});
var mesh = VoronoiMesh.Create(anchors);
The result of this is a mesh object that contains 4 vertices and 4 edges.
From example 5 I am to understand that mesh.Vertices should be the Voronoi cells but they seem to be triangles from the Delauny triangulation and not the Voronoi cells. What am I not understanding here?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.