Agisoft Metashape

Agisoft Metashape => Python and Java API => Topic started by: geo_enth3 on May 17, 2022, 11:41:59 AM

Title: Mesh: Select faces by "Polygon size"
Post by: geo_enth3 on May 17, 2022, 11:41:59 AM
Dear all,

I was wondering if it is possible to perform something like the Gradual Selection -> polygon size also with the Python API (please find the corresponding GUI screenshot attached). I would like to remove very large faces from my model as they are usually erroneous. I didn't find any function in the API docs that would allow me to do this but maybe somebody has some code already to perform a similar operation.

Thanks in advance,

geo_enth
Title: Re: Mesh: Select faces by "Polygon size"
Post by: Alexey Pasumansky on May 23, 2022, 04:57:55 PM
Hello geo_enth,

Currently there's no instrument for fast polygon selection using Python API based on the polygon size.

So the workaround would be only custom function creation that estimates the size of the mesh faces (as the triangle area based on the vertex coordinates) in the model, calculates the min/max values and then selects and removes the faces based on the input threshold. However, this approach would likely work slow for high-poly models.
Title: Re: Mesh: Select faces by "Polygon size"
Post by: geo_enth3 on May 25, 2022, 01:40:03 PM
Thanks Alexey,

I tried exactly this but it is indeed taking much too long...
not a big deal, I solved it for me by adapting the bounding box before generating the mesh.

Cheers!
Title: Re: Mesh: Select faces by "Polygon size"
Post by: Jay on January 12, 2023, 11:43:28 AM
Hello geo_enth,

Currently there's no instrument for fast polygon selection using Python API based on the polygon size.

So the workaround would be only custom function creation that estimates the size of the mesh faces (as the triangle area based on the vertex coordinates) in the model, calculates the min/max values and then selects and removes the faces based on the input threshold. However, this approach would likely work slow for high-poly models.

So is there any instrument for Connected component size selection via Python API?