예제 #1
0
 void saveToFiles(Dictionary <Vector3, Dictionary <Vector3, double[]> > BucketOVoxels, float _minVoxelSize, float _bucketSize, string _name)
 {
     if (writtenAverages == 1)
     {
         writtenAverages = 2;
         foreach (var bucket in BucketOVoxels)
         {
             bucketVoxels.Add(bucket.Key, new List <double[]>(bucket.Value.Values));
         }
         cloud = new SlimHabitatCloud(bucketVoxels, _minVoxelSize, _bucketSize, _name);
     }
 }
예제 #2
0
    PointCloudData ImportAsPointCloudData(string path)
    {
        SlimHabitatCloud cloud = new SlimHabitatCloud(path, true);
        //var stream = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.Read);
        //var reader = new PclBinaryReader(ReadFully(stream));

        //var header = ReadDataHeader(reader);
        //var body = ReadDataBody(header, reader);

        var data = ScriptableObject.CreateInstance <PointCloudData>();

        data.Initialize(cloud.pPosition.Clone() as Vector3[], cloud.pNormals.Clone() as Vector3[], cloud.pColours.Clone() as Color32[], Scale, PivotOffset, NormalRotation);
        data.name = Path.GetFileNameWithoutExtension(path);         //cloud.cloudInfo.name;

        return(data);
    }
예제 #3
0
 void readFromFile(string _name)
 {
     cloud = new SlimHabitatCloud(_name);
 }