public int Build(Vector3 min, int size, float threshold, List<VertexPositionColorNormal> vertices, int grid_size) { this.position = min; this.size = size; this.type = OctreeNodeType.Internal; int v_index = 0; ConstructNodes(vertices, grid_size, 1); Simplify(threshold, false); return v_index; }
public override long Contour(float threshold) { Stopwatch watch = new Stopwatch(); Vertices.Clear(); tree = new OctreeNode(); watch.Start(); tree.Build(Vector3.Zero, Resolution, threshold, Vertices, Size); tree.GenerateVertexBuffer(Vertices); if (Vertices.Count > 0) { VertexBuffer.SetData <VertexPositionColorNormal>(Vertices.ToArray()); } VertexCount = Vertices.Count; //ConstructTreeGrid(tree); CalculateIndexes(); watch.Stop(); return(watch.ElapsedMilliseconds); }