Grasshopper

algorithmic modeling for Rhino

Hi Guys,

i wrote a script to scale a triangle with C#,i want get a series of scale triangles once i run this script,but the result comes to just ONE final scaled triangle.I have tested many times of those codes but still couldn't work it out.anyone can do me a favor? 

all the files have been attached below.

Thanks alot

Views: 1542

Attachments:

Replies to This Discussion

Here we are:

Attachments:

BTW: Offset is more suitable for the occasion (Notify if you want a C# that does that)

added 2 lines more.

get the other C# as well in case that you are after combined trans stuff.

Attachments:

Hi jackieyin,
here's my two cents - in VB - but maybe you can succesfully translate it to C#...

Attachments:

Hi Pieter

I read your codes, it was simple but powerful.

Here I want talk more about how the Curve(in grasshopper) store in the Stack and Heap(See picture shown below). Curve is a reference type and it was stored in the heap, while the name of which, stored in the stack, points to the space of heap. Once the value of C changed, all the C1,C2,C3...will change accordingly. this can explain why my very first example (see TriangleScale.gh from the top)got the final smallest scaled triangle all the time. This is my explanation about the how the Curve or List Curve works in the memory space, if you guys find it is not correct, pls let me know. 

 

You're using my visual studio for scripting components thingy! Do you find it practical?

Hi Vicente

Yes!! Your scripting component helps me a lot from transform the codes from VS to C# component in grasshopper which saved me a lot time cos coding in VS is much more efficient compared with in C# component. But i am still wondering how you guys debug when you write some complex codes. C# component could not offer a step-by-step debugging process, once the program get complicated, debugging in gh is quit annoying. So o i just use the Print method try to catch the unexpected problem. I wonder if you got a better way or not. Thanks anyway.

Hi Peter,
Thanks for your beautiful codes in the triangleScale, the attachments you posted is far
better than what I have ever expected, and I learned the whole package about how the method transform works from your examples,really appreciated!

Notify if you want more of similar C# things (from simple to paranoid) with regard transformations, matrices, cats, dogs (and one alligator).

PS: for simple thingies like these you can work with the (awful) build-in C# editor: just replace espresso with Tequila (lot's) and relay on your Karma.

best, Peter

Tradition above all:

the V4 update (more bugs, slower, complicated, trickier, pointless = exactly what we call progress these days).

Notice the orange thingy: GH failed to internalize one curve [=null] (but that's the norm anyway).

Attachments:

Hello, 

I have a similar question. I want to have a series of scaled geometries. I attached my code and gh file that I have the same problem, but I used a different approach (I don't know if it is correct or not). 

Since I am quite new to C#, the answers seem complicated to me. I wonder that I can get the same result a simpler way or not. 

Thanks!

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service