-
Notifications
You must be signed in to change notification settings - Fork 318
feat: Add new polyline annotation type #769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: Add new polyline annotation type #769
Conversation
One for the data buffer One for the geometry buffer
I'm having trouble ending polylines with double clicking on a spot in max projection volume rendering in 3d, can other people reproduce this problem? |
I ran into this trouble in large datasets in 3D in general, |
This has incidentally highlighted to me how the chunk loading order is not optimized to be to surrounding the cursor for volume rendering, when laying down points in 3d using max projection this is pretty critical for speed, particularly when zooming and and out and triggering new MIP reloading. |
A polyline is a single annotation that contains one or more lines. They can be added from the UI or from the precomputed format
UI placement
Polylines can be added in the UI via:
enter
backspace
After placing a polyline, deleting vertices is currently not supported. You can move a single vertex via alt clicking on that vertex, or the whole polyline by clicking on any line in the polyline.
Precomputed format
Polylines are stored slightly differently to other precomputed format annotations. They require an additional piece of information, which is the number of vertices in the polyline. As such, the storage format for a single polyline is:
Technical note - handling a variable length annotation
Because all previous annotations were both:
There were a few changes needed for variable length annotations. The strategy chosen in the PR right now is generally that each instance for rendering is a fixed size, but not the annotation itself. So a polyline would have a variable number of instances depending on the length of the polyline, but each of those instances is a fixed size for the buffer.
This leads to a bit of data duplication in the buffer, as the properties for a polyline are per polyline, not per vertex or per line -- but those properties are copied per line instance of the polyline.
As such, changes across the annotation handling are setup for polylines specifically. Perhaps if another variable length annotation type is added in the future, this polyline handling could be made a little more generic and a variable length annotation handling could be added. In some places, this has already been setup in a generic way, but didn't want to risk an overdesign for a possible future addition