1+ use crate :: advanced:: bitset:: IndexBitSet ;
12use crate :: advanced:: buffer:: DelaunayBuffer ;
2- use alloc:: vec:: Vec ;
33use crate :: geom:: triangle:: IntTriangle ;
44use crate :: int:: triangulation:: RawIntTriangulation ;
5+ use alloc:: vec:: Vec ;
56use i_overlay:: i_float:: int:: point:: IntPoint ;
67use i_overlay:: i_float:: u128:: UInt128 ;
7- use crate :: advanced:: bitset:: IndexBitSet ;
88
99/// A 2D integer-based Delaunay triangulation.
1010/// Each triangle satisfies the Delaunay condition.
@@ -19,7 +19,6 @@ pub struct IntDelaunay {
1919}
2020
2121impl RawIntTriangulation {
22-
2322 /// Converts an int triangle mesh into a Delaunay triangulation by applying edge flips.
2423 ///
2524 /// The mesh is refined in-place by checking local angle conditions and
@@ -50,7 +49,6 @@ pub trait DelaunayRefine {
5049}
5150
5251impl DelaunayRefine for [ IntTriangle ] {
53-
5452 #[ inline]
5553 fn build ( & mut self ) {
5654 let mut buffer = DelaunayBuffer :: new ( ) ;
@@ -92,7 +90,7 @@ impl DelaunayRefine for [IntTriangle] {
9290 fn fix_triangle ( & mut self , abc_index : usize , unchecked : & mut IndexBitSet ) {
9391 // loop by same triangle increase cache locality
9492 let mut skip = usize:: MAX ;
95- let mut perfect= false ;
93+ let mut perfect = false ;
9694 while !perfect {
9795 perfect = true ;
9896 let neighbors = unsafe { self . get_unchecked ( abc_index) } . neighbors ;
@@ -276,14 +274,14 @@ impl IntDelaunay {
276274
277275#[ cfg( test) ]
278276mod tests {
279- use crate :: advanced:: delaunay:: Vec ;
280- use alloc:: vec;
281- use crate :: advanced:: delaunay:: DelaunayCondition ;
282- use crate :: advanced:: delaunay:: DelaunayRefine ;
277+ use crate :: advanced:: delaunay:: DelaunayCondition ;
278+ use crate :: advanced:: delaunay:: DelaunayRefine ;
283279 use crate :: advanced:: delaunay:: IntDelaunay ;
280+ use crate :: advanced:: delaunay:: Vec ;
284281 use crate :: geom:: point:: IndexPoint ;
285282 use crate :: geom:: triangle:: IntTriangle ;
286283 use crate :: int:: triangulatable:: IntTriangulatable ;
284+ use alloc:: vec;
287285 use i_overlay:: core:: fill_rule:: FillRule ;
288286 use i_overlay:: core:: overlay:: IntOverlayOptions ;
289287 use i_overlay:: core:: simplify:: Simplify ;
@@ -429,10 +427,7 @@ use crate::advanced::delaunay::DelaunayRefine;
429427 let shape = vec ! [ random( 8 , 5 ) ] ;
430428
431429 if let Some ( first) = shape
432- . simplify (
433- FillRule :: NonZero ,
434- IntOverlayOptions :: keep_all_points ( ) ,
435- )
430+ . simplify ( FillRule :: NonZero , IntOverlayOptions :: keep_all_points ( ) )
436431 . first ( )
437432 {
438433 let shape_area = first. area_two ( ) ;
@@ -451,10 +446,7 @@ use crate::advanced::delaunay::DelaunayRefine;
451446 let shape = vec ! [ random( 8 , 12 ) ] ;
452447
453448 if let Some ( first) = shape
454- . simplify (
455- FillRule :: NonZero ,
456- IntOverlayOptions :: keep_all_points ( ) ,
457- )
449+ . simplify ( FillRule :: NonZero , IntOverlayOptions :: keep_all_points ( ) )
458450 . first ( )
459451 {
460452 let shape_area = first. area_two ( ) ;
@@ -477,10 +469,7 @@ use crate::advanced::delaunay::DelaunayRefine;
477469 }
478470
479471 if let Some ( first) = shape
480- . simplify (
481- FillRule :: NonZero ,
482- IntOverlayOptions :: keep_all_points ( ) ,
483- )
472+ . simplify ( FillRule :: NonZero , IntOverlayOptions :: keep_all_points ( ) )
484473 . first ( )
485474 {
486475 let shape_area = first. area_two ( ) ;
0 commit comments