Register Family with point cloud to create existing model for Linear str.(bridge and tunnel)

Hi All,
I would like to share how to create the existing model of bridge based on point cloud insted Alignment and profile.
challenget :pensive: :pensive:
-The challenge here we need to predict the CL of the bridge to create existing model that we do not have the data from transportation. what we have the laser scane (point cloud).
Input

  1. point cloud for the Bridge
  2. Bridge cross section

Workflow

  1. load the point cloud into the project as *.rcp

  2. create a adaptive family (single point) have the bottom face of the cross section.

  3. create fourm strip (0,5 m) and create a point cover the strip area.

  4. insert the family at the project in location near to your bridge.

4)use dynamo to read the family geomenty (point at the bottom surfce) and convert it to point cloud object

"""
this code write by Ramiz Mohareb
enramiz@yahoo.com
11-10-2022
Important! This code will only work with Dynamo versions
that are able to run cPython3 and have the following additional 
python packages installed.
"""

import sys
import clr
import System
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
sys.path.append(r'C:\Users\sneep\AppData\Local\python-3.8.3-embed-amd64\Lib\site-packages')
import System
clr.AddReference('System.Drawing')
import System.Drawing

from System.Drawing import *
from System.Drawing.Imaging import *
import matplotlib.image
import PIL
import numpy as np
from scipy import misc
from matplotlib import cm
from matplotlib import colors as mcolors
import matplotlib.pyplot
from PIL import Image
from numpy import asarray
#face = matplotlib.pyplot.imread(r'C:\Users\mohareb\Desktop\a.png')
#face = misc.face() #ndarray 3 dimmensions
#face=misc.imread(face1)
#face = scipy.misc.imread(IN[0])
import os
import glob
import trimesh
import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from matplotlib import pyplot as plt
import io
from System.IO import MemoryStream
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.PointClouds import *

import numpy as np
import open3d as o3d
import copy


# Die Eingaben fΓΌr diesen Block werden in Form einer Liste in den IN-DATA_DIR = os.path.join(os.path.dirname(IN[0]), "ModelNet10")


points = IN[0]

X=IN[1]
Y=IN[2]
Z=IN[3]


#pcd.points = o3d.utility.Vector3dVector(points[:,:3])

pcd = o3d.geometry.PointCloud()
np_points = np.random.rand(100, 3)

# From numpy to Open3D
pcd.points = o3d.utility.Vector3dVector(np.asarray(points)[:,:3] )


# From numpy to Open3D
#pcd.points = o3d.utility.Vector3dVector([0,2,3])
# Code unterhalb dieser Linie platzieren
pcd1 = copy.deepcopy(pcd).translate((X, Y, Z))# Weisen Sie 
#pcd1 = copy.deepcopy(pcd).translate((0, 0, 0))# Weisen Sie Ihre Ausgabe der OUT-Variablen zu.


OUT = pcd1 ;
  1. use ICP registration to get the trasformation between the camily and point cloud
    Pointcloud ICP registration






  2. the output from ICP registration is three transation and three rotation

  3. use this output to relocate the adaptive family to the new postion

8)repeat the apove step to get all the bottom surface of the bridge

  1. use the location of the adaptive familys to create bottom polyline

10)Now you have the bottom CL use it to create your model :ok_hand: :ok_hand: :ok_hand: :ok_hand: :ok_hand: :partying_face: :partying_face: :partying_face:

5 Likes

Fantastic As Usual :slight_smile:

1 Like

Another example for tunnel

3 Likes