public void CanCreateInMemoryPointSet_Many() { var storage = PointCloud.CreateInMemoryStore(); var ps = new List <V3d>(); var ns = new List <V3f>(); for (var x = 0.125; x < 1.0; x += 0.25) { for (var y = 0.125; y < 1.0; y += 0.25) { for (var z = 0.125; z < 1.0; z += 0.25) { ps.Add(new V3d(x, y, z)); ns.Add(V3f.ZAxis); } } } Assert.IsTrue(ps.Count == 4 * 4 * 4); var imps = InMemoryPointSet.Build(ps, null, ns, null, new Cell(0, 0, 0, 0), 1); var root = imps.ToPointSetCell(storage, ct: CancellationToken.None); Assert.IsTrue(root.PointCountTree == 4 * 4 * 4); var countNodes = root.CountLeafNodes(true); Assert.IsTrue(countNodes == 4 * 4 * 4); }
public void CanCreateInMemoryPointSetWithNormals() { var chunk = new Chunk(new[] { V3d.IOO }, new[] { C4b.White }, new[] { V3f.OIO }); var builder = InMemoryPointSet.Build(chunk, 8192); var root = builder.ToPointSetNode(CreateInMemoryStore(), isTemporaryImportNode: false); Assert.IsTrue(root.IsLeaf); Assert.IsTrue(root.PointCountCell == 1); Assert.IsTrue(root.HasNormals); Assert.IsTrue(root.Normals.Value[0] == V3f.OIO); }
public void CanQueryPointsWithEverythingOutside_Single() { var storage = PointCloud.CreateInMemoryStore(); var ps = new List <V3d> { new V3d(0.5, 0.5, 0.5) }; var root = InMemoryPointSet.Build(ps, null, null, null, Cell.Unit, 1).ToPointSetCell(storage, ct: CancellationToken.None); var rs = root.QueryPoints(cell => false, cell => true, p => false).SelectMany(x => x.Positions).ToArray(); Assert.IsTrue(rs.Length == 0); }
public void CanCreateInMemoryPointSetWithoutColors() { var ps = new List <V3d> { new V3d(0.5, 0.5, 0.5) }; var ns = new List <V3f> { V3f.ZAxis }; var js = new List <int> { 123 }; var imps = InMemoryPointSet.Build(ps, null, ns, js, Cell.Unit, 1); }
public void CanCreateInMemoryPointSetWithoutIntensities() { var ps = new List <V3d> { new V3d(0.5, 0.5, 0.5) }; var cs = new List <C4b> { C4b.White }; var ns = new List <V3f> { V3f.ZAxis }; var imps = InMemoryPointSet.Build(ps, cs, ns, null, Cell.Unit, 1); }
public void CanCreateInMemoryPointSetWithoutNormals() { var ps = new List <V3d> { new V3d(0.5, 0.5, 0.5) }; var cs = new List <C4b> { C4b.White }; var js = new List <int> { 123 }; var imps = InMemoryPointSet.Build(ps, cs, null, js, Cell.Unit, 1); }
public void CanCreateInMemoryPointSet() { var ps = new List <V3d> { new V3d(0.5, 0.5, 0.5) }; var cs = new List <C4b> { C4b.White }; var ns = new List <V3f> { V3f.ZAxis }; var js = new List <int> { 123 }; var imps = InMemoryPointSet.Build(ps, cs, ns, js, Cell.Unit, 1); }