Community
Netfabb Forum
Welcome to Autodesk’s Netfabb Forums. Share your knowledge, ask questions, and explore popular Netfabb topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do I quickly find all empty meshes in the list of my objects?

5 REPLIES 5
Reply
Message 1 of 6
frennyluv
455 Views, 5 Replies

How do I quickly find all empty meshes in the list of my objects?

Hello and thank you for reading,

There are several occasions when I repair models they end up with empty meshes and I only know one way to figure them out by clicking every single object on and off and grouping them until there are no more empty meshes so I can finally save the .3MF file

This time my model exists out of almost 1000 parts... this is where I finally come to you for help.
Is there a way to have Netfabb detect these parts so I can delete them easier or in one go!

Thank you in advance.

5 REPLIES 5
Message 2 of 6
l.oliveiraGZS29
in reply to: frennyluv

Hi, are empty meshes, meshes with no triangles?

Message 3 of 6
l.oliveiraGZS29
in reply to: frennyluv

If empty meshes are meshes with 0 triangles (facecount = 0). I created this LUA script (not proud of its beauty but I guess it works) just make sure to drag all the meshes to a group before running the code:

 

 

 

system:setloggingtooglwindow(true);

local insertMeshesIntoTable;
insertMeshesIntoTable = function (meshgroup, Outtable)
  for mesh_index    = 0, meshgroup.meshcount - 1 do
      local traymesh      = meshgroup:getmesh(mesh_index);
      table.insert(Outtable, traymesh);
  end;
end;

if tray == nil then
    system:log('tray is nil!')
  else
    local root = tray.root;
   for group_index = 0, root.groupcount - 1 do
       subgroup = root:getsubgroup(group_index);
       local meshes = {};
       insertMeshesIntoTable(subgroup, meshes);
       for i, traymesh in pairs(meshes) do
        local luamesh   = traymesh.mesh; -- a LUAMesh
        if luamesh.facecount == 0 then
           subgroup:removemesh(traymesh);
        end;
    end;
   end;
end;

 

 

PS: Any tips for enhancing this code would be appreciated.



Message 4 of 6

Hi @frennyluv 

 

You can use the "Select by property" (former "Advanced part selection") feature to find specific parts, like with 0 triangles.

sebastianpichlmeier_0-1672643794248.png

Here you can select all parts with less than one triangle, which gives you only the empty ones:

sebastianpichlmeier_1-1672643899578.png

I hope that helps,

Kind regards,

Sebastian

 

Message 5 of 6
frennyluv
in reply to: l.oliveiraGZS29

Thank you very much for replying. I don't know exactly how the program describes them.

All I know is when I try to save a .3MF for my meshmixer or other programs it just won't do it until I deleted all those parts with the errors in them.
They're usually tiny parts, or invisble parts, things that seemingly cannot be translated into the new saved model.

 

But I don't know which ones so in a file with 50 parts I need to select a few names and try to save them. And each time I need to add a file, try to save them until I discover all the broken parts.
This takes me almost an hour to do. That's when I was wondering if there was an easier way.

Everything I do involved 3D resin printing so the models I work with need to be closed at least in their own geometry for each part. 
The parts cannot be fixed, even repaired they cannot be saved or sometimes the repair causes the model to have really weird shapes. Most of the time repair works, but not always.

(Where would I copy and paste the code in Netfabb?)

Kind regards

Message 6 of 6
l.oliveiraGZS29
in reply to: frennyluv

First you need to have the Ultimate version for running LUA scripts. Then you go to "Home" tab and click "Run Script" and then "New Script". The code should be pasted in the lower part of this window.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report