Setting different sizes on mesh edges in ghpython

Hi guys!

Here are pictures of the meshes I am working with:

I originally had 1 mesh object, but with my current code I duplicated it and set the second mesh object within the first one. Here is my code so far:

import rhinoscriptsyntax as rs
import Rhino.Geometry as rg
import ghpythonlib.components as gh

mesh = rg.Mesh.Offset(input_mesh, .3, False)
list = rg.Mesh.GetNakedEdges(mesh)

I was wondering if it possible to set the different edges of the interior mesh to different sizes (opposed to all of them being .3mm). and then the mesh would smoothly transition in size from one edge to the next? As you can see from the first pic, there are 3 edges, so it could get tricky. I am having trouble finding anything.

Thanks!!

Thanks

Hi!! This is a second go at seeing if anyone has a solution to my problem. (If it isn’t clear what I am trying to do please let me know so I could clarify). Thanks!!

I was wondering if it possible to set the different edges of the interior mesh to different sizes (opposed to all of them being .3mm).

Isn’t .3 the offset distance? This doesn’t have anything to do with the edge lengths of the interior mesh.

@Michael_Pryor Yeah, .3 is the offset distance. So, what I am asking is it possible to have one end of the second mesh be offset at .3 and the other end be offset at .2 instead of everything having to be the same offset distance.

I see yes, it is possible. Use a value field, map, or attractor and move verts by their normals based on those values and rebuild the mesh. Can make an example when I get a chance.

@Michael_Pryor Thanks, an example would also be really useful and much appreciated. Thanks so much!!

Here is the basic logic (I don’t have time for the scripting, and I use C# anyway). So you wont be able to rely on the basic rhinoscript or rhinocommon methods. Seems a good opportunity for you to learn by trying to recreate the following definition in python, the logic will be similar.


Mesh Variable Offset.gh (12.6 KB)

@Michael_Pryor Thanks so much, this helps a ton. You’re an absolute legend!!

1 Like