Forum

Author Topic: Bug? chunk.exportModel & vertex colors  (Read 6972 times)

Toll

  • Newbie
  • *
  • Posts: 19
    • View Profile
Bug? chunk.exportModel & vertex colors
« on: February 25, 2016, 12:35:01 AM »
Hello

i have some code that exports the 3dmodel as an OBJ format.

when exporting the model through the GUI, with no colors or vertex normals selected, i get an OBJ model that is (for eg) 160mb in size, and exports quite quick.

with the below snippet, the software continues to calculate vertex colors, even though it appears i have set it to false.
the exported model is 320mb and takes a few minutes longer.

is there something wrong with the code, or is this a python bug?

chunk.exportModel(path, precision=6, format='obj', projection = proj, texture=False, colors=False)

thanks
Luke

2nd q: is it possible to export the 3dmodel clipped to the shapes?
« Last Edit: February 25, 2016, 12:46:25 AM by Coalisgood »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15429
    • View Profile
Re: Bug? chunk.exportModel & vertex colors
« Reply #1 on: February 25, 2016, 09:02:50 AM »
Hello Luke,

During export model operation PhotoScan doesn't perform vertex colors calculation, as it is done during Build Mesh stage. Moreover, OBJ format doesn't support colors.
So probably the normals are saved (three numbers in 0 - 1 interval) when you are using Python code, since there's no "normals" argument.

Model export saves the whole model present in the active chunk, so if you need only a part, you should either generate the mesh in the smaller bounding box, or crop the model prior to the export, however, in the second case the edges will not be straight.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Toll

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Bug? chunk.exportModel & vertex colors
« Reply #2 on: March 18, 2016, 01:35:15 AM »
hi alex,
where do i find the 'generate mesh with a bounding box' option? i cant see an option in the GUI or in the API?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15429
    • View Profile
Re: Bug? chunk.exportModel & vertex colors
« Reply #3 on: March 18, 2016, 01:43:50 AM »
Hello Coalisgood,

Mesh is always generated only inside the bounding box. It can be adjusted using Resize Region and Rotate Region instruments located on the Toolbar.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Toll

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Bug? chunk.exportModel & vertex colors
« Reply #4 on: March 26, 2016, 03:33:54 AM »
thanks alex,

is it possible to implement an option to set the bounding box region by the imported shapes? would be great to only generate the mesh inside the shapes (for ortho surveys)

thanks