okgeometry-api 1.1.18 → 1.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -470,6 +470,35 @@ export function mesh_boolean_intersection(vertex_count_a, buffer_a, vertex_count
470
470
  return v3;
471
471
  }
472
472
 
473
+ /**
474
+ * Debug helper: run the live kernel-mesh boolean entrypoint and surface the
475
+ * exact error instead of collapsing it into an empty output buffer.
476
+ * @param {number} vertex_count_a
477
+ * @param {Float64Array} buffer_a
478
+ * @param {number} vertex_count_b
479
+ * @param {Float64Array} buffer_b
480
+ * @param {string} operation
481
+ * @returns {string}
482
+ */
483
+ export function mesh_boolean_kernel_mesh_debug(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation) {
484
+ let deferred4_0;
485
+ let deferred4_1;
486
+ try {
487
+ const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
488
+ const len0 = WASM_VECTOR_LEN;
489
+ const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
490
+ const len1 = WASM_VECTOR_LEN;
491
+ const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
492
+ const len2 = WASM_VECTOR_LEN;
493
+ const ret = wasm.mesh_boolean_kernel_mesh_debug(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
494
+ deferred4_0 = ret[0];
495
+ deferred4_1 = ret[1];
496
+ return getStringFromWasm0(ret[0], ret[1]);
497
+ } finally {
498
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
499
+ }
500
+ }
501
+
473
502
  /**
474
503
  * @returns {number}
475
504
  */
@@ -484,24 +513,320 @@ export function mesh_boolean_last_debug_marker() {
484
513
  * @param {number} vertex_count_b
485
514
  * @param {Float64Array} buffer_b
486
515
  * @param {string} operation
487
- * @returns {Float64Array}
516
+ * @param {string} cleanup_stage
517
+ * @returns {string}
518
+ */
519
+ export function mesh_boolean_manifold_port_cleanup_triangle_dump(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation, cleanup_stage) {
520
+ let deferred5_0;
521
+ let deferred5_1;
522
+ try {
523
+ const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
524
+ const len0 = WASM_VECTOR_LEN;
525
+ const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
526
+ const len1 = WASM_VECTOR_LEN;
527
+ const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
528
+ const len2 = WASM_VECTOR_LEN;
529
+ const ptr3 = passStringToWasm0(cleanup_stage, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
530
+ const len3 = WASM_VECTOR_LEN;
531
+ const ret = wasm.mesh_boolean_manifold_port_cleanup_triangle_dump(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2, ptr3, len3);
532
+ deferred5_0 = ret[0];
533
+ deferred5_1 = ret[1];
534
+ return getStringFromWasm0(ret[0], ret[1]);
535
+ } finally {
536
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
537
+ }
538
+ }
539
+
540
+ /**
541
+ * @param {number} vertex_count_a
542
+ * @param {Float64Array} buffer_a
543
+ * @param {number} vertex_count_b
544
+ * @param {Float64Array} buffer_b
545
+ * @param {string} operation
546
+ * @param {number} face_index
547
+ * @returns {string}
548
+ */
549
+ export function mesh_boolean_manifold_port_face2tri_face_debug(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation, face_index) {
550
+ let deferred4_0;
551
+ let deferred4_1;
552
+ try {
553
+ const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
554
+ const len0 = WASM_VECTOR_LEN;
555
+ const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
556
+ const len1 = WASM_VECTOR_LEN;
557
+ const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
558
+ const len2 = WASM_VECTOR_LEN;
559
+ const ret = wasm.mesh_boolean_manifold_port_face2tri_face_debug(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2, face_index);
560
+ deferred4_0 = ret[0];
561
+ deferred4_1 = ret[1];
562
+ return getStringFromWasm0(ret[0], ret[1]);
563
+ } finally {
564
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
565
+ }
566
+ }
567
+
568
+ /**
569
+ * @param {number} vertex_count_a
570
+ * @param {Float64Array} buffer_a
571
+ * @param {number} vertex_count_b
572
+ * @param {Float64Array} buffer_b
573
+ * @param {string} operation
574
+ * @param {number} face_index
575
+ * @param {number} rotate_offset
576
+ * @param {boolean} reverse
577
+ * @returns {string}
578
+ */
579
+ export function mesh_boolean_manifold_port_face2tri_face_transform_debug(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation, face_index, rotate_offset, reverse) {
580
+ let deferred4_0;
581
+ let deferred4_1;
582
+ try {
583
+ const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
584
+ const len0 = WASM_VECTOR_LEN;
585
+ const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
586
+ const len1 = WASM_VECTOR_LEN;
587
+ const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
588
+ const len2 = WASM_VECTOR_LEN;
589
+ const ret = wasm.mesh_boolean_manifold_port_face2tri_face_transform_debug(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2, face_index, rotate_offset, reverse);
590
+ deferred4_0 = ret[0];
591
+ deferred4_1 = ret[1];
592
+ return getStringFromWasm0(ret[0], ret[1]);
593
+ } finally {
594
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
595
+ }
596
+ }
597
+
598
+ /**
599
+ * @param {number} vertex_count_a
600
+ * @param {Float64Array} buffer_a
601
+ * @param {number} vertex_count_b
602
+ * @param {Float64Array} buffer_b
603
+ * @param {string} operation
604
+ * @returns {string}
605
+ */
606
+ export function mesh_boolean_manifold_port_final_triangle_dump(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation) {
607
+ let deferred4_0;
608
+ let deferred4_1;
609
+ try {
610
+ const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
611
+ const len0 = WASM_VECTOR_LEN;
612
+ const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
613
+ const len1 = WASM_VECTOR_LEN;
614
+ const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
615
+ const len2 = WASM_VECTOR_LEN;
616
+ const ret = wasm.mesh_boolean_manifold_port_final_triangle_dump(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
617
+ deferred4_0 = ret[0];
618
+ deferred4_1 = ret[1];
619
+ return getStringFromWasm0(ret[0], ret[1]);
620
+ } finally {
621
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
622
+ }
623
+ }
624
+
625
+ /**
626
+ * @param {number} vertex_count_a
627
+ * @param {Float64Array} buffer_a
628
+ * @param {number} vertex_count_b
629
+ * @param {Float64Array} buffer_b
630
+ * @param {string} operation
631
+ * @returns {string}
632
+ */
633
+ export function mesh_boolean_manifold_port_flag_edge_attempts_debug(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation) {
634
+ let deferred4_0;
635
+ let deferred4_1;
636
+ try {
637
+ const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
638
+ const len0 = WASM_VECTOR_LEN;
639
+ const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
640
+ const len1 = WASM_VECTOR_LEN;
641
+ const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
642
+ const len2 = WASM_VECTOR_LEN;
643
+ const ret = wasm.mesh_boolean_manifold_port_flag_edge_attempts_debug(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
644
+ deferred4_0 = ret[0];
645
+ deferred4_1 = ret[1];
646
+ return getStringFromWasm0(ret[0], ret[1]);
647
+ } finally {
648
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
649
+ }
650
+ }
651
+
652
+ /**
653
+ * @param {number} vertex_count_a
654
+ * @param {Float64Array} buffer_a
655
+ * @param {number} vertex_count_b
656
+ * @param {Float64Array} buffer_b
657
+ * @param {string} operation
658
+ * @returns {string}
659
+ */
660
+ export function mesh_boolean_manifold_port_intersections_debug(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation) {
661
+ let deferred4_0;
662
+ let deferred4_1;
663
+ try {
664
+ const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
665
+ const len0 = WASM_VECTOR_LEN;
666
+ const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
667
+ const len1 = WASM_VECTOR_LEN;
668
+ const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
669
+ const len2 = WASM_VECTOR_LEN;
670
+ const ret = wasm.mesh_boolean_manifold_port_intersections_debug(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
671
+ deferred4_0 = ret[0];
672
+ deferred4_1 = ret[1];
673
+ return getStringFromWasm0(ret[0], ret[1]);
674
+ } finally {
675
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
676
+ }
677
+ }
678
+
679
+ /**
680
+ * @param {number} vertex_count_a
681
+ * @param {Float64Array} buffer_a
682
+ * @param {number} vertex_count_b
683
+ * @param {Float64Array} buffer_b
684
+ * @param {string} operation
685
+ * @param {number} face_p
686
+ * @param {number} face_q
687
+ * @returns {string}
688
+ */
689
+ export function mesh_boolean_manifold_port_new_edge_bucket_debug(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation, face_p, face_q) {
690
+ let deferred4_0;
691
+ let deferred4_1;
692
+ try {
693
+ const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
694
+ const len0 = WASM_VECTOR_LEN;
695
+ const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
696
+ const len1 = WASM_VECTOR_LEN;
697
+ const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
698
+ const len2 = WASM_VECTOR_LEN;
699
+ const ret = wasm.mesh_boolean_manifold_port_new_edge_bucket_debug(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2, face_p, face_q);
700
+ deferred4_0 = ret[0];
701
+ deferred4_1 = ret[1];
702
+ return getStringFromWasm0(ret[0], ret[1]);
703
+ } finally {
704
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
705
+ }
706
+ }
707
+
708
+ /**
709
+ * @param {string} cleanup_stage
710
+ * @returns {string}
711
+ */
712
+ export function mesh_boolean_manifold_port_overlap_boxes_cleanup_triangle_dump(cleanup_stage) {
713
+ let deferred2_0;
714
+ let deferred2_1;
715
+ try {
716
+ const ptr0 = passStringToWasm0(cleanup_stage, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
717
+ const len0 = WASM_VECTOR_LEN;
718
+ const ret = wasm.mesh_boolean_manifold_port_overlap_boxes_cleanup_triangle_dump(ptr0, len0);
719
+ deferred2_0 = ret[0];
720
+ deferred2_1 = ret[1];
721
+ return getStringFromWasm0(ret[0], ret[1]);
722
+ } finally {
723
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
724
+ }
725
+ }
726
+
727
+ /**
728
+ * @param {number} face_index
729
+ * @returns {string}
730
+ */
731
+ export function mesh_boolean_manifold_port_overlap_boxes_face2tri_face_debug(face_index) {
732
+ let deferred1_0;
733
+ let deferred1_1;
734
+ try {
735
+ const ret = wasm.mesh_boolean_manifold_port_overlap_boxes_face2tri_face_debug(face_index);
736
+ deferred1_0 = ret[0];
737
+ deferred1_1 = ret[1];
738
+ return getStringFromWasm0(ret[0], ret[1]);
739
+ } finally {
740
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
741
+ }
742
+ }
743
+
744
+ /**
745
+ * @param {number} vertex_count_a
746
+ * @param {Float64Array} buffer_a
747
+ * @param {number} vertex_count_b
748
+ * @param {Float64Array} buffer_b
749
+ * @param {string} operation
750
+ * @param {number} face_index
751
+ * @returns {string}
752
+ */
753
+ export function mesh_boolean_manifold_port_raw_face_debug(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation, face_index) {
754
+ let deferred4_0;
755
+ let deferred4_1;
756
+ try {
757
+ const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
758
+ const len0 = WASM_VECTOR_LEN;
759
+ const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
760
+ const len1 = WASM_VECTOR_LEN;
761
+ const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
762
+ const len2 = WASM_VECTOR_LEN;
763
+ const ret = wasm.mesh_boolean_manifold_port_raw_face_debug(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2, face_index);
764
+ deferred4_0 = ret[0];
765
+ deferred4_1 = ret[1];
766
+ return getStringFromWasm0(ret[0], ret[1]);
767
+ } finally {
768
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
769
+ }
770
+ }
771
+
772
+ /**
773
+ * @param {number} vertex_count_a
774
+ * @param {Float64Array} buffer_a
775
+ * @param {number} vertex_count_b
776
+ * @param {Float64Array} buffer_b
777
+ * @param {string} operation
778
+ * @returns {string}
779
+ */
780
+ export function mesh_boolean_manifold_port_short_edge_attempts_debug(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation) {
781
+ let deferred4_0;
782
+ let deferred4_1;
783
+ try {
784
+ const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
785
+ const len0 = WASM_VECTOR_LEN;
786
+ const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
787
+ const len1 = WASM_VECTOR_LEN;
788
+ const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
789
+ const len2 = WASM_VECTOR_LEN;
790
+ const ret = wasm.mesh_boolean_manifold_port_short_edge_attempts_debug(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
791
+ deferred4_0 = ret[0];
792
+ deferred4_1 = ret[1];
793
+ return getStringFromWasm0(ret[0], ret[1]);
794
+ } finally {
795
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
796
+ }
797
+ }
798
+
799
+ /**
800
+ * @param {number} vertex_count_a
801
+ * @param {Float64Array} buffer_a
802
+ * @param {number} vertex_count_b
803
+ * @param {Float64Array} buffer_b
804
+ * @param {string} operation
805
+ * @param {number} edge
806
+ * @returns {string}
488
807
  */
489
- export function mesh_boolean_operation(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation) {
490
- const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
491
- const len0 = WASM_VECTOR_LEN;
492
- const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
493
- const len1 = WASM_VECTOR_LEN;
494
- const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
495
- const len2 = WASM_VECTOR_LEN;
496
- const ret = wasm.mesh_boolean_operation(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
497
- var v4 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
498
- wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
499
- return v4;
808
+ export function mesh_boolean_manifold_port_single_swap_triangle_dump(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation, edge) {
809
+ let deferred4_0;
810
+ let deferred4_1;
811
+ try {
812
+ const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
813
+ const len0 = WASM_VECTOR_LEN;
814
+ const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
815
+ const len1 = WASM_VECTOR_LEN;
816
+ const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
817
+ const len2 = WASM_VECTOR_LEN;
818
+ const ret = wasm.mesh_boolean_manifold_port_single_swap_triangle_dump(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2, edge);
819
+ deferred4_0 = ret[0];
820
+ deferred4_1 = ret[1];
821
+ return getStringFromWasm0(ret[0], ret[1]);
822
+ } finally {
823
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
824
+ }
500
825
  }
501
826
 
502
827
  /**
503
- * Debug helper: perform boolean operation and return a textual status,
504
- * including kernel error reason on failure.
828
+ * Debug helper: run the isolated direct-port pipeline and surface stage counts
829
+ * so we can see where geometry diverges without involving legacy routing.
505
830
  * @param {number} vertex_count_a
506
831
  * @param {Float64Array} buffer_a
507
832
  * @param {number} vertex_count_b
@@ -509,7 +834,7 @@ export function mesh_boolean_operation(vertex_count_a, buffer_a, vertex_count_b,
509
834
  * @param {string} operation
510
835
  * @returns {string}
511
836
  */
512
- export function mesh_boolean_operation_debug(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation) {
837
+ export function mesh_boolean_manifold_port_stage_debug(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation) {
513
838
  let deferred4_0;
514
839
  let deferred4_1;
515
840
  try {
@@ -519,7 +844,7 @@ export function mesh_boolean_operation_debug(vertex_count_a, buffer_a, vertex_co
519
844
  const len1 = WASM_VECTOR_LEN;
520
845
  const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
521
846
  const len2 = WASM_VECTOR_LEN;
522
- const ret = wasm.mesh_boolean_operation_debug(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
847
+ const ret = wasm.mesh_boolean_manifold_port_stage_debug(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
523
848
  deferred4_0 = ret[0];
524
849
  deferred4_1 = ret[1];
525
850
  return getStringFromWasm0(ret[0], ret[1]);
@@ -529,157 +854,107 @@ export function mesh_boolean_operation_debug(vertex_count_a, buffer_a, vertex_co
529
854
  }
530
855
 
531
856
  /**
532
- * Perform boolean operation and return stage-level profiling data followed by
533
- * the result mesh buffer.
534
- *
535
- * Output format:
536
- * [profile_len(=95), broadphase_ms, segments_ms, split_ms,
537
- * split_touched_faces_a, split_source_faces_a, split_touched_faces_b, split_source_faces_b,
538
- * classify_ms, classify_seed_ms, classify_strict_ms, classify_open_component_ms,
539
- * extract_ms, extract_primary_ms, extract_fallback_ms,
540
- * cleanup_ms, finalize_ms, finalize_cap_ms, finalize_recap_ms, finalize_stitch_ms,
541
- * pair_accepted, pair_rejected, pair_degenerate,
542
- * core_passes, core_total_ms, conservative_runs, conservative_ms, nudge_runs, nudge_ms,
543
- * recompose_runs, recompose_ms, repair_runs, repair_ms,
544
- * repair_loops, repair_loops_capped, repair_loop_vertices, repair_loop_max_vertices,
545
- * arrangement_adj_attempts, arrangement_adj_fast_hits, arrangement_adj_disabled_split_limit,
546
- * arrangement_adj_fallback_no_half_edges, arrangement_adj_fallback_collect_failed,
547
- * arrangement_adj_fallback_non_manifold, arrangement_adj_fallback_loop_mismatch,
548
- * arrangement_adj_fallback_twin_mismatch, arrangement_adj_fallback_invalid_face_index,
549
- * arrangement_adj_non_manifold_edges_total, arrangement_adj_non_manifold_limit_total,
550
- * arrangement_adj_non_manifold_tolerated_attempts,
551
- * arrangement_adj_fallback_non_manifold_excess_total,
552
- * subtraction_ultra_cases, subtraction_ultra_component_fallback_runs,
553
- * subtraction_ultra_open_bounds_total, subtraction_ultra_open_bounds_max,
554
- * subtraction_ultra_best_boundary_total, subtraction_ultra_best_non_manifold_total,
555
- * subtraction_ultra_scoped_faces_total, subtraction_ultra_scoped_faces_max,
556
- * subtraction_ultra_scoped_strict_evals_total, subtraction_ultra_scoped_strict_evals_max,
557
- * finalize_stitch_rebuild_ms, finalize_stitch_recap_ms,
558
- * finalize_stitch_attempts, finalize_stitch_kept,
559
- * finalize_stitch_rebuild_collect_ms, finalize_stitch_rebuild_weld_ms,
560
- * finalize_stitch_rebuild_commit_ms, finalize_stitch_rebuild_faces_in,
561
- * finalize_stitch_rebuild_faces_out,
562
- * whole_partial_attempts, whole_partial_accepts,
563
- * whole_partial_total_ms, whole_partial_split_ms,
564
- * whole_partial_boundary_build_ms,
565
- * whole_partial_split_triangle_fast_faces,
566
- * whole_partial_split_cdt_faces,
567
- * whole_partial_split_cdt_points_total,
568
- * whole_partial_split_cdt_constraints_total,
569
- * whole_partial_split_cdt_segment_constraints_total,
570
- * whole_partial_split_cdt_triangles_total,
571
- * whole_partial_triangle_cdt_single_segment_faces,
572
- * whole_partial_triangle_cdt_two_segment_faces,
573
- * whole_partial_triangle_cdt_three_plus_segment_faces,
574
- * whole_partial_triangle_cdt_all_boundary_segment_faces,
575
- * whole_partial_triangle_cdt_mixed_boundary_segment_faces,
576
- * whole_partial_triangle_cdt_any_interior_segment_faces,
577
- * whole_partial_classify_source_ms, whole_partial_classify_touched_ms,
578
- * whole_partial_extract_ms, whole_partial_extract_untouched_ms,
579
- * whole_partial_extract_interface_ms, whole_partial_extract_touched_ms,
580
- * whole_partial_finalize_ms,
581
- * whole_partial_interface_faces_total,
582
- * whole_partial_interface_faces_emitted,
583
- * whole_partial_interface_boundary_edge_hits,
584
- * whole_partial_interface_raw_edge_fallbacks,
585
- * whole_partial_touched_faces_total,
586
- * whole_partial_touched_faces_emitted,
587
- * whole_partial_touched_patch_attempts,
588
- * whole_partial_touched_patch_direct_regions,
589
- * whole_partial_touched_patch_triangulated_faces,
590
- * whole_partial_touched_fallback_faces,
591
- * whole_partial_touched_lineage_vertices,
592
- * whole_partial_touched_welded_vertices,
593
- * whole_partial_raw_boundary_untouched_edges,
594
- * whole_partial_raw_boundary_interface_edges,
595
- * whole_partial_raw_boundary_touched_edges,
596
- * whole_partial_raw_boundary_mixed_edges,
597
- * whole_partial_raw_non_manifold_untouched_edges,
598
- * whole_partial_raw_non_manifold_interface_edges,
599
- * whole_partial_raw_non_manifold_touched_edges,
600
- * whole_partial_raw_non_manifold_mixed_edges,
601
- * whole_partial_boundary_edges_total,
602
- * whole_partial_non_manifold_edges_total,
603
- * whole_partial_face_ratio_vs_a_total,
604
- * whole_partial_loop_plausible_total,
605
- * mesh_buffer...]
606
857
  * @param {number} vertex_count_a
607
858
  * @param {Float64Array} buffer_a
608
859
  * @param {number} vertex_count_b
609
860
  * @param {Float64Array} buffer_b
610
861
  * @param {string} operation
611
- * @returns {Float64Array}
862
+ * @returns {string}
612
863
  */
613
- export function mesh_boolean_operation_profiled(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation) {
614
- const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
615
- const len0 = WASM_VECTOR_LEN;
616
- const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
617
- const len1 = WASM_VECTOR_LEN;
618
- const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
619
- const len2 = WASM_VECTOR_LEN;
620
- const ret = wasm.mesh_boolean_operation_profiled(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
621
- var v4 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
622
- wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
623
- return v4;
864
+ export function mesh_boolean_manifold_port_swappable_edges_debug(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation) {
865
+ let deferred4_0;
866
+ let deferred4_1;
867
+ try {
868
+ const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
869
+ const len0 = WASM_VECTOR_LEN;
870
+ const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
871
+ const len1 = WASM_VECTOR_LEN;
872
+ const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
873
+ const len2 = WASM_VECTOR_LEN;
874
+ const ret = wasm.mesh_boolean_manifold_port_swappable_edges_debug(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
875
+ deferred4_0 = ret[0];
876
+ deferred4_1 = ret[1];
877
+ return getStringFromWasm0(ret[0], ret[1]);
878
+ } finally {
879
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
880
+ }
624
881
  }
625
882
 
626
883
  /**
627
- * Perform boolean subtraction on two meshes (A - B)
628
884
  * @param {number} vertex_count_a
629
885
  * @param {Float64Array} buffer_a
630
886
  * @param {number} vertex_count_b
631
887
  * @param {Float64Array} buffer_b
632
- * @returns {Float64Array}
888
+ * @param {string} operation
889
+ * @returns {string}
633
890
  */
634
- export function mesh_boolean_subtraction(vertex_count_a, buffer_a, vertex_count_b, buffer_b) {
635
- const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
636
- const len0 = WASM_VECTOR_LEN;
637
- const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
638
- const len1 = WASM_VECTOR_LEN;
639
- const ret = wasm.mesh_boolean_subtraction(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1);
640
- var v3 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
641
- wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
642
- return v3;
891
+ export function mesh_boolean_manifold_port_triangulated_triangle_dump(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation) {
892
+ let deferred4_0;
893
+ let deferred4_1;
894
+ try {
895
+ const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
896
+ const len0 = WASM_VECTOR_LEN;
897
+ const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
898
+ const len1 = WASM_VECTOR_LEN;
899
+ const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
900
+ const len2 = WASM_VECTOR_LEN;
901
+ const ret = wasm.mesh_boolean_manifold_port_triangulated_triangle_dump(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
902
+ deferred4_0 = ret[0];
903
+ deferred4_1 = ret[1];
904
+ return getStringFromWasm0(ret[0], ret[1]);
905
+ } finally {
906
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
907
+ }
643
908
  }
644
909
 
645
910
  /**
646
- * Perform boolean union on two meshes
647
911
  * @param {number} vertex_count_a
648
912
  * @param {Float64Array} buffer_a
649
913
  * @param {number} vertex_count_b
650
914
  * @param {Float64Array} buffer_b
915
+ * @param {string} operation
651
916
  * @returns {Float64Array}
652
917
  */
653
- export function mesh_boolean_union(vertex_count_a, buffer_a, vertex_count_b, buffer_b) {
918
+ export function mesh_boolean_operation(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation) {
654
919
  const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
655
920
  const len0 = WASM_VECTOR_LEN;
656
921
  const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
657
922
  const len1 = WASM_VECTOR_LEN;
658
- const ret = wasm.mesh_boolean_union(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1);
659
- var v3 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
923
+ const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
924
+ const len2 = WASM_VECTOR_LEN;
925
+ const ret = wasm.mesh_boolean_operation(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
926
+ var v4 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
660
927
  wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
661
- return v3;
928
+ return v4;
662
929
  }
663
930
 
664
931
  /**
932
+ * Debug helper: perform boolean operation and return a textual status,
933
+ * including kernel error reason on failure.
665
934
  * @param {number} vertex_count_a
666
935
  * @param {Float64Array} buffer_a
667
936
  * @param {number} vertex_count_b
668
937
  * @param {Float64Array} buffer_b
669
938
  * @param {string} operation
670
- * @returns {Float64Array}
939
+ * @returns {string}
671
940
  */
672
- export function mesh_boolean_whole_partial_candidate(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation) {
673
- const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
674
- const len0 = WASM_VECTOR_LEN;
675
- const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
676
- const len1 = WASM_VECTOR_LEN;
677
- const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
678
- const len2 = WASM_VECTOR_LEN;
679
- const ret = wasm.mesh_boolean_whole_partial_candidate(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
680
- var v4 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
681
- wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
682
- return v4;
941
+ export function mesh_boolean_operation_debug(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation) {
942
+ let deferred4_0;
943
+ let deferred4_1;
944
+ try {
945
+ const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
946
+ const len0 = WASM_VECTOR_LEN;
947
+ const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
948
+ const len1 = WASM_VECTOR_LEN;
949
+ const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
950
+ const len2 = WASM_VECTOR_LEN;
951
+ const ret = wasm.mesh_boolean_operation_debug(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
952
+ deferred4_0 = ret[0];
953
+ deferred4_1 = ret[1];
954
+ return getStringFromWasm0(ret[0], ret[1]);
955
+ } finally {
956
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
957
+ }
683
958
  }
684
959
 
685
960
  /**
@@ -688,40 +963,71 @@ export function mesh_boolean_whole_partial_candidate(vertex_count_a, buffer_a, v
688
963
  * @param {number} vertex_count_b
689
964
  * @param {Float64Array} buffer_b
690
965
  * @param {string} operation
966
+ * @returns {string}
967
+ */
968
+ export function mesh_boolean_port_triangle_dump(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation) {
969
+ let deferred4_0;
970
+ let deferred4_1;
971
+ try {
972
+ const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
973
+ const len0 = WASM_VECTOR_LEN;
974
+ const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
975
+ const len1 = WASM_VECTOR_LEN;
976
+ const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
977
+ const len2 = WASM_VECTOR_LEN;
978
+ const ret = wasm.mesh_boolean_port_triangle_dump(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
979
+ deferred4_0 = ret[0];
980
+ deferred4_1 = ret[1];
981
+ return getStringFromWasm0(ret[0], ret[1]);
982
+ } finally {
983
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
984
+ }
985
+ }
986
+
987
+ /**
988
+ * Perform boolean subtraction on two meshes (A - B)
989
+ * @param {number} vertex_count_a
990
+ * @param {Float64Array} buffer_a
991
+ * @param {number} vertex_count_b
992
+ * @param {Float64Array} buffer_b
691
993
  * @returns {Float64Array}
692
994
  */
693
- export function mesh_boolean_whole_partial_candidate_debug(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation) {
995
+ export function mesh_boolean_subtraction(vertex_count_a, buffer_a, vertex_count_b, buffer_b) {
694
996
  const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
695
997
  const len0 = WASM_VECTOR_LEN;
696
998
  const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
697
999
  const len1 = WASM_VECTOR_LEN;
698
- const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
699
- const len2 = WASM_VECTOR_LEN;
700
- const ret = wasm.mesh_boolean_whole_partial_candidate_debug(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
701
- var v4 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
1000
+ const ret = wasm.mesh_boolean_subtraction(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1);
1001
+ var v3 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
702
1002
  wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
703
- return v4;
1003
+ return v3;
704
1004
  }
705
1005
 
706
1006
  /**
1007
+ * Perform boolean operation and return stage-level profiling data followed by
1008
+ * the result mesh buffer.
1009
+ *
1010
+ * Output format:
1011
+ * [profile_len(=95), broadphase_ms, segments_ms, split_ms,
1012
+ * split_touched_faces_a, split_source_faces_a, split_touched_faces_b, split_source_faces_b,
1013
+ * classify_ms, classify_seed_ms, classify_strict_ms, classify_open_component_ms,
1014
+ * extract_ms, extract_primary_ms, extract_fallback_ms,
1015
+ * Perform boolean union on two meshes
707
1016
  * @param {number} vertex_count_a
708
1017
  * @param {Float64Array} buffer_a
709
1018
  * @param {number} vertex_count_b
710
1019
  * @param {Float64Array} buffer_b
711
- * @param {string} operation
712
1020
  * @returns {Float64Array}
713
1021
  */
714
- export function mesh_boolean_whole_partial_candidate_debug_full(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation) {
1022
+ export function mesh_boolean_union(vertex_count_a, buffer_a, vertex_count_b, buffer_b) {
715
1023
  const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
716
1024
  const len0 = WASM_VECTOR_LEN;
717
1025
  const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
718
1026
  const len1 = WASM_VECTOR_LEN;
719
- const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
720
- const len2 = WASM_VECTOR_LEN;
721
- const ret = wasm.mesh_boolean_whole_partial_candidate_debug_full(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
722
- var v4 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
1027
+ const ret = wasm.mesh_boolean_union(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1);
1028
+ var v3 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
723
1029
  wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
724
- return v4;
1030
+ return v3;
725
1031
  }
726
1032
 
727
1033
  /**
@@ -1185,6 +1491,72 @@ export function mesh_is_closed_volume(vertex_count, buffer) {
1185
1491
  return ret !== 0;
1186
1492
  }
1187
1493
 
1494
+ /**
1495
+ * Debug helper: run only the isolated direct-port `MeshGL -> Impl -> MeshGL`
1496
+ * normalization owner and return a JSON dump. This is for source-stage
1497
+ * comparison against official manifold-3d import/export, not legacy routing.
1498
+ * @param {number} vertex_count
1499
+ * @param {Float64Array} buffer
1500
+ * @param {boolean} trusted_input
1501
+ * @returns {string}
1502
+ */
1503
+ export function mesh_manifold_port_import_roundtrip_debug(vertex_count, buffer, trusted_input) {
1504
+ let deferred2_0;
1505
+ let deferred2_1;
1506
+ try {
1507
+ const ptr0 = passArrayF64ToWasm0(buffer, wasm.__wbindgen_malloc);
1508
+ const len0 = WASM_VECTOR_LEN;
1509
+ const ret = wasm.mesh_manifold_port_import_roundtrip_debug(vertex_count, ptr0, len0, trusted_input);
1510
+ deferred2_0 = ret[0];
1511
+ deferred2_1 = ret[1];
1512
+ return getStringFromWasm0(ret[0], ret[1]);
1513
+ } finally {
1514
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1515
+ }
1516
+ }
1517
+
1518
+ /**
1519
+ * @param {number} vertex_count
1520
+ * @param {Float64Array} buffer
1521
+ * @param {boolean} trusted_input
1522
+ * @returns {string}
1523
+ */
1524
+ export function mesh_manifold_port_import_stage_hashes_debug(vertex_count, buffer, trusted_input) {
1525
+ let deferred2_0;
1526
+ let deferred2_1;
1527
+ try {
1528
+ const ptr0 = passArrayF64ToWasm0(buffer, wasm.__wbindgen_malloc);
1529
+ const len0 = WASM_VECTOR_LEN;
1530
+ const ret = wasm.mesh_manifold_port_import_stage_hashes_debug(vertex_count, ptr0, len0, trusted_input);
1531
+ deferred2_0 = ret[0];
1532
+ deferred2_1 = ret[1];
1533
+ return getStringFromWasm0(ret[0], ret[1]);
1534
+ } finally {
1535
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1536
+ }
1537
+ }
1538
+
1539
+ /**
1540
+ * @param {Float64Array} data
1541
+ * @param {number} epsilon
1542
+ * @param {boolean} allow_convex
1543
+ * @returns {string}
1544
+ */
1545
+ export function mesh_manifold_port_triangulate_projected_polygon_debug(data, epsilon, allow_convex) {
1546
+ let deferred2_0;
1547
+ let deferred2_1;
1548
+ try {
1549
+ const ptr0 = passArrayF64ToWasm0(data, wasm.__wbindgen_malloc);
1550
+ const len0 = WASM_VECTOR_LEN;
1551
+ const ret = wasm.mesh_manifold_port_triangulate_projected_polygon_debug(ptr0, len0, epsilon, allow_convex);
1552
+ deferred2_0 = ret[0];
1553
+ deferred2_1 = ret[1];
1554
+ return getStringFromWasm0(ret[0], ret[1]);
1555
+ } finally {
1556
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1557
+ }
1558
+ }
1559
+
1188
1560
  /**
1189
1561
  * Merge multiple mesh buffers while preserving per-mesh vertex order and index remapping.
1190
1562
  * Input format: [mesh_count, len1, mesh1..., len2, mesh2..., ...]
@@ -1401,6 +1773,26 @@ export function mesh_topology_metrics(vertex_count, buffer) {
1401
1773
  return v2;
1402
1774
  }
1403
1775
 
1776
+ /**
1777
+ * Return raw index-topology metrics for a triangulated mesh buffer:
1778
+ * `[boundary_edges, non_manifold_edges]`.
1779
+ *
1780
+ * Unlike `mesh_topology_metrics`, this preserves duplicate same-position seam
1781
+ * vertices. That makes it a closer fit for trusted MeshGL-style boolean meshes,
1782
+ * where manifoldness comes from explicit topology rather than position welding.
1783
+ * @param {number} vertex_count
1784
+ * @param {Float64Array} buffer
1785
+ * @returns {Float64Array}
1786
+ */
1787
+ export function mesh_topology_metrics_raw(vertex_count, buffer) {
1788
+ const ptr0 = passArrayF64ToWasm0(buffer, wasm.__wbindgen_malloc);
1789
+ const len0 = WASM_VECTOR_LEN;
1790
+ const ret = wasm.mesh_topology_metrics_raw(vertex_count, ptr0, len0);
1791
+ var v2 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
1792
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
1793
+ return v2;
1794
+ }
1795
+
1404
1796
  /**
1405
1797
  * Translate a mesh by an offset vector and return new buffers
1406
1798
  * @param {number} vertex_count
@@ -1777,10 +2169,6 @@ export function version() {
1777
2169
  function __wbg_get_imports() {
1778
2170
  const import0 = {
1779
2171
  __proto__: null,
1780
- __wbg___okgeometry_boolean_should_cancel_c9088108881414a9: function() {
1781
- const ret = globalThis.__okgeometry_boolean_should_cancel();
1782
- return ret;
1783
- },
1784
2172
  __wbg___wbindgen_throw_be289d5034ed271b: function(arg0, arg1) {
1785
2173
  throw new Error(getStringFromWasm0(arg0, arg1));
1786
2174
  },