If it matches there are ways of selecting the triangles, if not it would be complicated…And it look basic but it’s not , because there’s no triangle informations in the geometry files (gltf, obj, etc.).
I believe you could take advantage of this as a go-around (since, no, there is no polygon group selection in BJS). But there’s cloning of materials and texture and you can also dispose of them and replace them.
If you’d assign a cloned material to your poly-selection, you can next search it through the material id. Since it’s not a unique id, you can even assign a same id to different materials to form ‘groups of poly-selection’ or even better you can add an identifier to each id for different purposes and next split the id to transform a group that contains a same identifier. After the process is done, you could simply assign the final material to all and dispose of those that are just duplicates. I know it’s not ideal. It’s a work-around but I believe it should still be manageable.
Edit: I realize my answer is just ‘high-level’ and may not be applicable. May be you could tell us a bit more about what you want to do with these ‘polys-selections’? It will only make our answers more accurate.
It’s basic in a 3D modelling app but not necessarly in an engine. Though, I’m not saying, improvements can still be made (and are made every day) and now with i.e. ray marching and the new stuff, may be one day in a near or less near future, it will enter the list of potential improvements (just a guess). Meanwhile, I believe we need to make with what’s available and there’s nearly always a solution as a work-around. May be not always the one we would have wanted but yes, that’s what it is I suppose
If you can’t solve a problem from the right side, it’s best to look at it from the other side to at least come up with a new approach.
How can you assign multiple materials to an object in Babylon? Via subMeshes!