PointCloudInstance Coordinate System

PointCloudInstance Coordinate System

andrew.wilsonCR5LU
Participant Participant
798 Views
2 Replies
Message 1 of 3

PointCloudInstance Coordinate System

andrew.wilsonCR5LU
Participant
Participant

I have a question about what coordinate system the cloud point and scan origin positions are in when they are retrieved from the native Revit point cloud engine. I ran the following code in Visual Studio 2015 with Revit 2016.

 

The point clouds which were loaded have the scanner location/ scan origin in the middle of its point cloud. Here I assume the scan origin is the position of the scanner head in the scene. This is the code I used to retrieve the point cloud info.

 

FilteredElementCollector collector = new FilteredElementCollector(Application.ActiveUIDocument.Document).OfClass(typeof(PointCloudInstance));
foreach (Element e in collector){

      PointCloudInstance pointCloudInstance = e as PointCloudInstance;

      BoundingBoxXYZ boundingBox = pointCloudInstance.get_BoundingBox(null);

      IList<string> scans = pointCloudInstance.GetScans();

      foreach (string scan in scans)
        {
                XYZ scanLocationHost = pointCloudInstance.GetScanOrigin(scan);

/// scanLocationHost is not inside of bounding box

        }

}

 

The problem comes when I compare the scan origin to the point cloud bounding box.

 

In one project, the scanner origin is returned in what seems to be the same coordinate system as the bounding box.

 

In another project, the scanner origin seems to be in a coordinate system that involves the project base point, but the bounding box does not.

 

Both projects have a project base point and survey point far away from origin and at the same place. Both projects have point clouds with their scanner location / scan origin within the point cloud as visible in the scene.

 

Could someone help me to understand the steps I need to follow to get the scan origin, point cloud points, and point cloud bounding box all in the same coordinate system in any project state?

799 Views
2 Replies
Replies (2)
Message 2 of 3

andrew.wilsonCR5LU
Participant
Participant
Unfortunately, the documentation on this class is quite sparse. I would appreciate any help.
Thanks,
Andrew
0 Likes
Message 3 of 3

Anonymous
Not applicable

This might be too late but look at PointCloudInstance's getTransform() and getTotalTransform() methods.

0 Likes