implementing dynamic level of detail for a space curve

Hello all! I am new to the forums, but I have been playing with VTK with C++/Qt for a few months now. I am quite impressed by the library!

I am interested in rendering 3D “space-curves” (lines) that are derived from vector graphics, comprised of straight line segments, circular arc segments, and bezier curves. Obviously I can approximate these curves as polylines suitable for rendering, but my question is about rendering with dynamic level of detail such that the curves always appear smooth.

Is there a way to have VTK intelligent manage a form of “mip-mapped” vertex data for rendering with different levels of resolution given the proximity to the camera? I imagine that this is vaguely analogous to rendering high resolution point cloud data, where when zoomed out it may be rendering a different lower resolution set of points.

I could see this being tricky to implement, especially when portions of the contour are near the camera while other portions are far away… You’d have to potentially do many render calls referencing different slices of the level-of-detail vertex arrays. For example, if a continuous spiral were rotated in the view such that the camera is near one outer edge, there might be a “pizza slice” of many turns of the spiral near the camera, but to isolated the contour where it intersects the slice would be a function of how many turns the spiral has.

I’d appreciate any thoughts on this!

Here are some screenshots of the same space curve shown from different perspectives, you can see the vertices when it is close to the camera:


How many primitives (i.e., line segments) are you expecting to render in any given frame? i.e., are you rendering a giant bowl of spaghetti (millions of curves) or just several hundred/thousand curves? Given today’s graphics hardware, the very simple approach to just crank up the resolution everywhere may be enough (with decent performance), or as a hybrid solution, use the minimum distance to each curve (which may require the use of a locator or equivalent). We have created adaptive rendering processes in the past for higher-order finite elements (see this) which may provide some hints as to how to proceed - but this approach takes a fair amount of work.

The complexity of the scene depends on the dataset, but I would count on the “bowl of spaghetti” scenario. Typically, there is varying complexity but it is relatively planar and not tangled in 3D. As far as the actual amount of them, I would need to support at least 50 thousand curves, but each curve would need to support being zoomed while still being smooth. This is why I am asking about the “mip-mapping”…

The issue is that any given curve may be leaving a local are and coming back, so the level-of-detail wouldn’t be applied to the chain as a whole but rather segments that enter into the local area.

Here is a basic example of a CNC toolpath that is a continuous space curve:

https://a.fsdn.com/con/app/proj/emc/screenshots/44896.jpg