Curve Evaluation and Song of the Gulls

Below, we take a look at one aspect of parametric NURB spline curve evaluation and an overview of recent AEC DevBlog posts.

First, however, another update on my vacation :-)

Marvels of the Song of the Gulls

I am winding up my vacation on the Island of Ischia that I first discovered three years back.

It is one of my favourite places in the world, where I visited natural wonders such as hot thermal springs of Sorgeto in Panza, where you can build your own bathtub to mix the hot spring water with the cold waves from the sea, and the antique natural roman bath of Cavascura on the Maronti Beach that includes a natural sauna in hewn rock that has been running uninterrupted for 3000 years.

On the way here, I first got off at the wrong ferry stop in Procida. That also proved very nice, with all the families taking their numerous kids for a Sunday walk, to chat and play in the main square.

View from Piano Liguori towards Procida and Naples

From the ferry, I walked up to the Chiesa della Annunziata and on to the Piano Liguori and then explored the peninsula of San Pancrazio with its spectacular old church and caves. Here is the view from Piano Liguori back towards Procida and Naples.

Cave of San Pancrazio

I visited the Trani family restaurant, olives and vineyard. They even built their own staircase access to the sea, tunnelling through the almost vertical rock facing the water.

Rock staircase and tunnel down to the sea

It was a huge pleasure chatting with one of the Trani sons and listening to his joy over the traditional agricultural work amidst the 'canto dei gabbiani', the song of the gulls, and the challenges of making it economically viable through some interaction with tourism.

I later saw this wonderful example of a scalable implementation and thinking outside the box:

Scalable water box

Parametric NURB Spline Curve Evaluation

Question: I use the Curve.Evaluate method to obtain equally spaced points along a curve.

This works fine for most curve types, but not on a NURB Spline that I created.

When I evaluate with regularly incremented parameter values, e.g. 0, .2, .4, .6, .8 and 1, the distances of the resulting positions along the curve are not visually equal. Using the same curve to create a ruled surface shows the lines and points appearing where one would expect.

Here is an example with the green lines displayed where ruled lines on the face occur, and text letters at the locations returned by the evaluate function:

NURB spline evaluation

Answer: The parameterisation of a NURB spline is such that regions of strong curvature are 'longer' in the parameter space than the actual curve length.

The assumption that a parameter measures uniformly along its length can only be made for lines and arcs. For ellipses and splines the parameter does not typically follow this pattern, because of the mathematics involved.

This is mentioned in the Developer Guide description of the parameter used in curve parameterisation:

"A ‘normalized’ parameter. The start value of the parameter is 0.0, and the end value is 1.0. For some curve types, this makes evaluation of the curve along its extents very easy; for example, the midpoint of a line is at parameter 0.5. (Note that for more complex curve equations like Splines this assumption cannot always be made)."

It is also explained in more detail in the Wikihelp community article on points hosted on curve edges.

The Revit Geometry API currently does not offer the ability to measure by segment-length or normalized segment-length. If it did, a more iterative solution would be easy to describe.

Recent AEC DevBlog Overview

Here is an overview of some of the posts by my colleagues on the AEC DevBlog in the past few weeks: