Grasshopper

algorithmic modeling for Rhino

Newb needs help: Trimming offset lines with a circle... Works when I have one, fails in a series.

Sorry to be a bother, I'm a Grasshopper novice.

  I wanted to do a series of lines bounded by a curve.  I find the intersections, shatter the lines, and then cull them.  I did this for a single circle, and it seems to work fine:

  Things get screwy when I try to use the same thing on multiple circles (with the lines at random angles).  While the offsets and the intersections seem ok, the shatter and cull are a mess.

  I'm aware that there's a problem with extra intersections where the lines cross adjacent circles, but the problem persisted even when I set them all to the same angle so there would be no extra intersections.

  Note that there seems to be a pair of lines that expand from the center one step per additional circle.  I'm not sure, but I suspect I have a data matching problem?

  I know that the offsets were screwed up in the multiple circle version until I added the CrossRef elements.  I also added one to the single circle version, but I'm not sure I'm using it properly.  My goal there was simply to merge the two series of offsets.

  Please let me know if I'd doing anything completely screwy, I'm really new to this.

Views: 451

Attachments:

Replies are closed for this discussion.

Replies to This Discussion

The first thing I noticed was 'CrossRef' - I've never used that one so thought it wasn't needed; removed it and used 'Graft' on the 'Offset Distance (D)' input instead.

Studied that data tree output and added 'Path Mapper' and 'Flip' between 'Offset' and 'CCX'.

Then spent a lot of time trying to understand why it still didn't work...

Didn't like the 'Extend (Ext)' component here and thought it might be messing up the 't' values so used a different approach to creating the base line for each circle.  I used 'Move' twice to copy the center of each circle in opposite directions, according to the 'VRot' vector, then created a line between them.  It's more straightforward but didn't help...

Spent a lot more time(!) studying data trees - even used two copies of my 'vuTreeList' tool to isolate one circle and its lines (I left one copy in the file, disconnected).  Finally managed the right combination of grafting the 'CCX B' and 'Shatter C' inputs and got the results we want - for half the circle.

Instead of making the same changes to the other half of the code/circle, I decided you probably want just one set of lines per circle, not two(?), so made some slight changes to the inputs for 'Series' that drives 'Offset'; I set the 'S' (Start) to negative 'Line Spacing' times 'Line Count' and set 'C' (Count) to "x*2".  Then threw away the other half of the code!

Attachments:

Thanks so much!  Really appreciate the help!  Yeah, I figured I didn't need two streams of code for the positive and negative offsets, but I wasn't sure how to merge it.

Hi Mike, here's my approach at this:

Attachments:

So...

  • 'Contour' applied to curves (instead of breps) creates points instead of curves!
  • 'PShift' with 'O (Offset)' of -1 is like 'Path Mapper' for many common cases.

Nice to know, thanks Pieter.

Thank you very much, I really appreciate it!  Do you have any thoughts on how I'd do the same thing with the cells of a voronoi pattern instead of circles?  That's where I was hoping to ultimately wind up.

Try hooking up the voronoi cells instead of the circles.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service