Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Convert Point Cloud to Solid Mass using Revit API

tom-bBSYBT
Contributor

Convert Point Cloud to Solid Mass using Revit API

tom-bBSYBT
Contributor
Contributor

Hi, as per the title description, I'm looking for a way to create a Solid object representing a cloud point,

I will be using this for reverse clash detection against an Architectural model.

 

I'm not sure the Revit API is a feasible way to do this, I don't have much experience manipulating cloud points,

my approach could be wrong, maybe I should just use some other already existing tool...

 

What do you think?

0 Likes
Reply
Accepted solutions (2)
1,178 Views
11 Replies
Replies (11)

jeremy_tammik
Autodesk
Autodesk

I think one interesting aspect of this task is how to generate the solid from the points. A convex hull would be super simple to achieve, but probably not fulfil your needs... it would be much too big, especially if your cloud point is partially concave, e.g., has lots of sticky out bits. A different candidate might be a 3D alpha shape:

  

  

Anyway, Revit and its API will not help you address this aspect. So, it might be more efficient to start your research independently of Revit. If the architectural model for clashing is in Revit anyway, then you can bring your cloud-point-generated solid into the RVT as a direct shape once you have it, if you like.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes

tom-bBSYBT
Contributor
Contributor

Thank you @jeremy_tammik , I was suspecting this could be a problem, after asking a bit around,

seems like there should be a way to semi-automatically convert cloud-point to mesh using Autodesk ReCap

followed by automatically convert the Mesh object to Solid using Fusion360 which can be imported into Revit.

 

The thing is, I only seen examples of small parts, I doubt this workflow is able to scale and be effective for

large data sets like something you gonna get from capturing a few typical floors of actual construction project.

 

Do you know by any chance a good set of tools to support a similar workflow to eventually achieve something

I'm able to get a Solid  object from?

0 Likes

tom-bBSYBT
Contributor
Contributor

@jeremy_tammik Also another approach I think to explore is iterating over the points of the cloud against

the Architectural model while checking for each point what type of object it is referencing. So I get a cluster

of points which I know should be a wall because in the Architectural model there is a Wall object in the same

position.

 

After I have many groups of clusters I can potentially draw lines around the outer X,Y,Z coordinates in order to create

direct shapes for each object type and extract the Solid I need.

 

What do you think is that feasible performance wise or a pipedream I need a super computer for?

0 Likes

jeremy_tammik
Autodesk
Autodesk

Yes, that sounds like a very good idea. If you are targeting specific separate architectural elements, it would be a total waste of information to process the point cloud into one single huge and complex stupid lump. Splitting it up into components matching the architectural target objects makes much more sense. If does not sound more complex than the single-lump approach, and not more computationally expensive either. You will only need a supercomputer for inefficient time-wasting approaches. An efficient approach will work fine. How will you match the point cloud bits and pieces to the elements? Just by proximity? How will you identify if something is missing or misplaced?

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes

tom-bBSYBT
Contributor
Contributor

Hi @jeremy_tammik , the idea is to make an initial approximation, it doesn't have to be precise. it only has to be

good enough to capture most of the correct element type so I get a nice big clusters which I know should represent

something, a wall, a floor, a column, etc...

 

At the second phase, the user will be able to manually classify patches of points which the previous approximation

wasn't able to classify due to on-site construction diviations or scanning errors which will happen regardless.

 

At the third phase, the already classified clusters will be re-constructed as elements, the idea I'm exploring

is to normalize the outer boundary of each cluster to get smooth lines and curves which will represent the faces

of the objects - This is the tricky part for me, lot's of math, any chance you know a C# library to help me?

 

At this final phase, I will run a fine tuning algorithm which will connect walls to each other or attach them

to floors/columns depending on what the problem is in order to get a more refined result like something

you would expect from a human modeler to do.

 

Is there a library to help me with the outer boundary detection?

0 Likes

jeremy_tammik
Autodesk
Autodesk
Accepted solution

Yes, sure. I think you will do yourself a disservice limiting your search to C#, though. C++ and JavaScript are also likely candidates. I heard good things about potree:

  

  

You can search GitHub for point cloud and sort by number of stars:

  

  

Here is a C++ library that extracts lines from point clouds:

  

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open

tom-bBSYBT
Contributor
Contributor

@jeremy_tammik  Amazing! This C++ library seems like something I'm looking for, unfortunately,

this gonna cost me some time because I didn't touch C++ since my university times, if there are sufficient

code examples for this library I think it might solve my problem!

 

Did you personally used it before? if so, any chance you can share a repo with me?

0 Likes

jeremy_tammik
Autodesk
Autodesk

Glad that it seems useful.

  

Did you personally used it before? if so, any chance you can share a repo with me?

  

Nope, haven't touched it myself. Happy weekend, take some rest  🙂

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open

tom-bBSYBT
Contributor
Contributor
Accepted solution

Thank you @jeremy_tammik  for your insights, always a pleasure to get your input!

 

After a bit more research I came to the conclusion that I'm better off developing a prototype

of my workflow based on NetTopologySuite , it is a C# library with the right tools for the job,

it is well maintained & documented, full of code examples and simple explanations for beginners.

 

I'm sharing the link for anyone who reads this looking for solutions, the short answers is:

Its complicated, you gonna need to do some research and understand some math concepts

Sorry 😞

 



https://github.com/NetTopologySuite/NetTopologySuite

0 Likes

jeremy_tammik
Autodesk
Autodesk

Glad to hear you found what you need. I am rather surprised, though, that you plan to use a 2D library to handle your point clouds. Aren't your building elements and point clouds 3D? Note that it says it is an API for modelling and manipulating 2-dimensional linear geometry.

   

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes

tom-bBSYBT
Contributor
Contributor

I will be using the library to extract Convex Hulls from each cluster, so I will get XY, XZ and YZ planes, 

foreach element type I can make assumption about their 3D geometry based on their Hull shapes.

This will allow me to compute a set of points which I will use to draw an outer boundary of the object

in Revit by connecting the dots with straight lines at first (maybe add in cases for curves later).

 

For instance, while re-creating a Wall element, the most important plane is the XY (Top and bottom faces),

I can assume for approximation purposes that parallel faces are symmetrical, I can assume the wall isn't

tilted on the side, I can also assume the Wall probably has consistent Hight across the YZ Plane. 

 

Similar estimations, approximations and assumption can be made for almost all Structural objects which

mostly consists of Euclidean Geometry therefore I should be able to get a good enough results for most

cases, obviously this won't work for complex structures but if to be honest, we mostly build boxes around

here and I'm not looking to solve for all possible geometries, 80% is good enough to save hundreds of

modeling hours

0 Likes