Grasshopper

algorithmic modeling for Rhino

Extracting discontinuity points in pairs along a curve. C#

I would like to create four point surfaces by connecting consecutive points on two separate curves. In my attached example I've extracted from the upper curve: points 0 and 1, and points 1 and 2 from the lower curve, to construct the surface shown. I'd like to do the same for upper curve points 1 and 2 and lower curve 2 and 3, and so on and so forth until the two curves form a faceted side. I was unsuccessful with loft and ruled-surface ( maybe I'm missing something ). A C# script would be preferable where I could walk through every point on each curve and send a set (list) of points to the four point surface component. Thank you in advance.

Views: 1523

Attachments:

Reply to This

Replies to This Discussion

Or a little simpler and more complete:

Attachments:

... and elegant!

I looked at the rest of this code and saw a much simpler way to make the diamonds...  What you see below in the cyan (light blue) group replaced all the code in the red group, which has been disabled, disconnected and can be deleted.  That change required one other small change, which was to reverse the 'True/False' culling pattern in your 'Cull' component (now 'False/True').

I did the same thing for both 'Outer Star' and 'Inner Star', then re-arranged the components a little but made no other wiring changes.

Nice little project.  Oh, I did make one more wiring change - instead of using 'Area' to get the centroid of the circle, I added a 'Pt' (0,0,0) component and used it for the circle and one end of the two lines where you had used 'Area Centroids'.  Won't make any difference in this case but 'Area' can be relatively slow when using "hundreds" of them.

P.S.  In the yellow group, there is a slider connected to the 'z' input of a 'Pt' point constructor...  That should really be a 'Unit Z' vector component instead of a 'Pt' but it works because GH is forgiving, at times.

Attachments:

Deleted disabled code, replaced 'Pt' with 'Unit Z' vector for 'Move'.

Attachments:

Fascinating - and very instructive and illuminating. Thanks for posting.  2 comments:

1. Medieval architects would have loved to use this for castle design.

2. Perimeter curve behaves quite surprisingly when you wire it to the Fillet Curve function. I was investigating more organic looking shapes.

Yes, it looks like a great design for a fort.

Show us your Fillet Curve mod?

This isn't as beautiful as William's design but I got inspired by this image of a seven-sided fort:

So wrote this bit that generates three different styles of "star forts", selected by the 'Value List' in the blue group and driven by point order lists:

  • Fat 7
  • Thin 7
  • Eight

The top offset can be negative (like William's) or positive, creating walls that slope out at the top.  The radius of the inner cylinder must be adjusted so it doesn't overlap the inner points of the stars.

Attachments:

I whomped up a quick 3D print using my fillet modification.  There is a trick to 3D printing things with fillets, and it is the necessity to invoke Rhino's _DivideAlongCreases _SplitAtTangents=_Yes function on the baked GH output before you export it as an STL file for printing. If this is not done the filleted surfaces will print with plane facets instead of smooth curves.

This is an obscure bug/feature in Rhino that drove me nuts for quite a while. I don't know if it's a recognized issue or will be fixed in Rhino 6.  I sure hope so. 

I am rather reluctant to post my fillet mods because I am strictly an amateur/self-taught GH user and therefore I tend to do things using comparatively crude/brute-force methods. In this case i deleted some of the original components and added a few to make the filleted shapes. The stuff in the top-right group is just for experimentation. It works but I'm not sure it's worth pursuing.

Attachments:

The 3D printing is very cool.  I don't have the Jackalope plugin so not sure what I'm missing in your model?

No need to be shy about sharing code.  I think "amateur/self-taught GH user" applies to many of us here.  I enjoy this forum for two reasons:

  • To see how other people do things - MUCH can be learned that way!
  • I enjoy solving puzzles.

Curious that you discarded the code I wrote using discontinuity points to extract matching segments from the top and bottom perimeter curves?  Using a Ruled or Lofted surface without that yields a badly twisted result, which was the reason William started this thread.

Adding your 'Fillet' to my code works great (the baked/red surface) but the 'RuleSrf' (green) is all messed up.

Your 3D print appears to have a fillet between the side and top surfaces but I don't see anything in your GH code to produce that?

Hi Joseph - thanks for your encouraging reply.  To answer your questions:

1. The Jackalope add-on is excellent and I use it a lot. I have never had a problem with it, but the twisting algorithm it uses can result in some unexpected (to me anyway) results. What can happen is it produces a "waist" in the twisted result which I guess should be expected but is not always desired. Here is an example of how I used it twice in the same part: http://www.thingiverse.com/thing:1601550

2. I took out your code at bottom right because it just didn't seem to be needed for the filleted surfaces I made. Of course I could be wrong about this - the fillet function is clearly very sensitive to points of discontinuity, so maybe I got lucky and just stumbled on a few values that worked.

And yes, I know about how sensitive ruled and lofted surfaces can be. I was pleasantly surprise to discover some of those problems can be fixed by reversing an edge curve 's direction. The concept of a curve's direction had never occurred to me and, as you pointed out, I learned about it from some posts in this forum. 

And would you believe my first job after graduating was in the Loft Lines department of an aerospace firm? There is some irony there I think.

3. I'm not sure what to say about the green surfaces in your image. My guess is they are the result of some quirks in the filleting or lofting code that have to do with connections between curve and surface segments. I spent many hours trying to get continuous, smooth surfaces lofted from what appeared to be smooth edge curves so I could make objects like this: http://www.thingiverse.com/thing:1596100.  I finally was able to find a method that worked - again, adapted from something I found in a post here.

4. On my printed part there is no fillet between the side and the top. It just looks like that because the part is small and no printer can make truly sharp edges. It is just melted plastic after all. I have made parts with top/side fillets and I think those look much better than ones made without them (http://www.thingiverse.com/thing:1118050) , but again it requires some extra fussing to get the filleting to work properly.

Hi Birk, I just got around to looking at the fillet component you placed in my description and how it economized the flow. It really works out well in this case. Thanks again for being a part of this thread.

It's very nice of you to make the added effort.  I find it of great interest, and valuable learning, and it has led me to where I was ultimately intending to go - a 3D print (small scale), the Escher fort will need to wait until another day (epoch) after I overcome the dizziness.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2019   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service