Notifications
Clear all

[Closed] how to know how many isolated vertexs have the object

i know thai i ask a lot, but i am search hard on the net and on this forum, well please help me with this questions please.

i use this to remove isolated vertexs, but i need to know how many vertexs the object have to send message to the user and ask if ok to remove or not

polyOp.deleteIsoVerts <Poly poly>

thanks

5 Replies
1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

ask for getvertsusingface for all faces. it returns all not isolated verts. all verts – not isolated = isolated

Hi, I’m guessing an answer, I actually haven’t tested it, but you can try:

for each vertex in mesh get number of edges (or faces) connected to it (see getEdgesUsingVert, or getFacesUsingVert), if the resulting BitArray is empty, then increment the count of isolated verts.

  • Enrico
fn GetNumIsoVerts epoly =(((#{1..(polyop.getnumverts epoly)}) - (polyop.getvertsusingface epoly #all)).numberset)
 
 GetNumIsoVerts $

Something like that, no error checking for non epolys or zero verts though…

I have another isue:

You can use getIsoVerts <mesh> method. It returns bitarray.
To get count of isolated do:

isoVertsCount = 0
 
 isoVertsBitA = meshop.getIsoVerts object.mesh
 for v in isoVertsBitA do 
 	if v then (isoVertsCount += 1)

I was know this function is existing, but I couldn’t rememer it’s name

In which case:

(meshop.getisoverts $.mesh).numberset