From: Matt Leotta <mleotta@le...>  20040927 16:06:27

On Sun, 20040926 at 16:23, Peter Vanroose wrote: > I must say I don't see the purpose of the new vsol_digital_curve_2d class. > Digital geometry already exists  it was placed in a separate library > (vdgl) but that library conceptually belongs to vsol. > > The main difference between the old vdgl_digital_curve and the new > vsol_digital_curve_2d is the fact that the new one uses refcounted > vsol_point_2d's as guide points instead of pairs of double. > Which makes it less useful for dense points (which is the main use of vdgl). The guide points in vdgl are actually more that pairs of doubles. They are edgels, which are pairs of doubles with two more doubles for gradient and orientation (4 doubles at each point). This is really targeted towards use in edge detection. In addition these points are stored in edgel chains, which are maintained by an interpolator object, which is contained within a vdgl_digital_curve. So you have dig through three layers of abstraction if you want to get to the actual point set. The intent of the vsol_digital_curve_2d was to remove the additional edge detection information and allow more direct access to underlying points while still allowing for the concept of a continuous structure via interpolation. > > But with sparse guide points, I don't see a difference between the new > vsol_digital_curve_2d and the class vsol_polyline_2d. The current difference is that vsol_digital_curve_2d supports interpolation at an arbitrary floating point index along the curve. Currently interpolation is linear, but we would like to find a way to abstractly allow a choice of interpolation function with out all the mess of the extra layers in vdgl. There is also some additional functionality to find the closest point to the curve and to split the curve at an arbitrary point. Currently vsol_polyline_2d is a simplification of vsol_digital_curve_2d. > > Hence my question: do we need this new class? It is just causing > confusion with the existing digital geometry in vdgl (e.g., by its > replacement of cast_to_digital_curve()). We (Brown) are using vsol_digital_curve_2d for dense points (often converting vdgl_digital_curve to vsol_digital_curve_2d). We also hope to add a similar vsol_digital_curve_3d based on the same concepts. There is no concept of a 3D edgel, and we want the 2D and 3D implementations to be similar. Ultimately the vsol_polyline_2d might not be need. It has a subset of the functionality of vsol_digital_curve_2d. However, I assume it should be left for now since it is commonly used for sparse points producing a set of connected line segments. We may ultimately switch to higher order interpolation and we don't want this to cause problems for those who use a polyline and expect to get linear segments. Matt Leotta 