Sign in

    LING71671/moon_strtree/src/api does not have a README file

    Box3D

    Re-export canonical geometry types without allocation or conversion wrappers.

    Box4D

    Re-export canonical geometry types without allocation or conversion wrappers.

    Rect

    Re-export canonical geometry types without allocation or conversion wrappers.

    SpatialPredicate

    Re-export canonical geometry types without allocation or conversion wrappers.

    ClusterResult

    pub struct ClusterResult {
    labels : Array[Int]
    num_clusters : Int
    num_noise : Int
    cluster_sizes : Array[Int]
    } derive(Default, Eq,
    Debug
    )

    Result of spatial density-based clustering (DBSCAN).

    ClusterResult::default

    fn ClusterResult::default() -> ClusterResult

    ClusterResult::equal

    ClusterResult::not_equal

    fn ClusterResult::not_equal(x : ClusterResult, y : ClusterResult) -> Bool

    CompactClusterResult

    pub struct CompactClusterResult {
    item_ids : Array[Int]
    labels : Array[Int]
    num_clusters : Int
    num_noise : Int
    cluster_sizes : Array[Int]
    } derive(Default, Eq,
    Debug
    )

    DBSCAN result aligned with item_ids instead of allocating up to the largest user ID.

    CompactClusterResult::default

    CompactClusterResult::equal

    CompactClusterResult::not_equal

    FlatBuffers

    pub struct FlatBuffers {
    // private fields
    } derive(Default, Eq,
    Debug
    )

    Raw contiguous array buffers of a packed StrTree for persistence with independently owned array copies.

    FlatBuffers::default

    fn FlatBuffers::default() -> FlatBuffers

    FlatBuffers::equal

    fn FlatBuffers::equal(FlatBuffers, FlatBuffers) -> Bool

    FlatBuffers::not_equal

    fn FlatBuffers::not_equal(x : FlatBuffers, y : FlatBuffers) -> Bool

    FlatBuffers3D

    pub struct FlatBuffers3D {
    // private fields
    } derive(Default, Eq,
    Debug
    )

    Raw contiguous array buffers of a packed StrTree3D for persistence with independently owned array copies.

    FlatBuffers3D::default

    fn FlatBuffers3D::default() -> FlatBuffers3D

    FlatBuffers3D::equal

    FlatBuffers3D::not_equal

    fn FlatBuffers3D::not_equal(x : FlatBuffers3D, y : FlatBuffers3D) -> Bool

    GeofenceEvent

    pub(all) enum GeofenceEvent {
    Enter(Int, Int)
    Exit(Int, Int)
    Stay(Int, Int)
    } derive(Eq,
    Debug
    )

    Discrete transition event emitted when an entity crosses or resides within a geofence.

    GeofenceEvent::equal

    GeofenceEvent::fence_id

    fn GeofenceEvent::fence_id(self : GeofenceEvent) -> Int

    Extracts the target geofence ID.

    GeofenceEvent::item_id

    fn GeofenceEvent::item_id(self : GeofenceEvent) -> Int

    Extracts the moving entity ID.

    GeofenceEvent::not_equal

    fn GeofenceEvent::not_equal(x : GeofenceEvent, y : GeofenceEvent) -> Bool

    GeofenceEvent::to_string

    fn GeofenceEvent::to_string(self : GeofenceEvent) -> String

    Formats geofence transition event.

    GeofenceMonitor

    pub struct GeofenceMonitor {
    // private fields
    } derive(Default, Eq,
    Debug
    )

    State tracker monitoring moving entity positions against a spatial index of geofences.

    GeofenceMonitor::active_fences

    fn GeofenceMonitor::active_fences(self : GeofenceMonitor, item_id : Int) -> Array[Int]

    Returns currently active geofence IDs occupied by the entity.

    GeofenceMonitor::clear

    fn GeofenceMonitor::clear(self : GeofenceMonitor) -> Unit

    Clears all tracked entities.

    GeofenceMonitor::default

    GeofenceMonitor::equal

    GeofenceMonitor::is_in_fence

    fn GeofenceMonitor::is_in_fence(self : GeofenceMonitor, item_id : Int, fence_id : Int) -> Bool

    Returns true if the entity is currently tracked inside the specified geofence.

    GeofenceMonitor::new

    Instantiates a new GeofenceMonitor indexing the supplied geofence bounding boxes.

    GeofenceMonitor::not_equal

    fn GeofenceMonitor::not_equal(x : GeofenceMonitor, y : GeofenceMonitor) -> Bool

    GeofenceMonitor::remove_item

    fn GeofenceMonitor::remove_item(self : GeofenceMonitor, item_id : Int) -> Array[GeofenceEvent]

    Unregisters tracked entity and returns Exit events for all fences it was previously inside.

    GeofenceMonitor::tracked_count

    fn GeofenceMonitor::tracked_count(self : GeofenceMonitor) -> Int

    Returns the number of currently tracked entities.

    GeofenceMonitor::update_point

    fn GeofenceMonitor::update_point(self : GeofenceMonitor, item_id : Int, x : Double, y : Double) -> Array[GeofenceEvent]

    Updates entity position with a 2D point coordinate (x, y) and returns generated events.

    GeofenceMonitor::update_rect

    Updates entity position with a 2D bounding rectangle and returns generated transition events.

    GridCell

    pub struct GridCell {
    col : Int
    row : Int
    count : Int
    bounds :
    Rect

    } derive(Default, Eq,
    Debug
    )

    A discrete 2D spatial grid cell with item density count and bounding rectangle.

    GridCell::default

    fn GridCell::default() -> GridCell

    GridCell::equal

    fn GridCell::equal(GridCell, GridCell) -> Bool

    GridCell::not_equal

    fn GridCell::not_equal(x : GridCell, y : GridCell) -> Bool

    GridCell::to_repr

    GridDensitySummary

    pub struct GridDensitySummary {
    cells : Array[GridCell]
    total_cells : Int
    max_density : Int
    avg_density : Double
    hotspot_cells : Array[GridCell]
    } derive(Default, Eq,
    Debug
    )

    Aggregated spatial grid density summary and hotspot metrics.

    GridDensitySummary::default

    GridDensitySummary::equal

    GridDensitySummary::not_equal

    Point2D

    pub struct Point2D {
    x : Double
    y : Double
    } derive(Default, Eq,
    Debug
    )

    A 2D point coordinate representing a polygon vertex.

    Point2D::default

    fn Point2D::default() -> Point2D

    Point2D::distance_to

    fn Point2D::distance_to(self : Point2D, other : Point2D) -> Double

    Computes Euclidean distance to another 2D point.

    Point2D::equal

    fn Point2D::equal(Point2D, Point2D) -> Bool

    Point2D::new

    fn Point2D::new(x : Double, y : Double) -> Point2D

    Creates a new 2D point coordinate.

    Point2D::not_equal

    fn Point2D::not_equal(x : Point2D, y : Point2D) -> Bool

    Point2D::to_repr

    Polygon2D

    pub struct Polygon2D {
    vertices : Array[Point2D]
    } derive(Default, Eq,
    Debug
    )

    A 2D polygonal planar curve or ring defined by sequential vertices.

    Polygon2D::area

    fn Polygon2D::area(self : Polygon2D) -> Double

    Computes the planar signed/unsigned area using Green's theorem / Shoelace formula.

    Polygon2D::centroid

    fn Polygon2D::centroid(self : Polygon2D) -> Point2D

    Computes the planar geometric centroid of the polygon.

    Polygon2D::clip_convex

    fn Polygon2D::clip_convex(self : Polygon2D, clip_poly : Polygon2D) -> Polygon2D

    Sutherland-Hodgman polygon clipping against an arbitrary convex polygon.

    Polygon2D::clip_rect

    Sutherland-Hodgman polygon clipping against an axis-aligned rectangular bounding box.

    Polygon2D::contains_point

    fn Polygon2D::contains_point(self : Polygon2D, px : Double, py : Double) -> Bool

    Tests whether a point (px, py) is contained within the polygon boundary.

    Polygon2D::default

    fn Polygon2D::default() -> Polygon2D

    Polygon2D::envelope

    Returns the minimum axis-aligned bounding box (AABB) enveloping all vertices.

    Polygon2D::equal

    fn Polygon2D::equal(Polygon2D, Polygon2D) -> Bool

    Polygon2D::new

    fn Polygon2D::new(vertices : Array[Point2D]) -> Polygon2D

    Creates a new Polygon2D from an ordered array of 2D vertices.

    Polygon2D::not_equal

    fn Polygon2D::not_equal(x : Polygon2D, y : Polygon2D) -> Bool

    Polygon2D::perimeter

    fn Polygon2D::perimeter(self : Polygon2D) -> Double

    Computes total boundary perimeter length of the closed polygon.

    Rng

    pub struct Rng {
    // private fields
    } derive(Default, Eq,
    Debug
    )

    Deterministic Linear Congruential Generator.

    Rng::default

    fn Rng::default() -> Rng

    Rng::equal

    fn Rng::equal(Rng, Rng) -> Bool

    Rng::new

    fn Rng::new(seed : Int) -> Rng

    Constructs an Rng with initial seed.

    Rng::not_equal

    fn Rng::not_equal(x : Rng, y : Rng) -> Bool

    Rng::to_repr

    StrMeshTree3D

    pub struct StrMeshTree3D {
    // private fields
    } derive(Default, Eq,
    Debug
    )

    Packed 3D spatial index for polygonal triangle meshes with accelerated ray-tracing and segment intersection.

    StrMeshTree3D::build

    fn StrMeshTree3D::build(triangles : Array[Triangle3D], node_capacity? : Int) -> StrMeshTree3D

    Builds a packed 3D mesh index from an array of Triangle3D primitives.

    StrMeshTree3D::default

    fn StrMeshTree3D::default() -> StrMeshTree3D

    StrMeshTree3D::equal

    StrMeshTree3D::get_triangle

    fn StrMeshTree3D::get_triangle(self : StrMeshTree3D, id : Int) -> Triangle3D

    Retrieves triangle primitive by index.

    StrMeshTree3D::not_equal

    fn StrMeshTree3D::not_equal(x : StrMeshTree3D, y : StrMeshTree3D) -> Bool

    StrMeshTree3D::num_triangles

    fn StrMeshTree3D::num_triangles(self : StrMeshTree3D) -> Int

    Returns total number of indexed mesh triangles.

    StrMeshTree3D::query_all_ray_hits

    fn StrMeshTree3D::query_all_ray_hits(self : StrMeshTree3D, ox : Double, oy : Double, oz : Double, dx : Double, dy : Double, dz : Double, max_distance? : Double) -> Array[(Int, Double)]

    Traces a ray and returns all intersecting triangle IDs and hit distances t, sorted by distance ascending.

    StrMeshTree3D::query_box

    Queries triangle candidates intersecting a 3D bounding box.

    StrMeshTree3D::query_first_ray_hit

    fn StrMeshTree3D::query_first_ray_hit(self : StrMeshTree3D, ox : Double, oy : Double, oz : Double, dx : Double, dy : Double, dz : Double, max_distance? : Double) -> (Int, Double)?

    Traces a ray and returns the closest intersecting triangle ID and distance t, or None if missed.

    StrMeshTree3D::query_segment

    fn StrMeshTree3D::query_segment(self : StrMeshTree3D, x1 : Double, y1 : Double, z1 : Double, x2 : Double, y2 : Double, z2 : Double) -> Array[Int]

    Queries mesh triangles that precisely intersect a 3D line segment.

    StrPolygonIndex

    pub struct StrPolygonIndex {
    // private fields
    } derive(Default, Eq,
    Debug
    )

    A packed spatial index managing collections of 2D polygonal planar shapes.

    StrPolygonIndex::build

    fn StrPolygonIndex::build(polygons : Array[Polygon2D], node_capacity? : Int) -> StrPolygonIndex

    Builds a packed StrPolygonIndex from an array of 2D polygons and optional node capacity.

    StrPolygonIndex::default

    StrPolygonIndex::envelope

    Returns the global bounding envelope encompassing all indexed polygons.

    StrPolygonIndex::equal

    StrPolygonIndex::not_equal

    fn StrPolygonIndex::not_equal(x : StrPolygonIndex, y : StrPolygonIndex) -> Bool

    StrPolygonIndex::query_clipped_polygons

    Hierarchically queries polygons intersecting the window and clips each with Sutherland-Hodgman, returning only valid planar fragments strictly contained inside the window.

    StrPolygonIndex::query_count

    Returns the count of candidate polygons intersecting the query window without allocating a result array.

    StrPolygonIndex::query_polygons

    Retrieves all full Polygon2D instances intersecting the query window.

    StrPolygonIndex::query_window

    Queries polygon indices whose bounding envelopes intersect the query window.

    StrPolygonIndex::total_polygons

    fn StrPolygonIndex::total_polygons(self : StrPolygonIndex) -> Int

    Returns total count of indexed polygons.

    StrTree

    pub struct StrTree {
    // private fields
    } derive(Default, Eq,
    Debug
    )

    Packed 2D spatial index tree with contiguous flat array storage.

    StrTree::aggregate_grid

    fn StrTree::aggregate_grid(self : StrTree, cell_width : Double, cell_height : Double, hotspot_threshold? : Int) -> GridDensitySummary

    Partitions spatial items into uniform rectangular grid cells and computes density distribution.

    StrTree::build

    fn StrTree::build(items : Array[(
    Rect
    , Int)], node_capacity? : Int) -> StrTree

    Builds a packed StrTree from an array of (Rect, ID) pairs and optional node capacity.

    StrTree::build_coordinates

    fn StrTree::build_coordinates(coordinates : Array[Double], node_capacity? : Int) -> StrTree

    Builds normalized rectangles from [minX, minY, maxX, maxY] coordinates. IDs are their zero-based input positions. Length must be divisible by four.

    StrTree::dbscan

    fn StrTree::dbscan(self : StrTree, eps : Double, min_pts : Int) -> ClusterResult

    Performs spatial index-accelerated Density-Based Spatial Clustering of Applications with Noise (DBSCAN).

    StrTree::dbscan_compact

    fn StrTree::dbscan_compact(self : StrTree, eps : Double, min_pts : Int) -> CompactClusterResult

    StrTree::default

    fn StrTree::default() -> StrTree

    StrTree::envelope

    Returns the bounding envelope enclosing the root node of the tree.

    StrTree::equal

    fn StrTree::equal(StrTree, StrTree) -> Bool

    StrTree::from_flat_buffers

    fn StrTree::from_flat_buffers(buffers : FlatBuffers) -> StrTree

    Reconstructs a StrTree directly from raw contiguous array buffers.

    StrTree::from_flat_buffers_checked

    fn StrTree::from_flat_buffers_checked(buffers : FlatBuffers) -> StrTree?

    Restores only buffers with valid topology, metadata and finite bounds.

    StrTree::not_equal

    fn StrTree::not_equal(x : StrTree, y : StrTree) -> Bool

    StrTree::query

    fn StrTree::query(self : StrTree, search_window :
    Rect
    ) -> Array[Int]

    Performs axis-aligned bounding box range intersection query using iterative stack DFS.

    StrTree::query_circle

    fn StrTree::query_circle(self : StrTree, cx : Double, cy : Double, radius : Double) -> Array[Int]

    Performs circular / radius range query using iterative stack DFS. Returns item IDs of all indexed elements whose bounding boxes intersect the circle.

    StrTree::query_circle_count

    fn StrTree::query_circle_count(self : StrTree, cx : Double, cy : Double, radius : Double) -> Int

    Performs circular / radius range counting with zero result allocation.

    StrTree::query_count

    fn StrTree::query_count(self : StrTree, search_window :
    Rect
    ) -> Int

    Performs axis-aligned bounding box range intersection counting with zero result allocation.

    StrTree::query_first

    fn StrTree::query_first(self : StrTree, search_window :
    Rect
    , predicate : (Int) -> Bool) -> Int?

    Returns the first item ID intersecting search_window that satisfies the predicate, or None.

    StrTree::query_into

    fn StrTree::query_into(self : StrTree, search_window :
    Rect
    , results : Array[Int], stack : Array[Int]) -> Unit

    Clears and reuses distinct caller-owned result and traversal buffers.

    StrTree::query_knn

    fn StrTree::query_knn(self : StrTree, x : Double, y : Double, k : Int) -> Array[Int]

    Performs branch-and-bound k-Nearest Neighbor (k-NN) search. Returns at most k item IDs sorted by ascending Euclidean distance to (x, y).

    StrTree::query_knn_with_distance

    fn StrTree::query_knn_with_distance(self : StrTree, x : Double, y : Double, k : Int) -> Array[(Int, Double)]

    Performs branch-and-bound k-Nearest Neighbor (k-NN) search. Returns at most k pairs (item_id, squared_distance) sorted by ascending Euclidean distance to (x, y).

    StrTree::query_knn_with_predicate

    fn StrTree::query_knn_with_predicate(self : StrTree, x : Double, y : Double, k : Int, predicate : (Int) -> Bool) -> Array[Int]

    Performs branch-and-bound k-Nearest Neighbor (k-NN) search filtered by user predicate. Returns at most k item IDs satisfying predicate(id), sorted by ascending Euclidean distance to (x, y).

    StrTree::query_knn_with_predicate_and_distance

    fn StrTree::query_knn_with_predicate_and_distance(self : StrTree, x : Double, y : Double, k : Int, predicate : (Int) -> Bool) -> Array[(Int, Double)]

    Performs branch-and-bound k-Nearest Neighbor (k-NN) search filtered by user predicate. Returns at most k pairs (item_id, squared_distance) satisfying predicate(id), sorted by ascending Euclidean distance to (x, y).

    StrTree::query_point

    fn StrTree::query_point(self : StrTree, x : Double, y : Double) -> Array[Int]

    Performs point inclusion query using iterative stack DFS.

    StrTree::query_point_count

    fn StrTree::query_point_count(self : StrTree, x : Double, y : Double) -> Int

    Performs point inclusion counting without allocating a result array.

    StrTree::query_segment

    fn StrTree::query_segment(self : StrTree, x1 : Double, y1 : Double, x2 : Double, y2 : Double) -> Array[Int]

    Performs line segment / ray intersection query using iterative stack DFS. Returns item IDs of all indexed elements whose bounding boxes intersect the segment (x1, y1) -> (x2, y2).

    StrTree::query_spatial_predicate

    Queries the spatial index using a named DE-9IM topological predicate.

    StrTree::query_with_predicate

    fn StrTree::query_with_predicate(self : StrTree, search_window :
    Rect
    , predicate : (Int) -> Bool) -> Array[Int]

    Performs axis-aligned bounding box range intersection query with filter predicate.

    StrTree::spatial_join

    fn StrTree::spatial_join(self : StrTree, other : StrTree) -> Array[(Int, Int)]

    Performs dual-tree hierarchical spatial join between two StrTree indexes. Returns all pairs of item IDs (id_a, id_b) whose bounding boxes intersect.

    StrTree::spatial_join_predicate

    fn StrTree::spatial_join_predicate(self : StrTree, other : StrTree, predicate :
    SpatialPredicate
    ) -> Array[(Int, Int)]

    Performs hierarchical spatial join between two trees filtering by a named topological predicate.

    StrTree::stats

    fn StrTree::stats(self : StrTree) -> TreeStats

    Computes structural diagnostic metrics from a StrTree.

    StrTree::to_flat_buffers

    fn StrTree::to_flat_buffers(self : StrTree) -> FlatBuffers

    Exports raw contiguous array buffers for serialization.

    StrTree::to_repr

    StrTree::validate_integrity

    fn StrTree::validate_integrity(self : StrTree) -> Bool

    Checks raw topology, metadata and finite geometric enclosures.

    StrTree3D

    pub struct StrTree3D {
    // private fields
    } derive(Default, Eq,
    Debug
    )

    Packed 3D spatial index tree with contiguous flat array storage.

    StrTree3D::build

    fn StrTree3D::build(items : Array[(
    Box3D
    , Int)], node_capacity? : Int) -> StrTree3D

    Builds a packed 3D StrTree from an array of (Box3D, ID) pairs and optional node capacity.

    StrTree3D::dbscan

    fn StrTree3D::dbscan(self : StrTree3D, eps : Double, min_pts : Int) -> ClusterResult

    Performs spatial index-accelerated 3D DBSCAN clustering.

    StrTree3D::dbscan_compact

    fn StrTree3D::dbscan_compact(self : StrTree3D, eps : Double, min_pts : Int) -> CompactClusterResult

    StrTree3D::default

    fn StrTree3D::default() -> StrTree3D

    StrTree3D::equal

    fn StrTree3D::equal(StrTree3D, StrTree3D) -> Bool

    StrTree3D::from_flat_buffers

    fn StrTree3D::from_flat_buffers(buffers : FlatBuffers3D) -> StrTree3D

    Reconstructs a StrTree3D directly from raw contiguous array buffers.

    StrTree3D::from_flat_buffers_checked

    fn StrTree3D::from_flat_buffers_checked(buffers : FlatBuffers3D) -> StrTree3D?

    Restores only buffers with valid topology, metadata and finite bounds.

    StrTree3D::not_equal

    fn StrTree3D::not_equal(x : StrTree3D, y : StrTree3D) -> Bool

    StrTree3D::query

    Performs 3D range query using iterative stack DFS traversal.

    StrTree3D::query_count

    fn StrTree3D::query_count(self : StrTree3D, search_box :
    Box3D
    ) -> Int

    Counts intersecting items without materializing result IDs; traversal uses a temporary stack.

    StrTree3D::query_first

    fn StrTree3D::query_first(self : StrTree3D, search_box :
    Box3D
    , predicate : (Int) -> Bool) -> Int?

    Performs 3D range intersection query returning first matching item ID satisfying predicate.

    StrTree3D::query_knn

    fn StrTree3D::query_knn(self : StrTree3D, x : Double, y : Double, z : Double, k : Int) -> Array[Int]

    Performs branch-and-bound k-Nearest Neighbor (k-NN) search in 3D Euclidean space.

    StrTree3D::query_knn_with_distance

    fn StrTree3D::query_knn_with_distance(self : StrTree3D, x : Double, y : Double, z : Double, k : Int) -> Array[(Int, Double)]

    Performs branch-and-bound 3D k-NN search returning pairs of (item_id, squared_distance).

    StrTree3D::query_knn_with_predicate

    fn StrTree3D::query_knn_with_predicate(self : StrTree3D, x : Double, y : Double, z : Double, k : Int, predicate : (Int) -> Bool) -> Array[Int]

    Performs branch-and-bound 3D k-NN search filtered by a user predicate closure.

    StrTree3D::query_knn_with_predicate_and_distance

    fn StrTree3D::query_knn_with_predicate_and_distance(self : StrTree3D, x : Double, y : Double, z : Double, k : Int, predicate : (Int) -> Bool) -> Array[(Int, Double)]

    Performs branch-and-bound 3D k-NN search with predicate and distance pairs.

    StrTree3D::query_point

    fn StrTree3D::query_point(self : StrTree3D, x : Double, y : Double, z : Double) -> Array[Int]

    Performs 3D point containment query.

    StrTree3D::query_point_count

    fn StrTree3D::query_point_count(self : StrTree3D, x : Double, y : Double, z : Double) -> Int

    Counts items containing a point without materializing result IDs; traversal uses a temporary stack.

    StrTree3D::query_segment

    fn StrTree3D::query_segment(self : StrTree3D, x1 : Double, y1 : Double, z1 : Double, x2 : Double, y2 : Double, z2 : Double) -> Array[Int]

    Performs 3D line segment / ray intersection query using iterative stack DFS.

    StrTree3D::query_sphere

    fn StrTree3D::query_sphere(self : StrTree3D, cx : Double, cy : Double, cz : Double, radius : Double) -> Array[Int]

    Performs 3D sphere range intersection query.

    StrTree3D::query_sphere_count

    fn StrTree3D::query_sphere_count(self : StrTree3D, cx : Double, cy : Double, cz : Double, radius : Double) -> Int

    Counts sphere intersections without materializing result IDs; traversal uses a temporary stack.

    StrTree3D::query_with_predicate

    fn StrTree3D::query_with_predicate(self : StrTree3D, search_box :
    Box3D
    , predicate : (Int) -> Bool) -> Array[Int]

    Performs 3D range intersection query with filter predicate.

    StrTree3D::spatial_join

    fn StrTree3D::spatial_join(self : StrTree3D, other : StrTree3D) -> Array[(Int, Int)]

    Performs dual-tree hierarchical spatial join between two StrTree3D indexes.

    StrTree3D::stats

    fn StrTree3D::stats(self : StrTree3D) -> TreeStats3D

    Computes structural diagnostic metrics for 3D StrTree.

    StrTree3D::to_flat_buffers

    fn StrTree3D::to_flat_buffers(self : StrTree3D) -> FlatBuffers3D

    Exports raw contiguous array buffers from StrTree3D.

    StrTree4D

    pub struct StrTree4D {
    // private fields
    } derive(Default, Eq,
    Debug
    )

    Packed 4D spatiotemporal index tree with contiguous flat array storage.

    StrTree4D::build

    fn StrTree4D::build(items : Array[(
    Box4D
    , Int)], node_capacity? : Int) -> StrTree4D

    Builds a packed 4D StrTree from an array of (Box4D, ID) pairs and optional node capacity.

    StrTree4D::default

    fn StrTree4D::default() -> StrTree4D

    StrTree4D::equal

    fn StrTree4D::equal(StrTree4D, StrTree4D) -> Bool

    StrTree4D::not_equal

    fn StrTree4D::not_equal(x : StrTree4D, y : StrTree4D) -> Bool

    StrTree4D::query

    Performs 4D range intersection query using iterative stack DFS traversal.

    StrTree4D::query_count

    fn StrTree4D::query_count(self : StrTree4D, search_box :
    Box4D
    ) -> Int

    Counts intersecting items without materializing result IDs; traversal uses a temporary stack.

    StrTree4D::query_point

    fn StrTree4D::query_point(self : StrTree4D, x : Double, y : Double, z : Double, t : Double) -> Array[Int]

    Performs 4D point containment query.

    StrTree4D::query_time_slice

    fn StrTree4D::query_time_slice(self : StrTree4D, t : Double, box_3d :
    Box3D
    ) -> Array[Int]

    Queries 3D spatial region at specific time instant t.

    StrTree4D::stats

    fn StrTree4D::stats(self : StrTree4D) -> TreeStats4D

    Computes structural diagnostic metrics for 4D StrTree.

    StreamingTrajectoryCompressor

    pub struct StreamingTrajectoryCompressor {
    // private fields
    } derive(Eq,
    Debug
    )

    Online streaming trajectory compressor performing real-time decimation against error tolerance.

    StreamingTrajectoryCompressor::compression_ratio

    fn StreamingTrajectoryCompressor::compression_ratio(self : StreamingTrajectoryCompressor) -> Double

    Computes point decimation percentage ((1 - emitted / received) * 100).

    StreamingTrajectoryCompressor::finish

    Flushes the remaining trajectory stream and returns all preserved decimated waypoints.

    StreamingTrajectoryCompressor::new

    fn StreamingTrajectoryCompressor::new(epsilon : Double, use_sed? : Bool) -> StreamingTrajectoryCompressor

    Instantiates an online trajectory compressor with error bound epsilon and optional SED calculation.

    StreamingTrajectoryCompressor::not_equal

    StreamingTrajectoryCompressor::push

    Ingests a new trajectory waypoint and returns any newly finalized anchor waypoints.

    StreamingTrajectoryCompressor::total_emitted

    Returns total number of finalized waypoints emitted so far.

    StreamingTrajectoryCompressor::total_received

    Returns total number of incoming points received so far.

    TrajectoryPoint

    pub struct TrajectoryPoint {
    x : Double
    y : Double
    t : Double
    track_id : Int
    } derive(Default, Eq,
    Debug
    )

    A timestamped 2D trajectory waypoint coordinate.

    TrajectoryPoint::default

    TrajectoryPoint::equal

    TrajectoryPoint::new

    fn TrajectoryPoint::new(x : Double, y : Double, t : Double, track_id : Int) -> TrajectoryPoint

    Creates a new timestamped trajectory waypoint.

    TrajectoryPoint::not_equal

    fn TrajectoryPoint::not_equal(x : TrajectoryPoint, y : TrajectoryPoint) -> Bool

    TrajectorySegment

    pub struct TrajectorySegment {
    p0_x : Double
    p0_y : Double
    p0_t : Double
    p1_x : Double
    p1_y : Double
    p1_t : Double
    track_id : Int
    segment_id : Int
    } derive(Default, Eq,
    Debug
    )

    A directed 2D trajectory segment connecting two consecutive waypoints in spacetime.

    TrajectorySegment::bounding_rect

    Computes 2D spatial bounding box enclosing the trajectory segment.

    TrajectorySegment::default

    TrajectorySegment::duration

    fn TrajectorySegment::duration(self : TrajectorySegment) -> Double

    Computes temporal duration (|p1_t - p0_t|).

    TrajectorySegment::equal

    TrajectorySegment::interpolate_position

    fn TrajectorySegment::interpolate_position(self : TrajectorySegment, t : Double) -> (Double, Double)?

    Linearly interpolates (x, y) spatial coordinates at timestamp t.

    TrajectorySegment::length

    fn TrajectorySegment::length(self : TrajectorySegment) -> Double

    Computes Euclidean 2D spatial path length.

    TrajectorySegment::new

    fn TrajectorySegment::new(p0_x : Double, p0_y : Double, p0_t : Double, p1_x : Double, p1_y : Double, p1_t : Double, track_id : Int, segment_id : Int) -> TrajectorySegment

    Creates a new directed trajectory segment with track and segment IDs.

    TrajectorySegment::not_equal

    fn TrajectorySegment::not_equal(x : TrajectorySegment, y : TrajectorySegment) -> Bool

    TrajectorySegment::speed

    fn TrajectorySegment::speed(self : TrajectorySegment) -> Double

    Computes average kinematic speed (length / duration).

    TrajectorySimplificationResult

    pub struct TrajectorySimplificationResult {
    points : Array[TrajectoryPoint]
    original_count : Int
    simplified_count : Int
    compression_ratio : Double
    max_error : Double
    } derive(Default, Eq,
    Debug
    )

    Metrics and decimated point collection resulting from trajectory simplification.

    TrajectorySimplificationResult::default

    TrajectorySimplificationResult::not_equal

    TrajectoryWindowIndex

    pub struct TrajectoryWindowIndex {
    // private fields
    } derive(Default, Eq,
    Debug
    )

    Spatiotemporal sliding-window trajectory segment index.

    TrajectoryWindowIndex::build

    fn TrajectoryWindowIndex::build(segments : Array[TrajectorySegment], node_capacity? : Int) -> TrajectoryWindowIndex

    Builds a TrajectoryWindowIndex from an array of TrajectorySegments.

    TrajectoryWindowIndex::default

    TrajectoryWindowIndex::equal

    TrajectoryWindowIndex::not_equal

    TrajectoryWindowIndex::num_segments

    fn TrajectoryWindowIndex::num_segments(self : TrajectoryWindowIndex) -> Int

    Returns total number of indexed trajectory segments.

    TrajectoryWindowIndex::query_tracks_in_window

    fn TrajectoryWindowIndex::query_tracks_in_window(self : TrajectoryWindowIndex, spatial_window :
    Rect
    , t_min : Double, t_max : Double) -> Array[Int]

    Queries unique track IDs that intersected search_window during temporal interval [t_min, t_max].

    TrajectoryWindowIndex::query_window

    fn TrajectoryWindowIndex::query_window(self : TrajectoryWindowIndex, spatial_window :
    Rect
    , t_min : Double, t_max : Double) -> Array[Int]

    Queries all trajectory segment IDs whose spatial bounding box intersects search_window and whose temporal lifespan overlaps [t_min, t_max].

    TrajectoryWindowIndex::segments_from_points

    fn TrajectoryWindowIndex::segments_from_points(points : Array[TrajectoryPoint]) -> Array[TrajectorySegment]

    Converts consecutive trajectory waypoints into directed segments, joining points with matching track_id.

    TreeStats

    pub struct TreeStats {
    num_items : Int
    num_nodes : Int
    height : Int
    node_capacity : Int
    fill_factor : Double
    leaf_nodes : Int
    branch_nodes : Int
    total_edges : Int
    estimated_memory_bytes : Int
    } derive(Default, Eq,
    Debug
    )

    Comprehensive structural and memory diagnostics for a packed StrTree.

    TreeStats::default

    fn TreeStats::default() -> TreeStats

    TreeStats::equal

    fn TreeStats::equal(TreeStats, TreeStats) -> Bool

    TreeStats::not_equal

    fn TreeStats::not_equal(x : TreeStats, y : TreeStats) -> Bool

    TreeStats3D

    pub struct TreeStats3D {
    num_items : Int
    num_nodes : Int
    height : Int
    node_capacity : Int
    fill_factor : Double
    leaf_nodes : Int
    branch_nodes : Int
    total_edges : Int
    estimated_memory_bytes : Int
    } derive(Default, Eq,
    Debug
    )

    Diagnostic statistics for a packed 3D StrTree.

    TreeStats3D::default

    fn TreeStats3D::default() -> TreeStats3D

    TreeStats3D::equal

    fn TreeStats3D::equal(TreeStats3D, TreeStats3D) -> Bool

    TreeStats3D::not_equal

    fn TreeStats3D::not_equal(x : TreeStats3D, y : TreeStats3D) -> Bool

    TreeStats4D

    pub struct TreeStats4D {
    num_items : Int
    num_nodes : Int
    height : Int
    node_capacity : Int
    fill_factor : Double
    leaf_nodes : Int
    branch_nodes : Int
    total_edges : Int
    estimated_memory_bytes : Int
    } derive(Default, Eq,
    Debug
    )

    Diagnostic statistics for a packed 4D StrTree.

    TreeStats4D::default

    fn TreeStats4D::default() -> TreeStats4D

    TreeStats4D::equal

    fn TreeStats4D::equal(TreeStats4D, TreeStats4D) -> Bool

    TreeStats4D::not_equal

    fn TreeStats4D::not_equal(x : TreeStats4D, y : TreeStats4D) -> Bool

    Triangle3D

    pub struct Triangle3D {
    p0_x : Double
    p0_y : Double
    p0_z : Double
    p1_x : Double
    p1_y : Double
    p1_z : Double
    p2_x : Double
    p2_y : Double
    p2_z : Double
    } derive(Default, Eq,
    Debug
    )

    Triangle represented by three 3D vertices in continuous space.

    Triangle3D::area

    fn Triangle3D::area(self : Triangle3D) -> Double

    Computes the surface area of the triangle.

    Triangle3D::centroid

    fn Triangle3D::centroid(self : Triangle3D) -> (Double, Double, Double)

    Computes the centroid (arithmetic center) of the triangle.

    Triangle3D::default

    fn Triangle3D::default() -> Triangle3D

    Triangle3D::equal

    fn Triangle3D::equal(Triangle3D, Triangle3D) -> Bool

    Triangle3D::intersects_segment

    fn Triangle3D::intersects_segment(self : Triangle3D, x1 : Double, y1 : Double, z1 : Double, x2 : Double, y2 : Double, z2 : Double) -> Bool

    Tests if a finite 3D line segment intersects the triangle.

    Triangle3D::new

    fn Triangle3D::new(p0_x : Double, p0_y : Double, p0_z : Double, p1_x : Double, p1_y : Double, p1_z : Double, p2_x : Double, p2_y : Double, p2_z : Double) -> Triangle3D

    Constructs a new Triangle3D with vertices (p0, p1, p2).

    Triangle3D::normal

    fn Triangle3D::normal(self : Triangle3D) -> (Double, Double, Double)

    Computes the surface normal vector of the triangle.

    Triangle3D::not_equal

    fn Triangle3D::not_equal(x : Triangle3D, y : Triangle3D) -> Bool

    Triangle3D::ray_intersection

    fn Triangle3D::ray_intersection(self : Triangle3D, ox : Double, oy : Double, oz : Double, dx : Double, dy : Double, dz : Double) -> Double?

    Tests if a 3D ray intersects the triangle, returning hit distance t.

    Triangle3D::to_box

    Computes the tight Axis-Aligned Bounding Box (Box3D) enclosing the triangle.

    generate_boxes_3d_clustered

    fn generate_boxes_3d_clustered(rng : Rng, count : Int, num_clusters? : Int, domain_x? : Double, domain_y? : Double, domain_z? : Double) -> Array[(
    Box3D
    , Int)]

    Generates clustered Gaussian distributed 3D bounding boxes.

    generate_boxes_3d_uniform

    fn generate_boxes_3d_uniform(rng : Rng, count : Int, domain_x? : Double, domain_y? : Double, domain_z? : Double, max_box_size? : Double) -> Array[(
    Box3D
    , Int)]

    Generates uniform randomly distributed 3D bounding boxes.

    generate_clustered

    fn generate_clustered(rng : Rng, count : Int, num_clusters? : Int, domain_width? : Double, domain_height? : Double) -> Array[(
    Rect
    , Int)]

    Generates clustered Gaussian distributed bounding boxes.

    generate_concentric

    fn generate_concentric(count : Int, center_x? : Double, center_y? : Double, step? : Double) -> Array[(
    Rect
    , Int)]

    Generates concentric nested bounding boxes.

    generate_diagonal

    fn generate_diagonal(rng : Rng, count : Int, domain_size? : Double) -> Array[(
    Rect
    , Int)]

    Generates diagonal collinear bounding boxes.

    generate_grid

    fn generate_grid(rows : Int, cols : Int, cell_size? : Double, spacing? : Double) -> Array[(
    Rect
    , Int)]

    Generates regularly spaced grid tiles.

    generate_uniform

    fn generate_uniform(rng : Rng, count : Int, domain_width? : Double, domain_height? : Double, max_box_size? : Double) -> Array[(
    Rect
    , Int)]

    Generates uniform randomly distributed bounding boxes.

    matches_de9im_pattern

    fn matches_de9im_pattern(matrix : String, pattern : String) -> Bool

    Checks whether a 9-character DE-9IM intersection matrix matches an intersection pattern.

    simplify_trajectory_2d

    fn simplify_trajectory_2d(points : Array[TrajectoryPoint], epsilon : Double) -> TrajectorySimplificationResult

    Simplifies a 2D trajectory waypoint sequence using Douglas-Peucker algorithm with tolerance epsilon.

    simplify_trajectory_spatiotemporal

    fn simplify_trajectory_spatiotemporal(points : Array[TrajectoryPoint], epsilon : Double) -> TrajectorySimplificationResult

    Simplifies a spatiotemporal trajectory using Synchronized Euclidean Distance (SED) tolerance epsilon.

    trajectory_dtw_distance

    fn trajectory_dtw_distance(a : Array[TrajectoryPoint], b : Array[TrajectoryPoint], window? : Int) -> Double

    Computes Dynamic Time Warping (DTW) distance between two trajectories with optional Sakoe-Chiba window constraint.

    trajectory_dtw_normalized

    fn trajectory_dtw_normalized(a : Array[TrajectoryPoint], b : Array[TrajectoryPoint], window? : Int) -> Double

    Computes length-normalized DTW distance (total_dtw / (len_a + len_b)).

    trajectory_frechet_distance

    fn trajectory_frechet_distance(a : Array[TrajectoryPoint], b : Array[TrajectoryPoint]) -> Double

    Computes Discrete Fréchet Distance between two polygonal trajectory curves.