Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ on:
branches: ["main"]

jobs:
msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.88.0
- name: Run MSRV check
working-directory: iOverlay
run: cargo check --all-features --all-targets

test:
runs-on: ubuntu-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions iOverlay/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "i_overlay"
version = "4.5.1"
authors = ["Nail Sharipov <nailxsharipov@gmail.com>"]
edition = "2024"
rust-version = "1.88"
description = "Boolean Operations for 2D Polygons: Supports intersection, union, difference, xor, and self-intersections for all polygon varieties."
license = "MIT OR Apache-2.0"
repository = "https://github.com/iShape-Rust/iOverlay"
Expand Down
2 changes: 1 addition & 1 deletion iOverlay/src/core/divide.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl ContourDecomposition for IntContour {
.map(|(i, &p)| IdPoint::new(i, p))
.collect();

id_points.sort_by(|p0, p1| p0.point.cmp(&p1.point).then_with(|| p0.id.cmp(&p1.id)));
id_points.sort_unstable_by(|p0, p1| p0.point.cmp(&p1.point).then_with(|| p0.id.cmp(&p1.id)));

let mut p0 = id_points.first().unwrap().point;
let mut anchors = Vec::new();
Expand Down
2 changes: 1 addition & 1 deletion iOverlay/src/core/extract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ impl OverlayGraph<'_> {
}

if !anchors_already_sorted {
anchors.sort_by(|s0, s1| s0.v_segment.a.cmp(&s1.v_segment.a));
anchors.sort_unstable_by(|s0, s1| s0.v_segment.a.cmp(&s1.v_segment.a));
}

shapes.join_sorted_holes(holes, anchors, clockwise);
Expand Down
2 changes: 1 addition & 1 deletion iOverlay/src/core/extract_ogc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ impl OverlayGraph<'_> {
}

if !anchors_already_sorted {
anchors.sort_by(|s0, s1| s0.v_segment.a.cmp(&s1.v_segment.a));
anchors.sort_unstable_by(|s0, s1| s0.v_segment.a.cmp(&s1.v_segment.a));
}

shapes.join_sorted_holes(holes, anchors, is_main_dir_cw);
Expand Down
3 changes: 2 additions & 1 deletion iOverlay/src/split/solver_fragment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ impl SplitSolver {
marks: Vec<LineMark>,
}

let marks_capacity = self.marks.len() / buffer.groups.len();
debug_assert!(!buffer.groups.is_empty(), "groups.len() >= 1");
let marks_capacity = self.marks.capacity() / buffer.groups.len();

let results: Vec<TaskResult> = buffer
.groups
Expand Down
16 changes: 8 additions & 8 deletions iOverlay/src/split/solver_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ impl SplitSolver {

let radius: i64 = snap_radius.radius();

for i in 0..segments.len() - 1 {
let ei = &segments[i].x_segment;
let ri = ei.y_range();
for (j, s) in segments.iter().enumerate().skip(i + 1) {
let ej = &s.x_segment;
if ei.b.x < ej.a.x {
for (i, si) in segments.iter().enumerate() {
let xsi = &si.x_segment;
let ri = xsi.y_range();
for (j, sj) in segments.iter().enumerate().skip(i + 1) {
let xsj = &sj.x_segment;
if xsi.b.x < xsj.a.x {
break;
}

if ej.is_not_intersect_y_range(&ri) {
if xsj.is_not_intersect_y_range(&ri) {
continue;
}

let is_round = SplitSolver::cross(i, j, ei, ej, &mut self.marks, radius);
let is_round = SplitSolver::cross(i, j, xsi, xsj, &mut self.marks, radius);
need_to_fix = need_to_fix || is_round
}
}
Expand Down
Loading