Invalid Solids to Point Cloud

For the past 2 weeks, I've been fighting with set of asbuilt solids that come from various sources that won't validate in ANYTHING.  

These asbuilts come in various flavors but seem to fall into a couple of categories:

  • Noisy CMS scans that have bad blind spots or laser returns so they end up looking like pin cushions or hedgehogs.
  • Multiple CMS scans that have been merged together, improperly, so you can end up with triangles inside of triangles inside of triangles.
    • Often the CMS scans are also intersected by other asbuilts so they have tunnel voids running through the middle of the solids
  • Mulitple square-ish profile solids that overlap (think cut and fill excavations that overlap vertical and ribs that cross multiple other shapes

I've been manually cleaning, removing triangles, trying the conditioning scripts etc but ... it's been a long slow slog.  Which got me thinking ... there's got to be a better way.  I had always wished for some sort of shrink wrap algorithm that just worked from the outside-in to find the first triangle, stope and then give an outer hull.  I have not been able to find anything that does that in any software but @AC's "automatic_solid_conditioning_9.tcl" script came close. 

That got me thinking about a different method that could utilize the point cloud functionality. I'll discard my machine-gun / entrance & exit wound analogy and do it like "needling" ... what if you stuck a needle through a balloon and recorded the location of the first and last contact points with the balloon.  If you do that multiple times in multiple directions with a high enough density, you should get a point cloud that could accurately represent the original shape.  It would remove all of the nasty inner triangles and could be refined with Ash's script if needed.

The first image is the original solid (I went simple for the demonstration).  The second image is the point cloud generated by the script overlaid on the original solid.  The colors represent the 3 directions (XZ, XY and YZ planes) that I used to pierce the solid.  The third image is the resulting solid from the point cloud (brown) compared against the original solid.  It runs relatively quickly though it could be improved.  I've run it on multiple problem solids and it seems to do a good job. I've attached the script and a test solid from the images.  



​​​​​​​

https://discuss.geoviasupport.com/index.php?/topic/5004-invalid-solids-to-point-cloud/