[request] Polygon count plugin

[request] Polygon count plugin

Postby ken28875 » Fri Sep 17, 2010 6:38 pm

Hi there Masters of Plugins,

Does anyone know if there is a plugin that shows me the polygon count (quad and triangle faces) when clicking on the model? If not, could someone please write it for me?

Thank you very much,

_KN
0
Follow Your Dreams.
User avatar
ken28875 
 

Re: [request] Polygon count plugin

Postby TIG » Fri Sep 17, 2010 6:58 pm

I'm sure there is one somewhere...
If not it's relatively easy to iterate all of the model.definitions.entities faces [*definition.instances.length] and all of the model's faces - using each face.vertices.length-vertices-2...
:geek:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [request] Polygon count plugin

Postby Rich O Brien » Fri Sep 17, 2010 7:01 pm

Doesn't MeshLab provide this info? If you've the ability to export to it's supported file types?

Where Pilou when you need him? :fro:
0
There's a frontroom and a backroom....reverse faces
User avatar
Rich O Brien 
Administrator
 

Re: [request] Polygon count plugin

Postby jeff hammond » Fri Sep 17, 2010 7:04 pm

TIG wrote:I'm sure there is one somewhere...
If not it's relatively easy to iterate all of the model.definitions.entities faces [*definition.instances.length] and all of the model's faces - using each face.vertices.length-vertices-2...
:geek:


haha.. i love when the coders talk to the plebs.. 'ah, it's simple' etc.. that sentence above might as well look like this to me:


If not it's relatively easy to 遍歷所有的模型定義實體所面臨的定義實例的長度和所有模型的臉 - 用每個面頂點長度頂點 -2

:lol: :lol:
0
dotdotdot
User avatar
jeff hammond 
Global Moderator
 

Re: [request] Polygon count plugin

Postby ken28875 » Fri Sep 17, 2010 7:16 pm

Hello guys,

@ TIG: What the hell are you talking about??? :?: LOL

@ Rich: I want to see the polygon count right in Sketchup so I don't have to export back and forth between 2 programs.

@ Jeff: I agree with you. LOL :D

Thanks,

_KN
0
Follow Your Dreams.
User avatar
ken28875 
 

Re: [request] Polygon count plugin

Postby Chris Fullmer » Fri Sep 17, 2010 7:19 pm

Currently you can get a full face and edge count. But you want a little more than that, is that what your asking? You would like too see specifically tri faces and quad faces only? What about faces that are mor than quad faces?
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [request] Polygon count plugin

Postby ken28875 » Fri Sep 17, 2010 7:46 pm

Chris Fullmer wrote:Currently you can get a full face and edge count. But you want a little more than that, is that what your asking? You would like too see specifically tri faces and quad faces only? What about faces that are mor than quad faces?


Hi Chris,

Yes, something similar to this in Maya:



You said we currently are able to see a full face and edge count. How do you do it?

Thank you,

_KN
0
Follow Your Dreams.
User avatar
ken28875 
 

Re: [request] Polygon count plugin

Postby TIG » Fri Sep 17, 2010 7:53 pm

### Copy+paste this into a file called facecount.rb in the Plugins folder
Code: Select all
def facecount()
  num=0
  model=Sketchup.active_model
  ss=model.selection
  if ss[0]
    ents=ss.to_a
  else
    ents=model.entities.to_a
  end#if
  defs=model.definitions
  ents.each{|e|num=num+(1)if e.class==Sketchup::Face}
  defs.each{|d|
    d.entities.each{|e|
      n=d.instances.length
      num=num+(1*n)if e.class==Sketchup::Face
    }
  }
  if ss[0]
    puts "Faces in Selection ="
  else
    puts "Faces in Model+Definitions ="
  end#if
  return num
end#def
### To run type facecount in the Ruby Console - it prints the count of faces.
### Copy+paste this into a file called tricount.rb in the Plugins folder
Code: Select all
def tricount()
  num=0
  model=Sketchup.active_model
  ss=model.selection
  if ss[0]
    ents=ss.to_a
  else
    ents=model.entities.to_a
  end#if
  defs=model.definitions
  ents.each{|e|num=num+(e.vertices.length-2)if e.class==Sketchup::Face}
  defs.each{|d|
    d.entities.each{|e|
      n=d.instances.length
      num=num+((e.vertices.length-2)*n)if e.class==Sketchup::Face
    }
  }
  if ss[0]
    puts "Potential Triangular-Faces in Selection ="
  else
    puts "Potential Triangular-Faces in Model+Definitions ="
  end#if
  return num
end#def
### To run type tricount in the Ruby Console -
### it prints the count of potential triangulated-faces [even if they currently have more vertices].
### These count all faces in the model and in instances, groups and images...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [request] Polygon count plugin

Postby Chris Fullmer » Fri Sep 17, 2010 9:56 pm

You can open the Model Info dialog box and it shows edge and face count. Go to Window > Model Info and click on the "statistics" tab. Then make sure you have the statistics set to "Entire Model" and turn on the "Show Nested Components" checkbox. Then it will show you a good bit of info.

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [request] Polygon count plugin

Postby ken28875 » Fri Sep 17, 2010 10:07 pm

Thanks TIG and Chris.

Have a good weekend.

_KN
0
Follow Your Dreams.
User avatar
ken28875 
 

Re: [request] Polygon count plugin

Postby thomthom » Sat Sep 18, 2010 12:44 pm

The Plugin Index is your friend: viewtopic.php?f=323&t=28782

Counttriangles.rb by Eleandor
viewtopic.php?t=16843
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [request] Polygon count plugin

Postby TIG » Sat Sep 18, 2010 10:38 pm

thomthom wrote:The Plugin Index is your friend: viewtopic.php?f=323&t=28782
Counttriangles.rb by Eleandor
viewtopic.php?t=16843

Knew I'd see it somewhere! :roll:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [request] Polygon count plugin

Postby Aris » Thu Oct 18, 2018 8:29 pm

Hi all,
on a similar topic, it would be great to be able to select a group or component and be able to see statistics just for this specific object.
I am working with heavy scenes and cooperating with other people, and sometimes I have to deal with garbage models within the scene
(it is not uncommon to have a flower pot in some obscure corner that takes up half of the scene's file size)
0
Not a native speaker, point out my spelling (or other) mistakes, I won't be offended!!!
User avatar
Aris 
Premium Member
Premium Member
 

Re: [request] Polygon count plugin

Postby srx » Fri Oct 19, 2018 6:52 am

Even more, it would be nice to have a plugin which helps in optimizing SU model by marking groups and components with colors according to their polygon count. :mrgreen:
...
and than gives an option to reduce them :) (useful for making proxies also) :mrgreen:
1
www.saurus.rs
User avatar
srx 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Plugins

Who is online

Users browsing this forum: che, fk0002, Google Bot and 21 guests

Visit our sponsors: