Exponential Sine Curve across Points Grid

Hello all,

I’ve spent the last two weeks playing around with Sine curves (And had a lot of fun), but I can’t seem to figure out how to distribute Z-values based off an exponential sine curve formula across a grid of points (ie. 1…100…#25 cross-product laced).

I’ve replicated what I’m roughly after (Albeit, it should be more… sinuous) in the Conceptual Massing environment as shown below:

Anyone have any ideas how to do this? I’ll bet my bottom dollar is sublimely easy :smiley:
Sine Curve Tower

Maybe it’s not quite as easy as I thought!

As an addendum, the premise would be:

  1. X-Direction curves to start a a low amplitude Sine curve at the edge and ramp up to a rather ‘sharp’, high amplitude sine curve at the centre.

  2. Y-Direction to be the same. Geometry is the result of a loft over these.

It’s kind of Gaudi-esque…

Hi Sol,

Not sure if this is what you are looking for. The graph may not be very clean :slight_smile: Attached home2

Create a 2D set of points > Query both X and Y values

Assign a center (here 50, 50) > calculate the distance of each of the points to the center --> this acts as the parameter that will determine the amplitude of the damping curve and amplitude of the sin wave (I have used cos here since I want the peak to be at the center cos(0)=1)

Create sin and damping curves > Superimpose the amplitudes > Translate the original set of points by this value

amp-sin

 

 

 

Getting pretty close Elayabharath!

Is there any chance you could re-post your image? I can’t make out your nodes (unfortunately!).

Edit: Ignore that - I just saw your download link… it’s way to early here!

Hello

I have tested it by opening file on 0.7.5.3566 this version of Dynamo. (this is 0.7.5 release build).

After opening file you need to click on Proceed anyway button to continue opening file.

let me know if that doesn’t work for you.

Keep using Dynamo!!!

Thanks,

Ritesh

Attaching new image of EB’s graph as well as I am attaching another DYN which has a different approach to achieve the same results.

New DYN file… SineWave

 

SineWaveNew

Very cool Ritesh, many thanks!

Hello all,

I tried playing around with all your definitions (very cool, many thanks), but still haven’t quite got what I’m looking for.

I’m after the following (illustrations at the bottom of the post).

 

A point grid of: 0…50…#100

x = 0, y = 0, z = sine curve translation

Sine curve = Factor*Math.Sin(X);

Each ‘point line’ would thus have a different factor associated with it up to half of the max lines (25 in this case).

Point Line 1 = Factor 1

Point Line 2 = Factor 2

And so on and so forth.

 

After getting my X-Axis sine curve working, I would mirror the point distribution to get something akin to the first post image in the X-Axis.

I would then rotate the point ‘cloud’ 90°, remove any co-incident points and create a new ‘cloud’ based off that - hopefully similar to the above image.

It should look something like below:

 

Simple_Sine_Curve_Def

 

Very simple defintion.

Simple_Sine_Curve_Def_Examples

 

 

First line. Second Line. Third Line … 10th Line.

Simple_Sine_Curve_Def_Mock_Up

 

Verbose version of what I’m after (part).

File: Sine_Curve_Mock_Up

How about some magicNode? :slight_smile:

(Tried to keep the python part minimal)
sin

That’s pretty cool Mehmet, although I must admit Python is currently beyond me. I do dabble in coding so do understand it a little bit… high time to take that plunge I think!

Does this mean it’s not possible Out-of-the-Box in Dynamo? Or is Python just easier :smiley: ?

I’m sure it’s doable in Dynamo. It’s just easier in Python.

Don’t frighten yourself about Python. You don’t have to be a Guru for basic operations. I started by examining Nate’s codes (Lunchbox) and watched “Introduction to Computer Science and Programming Using Python” videos of MIT. (You can find them from MIT OpenCourseWare, EDX or youtube).

It’s dead simple to learn the BASICs.

Ah brilliant. I’ll do that then. Thanks for the heads up!

I think it’s even easier to do this with design script and a bit of lacing. Just keep in mind that python math works in radians and Dynamo math works in degrees. Following Mehmet’s example:

Capture1

 

I hope this gets you started. I’ve commented as much as I could. I’m sure there is a better way of writing the same code. But for basic operations for the numbers we are dealing with the computational complexity doesn’t have a big hit on the efficiency.

sinHill

@Dimitar

You, you, you’re good you! (with Robert Deniro voice)

Ah awesome, thanks lads. I would prefer, for this example, to use DesignScript but Python is now off the ‘to-do’ list and on the ‘am-doing’ list :slight_smile:

I did start watching some of those MIT edX tutorials as well Mehmet and while I know most of that stuff (in general) so far, I’m learning tidbits which is cool.

Definitely excited to be learning Python.

@Mehmet: I had a look at your Python code, makes total logical sense. I agree it doesn’t look that bad to pick up and I’m reading/watching stuff where I can :slight_smile:

@Dimitar: I love how simple this is in DesignScript. I’ve been using your node and it’s doing 80% of what I’m after. Could you please explain to me something if you don’t mind?

I’ve added in an ‘offset’ value to take the points off the ground as indicated in the image below: Is there a way to add this to the Point.Add(v1) as a list? As in, I can get the offset to work as a static number (ie. 6), but cannot get it to populate offsets based off a list. I’m sure my syntax is somehow failing.

The intention would be to simulate that same sine curve in the opposite direction with an offset. So instead of having all the points along the edge at (X,Y,6), they would be (X,Y,(6-20)) or some such.

That way my ‘tower’ would have four corners ‘near’ the ground, and the intermediary points between said corners being the high points of a sine curve.

As below, the first orange box shows where I have added my Offset. I tried adding one in the second box as part of my: pts.Add(v1 + offset); and it didn’t work.

Code Block Sin Tower

Dimitar_Venkov_Code_Block_Sine_Curves

You could try a combination of geometry.mirror and geometry.translate. What’s the effect you’re aiming for?

2015-03-20_140747

 

List.Combine will probably be the answer, I just need to play with it.

Your example is so very very close. Forgive my 2-year old drawing skills, but the pink mash-up illustrates what I am after while the Dynamo output is where we go to. Effectively, it’s perfect however instead of having a ‘triangle’ of points created on the edge as such, I would like to create the same Math.Sin() function across them (As illustrated in pink)… List.Map maybe?

Dynamo_Sine_Tower_Venkov1 Dynamo_Sine_Tower_Venkov2

Thanks to Dimitar’s code I’m no more DS shy :slight_smile:

sinHill DS

 

 

 

 

 

 

 

 

 

 

I’m not sure if I’ve understood your question Sol.

If it is to pass some of the stuff in y direction then it’s a matter of feeding a custom yList and mapping yAnglesList accordingly.

sinHill DS Offset