Forum

Author Topic: Exporting  (Read 6211 times)

Xila

  • Newbie
  • *
  • Posts: 1
    • View Profile
Exporting
« on: July 10, 2016, 06:28:15 PM »
Is there some way to export a DXF with all the markers included?

stihl

  • Sr. Member
  • ****
  • Posts: 410
    • View Profile
Re: Exporting
« Reply #1 on: July 10, 2016, 09:35:00 PM »
The markers are just a visual representation in Photoscan, not an object on in the point cloud or mesh.

What you could do is export the point cloud DEM as a DXF and then export the marker positions and both import them in a CAD application and then change the appearance of the marker (GCP) to a flag or something.

Merzel

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Exporting
« Reply #2 on: October 17, 2016, 11:24:00 AM »
Hey stihl, thanks for the answer. Which CAD application do you use for this? I can t import xml marker filesin autucad for example. Thanks

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14943
    • View Profile
Re: Exporting
« Reply #3 on: October 17, 2016, 11:42:36 AM »
Hi,

I've moved the thread to the feature requests forum, since at the moment it is not possible to export markers in DXF format.

As a workaround I think that it is possible to create the point shapes in the estimated marker positions and export them to DXF, for example.

Code: [Select]
import PhotoScan

chunk = PhotoScan.app.document.chunk

if not chunk.shapes:
chunk.shapes = PhotoScan.Shapes()
chunk.shapes.crs = chunk.crs

for marker in chunk.markers:
chunk.shapes.addShape()
  shape = chunk.shapes[-1]
  shape.type = PhotoScan.Shape.Type.Point
  shape.has_z = True
  shape.vertices = [chunk.crs.project(chunk.transform.matrix.mulp(marker.position))]

PhotoScan.app.update()
Best regards,
Alexey Pasumansky,
Agisoft LLC

Merzel

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Exporting
« Reply #4 on: October 18, 2016, 08:11:02 PM »
Thanks a lot Alexey for the response. My other scripts run already with my photoscan pro version but with this one I just get "can't run script" .. do I have to customize it before use?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14943
    • View Profile
Re: Exporting
« Reply #5 on: October 18, 2016, 08:13:44 PM »
Hello Merzel,

Which version of PhotoScan Pro you are using and what's the output in the Console pane?
Best regards,
Alexey Pasumansky,
Agisoft LLC

Merzel

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Exporting
« Reply #6 on: October 18, 2016, 08:30:27 PM »
I m using version 1.2.6 (64bit) and in the console pane I get the following:

2016-10-18 19:25:19     Traceback (most recent call last):
2016-10-18 19:25:19     File "C:/Users/../Downloads/markertopoints.py", line 14, in <module>
2016-10-18 19:25:19     shape.vertices = [chunk.crs.project(chunk.transform.matrix.mulp(marker.position))]
2016-10-18 19:25:19    TypeError: must be PhotoScan.Vector, not None

I don't really understand the error.
thanks for your help Alexey

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14943
    • View Profile
Re: Exporting
« Reply #7 on: October 18, 2016, 08:37:50 PM »
Ok, it seems that some markers are not defined in space (have less than two projections), then adding a check:

Code: [Select]
import PhotoScan

chunk = PhotoScan.app.document.chunk

if not chunk.shapes:
chunk.shapes = PhotoScan.Shapes()
chunk.shapes.crs = chunk.crs

for marker in chunk.markers:
if not marker.position:
print("skipping marker " + marker.label)
continue
chunk.shapes.addShape()
  shape = chunk.shapes[-1]
  shape.type = PhotoScan.Shape.Type.Point
  shape.has_z = True
  shape.vertices = [chunk.crs.project(chunk.transform.matrix.mulp(marker.position))]

PhotoScan.app.update()
Best regards,
Alexey Pasumansky,
Agisoft LLC

Merzel

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Exporting
« Reply #8 on: October 18, 2016, 08:48:17 PM »
wow Alexey this is incredible!!! I send you the biggest greetz from Berlin, this is absolutly awesome