How to transform only specific points of a mesh

What’s the component to ‘filter’ and work only on a subset of vertices of a polygon mesh?
I’d like to scale only part of the mesh, without creating a second mesh. The list of vertex IDs I have.

I’d know how to write a Python component for that, but better ask before…

Best regards

Mesh Difference, Mesh Intersection? (if you create temp meshes to intersect with) :

You can also make (Brep) Boxes, Spheres etc, and place them in the region of the points you want and perform a Point Inclusion test.

If you have an existing mesh you can use DeconstructMesh->Vertices to the points to start from and to filter as described above.

// Rolf

The part of the mesh I want to work on cannot simply be surrounded by any simple shape.

But I think I get the idea now…
‘DeconstructMesh’ > split the vertex list into a part that will be transformed and a part that remains using ‘Sub List’ > combine the 2 vertex lists again > ConstructMesh

However, I think I’ll better do this with a few lines of Python code.

Best regards

if it’s not a free form shape you can bundle a whole bunch of Breps (and evaluate Point Inclusion for every each one of them…) to cover the shape/part you want to “capture” from the original mesh.

Happy coding! :slight_smile:

// Rolf

I see!
Thanks again! =)

Hint about a thead on point inclusion (if the inbuilt shapes are too slow). Read the entire thread. Super fast stuff.

// Rolf

You can access the vertices of a mesh and set a vertex like so in RhinoCommon using GHPython (note that this method has three other overloads i.e. different signatures/ways of setting the vertex). Make sure to pass your mesh to the GHPython component as a Mesh (right-click component -> Type Hint -> Mesh) to directly access the vertices using the dot notation syntax i.e. MyMesh.Vertices.SetVertex(indexOfVertex, newPosition)

Got it, thanks a lot everyone!!

Some things are simpler in code indeed… (I came to love Python here! =)

1 Like

@AndersDeleuran Hello, I wanted to follow the example you posted there, but unfortunately the links are broken.

Could you address me to the original page?

Thanks in advance!

Sure, there you go:

And then calling one of the SetVertex() methods of the MeshVertexList.

1 Like