Skip to content

assert_debug fails 'not possible! UniqueSegmentsIter guarantee it' #74

@SauvageThomas

Description

@SauvageThomas

Summary

Hi, I'm using IOverlay through the geo crate and I had a panick with a fail assert when offsetting a polygon.

Here is the fail assert:
https://github.com/iShape-Rust/iOverlay/blob/main/iOverlay/src/mesh/outline/builder.rs#L162

I'm not well versed in polygon manipulation ; is it a bug in the crate or is the polygon just not well formed enough for this operation ?
I'm working with generated polygon through algorithms on images, I try to pre-process them a bit, but some can have weird shapes.

Steps to reproduce

I managed to make a minimal reproductive exemple:

use i_overlay::mesh::outline::offset::OutlineOffset;
use i_overlay::mesh::style::{LineJoin, OutlineStyle};

fn main() {
    let shape = vec![vec![
        [53.0f64, 42.0],
        [27.0, 74.0],
        [26.0, 75.0],
        [35.0, 66.0],
        [53.0, 42.0],
    ]];

    let style = OutlineStyle::new(1.0f64).line_join(LineJoin::Round(1.0f64));

    shape.outline(&style);
}

Expected behavior

It should not panic

Actual behavior

It panics

Environment

  • iOverlay version: 6.0.0
  • Rust version: 1.95.0
  • OS: W11

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions