Grasshopper

algorithmic modeling for Rhino

I was looking at a post earlier today, which got me thinking about the logic of how to collect intersected curves into discrete, closed cells. This got me looking at this post which led me to the excellent codequotidian blog by Trevor Patt and this post, which uses half-edge mesh data structures to sort curve networks. I've been lucky to closely observe Daniel Piker and Will Pearson as they work their magic with Plankton, so I thought I'd take a look at sets of intersecting curves alone to see if a similar approach could organize them effectively. What I've done is a pretty rough workthrough of examining planar curves, blasting them apart based on intersections, and creating sets of "half-curves"...much like half-edges, but these allow for curves of any type to be used for edges in composing faces. I've only done planar curves because calculating angles is the means by which they are sequenced, but I think it'd be possible to also do this for curves on a surface or mesh, with local planes for calculating angles determined according the surface or mesh normals at each vertex.

No doubt the code's pretty ugly, and there'll be bugs.  It definitely likes curves that intersect...I haven't resolved how curves that float alone are treated, or if closed curves lie inside of other closed curves...But in any event, here's the code, have a play if you like...and enjoy!

131111_curve_network.gh

Views: 6827

Comment

You need to be a member of Grasshopper to add comments!

Comment by alex.lupascu on November 12, 2013 at 3:32am

Hello, i was wondering why is it necessary to code a VB component if this can be easily done with the standard ones? I remade your def using the split surface in combination with the bounding box and culling the index 0 of the original bounding surface.. seems to do the same thing and less buggier.. yours seems to generate extra surfaces for the regions that are isolated or inside other regions.

curve network 2.gh

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service