remesh 0.0.5

Isotropic remeshing library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
// SPDX-License-Identifier: MIT OR Apache-2.0
// Copyright (c) 2025 lacklustr@protonmail.com https://github.com/eadf

use remesh::prelude::*;

#[test]
fn test_combined_1() -> Result<(), RemeshError> {
    let vertices = vec![
        [-0.5, -0.5, -0.5],
        [-0.5, -0.5, 0.5],
        [-0.5, 0.5, -0.5],
        [-0.5, 0.5, 0.5],
        [0.5, -0.5, -0.5],
        [0.5, -0.5, 0.5],
        [0.5, 0.5, -0.5],
        [0.5, 0.5, 0.5],
        [-0.5, 0.0, 0.5],
        [0.5, 0.0, -0.5],
        [-0.0, -0.5, 0.5],
        [0.5, -0.5, 0.0],
        [-0.5, 0.5, 0.0],
        [-0.0, -0.5, -0.5],
        [-0.0, 0.5, 0.5],
    ];
    let indices = vec![
        6, 14, 7, 10, 8, 1, 7, 5, 11, 9, 13, 2, 14, 10, 7, 13, 10, 1, 13, 11, 10, 13, 4, 11, 10,
        11, 5, 12, 8, 3, 1, 12, 2, 2, 6, 9, 12, 6, 2, 7, 11, 4, 13, 9, 4, 13, 1, 0, 1, 2, 0, 7, 9,
        6, 10, 5, 7, 6, 12, 14, 14, 12, 3, 2, 13, 0, 8, 12, 1, 10, 14, 8, 8, 14, 3, 7, 4, 9,
    ];

    let (result_vertices, result_indices) =
        IsotropicRemesh::<f32, _, true>::new(&vertices, &indices)?
            .with_print_stats(20)?
            .with_target_edge_length(0.15_f32)?
            .with_default_split_multiplier()?
            .with_collapse_edges(CollapseStrategy::Disabled)?
            .without_smooth_weight()?
            .with_flip_edges(FlipStrategy::Disabled)?
            .run(6)?;

    assert_eq!(result_vertices.len(), 442, "result_vertices.len() mismatch");
    assert_eq!(result_indices.len(), 2640, "result_indices.len() mismatch");
    let (result_vertices, result_indices) =
        IsotropicRemesh::<f32, _, true>::new(&result_vertices, &result_indices)?
            .with_target_edge_length(2.0)?
            .with_default_split_multiplier()?
            .with_default_collapse_multiplier()?
            .without_smooth_weight()?
            .with_flip_edges(FlipStrategy::Valence)?
            .run(20)?;

    assert_eq!(result_vertices.len(), 8, "result_vertices.len() mismatch");
    assert_eq!(result_indices.len(), 36, "result_indices.len() mismatch");
    Ok(())
}

#[test]
fn test_combined_2() -> Result<(), RemeshError> {
    let vertices = vec![
        [0.020436637, -0.024037197, -0.010061838],
        [-0.021503575, 0.015962794, 0.028910778],
        [-0.06047619, -0.0440372, -0.010061838],
        [0.020436637, 0.015962794, -0.010061838],
        [-0.06047619, 0.015962794, -0.010061838],
        [-0.021503575, -0.0440372, 0.028910778],
    ];
    let indices = vec![
        4, 1, 3, 5, 2, 0, 0, 2, 4, 0, 4, 3, 5, 1, 4, 2, 5, 4, 0, 1, 5, 0, 3, 1,
    ];

    let (result_vertices, result_indices) = IsotropicRemesh::<f32, _>::new(&vertices, &indices)?
        .with_target_edge_length(0.25_f32)?
        .with_default_split_multiplier()?
        .with_default_collapse_multiplier()?
        .without_smooth_weight()?
        .with_flip_edges(FlipStrategy::default_quality())?
        .run(10)?;

    assert_eq!(result_vertices.len(), 6, "result_vertices.len() mismatch");
    assert_eq!(result_indices.len(), 24, "result_indices.len() mismatch");
    Ok(())
}

#[test]
fn test_combined_3() -> Result<(), RemeshError> {
    let vertices = vec![
        [0.85999995, -0.9155844, 0.9155844],
        [1.06, -0.8990885, 0.85999995],
        [0.82, -0.97999996, 0.88350415],
        [0.9155844, -0.9155844, 0.78],
        [1.02, -1.1128445, 1.02],
        [1.1164958, -0.78, 0.97999996],
        [0.97999996, -0.881752, 0.881752],
        [1.06, -1.1009115, 0.9],
        [1.1164958, -1.02, 0.78],
        [0.9155844, -1.0844156, 0.82],
        [0.97999996, -0.85999995, 0.88350415],
        [1.06, -0.88954425, 0.8895442],
        [0.82, -0.9155844, 0.9155844],
        [1.1128445, -1.02, 1.02],
        [1.06, -0.85999995, 0.89908856],
        [0.82, -1.1009115, 0.94],
        [0.881752, -0.881752, 0.97999996],
        [1.1164958, -0.9, 1.02],
        [0.97999996, -0.78, 0.88350415],
        [0.97999996, -0.8835041, 0.82],
        [1.1164958, -0.78, 1.02],
        [1.1164958, -1.02, 0.9],
        [0.82, -1.1164958, 0.97999996],
        [0.97999996, -1.1164958, 0.85999995],
        [0.82, -0.8835041, 0.97999996],
        [0.88350415, -0.97999996, 0.85999995],
        [0.85999995, -1.1164958, 1.02],
        [1.1069516, -0.94, 0.94],
        [0.82, -1.1164958, 1.02],
        [0.94, -0.8990885, 0.85999995],
        [1.0844156, -1.0844156, 0.78],
        [0.82, -0.8835041, 1.02],
        [0.9022337, -1.0852987, 0.9022337],
        [1.0844156, -0.9155844, 0.78],
        [0.85999995, -1.06, 0.89908856],
        [1.0844156, -1.0844156, 0.82],
        [0.94, -1.1069516, 0.94],
        [0.881752, -1.02, 0.881752],
        [1.0844156, -0.9155844, 0.82],
        [0.97999996, -1.1164958, 0.78],
        [0.8895442, -0.88954425, 0.94],
        [1.1182479, -0.97999996, 0.97999996],
        [0.85999995, -0.94, 0.89908856],
        [1.0844156, -1.0844156, 0.85999995],
        [0.88350415, -0.97999996, 0.78],
        [1.1164958, -0.85999995, 0.97999996],
        [0.903723, -0.9037229, 0.903723],
        [1.0844156, -0.9155844, 0.85999995],
        [1.064, -1.0934434, 1.024],
        [0.9155844, -0.85999995, 0.9155844],
        [1.0934434, -1.064, 1.024],
        [0.9155844, -0.82, 0.9155844],
        [1.0852987, -0.9022337, 0.9022337],
        [0.88350415, -1.02, 0.82],
        [1.1164958, -0.97999996, 1.02],
        [0.9155844, -0.78, 0.9155844],
        [1.0844156, -0.85999995, 0.9155844],
        [0.9155844, -0.9155844, 0.82],
        [1.1164958, -0.85999995, 1.02],
        [1.0844156, -0.82, 0.9155844],
        [0.9155844, -1.0844156, 0.85999995],
        [1.1164958, -0.97999996, 0.9],
        [0.89908856, -1.06, 0.85999995],
        [1.1164958, -1.02, 0.94],
        [0.89908856, -0.94, 0.85999995],
        [0.9, -1.1164958, 1.02],
        [1.1009115, -0.9, 0.94],
        [1.1009115, -0.78, 0.94],
        [0.94, -1.1009115, 0.9],
        [1.02, -1.1164958, 0.82],
        [0.88350415, -0.82, 1.02],
        [0.8895442, -1.06, 0.8895442],
        [1.02, -0.8835041, 0.82],
        [0.9155844, -1.0844156, 0.78],
        [0.97999996, -1.1164958, 0.94],
        [1.1009115, -1.06, 0.97999996],
        [0.89908856, -0.85999995, 0.94],
        [1.0844156, -1.0844156, 0.94],
        [0.89908856, -0.94, 0.78],
        [1.0844156, -1.0844156, 0.97999996],
        [0.94, -0.88954425, 0.8895442],
        [1.02, -1.1164958, 0.9],
        [1.1009115, -1.06, 0.78],
        [0.94, -0.85999995, 0.89908856],
        [1.02, -0.881752, 0.881752],
        [1.1164958, -0.97999996, 0.82],
        [0.94, -0.78, 0.89908856],
        [1.02, -0.82, 0.88350415],
        [0.88350415, -0.82, 0.97999996],
        [1.02, -0.78, 0.88350415],
        [1.1009115, -1.06, 0.9],
        [1.1009115, -0.94, 0.9],
        [0.9155844, -0.9155844, 0.85999995],
        [0.94, -1.1164958, 1.02],
        [0.85999995, -1.0844156, 0.9155844],
        [0.881752, -0.881752, 1.02],
        [1.06, -1.1009115, 0.82],
        [0.88350415, -0.78, 1.02],
        [0.82, -1.0844156, 0.9155844],
        [0.9, -1.1009115, 0.94],
        [0.85999995, -0.8990885, 0.94],
        [0.881752, -0.97999996, 0.881752],
        [0.82, -1.02, 0.88350415],
        [1.02, -1.1164958, 0.97999996],
    ];
    let indices = vec![
        82, 30, 39, 78, 33, 82, 33, 8, 82, 33, 19, 72, 39, 73, 44, 44, 78, 39, 19, 33, 3, 33, 85,
        8, 39, 9, 73, 39, 23, 9, 69, 23, 39, 30, 96, 69, 30, 35, 96, 9, 62, 73, 73, 62, 53, 19, 3,
        29, 73, 53, 44, 53, 25, 44, 25, 78, 44, 25, 57, 78, 57, 3, 78, 3, 57, 29, 82, 39, 78, 33,
        72, 38, 78, 3, 33, 96, 43, 69, 35, 43, 96, 60, 62, 9, 62, 37, 53, 37, 25, 53, 25, 64, 57,
        64, 92, 57, 29, 57, 92, 19, 29, 6, 84, 19, 6, 72, 19, 84, 38, 72, 84, 38, 84, 1, 38, 1, 47,
        68, 60, 9, 68, 32, 60, 23, 68, 9, 69, 81, 23, 43, 81, 69, 43, 7, 81, 43, 77, 7, 98, 34, 94,
        71, 62, 32, 32, 62, 60, 71, 94, 34, 71, 32, 94, 102, 12, 2, 102, 34, 98, 102, 37, 34, 37,
        62, 71, 37, 71, 34, 2, 37, 102, 2, 101, 37, 37, 101, 25, 12, 42, 2, 42, 101, 2, 101, 64,
        25, 101, 46, 64, 42, 46, 101, 12, 0, 42, 46, 92, 64, 0, 46, 42, 80, 29, 92, 80, 92, 46, 6,
        29, 80, 1, 84, 11, 47, 1, 11, 47, 11, 52, 49, 80, 46, 49, 83, 80, 83, 6, 80, 83, 10, 6, 10,
        84, 6, 14, 11, 84, 56, 11, 14, 56, 52, 11, 51, 83, 49, 51, 10, 83, 10, 87, 84, 87, 14, 84,
        14, 59, 56, 55, 86, 51, 86, 10, 51, 86, 18, 10, 18, 87, 10, 18, 89, 87, 89, 14, 87, 89, 59,
        14, 97, 55, 88, 58, 20, 70, 50, 13, 4, 94, 15, 98, 99, 94, 32, 68, 99, 32, 68, 36, 99, 23,
        36, 68, 23, 74, 36, 81, 74, 23, 81, 103, 74, 7, 79, 81, 0, 12, 100, 40, 46, 0, 40, 0, 100,
        40, 49, 46, 40, 76, 49, 76, 51, 49, 76, 55, 51, 94, 22, 15, 99, 22, 94, 99, 93, 22, 36, 93,
        99, 74, 93, 36, 81, 79, 103, 77, 79, 7, 15, 31, 24, 15, 28, 31, 100, 12, 24, 100, 24, 16,
        16, 40, 100, 16, 76, 40, 16, 88, 76, 88, 55, 76, 22, 26, 28, 93, 65, 22, 22, 65, 26, 4, 93,
        74, 103, 4, 74, 79, 4, 103, 79, 48, 4, 89, 86, 67, 16, 24, 31, 16, 31, 95, 95, 70, 16, 16,
        70, 88, 70, 97, 88, 54, 17, 95, 15, 12, 98, 89, 18, 86, 95, 4, 54, 79, 50, 48, 15, 22, 28,
        102, 98, 12, 20, 5, 67, 24, 12, 15, 65, 93, 95, 58, 70, 95, 86, 97, 67, 89, 67, 59, 30, 69,
        39, 35, 30, 82, 35, 82, 8, 85, 33, 38, 43, 35, 8, 47, 85, 38, 77, 43, 90, 21, 43, 8, 90,
        43, 21, 21, 8, 85, 21, 85, 61, 61, 85, 47, 61, 47, 91, 91, 47, 52, 77, 90, 21, 77, 21, 63,
        63, 21, 61, 27, 63, 61, 27, 61, 91, 66, 27, 91, 66, 91, 52, 66, 52, 56, 66, 56, 59, 20, 67,
        97, 79, 77, 75, 75, 77, 63, 75, 63, 13, 13, 63, 41, 27, 41, 63, 17, 41, 27, 45, 17, 27, 45,
        27, 66, 45, 66, 59, 45, 59, 67, 45, 67, 5, 13, 54, 4, 79, 75, 50, 13, 50, 75, 54, 13, 41,
        54, 41, 17, 17, 45, 58, 58, 45, 5, 20, 58, 5, 4, 48, 50, 86, 55, 97, 17, 58, 95, 26, 65,
        95, 93, 4, 95, 95, 31, 26, 31, 28, 26, 20, 97, 70,
    ];

    let (result_vertices, result_indices) = IsotropicRemesh::<f32, _>::new(&vertices, &indices)?
        .with_target_edge_length(0.25_f32)?
        .with_default_split_multiplier()?
        .with_default_collapse_multiplier()?
        .without_smooth_weight()?
        .with_flip_edges(FlipStrategy::default_quality())?
        .run(2)?;

    assert_eq!(result_vertices.len(), 94, "result_vertices.len() mismatch");
    assert_eq!(result_indices.len(), 552, "result_indices.len() mismatch");
    Ok(())
}

#[test]
fn test_combined_4() -> Result<(), RemeshError> {
    let vertices = vec![
        [-0.5, -0.5, -0.5],
        [-0.5, -0.5, 0.5],
        [-0.5, 0.5, -0.5],
        [-0.5, 0.5, 0.5],
        [0.5, -0.5, -0.5],
        [0.5, -0.5, 0.5],
        [0.5, 0.5, -0.5],
        [0.5, 0.5, 0.5], // V07
        [-0.5, 0.0, 0.0],
        [0.0, 0.5, 0.0],
        [0.5, 0.0, 0.0],
        [0.0, -0.5, 0.0],
        [0.5, 0.0, 0.5],
        [0.0, 0.5, -0.5],
        [-0.5, -0.25, -0.25],
        [-0.5, -0.375, 0.125],
        [-0.25, 0.5, -0.25],
        [-0.375, 0.5, 0.125],
        [0.5, 0.25, -0.25],
        [0.5, 0.375, 0.125],
        [0.25, -0.5, -0.25],
        [0.375, -0.5, 0.125],
        [-0.5, 0.0, 0.5],
        [0.0, 0.5, 0.5],
        [0.0, -0.5, 0.5],
        [0.5, 0.0, -0.5],
        [-0.5, 0.5, 0.0],
        [0.5, 0.5, 0.0],
        [0.5, -0.5, 0.0],
        [-0.5, -0.5, 0.0],
        [-0.5, 0.0, -0.5],
        [0.0, -0.5, -0.5],
        [-0.5, 0.125, -0.375],
        [0.125, 0.5, -0.375],
        [0.5, -0.125, -0.375],
        [-0.125, -0.5, -0.375],
        [-0.5, -0.25, 0.25],
        [-0.25, 0.5, 0.25],
        [0.25, -0.5, 0.25],
        [-0.5, 0.25, -0.25],
        [0.25, 0.5, -0.25],
        [0.5, -0.25, -0.25],
        [-0.25, -0.5, -0.25],
        [0.5, 0.25, 0.25],
    ];
    let indices = vec![
        13, 33, 6, 14, 15, 8, 16, 17, 9, 18, 19, 10, 20, 21, 11, 8, 36, 22, 23, 9, 37, 5, 10, 12,
        24, 11, 38, 9, 23, 7, 9, 7, 27, 23, 22, 1, 8, 39, 32, 30, 25, 4, 9, 40, 33, 11, 24, 1, 10,
        41, 34, 10, 5, 28, 11, 42, 35, 8, 22, 3, 30, 31, 0, 12, 7, 23, 12, 10, 43, 30, 13, 6, 30,
        6, 25, 14, 0, 29, 14, 30, 0, 15, 36, 8, 15, 29, 1, 16, 2, 26, 16, 13, 2, 17, 37, 9, 17, 26,
        3, 18, 6, 27, 18, 25, 6, 19, 43, 10, 19, 27, 7, 20, 4, 28, 20, 31, 4, 21, 38, 11, 21, 28,
        5, 30, 4, 31, 22, 23, 3, 11, 1, 29, 8, 3, 26, 24, 23, 1, 25, 34, 4, 26, 39, 8, 26, 17, 16,
        27, 40, 9, 27, 19, 18, 28, 41, 10, 28, 21, 20, 29, 42, 11, 29, 15, 14, 30, 2, 13, 30, 32,
        2, 31, 35, 0, 32, 14, 8, 32, 30, 14, 33, 16, 9, 33, 13, 16, 34, 18, 10, 34, 25, 18, 35, 20,
        11, 35, 31, 20, 36, 1, 22, 36, 15, 1, 37, 3, 23, 37, 17, 3, 38, 5, 24, 38, 21, 5, 39, 2,
        32, 39, 26, 2, 40, 6, 33, 40, 27, 6, 41, 4, 34, 41, 28, 4, 42, 0, 35, 42, 29, 0, 43, 7, 12,
        43, 19, 7, 23, 5, 12, 23, 24, 5,
    ];

    let (result_vertices, result_indices) = IsotropicRemesh::<f32, _>::new(&vertices, &indices)?
        .with_target_edge_length(2.5_f32)?
        .with_default_split_multiplier()?
        .with_default_collapse_multiplier()?
        .without_smooth_weight()?
        .with_flip_edges(FlipStrategy::Valence)?
        .run(10)?;

    assert_eq!(result_vertices.len(), 8, "result_vertices.len() mismatch");
    assert_eq!(result_indices.len(), 36, "result_indices.len() mismatch");
    Ok(())
}

#[test]
fn test_combined_5() -> Result<(), RemeshError> {
    let vertices = vec![
        [-0.5, -0.5, -0.5],
        [-0.5, -0.5, 0.5],
        [-0.5, 0.5, -0.5],
        [-0.5, 0.5, 0.5],
        [0.5, -0.5, -0.5],
        [0.5, -0.5, 0.5],
        [0.5, 0.5, -0.5],
        [0.5, 0.5, 0.5],
        [-0.0, -0.5, -0.5],
    ];
    let indices = vec![
        5, 6, 7, 7, 6, 2, 6, 8, 2, 2, 3, 7, 4, 5, 8, 8, 0, 2, 5, 1, 8, 7, 1, 5, 1, 3, 2, 8, 6, 4,
        3, 1, 7, 1, 2, 0, 6, 5, 4, 1, 0, 8,
    ];

    let (result_vertices, result_indices) = IsotropicRemesh::<f32, _>::new(&vertices, &indices)?
        .with_target_edge_length(2.0_f32)?
        .with_split_edges(SplitStrategy::Disabled)?
        .with_default_collapse_multiplier()?
        .without_smooth_weight()?
        .with_flip_edges(FlipStrategy::Valence)?
        .run(10)?;

    assert_eq!(result_vertices.len(), 8, "result_vertices.len() mismatch");
    assert_eq!(result_indices.len(), 36, "result_indices.len() mismatch");

    Ok(())
}

#[test]
fn test_combined_6() -> Result<(), RemeshError> {
    let vertices = vec![
        [-0.9, 1.1715629, -0.58],
        [-0.74, 1.06, -0.8104663],
        [-1.1615928, 1.0827703, -1.0827703],
        [-0.8193748, 1.104, -0.8193748],
        [-1.06, 1.1895337, -0.9],
        [-1.1895337, 1.06, -0.65999997],
        [-0.78, 1.1, -1.1715629],
        [-0.53999996, 1.06, -0.8104663],
        [-0.85999995, 1.1, -1.1715629],
        [-0.74, 1.16, -1.12],
        [-0.94, 1.1895337, -0.9],
        [-0.65999997, 1.06, -0.8104663],
        [-0.8104663, 1.06, -0.74],
        [-0.74, 1.06, -1.1895337],
        [-0.62, 1.16, -0.88],
        [-1.0987995, 1.0987995, -1.1392747],
        [-0.94, 1.1895337, -0.82],
        [-0.45999998, 1.1715629, -1.1],
        [-0.94, 1.12, -1.16],
        [-0.82, 1.12, -0.84],
        [-1.02, 1.1180826, -1.1586621],
        [-1.1704472, 1.02, -1.0980827],
        [-1.1979707, 1.02, -0.82],
        [-0.65999997, 1.14, -0.85999995],
        [-0.7, 1.1979707, -0.97999996],
        [-0.88, 1.16, -0.85999995],
        [-0.9, 1.1715629, -1.1],
        [-0.53999996, 1.1715629, -1.1],
        [-0.94, 1.1979707, -0.97999996],
        [-1.12, 1.16, -0.97999996],
        [-0.8052331, 1.06, -0.8052331],
        [-0.5, 1.12, -1.16],
        [-0.78, 1.16, -0.88],
        [-0.5, 1.1895337, -1.06],
        [-0.62, 1.1715629, -1.1],
        [-0.85999995, 1.14, -0.78],
        [-0.85999995, 1.16, -0.88],
        [-1.1873754, 1.06, -1.02],
        [-1.1895337, 1.06, -0.78],
        [-1.1180826, 1.02, -1.1586621],
        [-0.85999995, 1.1715629, -0.9],
        [-1.02, 1.1586621, -1.1180826],
        [-0.38, 1.1895337, -1.06],
        [-1.1715629, 1.1, -0.62],
        [-0.7, 1.1895337, -1.06],
        [-0.38, 1.1979707, -0.97999996],
        [-1.06, 1.1784691, -1.06],
        [-0.97999996, 1.1979707, -0.65999997],
        [-0.58, 1.12, -0.84],
        [-1.1531181, 1.1101605, -1.06],
        [-0.84, 1.12, -0.82],
        [-1.1259414, 1.1259414, -1.088162],
        [-0.5, 1.06, -1.1895337],
        [-1.1101605, 1.1531181, -1.06],
        [-0.45999998, 1.1979707, -0.97999996],
        [-0.58, 1.06, -1.1895337],
        [-0.82843703, 1.1, -0.78],
        [-0.84, 1.12, -0.62],
        [-1.06, 1.1531181, -1.1101605],
        [-0.7, 1.12, -1.16],
        [-0.5, 1.14, -0.85999995],
        [-1.06, 1.02, -1.1873754],
        [-0.78, 1.1, -0.82843703],
        [-1.06, 1.1895337, -0.7],
        [-1.06, 1.1101605, -1.1531181],
        [-1.1101605, 1.06, -1.1531181],
        [-1.1715629, 1.1, -0.85999995],
        [-0.84, 1.12, -0.84],
        [-0.89599997, 1.1738755, -0.89599997],
        [-0.85599995, 1.1439999, -0.85599995],
        [-1.1392747, 1.0987995, -1.0987995],
        [-0.9, 1.06, -1.1895337],
        [-0.42, 1.12, -1.16],
        [-1.1259414, 1.088162, -1.1259414],
        [-0.88, 1.16, -0.88],
        [-1.06, 1.1895337, -0.78],
        [-0.82, 1.1895337, -0.94],
        [-1.02, 1.1386621, -1.1386621],
        [-0.88, 1.16, -0.78],
        [-1.1586621, 1.1180826, -1.02],
        [-0.9, 1.1895337, -0.94],
        [-1.0827703, 1.0827703, -1.1615928],
        [-0.88, 1.16, -0.65999997],
        [-1.088162, 1.1259414, -1.1259414],
        [-1.12, 1.16, -0.78],
        [-1.0827703, 1.161593, -1.0827703],
        [-0.53999996, 1.1715629, -0.9],
        [-1.0987995, 1.1392747, -1.0987995],
    ];
    let indices = vec![
        7, 55, 42, 39, 61, 37, 30, 13, 1, 13, 55, 11, 65, 61, 39, 65, 81, 61, 64, 61, 81, 61, 20,
        18, 61, 18, 71, 18, 8, 71, 71, 6, 13, 71, 8, 6, 6, 59, 13, 13, 59, 55, 59, 31, 55, 65, 15,
        81, 5, 38, 47, 43, 5, 47, 31, 52, 55, 31, 72, 52, 64, 81, 15, 61, 64, 20, 2, 70, 73, 21,
        37, 2, 21, 2, 73, 37, 66, 79, 37, 38, 66, 57, 47, 12, 22, 38, 37, 5, 43, 38, 61, 71, 37,
        60, 7, 42, 73, 65, 39, 73, 15, 65, 21, 73, 39, 7, 11, 55, 21, 39, 37, 55, 52, 42, 47, 38,
        30, 38, 22, 30, 62, 3, 30, 62, 30, 1, 62, 1, 23, 23, 1, 11, 23, 11, 48, 56, 30, 3, 12, 30,
        56, 12, 56, 57, 71, 13, 30, 30, 37, 71, 48, 11, 7, 48, 7, 60, 49, 70, 2, 79, 49, 37, 49, 2,
        37, 83, 64, 15, 83, 20, 64, 83, 58, 20, 18, 6, 8, 9, 59, 6, 9, 34, 59, 51, 83, 15, 51, 73,
        70, 73, 51, 15, 51, 87, 83, 58, 83, 87, 58, 77, 20, 41, 77, 58, 41, 18, 77, 18, 20, 77, 18,
        41, 26, 6, 18, 26, 9, 6, 26, 31, 59, 34, 31, 34, 27, 85, 58, 87, 49, 51, 70, 53, 87, 51,
        53, 85, 87, 46, 58, 85, 46, 85, 53, 46, 41, 58, 26, 41, 46, 26, 46, 28, 44, 9, 26, 34, 9,
        44, 79, 51, 49, 79, 29, 51, 29, 53, 51, 46, 53, 29, 4, 28, 46, 44, 26, 28, 34, 44, 24, 4,
        46, 29, 44, 28, 80, 29, 79, 66, 44, 80, 76, 24, 44, 76, 24, 76, 32, 86, 24, 32, 10, 28, 4,
        80, 28, 10, 80, 10, 68, 80, 68, 40, 40, 68, 74, 40, 74, 36, 76, 80, 40, 76, 36, 32, 36, 76,
        40, 32, 23, 14, 36, 74, 25, 36, 25, 69, 32, 36, 69, 32, 69, 67, 32, 67, 19, 32, 19, 62, 32,
        62, 23, 23, 48, 14, 4, 29, 84, 10, 4, 75, 25, 74, 68, 68, 10, 25, 19, 67, 50, 19, 50, 3,
        62, 19, 3, 35, 50, 67, 35, 67, 69, 69, 25, 35, 25, 10, 16, 56, 3, 50, 38, 84, 66, 29, 66,
        84, 56, 50, 35, 35, 25, 78, 75, 4, 84, 16, 10, 47, 25, 16, 0, 25, 0, 78, 43, 84, 38, 57,
        56, 35, 57, 35, 78, 75, 84, 63, 47, 75, 63, 63, 84, 43, 10, 75, 47, 0, 16, 47, 57, 78, 82,
        78, 0, 82, 47, 63, 43, 82, 0, 57, 22, 37, 30, 17, 72, 31, 17, 31, 27, 27, 34, 33, 17, 27,
        33, 17, 33, 42, 33, 34, 24, 42, 33, 45, 33, 24, 54, 45, 33, 54, 54, 24, 86, 86, 32, 14, 14,
        48, 86, 54, 86, 60, 86, 48, 60, 60, 42, 45, 1, 13, 11, 57, 0, 47, 42, 52, 72, 54, 60, 45,
        72, 17, 42, 30, 12, 47,
    ];

    let (result_vertices, result_indices) = IsotropicRemesh::<f32, _>::new(&vertices, &indices)?
        .with_target_edge_length(2.0_f32)?
        .with_default_split_multiplier()?
        .with_default_collapse_multiplier()?
        .without_smooth_weight()?
        .with_flip_edges(FlipStrategy::Valence)?
        .run(1)?;

    assert_eq!(result_vertices.len(), 75, "result_vertices.len() mismatch");
    assert_eq!(result_indices.len(), 438, "result_indices.len() mismatch");
    Ok(())
}

#[test]
fn test_combined_7() -> Result<(), RemeshError> {
    let vertices = vec![
        [-0.50000006, -0.5, -0.5],
        [-0.50000006, -0.5, 0.5],
        [-0.50000006, 0.5, -0.5],
        [-0.50000006, 0.5, 0.5],
        [0.49999994, -0.5, -0.5],
        [0.49999994, -0.5, 0.5],
        [0.49999994, 0.5, -0.5],
        [0.49999994, 0.5, 0.5],
        [-0.055555552, 0.5, 0.0],
        [-0.055555552, -0.5, 0.0],
        [-0.50000006, 0.0, 0.0],
        [-0.30555558, -0.25, 0.5],
        [0.49999994, -0.5, 0.0],
        [-0.50000006, 0.0, -0.5],
        [-0.50000006, -0.5, 0.0],
        [0.49999994, 0.0, -0.5],
        [-0.50000006, 0.5, 0.0],
        [-0.055555552, 0.5, -0.5],
        [0.49999994, 0.0, 0.5],
        [-0.055555552, -0.5, -0.5],
        [-0.055555552, -0.5, 0.5],
        [-0.43055558, 0.125, 0.5],
        [-0.055555552, -0.5, -0.25],
        [-0.30555558, 0.5, -0.25],
        [0.19444446, -0.5, 0.25],
        [0.19444446, 0.5, -0.25],
        [-0.24305557, -0.4375, 0.5],
        [0.49999994, -0.25, 0.0],
        [-0.30555558, -0.5, 0.0],
        [-0.50000006, -0.25, -0.5],
        [-0.50000006, -0.5, -0.25],
        [0.49999994, 0.125, -0.375],
        [0.13194446, 0.5, -0.0625],
        [-0.11805557, -0.3125, 0.5],
        [-0.08680556, -0.15625, 0.5],
        [-0.30555558, 0.5, 0.25],
        [-0.30555558, -0.5, -0.25],
        [-0.30555558, 0.5, 0.0],
        [-0.30555558, 0.5, -0.5],
        [0.19444446, -0.5, 0.0],
        [-0.50000006, 0.5, -0.25],
        [-0.50000006, 0.25, 0.5],
        [0.49999994, -0.25, 0.5],
        [-0.50000006, 0.25, -0.5],
        [-0.055555552, 0.5, -0.25],
        [0.49999994, 0.5, -0.25],
        [0.49999994, -0.5, 0.25],
        [-0.50000006, -0.25, 0.5],
        [0.49999994, -0.5, -0.25],
        [-0.30555558, -0.5, -0.5],
        [-0.18055557, 0.5, -0.375],
        [-0.18055557, -0.125, 0.5],
        [0.069444455, 0.5, -0.125],
        [0.25694448, -0.4375, 0.5],
        [-0.36805558, -0.0625, 0.5],
        [-0.08680556, -0.40625, 0.5],
        [-0.18055557, -0.5, -0.125],
        [-0.18055557, 0.5, -0.125],
        [0.069444455, -0.125, 0.5],
        [0.069444455, -0.5, 0.125],
        [0.069444455, -0.5, -0.125],
        [-0.43055558, 0.5, -0.125],
        [-0.50000006, -0.125, -0.125],
        [0.069444455, 0.5, 0.125],
        [0.31944448, -0.5, 0.125],
        [-0.43055558, -0.5, -0.375],
        [0.16319446, 0.5, 0.09375],
        [-0.18055557, 0.5, 0.125],
        [-0.18055557, -0.5, -0.375],
        [0.31944448, -0.125, 0.5],
    ];
    let indices = vec![
        63, 32, 8, 33, 34, 11, 27, 18, 46, 69, 18, 58, 69, 58, 53, 1, 28, 9, 68, 19, 22, 4, 48, 19,
        23, 50, 38, 0, 62, 29, 67, 63, 8, 27, 45, 18, 67, 8, 37, 20, 24, 5, 59, 39, 24, 66, 63, 7,
        6, 15, 29, 25, 7, 45, 11, 1, 26, 11, 41, 47, 51, 58, 18, 53, 20, 5, 12, 48, 27, 60, 9, 22,
        6, 44, 25, 15, 31, 27, 65, 49, 36, 65, 36, 28, 40, 23, 2, 6, 25, 45, 48, 39, 19, 51, 18, 7,
        35, 3, 7, 54, 41, 11, 40, 43, 62, 41, 21, 3, 29, 19, 49, 2, 43, 40, 21, 54, 51, 21, 41, 54,
        47, 16, 40, 64, 39, 12, 64, 12, 46, 7, 18, 45, 22, 9, 56, 22, 19, 60, 6, 13, 43, 23, 57,
        44, 23, 61, 37, 29, 62, 13, 62, 14, 1, 62, 43, 13, 24, 46, 5, 24, 64, 46, 62, 0, 30, 61,
        40, 16, 52, 44, 8, 61, 16, 37, 26, 33, 11, 55, 20, 53, 27, 48, 4, 13, 6, 29, 69, 5, 42, 1,
        9, 20, 28, 56, 9, 30, 28, 14, 40, 10, 47, 60, 19, 39, 60, 39, 9, 43, 17, 6, 62, 1, 10, 1,
        47, 10, 59, 20, 9, 59, 9, 39, 30, 0, 28, 3, 37, 16, 31, 45, 27, 7, 25, 66, 32, 52, 8, 33,
        53, 58, 33, 55, 53, 66, 25, 32, 34, 51, 11, 29, 15, 19, 37, 35, 67, 46, 12, 27, 57, 37, 8,
        57, 8, 44, 54, 11, 51, 1, 11, 47, 56, 28, 36, 46, 42, 5, 35, 37, 3, 35, 7, 63, 56, 36, 22,
        36, 68, 22, 65, 28, 0, 51, 7, 3, 49, 65, 0, 38, 2, 23, 3, 16, 41, 55, 33, 26, 20, 59, 24,
        39, 64, 24, 39, 48, 12, 20, 26, 1, 68, 49, 19, 68, 36, 49, 40, 62, 10, 40, 61, 23, 37, 57,
        23, 4, 19, 15, 52, 32, 25, 52, 25, 44, 26, 20, 55, 6, 31, 15, 38, 17, 43, 41, 16, 47, 42,
        18, 69, 15, 27, 4, 43, 2, 38, 30, 14, 62, 44, 50, 23, 44, 6, 17, 35, 63, 67, 31, 6, 45, 1,
        14, 28, 63, 66, 32, 69, 53, 5, 58, 34, 33, 42, 46, 18, 49, 0, 29, 51, 34, 58, 51, 3, 21,
        50, 17, 38, 50, 44, 17,
    ];
    let (result_vertices, result_indices) = IsotropicRemesh::<f32, _>::new(&vertices, &indices)?
        .with_target_edge_length(2.0_f32)?
        .with_default_split_multiplier()?
        .with_default_collapse_multiplier()?
        .without_smooth_weight()?
        .with_flip_edges(FlipStrategy::Valence)?
        .run(11)?;

    assert_eq!(result_vertices.len(), 8, "result_vertices.len() mismatch");
    assert_eq!(result_indices.len(), 36, "result_indices.len() mismatch");
    Ok(())
}

#[test]
fn test_combined_8() -> Result<(), RemeshError> {
    let vertices = vec![
        [-0.5, -0.5, -0.5],
        [-0.5, -0.5, 0.5],
        [-0.5, 0.5, -0.5],
        [-0.5, 0.5, 0.5],
        [0.5, -0.5, -0.5],
        [0.5, -0.5, 0.5],
        [0.5, 0.5, -0.5],
        [0.5, 0.5, 0.5],
        [0.171875, -0.5, -0.5],
        [-0.3125, 0.5, 0.5],
        [0.5, -0.5, -0.328125],
    ];
    let indices = vec![
        3, 9, 2, 7, 9, 5, 2, 0, 1, 1, 9, 3, 10, 5, 8, 7, 5, 10, 10, 6, 7, 0, 2, 8, 6, 2, 9, 3, 2,
        1, 5, 9, 1, 4, 10, 8, 6, 9, 7, 6, 8, 2, 1, 0, 5, 4, 8, 6, 5, 0, 8, 4, 6, 10,
    ];
    let (result_vertices, result_indices) = IsotropicRemesh::<f32, _>::new(&vertices, &indices)?
        .with_target_edge_length(1.2_f32)?
        .with_default_split_multiplier()?
        .with_default_collapse_multiplier()?
        .without_smooth_weight()?
        .with_flip_edges(FlipStrategy::Valence)?
        .run(10)?;

    assert_eq!(result_vertices.len(), 8, "result_vertices.len() mismatch");
    assert_eq!(result_indices.len(), 36, "result_indices.len() mismatch");
    Ok(())
}

#[test]
fn test_combined_9() -> Result<(), RemeshError> {
    let vertices: Vec<vector_traits::glam::Vec3> = [
        [-0.5_f32, -0.5, -0.5],
        [-0.5, -0.5, 0.5],
        [-0.5, 0.5, -0.5],
        [-0.5, 0.5, 0.5],
        [0.5, -0.5, -0.5],
        [0.5, -0.5, 0.5],
        [0.5, 0.5, -0.5],
        [0.5, 0.5, 0.5],
        [0.171875, -0.5, -0.5],
        [-0.3125, 0.5, 0.5],
        [0.5, -0.5, -0.328125],
    ]
    .into_iter()
    .map(|v| v.into())
    .collect();

    let indices = vec![
        3, 9, 2, 7, 9, 5, 2, 0, 1, 1, 9, 3, 10, 5, 8, 7, 5, 10, 10, 6, 7, 0, 2, 8, 6, 2, 9, 3, 2,
        1, 5, 9, 1, 4, 10, 8, 6, 9, 7, 6, 8, 2, 1, 0, 5, 4, 8, 6, 5, 0, 8, 4, 6, 10,
    ];
    let (result_vertices, result_indices) =
        IsotropicRemesh::<f32, _, true>::new(&vertices, &indices)?
            .with_target_edge_length(0.5_f32)?
            .with_default_split_multiplier()?
            .with_default_collapse_multiplier()?
            .with_default_smooth_weight()?
            .with_flip_edges(FlipStrategy::Valence)?
            .run(1)?;

    assert_eq!(result_vertices.len(), 23, "result_vertices.len() mismatch");
    assert_eq!(result_indices.len(), 126, "result_indices.len() mismatch");
    Ok(())
}

// this tests std::mem::transmute::<Vec<S::Vec3>, Vec<V>>(vertices),
#[test]
fn test_combined_10() -> Result<(), RemeshError> {
    let vertices: Vec<vector_traits::glam::Vec3> = [
        [-0.5_f32, -0.5, -0.5],
        [-0.5, -0.5, 0.5],
        [-0.5, 0.5, -0.5],
        [-0.5, 0.5, 0.5],
        [0.5, -0.5, -0.5],
        [0.5, -0.5, 0.5],
        [0.5, 0.5, -0.5],
        [0.5, 0.5, 0.5],
        [0.171875, -0.5, -0.5],
        [-0.3125, 0.5, 0.5],
        [0.5, -0.5, -0.328125],
    ]
    .into_iter()
    .map(|v| v.into())
    .collect();

    let indices = vec![
        3, 9, 2, 7, 9, 5, 2, 0, 1, 1, 9, 3, 10, 5, 8, 7, 5, 10, 10, 6, 7, 0, 2, 8, 6, 2, 9, 3, 2,
        1, 5, 9, 1, 4, 10, 8, 6, 9, 7, 6, 8, 2, 1, 0, 5, 4, 8, 6, 5, 0, 8, 4, 6, 10,
    ];
    let (result_vertices, result_indices) =
        IsotropicRemesh::<f32, _, true>::new(&vertices, &indices)?
            .with_target_edge_length(0.5_f32)?
            .with_split_edges(SplitStrategy::Disabled)?
            .with_collapse_edges(CollapseStrategy::Disabled)?
            .with_default_smooth_weight()?
            .with_flip_edges(FlipStrategy::Valence)?
            .run(1)?;

    assert_eq!(result_vertices.len(), 11, "result_vertices.len() mismatch");
    assert_eq!(result_indices.len(), 54, "result_indices.len() mismatch");
    Ok(())
}

#[test]
fn test_combined_11() -> Result<(), RemeshError> {
    let vertices = [
        [0.0, 0.0, 0.0],
        [1.0, 0.0, 0.0],
        [0.49999994, 0.0, 1.0],
        [0.0, 1.0, 1.0],
        [0.49999994, 1.0, 0.0],
        [0.0, 0.0, 1.0],
        [0.49999994, 0.0, 0.0],
    ];
    let indices = [
        0, 5, 3, 5, 0, 2, 3, 2, 4, 0, 6, 2, 0, 4, 6, 2, 1, 4, 2, 6, 1, 4, 1, 6, 3, 5, 2, 4, 0, 3,
    ];
    let (result_vertices, result_indices) =
        IsotropicRemesh::<f32, _, true>::new(&vertices, &indices)?
            .with_target_edge_length(0.5_f32)?
            .with_default_split_multiplier()?
            .with_collapse_qem_threshold(0.10)?
            .without_smooth_weight()?
            .with_default_flip_edges()?
            .with_crease_angle_threshold(-160.0)?
            .run(5)?;

    assert_eq!(result_vertices.len(), 24, "result_vertices.len() mismatch");
    assert_eq!(result_indices.len(), 132, "result_indices.len() mismatch");
    Ok(())
}

#[test]
fn test_combined_12() -> Result<(), RemeshError> {
    let vertices = [
        [1.0901845, 1.5003837, -0.21215399],
        [2.0901845, 1.5003837, -0.21215399],
        [1.5901845, 1.5003837, 0.787846],
        [1.0901845, 2.5003839, 0.787846],
        [1.5901845, 2.5003839, -0.21215399],
        [1.0901845, 1.5003837, 0.787846],
        [1.5901845, 1.5003837, -0.21215399],
    ];
    let indices = [
        0, 5, 3, 5, 0, 2, 3, 2, 4, 0, 6, 2, 0, 4, 6, 2, 1, 4, 2, 6, 1, 4, 1, 6, 3, 5, 2, 4, 0, 3,
    ];
    let (result_vertices, result_indices) =
        IsotropicRemesh::<f32, _, true>::new(&vertices, &indices)?
            .with_target_edge_length(0.1_f32)?
            .with_default_split_multiplier()?
            .with_collapse_qem_threshold(0.10)?
            .without_smooth_weight()?
            .with_default_flip_edges()?
            .with_crease_angle_threshold(-160.0)?
            .run(5)?;

    assert_eq!(result_vertices.len(), 340, "result_vertices.len() mismatch");
    assert_eq!(result_indices.len(), 2028, "result_indices.len() mismatch");
    Ok(())
}

#[test]
fn test_combined_13() -> Result<(), RemeshError> {
    let vertices = [
        [1.0901845, 1.5003837, -0.21215399],
        [2.0901845, 1.5003837, -0.21215399],
        [1.5901845, 1.5003837, 0.787846],
        [1.0901845, 2.5003839, 0.787846],
        [1.5901845, 2.5003839, -0.21215399],
        [1.0901845, 1.5003837, 0.787846],
        [1.5901845, 1.5003837, -0.21215399],
    ];
    let indices = [
        0, 5, 3, 5, 0, 2, 3, 2, 4, 0, 6, 2, 0, 4, 6, 2, 1, 4, 2, 6, 1, 4, 1, 6, 3, 5, 2, 4, 0, 3,
    ];
    let (result_vertices, result_indices) =
        IsotropicRemesh::<f32, _, true>::new(&vertices, &indices)?
            .with_target_edge_length(0.2_f32)?
            .with_default_split_multiplier()?
            .with_collapse_qem_threshold(0.10)?
            .without_smooth_weight()?
            .with_default_flip_edges()?
            .with_crease_angle_threshold(-160.0)?
            .run(8)?;

    assert_eq!(result_vertices.len(), 103, "result_vertices.len() mismatch");
    assert_eq!(result_indices.len(), 606, "result_indices.len() mismatch");
    Ok(())
}

#[test]
fn test_combined_14() -> Result<(), RemeshError> {
    let vertices = [
        [1.0901845, 1.5003837, -0.212154],
        [2.0901845, 1.5003837, -0.21215399],
        [1.5901845, 1.5003837, 0.787846],
        [1.0901845, 2.5003839, 0.787846],
        [1.5901845, 2.5003839, -0.21215399],
        [1.0901845, 1.5003837, 0.787846],
        [1.5901845, 1.5003837, -0.21215399],
        [1.5901845, 2.0003839, 0.28784603],
        [1.0901845, 1.9972723, 0.28473443],
        [1.3401845, 2.0003839, 0.787846],
        [1.2501726, 1.8203601, -0.21215399],
        [1.8401845, 1.7503839, 0.037846014],
        [1.8401845, 1.5003837, 0.28784603],
        [1.3401845, 2.2503839, 0.537846],
        [1.0901845, 2.0003839, 0.787846],
        [1.0901845, 1.7503839, 0.537846],
        [1.8401845, 2.0003839, -0.21215399],
        [1.3401845, 2.5003839, 0.28784603],
        [1.0901845, 1.5003837, 0.28784603],
        [1.4318931, 2.1838012, -0.21215399],
        [1.3401845, 1.5003837, 0.537846],
        [1.4026845, 1.5003837, 0.16284601],
        [1.0901845, 1.7488279, 0.0362902],
        [1.5901845, 1.7503839, 0.537846],
        [1.0901845, 2.2503839, 0.537846],
        [1.5901845, 2.2503839, 0.037846014],
    ];
    let indices = [
        24, 15, 14, 21, 6, 12, 13, 9, 7, 0, 6, 21, 0, 10, 6, 23, 12, 11, 2, 20, 21, 21, 18, 0, 14,
        5, 9, 11, 1, 16, 20, 5, 18, 22, 10, 0, 9, 2, 23, 9, 5, 2, 10, 16, 6, 19, 4, 16, 11, 7, 23,
        11, 25, 7, 12, 1, 11, 12, 6, 1, 20, 2, 5, 15, 22, 18, 13, 3, 9, 13, 17, 3, 15, 24, 8, 14,
        9, 3, 15, 5, 14, 15, 18, 5, 16, 4, 25, 16, 10, 19, 17, 19, 8, 17, 25, 4, 21, 12, 2, 17, 8,
        24, 8, 10, 22, 6, 16, 1, 23, 2, 12, 25, 13, 7, 25, 17, 13, 22, 0, 18, 8, 22, 15, 20, 18,
        21, 10, 8, 19, 23, 7, 9, 19, 17, 4, 24, 3, 17, 24, 14, 3, 25, 11, 16,
    ];
    let (result_vertices, result_indices) =
        IsotropicRemesh::<f32, _, false>::new(&vertices, &indices)?
            .with_target_edge_length(2.0_f32)?
            .without_split_edges()?
            .with_collapse_qem_threshold(0.01)?
            .without_smooth_weight()?
            .without_flip_edges()?
            .with_crease_angle_threshold(-160.0)?
            .run(1)?;

    assert_eq!(result_vertices.len(), 15, "result_vertices.len() mismatch");
    assert_eq!(result_indices.len(), 78, "result_indices.len() mismatch");
    Ok(())
}

#[test]
fn test_combined_15() -> Result<(), RemeshError> {
    let vertices = vec![
        [2.0901845, 1.5003837, -0.21215399],
        [1.5901845, 1.5003837, 0.787846],
        [1.0901845, 2.5003839, 0.787846],
        [1.0901845, 1.5003837, -0.21215399],
        [1.8401845, 1.5003837, 0.28784603],
        [1.0901845, 1.5003837, 0.787846],
        [1.9692942, 1.7421645, -0.21215399],
        [1.5901845, 2.5003839, -0.21215399],
        [1.0901845, 1.9437729, 0.23123504],
    ];
    let indices = vec![
        8, 5, 2, 6, 3, 7, 4, 7, 2, 3, 0, 4, 4, 2, 1, 5, 8, 3, 8, 2, 7, 4, 0, 6, 2, 5, 1, 7, 4, 6,
        1, 5, 3, 1, 3, 4, 3, 8, 7, 3, 6, 0,
    ];

    let (result_vertices, result_indices) =
        IsotropicRemesh::<f32, _, false>::new(&vertices, &indices)?
            .with_target_edge_length(2.0_f32)?
            .without_split_edges()?
            .with_collapse_qem_threshold(0.01)?
            .without_smooth_weight()?
            .without_flip_edges()?
            .with_crease_angle_threshold(-160.0)?
            .run(2)?;

    assert_eq!(result_vertices.len(), 6, "result_vertices.len() mismatch");
    assert_eq!(result_indices.len(), 24, "result_indices.len() mismatch");
    Ok(())
}