Separating a multi-parts mesh ?
27258 12 2- Grendizer
- Member
- 375 posts
- Joined: May 2014
- Offline
hello,
I'm working on a STL import that was exported from Solidworks, and was in several parts. In Houdini the STL is all merged into one object.
I don't want to select all these faces one by one.
What's the official way to separate a mesh into parts in Houdini?
I have tried the Polydoctor node. What's cool is that it automatically shows the different parts that the object is made of: see attached pic.
Is Polydoctor the way to go?
With Polydoctor, I tried to extract the attribute “manifoldnumber” inside a “for each” but I don't know what to do next.
Thanks for the help…
I'm working on a STL import that was exported from Solidworks, and was in several parts. In Houdini the STL is all merged into one object.
I don't want to select all these faces one by one.
What's the official way to separate a mesh into parts in Houdini?
I have tried the Polydoctor node. What's cool is that it automatically shows the different parts that the object is made of: see attached pic.
Is Polydoctor the way to go?
With Polydoctor, I tried to extract the attribute “manifoldnumber” inside a “for each” but I don't know what to do next.
Thanks for the help…
Houdini gamboler
- Enivob
- Member
- 2630 posts
- Joined: June 2008
- Offline
- Grendizer
- Member
- 375 posts
- Joined: May 2014
- Offline
Hello Enivob
First thanks for taking the time to help and to post a file. I tried your scene and here's what I can say:
The VEX code in the attribute wrangle would force us to select each colors by typing their values. The problem is: there are 46 parts in this imported mesh, so the code would be too long to type.
There should be an automatic way to select parts, and here's why the polydoctor's manifoldnumber attribute could be used. The manifold attribute goes from 0 to 45.
I think we should do something like this:
For each manifoldnumber, create a new mesh.
But is it possible to generate 46 new meshes from a single node? Which node would it be?
And again : Is Polydoctor the best way to go for separating merged meshes in Houdini?
Thanks
Gz
First thanks for taking the time to help and to post a file. I tried your scene and here's what I can say:
The VEX code in the attribute wrangle would force us to select each colors by typing their values. The problem is: there are 46 parts in this imported mesh, so the code would be too long to type.
There should be an automatic way to select parts, and here's why the polydoctor's manifoldnumber attribute could be used. The manifold attribute goes from 0 to 45.
I think we should do something like this:
For each manifoldnumber, create a new mesh.
But is it possible to generate 46 new meshes from a single node? Which node would it be?
And again : Is Polydoctor the best way to go for separating merged meshes in Houdini?
Thanks
Gz
Houdini gamboler
- Konstantin Magnus
- Member
- 686 posts
- Joined: Sept. 2013
- Online
The partition SOP creates groups for example based on colours.
http://www.sidefx.com/docs/houdini/nodes/sop/partition.html [www.sidefx.com]
http://www.sidefx.com/docs/houdini/nodes/sop/partition.html [www.sidefx.com]
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
- Grendizer
- Member
- 375 posts
- Joined: May 2014
- Offline
- Doudini
- Member
- 333 posts
- Joined: Oct. 2012
- Offline
- jsmack
- Member
- 8045 posts
- Joined: Sept. 2011
- Offline
No, what you want is the connectivity node, which creates an attribute to index each island. The partition can then create groups based on the connectivity attribute. Typically groups are not required to consider the mesh as ‘separate’ once you have some kind of identifier for each part. If you want them packed into individual packed fragments/geometries, the assemble sop can be used name/pack by connectivity.
- Grendizer
- Member
- 375 posts
- Joined: May 2014
- Offline
Hello all, and first thanks for your help.
I've been testing again , following your precious advices. I managed to get it working, by keeping the Polydoctor node involved.
So here are the 3 things I tried :
1: From the polydoctor node I output the manifoldnumber attribute. Then in partition I add this rule : manifoldnumber_$manifoldnumber . Then in the assemble node I create groups based on manifoldnumber_. So with the delete node I can see my groups.
2: Putting a partition node just at the output of the STL , with the rule color_`rint(@Cd.r*255)`_`rint(@Cd.g*255)`_`rint(@Cd.b*255)` , does not work: it just creates a group called “color_255_255_255”
3: I also tried a connectivity node. I created a “island” attribute, but this attribute is not recognized in a visualizer node, I can't get it to show different colors for the different parts.
If you have some patience You can check the attached pic that sums it all up!
I've been testing again , following your precious advices. I managed to get it working, by keeping the Polydoctor node involved.
So here are the 3 things I tried :
1: From the polydoctor node I output the manifoldnumber attribute. Then in partition I add this rule : manifoldnumber_$manifoldnumber . Then in the assemble node I create groups based on manifoldnumber_. So with the delete node I can see my groups.
2: Putting a partition node just at the output of the STL , with the rule color_`rint(@Cd.r*255)`_`rint(@Cd.g*255)`_`rint(@Cd.b*255)` , does not work: it just creates a group called “color_255_255_255”
3: I also tried a connectivity node. I created a “island” attribute, but this attribute is not recognized in a visualizer node, I can't get it to show different colors for the different parts.
If you have some patience You can check the attached pic that sums it all up!
Houdini gamboler
- tamte
- Member
- 8839 posts
- Joined: July 2007
- Offline
manifold number and connectivity class attribute serve the same purpose, you can use either, even though they may produce different order
you can easily extract polys by attribute value and avoid partition and creating groups, just by using Blast SOP and @<attribname>=<value> in the group field, like
you can even make it depend on the digits in the node's name using expression like
you can easily extract polys by attribute value and avoid partition and creating groups, just by using Blast SOP and @<attribname>=<value> in the group field, like
@manifoldnumber=0
you can even make it depend on the digits in the node's name using expression like
@manifoldnumber=`opdigits(".")`
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- BabaJ
- Member
- 2129 posts
- Joined: Sept. 2015
- Offline
- Grendizer
- Member
- 375 posts
- Joined: May 2014
- Offline
Hi!
Tamte thanks a lot for your explanation and for taking the time to post a scene file!! This forum is very helpfull.
I think I have now the best way to separate multi-parts meshes!
Re-reading the thread , I have some more questions:
- I understand what “packing” does but i'm not yet use to when using it, in which case should I pack parts of my networks?
- About the “@” prefix for attribute. It is not used when the attribute is created, it is used when the attribute is called. Correct?
Bye,
Gz
Tamte thanks a lot for your explanation and for taking the time to post a scene file!! This forum is very helpfull.
I think I have now the best way to separate multi-parts meshes!
Re-reading the thread , I have some more questions:
- I understand what “packing” does but i'm not yet use to when using it, in which case should I pack parts of my networks?
- About the “@” prefix for attribute. It is not used when the attribute is created, it is used when the attribute is called. Correct?
Bye,
Gz
Houdini gamboler
- tamte
- Member
- 8839 posts
- Joined: July 2007
- Offline
Grendizer
- I understand what “packing” does but i'm not yet use to when using it, in which case should I pack parts of my networks?
it's a broader concept, but some advantages are
- you can duplicate packed geo and all the copies will point to the same underlying geo in memory, so it will instane automatically
- when you pack geo all the attributes are packed inside the primitive so not only you can access it as a single primitive, but you can merge it with other packed primitives that have other attributes packed inside without forcing all of them to have the same attribs which would happen if you merged nonpacked geos
- packed prims have their transform, so you can take advantage of that
…
Grendizerdepends
- About the “@” prefix for attribute. It is not used when the attribute is created, it is used when the attribute is called. Correct?
- in Nodes based on Snippet VOP (like Wrangles or Attrib/Group Expression, POP VEXpressions, …) you can use @<attribname> to create/modify/read attributes
and for further specificity use type description, f@, v@, s@, …
- in group fields you use @<attribname> to read the value per element, f@, v@, s@, … don't apply here, just @
- in some parameters of older non-compilable nodes which take local variables you can use @<attribname> to read atttrib value per element
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- Grendizer
- Member
- 375 posts
- Joined: May 2014
- Offline
-
- Quick Links