121
Python and Java API / How to use removecomponents
« on: December 30, 2015, 03:42:48 PM »
Hi guys,
I'm trying to integrate removeComponents into my workflow but I can't get in to work.
This is the code I'm using:
It seems to run when I use this code, but I don't get any result. I would expect this to remove components smaller than 40k polygons, but no matter what I set this threshold to nothing really gets removed. Anyone have any suggestions as to what I'm doing wrong here?
I'm trying to integrate removeComponents into my workflow but I can't get in to work.
This is the code I'm using:
Code: [Select]
def removethecrap(chunk):
doc = PhotoScan.app.document
chunk = doc.chunk
if chunk.model:
chunk.removeComponents(40000)
print("Crap removed.")
return 1
else:
print("No model. Script aborted.")
return 0
It seems to run when I use this code, but I don't get any result. I would expect this to remove components smaller than 40k polygons, but no matter what I set this threshold to nothing really gets removed. Anyone have any suggestions as to what I'm doing wrong here?