├── .gitattributes ├── .gitignore ├── .vs ├── MIConvexHull │ └── v15 │ │ └── Server │ │ └── sqlite3 │ │ ├── db.lock │ │ ├── storage.ide │ │ ├── storage.ide-shm │ │ └── storage.ide-wal ├── ProjectSettings.json ├── VSWorkspaceState.json └── slnx.sqlite ├── Examples ├── 10.NET Core Tester │ ├── 10.NET Core Tester.csproj │ ├── Program.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── project.json ├── 1TestEXE for MIConvexHull-2D │ ├── 1TestEXE for MIConvexHull-2D.csproj │ ├── Ouellet Method │ │ ├── ConvexHull.cs │ │ ├── ConvexHullThreadUsage.cs │ │ ├── Geometry.cs │ │ ├── Limit.cs │ │ ├── PointInfo.cs │ │ ├── Quadrant.cs │ │ ├── QuadrantSpecific1.cs │ │ ├── QuadrantSpecific2.cs │ │ ├── QuadrantSpecific3.cs │ │ └── QuadrantSpecific4.cs │ ├── Program.cs │ ├── Window2DPlot.xaml │ ├── Window2DPlot.xaml.cs │ ├── app.config │ └── vertex.cs ├── 2TestEXE for MIConvexHull-No Interfaces │ ├── 2TestEXE for MIConvexHull-No Interfaces.csproj │ ├── Program.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── app.config │ └── edge case to debug1.txt ├── 3DConvexHullWPF │ ├── 3DConvexHullWPF.csproj │ ├── App.xaml │ ├── App.xaml.cs │ ├── MainWindow.xaml │ ├── MainWindow.xaml.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── References │ │ ├── Petzold.Media3D.dll │ │ ├── StarMath.XML │ │ └── StarMath.dll │ ├── app.config │ ├── face.cs │ └── vertex.cs ├── 4 DelaunayAndVoronoiWPF │ ├── 4 DelaunayAndVoronoiWPF.csproj │ ├── App.xaml │ ├── App.xaml.cs │ ├── Cell.cs │ ├── MainWindow.xaml │ ├── MainWindow.xaml.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── References │ │ ├── Petzold.Media3D.dll │ │ └── StarMath.dll │ ├── app.config │ └── vertex.cs ├── 5TestEXE for MIConvexHull-6D Voronoi │ ├── 5TestEXE for MIConvexHull-6D Voronoi.csproj │ ├── Program.cs │ ├── StyleCop.Cache │ ├── app.config │ └── vertex.cs ├── 6UsingHelixStudio │ ├── 6Using Helix To Open Models.csproj │ ├── App.xaml │ ├── App.xaml.cs │ ├── MainWindow.xaml │ ├── MainWindow.xaml.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── app.config │ └── packages.config ├── 7DelaunayWPF │ ├── 7DelaunayWPF.csproj │ ├── App.xaml │ ├── App.xaml.cs │ ├── MainWindow.xaml │ ├── MainWindow.xaml.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── RandomTriangulation.cs │ ├── Tetrahedron.cs │ ├── Trackball.cs │ ├── Vertex.cs │ └── app.config ├── 8PerformanceTests │ ├── 8PerformanceTests.csproj │ ├── Program.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── app.config └── 9BatchConvexHullTest │ ├── 9BatchConvexHullTest.csproj │ ├── Program.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── Window3DPlot.xaml │ ├── Window3DPlot.xaml.cs │ ├── app.config │ └── packages.config ├── LICENSE.txt ├── MIConvexHull.NET Standard ├── Constants.cs ├── ConvexHull.cs ├── ConvexHull │ ├── Collections.cs │ ├── ConvexFace.cs │ ├── ConvexHullAlgorithm.2D.cs │ ├── ConvexHullAlgorithm.Initialize.cs │ ├── ConvexHullAlgorithm.MainLoop.cs │ ├── DataModel.cs │ ├── MathHelper.cs │ └── ObjectManager.cs ├── ConvexHullCreationResultOutcome.cs ├── ConvexHullGenerationException.cs ├── IVertex.cs ├── MIConvexHull.NET Standard.csproj ├── Triangulation.cs └── Triangulation │ ├── DelaunayTrianglationInternal.cs │ ├── DelaunayTriangulation.cs │ ├── TriangulationCell.cs │ ├── VoronoiEdge.cs │ └── VoronoiMesh.cs ├── MIConvexHull.sln ├── MIConvexHull ├── Constants.cs ├── ConvexHull.cs ├── ConvexHull │ ├── Collections.cs │ ├── ConvexFace.cs │ ├── ConvexHullAlgorithm.2D.cs │ ├── ConvexHullAlgorithm.Initialize.cs │ ├── ConvexHullAlgorithm.MainLoop.cs │ ├── DataModel.cs │ ├── MathHelper.cs │ └── ObjectManager.cs ├── ConvexHullCreationResultOutcome.cs ├── ConvexHullGenerationException.cs ├── IVertex.cs ├── Triangulation.cs └── Triangulation │ ├── DelaunayTrianglationInternal.cs │ ├── DelaunayTriangulation.cs │ ├── TriangulationCell.cs │ ├── VoronoiEdge.cs │ └── VoronoiMesh.cs ├── README.md ├── TestFiles ├── 100.stl ├── 3_bananas.amf.stl ├── Beam_Boss.STL ├── Casing.stl ├── DinoRider.3ds ├── Dog.3ds ├── Ferarri40.3ds ├── LeonardoVehicle.3ds ├── Pump-1.STL ├── TXT - G5 support de carrosserie-1.STL ├── Temp.stl ├── Tetrahedron.STL ├── Wedge.STL ├── Z665.stl ├── adaptor.stl ├── brace.stl ├── bunny.objz ├── cube.stl ├── cvxhullProb120.stl ├── cvxhullProb13.stl ├── cvxhullProb200.stl ├── cvxhullProb5.stl ├── cvxhullProb55.stl ├── cvxhullProb61.stl ├── cvxhullProb8.ply.stl ├── mendel_extruder.stl ├── off_axis_box.STL ├── piston.STL ├── radiobox.stl ├── simple_damper.STL ├── spherebox.stl └── sth2.STL └── packages ├── HelixToolkit.2015.1.715 ├── AUTHORS ├── CONTRIBUTORS ├── HelixToolkit.2015.1.715.nupkg ├── LICENSE ├── README.md └── lib │ └── portable-net4+sl4+wp71+win8 │ ├── HelixToolkit.XML │ └── HelixToolkit.dll ├── HelixToolkit.Wpf.2015.1.715 ├── AUTHORS ├── CONTRIBUTORS ├── HelixToolkit.Wpf.2015.1.715.nupkg ├── LICENSE ├── README.md └── lib │ ├── net40 │ ├── HelixToolkit.Wpf.XML │ └── HelixToolkit.Wpf.dll │ └── net45 │ ├── HelixToolkit.Wpf.XML │ └── HelixToolkit.Wpf.dll └── PropertyTools.Wpf.2015.2.0 ├── AUTHORS ├── CONTRIBUTORS ├── LICENSE ├── PropertyTools.Wpf.2015.2.0.nupkg ├── README.md └── lib ├── net40 ├── PropertyTools.Wpf.XML ├── PropertyTools.Wpf.dll ├── PropertyTools.dll └── PropertyTools.xml ├── net45 ├── PropertyTools.Wpf.XML ├── PropertyTools.Wpf.dll ├── PropertyTools.dll └── PropertyTools.xml └── portable-net40+sl5+wp8+win8 ├── PropertyTools.XML └── PropertyTools.dll /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ################# 33 | ## Visual Studio 34 | ################# 35 | 36 | ## Ignore Visual Studio temporary files, build results, and 37 | ## files generated by popular Visual Studio add-ons. 38 | 39 | # User-specific files 40 | *.suo 41 | *.user 42 | *.sln.docstates 43 | 44 | # Build results 45 | 46 | [Dd]ebug/ 47 | [Rr]elease/ 48 | x64/ 49 | build/ 50 | [Bb]in/ 51 | [Oo]bj/ 52 | .vs 53 | # MSTest test Results 54 | [Tt]est[Rr]esult*/ 55 | [Bb]uild[Ll]og.* 56 | 57 | *_i.c 58 | *_p.c 59 | *.ilk 60 | *.meta 61 | *.obj 62 | *.pch 63 | *.pdb 64 | *.pgc 65 | *.pgd 66 | *.rsp 67 | *.sbr 68 | *.tlb 69 | *.tli 70 | *.tlh 71 | *.tmp 72 | *.tmp_proj 73 | *.log 74 | *.vspscc 75 | *.vssscc 76 | .builds 77 | *.pidb 78 | *.log 79 | *.scc 80 | 81 | # Visual C++ cache files 82 | ipch/ 83 | *.aps 84 | *.ncb 85 | *.opensdf 86 | *.sdf 87 | *.cachefile 88 | 89 | # Visual Studio profiler 90 | *.psess 91 | *.vsp 92 | *.vspx 93 | 94 | # Guidance Automation Toolkit 95 | *.gpState 96 | 97 | # ReSharper is a .NET coding add-in 98 | _ReSharper*/ 99 | *.[Rr]e[Ss]harper 100 | 101 | # TeamCity is a build add-in 102 | _TeamCity* 103 | 104 | # DotCover is a Code Coverage Tool 105 | *.dotCover 106 | 107 | # NCrunch 108 | *.ncrunch* 109 | .*crunch*.local.xml 110 | 111 | # Installshield output folder 112 | [Ee]xpress/ 113 | 114 | # DocProject is a documentation generator add-in 115 | DocProject/buildhelp/ 116 | DocProject/Help/*.HxT 117 | DocProject/Help/*.HxC 118 | DocProject/Help/*.hhc 119 | DocProject/Help/*.hhk 120 | DocProject/Help/*.hhp 121 | DocProject/Help/Html2 122 | DocProject/Help/html 123 | 124 | # Click-Once directory 125 | publish/ 126 | 127 | # Publish Web Output 128 | *.Publish.xml 129 | *.pubxml 130 | *.publishproj 131 | 132 | # NuGet Packages Directory 133 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 134 | #packages/ 135 | 136 | # Windows Azure Build Output 137 | csx 138 | *.build.csdef 139 | 140 | # Windows Store app package directory 141 | AppPackages/ 142 | 143 | # Others 144 | sql/ 145 | *.Cache 146 | ClientBin/ 147 | [Ss]tyle[Cc]op.* 148 | ~$* 149 | *~ 150 | *.dbmdl 151 | *.[Pp]ublish.xml 152 | *.pfx 153 | *.publishsettings 154 | 155 | # RIA/Silverlight projects 156 | Generated_Code/ 157 | 158 | # Backup & report files from converting an old project file to a newer 159 | # Visual Studio version. Backup files are not needed, because we have git ;-) 160 | _UpgradeReport_Files/ 161 | Backup*/ 162 | UpgradeLog*.XML 163 | UpgradeLog*.htm 164 | 165 | # SQL Server files 166 | App_Data/*.mdf 167 | App_Data/*.ldf 168 | 169 | ############# 170 | ## Windows detritus 171 | ############# 172 | 173 | # Windows image file caches 174 | Thumbs.db 175 | ehthumbs.db 176 | 177 | # Folder config file 178 | Desktop.ini 179 | 180 | # Recycle Bin used on file shares 181 | $RECYCLE.BIN/ 182 | 183 | # Mac crap 184 | .DS_Store 185 | 186 | 187 | ############# 188 | ## Python 189 | ############# 190 | 191 | *.py[cod] 192 | 193 | # Packages 194 | *.egg 195 | *.egg-info 196 | dist/ 197 | build/ 198 | eggs/ 199 | parts/ 200 | var/ 201 | sdist/ 202 | develop-eggs/ 203 | .installed.cfg 204 | 205 | # Installer logs 206 | pip-log.txt 207 | 208 | # Unit test / coverage reports 209 | .coverage 210 | .tox 211 | 212 | #Translations 213 | *.mo 214 | 215 | #Mr Developer 216 | .mr.developer.cfg 217 | -------------------------------------------------------------------------------- /.vs/MIConvexHull/v15/Server/sqlite3/db.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/.vs/MIConvexHull/v15/Server/sqlite3/db.lock -------------------------------------------------------------------------------- /.vs/MIConvexHull/v15/Server/sqlite3/storage.ide: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/.vs/MIConvexHull/v15/Server/sqlite3/storage.ide -------------------------------------------------------------------------------- /.vs/MIConvexHull/v15/Server/sqlite3/storage.ide-shm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/.vs/MIConvexHull/v15/Server/sqlite3/storage.ide-shm -------------------------------------------------------------------------------- /.vs/MIConvexHull/v15/Server/sqlite3/storage.ide-wal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/.vs/MIConvexHull/v15/Server/sqlite3/storage.ide-wal -------------------------------------------------------------------------------- /.vs/ProjectSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "CurrentProjectSetting": null 3 | } -------------------------------------------------------------------------------- /.vs/VSWorkspaceState.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExpandedNodes": [ 3 | "" 4 | ], 5 | "SelectedNode": "\\MIConvexHull.sln", 6 | "PreviewInSolutionExplorer": false 7 | } -------------------------------------------------------------------------------- /.vs/slnx.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/.vs/slnx.sqlite -------------------------------------------------------------------------------- /Examples/10.NET Core Tester/10.NET Core Tester.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp1.0 5 | 10.NET Core Tester 6 | Exe 7 | 10.NET Core Tester 8 | 1.0.4 9 | $(PackageTargetFallback);dnxcore50 10 | false 11 | false 12 | false 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Examples/10.NET Core Tester/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyConfiguration("")] 9 | [assembly: AssemblyCompany("")] 10 | [assembly: AssemblyProduct("_10.NET_Core_Tester")] 11 | [assembly: AssemblyTrademark("")] 12 | 13 | // Setting ComVisible to false makes the types in this assembly not visible 14 | // to COM components. If you need to access a type in this assembly from 15 | // COM, set the ComVisible attribute to true on that type. 16 | [assembly: ComVisible(false)] 17 | 18 | // The following GUID is for the ID of the typelib if this project is exposed to COM 19 | [assembly: Guid("07d61fe9-9229-4178-bf6c-31b0b422afbd")] 20 | -------------------------------------------------------------------------------- /Examples/10.NET Core Tester/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0-*", 3 | 4 | "dependencies": { 5 | "NETStandard.Library": "1.6.0" 6 | }, 7 | 8 | "frameworks": { 9 | "netstandard1.6": { 10 | "imports": "dnxcore50" 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Examples/1TestEXE for MIConvexHull-2D/Ouellet Method/ConvexHullThreadUsage.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace OuelletConvexHull 3 | { 4 | public enum ConvexHullThreadUsage 5 | { 6 | AutoSelect = 0, 7 | OnlyOne = 1, 8 | All = 2, 9 | FixedFour = 4, 10 | OneOrFour = 8 11 | } 12 | } 13 | // ****************************************************************** 14 | -------------------------------------------------------------------------------- /Examples/1TestEXE for MIConvexHull-2D/Ouellet Method/Geometry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.CompilerServices; 3 | 4 | namespace OuelletConvexHull 5 | { 6 | public class Geometry 7 | { 8 | // ****************************************************************** 9 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 10 | public static double CalcSlope(double x1, double y1, double x2, double y2) 11 | { 12 | //if (Math.Abs(x2 - x1) <= Double.Epsilon) 13 | //{ 14 | // return Double.NaN; 15 | //} 16 | 17 | return (y2 - y1) / (x2 - x1); 18 | } 19 | 20 | // ****************************************************************** 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Examples/1TestEXE for MIConvexHull-2D/Ouellet Method/Limit.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | 8 | namespace OuelletConvexHull 9 | { 10 | public class Limit 11 | { 12 | // ************************************************************************ 13 | public Point Q1Top, Q2Top, Q2Left, Q3Left, Q3Bottom, Q4Bottom, Q4Right, Q1Right; 14 | 15 | // ************************************************************************ 16 | public Limit(Point pt) 17 | { 18 | Q1Top = pt; 19 | Q2Top = pt; 20 | Q2Left = pt; 21 | Q3Left = pt; 22 | Q3Bottom = pt; 23 | Q4Bottom =pt; 24 | Q4Right = pt; 25 | Q1Right = pt; 26 | } 27 | 28 | // ************************************************************************ 29 | private Limit() 30 | { 31 | 32 | } 33 | 34 | // ************************************************************************ 35 | public Limit Copy() 36 | { 37 | Limit limit = new Limit(); 38 | 39 | limit.Q1Top = Q1Top; 40 | limit.Q2Top = Q2Top; 41 | limit.Q2Left = Q2Left; 42 | limit.Q3Left = Q3Left; 43 | limit.Q3Bottom = Q3Bottom; 44 | limit.Q4Bottom = Q4Bottom; 45 | limit.Q4Right = Q4Right; 46 | limit.Q1Right = Q1Right; 47 | 48 | return limit; 49 | } 50 | 51 | // ************************************************************************ 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Examples/1TestEXE for MIConvexHull-2D/Ouellet Method/PointInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows; 3 | 4 | namespace OuelletConvexHull 5 | { 6 | public class PointInfo 7 | { 8 | // ************************************************************************ 9 | public double X; 10 | public double Y; 11 | public double SlopeToNext; 12 | 13 | // ************************************************************************ 14 | public PointInfo(double x, double y, double slopeToNext) 15 | { 16 | X = x; 17 | Y = y; 18 | SlopeToNext = slopeToNext; 19 | } 20 | 21 | // ************************************************************************ 22 | public PointInfo(double x, double y) 23 | { 24 | X = x; 25 | Y = y; 26 | SlopeToNext = Double.NaN; 27 | } 28 | 29 | // ************************************************************************ 30 | public PointInfo(Point pt) 31 | { 32 | X = pt.X; 33 | Y = pt.Y; 34 | SlopeToNext = Double.NaN; 35 | } 36 | 37 | // ************************************************************************ 38 | public override bool Equals(object obj) 39 | { 40 | if (obj == null) 41 | { 42 | return false; 43 | } 44 | 45 | if ((obj is PointInfo)) 46 | { 47 | // Want to know if really equals, no epsilon here. 48 | if (X == ((PointInfo) obj).X && Y == ((PointInfo) obj).Y) 49 | { 50 | return true; 51 | } 52 | } 53 | 54 | Point pt = (Point) obj; 55 | return (pt.X == X) && (pt.Y == Y); 56 | } 57 | 58 | // ************************************************************************ 59 | public bool Equals(PointInfo dpi) 60 | { 61 | // Want to know if really equals, no epsilon here. 62 | if (X == dpi.X && Y == dpi.Y) 63 | { 64 | return true; 65 | } 66 | 67 | return false; 68 | } 69 | 70 | // ************************************************************************ 71 | public override int GetHashCode() 72 | { 73 | // Not perfect but if should do the job 74 | return X.GetHashCode() + Y.GetHashCode(); 75 | } 76 | 77 | // ************************************************************************ 78 | public override string ToString() 79 | { 80 | return "(" + X + " | " + Y + ")"; 81 | } 82 | 83 | // ************************************************************************ 84 | public Point ToPoint() 85 | { 86 | return new Point(X, Y); 87 | } 88 | 89 | // ************************************************************************ 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /Examples/1TestEXE for MIConvexHull-2D/Ouellet Method/Quadrant.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.CompilerServices; 5 | using System.Windows; 6 | 7 | namespace OuelletConvexHull 8 | { 9 | public abstract class Quadrant 10 | { 11 | // ************************************************************************ 12 | public Point FirstPoint; 13 | public Point LastPoint; 14 | public Point RootPoint; 15 | 16 | public readonly List HullPoints = null; 17 | protected IReadOnlyList _listOfPoint; 18 | 19 | // ************************************************************************ 20 | // Very important the Quadrant should be always build in a way where dpiFirst has minus slope to center and dpiLast has maximum slope to center 21 | public Quadrant(IReadOnlyList listOfPoint, int initialResultGuessSize) 22 | { 23 | _listOfPoint = listOfPoint; 24 | HullPoints = new List(initialResultGuessSize); 25 | } 26 | 27 | // ************************************************************************ 28 | /// 29 | /// Initialize every values needed to extract values that are parts of the convex hull. 30 | /// This is where the first pass of all values is done the get maximum in every directions (x and y). 31 | /// 32 | protected abstract void SetQuadrantLimits(); 33 | 34 | // ************************************************************************ 35 | public void Calc(bool isSkipSetQuadrantLimits = false) 36 | { 37 | if (!_listOfPoint.Any()) 38 | { 39 | // There is no points at all. Hey don't try to crash me. 40 | return; 41 | } 42 | 43 | if (!isSkipSetQuadrantLimits) 44 | { 45 | SetQuadrantLimits(); 46 | } 47 | 48 | // Begin : General Init 49 | HullPoints.Add(FirstPoint); 50 | if (FirstPoint.Equals(LastPoint)) 51 | { 52 | return; // Case where for weird distribution (like triangle or diagonal) there could be one or more quadrants without points. 53 | } 54 | HullPoints.Add(LastPoint); 55 | 56 | // Main Loop to extract ConvexHullPoints 57 | foreach (Point point in _listOfPoint) 58 | { 59 | if (!IsGoodQuadrantForPoint(point)) 60 | { 61 | continue; 62 | } 63 | 64 | int indexLow = TryAdd(point.X, point.Y); 65 | 66 | if (indexLow == -1) 67 | { 68 | continue; 69 | } 70 | 71 | Point p1 = HullPoints[indexLow]; 72 | Point p2 = HullPoints[indexLow + 1]; 73 | 74 | if (!IsPointToTheRightOfOthers(p1, p2, point)) 75 | { 76 | continue; 77 | } 78 | 79 | int indexHi = indexLow + 1; 80 | 81 | // Find lower bound (remove point invalidate by the new one that come before) 82 | while (indexLow > 0) 83 | { 84 | if (IsPointToTheRightOfOthers(HullPoints[indexLow - 1], point, HullPoints[indexLow])) 85 | { 86 | break; // We found the lower index limit of points to keep. The new point should be added right after indexLow. 87 | } 88 | indexLow--; 89 | } 90 | 91 | // Find upper bound (remove point invalidate by the new one that come after) 92 | int maxIndexHi = HullPoints.Count - 1; 93 | while (indexHi < maxIndexHi) 94 | { 95 | if (IsPointToTheRightOfOthers(point, HullPoints[indexHi + 1], HullPoints[indexHi])) 96 | { 97 | break; // We found the higher index limit of points to keep. The new point should be added right before indexHi. 98 | } 99 | indexHi++; 100 | } 101 | 102 | if (indexLow + 1 == indexHi) 103 | { 104 | // Insert Point 105 | HullPoints.Insert(indexHi, point); 106 | } 107 | else 108 | { 109 | HullPoints[indexLow + 1] = point; 110 | 111 | // Remove any invalidated points if any 112 | if (indexLow + 2 < indexHi) 113 | { 114 | HullPoints.RemoveRange(indexLow + 2, indexHi - indexLow - 2); 115 | } 116 | } 117 | 118 | } 119 | } 120 | 121 | // ************************************************************************ 122 | /// 123 | /// To know if to the right. It is meaninful when p1 is first and p2 is next. 124 | /// 125 | /// 126 | /// 127 | /// 128 | /// 129 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 130 | protected bool IsPointToTheRightOfOthers(Point p1, Point p2, Point ptToCheck) 131 | { 132 | return ((p2.X - p1.X) * (ptToCheck.Y - p1.Y)) - ((p2.Y - p1.Y) * (ptToCheck.X - p1.X)) < 0; 133 | } 134 | 135 | // ************************************************************************ 136 | /// 137 | /// Tell if should try to add and where. -1 ==> Should not add. 138 | /// 139 | /// 140 | /// 141 | /// 142 | protected abstract int TryAdd(double x, double y); 143 | 144 | // ************************************************************************ 145 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 146 | protected abstract bool IsGoodQuadrantForPoint(Point pt); 147 | 148 | // ************************************************************************ 149 | 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /Examples/1TestEXE for MIConvexHull-2D/Ouellet Method/QuadrantSpecific1.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Diagnostics; 3 | using System.Linq; 4 | using System.Runtime.CompilerServices; 5 | using System.Windows; 6 | 7 | namespace OuelletConvexHull 8 | { 9 | public class QuadrantSpecific1 : Quadrant 10 | { 11 | // ************************************************************************ 12 | public QuadrantSpecific1( 13 | IReadOnlyList listOfPoint, int initialResultGuessSize) : 14 | base(listOfPoint, initialResultGuessSize) 15 | { 16 | } 17 | 18 | // ****************************************************************** 19 | protected override void SetQuadrantLimits() 20 | { 21 | Point firstPoint = this._listOfPoint.First(); 22 | 23 | double rightX = firstPoint.X; 24 | double rightY = firstPoint.Y; 25 | 26 | double topX = rightX; 27 | double topY = rightY; 28 | 29 | foreach (var point in _listOfPoint) 30 | { 31 | if (point.X >= rightX) 32 | { 33 | if (point.X == rightX) 34 | { 35 | if (point.Y > rightY) 36 | { 37 | rightY = point.Y; 38 | } 39 | } 40 | else 41 | { 42 | rightX = point.X; 43 | rightY = point.Y; 44 | } 45 | } 46 | 47 | if (point.Y >= topY) 48 | { 49 | if (point.Y == topY) 50 | { 51 | if (point.X > topX) 52 | { 53 | topX = point.X; 54 | } 55 | } 56 | else 57 | { 58 | topX = point.X; 59 | topY = point.Y; 60 | } 61 | } 62 | } 63 | 64 | FirstPoint = new Point(rightX, rightY); 65 | LastPoint = new Point(topX, topY); 66 | RootPoint = new Point(topX, rightY); 67 | } 68 | 69 | // ****************************************************************** 70 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 71 | protected override bool IsGoodQuadrantForPoint(Point pt) 72 | { 73 | if (pt.X > this.RootPoint.X && pt.Y > this.RootPoint.Y) 74 | { 75 | return true; 76 | } 77 | 78 | return false; 79 | } 80 | 81 | // ****************************************************************** 82 | protected override int TryAdd(double x, double y) 83 | { 84 | int indexLow = 0; 85 | int indexHi = HullPoints.Count - 1; 86 | 87 | while (indexLow != indexHi - 1) 88 | { 89 | int index = ((indexHi - indexLow) >> 1) + indexLow; 90 | 91 | if (x <= HullPoints[index].X && y <= HullPoints[index].Y) 92 | { 93 | return -1; // No calc needed 94 | } 95 | 96 | if (x > HullPoints[index].X) 97 | { 98 | indexHi = index; 99 | continue; 100 | } 101 | 102 | if (x < HullPoints[index].X) 103 | { 104 | indexLow = index; 105 | continue; 106 | } 107 | 108 | if (x == HullPoints[index].X) 109 | { 110 | if (y > HullPoints[index].Y) 111 | { 112 | indexLow = index; 113 | } 114 | else 115 | { 116 | return -1; 117 | } 118 | } 119 | 120 | break; 121 | } 122 | 123 | if (y <= HullPoints[indexLow].Y) 124 | { 125 | return -1; // Eliminated without slope calc 126 | } 127 | 128 | return indexLow; 129 | } 130 | 131 | // ****************************************************************** 132 | } 133 | } 134 | 135 | -------------------------------------------------------------------------------- /Examples/1TestEXE for MIConvexHull-2D/Ouellet Method/QuadrantSpecific2.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Diagnostics; 3 | using System.Linq; 4 | using System.Runtime.CompilerServices; 5 | using System.Windows; 6 | 7 | namespace OuelletConvexHull 8 | { 9 | public class QuadrantSpecific2 : Quadrant 10 | { 11 | // ************************************************************************ 12 | public QuadrantSpecific2(IReadOnlyList listOfPoint, int initialResultGuessSize) : 13 | base(listOfPoint, initialResultGuessSize) 14 | { 15 | } 16 | 17 | // ****************************************************************** 18 | protected override void SetQuadrantLimits() 19 | { 20 | Point firstPoint = this._listOfPoint.First(); 21 | 22 | double leftX = firstPoint.X; 23 | double leftY = firstPoint.Y; 24 | 25 | double topX = leftX; 26 | double topY = leftY; 27 | 28 | foreach (var point in _listOfPoint) 29 | { 30 | 31 | if (point.X <= leftX) 32 | { 33 | if (point.X == leftX) 34 | { 35 | if (point.Y > leftY) 36 | { 37 | leftY = point.Y; 38 | } 39 | } 40 | else 41 | { 42 | leftX = point.X; 43 | leftY = point.Y; 44 | } 45 | } 46 | 47 | if (point.Y >= topY) 48 | { 49 | if (point.Y == topY) 50 | { 51 | if (point.X < topX) 52 | { 53 | topX = point.X; 54 | } 55 | } 56 | else 57 | { 58 | topX = point.X; 59 | topY = point.Y; 60 | } 61 | } 62 | } 63 | 64 | FirstPoint = new Point(topX, topY); 65 | LastPoint = new Point(leftX, leftY); 66 | RootPoint = new Point(topX, leftY); 67 | } 68 | 69 | // ****************************************************************** 70 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 71 | protected override bool IsGoodQuadrantForPoint(Point pt) 72 | { 73 | if (pt.X < this.RootPoint.X && pt.Y > this.RootPoint.Y) 74 | { 75 | return true; 76 | } 77 | 78 | return false; 79 | } 80 | 81 | // ****************************************************************** 82 | protected override int TryAdd(double x, double y) 83 | { 84 | int indexLow = 0; 85 | int indexHi = HullPoints.Count - 1; 86 | 87 | while (indexLow != indexHi - 1) 88 | { 89 | int index = ((indexHi - indexLow) >> 1) + indexLow; 90 | 91 | if (x >= HullPoints[index].X && y <= HullPoints[index].Y) 92 | { 93 | return -1; // No calc needed 94 | } 95 | 96 | if (x > HullPoints[index].X) 97 | { 98 | indexHi = index; 99 | continue; 100 | } 101 | 102 | if (x < HullPoints[index].X) 103 | { 104 | indexLow = index; 105 | continue; 106 | } 107 | 108 | if (x == HullPoints[index].X) 109 | { 110 | if (y > HullPoints[index].Y) 111 | { 112 | indexLow = index; 113 | } 114 | else 115 | { 116 | return -1; 117 | } 118 | } 119 | 120 | break; 121 | } 122 | 123 | if (y <= HullPoints[indexHi].Y) 124 | { 125 | return -1; // Eliminated without slope calc 126 | } 127 | 128 | return indexLow; 129 | 130 | } 131 | // ****************************************************************** 132 | 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /Examples/1TestEXE for MIConvexHull-2D/Ouellet Method/QuadrantSpecific3.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Diagnostics; 3 | using System.Linq; 4 | using System.Runtime.CompilerServices; 5 | using System.Windows; 6 | 7 | namespace OuelletConvexHull 8 | { 9 | public class QuadrantSpecific3 : Quadrant 10 | { 11 | // ************************************************************************ 12 | public QuadrantSpecific3(IReadOnlyList listOfPoint, int initialResultGuessSize) : 13 | base(listOfPoint, initialResultGuessSize) 14 | { 15 | } 16 | 17 | // ****************************************************************** 18 | protected override void SetQuadrantLimits() 19 | { 20 | Point firstPoint = this._listOfPoint.First(); 21 | 22 | double leftX = firstPoint.X; 23 | double leftY = firstPoint.Y; 24 | 25 | double bottomX = leftX; 26 | double bottomY = leftY; 27 | 28 | foreach (var point in _listOfPoint) 29 | { 30 | if (point.X <= leftX) 31 | { 32 | if (point.X == leftX) 33 | { 34 | if (point.Y < leftY) 35 | { 36 | leftY = point.Y; 37 | } 38 | } 39 | else 40 | { 41 | leftX = point.X; 42 | leftY = point.Y; 43 | } 44 | } 45 | 46 | if (point.Y <= bottomY) 47 | { 48 | if (point.Y == bottomY) 49 | { 50 | if (point.X < bottomX) 51 | { 52 | bottomX = point.X; 53 | } 54 | } 55 | else 56 | { 57 | bottomX = point.X; 58 | bottomY = point.Y; 59 | } 60 | } 61 | } 62 | 63 | FirstPoint = new Point(leftX, leftY); 64 | LastPoint = new Point(bottomX, bottomY); 65 | RootPoint = new Point(bottomX, leftY); 66 | } 67 | 68 | // ****************************************************************** 69 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 70 | protected override bool IsGoodQuadrantForPoint(Point pt) 71 | { 72 | if (pt.X < this.RootPoint.X && pt.Y < this.RootPoint.Y) 73 | { 74 | return true; 75 | } 76 | 77 | return false; 78 | } 79 | 80 | // ****************************************************************** 81 | protected override int TryAdd(double x, double y) 82 | { 83 | int indexLow = 0; 84 | int indexHi = HullPoints.Count - 1; 85 | 86 | while (indexLow != indexHi - 1) 87 | { 88 | int index = ((indexHi - indexLow) >> 1) + indexLow; 89 | 90 | if (x >= HullPoints[index].X && y >= HullPoints[index].Y) 91 | { 92 | return -1; // No calc needed 93 | } 94 | 95 | if (x > HullPoints[index].X) 96 | { 97 | indexLow = index; 98 | continue; 99 | } 100 | 101 | if (x < HullPoints[index].X) 102 | { 103 | indexHi = index; 104 | continue; 105 | } 106 | 107 | if (y < HullPoints[index].Y) 108 | { 109 | indexLow = index; 110 | } 111 | else 112 | { 113 | return -1; 114 | } 115 | break; 116 | } 117 | 118 | if (y >= HullPoints[indexLow].Y) 119 | { 120 | return -1; // Eliminated without slope calc 121 | } 122 | 123 | return indexLow; 124 | } 125 | 126 | // ****************************************************************** 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /Examples/1TestEXE for MIConvexHull-2D/Ouellet Method/QuadrantSpecific4.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Diagnostics; 3 | using System.Linq; 4 | using System.Runtime.CompilerServices; 5 | using System.Windows; 6 | 7 | namespace OuelletConvexHull 8 | { 9 | public class QuadrantSpecific4 : Quadrant 10 | { 11 | // ************************************************************************ 12 | public QuadrantSpecific4(IReadOnlyList listOfPoint, int initialResultGuessSize) : 13 | base(listOfPoint, initialResultGuessSize) 14 | { 15 | } 16 | 17 | // ****************************************************************** 18 | protected override void SetQuadrantLimits() 19 | { 20 | Point firstPoint = this._listOfPoint.First(); 21 | 22 | double rightX = firstPoint.X; 23 | double rightY = firstPoint.Y; 24 | 25 | double bottomX = rightX; 26 | double bottomY = rightY; 27 | 28 | foreach (var point in _listOfPoint) 29 | { 30 | if (point.X >= rightX) 31 | { 32 | if (point.X == rightX) 33 | { 34 | if (point.Y < rightY) 35 | { 36 | rightY = point.Y; 37 | } 38 | } 39 | else 40 | { 41 | rightX = point.X; 42 | rightY = point.Y; 43 | } 44 | } 45 | 46 | if (point.Y <= bottomY) 47 | { 48 | if (point.Y == bottomY) 49 | { 50 | if (point.X > bottomX) 51 | { 52 | bottomX = point.X; 53 | } 54 | } 55 | else 56 | { 57 | bottomX = point.X; 58 | bottomY = point.Y; 59 | } 60 | } 61 | } 62 | 63 | FirstPoint = new Point(bottomX, bottomY); 64 | LastPoint = new Point(rightX, rightY); 65 | RootPoint = new Point(bottomX, rightY); 66 | } 67 | 68 | // ****************************************************************** 69 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 70 | protected override bool IsGoodQuadrantForPoint(Point pt) 71 | { 72 | if (pt.X > this.RootPoint.X && pt.Y < this.RootPoint.Y) 73 | { 74 | return true; 75 | } 76 | 77 | return false; 78 | } 79 | 80 | // ****************************************************************** 81 | protected override int TryAdd(double x, double y) 82 | { 83 | int indexLow = 0; 84 | int indexHi = HullPoints.Count - 1; 85 | 86 | while (indexLow != indexHi - 1) 87 | { 88 | int index = ((indexHi - indexLow) >> 1) + indexLow; 89 | 90 | if (x <= HullPoints[index].X && y >= HullPoints[index].Y) 91 | { 92 | return -1; // No calc needed 93 | } 94 | 95 | if (x > HullPoints[index].X) 96 | { 97 | indexLow = index; 98 | continue; 99 | } 100 | 101 | if (x < HullPoints[index].X) 102 | { 103 | indexHi = index; 104 | continue; 105 | } 106 | 107 | if (x == HullPoints[index].X) 108 | { 109 | if (y < HullPoints[index].Y) 110 | { 111 | indexLow = index; 112 | } 113 | else 114 | { 115 | return -1; 116 | } 117 | } 118 | 119 | break; 120 | } 121 | 122 | if (y >= HullPoints[indexHi].Y) 123 | { 124 | return -1; // Eliminated without slope calc 125 | } 126 | 127 | return indexLow; 128 | } 129 | 130 | // ****************************************************************** 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /Examples/1TestEXE for MIConvexHull-2D/Window2DPlot.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Examples/1TestEXE for MIConvexHull-2D/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Examples/1TestEXE for MIConvexHull-2D/vertex.cs: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * This file & class is part of the MIConvexHull Library Project. 3 | * Copyright 2010 Matthew Ira Campbell, PhD. 4 | * 5 | * MIConvexHull is free software: you can redistribute it and/or modify 6 | * it under the terms of the MIT License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * MIConvexHull is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * MIT License for more details. 14 | * 15 | * You should have received a copy of the MIT License 16 | * along with MIConvexHull. 17 | * 18 | * Please find further details and contact information on GraphSynth 19 | * at https://designengrlab.github.io/MIConvexHull/ 20 | *************************************************************************/ 21 | namespace TestEXE_for_MIConvexHull2D 22 | { 23 | using MIConvexHull; 24 | /// 25 | /// A vertex is a simple class that stores the postion of a point, node or vertex. 26 | /// 27 | public struct Vertex : IVertex2D 28 | { 29 | /// 30 | /// Initializes a new instance of the class. 31 | /// 32 | /// The x position. 33 | /// The y position. 34 | public Vertex(double x, double y) 35 | { 36 | X = x; 37 | Y = y; 38 | } 39 | 40 | public double X { get; set; } 41 | 42 | public double Y { get; set; } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Examples/2TestEXE for MIConvexHull-No Interfaces/2TestEXE for MIConvexHull-No Interfaces.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {62FC0ECE-F54A-47F9-B183-0C54AE944408} 9 | Exe 10 | Properties 11 | TestEXE_for_MIConvexHull_No_Interfaces 12 | TestEXE for MIConvexHull-No Interfaces 13 | v4.7.2 14 | 15 | 16 | 512 17 | 18 | 19 | 20 | 21 | true 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | full 25 | AnyCPU 26 | prompt 27 | true 28 | true 29 | false 30 | 31 | 32 | bin\Release\ 33 | TRACE 34 | true 35 | pdbonly 36 | AnyCPU 37 | prompt 38 | false 39 | false 40 | false 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | {3250db91-b2e5-407a-b990-66b43f47a102} 61 | MIConvexHull.NET Standard 62 | 63 | 64 | 65 | 72 | -------------------------------------------------------------------------------- /Examples/2TestEXE for MIConvexHull-No Interfaces/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using MIConvexHull; 4 | using System.Collections.Generic; 5 | 6 | namespace TestEXE_for_MIConvexHull_No_Interfaces 7 | { 8 | class Program 9 | { 10 | static void Main() 11 | { 12 | const int NumberOfVertices = 30000; 13 | const double size = 1000; 14 | const int dimension = 3; 15 | 16 | var r = new Random(); 17 | Console.WriteLine("Ready? Push Return/Enter to start."); 18 | Console.ReadLine(); 19 | 20 | Console.WriteLine("Making " + NumberOfVertices + " random vertices."); 21 | /* our inputs are simply in the form of an array of double arrays */ 22 | var vertices = new double[NumberOfVertices][]; 23 | for (var i = 0; i < NumberOfVertices; i++) 24 | { 25 | var location = new double[dimension]; 26 | for (var j = 0; j < dimension; j++) 27 | location[j] = size * r.NextDouble(); 28 | vertices[i] = location; 29 | } 30 | Console.WriteLine("Running..."); 31 | var now = DateTime.Now; 32 | 33 | var convexHull = ConvexHull.Create(vertices); 34 | 35 | double[][] hullPoints = convexHull.Result.Points.Select(p => p.Position).ToArray(); 36 | 37 | var interval = DateTime.Now - now; 38 | Console.WriteLine("Out of the {0} 3D vertices, there are {1} on the convex hull.", NumberOfVertices, hullPoints.Length); 39 | Console.WriteLine("time = " + interval); 40 | Console.ReadLine(); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Examples/2TestEXE for MIConvexHull-No Interfaces/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("TestEXE for MIConvexHull-No Interfaces")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("Microsoft")] 11 | [assembly: AssemblyProduct("TestEXE for MIConvexHull-No Interfaces")] 12 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("f560896d-fa27-412b-8729-49c4fba9f62b")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Examples/2TestEXE for MIConvexHull-No Interfaces/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Examples/2TestEXE for MIConvexHull-No Interfaces/edge case to debug1.txt: -------------------------------------------------------------------------------- 1 |  2 | const int NumberOfVertices = 4; 3 | 4 | var vertices = new double[NumberOfVertices][]; 5 | vertices[0] = new[] {0.0, 0.0}; 6 | vertices[1] = new[] {0.0, -2.0}; 7 | vertices[2] = new[] {-0.70710678118654746, -1.5}; 8 | vertices[3] = new[] {-0.70710678118654746, -0.5}; 9 | 10 | var div = Triangulation.CreateDelaunay(vertices); 11 | 12 | Console.WriteLine(); -------------------------------------------------------------------------------- /Examples/3DConvexHullWPF/App.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Examples/3DConvexHullWPF/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace ExampleWithGraphics 4 | { 5 | /// 6 | /// Interaction logic for App.xaml 7 | /// 8 | public partial class App : Application 9 | { 10 | } 11 | } -------------------------------------------------------------------------------- /Examples/3DConvexHullWPF/MainWindow.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Examples/7DelaunayWPF/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Navigation; 13 | using System.Windows.Shapes; 14 | using System.Diagnostics; 15 | using System.Threading.Tasks; 16 | 17 | namespace DelaunayWPF 18 | { 19 | /// 20 | /// Interaction logic for MainWindow.xaml 21 | /// 22 | public partial class MainWindow : Window 23 | { 24 | public MainWindow() 25 | { 26 | InitializeComponent(); 27 | 28 | // set up the trackball 29 | var trackball = new Wpf3DTools.Trackball(); 30 | trackball.EventSource = background; 31 | viewport.Camera.Transform = trackball.Transform; 32 | light.Transform = trackball.RotateTransform; 33 | } 34 | 35 | RandomTriangulation triangulation; 36 | 37 | void Create(bool uniform = false) 38 | { 39 | if (triangulation != null) viewport.Children.Remove(triangulation); 40 | 41 | int count; 42 | if (!int.TryParse(numPoints.Text, out count) && count < 10) count = 100; 43 | 44 | triangulation = RandomTriangulation.Create(count, 10, uniform); 45 | viewport.Children.Add(triangulation); 46 | 47 | infoText.Text = string.Format("{0} tetrahedrons", triangulation.Count); 48 | } 49 | 50 | private void Grid_Loaded(object sender, RoutedEventArgs e) 51 | { 52 | Create(); 53 | } 54 | 55 | private void GenerateButton_Click(object sender, RoutedEventArgs e) 56 | { 57 | Create(); 58 | } 59 | 60 | private void GenerateUniformButton_Click(object sender, RoutedEventArgs e) 61 | { 62 | Create(true); 63 | } 64 | 65 | private void ExpandButton_Click(object sender, RoutedEventArgs e) 66 | { 67 | triangulation.Expand(); 68 | } 69 | 70 | private void ExpandRandomButton_Click(object sender, RoutedEventArgs e) 71 | { 72 | triangulation.ExpandRandom(); 73 | } 74 | 75 | private void CollapseButton_Click(object sender, RoutedEventArgs e) 76 | { 77 | triangulation.Collapse(); 78 | } 79 | 80 | private void PulseButton_Click(object sender, RoutedEventArgs e) 81 | { 82 | triangulation.Pulse(); 83 | } 84 | } 85 | } -------------------------------------------------------------------------------- /Examples/7DelaunayWPF/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("DelaunayWPF")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("Microsoft")] 14 | [assembly: AssemblyProduct("DelaunayWPF")] 15 | [assembly: AssemblyCopyright("Copyright © Microsoft 2011")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /Examples/7DelaunayWPF/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace DelaunayWPF.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DelaunayWPF.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Examples/7DelaunayWPF/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace DelaunayWPF.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.3.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Examples/7DelaunayWPF/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Examples/7DelaunayWPF/Vertex.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using MIConvexHull; 6 | using System.Windows.Media.Media3D; 7 | 8 | namespace DelaunayWPF 9 | { 10 | /// 11 | /// Represents a point in 3D space. 12 | /// 13 | class Vertex : IVertex 14 | { 15 | public Vertex(double x, double y, double z) 16 | { 17 | Position = new double[] { x, y, z }; 18 | } 19 | 20 | public Point3D ToPoint3D() 21 | { 22 | return new Point3D(Position[0], Position[1], Position[2]); 23 | } 24 | 25 | public double[] Position { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Examples/7DelaunayWPF/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Examples/8PerformanceTests/8PerformanceTests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {455D80B5-5288-4DC9-839E-02C3EE9000B2} 9 | Exe 10 | Properties 11 | _8PerformanceTests 12 | 8PerformanceTests 13 | v4.6.1 14 | 15 | 16 | 512 17 | 18 | 19 | 20 | 21 | true 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | full 25 | AnyCPU 26 | prompt 27 | MinimumRecommendedRules.ruleset 28 | 29 | 30 | bin\Release\ 31 | TRACE 32 | true 33 | pdbonly 34 | AnyCPU 35 | prompt 36 | MinimumRecommendedRules.ruleset 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | {3250db91-b2e5-407a-b990-66b43f47a102} 57 | MIConvexHull.NET Standard 58 | 59 | 60 | 61 | 68 | -------------------------------------------------------------------------------- /Examples/8PerformanceTests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("8PerformanceTests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("8PerformanceTests")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2011")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("c080b3df-db8d-4604-864a-0f8f6e9a94f8")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Examples/8PerformanceTests/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Examples/9BatchConvexHullTest/9BatchConvexHullTest.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {2EFD65A6-A23D-4DD5-8A34-CDEA408BAEA3} 8 | Exe 9 | Properties 10 | BatchConvexHullTest 11 | 9BatchConvexHullTest 12 | v4.6.1 13 | 512 14 | 15 | 16 | 17 | 18 | 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | 38 | 39 | 40 | ..\..\packages\HelixToolkit.Wpf.2015.1.715\lib\net45\HelixToolkit.Wpf.dll 41 | True 42 | 43 | 44 | 45 | 46 | ..\..\packages\PropertyTools.Wpf.2015.2.0\lib\net45\PropertyTools.dll 47 | True 48 | 49 | 50 | ..\..\packages\PropertyTools.Wpf.2015.2.0\lib\net45\PropertyTools.Wpf.dll 51 | True 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | Window3DPlot.xaml 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | MSBuild:Compile 81 | Designer 82 | 83 | 84 | 85 | 86 | {3250db91-b2e5-407a-b990-66b43f47a102} 87 | MIConvexHull.NET Standard 88 | 89 | 90 | 91 | 92 | 93 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 94 | 95 | 96 | 103 | -------------------------------------------------------------------------------- /Examples/9BatchConvexHullTest/Program.cs: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * This file & class is part of the MIConvexHull Library Project. 3 | * Copyright 2010 Matthew Ira Campbell, PhD. 4 | * 5 | * MIConvexHull is free software: you can redistribute it and/or modify 6 | * it under the terms of the MIT License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * MIConvexHull is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * MIT License for more details. 14 | * 15 | * You should have received a copy of the MIT License 16 | * along with MIConvexHull. 17 | * 18 | * Please find further details and contact information on GraphSynth 19 | * at https://designengrlab.github.io/MIConvexHull/ 20 | *************************************************************************/ 21 | 22 | using System; 23 | using MIConvexHull; 24 | using System.Collections.Generic; 25 | using System.IO; 26 | using System.Linq; 27 | using System.Windows; 28 | using System.Windows.Media.Media3D; 29 | using HelixToolkit.Wpf; 30 | 31 | namespace BatchConvexHullTest 32 | { 33 | using Path = List; 34 | using Paths = List>; 35 | 36 | internal class Program 37 | { 38 | static readonly ModelImporter modelImporter = new ModelImporter(); 39 | 40 | [STAThread] 41 | private static void Main(string[] args) 42 | { 43 | var dir = new DirectoryInfo("../../../../TestFiles"); 44 | var fileNames = dir.GetFiles(); 45 | string filename = ""; 46 | for (var i = 0; i < fileNames.Count(); i++) 47 | { 48 | try 49 | { 50 | filename = fileNames[i].FullName; 51 | Console.WriteLine("Attempting: " + filename); 52 | List vertices; 53 | var v3D = MakeModelVisual3D(filename, out vertices); 54 | var now = DateTime.Now; 55 | var convexHull = ConvexHull.Create(vertices); 56 | var interval = DateTime.Now - now; 57 | Window3DPlot.ShowWithConvexHull(v3D, convexHull.Result); 58 | Console.WriteLine("time = " + interval); 59 | } 60 | catch (Exception e) 61 | { 62 | Console.WriteLine("Failed on " + filename + ": " + e.Message); 63 | } 64 | } 65 | Console.WriteLine("Finished."); 66 | Console.ReadLine(); 67 | } 68 | 69 | static Visual3D MakeModelVisual3D(string filename, out List vertices) 70 | { 71 | 72 | var currentModel = modelImporter.Load(filename); 73 | var verts = new List(); 74 | foreach (var model in currentModel.Children) 75 | { 76 | if (model is GeometryModel3D) 77 | if (((GeometryModel3D)model).Geometry is MeshGeometry3D) 78 | { 79 | var mesh = (MeshGeometry3D)((GeometryModel3D)model).Geometry; 80 | verts.AddRange(mesh.Positions); 81 | } 82 | } 83 | vertices = verts.Distinct(new Point3DComparer()).Select(p => 84 | new MIConvexHull.DefaultVertex { Position = new[] { p.X, p.Y, p.Z } }).ToList(); 85 | return new ModelVisual3D { Content = currentModel }; //.Children[0] }; 86 | 87 | } 88 | } 89 | 90 | 91 | class Point3DComparer : IEqualityComparer 92 | { 93 | #region Implementation of IEqualityComparer 94 | 95 | /// 96 | /// Determines whether the specified objects are equal. 97 | /// 98 | /// 99 | /// true if the specified objects are equal; otherwise, false. 100 | /// 101 | /// The first object of type to compare.The second object of type to compare. 102 | bool IEqualityComparer.Equals(Point3D x, Point3D y) 103 | { 104 | return ((x - y).Length < 1e-15); 105 | } 106 | 107 | /// 108 | /// Returns a hash code for the specified object. 109 | /// 110 | /// 111 | /// A hash code for the specified object. 112 | /// 113 | /// The for which a hash code is to be returned.The type of is a reference type and is null. 114 | int IEqualityComparer.GetHashCode(Point3D obj) 115 | { 116 | var d = obj.ToVector3D().LengthSquared; 117 | return d.GetHashCode(); 118 | } 119 | 120 | #endregion 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /Examples/9BatchConvexHullTest/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("UnitTesting")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("UnitTesting")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("2efd65a6-a23d-4dd5-8a34-cdea408baea3")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Examples/9BatchConvexHullTest/Window3DPlot.xaml.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/Examples/9BatchConvexHullTest/Window3DPlot.xaml.cs -------------------------------------------------------------------------------- /Examples/9BatchConvexHullTest/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Examples/9BatchConvexHullTest/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2010 David Sehnal, Matthew Campbell 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MIConvexHull.NET Standard/Constants.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * The MIT License (MIT) 4 | * 5 | * MIConvexHull, Copyright (c) 2015 David Sehnal, Matthew Campbell 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | * 25 | *****************************************************************************/ 26 | 27 | namespace MIConvexHull 28 | { 29 | internal static class Constants 30 | { 31 | /// 32 | /// The default plane distance tolerance 33 | /// 34 | internal const double DefaultPlaneDistanceTolerance = 1e-10; 35 | /// 36 | /// The starting delta dot product in simplex 37 | /// 38 | internal const double StartingDeltaDotProductInSimplex = 0.5; 39 | /// 40 | /// The connector table size 41 | /// 42 | internal const int ConnectorTableSize = 2017; 43 | 44 | 45 | internal const double DefaultEqualityTolerance = 1e-15; 46 | internal const double FractionalNegligibleVolume = 1e-12; 47 | 48 | /// 49 | /// Determines whether the specified x is negligible (|x| lte 1e-15). 50 | /// 51 | /// The x. 52 | /// An optional tolerance. 53 | /// true if the specified x is negligible; otherwise, false. 54 | internal static bool IsNegligible(this double x, double optionalTolerance = DefaultEqualityTolerance) 55 | { 56 | return (System.Math.Abs(x) <= optionalTolerance); 57 | } 58 | 59 | } 60 | } -------------------------------------------------------------------------------- /MIConvexHull.NET Standard/ConvexHull/ConvexFace.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * The MIT License (MIT) 4 | * 5 | * MIConvexHull, Copyright (c) 2015 David Sehnal, Matthew Campbell 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | * 25 | *****************************************************************************/ 26 | 27 | namespace MIConvexHull 28 | { 29 | /// 30 | /// A convex face representation containing adjacency information. 31 | /// 32 | /// The type of the t vertex. 33 | /// The type of the t face. 34 | public abstract class ConvexFace 35 | where TVertex : IVertex 36 | where TFace : ConvexFace 37 | { 38 | /// 39 | /// Adjacency. Array of length "dimension". 40 | /// If F = Adjacency[i] then the vertices shared with F are Vertices[j] where j != i. 41 | /// In the context of triangulation, can be null (indicates the cell is at boundary). 42 | /// 43 | /// The adjacency. 44 | public TFace[] Adjacency { get; set; } 45 | 46 | /// 47 | /// The vertices stored in clockwise order for dimensions 2 - 4, in higher dimensions the order is arbitrary. 48 | /// Unless I accidentally switch some index somewhere in which case the order is CCW. Either way, it is consistent. 49 | /// 3D Normal = (V[1] - V[0]) x (V[2] - V[1]). 50 | /// 51 | /// The vertices. 52 | public TVertex[] Vertices { get; set; } 53 | 54 | /// 55 | /// The normal vector of the face. Null if used in triangulation. 56 | /// 57 | /// The normal. 58 | public double[] Normal { get; set; } 59 | } 60 | 61 | /// 62 | /// A default convex face representation. 63 | /// 64 | /// The type of the t vertex. 65 | public class DefaultConvexFace : ConvexFace> 66 | where TVertex : IVertex 67 | { 68 | } 69 | } -------------------------------------------------------------------------------- /MIConvexHull.NET Standard/ConvexHullCreationResultOutcome.cs: -------------------------------------------------------------------------------- 1 | namespace MIConvexHull 2 | { 3 | /// 4 | /// Enum ConvexHullCreationResultOutcome 5 | /// 6 | public enum ConvexHullCreationResultOutcome 7 | { 8 | /// 9 | /// Successfully created. 10 | /// 11 | Success, 12 | /// 13 | /// dimension smaller two 14 | /// 15 | DimensionSmallerTwo, 16 | /// 17 | /// dimension smaller two 18 | /// 19 | DimensionTwoWrongMethod, 20 | /// 21 | /// not enough vertices for dimension 22 | /// 23 | NotEnoughVerticesForDimension, 24 | /// 25 | /// non uniform dimension 26 | /// 27 | NonUniformDimension, 28 | /// 29 | /// degenerate data 30 | /// 31 | DegenerateData, 32 | /// 33 | /// unknown error 34 | /// 35 | UnknownError 36 | } 37 | } -------------------------------------------------------------------------------- /MIConvexHull.NET Standard/ConvexHullGenerationException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MIConvexHull 4 | { 5 | /// 6 | /// Class ConvexHullGenerationException. 7 | /// Implements the 8 | /// 9 | /// 10 | public class ConvexHullGenerationException : Exception 11 | { 12 | /// 13 | /// Initializes a new instance of the class. 14 | /// 15 | /// The error. 16 | /// The error message. 17 | public ConvexHullGenerationException(ConvexHullCreationResultOutcome error, string errorMessage) 18 | { 19 | ErrorMessage = errorMessage; 20 | Error = error; 21 | } 22 | 23 | /// 24 | /// Gets the error message. 25 | /// 26 | /// The error message. 27 | public string ErrorMessage { get; } 28 | 29 | /// 30 | /// Gets the error. 31 | /// 32 | /// The error. 33 | public ConvexHullCreationResultOutcome Error { get; } 34 | } 35 | } -------------------------------------------------------------------------------- /MIConvexHull.NET Standard/IVertex.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * The MIT License (MIT) 4 | * 5 | * MIConvexHull, Copyright (c) 2015 David Sehnal, Matthew Campbell 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | * 25 | *****************************************************************************/ 26 | 27 | namespace MIConvexHull 28 | { 29 | /// 30 | /// An interface for a structure with nD position. 31 | /// 32 | public interface IVertex 33 | { 34 | /// 35 | /// Position of the vertex. 36 | /// 37 | /// The position. 38 | double[] Position { get; } 39 | } 40 | 41 | /// 42 | /// An interface for a structure with nD position. 43 | /// 44 | public interface IVertex2D 45 | { 46 | /// 47 | /// Gets the x. 48 | /// 49 | /// The x. 50 | double X { get; } 51 | 52 | /// 53 | /// Gets the y. 54 | /// 55 | /// The y. 56 | double Y { get; } 57 | } 58 | 59 | /// 60 | /// "Default" vertex. 61 | /// 62 | /// 63 | public class DefaultVertex : IVertex 64 | { 65 | /// 66 | /// Position of the vertex. 67 | /// 68 | /// The position. 69 | public double[] Position { get; set; } 70 | } 71 | 72 | /// 73 | /// "Default" 2D vertex. 74 | /// 75 | /// 76 | public struct DefaultVertex2D : IVertex2D 77 | { 78 | public DefaultVertex2D(double[] coordinates) : this() 79 | { 80 | X = coordinates[0]; 81 | Y = coordinates[1]; 82 | } 83 | public DefaultVertex2D(double x, double y) : this() 84 | { 85 | X = x; 86 | Y = y; 87 | } 88 | 89 | public double X { get; private set; } 90 | 91 | public double Y { get; private set; } 92 | } 93 | } -------------------------------------------------------------------------------- /MIConvexHull.NET Standard/MIConvexHull.NET Standard.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard1.0 5 | MIConvexHull 6 | MIConvexHull 7 | 1.1.19.1018 8 | David Sehnal, Matt Campbell 9 | This project is a convex hull algorithm and library for 2D, 3D, and higher dimensions. The code can also be used to compute Delaunay triangulations and Voronoi meshes of the input data. 10 | 11 | 2019 12 | https://github.com/DesignEngrLab/MIConvexHull/blob/master/LICENSE.txt 13 | https://designengrlab.github.io/MIConvexHull/ 14 | https://github.com/DesignEngrLab/MIConvexHull.git 15 | git 16 | 1.1.19.1018 17 | 1.1.19.1018 18 | true 19 | DesignEngineeringLab.pfx 20 | true 21 | MIConvexHull 22 | false 23 | MIConvexHull 24 | 25 | 26 | -------------------------------------------------------------------------------- /MIConvexHull.NET Standard/Triangulation/DelaunayTrianglationInternal.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * The MIT License (MIT) 4 | * 5 | * MIConvexHull, Copyright (c) 2015 David Sehnal, Matthew Campbell 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | * 25 | *****************************************************************************/ 26 | 27 | using System.Collections.Generic; 28 | using System.Linq; 29 | 30 | namespace MIConvexHull 31 | { 32 | /* 33 | * Code here handles triangulation related stuff. 34 | */ 35 | 36 | /// 37 | /// Class ConvexHullAlgorithm. 38 | /// 39 | internal partial class ConvexHullAlgorithm 40 | { 41 | /// 42 | /// Computes the Delaunay triangulation. 43 | /// 44 | /// The type of the t vertex. 45 | /// The type of the t cell. 46 | /// The data. 47 | /// The plane distance tolerance. 48 | /// TCell[]. 49 | internal static TCell[] GetDelaunayTriangulation(IList data, 50 | double PlaneDistanceTolerance) 51 | where TCell : TriangulationCell, new() 52 | where TVertex : IVertex 53 | { 54 | var ch = new ConvexHullAlgorithm(data.Cast().ToArray(), true, PlaneDistanceTolerance); 55 | ch.GetConvexHull(); 56 | ch.RemoveUpperFaces(); 57 | return ch.GetConvexFaces(); 58 | } 59 | 60 | /// 61 | /// Removes up facing Tetrahedrons from the triangulation. 62 | /// 63 | private void RemoveUpperFaces() 64 | { 65 | var delaunayFaces = ConvexFaces; 66 | var dimension = NumOfDimensions - 1; 67 | 68 | // Remove the "upper" faces 69 | for (var i = delaunayFaces.Count - 1; i >= 0; i--) 70 | { 71 | var candidateIndex = delaunayFaces[i]; 72 | var candidate = FacePool[candidateIndex]; 73 | if (candidate.Normal[dimension] >= 0.0) 74 | { 75 | for (var fi = 0; fi < candidate.AdjacentFaces.Length; fi++) 76 | { 77 | var af = candidate.AdjacentFaces[fi]; 78 | if (af >= 0) 79 | { 80 | var face = FacePool[af]; 81 | for (var j = 0; j < face.AdjacentFaces.Length; j++) 82 | { 83 | if (face.AdjacentFaces[j] == candidateIndex) 84 | { 85 | face.AdjacentFaces[j] = -1; 86 | } 87 | } 88 | } 89 | } 90 | delaunayFaces[i] = delaunayFaces[delaunayFaces.Count - 1]; 91 | delaunayFaces.Pop(); 92 | } 93 | } 94 | } 95 | } 96 | } -------------------------------------------------------------------------------- /MIConvexHull.NET Standard/Triangulation/DelaunayTriangulation.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * The MIT License (MIT) 4 | * 5 | * MIConvexHull, Copyright (c) 2015 David Sehnal, Matthew Campbell 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | * 25 | *****************************************************************************/ 26 | 27 | using System; 28 | using System.Collections.Generic; 29 | 30 | namespace MIConvexHull 31 | { 32 | /// 33 | /// Calculation and representation of Delaunay triangulation. 34 | /// 35 | /// The type of the t vertex. 36 | /// The type of the t cell. 37 | /// 38 | public class DelaunayTriangulation : ITriangulation 39 | where TCell : TriangulationCell, new() 40 | where TVertex : IVertex 41 | { 42 | /// 43 | /// Can only be created using a factory method. 44 | /// 45 | private DelaunayTriangulation() 46 | { 47 | } 48 | 49 | /// 50 | /// Cells of the triangulation. 51 | /// 52 | /// The cells. 53 | public IEnumerable Cells { get; private set; } 54 | 55 | /// 56 | /// Creates the Delaunay triangulation of the input data. 57 | /// 58 | /// The data. 59 | /// The plane distance tolerance (default is 1e-10). If too high, points 60 | /// will be missed. If too low, the algorithm may break. Only adjust if you notice problems. 61 | /// DelaunayTriangulation<TVertex, TCell>. 62 | /// data 63 | /// data 64 | public static DelaunayTriangulation Create(IList data, 65 | double PlaneDistanceTolerance)// = Constants.DefaultPlaneDistanceTolerance) 66 | { 67 | if (data == null) throw new ArgumentNullException("data"); 68 | if (data.Count == 0) return new DelaunayTriangulation { Cells = new TCell[0] }; 69 | 70 | var cells = ConvexHullAlgorithm.GetDelaunayTriangulation(data, PlaneDistanceTolerance); 71 | 72 | return new DelaunayTriangulation { Cells = cells }; 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /MIConvexHull.NET Standard/Triangulation/TriangulationCell.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * The MIT License (MIT) 4 | * 5 | * MIConvexHull, Copyright (c) 2015 David Sehnal, Matthew Campbell 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | * 25 | *****************************************************************************/ 26 | 27 | namespace MIConvexHull 28 | { 29 | /// 30 | /// Representation of the triangulation cell. Pretty much the same as ConvexFace, 31 | /// just wanted to distinguish the two. 32 | /// To declare your own face type, use class Face : DelaunayFace(of Vertex, of Face) 33 | /// 34 | /// The type of the t vertex. 35 | /// The type of the t cell. 36 | /// 37 | public abstract class TriangulationCell : ConvexFace 38 | where TVertex : IVertex 39 | where TCell : ConvexFace 40 | { 41 | } 42 | 43 | /// 44 | /// Default triangulation cell. 45 | /// 46 | /// The type of the t vertex. 47 | public class DefaultTriangulationCell : TriangulationCell> 48 | where TVertex : IVertex 49 | { 50 | } 51 | } -------------------------------------------------------------------------------- /MIConvexHull.NET Standard/Triangulation/VoronoiEdge.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * The MIT License (MIT) 4 | * 5 | * MIConvexHull, Copyright (c) 2015 David Sehnal, Matthew Campbell 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | * 25 | *****************************************************************************/ 26 | 27 | namespace MIConvexHull 28 | { 29 | /// 30 | /// A class representing an (undirected) edge of the Voronoi graph. 31 | /// 32 | /// The type of the t vertex. 33 | /// The type of the t cell. 34 | public class VoronoiEdge 35 | where TVertex : IVertex 36 | where TCell : TriangulationCell 37 | { 38 | /// 39 | /// Create an instance of the edge. 40 | /// 41 | public VoronoiEdge() 42 | { 43 | } 44 | 45 | /// 46 | /// Create an instance of the edge. 47 | /// 48 | /// The source. 49 | /// The target. 50 | public VoronoiEdge(TCell source, TCell target) 51 | { 52 | Source = source; 53 | Target = target; 54 | } 55 | 56 | /// 57 | /// Source of the edge. 58 | /// 59 | /// The source. 60 | public TCell Source { get; internal set; } 61 | 62 | /// 63 | /// Target of the edge. 64 | /// 65 | /// The target. 66 | public TCell Target { get; internal set; } 67 | 68 | /// 69 | /// ... 70 | /// 71 | /// The object to compare with the current object. 72 | /// true if the specified is equal to this instance; otherwise, false. 73 | public override bool Equals(object obj) 74 | { 75 | var other = obj as VoronoiEdge; 76 | if (other == null) return false; 77 | if (ReferenceEquals(this, other)) return true; 78 | return (Source == other.Source && Target == other.Target) 79 | || (Source == other.Target && Target == other.Source); 80 | } 81 | 82 | /// 83 | /// ... 84 | /// 85 | /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. 86 | public override int GetHashCode() 87 | { 88 | var hash = 23; 89 | hash = hash * 31 + Source.GetHashCode(); 90 | return hash * 31 + Target.GetHashCode(); 91 | } 92 | } 93 | } -------------------------------------------------------------------------------- /MIConvexHull/Constants.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * The MIT License (MIT) 4 | * 5 | * MIConvexHull, Copyright (c) 2015 David Sehnal, Matthew Campbell 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | * 25 | *****************************************************************************/ 26 | 27 | namespace MIConvexHull 28 | { 29 | internal static class Constants 30 | { 31 | /// 32 | /// The default plane distance tolerance 33 | /// 34 | internal const double DefaultPlaneDistanceTolerance = 1e-10; 35 | /// 36 | /// The starting delta dot product in simplex 37 | /// 38 | internal const double StartingDeltaDotProductInSimplex = 0.5; 39 | /// 40 | /// The connector table size 41 | /// 42 | internal const int ConnectorTableSize = 2017; 43 | } 44 | } -------------------------------------------------------------------------------- /MIConvexHull/ConvexHull/ConvexFace.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * The MIT License (MIT) 4 | * 5 | * MIConvexHull, Copyright (c) 2015 David Sehnal, Matthew Campbell 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | * 25 | *****************************************************************************/ 26 | 27 | namespace MIConvexHull 28 | { 29 | /// 30 | /// A convex face representation containing adjacency information. 31 | /// 32 | /// The type of the t vertex. 33 | /// The type of the t face. 34 | public abstract class ConvexFace 35 | where TVertex : IVertex 36 | where TFace : ConvexFace 37 | { 38 | /// 39 | /// Adjacency. Array of length "dimension". 40 | /// If F = Adjacency[i] then the vertices shared with F are Vertices[j] where j != i. 41 | /// In the context of triangulation, can be null (indicates the cell is at boundary). 42 | /// 43 | /// The adjacency. 44 | public TFace[] Adjacency { get; set; } 45 | 46 | /// 47 | /// The vertices stored in clockwise order for dimensions 2 - 4, in higher dimensions the order is arbitrary. 48 | /// Unless I accidentally switch some index somewhere in which case the order is CCW. Either way, it is consistent. 49 | /// 3D Normal = (V[1] - V[0]) x (V[2] - V[1]). 50 | /// 51 | /// The vertices. 52 | public TVertex[] Vertices { get; set; } 53 | 54 | /// 55 | /// The normal vector of the face. Null if used in triangulation. 56 | /// 57 | /// The normal. 58 | public double[] Normal { get; set; } 59 | } 60 | 61 | /// 62 | /// A default convex face representation. 63 | /// 64 | /// The type of the t vertex. 65 | public class DefaultConvexFace : ConvexFace> 66 | where TVertex : IVertex 67 | { 68 | } 69 | } -------------------------------------------------------------------------------- /MIConvexHull/ConvexHullCreationResultOutcome.cs: -------------------------------------------------------------------------------- 1 | namespace MIConvexHull 2 | { 3 | /// 4 | /// Enum ConvexHullCreationResultOutcome 5 | /// 6 | public enum ConvexHullCreationResultOutcome 7 | { 8 | /// 9 | /// Successfully created. 10 | /// 11 | Success, 12 | /// 13 | /// dimension smaller two 14 | /// 15 | DimensionSmallerTwo, 16 | /// 17 | /// dimension smaller two 18 | /// 19 | DimensionTwoWrongMethod, 20 | /// 21 | /// not enough vertices for dimension 22 | /// 23 | NotEnoughVerticesForDimension, 24 | /// 25 | /// non uniform dimension 26 | /// 27 | NonUniformDimension, 28 | /// 29 | /// degenerate data 30 | /// 31 | DegenerateData, 32 | /// 33 | /// unknown error 34 | /// 35 | UnknownError 36 | } 37 | } -------------------------------------------------------------------------------- /MIConvexHull/ConvexHullGenerationException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MIConvexHull 4 | { 5 | /// 6 | /// Class ConvexHullGenerationException. 7 | /// Implements the 8 | /// 9 | /// 10 | public class ConvexHullGenerationException : Exception 11 | { 12 | /// 13 | /// Initializes a new instance of the class. 14 | /// 15 | /// The error. 16 | /// The error message. 17 | public ConvexHullGenerationException(ConvexHullCreationResultOutcome error, string errorMessage) 18 | { 19 | ErrorMessage = errorMessage; 20 | Error = error; 21 | } 22 | 23 | /// 24 | /// Gets the error message. 25 | /// 26 | /// The error message. 27 | public string ErrorMessage { get; } 28 | 29 | /// 30 | /// Gets the error. 31 | /// 32 | /// The error. 33 | public ConvexHullCreationResultOutcome Error { get; } 34 | } 35 | } -------------------------------------------------------------------------------- /MIConvexHull/IVertex.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * The MIT License (MIT) 4 | * 5 | * MIConvexHull, Copyright (c) 2015 David Sehnal, Matthew Campbell 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | * 25 | *****************************************************************************/ 26 | 27 | namespace MIConvexHull 28 | { 29 | /// 30 | /// An interface for a structure with nD position. 31 | /// 32 | public interface IVertex 33 | { 34 | /// 35 | /// Position of the vertex. 36 | /// 37 | /// The position. 38 | double[] Position { get; } 39 | } 40 | 41 | /// 42 | /// An interface for a structure with nD position. 43 | /// 44 | public interface IVertex2D 45 | { 46 | /// 47 | /// Gets the x. 48 | /// 49 | /// The x. 50 | double X { get; } 51 | 52 | /// 53 | /// Gets the y. 54 | /// 55 | /// The y. 56 | double Y { get; } 57 | } 58 | 59 | /// 60 | /// "Default" vertex. 61 | /// 62 | /// 63 | public class DefaultVertex : IVertex 64 | { 65 | /// 66 | /// Position of the vertex. 67 | /// 68 | /// The position. 69 | public double[] Position { get; set; } 70 | } 71 | 72 | /// 73 | /// "Default" 2D vertex. 74 | /// 75 | /// 76 | public struct DefaultVertex2D : IVertex2D 77 | { 78 | private double[] p; 79 | 80 | public DefaultVertex2D(double[] coordinates) : this() 81 | { 82 | X = coordinates[0]; 83 | Y = coordinates[1]; 84 | } 85 | public DefaultVertex2D(double x, double y) : this() 86 | { 87 | X = x; 88 | Y = y; 89 | } 90 | 91 | public double X { get; private set; } 92 | 93 | public double Y { get; private set; } 94 | } 95 | } -------------------------------------------------------------------------------- /MIConvexHull/Triangulation/DelaunayTrianglationInternal.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * The MIT License (MIT) 4 | * 5 | * MIConvexHull, Copyright (c) 2015 David Sehnal, Matthew Campbell 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | * 25 | *****************************************************************************/ 26 | 27 | using System.Collections.Generic; 28 | using System.Linq; 29 | 30 | namespace MIConvexHull 31 | { 32 | /* 33 | * Code here handles triangulation related stuff. 34 | */ 35 | 36 | /// 37 | /// Class ConvexHullAlgorithm. 38 | /// 39 | internal partial class ConvexHullAlgorithm 40 | { 41 | /// 42 | /// Computes the Delaunay triangulation. 43 | /// 44 | /// The type of the t vertex. 45 | /// The type of the t cell. 46 | /// The data. 47 | /// The plane distance tolerance. 48 | /// TCell[]. 49 | internal static TCell[] GetDelaunayTriangulation(IList data, 50 | double PlaneDistanceTolerance) 51 | where TCell : TriangulationCell, new() 52 | where TVertex : IVertex 53 | { 54 | var ch = new ConvexHullAlgorithm(data.Cast().ToArray(), true, PlaneDistanceTolerance); 55 | ch.GetConvexHull(); 56 | ch.RemoveUpperFaces(); 57 | return ch.GetConvexFaces(); 58 | } 59 | 60 | /// 61 | /// Removes up facing Tetrahedrons from the triangulation. 62 | /// 63 | private void RemoveUpperFaces() 64 | { 65 | var delaunayFaces = ConvexFaces; 66 | var dimension = NumOfDimensions - 1; 67 | 68 | // Remove the "upper" faces 69 | for (var i = delaunayFaces.Count - 1; i >= 0; i--) 70 | { 71 | var candidateIndex = delaunayFaces[i]; 72 | var candidate = FacePool[candidateIndex]; 73 | if (candidate.Normal[dimension] >= 0.0) 74 | { 75 | for (var fi = 0; fi < candidate.AdjacentFaces.Length; fi++) 76 | { 77 | var af = candidate.AdjacentFaces[fi]; 78 | if (af >= 0) 79 | { 80 | var face = FacePool[af]; 81 | for (var j = 0; j < face.AdjacentFaces.Length; j++) 82 | { 83 | if (face.AdjacentFaces[j] == candidateIndex) 84 | { 85 | face.AdjacentFaces[j] = -1; 86 | } 87 | } 88 | } 89 | } 90 | delaunayFaces[i] = delaunayFaces[delaunayFaces.Count - 1]; 91 | delaunayFaces.Pop(); 92 | } 93 | } 94 | } 95 | } 96 | } -------------------------------------------------------------------------------- /MIConvexHull/Triangulation/DelaunayTriangulation.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * The MIT License (MIT) 4 | * 5 | * MIConvexHull, Copyright (c) 2015 David Sehnal, Matthew Campbell 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | * 25 | *****************************************************************************/ 26 | 27 | using System; 28 | using System.Collections.Generic; 29 | 30 | namespace MIConvexHull 31 | { 32 | /// 33 | /// Calculation and representation of Delaunay triangulation. 34 | /// 35 | /// The type of the t vertex. 36 | /// The type of the t cell. 37 | /// 38 | public class DelaunayTriangulation : ITriangulation 39 | where TCell : TriangulationCell, new() 40 | where TVertex : IVertex 41 | { 42 | /// 43 | /// Can only be created using a factory method. 44 | /// 45 | private DelaunayTriangulation() 46 | { 47 | } 48 | 49 | /// 50 | /// Cells of the triangulation. 51 | /// 52 | /// The cells. 53 | public IEnumerable Cells { get; private set; } 54 | 55 | /// 56 | /// Creates the Delaunay triangulation of the input data. 57 | /// 58 | /// The data. 59 | /// The plane distance tolerance (default is 1e-10). If too high, points 60 | /// will be missed. If too low, the algorithm may break. Only adjust if you notice problems. 61 | /// DelaunayTriangulation<TVertex, TCell>. 62 | /// data 63 | /// data 64 | public static DelaunayTriangulation Create(IList data, 65 | double PlaneDistanceTolerance)// = Constants.DefaultPlaneDistanceTolerance) 66 | { 67 | if (data == null) throw new ArgumentNullException("data"); 68 | if (data.Count == 0) return new DelaunayTriangulation { Cells = new TCell[0] }; 69 | 70 | var cells = ConvexHullAlgorithm.GetDelaunayTriangulation(data, PlaneDistanceTolerance); 71 | 72 | return new DelaunayTriangulation { Cells = cells }; 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /MIConvexHull/Triangulation/TriangulationCell.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * The MIT License (MIT) 4 | * 5 | * MIConvexHull, Copyright (c) 2015 David Sehnal, Matthew Campbell 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | * 25 | *****************************************************************************/ 26 | 27 | namespace MIConvexHull 28 | { 29 | /// 30 | /// Representation of the triangulation cell. Pretty much the same as ConvexFace, 31 | /// just wanted to distinguish the two. 32 | /// To declare your own face type, use class Face : DelaunayFace(of Vertex, of Face) 33 | /// 34 | /// The type of the t vertex. 35 | /// The type of the t cell. 36 | /// 37 | public abstract class TriangulationCell : ConvexFace 38 | where TVertex : IVertex 39 | where TCell : ConvexFace 40 | { 41 | } 42 | 43 | /// 44 | /// Default triangulation cell. 45 | /// 46 | /// The type of the t vertex. 47 | public class DefaultTriangulationCell : TriangulationCell> 48 | where TVertex : IVertex 49 | { 50 | } 51 | } -------------------------------------------------------------------------------- /MIConvexHull/Triangulation/VoronoiEdge.cs: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * The MIT License (MIT) 4 | * 5 | * MIConvexHull, Copyright (c) 2015 David Sehnal, Matthew Campbell 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | * 25 | *****************************************************************************/ 26 | 27 | namespace MIConvexHull 28 | { 29 | /// 30 | /// A class representing an (undirected) edge of the Voronoi graph. 31 | /// 32 | /// The type of the t vertex. 33 | /// The type of the t cell. 34 | public class VoronoiEdge 35 | where TVertex : IVertex 36 | where TCell : TriangulationCell 37 | { 38 | /// 39 | /// Create an instance of the edge. 40 | /// 41 | public VoronoiEdge() 42 | { 43 | } 44 | 45 | /// 46 | /// Create an instance of the edge. 47 | /// 48 | /// The source. 49 | /// The target. 50 | public VoronoiEdge(TCell source, TCell target) 51 | { 52 | Source = source; 53 | Target = target; 54 | } 55 | 56 | /// 57 | /// Source of the edge. 58 | /// 59 | /// The source. 60 | public TCell Source { get; internal set; } 61 | 62 | /// 63 | /// Target of the edge. 64 | /// 65 | /// The target. 66 | public TCell Target { get; internal set; } 67 | 68 | /// 69 | /// ... 70 | /// 71 | /// The object to compare with the current object. 72 | /// true if the specified is equal to this instance; otherwise, false. 73 | public override bool Equals(object obj) 74 | { 75 | var other = obj as VoronoiEdge; 76 | if (other == null) return false; 77 | if (ReferenceEquals(this, other)) return true; 78 | return (Source == other.Source && Target == other.Target) 79 | || (Source == other.Target && Target == other.Source); 80 | } 81 | 82 | /// 83 | /// ... 84 | /// 85 | /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. 86 | public override int GetHashCode() 87 | { 88 | var hash = 23; 89 | hash = hash * 31 + Source.GetHashCode(); 90 | return hash * 31 + Target.GetHashCode(); 91 | } 92 | } 93 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MIConvexHull 2 | A .Net fast convex hull library for 2, 3, and higher dimensions 3 | http://designengrlab.github.io/MIConvexHull/ 4 | -------------------------------------------------------------------------------- /TestFiles/Beam_Boss.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/TestFiles/Beam_Boss.STL -------------------------------------------------------------------------------- /TestFiles/Casing.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/TestFiles/Casing.stl -------------------------------------------------------------------------------- /TestFiles/DinoRider.3ds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/TestFiles/DinoRider.3ds -------------------------------------------------------------------------------- /TestFiles/Dog.3ds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/TestFiles/Dog.3ds -------------------------------------------------------------------------------- /TestFiles/Ferarri40.3ds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/TestFiles/Ferarri40.3ds -------------------------------------------------------------------------------- /TestFiles/LeonardoVehicle.3ds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/TestFiles/LeonardoVehicle.3ds -------------------------------------------------------------------------------- /TestFiles/Temp.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/TestFiles/Temp.stl -------------------------------------------------------------------------------- /TestFiles/Tetrahedron.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/TestFiles/Tetrahedron.STL -------------------------------------------------------------------------------- /TestFiles/Wedge.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/TestFiles/Wedge.STL -------------------------------------------------------------------------------- /TestFiles/adaptor.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/TestFiles/adaptor.stl -------------------------------------------------------------------------------- /TestFiles/bunny.objz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/TestFiles/bunny.objz -------------------------------------------------------------------------------- /TestFiles/cube.stl: -------------------------------------------------------------------------------- 1 | solid C:\Users\Matt Campbell\Documents\GitHub\TVGL\TestFiles\cube 2 | facet normal 0 0 -1 3 | outer loop 4 | vertex -1 1 -1 5 | vertex 1 1 -1 6 | vertex 1 -1 -1 7 | endloop 8 | endfacet 9 | facet normal 0 0 -1 10 | outer loop 11 | vertex -1 1 -1 12 | vertex 1 -1 -1 13 | vertex -1 -1 -1 14 | endloop 15 | endfacet 16 | facet normal 0 0 1 17 | outer loop 18 | vertex 1 -1 1 19 | vertex 1 1 1 20 | vertex -1 1 1 21 | endloop 22 | endfacet 23 | facet normal 0 0 1 24 | outer loop 25 | vertex -1 -1 1 26 | vertex 1 -1 1 27 | vertex -1 1 1 28 | endloop 29 | endfacet 30 | facet normal 1 0 0 31 | outer loop 32 | vertex 1 1 -1 33 | vertex 1 1 1 34 | vertex 1 -1 1 35 | endloop 36 | endfacet 37 | facet normal 1 0 0 38 | outer loop 39 | vertex 1 1 -1 40 | vertex 1 -1 1 41 | vertex 1 -1 -1 42 | endloop 43 | endfacet 44 | facet normal -1 0 0 45 | outer loop 46 | vertex -1 1 1 47 | vertex -1 1 -1 48 | vertex -1 -1 -1 49 | endloop 50 | endfacet 51 | facet normal -1 0 0 52 | outer loop 53 | vertex -1 1 1 54 | vertex -1 -1 -1 55 | vertex -1 -1 1 56 | endloop 57 | endfacet 58 | facet normal 0 1 0 59 | outer loop 60 | vertex -1 1 1 61 | vertex 1 1 1 62 | vertex 1 1 -1 63 | endloop 64 | endfacet 65 | facet normal 0 1 0 66 | outer loop 67 | vertex -1 1 1 68 | vertex 1 1 -1 69 | vertex -1 1 -1 70 | endloop 71 | endfacet 72 | facet normal 0 -1 0 73 | outer loop 74 | vertex -1 -1 -1 75 | vertex 1 -1 -1 76 | vertex 1 -1 1 77 | endloop 78 | endfacet 79 | facet normal 0 -1 0 80 | outer loop 81 | vertex -1 -1 -1 82 | vertex 1 -1 1 83 | vertex -1 -1 1 84 | endloop 85 | endfacet 86 | endsolid C:\Users\Matt Campbell\Documents\GitHub\TVGL\TestFiles\cube 87 | # created by TVGL on 2016/8/30 at 8:16:39 88 | # Originally loaded from : C:\Users\Matt Campbell\Documents\GitHub\TVGL\TestFiles\cube.ply 89 | -------------------------------------------------------------------------------- /TestFiles/cvxhullProb5.stl: -------------------------------------------------------------------------------- 1 | solid C:\Users\Matt\Documents\GitHub\TVGL\TestFiles\cvxhullProb5 2 | facet normal 0.118505183439304 -0.382338071342492 -0.916391903445311 3 | outer loop 4 | vertex 98.608392176 -198.590697366 -98.155289436 5 | vertex 94.313260596 -198.2041 -98.872020176 6 | vertex 98.6362 -198.2041 -98.31299 7 | endloop 8 | endfacet 9 | facet normal 0.193763828812307 -0.382462278241044 -0.903425804572055 10 | outer loop 11 | vertex 102.046274603 -198.2041 -97.581608288 12 | vertex 98.608392176 -198.590697366 -98.155289436 13 | vertex 98.6362 -198.2041 -98.31299 14 | endloop 15 | endfacet 16 | facet normal 0.207916049360529 -0.130437182732529 -0.969410675502963 17 | outer loop 18 | vertex 105.554096369 -196.962996803 -96.996256328 19 | vertex 102.046274603 -198.2041 -97.581608288 20 | vertex 98.6362 -198.2041 -98.31299 21 | endloop 22 | endfacet 23 | facet normal 0.163241508314825 0.127959247604148 -0.978252851217762 24 | outer loop 25 | vertex 89.930665703 -196.963000561 -99.603345962 26 | vertex 105.554096369 -196.962996803 -96.996256328 27 | vertex 98.6362 -198.2041 -98.31299 28 | endloop 29 | endfacet 30 | facet normal 0.127154325595882 -0.130391266180115 -0.983275086222672 31 | outer loop 32 | vertex 94.313260596 -198.2041 -98.872020176 33 | vertex 89.930665703 -196.963000561 -99.603345962 34 | vertex 98.6362 -198.2041 -98.31299 35 | endloop 36 | endfacet 37 | facet normal -0.164594600321116 2.72558141962043E-10 0.986361301727279 38 | outer loop 39 | vertex 98.608392176 -198.590697366 -98.155289436 40 | vertex 102.046274603 -198.2041 -97.581608288 41 | vertex 105.554096369 -196.962996803 -96.996256328 42 | endloop 43 | endfacet 44 | facet normal -0.164594600296942 1.66528063495591E-10 0.986361301731313 45 | outer loop 46 | vertex 94.313260596 -198.2041 -98.872020176 47 | vertex 98.608392176 -198.590697366 -98.155289436 48 | vertex 105.554096369 -196.962996803 -96.996256328 49 | endloop 50 | endfacet 51 | facet normal -0.164594600258657 -1.89879664080625E-10 0.986361301737701 52 | outer loop 53 | vertex 94.313260596 -198.2041 -98.872020176 54 | vertex 105.554096369 -196.962996803 -96.996256328 55 | vertex 89.930665703 -196.963000561 -99.603345962 56 | endloop 57 | endfacet 58 | endsolid C:\Users\Matt\Documents\GitHub\TVGL\TestFiles\cvxhullProb5 59 | # created by TVGL on 2016/6/29 at 14:28:44 60 | # Originally loaded from : C:\Users\Matt\Documents\GitHub\TVGL\TestFiles\cvxhullProb5.ply 61 | -------------------------------------------------------------------------------- /TestFiles/off_axis_box.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/TestFiles/off_axis_box.STL -------------------------------------------------------------------------------- /TestFiles/piston.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/TestFiles/piston.STL -------------------------------------------------------------------------------- /TestFiles/radiobox.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/TestFiles/radiobox.stl -------------------------------------------------------------------------------- /TestFiles/simple_damper.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/TestFiles/simple_damper.STL -------------------------------------------------------------------------------- /TestFiles/sth2.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/TestFiles/sth2.STL -------------------------------------------------------------------------------- /packages/HelixToolkit.2015.1.715/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of Helix Toolkit authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS file. 3 | # See the latter for an explanation. 4 | 5 | # Names should be added to this file as 6 | # Name or Organization 7 | # The email address is not required for organizations. 8 | 9 | # Please keep the list sorted. 10 | # Please notify the first person on the list to be added here. 11 | 12 | Oystein Bjorke 13 | -------------------------------------------------------------------------------- /packages/HelixToolkit.2015.1.715/CONTRIBUTORS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/packages/HelixToolkit.2015.1.715/CONTRIBUTORS -------------------------------------------------------------------------------- /packages/HelixToolkit.2015.1.715/HelixToolkit.2015.1.715.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/packages/HelixToolkit.2015.1.715/HelixToolkit.2015.1.715.nupkg -------------------------------------------------------------------------------- /packages/HelixToolkit.2015.1.715/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2012 Helix Toolkit contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included 14 | in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /packages/HelixToolkit.2015.1.715/README.md: -------------------------------------------------------------------------------- 1 | Helix Toolkit is a collection of 3D components for .NET. Currently it contains one component that adds functionality to the WPF 3D model (Media3D namespace), and one WPF component that creates a similar scene graph for DirectX (based on SharpDX). 2 | 3 | [![Build status](https://ci.appveyor.com/api/projects/status/tmqafdk9p7o98gw7)](https://ci.appveyor.com/project/objorke/helix-toolkit) 4 | 5 | Description | Value 6 | --------------------|----------------------- 7 | License | The MIT License (MIT) 8 | Web page | http://helix-toolkit.org/ 9 | Documentation | http://docs.helix-toolkit.org/ 10 | Forum | http://forum.helix-toolkit.org/ 11 | Chat | https://gitter.im/helix-toolkit/helix-toolkit 12 | Source repository | http://github.com/helix-toolkit/helix-toolkit 13 | Latest build | http://ci.appveyor.com/project/objorke/helix-toolkit 14 | Issue tracker | http://github.com/helix-toolkit/helix-toolkit/issues 15 | NuGet packages | http://www.nuget.org/packages?q=HelixToolkit 16 | StackOverflow | http://stackoverflow.com/questions/tagged/helix-3d-toolkit 17 | Twitter | https://twitter.com/hashtag/Helix3DToolkit 18 | -------------------------------------------------------------------------------- /packages/HelixToolkit.2015.1.715/lib/portable-net4+sl4+wp71+win8/HelixToolkit.XML: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | HelixToolkit 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/HelixToolkit.2015.1.715/lib/portable-net4+sl4+wp71+win8/HelixToolkit.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/packages/HelixToolkit.2015.1.715/lib/portable-net4+sl4+wp71+win8/HelixToolkit.dll -------------------------------------------------------------------------------- /packages/HelixToolkit.Wpf.2015.1.715/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of Helix Toolkit authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS file. 3 | # See the latter for an explanation. 4 | 5 | # Names should be added to this file as 6 | # Name or Organization 7 | # The email address is not required for organizations. 8 | 9 | # Please keep the list sorted. 10 | # Please notify the first person on the list to be added here. 11 | 12 | Oystein Bjorke 13 | -------------------------------------------------------------------------------- /packages/HelixToolkit.Wpf.2015.1.715/CONTRIBUTORS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/packages/HelixToolkit.Wpf.2015.1.715/CONTRIBUTORS -------------------------------------------------------------------------------- /packages/HelixToolkit.Wpf.2015.1.715/HelixToolkit.Wpf.2015.1.715.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/packages/HelixToolkit.Wpf.2015.1.715/HelixToolkit.Wpf.2015.1.715.nupkg -------------------------------------------------------------------------------- /packages/HelixToolkit.Wpf.2015.1.715/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2012 Helix Toolkit contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included 14 | in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /packages/HelixToolkit.Wpf.2015.1.715/README.md: -------------------------------------------------------------------------------- 1 | Helix Toolkit is a collection of 3D components for .NET. Currently it contains one component that adds functionality to the WPF 3D model (Media3D namespace), and one WPF component that creates a similar scene graph for DirectX (based on SharpDX). 2 | 3 | [![Build status](https://ci.appveyor.com/api/projects/status/tmqafdk9p7o98gw7)](https://ci.appveyor.com/project/objorke/helix-toolkit) 4 | 5 | Description | Value 6 | --------------------|----------------------- 7 | License | The MIT License (MIT) 8 | Web page | http://helix-toolkit.org/ 9 | Documentation | http://docs.helix-toolkit.org/ 10 | Forum | http://forum.helix-toolkit.org/ 11 | Chat | https://gitter.im/helix-toolkit/helix-toolkit 12 | Source repository | http://github.com/helix-toolkit/helix-toolkit 13 | Latest build | http://ci.appveyor.com/project/objorke/helix-toolkit 14 | Issue tracker | http://github.com/helix-toolkit/helix-toolkit/issues 15 | NuGet packages | http://www.nuget.org/packages?q=HelixToolkit 16 | StackOverflow | http://stackoverflow.com/questions/tagged/helix-3d-toolkit 17 | Twitter | https://twitter.com/hashtag/Helix3DToolkit 18 | -------------------------------------------------------------------------------- /packages/HelixToolkit.Wpf.2015.1.715/lib/net40/HelixToolkit.Wpf.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/packages/HelixToolkit.Wpf.2015.1.715/lib/net40/HelixToolkit.Wpf.dll -------------------------------------------------------------------------------- /packages/HelixToolkit.Wpf.2015.1.715/lib/net45/HelixToolkit.Wpf.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/packages/HelixToolkit.Wpf.2015.1.715/lib/net45/HelixToolkit.Wpf.dll -------------------------------------------------------------------------------- /packages/PropertyTools.Wpf.2015.2.0/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of OxyPlot authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS file. 3 | # See the latter for an explanation. 4 | 5 | # Names should be added to this file as 6 | # Name or Organization 7 | # The email address is not required for organizations. 8 | 9 | # Please keep the list sorted. 10 | 11 | DNV GL AS 12 | Jeremy Liu 13 | Oystein Bjorke 14 | Per Malmberg 15 | Ray Lu 16 | -------------------------------------------------------------------------------- /packages/PropertyTools.Wpf.2015.2.0/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This is the official list of people who have contributed 2 | # to the PropertyTools repository. 3 | # The AUTHORS file lists the copyright holders; this file 4 | # lists people. 5 | 6 | # People submitting code should be listed in this file (by email address). 7 | 8 | # Names should be added to this file like so: 9 | # Name 10 | 11 | # Please keep the list sorted. 12 | 13 | Aldinei Sampaio 14 | Jeremy Liu 15 | Jochen Kühner 16 | Oystein Bjorke 17 | Per Malmberg 18 | Ray Lu 19 | Roland König 20 | William Dibbern -------------------------------------------------------------------------------- /packages/PropertyTools.Wpf.2015.2.0/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 PropertyTools contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included 14 | in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /packages/PropertyTools.Wpf.2015.2.0/PropertyTools.Wpf.2015.2.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/packages/PropertyTools.Wpf.2015.2.0/PropertyTools.Wpf.2015.2.0.nupkg -------------------------------------------------------------------------------- /packages/PropertyTools.Wpf.2015.2.0/README.md: -------------------------------------------------------------------------------- 1 | [![Build status](https://ci.appveyor.com/api/projects/status/b3579d3lja65kt6m)](https://ci.appveyor.com/project/objorke/propertytools) 2 | 3 | ``` 4 | License: The MIT License (MIT) 5 | Project page: https://github.com/objorke/PropertyTools/ 6 | NuGet: https://www.nuget.org/packages/PropertyTools.Wpf/ 7 | ``` 8 | 9 | | Control | Description | Status | 10 | |-------------------|------------------------------------------------------------------------------------------|--------| 11 | | PropertyGrid | A control that shows properties of an object or a collection of objects. | Stable | 12 | | DataGrid | A data grid with an "Excel feel" (note that the control is not virtualized) | Stable | 13 | | TreeListBox | A ListBox that looks and feels like a TreeView (supports multi-select and drag-drop) | Some bugs remaining | 14 | | ColorPicker | A color picker | Stable | 15 | | RadioButtonList | A collection of radio buttons that binds to an enum | Stable | 16 | | EnumMenuItem | A collection of checkable menuitems that binds to an enum | Stable | 17 | | EditableTextBlock | A TextBlock that can be changed into a TextBox, useful for in-place editing in TreeViews | Stable | 18 | | FilePicker | A TextBox with browse for file button | Stable | 19 | | DirectoryPicker | A TextBox with browse for directory button | Stable | 20 | | DockPanelSplitter | A splitter for DockPanels | Stable | 21 | | SpinControl | A numeric up/down spinner control | Stable | 22 | | LinkBlock | A hyperlink on a TextBlock | Stable | 23 | | SliderEx | A Slider that calls IEditableObject.BeginEdit/EndEdit when thumb dragging | Stable | 24 | | PopupBox | A restyled `ComboBox` where you can put anything in the Popup | Stable | 25 | | FormattingTextBox | A `TextBox` where you can bind the StringFormat | Stable | 26 | 27 | ### PropertyGrid 28 | 29 | ![PropertyGrid](/Images/PropertyGrid.png) 30 | 31 | ### DataGrid 32 | 33 | ![DataGrid](/Images/DataGrid.png) 34 | 35 | ### TreeListBox 36 | 37 | ![TreeListBox](/Images/TreeListBox.png) 38 | 39 | ### ColorPicker 40 | 41 | ![ColorPicker](/Images/ColorPicker.png) ![ColorPicker](/Images/ColorPicker2.png) 42 | 43 | ### AboutDialog 44 | 45 | Generic "About" dialog 46 | 47 | - Titles and version is taken from AssemblyInfo 48 | - Open System Info... 49 | - Copy report 50 | 51 | ![AboutDialog](/Images/AboutDialog.png) 52 | 53 | ### PropertyDialog 54 | 55 | Below is an example `PropertyDialog` bound to `Settings.Default`: 56 | 57 | ![OptionsDialog](/Images/PropertyDialog.png) 58 | 59 | ### Build requirements 60 | 61 | - Microsoft 4.0 or later 62 | - Portable library tools 63 | - Visual Studio 2010 or later 64 | 65 | ### Links 66 | 67 | Semantic versioning [semver.org](http://semver.org/) 68 | Semver tool: [GitVersion](https://github.com/GitTools/GitVersion) 69 | Branching strategy: [GitHub Flow](https://guides.github.com/introduction/flow/index.html) 70 | -------------------------------------------------------------------------------- /packages/PropertyTools.Wpf.2015.2.0/lib/net40/PropertyTools.Wpf.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/packages/PropertyTools.Wpf.2015.2.0/lib/net40/PropertyTools.Wpf.dll -------------------------------------------------------------------------------- /packages/PropertyTools.Wpf.2015.2.0/lib/net40/PropertyTools.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/packages/PropertyTools.Wpf.2015.2.0/lib/net40/PropertyTools.dll -------------------------------------------------------------------------------- /packages/PropertyTools.Wpf.2015.2.0/lib/net45/PropertyTools.Wpf.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/packages/PropertyTools.Wpf.2015.2.0/lib/net45/PropertyTools.Wpf.dll -------------------------------------------------------------------------------- /packages/PropertyTools.Wpf.2015.2.0/lib/net45/PropertyTools.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/packages/PropertyTools.Wpf.2015.2.0/lib/net45/PropertyTools.dll -------------------------------------------------------------------------------- /packages/PropertyTools.Wpf.2015.2.0/lib/portable-net40+sl5+wp8+win8/PropertyTools.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DesignEngrLab/MIConvexHull/90b620d7d5f64b1c3954638ff832c274f9a993bb/packages/PropertyTools.Wpf.2015.2.0/lib/portable-net40+sl5+wp8+win8/PropertyTools.dll --------------------------------------------------------------------------------