Grasshopper

algorithmic modeling for Rhino

Hi guys,

does anyone know a way to use the split mesh edge command of rhino in grasshopper? 

more precisely:
using kangaroo to refine a mesh, i want to tell grasshopper to split every edge above a certain value
(by the way i also want to tell it, to unify vertics with a distance below a certain value, but thats another issue)

i post this, since i couldn't find any information in the forum

any ideas? 
thanks
Benjamin 

Views: 3195

Replies to This Discussion

Maybe if i transform the mesh into a line grid, and then by evaluating their length and dispatching them according to the given value, i can apply "divide curves" on every curve that is to long. then cull similar points and apply delaunay one my new point list.

but delaunay creates the strange edge faces, so i want to avoid delaunay...

 

For the collapsing of short edges you could use a C# script something like this:

for (int i = 0; i < M.TopologyEdges.Count; i++)
{
  if (M.TopologyEdges.EdgeLine(i).Length < L)
  {
    M.TopologyEdges.CollapseEdge(i);
  }
}

Now it should be possible to do a similar thing with splitting long edges, but as far as I can see there is no equivalent SplitEdge method in the SDK. Maybe this is just an oversight and something that could be added. Otherwise I guess you'd have to make a new point along the edge, delete the current 2 connected faces and replace them with 4 new ones.

How does this relate to Kangaroo ? is it to improve the mesh before some sort of relaxation ? because depending on the type of relaxation, and how bad the initial mesh is, you might be able to just let the relaxation take care of the edge lengths.

thanks for the quick reply daniel,

i have no clue of scripting yet, but i guess its time to start some tutorials...

yes i would try to use "mesh" instead of delaunay, just a bit tricky to create the new meshfaces in the right position

the connection with kangaroo is the following:

i have a triangular mesh that follows the shape of a given surface (with a certain tolerance). i want all the elements to have an equal length (or as close to equal as i can get). now when i use the mesh relaxation, equalization and "pull to surface" in kangaroo the mesh folds itself and some edges remain to long, because the geometry is just not capable. so i want to tell grasshopper to split edges and unify vertices and then run the kangaroo relaxation again to get closer to equality of the elements


pictures attachedunequalized

ran the kangaroo relaxation 7 times and improved the mesh inbewteen by hand in rhino...
average variation still 3.5% 

I could finally solve it, here is the circuit. I hope it is useful for somebody.

The Weaverbird Plugin is required to run the script.

The script splits every edge only once, even if the split parts of the old edge are still longer the threshold value. to achieve this, one could use the hoop snake plugin and loop as long until every edge is shorter than the threshold. maybe i'll add a loop later

have fun
Benjamin 

Attachments:

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service