Forum

Author Topic: Face count and vertex count  (Read 3935 times)

jpaton

  • Newbie
  • *
  • Posts: 12
    • View Profile
Face count and vertex count
« on: February 06, 2024, 02:58:10 PM »
How can i acces to the value of nº faces and nº vertex of my model using the python API?
I tried with     
   model = Metashape.Model.Statistics
    num_faces=model.faces

I am working with metashape_python_api_1_8_4
« Last Edit: February 06, 2024, 03:09:24 PM by jpaton »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15382
    • View Profile
Re: Face count and vertex count
« Reply #1 on: February 07, 2024, 03:51:57 PM »
Hello jpaton,

Should work with the following:
Code: [Select]
num_vertices = len(chunk.model.vertices)
num_faces = len(chunk.model.faces)

The example of using Statistics class:
Code: [Select]
stats = chunk.model.statistics()
num_faces = stats.faces
num_vertices = stats.vertices
Best regards,
Alexey Pasumansky,
Agisoft LLC

jpaton

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Face count and vertex count
« Reply #2 on: February 08, 2024, 11:38:10 AM »
it works!!!
Thanks  ;D ;D ;D