okgeometry-api 1.1.19 → 1.1.21

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.
@@ -452,6 +452,27 @@ export function mesh_apply_matrix(vertex_count, buffer, matrix) {
452
452
  }
453
453
 
454
454
  /**
455
+ * Perform boolean intersection on two meshes
456
+ * @param {number} vertex_count_a
457
+ * @param {Float64Array} buffer_a
458
+ * @param {number} vertex_count_b
459
+ * @param {Float64Array} buffer_b
460
+ * @returns {Float64Array}
461
+ */
462
+ export function mesh_boolean_intersection(vertex_count_a, buffer_a, vertex_count_b, buffer_b) {
463
+ const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
464
+ const len0 = WASM_VECTOR_LEN;
465
+ const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
466
+ const len1 = WASM_VECTOR_LEN;
467
+ const ret = wasm.mesh_boolean_intersection(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1);
468
+ var v3 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
469
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
470
+ return v3;
471
+ }
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.
455
476
  * @param {number} vertex_count_a
456
477
  * @param {Float64Array} buffer_a
457
478
  * @param {number} vertex_count_b
@@ -459,7 +480,7 @@ export function mesh_apply_matrix(vertex_count, buffer, matrix) {
459
480
  * @param {string} operation
460
481
  * @returns {string}
461
482
  */
462
- export function mesh_boolean_finalize_stage_summary_debug(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation) {
483
+ export function mesh_boolean_kernel_mesh_debug(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation) {
463
484
  let deferred4_0;
464
485
  let deferred4_1;
465
486
  try {
@@ -469,7 +490,7 @@ export function mesh_boolean_finalize_stage_summary_debug(vertex_count_a, buffer
469
490
  const len1 = WASM_VECTOR_LEN;
470
491
  const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
471
492
  const len2 = WASM_VECTOR_LEN;
472
- const ret = wasm.mesh_boolean_finalize_stage_summary_debug(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
493
+ const ret = wasm.mesh_boolean_kernel_mesh_debug(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
473
494
  deferred4_0 = ret[0];
474
495
  deferred4_1 = ret[1];
475
496
  return getStringFromWasm0(ret[0], ret[1]);
@@ -479,30 +500,69 @@ export function mesh_boolean_finalize_stage_summary_debug(vertex_count_a, buffer
479
500
  }
480
501
 
481
502
  /**
482
- * Perform boolean intersection on two meshes
503
+ * @returns {number}
504
+ */
505
+ export function mesh_boolean_last_debug_marker() {
506
+ const ret = wasm.mesh_boolean_last_debug_marker();
507
+ return ret >>> 0;
508
+ }
509
+
510
+ /**
483
511
  * @param {number} vertex_count_a
484
512
  * @param {Float64Array} buffer_a
485
513
  * @param {number} vertex_count_b
486
514
  * @param {Float64Array} buffer_b
487
- * @returns {Float64Array}
515
+ * @param {string} operation
516
+ * @param {string} cleanup_stage
517
+ * @returns {string}
488
518
  */
489
- export function mesh_boolean_intersection(vertex_count_a, buffer_a, vertex_count_b, buffer_b) {
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 ret = wasm.mesh_boolean_intersection(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1);
495
- var v3 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
496
- wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
497
- return v3;
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
+ }
498
538
  }
499
539
 
500
540
  /**
501
- * @returns {number}
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}
502
548
  */
503
- export function mesh_boolean_last_debug_marker() {
504
- const ret = wasm.mesh_boolean_last_debug_marker();
505
- return ret >>> 0;
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
+ }
506
566
  }
507
567
 
508
568
  /**
@@ -511,24 +571,31 @@ export function mesh_boolean_last_debug_marker() {
511
571
  * @param {number} vertex_count_b
512
572
  * @param {Float64Array} buffer_b
513
573
  * @param {string} operation
514
- * @returns {Float64Array}
574
+ * @param {number} face_index
575
+ * @param {number} rotate_offset
576
+ * @param {boolean} reverse
577
+ * @returns {string}
515
578
  */
516
- export function mesh_boolean_operation(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation) {
517
- const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
518
- const len0 = WASM_VECTOR_LEN;
519
- const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
520
- const len1 = WASM_VECTOR_LEN;
521
- const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
522
- const len2 = WASM_VECTOR_LEN;
523
- const ret = wasm.mesh_boolean_operation(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
524
- var v4 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
525
- wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
526
- return v4;
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
+ }
527
596
  }
528
597
 
529
598
  /**
530
- * Debug helper: perform boolean operation and return a textual status,
531
- * including kernel error reason on failure.
532
599
  * @param {number} vertex_count_a
533
600
  * @param {Float64Array} buffer_a
534
601
  * @param {number} vertex_count_b
@@ -536,7 +603,7 @@ export function mesh_boolean_operation(vertex_count_a, buffer_a, vertex_count_b,
536
603
  * @param {string} operation
537
604
  * @returns {string}
538
605
  */
539
- export function mesh_boolean_operation_debug(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation) {
606
+ export function mesh_boolean_manifold_port_final_triangle_dump(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation) {
540
607
  let deferred4_0;
541
608
  let deferred4_1;
542
609
  try {
@@ -546,7 +613,7 @@ export function mesh_boolean_operation_debug(vertex_count_a, buffer_a, vertex_co
546
613
  const len1 = WASM_VECTOR_LEN;
547
614
  const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
548
615
  const len2 = WASM_VECTOR_LEN;
549
- const ret = wasm.mesh_boolean_operation_debug(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
616
+ const ret = wasm.mesh_boolean_manifold_port_final_triangle_dump(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
550
617
  deferred4_0 = ret[0];
551
618
  deferred4_1 = ret[1];
552
619
  return getStringFromWasm0(ret[0], ret[1]);
@@ -556,98 +623,30 @@ export function mesh_boolean_operation_debug(vertex_count_a, buffer_a, vertex_co
556
623
  }
557
624
 
558
625
  /**
559
- * Perform boolean operation and return stage-level profiling data followed by
560
- * the result mesh buffer.
561
- *
562
- * Output format:
563
- * [profile_len(=95), broadphase_ms, segments_ms, split_ms,
564
- * split_touched_faces_a, split_source_faces_a, split_touched_faces_b, split_source_faces_b,
565
- * classify_ms, classify_seed_ms, classify_strict_ms, classify_open_component_ms,
566
- * extract_ms, extract_primary_ms, extract_fallback_ms,
567
- * cleanup_ms, finalize_ms, finalize_cap_ms, finalize_recap_ms, finalize_stitch_ms,
568
- * pair_accepted, pair_rejected, pair_degenerate,
569
- * core_passes, core_total_ms, conservative_runs, conservative_ms, nudge_runs, nudge_ms,
570
- * recompose_runs, recompose_ms, repair_runs, repair_ms,
571
- * repair_loops, repair_loops_capped, repair_loop_vertices, repair_loop_max_vertices,
572
- * arrangement_adj_attempts, arrangement_adj_fast_hits, arrangement_adj_disabled_split_limit,
573
- * arrangement_adj_fallback_no_half_edges, arrangement_adj_fallback_collect_failed,
574
- * arrangement_adj_fallback_non_manifold, arrangement_adj_fallback_loop_mismatch,
575
- * arrangement_adj_fallback_twin_mismatch, arrangement_adj_fallback_invalid_face_index,
576
- * arrangement_adj_non_manifold_edges_total, arrangement_adj_non_manifold_limit_total,
577
- * arrangement_adj_non_manifold_tolerated_attempts,
578
- * arrangement_adj_fallback_non_manifold_excess_total,
579
- * subtraction_ultra_cases, subtraction_ultra_component_fallback_runs,
580
- * subtraction_ultra_open_bounds_total, subtraction_ultra_open_bounds_max,
581
- * subtraction_ultra_best_boundary_total, subtraction_ultra_best_non_manifold_total,
582
- * subtraction_ultra_scoped_faces_total, subtraction_ultra_scoped_faces_max,
583
- * subtraction_ultra_scoped_strict_evals_total, subtraction_ultra_scoped_strict_evals_max,
584
- * finalize_stitch_rebuild_ms, finalize_stitch_recap_ms,
585
- * finalize_stitch_attempts, finalize_stitch_kept,
586
- * finalize_stitch_rebuild_collect_ms, finalize_stitch_rebuild_weld_ms,
587
- * finalize_stitch_rebuild_commit_ms, finalize_stitch_rebuild_faces_in,
588
- * finalize_stitch_rebuild_faces_out,
589
- * whole_partial_attempts, whole_partial_accepts,
590
- * whole_partial_total_ms, whole_partial_split_ms,
591
- * whole_partial_boundary_build_ms,
592
- * whole_partial_split_triangle_fast_faces,
593
- * whole_partial_split_cdt_faces,
594
- * whole_partial_split_cdt_points_total,
595
- * whole_partial_split_cdt_constraints_total,
596
- * whole_partial_split_cdt_segment_constraints_total,
597
- * whole_partial_split_cdt_triangles_total,
598
- * whole_partial_triangle_cdt_single_segment_faces,
599
- * whole_partial_triangle_cdt_two_segment_faces,
600
- * whole_partial_triangle_cdt_three_plus_segment_faces,
601
- * whole_partial_triangle_cdt_all_boundary_segment_faces,
602
- * whole_partial_triangle_cdt_mixed_boundary_segment_faces,
603
- * whole_partial_triangle_cdt_any_interior_segment_faces,
604
- * whole_partial_classify_source_ms, whole_partial_classify_touched_ms,
605
- * whole_partial_extract_ms, whole_partial_extract_untouched_ms,
606
- * whole_partial_extract_interface_ms, whole_partial_extract_touched_ms,
607
- * whole_partial_finalize_ms,
608
- * whole_partial_interface_faces_total,
609
- * whole_partial_interface_faces_emitted,
610
- * whole_partial_interface_boundary_edge_hits,
611
- * whole_partial_interface_raw_edge_fallbacks,
612
- * whole_partial_touched_faces_total,
613
- * whole_partial_touched_faces_emitted,
614
- * whole_partial_touched_patch_attempts,
615
- * whole_partial_touched_patch_direct_regions,
616
- * whole_partial_touched_patch_triangulated_faces,
617
- * whole_partial_touched_fallback_faces,
618
- * whole_partial_touched_lineage_vertices,
619
- * whole_partial_touched_welded_vertices,
620
- * whole_partial_raw_boundary_untouched_edges,
621
- * whole_partial_raw_boundary_interface_edges,
622
- * whole_partial_raw_boundary_touched_edges,
623
- * whole_partial_raw_boundary_mixed_edges,
624
- * whole_partial_raw_non_manifold_untouched_edges,
625
- * whole_partial_raw_non_manifold_interface_edges,
626
- * whole_partial_raw_non_manifold_touched_edges,
627
- * whole_partial_raw_non_manifold_mixed_edges,
628
- * whole_partial_boundary_edges_total,
629
- * whole_partial_non_manifold_edges_total,
630
- * whole_partial_face_ratio_vs_a_total,
631
- * whole_partial_loop_plausible_total,
632
- * mesh_buffer...]
633
626
  * @param {number} vertex_count_a
634
627
  * @param {Float64Array} buffer_a
635
628
  * @param {number} vertex_count_b
636
629
  * @param {Float64Array} buffer_b
637
630
  * @param {string} operation
638
- * @returns {Float64Array}
631
+ * @returns {string}
639
632
  */
640
- export function mesh_boolean_operation_profiled(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation) {
641
- const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
642
- const len0 = WASM_VECTOR_LEN;
643
- const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
644
- const len1 = WASM_VECTOR_LEN;
645
- const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
646
- const len2 = WASM_VECTOR_LEN;
647
- const ret = wasm.mesh_boolean_operation_profiled(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
648
- var v4 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
649
- wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
650
- return v4;
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
+ }
651
650
  }
652
651
 
653
652
  /**
@@ -658,7 +657,7 @@ export function mesh_boolean_operation_profiled(vertex_count_a, buffer_a, vertex
658
657
  * @param {string} operation
659
658
  * @returns {string}
660
659
  */
661
- export function mesh_boolean_primary_output_summary_debug(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation) {
660
+ export function mesh_boolean_manifold_port_intersections_debug(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation) {
662
661
  let deferred4_0;
663
662
  let deferred4_1;
664
663
  try {
@@ -668,7 +667,7 @@ export function mesh_boolean_primary_output_summary_debug(vertex_count_a, buffer
668
667
  const len1 = WASM_VECTOR_LEN;
669
668
  const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
670
669
  const len2 = WASM_VECTOR_LEN;
671
- const ret = wasm.mesh_boolean_primary_output_summary_debug(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
670
+ const ret = wasm.mesh_boolean_manifold_port_intersections_debug(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
672
671
  deferred4_0 = ret[0];
673
672
  deferred4_1 = ret[1];
674
673
  return getStringFromWasm0(ret[0], ret[1]);
@@ -678,41 +677,234 @@ export function mesh_boolean_primary_output_summary_debug(vertex_count_a, buffer
678
677
  }
679
678
 
680
679
  /**
681
- * Perform boolean subtraction on two meshes (A - B)
682
680
  * @param {number} vertex_count_a
683
681
  * @param {Float64Array} buffer_a
684
682
  * @param {number} vertex_count_b
685
683
  * @param {Float64Array} buffer_b
686
- * @returns {Float64Array}
684
+ * @param {string} operation
685
+ * @param {number} face_p
686
+ * @param {number} face_q
687
+ * @returns {string}
687
688
  */
688
- export function mesh_boolean_subtraction(vertex_count_a, buffer_a, vertex_count_b, buffer_b) {
689
- const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
690
- const len0 = WASM_VECTOR_LEN;
691
- const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
692
- const len1 = WASM_VECTOR_LEN;
693
- const ret = wasm.mesh_boolean_subtraction(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1);
694
- var v3 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
695
- wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
696
- return v3;
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
+ }
697
742
  }
698
743
 
699
744
  /**
700
- * Perform boolean union on two meshes
701
745
  * @param {number} vertex_count_a
702
746
  * @param {Float64Array} buffer_a
703
747
  * @param {number} vertex_count_b
704
748
  * @param {Float64Array} buffer_b
705
- * @returns {Float64Array}
749
+ * @param {string} operation
750
+ * @param {number} face_index
751
+ * @returns {string}
706
752
  */
707
- export function mesh_boolean_union(vertex_count_a, buffer_a, vertex_count_b, buffer_b) {
708
- const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
709
- const len0 = WASM_VECTOR_LEN;
710
- const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
711
- const len1 = WASM_VECTOR_LEN;
712
- const ret = wasm.mesh_boolean_union(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1);
713
- var v3 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
714
- wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
715
- return v3;
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}
807
+ */
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
+ }
825
+ }
826
+
827
+ /**
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.
830
+ * @param {number} vertex_count_a
831
+ * @param {Float64Array} buffer_a
832
+ * @param {number} vertex_count_b
833
+ * @param {Float64Array} buffer_b
834
+ * @param {string} operation
835
+ * @returns {string}
836
+ */
837
+ export function mesh_boolean_manifold_port_stage_debug(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation) {
838
+ let deferred4_0;
839
+ let deferred4_1;
840
+ try {
841
+ const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
842
+ const len0 = WASM_VECTOR_LEN;
843
+ const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
844
+ const len1 = WASM_VECTOR_LEN;
845
+ const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
846
+ const len2 = WASM_VECTOR_LEN;
847
+ const ret = wasm.mesh_boolean_manifold_port_stage_debug(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
848
+ deferred4_0 = ret[0];
849
+ deferred4_1 = ret[1];
850
+ return getStringFromWasm0(ret[0], ret[1]);
851
+ } finally {
852
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
853
+ }
854
+ }
855
+
856
+ /**
857
+ * @param {number} vertex_count_a
858
+ * @param {Float64Array} buffer_a
859
+ * @param {number} vertex_count_b
860
+ * @param {Float64Array} buffer_b
861
+ * @param {string} operation
862
+ * @returns {string}
863
+ */
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
+ }
881
+ }
882
+
883
+ /**
884
+ * @param {number} vertex_count_a
885
+ * @param {Float64Array} buffer_a
886
+ * @param {number} vertex_count_b
887
+ * @param {Float64Array} buffer_b
888
+ * @param {string} operation
889
+ * @returns {string}
890
+ */
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
+ }
716
908
  }
717
909
 
718
910
  /**
@@ -723,59 +915,119 @@ export function mesh_boolean_union(vertex_count_a, buffer_a, vertex_count_b, buf
723
915
  * @param {string} operation
724
916
  * @returns {Float64Array}
725
917
  */
726
- export function mesh_boolean_whole_partial_candidate(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation) {
918
+ export function mesh_boolean_operation(vertex_count_a, buffer_a, vertex_count_b, buffer_b, operation) {
727
919
  const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
728
920
  const len0 = WASM_VECTOR_LEN;
729
921
  const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
730
922
  const len1 = WASM_VECTOR_LEN;
731
923
  const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
732
924
  const len2 = WASM_VECTOR_LEN;
733
- const ret = wasm.mesh_boolean_whole_partial_candidate(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
925
+ const ret = wasm.mesh_boolean_operation(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
734
926
  var v4 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
735
927
  wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
736
928
  return v4;
737
929
  }
738
930
 
739
931
  /**
932
+ * Debug helper: perform boolean operation and return a textual status,
933
+ * including kernel error reason on failure.
740
934
  * @param {number} vertex_count_a
741
935
  * @param {Float64Array} buffer_a
742
936
  * @param {number} vertex_count_b
743
937
  * @param {Float64Array} buffer_b
744
938
  * @param {string} operation
939
+ * @returns {string}
940
+ */
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
+ }
958
+ }
959
+
960
+ /**
961
+ * @param {number} vertex_count_a
962
+ * @param {Float64Array} buffer_a
963
+ * @param {number} vertex_count_b
964
+ * @param {Float64Array} buffer_b
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
745
993
  * @returns {Float64Array}
746
994
  */
747
- 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) {
748
996
  const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
749
997
  const len0 = WASM_VECTOR_LEN;
750
998
  const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
751
999
  const len1 = WASM_VECTOR_LEN;
752
- const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
753
- const len2 = WASM_VECTOR_LEN;
754
- const ret = wasm.mesh_boolean_whole_partial_candidate_debug(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
755
- 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();
756
1002
  wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
757
- return v4;
1003
+ return v3;
758
1004
  }
759
1005
 
760
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
761
1016
  * @param {number} vertex_count_a
762
1017
  * @param {Float64Array} buffer_a
763
1018
  * @param {number} vertex_count_b
764
1019
  * @param {Float64Array} buffer_b
765
- * @param {string} operation
766
1020
  * @returns {Float64Array}
767
1021
  */
768
- 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) {
769
1023
  const ptr0 = passArrayF64ToWasm0(buffer_a, wasm.__wbindgen_malloc);
770
1024
  const len0 = WASM_VECTOR_LEN;
771
1025
  const ptr1 = passArrayF64ToWasm0(buffer_b, wasm.__wbindgen_malloc);
772
1026
  const len1 = WASM_VECTOR_LEN;
773
- const ptr2 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
774
- const len2 = WASM_VECTOR_LEN;
775
- const ret = wasm.mesh_boolean_whole_partial_candidate_debug_full(vertex_count_a, ptr0, len0, vertex_count_b, ptr1, len1, ptr2, len2);
776
- 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();
777
1029
  wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
778
- return v4;
1030
+ return v3;
779
1031
  }
780
1032
 
781
1033
  /**
@@ -1239,6 +1491,72 @@ export function mesh_is_closed_volume(vertex_count, buffer) {
1239
1491
  return ret !== 0;
1240
1492
  }
1241
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
+
1242
1560
  /**
1243
1561
  * Merge multiple mesh buffers while preserving per-mesh vertex order and index remapping.
1244
1562
  * Input format: [mesh_count, len1, mesh1..., len2, mesh2..., ...]
@@ -1851,10 +2169,6 @@ export function version() {
1851
2169
  function __wbg_get_imports() {
1852
2170
  const import0 = {
1853
2171
  __proto__: null,
1854
- __wbg___okgeometry_boolean_should_cancel_e9cae7a8bf9ae3e0: function() {
1855
- const ret = globalThis.__okgeometry_boolean_should_cancel();
1856
- return ret;
1857
- },
1858
2172
  __wbg___wbindgen_throw_be289d5034ed271b: function(arg0, arg1) {
1859
2173
  throw new Error(getStringFromWasm0(arg0, arg1));
1860
2174
  },