Spacing of Geometry along Curve & Variable Height Extrusion


(Aideenmod) #1

Hello,

I’m new to grasshopper and having trouble to figure this one out. I need to space a geometry along a curve with the spacing being 2 times the length of one triangle edge as a radius to where it cuts the curve as shown in the picture.

The attached file is working relatively well however the spacing is messured with 2 times the length of one triangle edge along the curve as so is not accurate.

Does anyone know how to solve this?

Thank you!!

geo spaced on curve.gh (17.5 KB)


Basic geometry problems interpolate crv and rotate rectangles
#2

You didn’t internalize your geometry:

missing


(Aideenmod) #3

It should be in this one.

Thanks!

geo spaced on curve.gh (18.7 KB)


#4

This is hasty and doesn’t align the triangle as you did, with two vertices touching the curve… Basically though, you want to use DivDist.


geo_spaced_on_curve_2018Feb12a.gh (14.6 KB)

This version aligns the triangles by their “base points” but as you can see, it fails on the last one because the curve ends too soon. so to speak: Later - Wait a second, I made a mistake… working on it…


geo_spaced_on_curve_2018Feb12b.gh (18.8 KB) (removed due to error)


#5

Fixed that by by extending the curve (Ext), though that might cause trouble in some cases where the curve is already “just right”? Later - Wait a second, I made a mistake… working on it…


geo_spaced_on_curve_2018Feb12c.gh (20.9 KB) (removed due to error)

By the way, any particular reason your geometry is eighty-seven thousand units away from the origin? Inconvenient if it’s not necessary.


(Aideenmod) #6

Wow! Thank you so much Joseph. :slight_smile:

No, there’s no need for it to be so far from origin. The curve and sizing of the triangles are just a sketch. So can be changed. I just need a scritical of test many options.


#7

Standby… Except for the first one, I made a mistake in versions ‘b’ and ‘c’ (which I will remove).

Like version ‘a’, this version has the correct spacing but aligns the triangles according to the tangent at each point, which isn’t the same as having two vertices of each triangle touching the curve. That’s more complicated… Not quite sure yet how to do that part “easily”.


geo_spaced_on_curve_2018Feb12d.gh (17.0 KB)


#8

OK, I think I finally got it right. The complexity of “simple things”!


geo_spaced_on_curve_2018Feb12e.gh (23.1 KB)

There is still an assumption here that the curve is in the XY plane, which might not always be true, and then the code will break…


#9

For whatever it’s worth, this version handles a 3D non-planar curve, but as you can see, the triangles all remain horizontal because of using HFrame. That too can be “fixed” but I’ll stop at this point.


geo_spaced_on_curve_2018Feb12f.gh (22.0 KB)


(Aideenmod) #10

A huge thank you Joseph!

This works great for what I need. The curves will remain planar.

Really learnt a lot from you help. Amazing!


(Aideenmod) #11

Thank you so much for your help with the script.

I altered it a bit today so the spacing is the length of one side between each geometry. (I realised later that this is what I needed) Now I have tried o extrude them and I am almost finished but I just have one problem now I can’t fix - it’s that the last element piles up… even when I set a number slider to control the number if geometries. Might you have a solution?

No worries if not.

Thanks!!
18<a class=“attachment”

geo2_spaced_on_curve.gh (13.1 KB)


#12

I sounds like you want version ‘c’ from yesterday? Here is a slightly modified version of that using your latest geometry. I didn’t add the extrusions.

geo_spaced_on_curve_2018Feb13a
geo_spaced_on_curve_2018Feb13a.gh (18.1 KB)

P.S. Adding your extrusion code now and I see your “last element piles up” problem". Standby…

OK, see two things in the purple group:

  1. To count the points (Lng), you want every other point, which comes from Cull, not from DivDist.
  2. The Range ‘N’ input needs the expression “x-1” to get the same number of results.


geo_spaced_on_curve_2018Feb13b.gh (22.8 KB)

P.P.S. I just noticed the min/max settings on your domain sliders in the purple group??? What’s up with only two possible values? ‘499 to 500’ and ‘899 to 900’? Kind of useless, eh? Fixed that.


(Aideenmod) #13

Great Joseph that all makes perfect sense

Thanks again, I really appreciate it.


(Aideenmod) #14

Hi again Joseph,

what I’m trying to do now is add more range domains to the extrusion and a number slider to the start and end points so I can get a height that can move up and down along the curve. Here’s a screen shot of what I’d like to achieve. If you have any good ideas to share?

If not no worries!!

I’m still getting my head around it but really really learning a lot from the files you’re making!!


#15

Well, yeah, I have some ideas… Kind of mixing apples and oranges though, since that’s really a completely different topic. And it’s not well defined. There are many ways of doing stuff like that. Graph Mapper comes to mind, but if you want slider controls, it’s what I call an art project - totally arbitrary.


(Aideenmod) #16

You’re right - it’s a different topic.

I’ll check out Graph Mapper.
Thanks!


#17

Unless you want to use attractors(?), just forget about the geometry and think about how to generate and control a pattern of numeric values. Here’s a quick application of Graph Mapper:


geo_spaced_on_curve_2018Feb14a.gh (23.6 KB)


(Aideenmod) #18

Thank you!

The graph mapper works alright.

Just looking quickly at a attractors, probably would be the better as it appear that there is more variety in the ability to adjust and control the form.