Grasshopper

algorithmic modeling for Rhino

This must be simple but I am banging my head against a wall.

 

I have a periodic, degree 3 curve with 4 control points. There are sliders driving the placement of the control points on the XZ plane. I want to be sure that the curve itself never has points that meet or exceed a certain value of X. For example, no point on the curve should ever have an X value of -10 or above.

 

Anyone able to get that through my thick skull?

Views: 409

Attachments:

Replies to This Discussion

Hi Matthew,

 

there's no straightforward way to limit your points in such a way so as to prevent the curve from stepping over the x=-10 boundary. It's easy to determine whether the condition is broken (just use a boundingbox) but it's difficult to fix this problem. Here's a couple of algorithms that spring to mind immediately, none of them very good:

 

1) You could choose to pick the control-point with the highest x-value and move it in the the negative x direction until the curve rightmost extreme is once again below x = -10. This could severely deform the curve, especially if it's way beyond x = -10.

 

2) Measure the total offending distance and move all control points in the negative x direction. The benefit of this algorithm is that it is only requires a single step (i.e. no iteration or recursion). 

 

3) Assign weights to all control-points (the farther along the x-axis the higher the weight for example) and move them all in negative x depending on this weight. This again requires iteration but will distort the overall shape less so than algorithm [1].

 

the main problem is that it is not easy to predict exactly how a curve extreme will change when a control-point is changed. There's no straightforward relationship between the two, other than actually making the curve and re-evaluating it. In your example, you could choose to move all control points and they would all affect the rightmost curve extreme. But they do not do so in a linear fashion.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Thanks David. At least I wasn't overlooking something stupidly obvious as I usually do. Your proposed solutions are helpful. Will see what works out.

 

Matt

David,

 

Quick thought/ Question. Would a box morph essentially achieve some version of the solutions you described above?

 

Matt

Don't know. How would you set up the morph?

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service