Switch attribute-based vector data from referencing PointIds to indexes in the points table (#1949)

* Index for points

* Code review

* Add todo comment about a possible perf optimization

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
James Lindsay
2024-09-04 09:59:55 +01:00
committed by GitHub
parent 19541c9684
commit 9524835a30
8 changed files with 326 additions and 135 deletions

View File

@@ -10,7 +10,7 @@ impl<PointId: crate::Identifier> Subpath<PointId> {
/// A `Subpath` with less than 2 [ManipulatorGroup]s may not be closed.
#[track_caller]
pub fn new(manipulator_groups: Vec<ManipulatorGroup<PointId>>, closed: bool) -> Self {
assert!(!closed || manipulator_groups.len() > 1, "A closed Subpath must contain more than 1 ManipulatorGroup.");
assert!(!closed || !manipulator_groups.is_empty(), "A closed Subpath must contain more than 0 ManipulatorGroups.");
Self { manipulator_groups, closed }
}