Grasshopper

algorithmic modeling for Rhino

Hello !

I 'm trying to describe an ellipse with randomly generated surfaces.

First I make an ellipse, I scale it "n" number of times with a graph mapper "perlin noise".

After I generate random points on the curves, I make plans on those points and I create random sized vertical planar surfaces, I move them on z randomly and finally i cull the intersecting ones with the "collision many/many" component.

Now I think that i have too much surfaces so i'm tryng to cull those that can't be seen because they are surrounded by other surfaces but i don't really know how to proceed ?

Maybe a solution is to scale each surfaces, to generate points on each, move them on their z by z and minus z, creating lines with those points and culling each surfaces according to the number of intersections but i don't know how to do that...???

The main idea is to keep the boundaries of the ellipse with surfaces but not to have too many of them, any advises to proceed differently are really welcomed 'cause i think the results are very ugly for now and i hate using the "random" component...  

On the image the pink surfaces are those i want to cull...

So thanks in advance for taking time to take a look at my code ;)

Views: 1933

Attachments:

Replies to This Discussion

Anyone has an adise or somthing please ??

Not that difficult at all: I had plans for a "small" tutorial for you, but something happened and it would be ready Sunday (I do hope so),

best, Peter

Thank you very much Peter !  Do you think trying with the vectors is the good way or there are easiest ways to achieve that ?? Maybe with a genetic solver ??

Best regards, Nenov

Well,to tell you the truth l have some ideas in mind: more in a while

OK, whilst I'm performing some "minor" changes on that def of yours (AND I'm waiting your progress as regards the ray thing), get a "generic" way to control massacre on items in collections (Lists in this occasion, but it could be converted for DT in no time). Requires some minutes more as regards ... some things, but the usual update is due to some days.

Bad news: it's C#

Good news: User's Manual :

1. That thing (the C#, not me) after sorting (in a "sequential way", so tho speak) the panels (their order was chaotic) allows you to start the massacre by locating a focus of interest (and the user controllable  +/- Range derived from it).2. The Range is variable (obviously) and takes care not to exceed the indices of the panel list (OK, that's elementary).

3. If you click the right button (Sadistic Q: where is it?  he he) things are deleted and a new constantly self-updating list is your new List. Thus the massacre of panels is totally controllable. An autoZoom thing is also included (free of charge, but it's a bit nerve braking). Zoom factor is variable as well.

4. Then you move over (via the index slider) and start the massacre again. Notice the change of Range.

5. If you turn begin to false (initialization) and then begin to true > start all over again.

6. The other C# thing allows you to increment the index slider in a rather more convenient way. It's a bit weird: it uses delegates (A delegate is an object that knows how to call a method) and events (An event is a construct that exposes just the subset of delegate features required for the broadcaster/subscriber model - but don't ask what this means, he he) in order to talk with your slider (with a defined NickName) and perform the required value control.

NOTE: without realizing it you've just (indirectly) asked one of the most important questions even exposed in this Noble Forum. I hear you : what question? Well ... wait some days for the mother of all threads:  "Total control in collections on a per Item basis"

may the Force (the dark option) be with you (and me)

best, Peter

Attachments:

Wow wow wow !! Crazy i have to learn coding... give me some time to understand !!

The dark side of the force becomes stronger... have to pass my driving license for the Ducati hehe. Many Thanks but for now i've not understand how it works. 

I've made a new code with hoopsnake but for now it's not very good i still need to improve it. More in a while.

Best regards and i think the force (the dark one is already with you ;)

Ivo

Attachments:

You've just mentioned the 2 magic words (a) Ducati, (b) The Dark (OK, that's 3 words, but who's counting?).

Get the usual update (V2): new! improved! more bugs! slower! 3 divisions by zero! 123 exceptions! == fantastic.

1. When at begin = false mode > (a) you can now see things and (b) you can reduce your panels (prior the interactive massacre,i.e. begin = true) based on the famous algo of mine as written in this top secret (C)(tm) function: 

MassacreOnList(sListSorted, pC, CofCPanelDist) : in Plain English:: take no prisoners.

2. make a break > buy a book (you know what kind) > learn things > sky is the limit (in fact events/delegates is the limit - nasty stuff).

3. in order to get your def (the complete thing) YOU MUST post here a hymn (original, lyrical and passionate) related with the ultimate thing: my Panigale 1199.

best, Lord Of Darkness

Attachments:

Yes, nice ! Now I still don't understand but I can use it hehe ;)

Like always your message are very fun !

For the reading these days i'm on D'Arcy Thompson's On growht and Form but too complicated, after i tried Le pli of Gilles Delleuze but still too complicated... think i'll watch tv (no maybe some Steinbeck's book, the thin ones about alcoholics  hehe).

For the hymn maybe some oldschool rap like DMX but I prefer a lot more, when i've finished something i'm proud of, to listen to this: https://www.youtube.com/watch?v=3NXBgSCSrIk

Er.. hmm.. riding THE ultimate and listen to THAT => no, no.

It's obviously a cliche ... but try this: https://www.youtube.com/watch?v=5UWRypqz5-o

Anyway here's some tech-preview for the Mother of all treads:

As engineers quite often we define some kind of "global" policy in order to create things in collections (either a piston on a mighty flat12(*) or something in some DataTree - it makes no difference at all). You did that by applying a random policy and getting the panels as a "fire and forget" set of things. Other similar ways are: Attractors, some sort of global logic etc etc etc.

But ... in most of cases (at least engineering type of cases) we need more: we need individual control on items in collections. You've (indirectly)  asked that: in fact ... what do you really need is an ability to "outline" rules for some collection AND on the fly (at Item creation time) control these Item(s) AND/OR at later time modify/delete/whatever the Item(s).

Now... if your panels are made from real-life components that should "comply" to a variety of nested restrictions (topological, cost, aesthetics,  whatever) the whole thing goes dizzy .. but IS the real-life/norm (but very rarely people talk about that: it's another unspeakable truth in our trade).

(*) Porsche 917 anyone?

PS: play with that Anemone thingy (it does create on the fly/interactively stuff - although very primitive ones)

more, soon

Attachments:

I just don't get it... why this anemone code ??

I have used iterative things to bake when i have a lot of elements to bake but here i just don't understand why ?? 

For the Porsche hope to buy one soon...

this paper pavillon "est tombé a l'eau"... too bad

You don't get the Anemone thing? Well...this is NOT about baking it's about creating things interactively.

In plain English: you create a collection (stored in some tree) of boxes where AT creation time you can "shape" them.

In plain English (for your pavilion): you define the path (the ellipse) and then you control (on a per item basis) these panels (shape, position etc etc) prior storing them into some collection. What is the "usual" way? The wrong one: you mastermind some logic, you get the SUM of panels and then we spend time and effort to clean the mess.

And why it's a mess? Because in quite a few cases we need control over items and not over the collection of items.

Of course I could create a "correction" C# that does far more better things (than the one provided) in order to clean/clear the mess ... but compare the time to think/test the code VS the time to put these panels in place on a per panel policy. It's like buying a Toyota Prius (Yikes!) and spending time/effort to make it a Lotus Elise (the ultimate affordable sports car).

PS: you can't buy a 917: only available in auctions (at around 300++K). This immortal racer (against popular belief) is not the most successful racer of all times:  the crude Viper (tractor 8L engine, push rods, 5K rpm  etc etc) had won 7 times more trophies.

Sorry, i didn't respond so fast but i was in istanbul the most arabic european city hehe !!

I start a new thing with my collegues, not a grasshopper thing but come back to the old way with the ruler, the rubber and the pen and a lot of a paper. But thank you for the time spend to help me, i'll use your code one day if it comes to help ! 

Working now on a new galapagos pavillon...

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