Very informative. I like to think of the curve parameter as similar to the uv coordinates of a nurb surface. A common mistake is trying to space out geometrically over a surface using uv subdivisions. It's basically the same error than using the cuve parameter instead of length, but in a non planar nurb surface its much more difficult to find a real length between two points. What i have done in the past is project a curve onto the surface and use the length component, I don't know if there are better solutions.
On Jan 16, 10:50 am, David Rutten <[email protected]> wrote: > Thanks Damien, > > you saved me a lot of trouble explaining about curve domains :) > > There's one thing I'd like to add to those who want to know more about > nurbs mathematics. This is not required knowledge even for Plugin > programmers. So if you skip this, you'll be no worse off: > > The domain of a curve is an emergent property of the knot-vector. I > always hated the word "knot-vector", because it conjures up images > that have nothing to do with what it's supposed to describe. Every > nurbs curve is defined by 3 things: > > 1) the control point position + weights > 2) the degree of the curve > 3) the knot-vector > > The control points are 4D points (3d points if you omit weighting > factors). > The degree is a single integer number between 1 and infinity (or 1 and > 11 in the case of Rhino). > And the knot-vector is a list of floating point numbers that controls > the area of influence of individual control points. (it's a bit more > complicated than that, but this is only a flying survey) > > The thing to realise about the knot vector is that the only thing that > matters are the relative ratios of the subsequent numbers. Hence, a > curve with the knot vector: > > {0, 0, 0, 1, 2, 3, 3, 3} > > will look exactly the same as a curve with the same degree and control > points but with the knot vector: > > {10, 10, 10, 11, 12, 13, 13, 13} > > and exactly the same as a curve with the knot vector: > > {0, 0, 0, 2, 4, 6, 6, 6} > > The celebrated domain of the curve is nothing more than the numeric > interval between the first and the last number in the knot-vector. We > can fit the knot-vector into any non-zero domain we wish, because we > can easily scale and offset all the knots so that their relative > ratios remain unmolested. > > If you want a hands on example, create a curve in Rhino (degree=3, 5 > control points, don't make it closed), and use the _List command to > sneak a peek at the knot-vector. Then use the _Reparameterize command > to change the domain and use _List again to see what's changed in the > knot-vector. > > -- > David Rutten > [email protected] > Robert McNeel & Associates > > On Jan 16, 5:35 am, damien_alomar <[email protected]> wrote: > > > Evaluating the curve in more of a geometric matter just requires > > switching out the Evaluate Curve for the Evaluate Length component > > (forgot about that one), and disconnecting the curve domain from the > > random component....the Evaluate length component will default to > > evaluating the curve between 0 and 1, so the standard output of the > > random component is fine > > >http://grasshopper3d.googlegroups.com/web/rndCrvDivLen.jpg?hl=en&gsc=... > > > -Damien > > > On Jan 15, 11:26 pm, damien_alomar <[email protected]> wrote: > > > > Domains are equivalent to the mathematical "length" of the curve. > > > There's a start parameter and an end parameter value and any values in > > > between those two can be solved through the mathematical equations and > > > the control points that dictate the final shape of the curve. The > > > three key things to understand are that the domain does not really > > > relate to the length of the curve at all (although by default when > > > Rhino creates curves it does its best to try and match the domain to > > > the length), the domain of the curve can be reexpressed (ie changed > > > from 0 to 1), and lastly that evenly spaced values in parametric space > > > will not be evenly placed in terms of distance along the curve. > > > > So far the suggested solutions are really over complicating this > > > problem. Right now you guys aren't using the random component as its > > > intended and are thinking of crazy ways to get around it. Random > > > number generators will only generate numbers from 0 to 1, so if you > > > look at the R node you'll find that the random component can except a > > > range and defaults to that 0 to 1 range. Ideally we want to use the > > > domain of our curve to set the range of our random number set. There > > > use to be an explicit Curve Domain component in grasshopper, but it > > > was taken out because David has added the implicit conversions almost > > > everywhere in GH. An implicit conversion is simple the concept that I > > > can feed one data type (a curve for instance) into another data type > > > (a range/domain for instance) and that data type is able to be > > > extracted from another, the it will do so automatically. Because of > > > this, we can just feed our curve directly into the R node and we'll > > > get the domain that is need...no dotNet scripts. After that just feed > > > that to the Curve Parameter component and you're on your way. > > > >http://grasshopper3d.googlegroups.com/web/rndCrvDiv.jpg?hl=en&gsc=Ql9... > > > > The only thing about this solution is that you'll get a higher > > > concentration of points, geometrically speaking, where the parametric > > > space of the curve is more compressed. This kind of makes the > > > randomness jaded, but probably doesn't matter that much. I'll see if > > > there's a way to randomly divide the curve more based on geometric > > > space than parametric. > > > > HTH, > > > Damien > > > > On Jan 15, 8:31 pm, visose <[email protected]> wrote: > > > > > I'll leave that to David. He's a man of much more knowledge. He will > > > > probably have to end up correcting me any way. > > > > :P > > > > > On Jan 16, 1:42 am, Chris Wilkins <[email protected]> wrote: > > > > > > Visose, > > > > > > That worked. You are a man of much knowledge. > > > > > > Can you explain the "reparameterize" and the "domain" of the curves > > > > > any further? > > > > > > Thanks much, > > > > > Chris > > > > > > On Jan 15, 7:29 pm, visose <[email protected]> wrote: > > > > > > > Right-click on the curve component and check 'reparametrize'. It > > > > > > should normalize the domain range from 0 to 1. > > > > > > > On Jan 16, 1:22 am, Chris Wilkins <[email protected]> wrote: > > > > > > > > Baldino, > > > > > > > > I tried building your solution (since I hadn't used the Random > > > > > > > component yet), and found a problem when there are more than 3 > > > > > > > control > > > > > > > points on the curve. I found that the domain of the curve rises > > > > > > > when > > > > > > > more control points are there, and the Evaluate Point on Curve > > > > > > > component would only divide a portion of the curves. Here's a pic > > > > > > > of > > > > > > > that: > > > > > > > >http://groups.google.com/group/grasshopper3d/web/RandomDivideVB1.jpg > > > > > > > (I crossreferenced the input in the last component to show the > > > > > > > five > > > > > > > curves with same random values) > > > > > > > > The domains are listed under each curve and you can see how the > > > > > > > affected portion is shorter when the domain rises over 1. > > > > > > > > I couldn't find a GH component that output the number of control > > > > > > > points, so I tried out the VB component (finally). I got the > > > > > > > domain of > > > > > > > the curve that way and multiplied the random numbers by the > > > > > > > domain to > > > > > > > divide the whole length of the curve. Here's the two additional > > > > > > > components: > > > > > > > >http://groups.google.com/group/grasshopper3d/web/RandomDivideVB2.jpg > > > > > > > (I could only make it do one curve at a time without more > > > > > > > thought). > > > > > > > > Chris > > > > > > > > PS. I have no idea if changing the degree of the curve will mess > > > > > > > this > > > > > > > solution up. I had no idea what "domain" of curve was before this. > > > > > > > > On Jan 15, 12:37 pm, baldino <[email protected]> wrote: > > > > > > > > > this will > > > > > > > > work:http://groups.google.com/group/grasshopper3d/web/divide_crv_randomlen... > > > > > > > > > On Jan 15, 6:15 pm, Alvin <[email protected]> wrote: > > > > > > > > > > Hi, > > > > > > > > > > I'm just getting into Grasshopper and need some initial help. > > > > > > > > > > I would like to divide a curve into a certain # of segments, > > > > > > > > > with each > > > > > > > > > segment being a random length. I cant see how to any of the > > > > > > > > > functions > > > > > > > > > in the curve>division section of grasshopper can do this. > > > > > > > > > Little help > > > > > > > > > please? > > > > > > > > > > thanks much, > > > > > > > > > > Alvin- Hide quoted text - > > > > > > > > > - Show quoted text -- Hide quoted text - > > > > > > > - Show quoted text -- Hide quoted text - > > > - Show quoted text -
