Curve geometry 2
Last updated
Last updated
Combining the earlier section on ranges with evaluating points on curves we can to produce multiple points on a curve with ease. This results to dividing a curve by equal spaces along its domain. As points have equal parameter distances among one-another we call this iso-parametric division. Note however that the Euclidean distances among the points generated are not equal!
Curve division is a very common geometric operation and it is directly supported through a wide range of division components found in the “curve / division” panel. For instance, divide-by-length selects points at equal “travel lengths” along the curve, divide-by-distance uses equal segment lengths between selected points etc. Curve division to a range of points is also known also as curve segmentation.
Distance Division
Let’s now use the “divide by distance” component and generate some points. You will notice that we cannot control the number of points generated directly as before. The following graph demonstrates how to compute the number of points using the “list length” component. Since ranges are numbered from zero, the total number of elements in [0, max] is max + 1. Zero-based indexing is a constant headache and source of mistakes, so keep that in mind.
Index Visualization
Instead of always using the “panel” component to visualize information, we can also use some of the tools found in the “display” tab. Let’s display in the viewport the index order of points created via curve division. The simplest way is to use the “point list” component which requires a sequence of points and the text size.
Range Indexing
Another very useful operation for ranges is the ability to select (or to index) items from within lists. The animation below shows how this can be performed using the “list item” component. As we have discussed earlier, it is very common to operate on data knowing the location they are stored. Spreadsheets use a column letter and row number indexing scheme. For linear containers of values, such as lists, it makes sense to just use the offset from the start/first position (which is most often zero).
The “list item” component requires a list input and an integer index representing the position of the item along the list to output. The wrap input, controls the behaviour for when the index supplied is outside the valid range i.e. [0, length – 1].
Say for instance you have 4 items but you requested the item at position 6. Well, this makes no sense and generally programming languages will severely complain and/or applications catastrophically fail.
By default wrap is enabled; this causes the selection to work like a clock i.e. after mid-night we start counting again from one. This offers a safety-net preventing the index going “out of bounds”.
Another nice feature of this component is that when we zoom in, we can activate additional outputs of consecutive elements from our base index position. So here for example we also selected the item in the immediately following position “index + 1”. The concept of relative indexing is amazingly powerful and ubiquitous in computing. Relative elements among ranges have very important semantic properties e.g. two consecutive values give us a sense of rate of change or a way to express the idea of neighbourhood among data.
Practice
We looked at relative indexing forward i.e. “+1”. Try to also experiment with relative indexing backwards i.e. “-1”. You can create new outputs by zooming in and selecting the plus/minus buttons above/below the base output value.
What are some curves where being equally divided by domain intervals produce points which are also equally distanced in space? We have already seen some of them and this property makes them indeed very useful.
Produce points using the “divide by distance” component, then create a “polyline” to connect all points. Use the “circle” component to place a circle centred on each point with radius equal to the curve division distance.