@ccpc/math 0.1.0 → 0.1.3
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
package/package.json
CHANGED
|
@@ -1,38 +1,20 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"publishConfig": {
|
|
22
|
-
"access": "public"
|
|
23
|
-
},
|
|
24
|
-
"scripts": {
|
|
25
|
-
"dev": "tsc -p tsconfig.json --watch --preserveWatchOutput",
|
|
26
|
-
"build": "tsc -p tsconfig.json",
|
|
27
|
-
"lint": "eslint . --ext .ts",
|
|
28
|
-
"lint:fix": "eslint . --ext .ts --fix",
|
|
29
|
-
"test": "vitest",
|
|
30
|
-
"test:run": "vitest run",
|
|
31
|
-
"test:coverage": "vitest run --coverage",
|
|
32
|
-
"prepublishOnly": "pnpm run build && pnpm run test:run"
|
|
33
|
-
},
|
|
34
|
-
"devDependencies": {
|
|
35
|
-
"@vitest/coverage-v8": "^4.0.18",
|
|
36
|
-
"vitest": "^4.0.18"
|
|
37
|
-
}
|
|
38
|
-
}
|
|
2
|
+
"name": "@ccpc/math",
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "2D geometry and curve math library",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./index.cjs",
|
|
8
|
+
"types": "./types/index.d.ts",
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"clipper2-wasm": "^0.2.1",
|
|
11
|
+
"earcut": "^3.0.2",
|
|
12
|
+
"libtess": "^1.2.2",
|
|
13
|
+
"lodash": "^4.17.23",
|
|
14
|
+
"numeric": "^1.2.6",
|
|
15
|
+
"poly2tri": "^1.5.0",
|
|
16
|
+
"priorityqueuejs": "^2.0.0",
|
|
17
|
+
"quadtree-lib": "^1.0.9",
|
|
18
|
+
"uuid": "^10.0.0"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Loop } from '../../../topology/loop';
|
|
2
|
+
import { Polygon } from '../../../topology/polygon';
|
|
3
|
+
import { Curve2 } from '../../../geometry/curve2';
|
|
4
|
+
import { IFace2D } from './utils';
|
|
5
|
+
export declare enum Bool2dType {
|
|
6
|
+
union = 0,
|
|
7
|
+
intersect = 1,
|
|
8
|
+
difference = 2,
|
|
9
|
+
xor = 3,
|
|
10
|
+
split = 4
|
|
11
|
+
}
|
|
12
|
+
export { Bool2dType as BoolType };
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* 二维布尔运算,暂时支持直线、圆弧的交、并、差、分割
|
|
16
|
+
*/
|
|
17
|
+
declare class Bool2d {
|
|
18
|
+
static boolOperate(loopOrPolygons1: (Loop | Polygon)[], loopOrPolygons2: (Loop | Polygon)[], type: Bool2dType, distanceTol?: number, angleTol?: number): Polygon[];
|
|
19
|
+
static boolOperateCore(faces1: IFace2D[], faces2: IFace2D[], type: Bool2dType, distanceTol?: number, angleTol?: number, newCurveMap?: Map<Curve2, Curve2>, noOverlap1?: boolean, noOverlap2?: boolean): IFace2D[];
|
|
20
|
+
private static _toFace2d;
|
|
21
|
+
}
|
|
22
|
+
export { Bool2d };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Curve2 } from '../../../geometry/curve2';
|
|
2
|
+
import { IFace2D } from './utils';
|
|
3
|
+
/**
|
|
4
|
+
* 两组二维面域相减
|
|
5
|
+
* @param faces1
|
|
6
|
+
* @param faces2
|
|
7
|
+
* @param newCurveMap 可选参数, map<new bounded curve, origin bounded curve>.
|
|
8
|
+
*/
|
|
9
|
+
export declare function faces2DDifference(faces1: IFace2D[], faces2: IFace2D[], distanceTol: number, angleTol: number, newCurveMap?: Map<Curve2, Curve2>): IFace2D[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Curve2 } from '../../../geometry/curve2';
|
|
2
|
+
import { IFace2D } from './utils';
|
|
3
|
+
/**
|
|
4
|
+
* 两组二维面域相交
|
|
5
|
+
* @param faces1
|
|
6
|
+
* @param faces2
|
|
7
|
+
* @param newCurveMap 可选参数, map<new bounded curve, origin bounded curve>.
|
|
8
|
+
*/
|
|
9
|
+
export declare function faces2DIntersect(faces1: IFace2D[], faces2: IFace2D[], distanceTol: number, angleTol: number, newCurveMap?: Map<Curve2, Curve2>): IFace2D[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Curve2 } from '../../../geometry/curve2';
|
|
2
|
+
import { IFace2D } from './utils';
|
|
3
|
+
/**
|
|
4
|
+
* 两组二维面域求并集
|
|
5
|
+
* @param faces1
|
|
6
|
+
* @param faces2
|
|
7
|
+
* @param newCurveMap 可选参数, map<new bounded curve, origin bounded curve>.
|
|
8
|
+
*/
|
|
9
|
+
export declare function faces2DUnion(faces1: IFace2D[], faces2: IFace2D[], distanceTol: number, angleTol: number, newCurveMap?: Map<Curve2, Curve2>): IFace2D[];
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Curve2 } from '../../../geometry/curve2';
|
|
2
|
+
import { Box2 } from '../../../base/box2';
|
|
3
|
+
import { Vec2 } from '../../../base/vec2';
|
|
4
|
+
import { Bool2dType } from './bool2d';
|
|
5
|
+
export interface IFace2D {
|
|
6
|
+
loops: Curve2[][];
|
|
7
|
+
bcGroups?: Curve2dGroup[];
|
|
8
|
+
box?: Box2;
|
|
9
|
+
bPositive?: boolean;
|
|
10
|
+
bBlankFace?: boolean;
|
|
11
|
+
originFaces?: IFace2D[];
|
|
12
|
+
}
|
|
13
|
+
export declare class Curve2dGroup {
|
|
14
|
+
static curvesEqual(g1: Curve2dGroup, g2: Curve2dGroup, disTol: number, angleTol: number): boolean;
|
|
15
|
+
face: IFace2D;
|
|
16
|
+
curves: Curve2[];
|
|
17
|
+
box: Box2;
|
|
18
|
+
bValid: boolean;
|
|
19
|
+
insideFaces: IFace2D[];
|
|
20
|
+
onFaces: IFace2D[];
|
|
21
|
+
outsideFaces: IFace2D[];
|
|
22
|
+
constructor(face: IFace2D, bcs: Curve2[]);
|
|
23
|
+
addInsideFace(face: IFace2D): void;
|
|
24
|
+
addOnFace(face: IFace2D): void;
|
|
25
|
+
getReversedCurves(newCurveMap?: Map<Curve2, Curve2>): Curve2[];
|
|
26
|
+
cloneCurves(newCurveMap?: Map<Curve2, Curve2>): Curve2[];
|
|
27
|
+
}
|
|
28
|
+
export declare function intersectFaces(faces1: IFace2D[], faces2: IFace2D[], distanceTol: number, angleTol: number): void;
|
|
29
|
+
export declare function splitLoopByPoints(loop: Curve2[], points: Vec2[], result: Curve2[][], distanceTol: number): void;
|
|
30
|
+
export declare function splitLoopsIntoGroup(faces1: IFace2D[], faces2: IFace2D[], distanceTol: number): void;
|
|
31
|
+
export declare function calculateFaceBBox(face: IFace2D): void;
|
|
32
|
+
export declare function calculatePositionInfo(face: IFace2D, otherFaces: IFace2D[], distanceTol: number, angleTol: number, insideFaceMap?: Map<IFace2D, Curve2dGroup[]>): void;
|
|
33
|
+
/**
|
|
34
|
+
* check if the bounded curve group is valid. it's on the other face's boundary.
|
|
35
|
+
* @param group input bounded curve group.
|
|
36
|
+
* @param reverseResult flag means reverse the result.
|
|
37
|
+
*/
|
|
38
|
+
export declare function validateOverlapCurveGroup(group: Curve2dGroup, distTol?: number, reverseResult?: boolean): void;
|
|
39
|
+
export declare function areFacesTotallyOverlap(face1: IFace2D, face2: IFace2D, disTol: number, angleTol: number): boolean;
|
|
40
|
+
export declare function generateResult(allFaces: IFace2D[], resultFaces: IFace2D[], type: Bool2dType, getOriginFaces: (newFace: IFace2D, candidates: Set<IFace2D>) => IFace2D[], distanceTol: number, angleTol: number, newCurveMap?: Map<Curve2, Curve2>): void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Curve2 } from '../../geometry/curve2';
|
|
2
|
+
import { Loop } from '../../topology/loop';
|
|
3
|
+
import { Polygon } from '../../topology/polygon';
|
|
4
|
+
import { Vec2 } from '../../base/vec2';
|
|
5
|
+
/**
|
|
6
|
+
* 二维布尔运算,封装的clipper算法
|
|
7
|
+
*/
|
|
8
|
+
declare class BoolOperateClipper {
|
|
9
|
+
/**
|
|
10
|
+
* 差
|
|
11
|
+
* @param loopOrPolygons1
|
|
12
|
+
* @param loopOrPolygons2
|
|
13
|
+
*/
|
|
14
|
+
static curvePolygon(curve: Curve2, loopOrPolygons2: (Loop | Polygon)[], isIntersect: boolean): Vec2[][];
|
|
15
|
+
static boolOperate(loopOrPolygons1: (Loop | Polygon)[], type: 0 | 1 | 2, loopOrPolygons2: (Loop | Polygon)[]): Polygon;
|
|
16
|
+
static boolOperateEx(loopOrPolygons1: (Loop | Polygon)[], type: 0 | 1 | 2, loopOrPolygons2: (Loop | Polygon)[]): Polygon[];
|
|
17
|
+
}
|
|
18
|
+
export { BoolOperateClipper };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PolyCurve } from '../../topology/polycurve';
|
|
2
|
+
import { Loop } from '../../topology/loop';
|
|
3
|
+
import { Polygon } from '../../topology/polygon';
|
|
4
|
+
export declare class PolycurvePolygonBool {
|
|
5
|
+
/**
|
|
6
|
+
* 布尔运算, 区域裁剪线段, 支持曲线
|
|
7
|
+
* @param polyline
|
|
8
|
+
* @param polygon
|
|
9
|
+
* @param isIntersect 内部还是外部
|
|
10
|
+
* @param isTangentKeep 保留边界重叠部分
|
|
11
|
+
*/
|
|
12
|
+
static execute(polyline: PolyCurve, loopOrPolygons: (Loop | Polygon)[], isIntersect: boolean, isTangentKeep: boolean, _torlerance: number): PolyCurve[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Polygon } from '../topology/polygon';
|
|
2
|
+
import { Loop } from '../topology/loop';
|
|
3
|
+
import { PolyCurve } from '../topology/polycurve';
|
|
4
|
+
/**
|
|
5
|
+
* 布尔运算
|
|
6
|
+
* -
|
|
7
|
+
*/
|
|
8
|
+
declare class BoolOperate2d {
|
|
9
|
+
/**
|
|
10
|
+
* 并
|
|
11
|
+
* 使用Clipper, 支持直线
|
|
12
|
+
* @param loopOrPolygons
|
|
13
|
+
*/
|
|
14
|
+
static union(loopOrPolygons: (Loop | Polygon)[]): Polygon;
|
|
15
|
+
/**
|
|
16
|
+
* 交
|
|
17
|
+
* 使用Clipper, 支持直线
|
|
18
|
+
* @param loopOrPolygons
|
|
19
|
+
*/
|
|
20
|
+
static intersect(loopOrPolygons: (Loop | Polygon)[]): Polygon;
|
|
21
|
+
/**
|
|
22
|
+
* 差 loopOrPolygons1 - loopOrPolygons2
|
|
23
|
+
* 使用Clipper, 支持直线
|
|
24
|
+
* @param loopOrPolygons1
|
|
25
|
+
* @param loopOrPolygons2
|
|
26
|
+
*/
|
|
27
|
+
static difference(loopOrPolygon1: Loop | Polygon, loopOrPolygons2: (Loop | Polygon)[]): Polygon;
|
|
28
|
+
/**
|
|
29
|
+
* 求并集,适用于Loop, PolygonEx
|
|
30
|
+
* 支持直线、圆弧
|
|
31
|
+
* @param loopOrPolygonExs
|
|
32
|
+
* @return 得到PolygonEx数组
|
|
33
|
+
*/
|
|
34
|
+
static polygonExUnion(loopOrPolygonExs: (Loop | Polygon)[], disTol?: number, angleTol?: number): Polygon[];
|
|
35
|
+
/**
|
|
36
|
+
* 两组之间求交集,适用于Loop, PolygonEx
|
|
37
|
+
* 支持直线、圆弧
|
|
38
|
+
* @param loopOrPolygonExs1
|
|
39
|
+
* @param loopOrPolygonExs2
|
|
40
|
+
* @return 得到PolygonEx数组
|
|
41
|
+
*/
|
|
42
|
+
static polygonExIntersect(loopOrPolygonExs1: (Loop | Polygon)[], loopOrPolygonExs2: (Loop | Polygon)[], disTol?: number, angleTol?: number): Polygon[];
|
|
43
|
+
/**
|
|
44
|
+
* 两组之间求差集,适用于Loop, PolygonEx
|
|
45
|
+
* 支持直线、圆弧
|
|
46
|
+
* @param loopOrPolygonExs1
|
|
47
|
+
* @param loopOrPolygonExs2
|
|
48
|
+
* @return 得到PolygonEx数组
|
|
49
|
+
*/
|
|
50
|
+
static polygonExDifference(loopOrPolygonExs1: (Loop | Polygon)[], loopOrPolygonExs2: (Loop | Polygon)[], disTol?: number, angleTol?: number): Polygon[];
|
|
51
|
+
/**
|
|
52
|
+
* 返回polyline在loop/polygon内部的部分
|
|
53
|
+
* @param polyline
|
|
54
|
+
* @param loopOrPolygons
|
|
55
|
+
* @param isTangentKeep 保留边界重叠部分
|
|
56
|
+
* @param tolerance
|
|
57
|
+
*/
|
|
58
|
+
static polylineIntersect(polyline: PolyCurve, loopOrPolygons: (Polygon | Loop)[], isTangentKeep: boolean, tolerance?: number): PolyCurve[];
|
|
59
|
+
/**
|
|
60
|
+
* 返回polyline在loop/polygon外部的部分
|
|
61
|
+
* @param polyline
|
|
62
|
+
* @param polygon
|
|
63
|
+
* @param torlerance
|
|
64
|
+
*/
|
|
65
|
+
static polylineDifference(polyline: PolyCurve, loopOrPolygons: (Polygon | Loop)[], isTangentKeep: boolean, torlerance?: number): PolyCurve[];
|
|
66
|
+
}
|
|
67
|
+
export { BoolOperate2d };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Vec2 } from '../base/vec2';
|
|
2
|
+
import { Curve2 } from '../geometry/curve2';
|
|
3
|
+
import { Vec3 } from '../base/vec3';
|
|
4
|
+
import { Surface } from '../geometry/surface';
|
|
5
|
+
import { Curve3 } from '../geometry/curve3d';
|
|
6
|
+
import { IPtCvDistanceInfo2, IPtCvDistanceInfo3 } from './distance/pt_to_curve_distance_info';
|
|
7
|
+
import { types } from '../type_define/i_types';
|
|
8
|
+
/**
|
|
9
|
+
* - 点到二维曲线的距离
|
|
10
|
+
* - 点到三维曲线的距离
|
|
11
|
+
* - 点到Surface的有向距离
|
|
12
|
+
* - 点到Surface的距离
|
|
13
|
+
* - 二维曲线到二维曲线最近距离
|
|
14
|
+
*/
|
|
15
|
+
export declare class D {
|
|
16
|
+
/**
|
|
17
|
+
* 点到曲线距离
|
|
18
|
+
* @param point 点
|
|
19
|
+
* @param curve 二维曲线,可以是无限长Line
|
|
20
|
+
* @param minDistancePoint 最小距离曲线上的点
|
|
21
|
+
*/
|
|
22
|
+
static ptToCurve2d(point: types.IXY, curve: Curve2, minDistancePoint?: Vec2): number;
|
|
23
|
+
/**
|
|
24
|
+
* 点到曲线的有向距离,点在直线右侧返回正,否则返回负值
|
|
25
|
+
* @param point 点
|
|
26
|
+
* @param curve 二维曲线,可以是无限长Line
|
|
27
|
+
* @param minDistancePoint 最小距离曲线上的点
|
|
28
|
+
*/
|
|
29
|
+
static ptToCurve2dSigned(point: types.IXY, curve: Curve2, minDistancePoint?: Vec2): number;
|
|
30
|
+
/**
|
|
31
|
+
* 点到曲线的有向距离,点在直线右侧返回正,否则返回负值
|
|
32
|
+
* @param point
|
|
33
|
+
* @param curve
|
|
34
|
+
* @param minDistancePoint
|
|
35
|
+
*/
|
|
36
|
+
static ptToCurve2dSignedInfo(point: types.IXY, curve: Curve2): IPtCvDistanceInfo2;
|
|
37
|
+
/**
|
|
38
|
+
* 点到三维曲线的距离,直线支持传入有限长和无限长
|
|
39
|
+
* @returns 距离值 >= 0
|
|
40
|
+
*/
|
|
41
|
+
static ptToCurve3d(point: types.IXYZ, curve: Curve3, footPoint?: Vec3): number;
|
|
42
|
+
/**
|
|
43
|
+
* 点到三维曲线的距离,直线支持传入有限长和无限长
|
|
44
|
+
*/
|
|
45
|
+
static ptToCurve3dInfo(point: types.IXYZ, curve: Curve3): IPtCvDistanceInfo3;
|
|
46
|
+
/**
|
|
47
|
+
* 点到三围曲线组的距离
|
|
48
|
+
* @param point
|
|
49
|
+
* @param curves
|
|
50
|
+
* @param eps
|
|
51
|
+
*/
|
|
52
|
+
static ptToCurve3dsInfos(point: types.IXYZ, curves: Curve3[], eps?: number): IPtCvDistanceInfo3[];
|
|
53
|
+
/**
|
|
54
|
+
* 点到Surface的距离,返回结果 >= 0
|
|
55
|
+
* @param point 三维点
|
|
56
|
+
* @param surface 曲面
|
|
57
|
+
* @param footPoint [out] 输出参数,若用户想要获取垂足点,则传入该参数
|
|
58
|
+
* @returns 距离值,≥0
|
|
59
|
+
*/
|
|
60
|
+
static ptToSurf(point: Vec3, surface: Surface, footPoint?: Vec3): number;
|
|
61
|
+
/**
|
|
62
|
+
* 点到Surface的有向距离
|
|
63
|
+
* @param point 三维点
|
|
64
|
+
* @param surface 曲面
|
|
65
|
+
* @param footPoint [out] 输出参数,若用户想要获取垂足点,则传入该参数
|
|
66
|
+
* @returns 有向距离,在法线同侧为正,
|
|
67
|
+
*/
|
|
68
|
+
static ptToSurfSigned(point: Vec3, surface: Surface, footPoint?: Vec3): number;
|
|
69
|
+
/**
|
|
70
|
+
* 二维曲线到二维曲线最近距离
|
|
71
|
+
* @param curve1 二维曲线
|
|
72
|
+
* @param curve2 二维曲线
|
|
73
|
+
* @param minDistPoint1 最小距离曲线1上的点
|
|
74
|
+
* @param minDistPoint2 最小距离曲线2上的点
|
|
75
|
+
*/
|
|
76
|
+
static curve2s(curve1: Curve2, curve2: Curve2, minDistPoint1?: Vec2, minDistPoint2?: Vec2): number;
|
|
77
|
+
/**
|
|
78
|
+
* 三维曲线到三维曲线最近距离
|
|
79
|
+
* @param curve1 三维曲线
|
|
80
|
+
* @param curve2 三维曲线
|
|
81
|
+
* @param minDistPoint1 最小距离曲线1上的点
|
|
82
|
+
* @param minDistPoint2 最小距离曲线2上的点
|
|
83
|
+
*/
|
|
84
|
+
static curve3s(curve1: Curve3, curve2: Curve3, minDistPoint1?: Vec3, minDistPoint2?: Vec3): number;
|
|
85
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Curve3 } from '../geometry/curve3d';
|
|
2
|
+
import { Vec3 } from '../base/vec3';
|
|
3
|
+
import { Tol } from '../base/tol';
|
|
4
|
+
import { types } from '../type_define/i_types';
|
|
5
|
+
import { EvolutionMap } from '../topology/evolution_map';
|
|
6
|
+
import { Curve2 } from '../geometry/curve2';
|
|
7
|
+
export declare class Offset {
|
|
8
|
+
/**
|
|
9
|
+
* 偏置平面曲线闭环,使其过 point 点。得到的结果可能为多个 Loop
|
|
10
|
+
* @param curves 闭合曲线组
|
|
11
|
+
* @param point 目标点
|
|
12
|
+
*/
|
|
13
|
+
static curve3dsByPoint(curves: Curve3[], point: types.IXYZ, tol?: Tol): {
|
|
14
|
+
loops: Curve3[][];
|
|
15
|
+
evolution: EvolutionMap<Curve3>;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* 根据给定偏移量,偏置平面曲线闭环
|
|
19
|
+
* @param curves 待偏置的曲线组
|
|
20
|
+
* @param offsetXY 平面方向偏移量
|
|
21
|
+
* @param offsetZ 法向偏移量
|
|
22
|
+
* @param directionZ 偏置 z 方向
|
|
23
|
+
*/
|
|
24
|
+
static curve3dsByOffsets(curves: Curve3[], offsetXY: number, offsetZ: number, directionZ?: Vec3, tol?: Tol): {
|
|
25
|
+
loops: Curve3[][];
|
|
26
|
+
evolution: EvolutionMap<Curve3>;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* 根据给定偏移量,偏置平面曲线,传入曲线请保证首尾相接
|
|
30
|
+
* @param curves 待偏置的曲线组
|
|
31
|
+
* @param offsetDist 平面方向偏移量。关于偏移方向:从directionZ方向看过去,曲线的左边的offset为负;右边offset为正
|
|
32
|
+
*/
|
|
33
|
+
static offsetCurve3dList(curves: Curve3[], offsetDist: number, directionZ: Vec3): {
|
|
34
|
+
curveList: Curve3[];
|
|
35
|
+
evolution: EvolutionMap<Curve3>;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* 根据给定偏移量,偏置平面曲线闭环
|
|
39
|
+
* @param curves 待偏置的曲线组
|
|
40
|
+
* @param offsetDist 偏移量
|
|
41
|
+
* @param tol 容差
|
|
42
|
+
* @param imMerge 路径是否闭合
|
|
43
|
+
* @param offsetIndexes 偏移边index(如果不传,则所有边都偏移)
|
|
44
|
+
*/
|
|
45
|
+
static offsetLoop2d(curves: Curve2[], offsetDist: number, tol?: Tol, isMerge?: boolean, offsetIndexes?: number[]): {
|
|
46
|
+
loops: Curve2[][];
|
|
47
|
+
evolution: EvolutionMap<Curve2>;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* 根据给定偏移量,偏置平面曲线,保证曲线首尾相接
|
|
51
|
+
* @param curves 待偏置的曲线组
|
|
52
|
+
* @param offsetDist 平面方向偏移量。关于偏移方向:以第一条curve为准,正值的offset就是第一条curve的右边;负值的offset就是第一条curve的左边
|
|
53
|
+
*/
|
|
54
|
+
static offsetCurve2dList(curves: Curve2[], offsetDist: number): {
|
|
55
|
+
curveList: Curve2[];
|
|
56
|
+
evolution: EvolutionMap<Curve2>;
|
|
57
|
+
};
|
|
58
|
+
private static _isDegeneratedCurve;
|
|
59
|
+
/**
|
|
60
|
+
* 通过延长线连接相邻曲线
|
|
61
|
+
* @param curves
|
|
62
|
+
* @param dz
|
|
63
|
+
* @param offsetXY
|
|
64
|
+
* @param tol
|
|
65
|
+
* @returns 从新曲线映射到原曲线的映射集
|
|
66
|
+
*/
|
|
67
|
+
private static _connectCurves;
|
|
68
|
+
private static _makeJoints;
|
|
69
|
+
private static _findLoops;
|
|
70
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Tol } from '../base/tol';
|
|
2
|
+
import { Curve2 } from '../geometry/curve2';
|
|
3
|
+
import { Curve3 } from '../geometry/curve3d';
|
|
4
|
+
import { Surface } from '../geometry/surface';
|
|
5
|
+
import { ICurvesOverlapInfo } from './overlap/i_overlap';
|
|
6
|
+
declare class CalcOverlap {
|
|
7
|
+
/**
|
|
8
|
+
* 判断曲线是否共线,不需要有重合
|
|
9
|
+
* @param curve1
|
|
10
|
+
* @param curve2
|
|
11
|
+
* @param tol
|
|
12
|
+
* @returns 返回是否共线
|
|
13
|
+
*/
|
|
14
|
+
static curve2dsColinear(curve1: Curve2, curve2: Curve2, tol?: Tol): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* 计算曲线与曲线重合部分
|
|
17
|
+
* @param curve1
|
|
18
|
+
* @param curve2
|
|
19
|
+
* @param tol
|
|
20
|
+
* @returns 返回曲线重合部分,若无重合部分,则返回空集
|
|
21
|
+
*/
|
|
22
|
+
static curve2ds(curve1: Curve2, curve2: Curve2, tol?: Tol): ICurvesOverlapInfo[];
|
|
23
|
+
/**
|
|
24
|
+
* 判断曲线是否共线,不需要有重合
|
|
25
|
+
* @param curve1
|
|
26
|
+
* @param curve2
|
|
27
|
+
* @param tol
|
|
28
|
+
* @returns 返回是否共线
|
|
29
|
+
*/
|
|
30
|
+
static curve3dsColinear(curve1: Curve3, curve2: Curve3, tol?: Tol): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* 计算曲线与曲线重合部分
|
|
33
|
+
* @param curve1
|
|
34
|
+
* @param curve2
|
|
35
|
+
* @param tol
|
|
36
|
+
* @returns 返回曲线重合部分,若无重合部分,则返回空集
|
|
37
|
+
*/
|
|
38
|
+
static curve3ds(curve1: Curve3, curve2: Curve3, tol?: Tol): ICurvesOverlapInfo[];
|
|
39
|
+
/**
|
|
40
|
+
* 计算曲面与曲面重合部分,不支持 SweepSurface,暂不支持 NurbsSurface
|
|
41
|
+
* @param surface1
|
|
42
|
+
* @param surface2
|
|
43
|
+
* @param tol
|
|
44
|
+
* @returns 当两个曲面重合时返回 true
|
|
45
|
+
*/
|
|
46
|
+
static isSurfacesCoplaner(surface1: Surface, surface2: Surface, tol?: Tol): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* 计算曲线与曲面重合部分,不支持 SweepSurface,暂不支持 NurbsSurface
|
|
49
|
+
* @param curve1
|
|
50
|
+
* @param surface
|
|
51
|
+
* @param tol
|
|
52
|
+
* @returns 返回曲线与曲面是否重合
|
|
53
|
+
*/
|
|
54
|
+
static isCurveSurfaceOverlap(curve1: Curve3, surface: Surface, tol?: Tol): boolean;
|
|
55
|
+
}
|
|
56
|
+
export { CalcOverlap, CalcOverlap as Overlap };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Ln2 } from '../geometry/ln2';
|
|
2
|
+
import { Curve2 } from '../geometry/curve2';
|
|
3
|
+
import { Plane } from '../geometry/plane';
|
|
4
|
+
import { Curve3 } from '../geometry/curve3d';
|
|
5
|
+
import { Ln3 } from '../geometry/ln3';
|
|
6
|
+
import { Interval } from '../base/interval';
|
|
7
|
+
import { Coord3 } from '../base/coord3';
|
|
8
|
+
/**
|
|
9
|
+
* 投影算法
|
|
10
|
+
*/
|
|
11
|
+
export declare class Project {
|
|
12
|
+
/**
|
|
13
|
+
* curve沿coordinate z轴向coordinate XOY面投影. 调用此接口请保证曲线必须在coord的XOY平面上。
|
|
14
|
+
*/
|
|
15
|
+
static curve3dTo2d(curve: Curve3, coord: Coord3): Curve2 | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* (支持斜投影)将三维曲线投影到平面上,得到在平面上的二维投影。与curve3dTo2d的区别是,curve3d可以不在平面上。
|
|
18
|
+
*/
|
|
19
|
+
static curveToPlane(curve: Curve3, plane: Plane): Curve2 | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* line1向line2投影,返回一个区间,该区间代表投影后的线在line2参数域上的区间
|
|
22
|
+
*/
|
|
23
|
+
static line1ToLine2(line1: Ln2, line2: Ln2): Interval;
|
|
24
|
+
static line1ToLine2(line1: Ln3, line2: Ln3): Interval;
|
|
25
|
+
/**
|
|
26
|
+
* 将二维曲线根据坐标系转换至三维空间
|
|
27
|
+
*/
|
|
28
|
+
static curve2dTo3d(curve: Curve2, coord: Coord3): Curve3;
|
|
29
|
+
}
|