I’m working on an automation and BIM challenge involving generating in-place masses in Revit from point-clouds (primarily .rcs files imported into Revit - other options .rcp or .pts are possible). I would like to open a discussion on how others have approached this and share what I’ve tried so far and where I got stuck and what is the next step to tackle this “mission”.
So the goal is to generate usable, accurate Revit in-place mass or generic model mass either from imported point cloud data .rcs or via external script that exports the .rcs to .obj or .pts which I alreaddy have that script/button made. I am thinking to make it simple, import pointcloud .rcs (saved/exported from Recap) in revit origin to origin, then adjust/place the point cloud where it should be (0,0,0 position in project - ground floor or wherever you need it to be), then select/highlight the pointcloud then either click a button so that a script (python, cpython, ironpython, c#…) will convert/create the pointcloud into a in-place mass/generic model mass, or open dynamo/grasshopper/rhino.insiderevit and connect the nodes and scripts and tweak step-by-step while watching changes in real-time. If you have a similar proven method, a way/tool/programming langugage etc. that will definitely make it happen then I am all ears!
There’s ton of information that I would add here, all the approaches/methods I’ve tried, problems, methods I abandoned, planned and currently working on, but this would take forever to write here.
I’d appreciate any feedback on similar workflows you’ve used (no matter which tool, Revit, Rhino, Dynamo, Grasshopper, Ansys…), generative/parametric design approach, clean mesh generation from points.
Let’s collaborate on a robust, cross-platform method for turning scan data into usable design geometry!
P.S. In the attachements you can see some failed attempts and a example of a in-place mass how it should look like as one entire mass after the conversion.
My latest experiments with this space involve reading the points as xyz’s, rounding to the nearest tolerance (e.g. one point every 0.5m) then keeping unique points to start with. This helps reduce the number of points drastically.
I’m still figuring our the best way to join these together. At the moment im focused on ways to cluster and hull them, or alternatively join the nearest 3 points with tolerance just over the hypotenuse of point spacing into triangles for a rough mesh outcome.
I’ve written most of the code in grasshopper at work so cant share the raw work but maybe this gives some ideas.
To my understanding you can not create revit geometries (extrusion, sweep etc.) using revit API, at least not easily. Most likely method of working with the mesh would either be making a dwg/sat or a directshape/freeform in revit. I would honestly do this in Rhino over Revit as it has lots of utilities and geometry nodes available already vs having to do it all via revitapi.
Ive also been researching octree as a means to use flexible fidelity vs even decimation/spacing but its well beyond my abilities for now.
I know many platforms use ‘rolling sphere’ algorithms to do point clouds to mesh. Again beyond me. Meshmixer is a pretty good free tool that has one of these algorithms available.
We deal with point clouds sometimes but not as often as id like, so i have to shelf this often. Ive experimented with volvox, voxels and pufferfish and sastrugi for dynamo. No luck in those cases generally aside from some nice utility in volvox.
Thanks a lot, Gavin! I really appreciate the guidance and support!
Your suggestions helped me clarify the direction: I’ll go with a Rhino + Grasshopper workflow to preprocess the point cloud (rounding, clustering, meshing), then I’ll export to .sat or .obj for
-DirectShape import into Revit- via pyRevit or FreeCAD. I’ll skip Revit-native geometry generation for now and keep the mesh work outside Revit where possible.
I’ve also tried to get around by making first a polygonal mesh out the pointcloud in .obj file (something that Recap already has), deeplearning frameworks such as PyTorch and Tensorflow were also used, but then after that point I made a script to somehow convert it as a generic mass model, and it recognized the mass model in revit but in the project browser when I drag the mas model in the project 3D view space, nothing is shows except thousands of floating pin symbols, tried everything in the VG, show mass button, workspaces etc. I think those are still points and nothing new happened. Anyway, here is the .obj mesh “blob” examples that I managed to make out of the pointclouds:
Also, I’ve been actively following your - C# + Visual Studio courses - on YT, they’re super helpful, and I’ll definitely need solid C# skills soon for custom Revit API development since I can see some limitations with python and pyrevit. Keep up the great work!
I’ll keep posting updates here as I make progress with the in-place massing and share what works.
Thanks again!
Great to hear you’re following a similar path as Gavin, it really helps confirm the direction I’m heading with the workflow. I’ll definitely look into Cintoo’s mesh export tools, hadn’t explored that option yet, but it sounds like a smart way to skip the heavy lifting. Also appreciate the tip about Dr. Florent Poux, I’ll see what I can do next.
Histogram-based approach for detecting horizontal surfaces.
2D projections and image processing (morphological operations like dilation and erosion via OpenCV).
Douglas-Peucker algorithm for simplifying contours and line segments.
Wall detection through vector analysis of parallel line segments.
Exporting to json to use in pyRevit
pyRevit script to create walls, slabs, openings
Happy to share once finalised, im getting currently about 60ish% accuracy. The json part is the easiest and works quite well. However, im using open3d so converting from e57 to xyz, which then im using to export ifc or json
@Emin90 i have went through this rabbit hole for a while, i would suggest steering away from C# actually here. The Revit API is not great when it comes to pointclouds as you are only stuck with rcps. Python and Open3D specifically have a ton open-sourced projects that do very similar things. Two most notable projects are SpatialLM, using project Aria from Facebook which is an open source synthetic 24tb pointcloud library and Cloud-2-BIM which is an open source project that im building upon now as it gave me the best results. And as Jean recommended Florent Poux’s youtube is a goldfield for pointcloud operations.
I haven’t used morphological operations on 2D projections yet, but I’ll definitely try that with OpenCV. The ;wall detection via vector analysis’ and exporting to ‘JSON for pyRevit’ automation is a smart workflow, let me know when you finalize it haha.
Also, thanks for mentioning Cloud-2-BIM and SpatialLM, I’ve just started looking into those. I agree, Open3D with Python as I see gives far more flexibility than dealing with RCPs in the Revit API alone. I’m still learning C# for other parts of the Revit ecosystem, but for point cloud processing, Python/Open3D is definitely the way forward.
Looking forward to learning more from your work and yes, Dr. Florent Poux’s content is something beyond my expectations and I can definitely get some output for tackling my project.
Keep in touch and let’s share results as we refine our workflows!
@GavinCrump have you tried shrink wrap? I never touched Rhino so I have no experience whatsoever there, but it seems like a very good way to get a quick estimation of points.
I have played with it a fair bit. Whilst it is an amazing tool and has lots of practical use cases such as watertighting 3d printing shapes, it tends to operate best for hullable, smaller objects. It also tends to produce pretty heavy face counts unless you post-process or reduce the detail of the outcomes, so for me its not the best approach for meshing point clouds given their size and complexity as well as the fact that there is space inside the point clour that isnt solid.
If one could isolate points by shape then it might have some use cases.