MeshFaceList.DeleteFaces also deletes vertices, however the SDK says it maintains the rest of the geometry:
“Removes a collection of faces from the mesh without affecting the remaining geometry.”
It seems to happen when a vertex loses all its faces.
Since there is a method to remove unused vertices, this method shouldn’t change the topology in my place.
private void RunScript(Mesh M, ref object A)
A = M;
DeleteFacesBug.gh (10.5 KB)
Please, fix that.
May 7, 2018, 4:44pm
The function does seem a bit heavy-handed. I’ve created an issue so we can address this.
@dale I was going to post this problem, I searched on the forum, and it turns out I already reported it three years ago!
Using Version 6 SR31
Delete faces remove vertices facepalm.gh (7.1 KB)
Give me my damn vertices please!
November 20, 2020, 5:19pm
Looks like it’s working, as expected:
What am I missing?
Why doesn’t it work for me? Can anyone else try it? (just open the file and say if the right panel returns 121 or 120 vertices).
Can someone test if returns 120 or 121 vertices and with which version of Rhino? I don’t understand why it doesn’t work for me!
Delete faces remove vertices facepalm (1).gh (9.2 KB)
Yes - DeleteFaces with Compact=false was incorrectly removing vertices in some previous releases.
It is fixed and works as it should in R7. I’m not sure why the fix looks like it hasn’t gone into 6.31
You can track the issue here:
I understand that the fix has been moved to RH7, ok
Thank you both for answering.
November 23, 2020, 9:13am
I know it’s a pain - I encountered this bug too a while back and it was driving me crazy for a while why I couldn’t get it to work.
You can work around it though with something like this:
Mesh m = mesh.DuplicateMesh();
for(int i = 0;i < mesh.Faces.Count;i++)