@ccpc/math 0.1.0 → 0.1.7
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.
- package/index.cjs +226 -0
- package/package.json +19 -37
- package/types/algorithm/bool_operate/bool2d/bool2d.d.ts +22 -0
- package/types/algorithm/bool_operate/bool2d/difference.d.ts +9 -0
- package/types/algorithm/bool_operate/bool2d/intersect.d.ts +9 -0
- package/types/algorithm/bool_operate/bool2d/split.d.ts +3 -0
- package/types/algorithm/bool_operate/bool2d/union.d.ts +9 -0
- package/types/algorithm/bool_operate/bool2d/utils.d.ts +40 -0
- package/types/algorithm/bool_operate/bool_operate_clipper.d.ts +18 -0
- package/types/algorithm/bool_operate/polycurve_polygon_bool.d.ts +13 -0
- package/types/algorithm/bool_operate_2d.d.ts +67 -0
- package/types/algorithm/calc_d.d.ts +85 -0
- package/types/algorithm/calc_offset.d.ts +70 -0
- package/types/algorithm/calc_overlap.d.ts +56 -0
- package/types/algorithm/calc_project.d.ts +29 -0
- package/types/algorithm/calc_x.d.ts +215 -0
- package/types/algorithm/calculate_util/geometry_subdevide_infos.d.ts +73 -0
- package/types/algorithm/calculate_util/iterative_method.d.ts +30 -0
- package/types/algorithm/discrete/discrete_curve.d.ts +31 -0
- package/types/algorithm/discrete/discrete_refiner.d.ts +35 -0
- package/types/algorithm/discrete/discrete_surface.d.ts +74 -0
- package/types/algorithm/discrete/discrete_topology.d.ts +32 -0
- package/types/algorithm/discrete/discrete_util.d.ts +96 -0
- package/types/algorithm/discrete/grid_discrete_data.d.ts +58 -0
- package/types/algorithm/discrete/libtess.d.ts +12 -0
- package/types/algorithm/discrete/uniform_grid_discrete.d.ts +3 -0
- package/types/algorithm/distance/base_calc_distance/curves_distance_util.d.ts +20 -0
- package/types/algorithm/distance/base_calc_distance/define_of_calculate_distance.d.ts +12 -0
- package/types/algorithm/distance/curve2ds_distance/arc2s_distance.d.ts +17 -0
- package/types/algorithm/distance/curve2ds_distance/line2d_to_arc2d_distance.d.ts +17 -0
- package/types/algorithm/distance/curve2ds_distance/line2s_distance.d.ts +15 -0
- package/types/algorithm/distance/curve2s_distance.d.ts +15 -0
- package/types/algorithm/distance/curve3ds_distance/line3d_to_line3d_distance_paramed.d.ts +12 -0
- package/types/algorithm/distance/curve3s_distance.d.ts +31 -0
- package/types/algorithm/distance/pt_to_curve2_signed_distance.d.ts +17 -0
- package/types/algorithm/distance/pt_to_curve3_distance.d.ts +25 -0
- package/types/algorithm/distance/pt_to_curve_distance_info.d.ts +12 -0
- package/types/algorithm/distance/pt_to_surface_distance.d.ts +17 -0
- package/types/algorithm/distance/pts_to_curves_distance.d.ts +13 -0
- package/types/algorithm/distance/pts_to_pts_distance.d.ts +7 -0
- package/types/algorithm/geometry_merge.d.ts +22 -0
- package/types/algorithm/index.d.ts +32 -0
- package/types/algorithm/intersect/box_cut_line.d.ts +6 -0
- package/types/algorithm/intersect/curve_self_x.d.ts +13 -0
- package/types/algorithm/intersect/curve_surface_x.d.ts +34 -0
- package/types/algorithm/intersect/curve_surface_x_util.d.ts +32 -0
- package/types/algorithm/intersect/curves_x/circulars_x.d.ts +35 -0
- package/types/algorithm/intersect/curves_x/linear_circular_x.d.ts +40 -0
- package/types/algorithm/intersect/curves_x/lines_x.d.ts +17 -0
- package/types/algorithm/intersect/curves_x/lines_x_util.d.ts +4 -0
- package/types/algorithm/intersect/curves_x.d.ts +26 -0
- package/types/algorithm/intersect/curves_x_util.d.ts +35 -0
- package/types/algorithm/intersect/intersect_info_util.d.ts +9 -0
- package/types/algorithm/intersect/surface_self_x.d.ts +8 -0
- package/types/algorithm/intersect/surfaces_x.d.ts +53 -0
- package/types/algorithm/intersect/surfaces_x_complex.d.ts +29 -0
- package/types/algorithm/intersect/surfaces_x_special.d.ts +16 -0
- package/types/algorithm/intersect/surfaces_x_util.d.ts +41 -0
- package/types/algorithm/intersect/x_info.d.ts +65 -0
- package/types/algorithm/loop_property/loop-area.d.ts +49 -0
- package/types/algorithm/loop_property/loop-centroid.d.ts +40 -0
- package/types/algorithm/merge_geometry/halfplane.d.ts +24 -0
- package/types/algorithm/merge_geometry/merge_curve.d.ts +14 -0
- package/types/algorithm/merge_geometry/merge_point.d.ts +18 -0
- package/types/algorithm/mesh/clip_mesh.d.ts +27 -0
- package/types/algorithm/mesh/extrude_clip.d.ts +236 -0
- package/types/algorithm/mesh/mesh_assist.d.ts +21 -0
- package/types/algorithm/mesh/mesh_contour.d.ts +26 -0
- package/types/algorithm/mesh/mesh_util.d.ts +115 -0
- package/types/algorithm/offset/loop2d_offset.d.ts +22 -0
- package/types/algorithm/offset/polygon_offset.d.ts +27 -0
- package/types/algorithm/overlap/curve_surface_coincide.d.ts +6 -0
- package/types/algorithm/overlap/curves_colinear.d.ts +38 -0
- package/types/algorithm/overlap/curves_merge.d.ts +74 -0
- package/types/algorithm/overlap/curves_overlap.d.ts +34 -0
- package/types/algorithm/overlap/i_overlap.d.ts +9 -0
- package/types/algorithm/overlap/surfaces_coplaner.d.ts +5 -0
- package/types/algorithm/pattern/blocks2Geometry.d.ts +50 -0
- package/types/algorithm/pattern/math.d.ts +42 -0
- package/types/algorithm/pattern/pattern.d.ts +43 -0
- package/types/algorithm/pattern/pattern_util.d.ts +53 -0
- package/types/algorithm/pattern/pave.d.ts +33 -0
- package/types/algorithm/pj/curves_oj.d.ts +19 -0
- package/types/algorithm/pj/curves_pj.d.ts +19 -0
- package/types/algorithm/pj/loops_pj.d.ts +13 -0
- package/types/algorithm/pj/pj_type.d.ts +46 -0
- package/types/algorithm/pj/pt_loop_pj.d.ts +24 -0
- package/types/algorithm/pj/pt_polygon_pj.d.ts +18 -0
- package/types/algorithm/pj/pt_polygon_position_judger.d.ts +11 -0
- package/types/algorithm/position_judge.d.ts +72 -0
- package/types/algorithm/project/curve3d_to_plane_project.d.ts +11 -0
- package/types/algorithm/project/curve_curve_project.d.ts +9 -0
- package/types/algorithm/search_graph/iloops_polygonex.d.ts +28 -0
- package/types/algorithm/search_graph/loop_tree_node.d.ts +30 -0
- package/types/algorithm/search_graph/loops_to_loop_tree_search_graph.d.ts +25 -0
- package/types/algorithm/search_graph/polygon_polygonex.d.ts +13 -0
- package/types/algorithm/search_graph/search_loop2d.d.ts +20 -0
- package/types/algorithm/search_graph/search_polyline.d.ts +11 -0
- package/types/algorithm/search_graph.d.ts +45 -0
- package/types/algorithm/topology_edit.d.ts +10 -0
- package/types/base/box.d.ts +100 -0
- package/types/base/box2.d.ts +17 -0
- package/types/base/box3.d.ts +20 -0
- package/types/base/coord.d.ts +10 -0
- package/types/base/coord2.d.ts +92 -0
- package/types/base/coord3.d.ts +139 -0
- package/types/base/discrete_param.d.ts +28 -0
- package/types/base/euler.d.ts +102 -0
- package/types/base/geo_element.d.ts +54 -0
- package/types/base/interval.d.ts +122 -0
- package/types/base/ivector.d.ts +126 -0
- package/types/base/matrix.d.ts +108 -0
- package/types/base/matrix3.d.ts +118 -0
- package/types/base/matrix4.d.ts +166 -0
- package/types/base/matrix_util.d.ts +5 -0
- package/types/base/period_inverval.d.ts +127 -0
- package/types/base/quaternion.d.ts +39 -0
- package/types/base/tangent_cone.d.ts +11 -0
- package/types/base/tilt_box.d.ts +11 -0
- package/types/base/tol.d.ts +120 -0
- package/types/base/vec.d.ts +46 -0
- package/types/base/vec2.d.ts +146 -0
- package/types/base/vec3.d.ts +158 -0
- package/types/brep-src/algorithm/alg_const.d.ts +23 -0
- package/types/brep-src/algorithm/alg_types.d.ts +47 -0
- package/types/brep-src/algorithm/algorithm_util/base_define.d.ts +7 -0
- package/types/brep-src/algorithm/algorithm_util/body_base_util.d.ts +4 -0
- package/types/brep-src/algorithm/algorithm_util/curve_solid_analysis.d.ts +28 -0
- package/types/brep-src/algorithm/algorithm_util/face_face_analysis.d.ts +39 -0
- package/types/brep-src/algorithm/algorithm_util/search_wire.d.ts +8 -0
- package/types/brep-src/algorithm/body_builder/basic_body_builder.d.ts +15 -0
- package/types/brep-src/algorithm/body_builder/extrude_body.d.ts +23 -0
- package/types/brep-src/algorithm/body_builder/sweep_body.d.ts +37 -0
- package/types/brep-src/algorithm/body_builder.d.ts +36 -0
- package/types/brep-src/algorithm/body_util.d.ts +21 -0
- package/types/brep-src/algorithm/bool_sk/brep_converter.d.ts +11 -0
- package/types/brep-src/algorithm/brep_calc_project.d.ts +50 -0
- package/types/brep-src/algorithm/brep_calc_x.d.ts +34 -0
- package/types/brep-src/algorithm/brep_pj.d.ts +47 -0
- package/types/brep-src/algorithm/index.d.ts +5 -0
- package/types/brep-src/algorithm/intersect/curve_face_overlap.d.ts +10 -0
- package/types/brep-src/algorithm/intersect/face_face_intersect.d.ts +22 -0
- package/types/brep-src/algorithm/intersect/face_faces_intersect.d.ts +15 -0
- package/types/brep-src/algorithm/intersect/line_face_intersect.d.ts +16 -0
- package/types/brep-src/algorithm/podition_judge/body_pj.d.ts +25 -0
- package/types/brep-src/algorithm/podition_judge/extrude_pj.d.ts +28 -0
- package/types/brep-src/algorithm/podition_judge/pt_body_pj.d.ts +32 -0
- package/types/brep-src/algorithm/project/body_project.d.ts +8 -0
- package/types/brep-src/algorithm/project/face_project.d.ts +20 -0
- package/types/brep-src/algorithm/project/face_surface_project.d.ts +8 -0
- package/types/brep-src/algorithm/project/space_project.d.ts +26 -0
- package/types/brep-src/algorithm/project/space_project_simple.d.ts +10 -0
- package/types/brep-src/algorithm/project/view_project.d.ts +25 -0
- package/types/brep-src/algorithm/shell_builder/create_shell_from_curves.d.ts +38 -0
- package/types/brep-src/algorithm/shell_builder.d.ts +25 -0
- package/types/brep-src/algorithm/shell_edit/add_edges/add_edges.d.ts +14 -0
- package/types/brep-src/algorithm/shell_edit/add_edges/add_edges_core.d.ts +11 -0
- package/types/brep-src/algorithm/shell_edit/copy_faces.d.ts +20 -0
- package/types/brep-src/algorithm/shell_edit/delete_faces_edges/delete_edge.d.ts +9 -0
- package/types/brep-src/algorithm/shell_edit/delete_faces_edges/delete_faces_edges.d.ts +17 -0
- package/types/brep-src/algorithm/shell_edit/faces_boolean/faces_boolean.d.ts +19 -0
- package/types/brep-src/algorithm/shell_edit/faces_boolean/faces_shells_boolean.d.ts +13 -0
- package/types/brep-src/algorithm/shell_edit/faces_boolean/octree.d.ts +11 -0
- package/types/brep-src/algorithm/shell_edit/isolate_faces.d.ts +21 -0
- package/types/brep-src/algorithm/shell_edit/merge_connect_faces.d.ts +14 -0
- package/types/brep-src/algorithm/shell_edit/merge_edges.d.ts +8 -0
- package/types/brep-src/algorithm/shell_edit/move_operators/move_edges.d.ts +31 -0
- package/types/brep-src/algorithm/shell_edit/move_operators/move_faces.d.ts +14 -0
- package/types/brep-src/algorithm/shell_edit/operator/dispose_topo.d.ts +2 -0
- package/types/brep-src/algorithm/shell_edit/operator/merge_connect_edge.d.ts +3 -0
- package/types/brep-src/algorithm/shell_edit/operator/merge_connect_face.d.ts +2 -0
- package/types/brep-src/algorithm/shell_edit/operator/merge_overlap_edge.d.ts +3 -0
- package/types/brep-src/algorithm/shell_edit/operator/merge_shell.d.ts +11 -0
- package/types/brep-src/algorithm/shell_edit/operator/merge_vertex.d.ts +2 -0
- package/types/brep-src/algorithm/shell_edit/operator/split_edge.d.ts +4 -0
- package/types/brep-src/algorithm/shell_edit/operator/split_shell.d.ts +6 -0
- package/types/brep-src/algorithm/shell_edit/pull_push_face/pull_push_face.d.ts +18 -0
- package/types/brep-src/algorithm/shell_edit/pull_push_face/pull_push_face_core.d.ts +6 -0
- package/types/brep-src/algorithm/shell_edit/pull_push_face/pull_push_face_preview.d.ts +16 -0
- package/types/brep-src/algorithm/shell_edit/pull_push_face/pull_push_face_preview_core.d.ts +24 -0
- package/types/brep-src/algorithm/shell_edit/roundinng/2d_rounding.d.ts +22 -0
- package/types/brep-src/algorithm/shell_edit/shell_modeling_base.d.ts +10 -0
- package/types/brep-src/algorithm/shell_edit/shell_modeling_result.d.ts +21 -0
- package/types/brep-src/algorithm/shell_edit/smooth/detect_loop_util.d.ts +27 -0
- package/types/brep-src/algorithm/shell_edit/smooth/shell_modeling_util.d.ts +24 -0
- package/types/brep-src/algorithm/shell_edit/smooth/smooth_util.d.ts +22 -0
- package/types/brep-src/algorithm/shell_edit/split_edge.d.ts +10 -0
- package/types/brep-src/algorithm/shell_edit.d.ts +119 -0
- package/types/brep-src/algorithm/shell_valid/base_brep_topo_error.d.ts +176 -0
- package/types/brep-src/algorithm/shell_valid/diagnose_shell.d.ts +14 -0
- package/types/brep-src/brep/brep_body.d.ts +19 -0
- package/types/brep-src/brep/coedge3d.d.ts +83 -0
- package/types/brep-src/brep/edge.d.ts +96 -0
- package/types/brep-src/brep/face.d.ts +150 -0
- package/types/brep-src/brep/shell.d.ts +166 -0
- package/types/brep-src/brep/topo_object.d.ts +40 -0
- package/types/brep-src/brep/vertex.d.ts +48 -0
- package/types/brep-src/brep/wire.d.ts +66 -0
- package/types/brep-src/continuous/continuous_edge.d.ts +17 -0
- package/types/brep-src/continuous/continuous_face.d.ts +10 -0
- package/types/brep-src/continuous/continuous_util.d.ts +60 -0
- package/types/brep-src/continuous/continuous_uv.d.ts +24 -0
- package/types/brep-src/continuous/index.d.ts +4 -0
- package/types/brep-src/index.d.ts +14 -0
- package/types/brep-src/type_define/i_types.d.ts +46 -0
- package/types/brep-src/util/util.d.ts +23 -0
- package/types/conversion/units_conversion.d.ts +14 -0
- package/types/geometry/arc2d.d.ts +249 -0
- package/types/geometry/arc3d.d.ts +204 -0
- package/types/geometry/circle3d.d.ts +92 -0
- package/types/geometry/circular_surface.d.ts +52 -0
- package/types/geometry/coord_based_surface.d.ts +25 -0
- package/types/geometry/curve.d.ts +228 -0
- package/types/geometry/curve2.d.ts +62 -0
- package/types/geometry/curve3d.d.ts +66 -0
- package/types/geometry/cylinder.d.ts +73 -0
- package/types/geometry/discrete_arrow.d.ts +3 -0
- package/types/geometry/extend_curve2.d.ts +75 -0
- package/types/geometry/geometry2d.d.ts +35 -0
- package/types/geometry/geometry3d.d.ts +36 -0
- package/types/geometry/intersect_curve3.d.ts +90 -0
- package/types/geometry/ln2.d.ts +168 -0
- package/types/geometry/ln3.d.ts +152 -0
- package/types/geometry/nurbs_curve2.d.ts +106 -0
- package/types/geometry/nurbs_curve3.d.ts +191 -0
- package/types/geometry/offset_curve2.d.ts +63 -0
- package/types/geometry/offset_curve3.d.ts +97 -0
- package/types/geometry/offset_parameter_mapper.d.ts +72 -0
- package/types/geometry/plane.d.ts +109 -0
- package/types/geometry/polyline.d.ts +12 -0
- package/types/geometry/smooth_poly2.d.ts +78 -0
- package/types/geometry/smooth_poly3.d.ts +85 -0
- package/types/geometry/surface.d.ts +173 -0
- package/types/index.d.ts +78 -0
- package/types/io/obj_parser.d.ts +4 -0
- package/types/io/svgparser.d.ts +22 -0
- package/types/loader/loader.d.ts +23 -0
- package/types/loader/register_geo.d.ts +7 -0
- package/types/math/gauss_integration.d.ts +13 -0
- package/types/math/inv_bilinear.d.ts +33 -0
- package/types/solve_equations/cubic_equation.d.ts +7 -0
- package/types/solve_equations/linear_system.d.ts +6 -0
- package/types/solve_equations/nonlinear_system.d.ts +11 -0
- package/types/solve_equations/plurality.d.ts +9 -0
- package/types/solve_equations/polynomial_equation.d.ts +6 -0
- package/types/solve_equations/quadratic_equation.d.ts +6 -0
- package/types/solve_equations/quartic_equation.d.ts +6 -0
- package/types/solve_equations/solve_equation_util.d.ts +50 -0
- package/types/test_util/loop_generator.d.ts +21 -0
- package/types/topology/evolution_map.d.ts +90 -0
- package/types/topology/loop.d.ts +50 -0
- package/types/topology/polycurve.d.ts +109 -0
- package/types/topology/polygon.d.ts +118 -0
- package/types/topology/trimmed_surface.d.ts +136 -0
- package/types/type_define/const.d.ts +18 -0
- package/types/type_define/i_element.d.ts +9 -0
- package/types/type_define/i_element_type.d.ts +34 -0
- package/types/type_define/i_geometry.d.ts +191 -0
- package/types/type_define/i_types.d.ts +280 -0
- package/types/util/array_util.d.ts +8 -0
- package/types/util/assert.d.ts +21 -0
- package/types/util/clipper2_util.d.ts +5 -0
- package/types/util/clipper_format_converter.d.ts +21 -0
- package/types/util/clipper_util.d.ts +10 -0
- package/types/util/curve_util.d.ts +72 -0
- package/types/util/geom_util.d.ts +23 -0
- package/types/util/log.d.ts +19 -0
- package/types/util/math_error.d.ts +37 -0
- package/types/util/surface_util.d.ts +13 -0
- package/types/util/util.d.ts +18 -0
- package/types/util/uv_util.d.ts +68 -0
- package/types/verb/export_verb.d.ts +2 -0
- package/types/wasm/a2d.d.ts +19 -0
- package/types/wasm/bx2.d.ts +16 -0
- package/types/wasm/c2d.d.ts +29 -0
- package/types/wasm/elli.d.ts +19 -0
- package/types/wasm/grapher2d.d.ts +39 -0
- package/types/wasm/grapherutil.d.ts +9 -0
- package/types/wasm/l2d.d.ts +14 -0
- package/types/wasm/loader.d.ts +8 -0
- package/types/wasm/pt.d.ts +19 -0
- package/types/wasm/wasm-geom.d.ts +296 -0
- package/types/wasm/wasminstance.d.ts +19 -0
- package/types/wasm/wrapper.d.ts +82 -0
- package/README.md +0 -21
- package/dist/constants/geom_type.d.ts +0 -13
- package/dist/constants/geom_type.d.ts.map +0 -1
- package/dist/constants/geom_type.js +0 -17
- package/dist/constants/math_const.d.ts +0 -9
- package/dist/constants/math_const.d.ts.map +0 -1
- package/dist/constants/math_const.js +0 -12
- package/dist/core/box2.d.ts +0 -71
- package/dist/core/box2.d.ts.map +0 -1
- package/dist/core/box2.js +0 -243
- package/dist/core/coord2d.d.ts +0 -62
- package/dist/core/coord2d.d.ts.map +0 -1
- package/dist/core/coord2d.js +0 -155
- package/dist/core/geom_base.d.ts +0 -19
- package/dist/core/geom_base.d.ts.map +0 -1
- package/dist/core/geom_base.js +0 -18
- package/dist/core/mat3.d.ts +0 -101
- package/dist/core/mat3.d.ts.map +0 -1
- package/dist/core/mat3.js +0 -290
- package/dist/core/vec2.d.ts +0 -138
- package/dist/core/vec2.d.ts.map +0 -1
- package/dist/core/vec2.js +0 -297
- package/dist/curves/arc2.d.ts +0 -49
- package/dist/curves/arc2.d.ts.map +0 -1
- package/dist/curves/arc2.js +0 -265
- package/dist/curves/bspline2.d.ts +0 -150
- package/dist/curves/bspline2.d.ts.map +0 -1
- package/dist/curves/bspline2.js +0 -793
- package/dist/curves/circle2.d.ts +0 -42
- package/dist/curves/circle2.d.ts.map +0 -1
- package/dist/curves/circle2.js +0 -135
- package/dist/curves/circle_curve2.d.ts +0 -38
- package/dist/curves/circle_curve2.d.ts.map +0 -1
- package/dist/curves/circle_curve2.js +0 -112
- package/dist/curves/curve2.d.ts +0 -214
- package/dist/curves/curve2.d.ts.map +0 -1
- package/dist/curves/curve2.js +0 -238
- package/dist/curves/ellipse2.d.ts +0 -42
- package/dist/curves/ellipse2.d.ts.map +0 -1
- package/dist/curves/ellipse2.js +0 -125
- package/dist/curves/ellipse_arc2.d.ts +0 -49
- package/dist/curves/ellipse_arc2.d.ts.map +0 -1
- package/dist/curves/ellipse_arc2.js +0 -184
- package/dist/curves/ellipse_curve2.d.ts +0 -56
- package/dist/curves/ellipse_curve2.d.ts.map +0 -1
- package/dist/curves/ellipse_curve2.js +0 -262
- package/dist/curves/interval.d.ts +0 -112
- package/dist/curves/interval.d.ts.map +0 -1
- package/dist/curves/interval.js +0 -200
- package/dist/curves/line2.d.ts +0 -64
- package/dist/curves/line2.d.ts.map +0 -1
- package/dist/curves/line2.js +0 -193
- package/dist/curves/period_interval.d.ts +0 -129
- package/dist/curves/period_interval.d.ts.map +0 -1
- package/dist/curves/period_interval.js +0 -240
- package/dist/discretize/discretize_defaults.d.ts +0 -12
- package/dist/discretize/discretize_defaults.d.ts.map +0 -1
- package/dist/discretize/discretize_defaults.js +0 -12
- package/dist/discretize/discretize_engine.d.ts +0 -33
- package/dist/discretize/discretize_engine.d.ts.map +0 -1
- package/dist/discretize/discretize_engine.js +0 -347
- package/dist/discretize/discretize_errors.d.ts +0 -15
- package/dist/discretize/discretize_errors.d.ts.map +0 -1
- package/dist/discretize/discretize_errors.js +0 -30
- package/dist/discretize/discretize_options.d.ts +0 -18
- package/dist/discretize/discretize_options.d.ts.map +0 -1
- package/dist/discretize/discretize_options.js +0 -19
- package/dist/discretize/discretize_types.d.ts +0 -36
- package/dist/discretize/discretize_types.d.ts.map +0 -1
- package/dist/discretize/discretize_types.js +0 -1
- package/dist/discretize/internal/curve_guards.d.ts +0 -35
- package/dist/discretize/internal/curve_guards.d.ts.map +0 -1
- package/dist/discretize/internal/curve_guards.js +0 -62
- package/dist/discretize/internal/postprocess.d.ts +0 -5
- package/dist/discretize/internal/postprocess.d.ts.map +0 -1
- package/dist/discretize/internal/postprocess.js +0 -109
- package/dist/discretize/internal/sampling_utils.d.ts +0 -8
- package/dist/discretize/internal/sampling_utils.d.ts.map +0 -1
- package/dist/discretize/internal/sampling_utils.js +0 -36
- package/dist/discretize/register_builtin_strategies.d.ts +0 -3
- package/dist/discretize/register_builtin_strategies.d.ts.map +0 -1
- package/dist/discretize/register_builtin_strategies.js +0 -10
- package/dist/discretize/strategies/bspline_strategy.d.ts +0 -4
- package/dist/discretize/strategies/bspline_strategy.d.ts.map +0 -1
- package/dist/discretize/strategies/bspline_strategy.js +0 -115
- package/dist/discretize/strategies/circle_strategy.d.ts +0 -7
- package/dist/discretize/strategies/circle_strategy.d.ts.map +0 -1
- package/dist/discretize/strategies/circle_strategy.js +0 -55
- package/dist/discretize/strategies/ellipse_strategy.d.ts +0 -7
- package/dist/discretize/strategies/ellipse_strategy.d.ts.map +0 -1
- package/dist/discretize/strategies/ellipse_strategy.js +0 -86
- package/dist/discretize/strategies/line_strategy.d.ts +0 -4
- package/dist/discretize/strategies/line_strategy.d.ts.map +0 -1
- package/dist/discretize/strategies/line_strategy.js +0 -40
- package/dist/discretize/strategy_registry.d.ts +0 -9
- package/dist/discretize/strategy_registry.d.ts.map +0 -1
- package/dist/discretize/strategy_registry.js +0 -34
- package/dist/index.d.ts +0 -30
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -24
- package/dist/intersections/analytic_x_algorithm.d.ts +0 -10
- package/dist/intersections/analytic_x_algorithm.d.ts.map +0 -1
- package/dist/intersections/analytic_x_algorithm.js +0 -83
- package/dist/intersections/curve_x_engine.d.ts +0 -9
- package/dist/intersections/curve_x_engine.d.ts.map +0 -1
- package/dist/intersections/curve_x_engine.js +0 -27
- package/dist/intersections/index.d.ts +0 -5
- package/dist/intersections/index.d.ts.map +0 -1
- package/dist/intersections/index.js +0 -11
- package/dist/intersections/internal/certification.d.ts +0 -34
- package/dist/intersections/internal/certification.d.ts.map +0 -1
- package/dist/intersections/internal/certification.js +0 -238
- package/dist/intersections/internal/interval_clipping.d.ts +0 -29
- package/dist/intersections/internal/interval_clipping.d.ts.map +0 -1
- package/dist/intersections/internal/interval_clipping.js +0 -123
- package/dist/intersections/internal/kind.d.ts +0 -4
- package/dist/intersections/internal/kind.d.ts.map +0 -1
- package/dist/intersections/internal/kind.js +0 -16
- package/dist/intersections/internal/pair.d.ts +0 -9
- package/dist/intersections/internal/pair.d.ts.map +0 -1
- package/dist/intersections/internal/pair.js +0 -14
- package/dist/intersections/internal/result.d.ts +0 -20
- package/dist/intersections/internal/result.d.ts.map +0 -1
- package/dist/intersections/internal/result.js +0 -125
- package/dist/intersections/internal/sampling.d.ts +0 -15
- package/dist/intersections/internal/sampling.d.ts.map +0 -1
- package/dist/intersections/internal/sampling.js +0 -131
- package/dist/intersections/internal/segment.d.ts +0 -32
- package/dist/intersections/internal/segment.d.ts.map +0 -1
- package/dist/intersections/internal/segment.js +0 -137
- package/dist/intersections/internal/tolerance.d.ts +0 -10
- package/dist/intersections/internal/tolerance.d.ts.map +0 -1
- package/dist/intersections/internal/tolerance.js +0 -20
- package/dist/intersections/intersector.d.ts +0 -6
- package/dist/intersections/intersector.d.ts.map +0 -1
- package/dist/intersections/intersector.js +0 -1
- package/dist/intersections/numeric_x_algorithm.d.ts +0 -10
- package/dist/intersections/numeric_x_algorithm.d.ts.map +0 -1
- package/dist/intersections/numeric_x_algorithm.js +0 -73
- package/dist/intersections/solvers/bspline_self_solver.d.ts +0 -7
- package/dist/intersections/solvers/bspline_self_solver.d.ts.map +0 -1
- package/dist/intersections/solvers/bspline_self_solver.js +0 -308
- package/dist/intersections/solvers/line_line_pair_solver.d.ts +0 -7
- package/dist/intersections/solvers/line_line_pair_solver.d.ts.map +0 -1
- package/dist/intersections/solvers/line_line_pair_solver.js +0 -35
- package/dist/intersections/solvers/pair_solvers.d.ts +0 -94
- package/dist/intersections/solvers/pair_solvers.d.ts.map +0 -1
- package/dist/intersections/solvers/pair_solvers.js +0 -1078
- package/dist/intersections/solvers/polyline_pair_intersector.d.ts +0 -51
- package/dist/intersections/solvers/polyline_pair_intersector.d.ts.map +0 -1
- package/dist/intersections/solvers/polyline_pair_intersector.js +0 -731
- package/dist/intersections/types.d.ts +0 -11
- package/dist/intersections/types.d.ts.map +0 -1
- package/dist/intersections/types.js +0 -1
- package/dist/serialize/dump_types.d.ts +0 -101
- package/dist/serialize/dump_types.d.ts.map +0 -1
- package/dist/serialize/dump_types.js +0 -5
- package/dist/serialize/geom_mgr.d.ts +0 -24
- package/dist/serialize/geom_mgr.d.ts.map +0 -1
- package/dist/serialize/geom_mgr.js +0 -30
- package/dist/types/type_define.d.ts +0 -29
- package/dist/types/type_define.d.ts.map +0 -1
- package/dist/types/type_define.js +0 -10
- package/dist/types/type_guard.d.ts +0 -46
- package/dist/types/type_guard.d.ts.map +0 -1
- package/dist/types/type_guard.js +0 -5
- package/dist/utils/math_error.d.ts +0 -16
- package/dist/utils/math_error.d.ts.map +0 -1
- package/dist/utils/math_error.js +0 -35
- package/dist/utils/math_utils.d.ts +0 -9
- package/dist/utils/math_utils.d.ts.map +0 -1
- package/dist/utils/math_utils.js +0 -25
- package/dist/utils/precision.d.ts +0 -29
- package/dist/utils/precision.d.ts.map +0 -1
- package/dist/utils/precision.js +0 -44
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { MathError } from '../utils/math_error';
|
|
2
|
-
import { getCurveKind } from './internal/kind';
|
|
3
|
-
import { normalizePair } from './internal/pair';
|
|
4
|
-
import { analyzeCurveXInfosQuality, postprocessCurveXInfos, swapCurveXInfos } from './internal/result';
|
|
5
|
-
import { makeIntersectionTolerance } from './internal/tolerance';
|
|
6
|
-
import { ArcArcPairSolver, ArcEllipseArcPairSolver, ArcEllipsePairSolver, CircleArcPairSolver, CircleCirclePairSolver, CircleEllipseArcPairSolver, CircleEllipsePairSolver, EllipseArcEllipseArcPairSolver, EllipseEllipseArcPairSolver, EllipseEllipsePairSolver, LineArcPairSolver, LineCirclePairSolver, LineEllipseArcPairSolver, LineEllipsePairSolver, LineLinePairSolver, } from './solvers/pair_solvers';
|
|
7
|
-
import { PolylinePairIntersector } from './solvers/polyline_pair_intersector';
|
|
8
|
-
export class AnalyticXAlgorithm {
|
|
9
|
-
constructor() {
|
|
10
|
-
this.map = {
|
|
11
|
-
'line|line': new LineLinePairSolver(),
|
|
12
|
-
'line|circle': new LineCirclePairSolver(),
|
|
13
|
-
'line|arc': new LineArcPairSolver(),
|
|
14
|
-
'line|ellipse': new LineEllipsePairSolver(),
|
|
15
|
-
'line|ellipseArc': new LineEllipseArcPairSolver(),
|
|
16
|
-
'circle|circle': new CircleCirclePairSolver(),
|
|
17
|
-
'circle|arc': new CircleArcPairSolver(),
|
|
18
|
-
'circle|ellipse': new CircleEllipsePairSolver(),
|
|
19
|
-
'circle|ellipseArc': new CircleEllipseArcPairSolver(),
|
|
20
|
-
'arc|arc': new ArcArcPairSolver(),
|
|
21
|
-
'arc|ellipse': new ArcEllipsePairSolver(),
|
|
22
|
-
'arc|ellipseArc': new ArcEllipseArcPairSolver(),
|
|
23
|
-
'ellipse|ellipse': new EllipseEllipsePairSolver(),
|
|
24
|
-
'ellipse|ellipseArc': new EllipseEllipseArcPairSolver(),
|
|
25
|
-
'ellipseArc|ellipseArc': new EllipseArcEllipseArcPairSolver(),
|
|
26
|
-
};
|
|
27
|
-
this.retryMap = {
|
|
28
|
-
'circle|ellipse': new PolylinePairIntersector(320, 96),
|
|
29
|
-
'circle|ellipseArc': new PolylinePairIntersector(320, 96),
|
|
30
|
-
'arc|ellipse': new PolylinePairIntersector(320, 96),
|
|
31
|
-
'arc|ellipseArc': new PolylinePairIntersector(320, 96),
|
|
32
|
-
'ellipse|ellipse': new PolylinePairIntersector(352, 96),
|
|
33
|
-
'ellipse|ellipseArc': new PolylinePairIntersector(352, 96),
|
|
34
|
-
'ellipseArc|ellipseArc': new PolylinePairIntersector(352, 96),
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
intersect(c1, c2) {
|
|
38
|
-
const k1 = getCurveKind(c1);
|
|
39
|
-
const k2 = getCurveKind(c2);
|
|
40
|
-
const pair = normalizePair(k1, k2);
|
|
41
|
-
const solver = this.map[pair.key];
|
|
42
|
-
if (!solver) {
|
|
43
|
-
MathError.throw(`AnalyticXAlgorithm: unsupported pair ${c1.getType()}|${c2.getType()}`);
|
|
44
|
-
}
|
|
45
|
-
const tol = makeIntersectionTolerance(c1, c2);
|
|
46
|
-
const diagBefore = PolylinePairIntersector.getDiagnostics();
|
|
47
|
-
const raw = pair.swapped ? solver.intersect(c2, c1) : solver.intersect(c1, c2);
|
|
48
|
-
const ordered = pair.swapped ? swapCurveXInfos(raw) : raw;
|
|
49
|
-
const primary = postprocessCurveXInfos(ordered, tol.pointTol);
|
|
50
|
-
const quality = analyzeCurveXInfosQuality(ordered, tol.pointTol);
|
|
51
|
-
if (!this.shouldRetry(pair.key, c1, c2, quality, diagBefore, PolylinePairIntersector.getDiagnostics())) {
|
|
52
|
-
return primary;
|
|
53
|
-
}
|
|
54
|
-
const retrySolver = this.retryMap[pair.key];
|
|
55
|
-
if (!retrySolver)
|
|
56
|
-
return primary;
|
|
57
|
-
const retryRaw = pair.swapped ? retrySolver.intersect(c2, c1) : retrySolver.intersect(c1, c2);
|
|
58
|
-
if (retryRaw.length === 0)
|
|
59
|
-
return primary;
|
|
60
|
-
const retryOrdered = pair.swapped ? swapCurveXInfos(retryRaw) : retryRaw;
|
|
61
|
-
return postprocessCurveXInfos([...ordered, ...retryOrdered], tol.pointTol);
|
|
62
|
-
}
|
|
63
|
-
shouldRetry(key, c1, c2, quality, before, after) {
|
|
64
|
-
if (!this.retryMap[key])
|
|
65
|
-
return false;
|
|
66
|
-
if (!this.boxesLikelyIntersect(c1, c2))
|
|
67
|
-
return false;
|
|
68
|
-
if (quality.rawCount === 0)
|
|
69
|
-
return true;
|
|
70
|
-
if (quality.duplicatePointCount > 0)
|
|
71
|
-
return true;
|
|
72
|
-
const certificationMissDelta = after.certificationMissCount - before.certificationMissCount;
|
|
73
|
-
const refineFailDelta = after.refineFailureCount - before.refineFailureCount;
|
|
74
|
-
const rejectDelta = after.certificationRejectCount - before.certificationRejectCount;
|
|
75
|
-
return certificationMissDelta > 0 || refineFailDelta > 0 || rejectDelta > 0;
|
|
76
|
-
}
|
|
77
|
-
boxesLikelyIntersect(c1, c2) {
|
|
78
|
-
const t = makeIntersectionTolerance(c1, c2);
|
|
79
|
-
const b1 = c1.boundingBox().expandByScalar(t.pointTol * 2);
|
|
80
|
-
const b2 = c2.boundingBox().expandByScalar(t.pointTol * 2);
|
|
81
|
-
return b1.intersects(b2);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Curve2 } from '../curves/curve2';
|
|
2
|
-
import type { CurveXInfo } from './types';
|
|
3
|
-
export declare class CurveXEngine {
|
|
4
|
-
private readonly analytic;
|
|
5
|
-
private readonly numeric;
|
|
6
|
-
intersect(c1: Curve2, c2: Curve2): CurveXInfo[];
|
|
7
|
-
private shouldUseNumeric;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=curve_x_engine.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"curve_x_engine.d.ts","sourceRoot":"","sources":["../../src/intersections/curve_x_engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAI9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC,qBAAa,YAAY;IACrB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA2B;IACpD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA0B;IAE3C,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,UAAU,EAAE;IAkBtD,OAAO,CAAC,gBAAgB;CAG3B"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { MathError } from '../utils/math_error';
|
|
2
|
-
import { AnalyticXAlgorithm } from './analytic_x_algorithm';
|
|
3
|
-
import { NumericXAlgorithm } from './numeric_x_algorithm';
|
|
4
|
-
export class CurveXEngine {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.analytic = new AnalyticXAlgorithm();
|
|
7
|
-
this.numeric = new NumericXAlgorithm();
|
|
8
|
-
}
|
|
9
|
-
intersect(c1, c2) {
|
|
10
|
-
if (this.shouldUseNumeric(c1, c2)) {
|
|
11
|
-
return this.numeric.intersect(c1, c2);
|
|
12
|
-
}
|
|
13
|
-
try {
|
|
14
|
-
return this.analytic.intersect(c1, c2);
|
|
15
|
-
}
|
|
16
|
-
catch (error) {
|
|
17
|
-
if (error instanceof MathError &&
|
|
18
|
-
error.message.startsWith('AnalyticXAlgorithm: unsupported pair')) {
|
|
19
|
-
return this.numeric.intersect(c1, c2);
|
|
20
|
-
}
|
|
21
|
-
throw error;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
shouldUseNumeric(c1, c2) {
|
|
25
|
-
return c1.isBSpline() || c2.isBSpline();
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { Curve2 } from '../curves/curve2';
|
|
2
|
-
export type { CurveXInfo } from './types';
|
|
3
|
-
export declare function intersectCurveCurve(c1: Curve2, c2: Curve2): import("./types").CurveXInfo[];
|
|
4
|
-
export declare function intersectCurveSelf(curve: Curve2): import("./types").CurveXInfo[];
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/intersections/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAI9C,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAIzC,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,kCAEzD;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,kCAG/C"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { CurveXEngine } from './curve_x_engine';
|
|
2
|
-
import { intersectBSplineSelf } from './solvers/bspline_self_solver';
|
|
3
|
-
const curveXEngine = new CurveXEngine();
|
|
4
|
-
export function intersectCurveCurve(c1, c2) {
|
|
5
|
-
return curveXEngine.intersect(c1, c2);
|
|
6
|
-
}
|
|
7
|
-
export function intersectCurveSelf(curve) {
|
|
8
|
-
if (!curve.isBSpline())
|
|
9
|
-
return [];
|
|
10
|
-
return intersectBSplineSelf(curve);
|
|
11
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Interval } from '../../curves/interval';
|
|
2
|
-
import type { Curve2 } from '../../curves/curve2';
|
|
3
|
-
import type { Vec2 } from '../../core/vec2';
|
|
4
|
-
export type ClosestPointLike = {
|
|
5
|
-
param: number;
|
|
6
|
-
distance: number;
|
|
7
|
-
};
|
|
8
|
-
export type ClosestPointProvider = (curve: Curve2, p: Vec2, tol: number) => ClosestPointLike | undefined;
|
|
9
|
-
export type ParamPairCandidate = {
|
|
10
|
-
u1: number;
|
|
11
|
-
u2: number;
|
|
12
|
-
residual: number;
|
|
13
|
-
};
|
|
14
|
-
export type CertifiedParamPair = {
|
|
15
|
-
point: Vec2;
|
|
16
|
-
u1: number;
|
|
17
|
-
u2: number;
|
|
18
|
-
residual: number;
|
|
19
|
-
};
|
|
20
|
-
export type ResidualEnvelope = {
|
|
21
|
-
lowerBound: number;
|
|
22
|
-
upperBound: number;
|
|
23
|
-
minSample: number;
|
|
24
|
-
maxSample: number;
|
|
25
|
-
};
|
|
26
|
-
export type CertificationOutcome = {
|
|
27
|
-
pair: CertifiedParamPair;
|
|
28
|
-
usedDegenerateRescue: boolean;
|
|
29
|
-
envelopeUpperBound: number;
|
|
30
|
-
};
|
|
31
|
-
export declare function certifyParamPair(c1: Curve2, c2: Curve2, candidate: ParamPairCandidate, tol: number, closestPoint: ClosestPointProvider): CertificationOutcome | undefined;
|
|
32
|
-
export declare function projectRangeToCurve(baseCurve: Curve2, otherCurve: Curve2, rangeOnBase: Interval, tol: number, closestPoint: ClosestPointProvider): Interval | undefined;
|
|
33
|
-
export declare function certifyOverlapMonotone(baseCurve: Curve2, otherCurve: Curve2, rangeOnBase: Interval, tol: number, paramTol: number, closestPoint: ClosestPointProvider): boolean;
|
|
34
|
-
//# sourceMappingURL=certification.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"certification.d.ts","sourceRoot":"","sources":["../../../src/intersections/internal/certification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAAM,MAAM,gBAAgB,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,gBAAgB,GAAG,SAAS,CAAA;AAExG,MAAM,MAAM,kBAAkB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC7B,KAAK,EAAE,IAAI,CAAA;IACX,EAAE,EAAE,MAAM,CAAA;IACV,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC3B,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IAC/B,IAAI,EAAE,kBAAkB,CAAA;IACxB,oBAAoB,EAAE,OAAO,CAAA;IAC7B,kBAAkB,EAAE,MAAM,CAAA;CAC7B,CAAA;AAED,wBAAgB,gBAAgB,CAC5B,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,kBAAkB,EAC7B,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,oBAAoB,GACnC,oBAAoB,GAAG,SAAS,CAwBlC;AAED,wBAAgB,mBAAmB,CAC/B,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,QAAQ,EACrB,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,oBAAoB,GACnC,QAAQ,GAAG,SAAS,CAOtB;AAED,wBAAgB,sBAAsB,CAClC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,QAAQ,EACrB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,oBAAoB,WAuBrC"}
|
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
import { Interval } from '../../curves/interval';
|
|
2
|
-
import { Precision } from '../../utils/precision';
|
|
3
|
-
export function certifyParamPair(c1, c2, candidate, tol, closestPoint) {
|
|
4
|
-
const cp2 = closestPoint(c2, c1.pointAt(candidate.u1), tol * 2);
|
|
5
|
-
const cp1 = closestPoint(c1, c2.pointAt(candidate.u2), tol * 2);
|
|
6
|
-
if (!cp1 || !cp2)
|
|
7
|
-
return undefined;
|
|
8
|
-
if (cp1.distance > tol * 3 || cp2.distance > tol * 3)
|
|
9
|
-
return undefined;
|
|
10
|
-
const measured = measureParamPair(c1, c2, cp1.param, cp2.param);
|
|
11
|
-
if (measured.residual > tol * 3)
|
|
12
|
-
return undefined;
|
|
13
|
-
const envelope = estimateResidualEnvelopeAdaptive(c1, c2, measured.u1, measured.u2, 4);
|
|
14
|
-
if (envelope.upperBound <= tol * 6) {
|
|
15
|
-
return {
|
|
16
|
-
pair: measured,
|
|
17
|
-
usedDegenerateRescue: false,
|
|
18
|
-
envelopeUpperBound: envelope.upperBound,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
if (!isNearDegenerate(c1, c2, measured.u1, measured.u2))
|
|
22
|
-
return undefined;
|
|
23
|
-
const rescued = tryDegenerateRescue(c1, c2, measured, tol, closestPoint);
|
|
24
|
-
if (!rescued)
|
|
25
|
-
return undefined;
|
|
26
|
-
return {
|
|
27
|
-
pair: rescued.pair,
|
|
28
|
-
usedDegenerateRescue: true,
|
|
29
|
-
envelopeUpperBound: rescued.envelope.upperBound,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
export function projectRangeToCurve(baseCurve, otherCurve, rangeOnBase, tol, closestPoint) {
|
|
33
|
-
const startOnBase = baseCurve.pointAt(rangeOnBase.start);
|
|
34
|
-
const endOnBase = baseCurve.pointAt(rangeOnBase.end);
|
|
35
|
-
const cpStart = closestPoint(otherCurve, startOnBase, tol);
|
|
36
|
-
const cpEnd = closestPoint(otherCurve, endOnBase, tol);
|
|
37
|
-
if (!cpStart || !cpEnd)
|
|
38
|
-
return undefined;
|
|
39
|
-
return new Interval(Math.min(cpStart.param, cpEnd.param), Math.max(cpStart.param, cpEnd.param));
|
|
40
|
-
}
|
|
41
|
-
export function certifyOverlapMonotone(baseCurve, otherCurve, rangeOnBase, tol, paramTol, closestPoint) {
|
|
42
|
-
const samples = [0, 0.25, 0.5, 0.75, 1];
|
|
43
|
-
let pass = 0;
|
|
44
|
-
const paramsOnOther = [];
|
|
45
|
-
for (const t of samples) {
|
|
46
|
-
const u = rangeOnBase.start + (rangeOnBase.end - rangeOnBase.start) * t;
|
|
47
|
-
const p = baseCurve.pointAt(u);
|
|
48
|
-
const cp = closestPoint(otherCurve, p, tol);
|
|
49
|
-
if (!cp)
|
|
50
|
-
continue;
|
|
51
|
-
paramsOnOther.push(cp.param);
|
|
52
|
-
if (cp.distance <= tol * 2.5)
|
|
53
|
-
pass++;
|
|
54
|
-
}
|
|
55
|
-
if (pass < 4 || paramsOnOther.length < 4)
|
|
56
|
-
return false;
|
|
57
|
-
let nonDecreasing = true;
|
|
58
|
-
let nonIncreasing = true;
|
|
59
|
-
for (let i = 1; i < paramsOnOther.length; i++) {
|
|
60
|
-
if (paramsOnOther[i] < paramsOnOther[i - 1] - paramTol)
|
|
61
|
-
nonDecreasing = false;
|
|
62
|
-
if (paramsOnOther[i] > paramsOnOther[i - 1] + paramTol)
|
|
63
|
-
nonIncreasing = false;
|
|
64
|
-
}
|
|
65
|
-
return nonDecreasing || nonIncreasing;
|
|
66
|
-
}
|
|
67
|
-
function measureParamPair(c1, c2, u1, u2) {
|
|
68
|
-
const p1 = c1.pointAt(u1);
|
|
69
|
-
const p2 = c2.pointAt(u2);
|
|
70
|
-
return {
|
|
71
|
-
u1,
|
|
72
|
-
u2,
|
|
73
|
-
point: p1.added(p2).scale(0.5),
|
|
74
|
-
residual: p1.distanceTo(p2),
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
function estimateResidualEnvelopeAdaptive(c1, c2, u1, u2, maxDepth) {
|
|
78
|
-
let w1 = buildCertificationWindow(c1, u1, 1);
|
|
79
|
-
let w2 = buildCertificationWindow(c2, u2, 1);
|
|
80
|
-
let upper = Number.POSITIVE_INFINITY;
|
|
81
|
-
let lower = 0;
|
|
82
|
-
let minSample = Number.POSITIVE_INFINITY;
|
|
83
|
-
let maxSample = 0;
|
|
84
|
-
for (let depth = 0; depth <= maxDepth; depth++) {
|
|
85
|
-
const env = evaluateWindowEnvelope(c1, c2, w1, w2);
|
|
86
|
-
lower = Math.max(lower, env.lowerBound);
|
|
87
|
-
upper = Math.min(upper, env.upperBound);
|
|
88
|
-
minSample = Math.min(minSample, env.minSample);
|
|
89
|
-
maxSample = Math.max(maxSample, env.maxSample);
|
|
90
|
-
if (w1.length() <= Precision.CURVE_PARAM_EPS * 32 && w2.length() <= Precision.CURVE_PARAM_EPS * 32) {
|
|
91
|
-
break;
|
|
92
|
-
}
|
|
93
|
-
w1 = shrinkWindowAroundParam(c1, w1, u1, 0.5);
|
|
94
|
-
w2 = shrinkWindowAroundParam(c2, w2, u2, 0.5);
|
|
95
|
-
}
|
|
96
|
-
const half1 = 0.5 * (w1.end - w1.start);
|
|
97
|
-
const half2 = 0.5 * (w2.end - w2.start);
|
|
98
|
-
const l1 = maxTangentNorm(c1, w1);
|
|
99
|
-
const l2 = maxTangentNorm(c2, w2);
|
|
100
|
-
const drift = l1 * half1 + l2 * half2;
|
|
101
|
-
const conservativeUpper = Number.isFinite(upper) ? upper + drift * 0.25 : maxSample + drift;
|
|
102
|
-
const conservativeLower = Math.max(0, lower - drift * 0.25);
|
|
103
|
-
return {
|
|
104
|
-
lowerBound: conservativeLower,
|
|
105
|
-
upperBound: Math.max(conservativeUpper, maxSample),
|
|
106
|
-
minSample,
|
|
107
|
-
maxSample,
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
function tryDegenerateRescue(c1, c2, measured, tol, closestPoint) {
|
|
111
|
-
const w1 = buildCertificationWindow(c1, measured.u1, 2);
|
|
112
|
-
const w2 = buildCertificationWindow(c2, measured.u2, 2);
|
|
113
|
-
const grid = sampleInterval5(w1);
|
|
114
|
-
const grid2 = sampleInterval5(w2);
|
|
115
|
-
let best = measured;
|
|
116
|
-
for (const u of grid) {
|
|
117
|
-
const p1 = c1.pointAt(u);
|
|
118
|
-
for (const v of grid2) {
|
|
119
|
-
const p2 = c2.pointAt(v);
|
|
120
|
-
const d = p1.distanceTo(p2);
|
|
121
|
-
if (d >= best.residual)
|
|
122
|
-
continue;
|
|
123
|
-
best = {
|
|
124
|
-
u1: u,
|
|
125
|
-
u2: v,
|
|
126
|
-
point: p1.added(p2).scale(0.5),
|
|
127
|
-
residual: d,
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
const cp2 = closestPoint(c2, c1.pointAt(best.u1), tol * 3);
|
|
132
|
-
if (cp2) {
|
|
133
|
-
const cp1 = closestPoint(c1, c2.pointAt(cp2.param), tol * 3);
|
|
134
|
-
if (cp1) {
|
|
135
|
-
best = measureParamPair(c1, c2, cp1.param, cp2.param);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
if (best.residual > tol * 2.8)
|
|
139
|
-
return undefined;
|
|
140
|
-
const envelope = evaluateWindowEnvelope(c1, c2, buildCertificationWindow(c1, best.u1, 1), buildCertificationWindow(c2, best.u2, 1));
|
|
141
|
-
if (envelope.upperBound > tol * 8)
|
|
142
|
-
return undefined;
|
|
143
|
-
return {
|
|
144
|
-
pair: best,
|
|
145
|
-
envelope,
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
function evaluateWindowEnvelope(c1, c2, w1, w2) {
|
|
149
|
-
const uSamples = sampleInterval5(w1);
|
|
150
|
-
const vSamples = sampleInterval5(w2);
|
|
151
|
-
let minSample = Number.POSITIVE_INFINITY;
|
|
152
|
-
let maxSample = 0;
|
|
153
|
-
for (const a of uSamples) {
|
|
154
|
-
const p1 = c1.pointAt(a);
|
|
155
|
-
for (const b of vSamples) {
|
|
156
|
-
const p2 = c2.pointAt(b);
|
|
157
|
-
const r = p1.distanceTo(p2);
|
|
158
|
-
if (r < minSample)
|
|
159
|
-
minSample = r;
|
|
160
|
-
if (r > maxSample)
|
|
161
|
-
maxSample = r;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
const half1 = 0.5 * (w1.end - w1.start);
|
|
165
|
-
const half2 = 0.5 * (w2.end - w2.start);
|
|
166
|
-
const l1 = maxTangentNorm(c1, w1);
|
|
167
|
-
const l2 = maxTangentNorm(c2, w2);
|
|
168
|
-
const drift = l1 * half1 + l2 * half2;
|
|
169
|
-
return {
|
|
170
|
-
lowerBound: Math.max(0, minSample - drift),
|
|
171
|
-
upperBound: maxSample + drift,
|
|
172
|
-
minSample,
|
|
173
|
-
maxSample,
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
function buildCertificationWindow(curve, u, scale) {
|
|
177
|
-
const range = curve.getRange();
|
|
178
|
-
const span = Math.max(range.length(), Precision.CURVE_PARAM_EPS);
|
|
179
|
-
const half = Math.max(Precision.CURVE_PARAM_EPS * 16, span * 1e-4 * scale);
|
|
180
|
-
const start = Math.max(range.start, u - half);
|
|
181
|
-
const end = Math.min(range.end, u + half);
|
|
182
|
-
if (end <= start + Precision.CURVE_PARAM_EPS) {
|
|
183
|
-
const clamped = range.clamp(u);
|
|
184
|
-
return new Interval(clamped, clamped);
|
|
185
|
-
}
|
|
186
|
-
return new Interval(start, end);
|
|
187
|
-
}
|
|
188
|
-
function sampleInterval3(x) {
|
|
189
|
-
if (x.end - x.start <= Precision.CURVE_PARAM_EPS) {
|
|
190
|
-
return [x.start];
|
|
191
|
-
}
|
|
192
|
-
return [x.start, 0.5 * (x.start + x.end), x.end];
|
|
193
|
-
}
|
|
194
|
-
function sampleInterval5(x) {
|
|
195
|
-
if (x.end - x.start <= Precision.CURVE_PARAM_EPS) {
|
|
196
|
-
return [x.start];
|
|
197
|
-
}
|
|
198
|
-
const a = x.start;
|
|
199
|
-
const b = x.end;
|
|
200
|
-
return [
|
|
201
|
-
a,
|
|
202
|
-
a + 0.25 * (b - a),
|
|
203
|
-
a + 0.5 * (b - a),
|
|
204
|
-
a + 0.75 * (b - a),
|
|
205
|
-
b,
|
|
206
|
-
];
|
|
207
|
-
}
|
|
208
|
-
function maxTangentNorm(curve, x) {
|
|
209
|
-
const samples = sampleInterval3(x);
|
|
210
|
-
let ret = Precision.CURVE_NEWTON_EPS;
|
|
211
|
-
for (const u of samples) {
|
|
212
|
-
const n = curve.tangentAt(u).len();
|
|
213
|
-
if (Number.isFinite(n))
|
|
214
|
-
ret = Math.max(ret, n);
|
|
215
|
-
}
|
|
216
|
-
return ret;
|
|
217
|
-
}
|
|
218
|
-
function isNearDegenerate(c1, c2, u1, u2) {
|
|
219
|
-
const t1 = c1.tangentAt(u1);
|
|
220
|
-
const t2 = c2.tangentAt(u2);
|
|
221
|
-
const n1 = t1.len();
|
|
222
|
-
const n2 = t2.len();
|
|
223
|
-
if (n1 <= Precision.CURVE_NEWTON_EPS || n2 <= Precision.CURVE_NEWTON_EPS)
|
|
224
|
-
return true;
|
|
225
|
-
const sin = Math.abs(t1.cross(t2)) / (n1 * n2);
|
|
226
|
-
return sin <= 1e-3;
|
|
227
|
-
}
|
|
228
|
-
function shrinkWindowAroundParam(curve, window, center, factor) {
|
|
229
|
-
const range = curve.getRange();
|
|
230
|
-
const half = Math.max(Precision.CURVE_PARAM_EPS * 8, 0.5 * window.length() * factor);
|
|
231
|
-
const u = range.clamp(center);
|
|
232
|
-
const start = Math.max(range.start, u - half);
|
|
233
|
-
const end = Math.min(range.end, u + half);
|
|
234
|
-
if (end <= start + Precision.CURVE_PARAM_EPS) {
|
|
235
|
-
return new Interval(u, u);
|
|
236
|
-
}
|
|
237
|
-
return new Interval(start, end);
|
|
238
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Interval } from '../../curves/interval';
|
|
2
|
-
import type { Curve2 } from '../../curves/curve2';
|
|
3
|
-
export type ClipPointSeed = {
|
|
4
|
-
u1: number;
|
|
5
|
-
u2: number;
|
|
6
|
-
};
|
|
7
|
-
export type ClipOverlapSeed = {
|
|
8
|
-
range1: Interval;
|
|
9
|
-
range2: Interval;
|
|
10
|
-
};
|
|
11
|
-
export type IntervalClipOptions = {
|
|
12
|
-
pointTol: number;
|
|
13
|
-
seedParamTol: number;
|
|
14
|
-
maxDepth: number;
|
|
15
|
-
maxNodes: number;
|
|
16
|
-
pointSeedLimit: number;
|
|
17
|
-
overlapSeedLimit: number;
|
|
18
|
-
};
|
|
19
|
-
export type IntervalClipDiagnostics = {
|
|
20
|
-
nodesVisited: number;
|
|
21
|
-
aborted: boolean;
|
|
22
|
-
};
|
|
23
|
-
export type IntervalClipResult = {
|
|
24
|
-
pointSeeds: ClipPointSeed[];
|
|
25
|
-
overlapSeeds: ClipOverlapSeed[];
|
|
26
|
-
diagnostics: IntervalClipDiagnostics;
|
|
27
|
-
};
|
|
28
|
-
export declare function collectIntervalClipSeeds(c1: Curve2, c2: Curve2, options: IntervalClipOptions): IntervalClipResult;
|
|
29
|
-
//# sourceMappingURL=interval_clipping.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interval_clipping.d.ts","sourceRoot":"","sources":["../../../src/intersections/internal/interval_clipping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAKjD,MAAM,MAAM,aAAa,GAAG;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,EAAE,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC1B,MAAM,EAAE,QAAQ,CAAA;IAChB,MAAM,EAAE,QAAQ,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,cAAc,EAAE,MAAM,CAAA;IACtB,gBAAgB,EAAE,MAAM,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IAClC,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC7B,UAAU,EAAE,aAAa,EAAE,CAAA;IAC3B,YAAY,EAAE,eAAe,EAAE,CAAA;IAC/B,WAAW,EAAE,uBAAuB,CAAA;CACvC,CAAA;AAOD,wBAAgB,wBAAwB,CACpC,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,mBAAmB,GAC7B,kBAAkB,CAoHpB"}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { Interval } from '../../curves/interval';
|
|
2
|
-
import { Precision } from '../../utils/precision';
|
|
3
|
-
import { intersectSegments, lerp, makeSegment, segmentBoxesMayIntersect, segmentDistance } from './segment';
|
|
4
|
-
export function collectIntervalClipSeeds(c1, c2, options) {
|
|
5
|
-
const r1 = c1.getRange();
|
|
6
|
-
const r2 = c2.getRange();
|
|
7
|
-
if (r1.length() <= Precision.CURVE_PARAM_EPS || r2.length() <= Precision.CURVE_PARAM_EPS) {
|
|
8
|
-
return {
|
|
9
|
-
pointSeeds: [],
|
|
10
|
-
overlapSeeds: [],
|
|
11
|
-
diagnostics: { nodesVisited: 0, aborted: false },
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
const pointSeeds = [];
|
|
15
|
-
const overlapSeeds = [];
|
|
16
|
-
const state = {
|
|
17
|
-
nodes: 0,
|
|
18
|
-
aborted: false,
|
|
19
|
-
};
|
|
20
|
-
const cache1 = new Map();
|
|
21
|
-
const cache2 = new Map();
|
|
22
|
-
const getPoint = (curve, cache, u) => {
|
|
23
|
-
const key = u.toPrecision(15);
|
|
24
|
-
const found = cache.get(key);
|
|
25
|
-
if (found)
|
|
26
|
-
return found;
|
|
27
|
-
const p = curve.pointAt(u);
|
|
28
|
-
cache.set(key, p);
|
|
29
|
-
return p;
|
|
30
|
-
};
|
|
31
|
-
const recurse = (u0, u1, v0, v1, depth) => {
|
|
32
|
-
if (state.aborted)
|
|
33
|
-
return;
|
|
34
|
-
if (state.nodes++ > options.maxNodes) {
|
|
35
|
-
state.aborted = true;
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
if (u1 - u0 <= Precision.CURVE_PARAM_EPS && v1 - v0 <= Precision.CURVE_PARAM_EPS)
|
|
39
|
-
return;
|
|
40
|
-
const p10 = getPoint(c1, cache1, u0);
|
|
41
|
-
const p11 = getPoint(c1, cache1, u1);
|
|
42
|
-
const p20 = getPoint(c2, cache2, v0);
|
|
43
|
-
const p21 = getPoint(c2, cache2, v1);
|
|
44
|
-
const s1 = makeSegment(p10, p11);
|
|
45
|
-
const s2 = makeSegment(p20, p21);
|
|
46
|
-
if (!segmentBoxesMayIntersect(s1, s2, options.pointTol))
|
|
47
|
-
return;
|
|
48
|
-
const hit = intersectSegments(s1, s2);
|
|
49
|
-
if (hit.kind === 'point') {
|
|
50
|
-
addPointSeed(pointSeeds, lerp(u0, u1, hit.t1), lerp(v0, v1, hit.t2), options.seedParamTol, options.pointSeedLimit);
|
|
51
|
-
}
|
|
52
|
-
else if (hit.kind === 'overlap') {
|
|
53
|
-
addOverlapSeed(overlapSeeds, {
|
|
54
|
-
range1: new Interval(lerp(u0, u1, hit.t1s), lerp(u0, u1, hit.t1e)),
|
|
55
|
-
range2: new Interval(lerp(v0, v1, hit.t2s), lerp(v0, v1, hit.t2e)),
|
|
56
|
-
}, options.overlapSeedLimit);
|
|
57
|
-
addPointSeed(pointSeeds, 0.5 * (lerp(u0, u1, hit.t1s) + lerp(u0, u1, hit.t1e)), 0.5 * (lerp(v0, v1, hit.t2s) + lerp(v0, v1, hit.t2e)), options.seedParamTol, options.pointSeedLimit);
|
|
58
|
-
}
|
|
59
|
-
const dist = segmentDistance(s1, s2);
|
|
60
|
-
const uSpan = u1 - u0;
|
|
61
|
-
const vSpan = v1 - v0;
|
|
62
|
-
const paramTiny = uSpan <= Precision.CURVE_PARAM_EPS * 32 && vSpan <= Precision.CURVE_PARAM_EPS * 32;
|
|
63
|
-
const geomTiny = Math.max(s1.len, s2.len) <= options.pointTol * 1.25;
|
|
64
|
-
if (depth >= options.maxDepth || paramTiny || geomTiny) {
|
|
65
|
-
if (dist <= options.pointTol * 1.75) {
|
|
66
|
-
addPointSeed(pointSeeds, 0.5 * (u0 + u1), 0.5 * (v0 + v1), options.seedParamTol, options.pointSeedLimit);
|
|
67
|
-
}
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
if (dist > Math.max(s1.len, s2.len) + options.pointTol * 3)
|
|
71
|
-
return;
|
|
72
|
-
const splitU = s1.len >= s2.len;
|
|
73
|
-
if (splitU) {
|
|
74
|
-
const um = 0.5 * (u0 + u1);
|
|
75
|
-
if (um <= u0 + Precision.CURVE_PARAM_EPS || um >= u1 - Precision.CURVE_PARAM_EPS)
|
|
76
|
-
return;
|
|
77
|
-
recurse(u0, um, v0, v1, depth + 1);
|
|
78
|
-
recurse(um, u1, v0, v1, depth + 1);
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
const vm = 0.5 * (v0 + v1);
|
|
82
|
-
if (vm <= v0 + Precision.CURVE_PARAM_EPS || vm >= v1 - Precision.CURVE_PARAM_EPS)
|
|
83
|
-
return;
|
|
84
|
-
recurse(u0, u1, v0, vm, depth + 1);
|
|
85
|
-
recurse(u0, u1, vm, v1, depth + 1);
|
|
86
|
-
};
|
|
87
|
-
recurse(r1.start, r1.end, r2.start, r2.end, 0);
|
|
88
|
-
return {
|
|
89
|
-
pointSeeds,
|
|
90
|
-
overlapSeeds,
|
|
91
|
-
diagnostics: {
|
|
92
|
-
nodesVisited: state.nodes,
|
|
93
|
-
aborted: state.aborted,
|
|
94
|
-
},
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
function addPointSeed(seeds, u1, u2, paramTol, limit) {
|
|
98
|
-
if (limit > 0 && seeds.length >= limit)
|
|
99
|
-
return;
|
|
100
|
-
for (const seed of seeds) {
|
|
101
|
-
if (Math.abs(seed.u1 - u1) <= paramTol && Math.abs(seed.u2 - u2) <= paramTol) {
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
seeds.push({ u1, u2 });
|
|
106
|
-
}
|
|
107
|
-
function addOverlapSeed(seeds, next, limit) {
|
|
108
|
-
for (let i = 0; i < seeds.length; i++) {
|
|
109
|
-
const cur = seeds[i];
|
|
110
|
-
const overlap1 = next.range1.intersect(cur.range1, Precision.CURVE_PARAM_EPS * 8);
|
|
111
|
-
const overlap2 = next.range2.intersect(cur.range2, Precision.CURVE_PARAM_EPS * 8);
|
|
112
|
-
if (overlap1.length === 0 || overlap2.length === 0)
|
|
113
|
-
continue;
|
|
114
|
-
seeds[i] = {
|
|
115
|
-
range1: new Interval(Math.min(cur.range1.start, next.range1.start), Math.max(cur.range1.end, next.range1.end)),
|
|
116
|
-
range2: new Interval(Math.min(cur.range2.start, next.range2.start), Math.max(cur.range2.end, next.range2.end)),
|
|
117
|
-
};
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
if (limit > 0 && seeds.length >= limit)
|
|
121
|
-
return;
|
|
122
|
-
seeds.push(next);
|
|
123
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kind.d.ts","sourceRoot":"","sources":["../../../src/intersections/internal/kind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAEjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAEvC,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAQrD"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { MathError } from '../../utils/math_error';
|
|
2
|
-
export function getCurveKind(curve) {
|
|
3
|
-
if (curve.isLine())
|
|
4
|
-
return 'line';
|
|
5
|
-
if (curve.isCircle())
|
|
6
|
-
return 'circle';
|
|
7
|
-
if (curve.isArc())
|
|
8
|
-
return 'arc';
|
|
9
|
-
if (curve.isEllipse())
|
|
10
|
-
return 'ellipse';
|
|
11
|
-
if (curve.isEllipseArc())
|
|
12
|
-
return 'ellipseArc';
|
|
13
|
-
if (curve.isBSpline())
|
|
14
|
-
return 'bspline';
|
|
15
|
-
MathError.throw(`CurveX: unsupported curve type ${curve.getType()}`);
|
|
16
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export type CurveKind = 'line' | 'circle' | 'arc' | 'ellipse' | 'ellipseArc' | 'bspline';
|
|
2
|
-
export type PairKey = `${CurveKind}|${CurveKind}`;
|
|
3
|
-
type PairNormalizeResult = {
|
|
4
|
-
key: PairKey;
|
|
5
|
-
swapped: boolean;
|
|
6
|
-
};
|
|
7
|
-
export declare function normalizePair(k1: CurveKind, k2: CurveKind): PairNormalizeResult;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=pair.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pair.d.ts","sourceRoot":"","sources":["../../../src/intersections/internal/pair.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,CAAA;AAExF,MAAM,MAAM,OAAO,GAAG,GAAG,SAAS,IAAI,SAAS,EAAE,CAAA;AAEjD,KAAK,mBAAmB,GAAG;IACvB,GAAG,EAAE,OAAO,CAAA;IACZ,OAAO,EAAE,OAAO,CAAA;CACnB,CAAA;AAWD,wBAAgB,aAAa,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,GAAG,mBAAmB,CAK/E"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const kindOrder = {
|
|
2
|
-
line: 0,
|
|
3
|
-
circle: 1,
|
|
4
|
-
arc: 2,
|
|
5
|
-
ellipse: 3,
|
|
6
|
-
ellipseArc: 4,
|
|
7
|
-
bspline: 5,
|
|
8
|
-
};
|
|
9
|
-
export function normalizePair(k1, k2) {
|
|
10
|
-
if (kindOrder[k1] <= kindOrder[k2]) {
|
|
11
|
-
return { key: `${k1}|${k2}`, swapped: false };
|
|
12
|
-
}
|
|
13
|
-
return { key: `${k2}|${k1}`, swapped: true };
|
|
14
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Interval } from '../../curves/interval';
|
|
2
|
-
import type { CurveXInfo } from '../types';
|
|
3
|
-
export type CurveXQuality = {
|
|
4
|
-
rawCount: number;
|
|
5
|
-
uniqueCount: number;
|
|
6
|
-
overlapCount: number;
|
|
7
|
-
uniquePointCount: number;
|
|
8
|
-
duplicatePointCount: number;
|
|
9
|
-
};
|
|
10
|
-
export declare function swapCurveXInfos(items: CurveXInfo[]): {
|
|
11
|
-
point: import("../..").Vec2;
|
|
12
|
-
u1: number;
|
|
13
|
-
u2: number;
|
|
14
|
-
isOverlap: boolean;
|
|
15
|
-
range1: Interval | undefined;
|
|
16
|
-
range2: Interval | undefined;
|
|
17
|
-
}[];
|
|
18
|
-
export declare function postprocessCurveXInfos(items: CurveXInfo[], pointTol?: number): CurveXInfo[];
|
|
19
|
-
export declare function analyzeCurveXInfosQuality(items: CurveXInfo[], pointTol?: number): CurveXQuality;
|
|
20
|
-
//# sourceMappingURL=result.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../../../src/intersections/internal/result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAEhD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAE1C,MAAM,MAAM,aAAa,GAAG;IACxB,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,gBAAgB,EAAE,MAAM,CAAA;IACxB,mBAAmB,EAAE,MAAM,CAAA;CAC9B,CAAA;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE;;;;;;;IASlD;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,QAAQ,SAAiC,gBAIpG;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,QAAQ,SAAiC,GAAG,aAAa,CAmBvH"}
|