Author Topic: Decimate mesh by a factor using script?  (Read 1737 times)


  • Newbie
  • *
  • Posts: 4
    • View Profile
Decimate mesh by a factor using script?
« on: July 06, 2016, 01:13:29 AM »
Hello all!

I've been checking out photoscan and i'm trying to make a big model of a park with some statues and well, my 16gb memory isnt cutting it for high quality model. So i explored my options and scripting with chunk splitting is what can help me.

Now, i'm at a place where even after splitting some parts of the statue are coming out too big to to decimate later and so I went into even smaller chunks and splitting things in height too - this is a way to get what i want but there will be just so many little chunks - i need to decimate them before putting them back together again.

I can do this in script using new_chunk.decimateModel(face_count = x)
BUT, this option only allows me to use fixed face count and thats just bad. Some chunks will have irrelevent amount of faces compared to the highest ones and I want to decimate by a factor, like divide with 5 or 10 etc.

For that I need to know what is the scripting call/syntax i could use to call for current chunks model's facecount to use a ( variable / 5 ) as desired face_count.

Can somebody please tell me how to call it?

Did not find this info from api pdf -

« Last Edit: July 06, 2016, 01:15:04 AM by Gelisob »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14927
    • View Profile
Re: Decimate mesh by a factor using script?
« Reply #1 on: July 06, 2016, 07:06:53 AM »
Hello Gelisob,

You can find the number of polygons in the active model using
Code: [Select]
len(chunk.model.faces)So the target value would be just a product of actual number for chunk and downscale factor.
Best regards,
Alexey Pasumansky,
Agisoft LLC