static public Octree <T> Build(List <T> Points, BoundingBox boundingBox, double minPointSpacing) { try { Octree <T> octree = new Octree <T>(boundingBox, minPointSpacing); octree.Insert(Points); return(octree); } catch (Exception) { throw; } }
static public Octree <T> Build(List <Vector3> points, double minPointSpacing) { try { BoundingBox boundingBox = BoundingBoxBuilder.CubeFromPtArray(points); Octree <T> octree = new Octree <T>(boundingBox, minPointSpacing); // int index = 0; foreach (Vector3 pt in points) { T octpt = new T(); //octpt.Index = index++; octpt.Position = pt; octree.Insert(octpt); } return(octree); } catch (Exception) { throw; } }
static public Octree <T> Build(List <T> Points, double minPointSpacing) { try { List <Vector3> points = new List <Vector3>(); foreach (T pt in Points) { points.Add(pt.Position); } BoundingBox boundingBox = BoundingBoxBuilder.CubeFromPtArray(points); Octree <T> octree = new Octree <T>(boundingBox, minPointSpacing); octree.Insert(Points); return(octree); } catch (Exception) { throw; } }