LOD control of point clouds with custom point cloud engine

LOD control of point clouds with custom point cloud engine

sg.kim
Participant Participant
1,987 Views
5 Replies
Message 1 of 6

LOD control of point clouds with custom point cloud engine

sg.kim
Participant
Participant

Hi,

 

I am implementing my own custom point cloud engine because Revit's internal point cloud engine does not provide the entire list of points in point cloud. A sample code in the Revit SDK gave me a lot of questions and opportunity of learning Revit APIs.

 

My engine works somehow, but the point cloud appears as if it is broken at distant zoom levels.

 

 

While I was trying to figure out what is wrong,

I found the following statement in the Revit API docs:

[http://www.revitapidocs.com/2016/d5e8d1d7-9375-ce6b-ff4f-6d4764c92736.htm]

 

 

IPointCloudAccess

 

"An instance of this class will be requested by Revit when drawing the point cloud in the view. For performance reasons, when rendering every frame Revit asks the engine to fetch the necessary points split into multiple batches. The number of batches requested depends on the view: the smaller the projection of the cloud bounding box on the screen the fewer batches Revit requests. Revit assumes that each batch contains points uniformly distributed over the visible part of the cloud ("visible" as defined by the filter). Thus, the points supplied by the engine should not be geometrically distinct (e.g. divided into multiple independent volumes, because at distant zoom levels Revit will only request a few batches and only part of the cloud will be displayed."

 

Revit fetches point clouds from custom point cloud engines using an iterator class inherited by IPointSetIterator.

After the engines are registered to the Revit's PointCloudEngineRegistry class, Revit calls ReadPoints methods of the target point clouds' IPointSetIterator class instance.

 

I think that the "batch" means the invocation of IPointSetIterator.ReadPoints method.

The description means that the number of batches decreases as the zoom level goes distant, thus the fewer batches fetch the fewer points.

I check my point cloud engine and it turns out that it did not care at all.

 

However, do you think that it is more reasonable that each batch fetches the smaller (and fixed) amount of points with the same number of batches, instead of decreasing the number of batches?

 

 

The following source code is the declaration of IPointSetIterator which is used as an interface of point cloud access iterator of custom point cloud engines (metadata):

 

 

using System;

namespace Autodesk.Revit.DB.PointClouds
{
	public interface IPointSetIterator
	{
		...
		//
		// Summary:
		//     Implement this method to fill the provided buffer with points up to the number
		//     of maximum points for which the buffer was allocated.
		//
		// Parameters:
		//   buffer:
		//     Memory buffer into which the points should be written. The buffer was allocated
		//     by Revit and it is guaranteed to be valid for the duration of the call.
		//
		//   bufferSize:
		//     The maximum number of CloudPoint objects that may be copied into the buffer.
		//
		// Returns:
		//     The actual number of CloudPoint objects placed in the buffer (can be less than
		//     the length of the buffer). If there are no more points available, return 0.
		int ReadPoints( IntPtr buffer, int bufferSize );
	}
}

 

Revit calls the ReadPoints methods iteratively until the exact amount of points that Revit requires.

The bufferSize parameter is not fixed. Revit keep changing the size of buffer through the successive calls.

The number of calls is also not fixed. Revit tries calling the methods, changing the size of buffer.

 

I tested my own add-in that handles 544,285 points of point cloud.

At first, the batches requires 262,144 points, which means the bufferSize was set to 262144.

Note that the number 262,144 is not half of 544,285.

That makes me assume that the number is not decided as a result of calculation related to the total number of points in the point cloud.

After some of the points are provided, the size is set to 209,254, and 186,387 after that, and so on.

When I try again, the size becomes another random number. I am not sure it is random, but to me, it looks like random.

I don't know what is going on except for the fact that it is decreasing.

 

There is no description about how Revit decides the sizes of those buffers.

 

The engines cannot presume how many batches will eventually occur, so they cannot decide how many points they should provide to make the distribution of the points uniform. In order to make each batch contains the points uniformly distributed, the engines have to know how many batches will be executed, and how many points each batch requires, so that the engine can prepare the points (for example, they can filter out uniformly distributed portion of their points).

 

0 Likes
Accepted solutions (1)
1,988 Views
5 Replies
Replies (5)
Message 2 of 6

jeremytammik
Autodesk
Autodesk

Dear SG Kim,

 

Thank you for your query here and your associated ADN case 13354346 [LOD control of point clouds with custom point cloud engine].

 

Please excuse (once again) the long delay replying, and thank you for your patience and understanding!

 

Afaik, there is currently no API access to the functionality you request.

 

I submitted the wish list item CF-4815 [LOD control of point clouds with custom point cloud engine -- 13354346] on your behalf for it you suggest, as this issue requires exploration and possibly a modification to our software. Please make a note of this number for future reference.

 

We will see what the development team have to say about it. I prompted them separately for a timely response.

 

You are welcome to request an update on the status of this issue or to provide us with additional information at any time quoting this wish list item number.

 

If you can provide a business case underlining the importance of this issue, it will help prioritise it against all other outstanding change requests. Any information that you can provide to influence this assessment will help. Thank you very much for your input.

 

By the way, all wish list items should also be entered in the Revit Idea Station.

 

This will make them visible to other users and developers and enable them to vote for them, which again will help prioritise.

 

Thank you!

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 6

jeremytammik
Autodesk
Autodesk
Accepted solution

Dear SG Kim,

Thank you for your patience.

 

I asked the development team about the status the following point cloud related wish list items:

 

  • CF-2064 - notify about limit
  • CF-2065 - remove limit
  • CF-4815 - control LOD

 

Their reply is short and sweet:

 

As of right now, improvements to the Point Cloud APIs are not on the roadmap. I encourage these to be filed on Revit Ideas.

 

I hope this clarifies.

 

Best regards,

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 4 of 6

Anonymous
Not applicable

Dear Kim

 

I also have the same problem with my point cloud engine and don't know what to do. It's so annoying that the GetPoints method is limited to 1M points and the custom engine doesn't work properly either.

What did you do; could you find a way?

I've figured out that increasing the size of the bounding box might resolve the problem to some extent, but the problem still exists when you zoom out. It gets even worse when I try to import a point cloud with a higher number of points.

Message 5 of 6

vincent.ngaiT3DXU
Community Visitor
Community Visitor

I have the same issue as well, while zooming out/in cells that are considered culled appears to be in LIFO order, and not if they're actually out of the view frustum. So what would the dev team recommend be a good cell partitioning system? Overlapping voxel coverage? Or would dealing with large point clouds be better handled if the plugin can export to Recap's RCS/RCP and then use Revit's SDK to trigger a link?

0 Likes
Message 6 of 6

caiguonengW8PLN
Participant
Participant

How to obtain the current view in the IPointCloudAccess method?

0 Likes