Forum

Author Topic: 2D Line Drawing from Photoscan Model  (Read 24770 times)

hfb2p

  • Newbie
  • *
  • Posts: 2
    • View Profile
2D Line Drawing from Photoscan Model
« on: September 22, 2013, 05:39:36 PM »
Is there a relatively simple way to create 2D line drawings (e.g. an architectural elevation/fa?ade drawing) from a Photoscan model? I've seen the products of doing so, but not much on the workflow to reach that end. 

I'm guessing that it is done through exporting a point cloud or mesh into AutoCAD, and then a few more steps (flattening? tracing?) beyond here?

I'm somewhat new to this, so this might be a pretty 101 question.  I have access to AutoCAD 2013, Photoshop, and Illustrator.  I would be interested to hear from anyone with experience with this, as it seems to be a somewhat standard deliverable for commercial photogrammetry. 


chrisd

  • Full Member
  • ***
  • Posts: 187
    • View Profile
Re: 2D Line Drawing from Photoscan Model
« Reply #1 on: September 22, 2013, 09:40:43 PM »
Is your model an object or a landform?

hfb2p

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: 2D Line Drawing from Photoscan Model
« Reply #2 on: September 22, 2013, 10:29:50 PM »
All of my models are objects, and primarily architecture.

chrisd

  • Full Member
  • ***
  • Posts: 187
    • View Profile
Re: 2D Line Drawing from Photoscan Model
« Reply #3 on: September 23, 2013, 12:27:18 AM »
I see you have AutoCAD, otherwise I would suggest Sketchup. You will need to decimate your model first. I don't have experience with this in Photoscan, but it may work fine for the decimation.  There are several apps that can do this including Atangeo Balancer, Mootools Polygon Cruncher & Meshlab.

Finding the balance between the level of detail you want and the responsiveness of working with the file is the key.


aldanstar

  • Full Member
  • ***
  • Posts: 137
    • View Profile
    • Александр Старовойтов
Re: 2D Line Drawing from Photoscan Model
« Reply #4 on: September 23, 2013, 01:13:24 PM »
Also, you can use ArcGIS Scene for task. ArcGIS supports drawing on multipatch from Ver. 10.1.
С уважением,
Александр Старовойтов
Казанский (Приволжский) Федеральный Университет

James

  • Hero Member
  • *****
  • Posts: 748
    • View Profile
Re: 2D Line Drawing from Photoscan Model
« Reply #5 on: September 23, 2013, 02:23:33 PM »
As you have acad 2013 you can export the dense cloud from photoscan and convert to pcg to open as point cloud inside autocad and use as a reference to draw your line work. i don't think autocad would enjoy big triangulated meshes but haven't tried that for a while. a couple of years ago it really wasn't happy and the result was pretty ugly too.

i have brought photoscan point clouds into revit 2013 but not tried in autocad. my basic process is to export the point cloud as .ply which can easily be converted to .pts in a text editor (i.e. textpad). the pcg converter (built into acad) works with other formats besides .pts so you may not need to perform this step, i convert to pts because i also take it into other software that uses it.

then the process is pretty much glorified tracing!

edit: just tried it in acad 2011 - see image attached. i inserted a pcg file i created earlier in revit 2013 from a pts file from a ply file from photoscan, and it seems pretty useful. revit 2013 shows the point colours so perhaps acad 2013 does too, although 2011 doesnt seem to.
« Last Edit: September 23, 2013, 02:30:37 PM by James »

yusaku

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: 2D Line Drawing from Photoscan Model
« Reply #6 on: October 09, 2013, 12:24:40 PM »
Hello,
i have a similar issue here. However, i am ignorant about the proccedure (and the programs) that James mentions. How can i convert the ply file to pts? After that I open it with Revit and then convert to pcg file?

thank you

JMR

  • Hero Member
  • *****
  • Posts: 502
    • View Profile
Re: 2D Line Drawing from Photoscan Model
« Reply #7 on: October 09, 2013, 01:37:17 PM »
The most obvious answer to yusakus question (2D drawings) is to export orthophoto of the desired views and just draw on the orthos as raster reference with any CAD, isn't it?

Regards

yusaku

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: 2D Line Drawing from Photoscan Model
« Reply #8 on: October 09, 2013, 02:16:28 PM »
Thank you for the reply JMR. Although this is probably the most easy solution, i would like to explore the abilities of photoscan, so i am really interested in the method that James proposed.

James

  • Hero Member
  • *****
  • Posts: 748
    • View Profile
Re: 2D Line Drawing from Photoscan Model
« Reply #9 on: October 09, 2013, 02:21:13 PM »
Converting PLY to PCG is fairly simple if you have a good text editor like Textpad (http://www.textpad.com/).

Export your points from PhotoScan as PLY using these settings (also attached below):
Code: [Select]
Shift: 0, 0, 0
Type: Dense (or Sparse if it's good enough)
Point colors: Yes
Point normals: No (I don't think PTS supports that)
Binary encoding: No
Precision: Either leave at 6 or reduce to 3 to save some file size if you are working in meter units and millimeters are precise enough.

Once you have exported the PLY file open it in Textpad, and it will look something like this:

Code: [Select]
ply
format ascii 1.0
element vertex 40497
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
end_header
-4.926942 4.215927 7.520528 85 38 0
-4.834573 4.392451 8.721108 140 85 27
-5.201404 4.767813 2.587182 16 15 12
-5.061094 4.770470 4.808211 26 16 14
-5.034769 4.764192 5.011490 23 19 16
-5.037882 4.766567 5.009295 30 24 21
-4.914380 4.302697 7.428827 73 40 0
etc

make a note of the element vertex number (this is the number of points exported) and then delete the entire header, replacing it with that number, to look like this:

Code: [Select]
40497
-4.926942 4.215927 7.520528 85 38 0
-4.834573 4.392451 8.721108 140 85 27
-5.201404 4.767813 2.587182 16 15 12
-5.061094 4.770470 4.808211 26 16 14
-5.034769 4.764192 5.011490 23 19 16
-5.037882 4.766567 5.009295 30 24 21
-4.914380 4.302697 7.428827 73 40 0
etc

All that is left to do is add a column required by the PTS format, unfortunately it needs to be the 4th column, so we have to insert it after column 3 using a regular expression search and replace. This column represents the intensity value (this is recorded by a lidar scanner and expected to be in a pts file but we can make up a value).

In textpad press 'F8' to open the search and replace dialog, and enter the following expressions (also attached below) make sure you have 'Regular expression' enabled:

Find what:
Code: [Select]
\(^[^ ]+ [^ ]+ [^ ]+\)Replace with:
Code: [Select]
& 100
This will select the first three columns separated by spaces, and replace them by the same text with a 100 appended as the 4th column. Then click <Replace All>.

Just to check you have done it right, it should now look like this:

Code: [Select]
40497
-4.926942 4.215927 7.520528 100 85 38 0
-4.834573 4.392451 8.721108 100 140 85 27
-5.201404 4.767813 2.587182 100 16 15 12
-5.061094 4.770470 4.808211 100 26 16 14
-5.034769 4.764192 5.011490 100 23 19 16
-5.037882 4.766567 5.009295 100 30 24 21
-4.914380 4.302697 7.428827 100 73 40 0
etc

Save this as a .PTS file and Revit/Autocad should be able to index it as a PCG.

James

  • Hero Member
  • *****
  • Posts: 748
    • View Profile
Re: 2D Line Drawing from Photoscan Model
« Reply #10 on: October 09, 2013, 02:24:28 PM »
And in case it isn't clear, the columns of the PTS file are:

X Y Z Intensity R G B

yusaku

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: 2D Line Drawing from Photoscan Model
« Reply #11 on: October 09, 2013, 05:19:45 PM »
Thank you very much James!
I ll try it out!

k

JWH

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: 2D Line Drawing from Photoscan Model
« Reply #12 on: October 13, 2015, 01:48:10 AM »
Whenever I insert:

\(^[^ ]+ [^ ]+ [^ ]+\)

into replace and find a error appears saying that something does not match up in the equation.

Also my point cloud has 2.6 million points.... is this too big for Revit in the first place. I notice where you can decimate the mesh but not the dense cloud in PhotoScan

James

  • Hero Member
  • *****
  • Posts: 748
    • View Profile
Re: 2D Line Drawing from Photoscan Model
« Reply #13 on: October 13, 2015, 09:44:40 AM »
I don't know why that wouldn't work, but there is an easier way anyway. Use free recap to import most point cloud formats and then either use the resulting rcp files directly in revit, or export pcg or pts files as needed.

http://www.autodesk.com/products/recap/download

I think at least revit 2013 (and later) should have no problem with many millions of points.

ThomasVD

  • Full Member
  • ***
  • Posts: 107
    • View Profile
Re: 2D Line Drawing from Photoscan Model
« Reply #14 on: October 13, 2015, 02:28:49 PM »
So far I've just exported orthophotos and then traced them in vector drawing software such as Illustrator. However any manual tracing is quite time-consuming so I'm wondering whether there aren't automated procedures to trace features in 3D CAD software.