jbuckmccready / cavalier_contours

2D polyline/shape library for offsetting, combining, etc.
Apache License 2.0
144 stars 12 forks source link

Cleaned up and simplified pline spatial index creation #29

Closed jbuckmccready closed 1 year ago

jbuckmccready commented 1 year ago

PlineSource::create_aabb_index and PlineSource::create_approx_aabb_index no longer return an Option since having less than 2 vertexes will now create an empty aabb spatial index. Added docs and made panic message clear regarding case where Self::Num fails to cast to/from a u16 which is required for constructing the index (this should not come up in practice because Self::Num type is decided at compile time so I decided not to return a result and instead just panic with a clear error message).