@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
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 演化关系记录。
|
|
3
|
+
* 鼓励使用 “新几何体 => 旧几何体”的映射方式。在这种方式下,用 replaceKey() 可以高效地追加新的变化。
|
|
4
|
+
* 相比之下,“旧几何体 => 新几何体” 的构造方式,用 merge() 来追加新的变化效率较低
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
export declare class EvolutionMap<KeyType, ValueType = KeyType> extends Map<KeyType, ValueType[]> {
|
|
8
|
+
/**
|
|
9
|
+
* 添加演化关系
|
|
10
|
+
* @param key
|
|
11
|
+
* @param value
|
|
12
|
+
*/
|
|
13
|
+
add(key: KeyType, ...values: ValueType[]): void;
|
|
14
|
+
/**
|
|
15
|
+
* 删除演化关系,若未指定 key,则会枚举所有 key。若从待删除 value 为某 values 列表中最后一项,则删除该键值对
|
|
16
|
+
* @param value
|
|
17
|
+
* @param key
|
|
18
|
+
* @return 删除成功返回 true
|
|
19
|
+
*/
|
|
20
|
+
remove(value: ValueType, key?: KeyType): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* 连接演化关系,仅保留使用到的键和值。通常 B' 为 B 的字集,用于连接算法中的多个步骤。
|
|
23
|
+
* this(A -> B) connect evo2(B'-> C) => (A -> (B & B') -> C) => (A -> C)
|
|
24
|
+
* 相关函数:connectKeyMap(), mergeKeyMap(), mergeValueMap()
|
|
25
|
+
* @param evo2
|
|
26
|
+
*/
|
|
27
|
+
connectValueMap<ValueType2>(evo2: EvolutionMap<ValueType, ValueType2>, revserveEmptyKey?: boolean): EvolutionMap<KeyType, ValueType2>;
|
|
28
|
+
/**
|
|
29
|
+
* 连接演化关系,仅保留使用到的键和值。通常 B' 为 B 的字集,用于连接算法中的多个步骤。
|
|
30
|
+
* evo0(A -> B) connect this(B'-> C) => (A -> (B & B') -> C) => (A -> C)
|
|
31
|
+
* 相关函数:connectValueMap(), mergeKeyMap(), mergeValueMap()
|
|
32
|
+
* @param evo2
|
|
33
|
+
*/
|
|
34
|
+
connectKeyMap<KeyType0>(evo0: EvolutionMap<KeyType0, KeyType>, revserveEmptyKey?: boolean): EvolutionMap<KeyType0, ValueType>;
|
|
35
|
+
/**
|
|
36
|
+
* 合并演化关系,尽可能保留所有的键值对。通常用于合并多个操作。
|
|
37
|
+
* this(A -> B) merge evo2(B' -> C) => (A -> C + A -> B (not in B') + B'(not in B) -> C)
|
|
38
|
+
* 相关函数:connectKeyMap(), connectValueMap(), mergeKeyMap()
|
|
39
|
+
* @param evo2
|
|
40
|
+
*/
|
|
41
|
+
mergeValueMap<ValueType2>(evo2: EvolutionMap<ValueType, ValueType2>): EvolutionMap<KeyType | ValueType, ValueType | ValueType2>;
|
|
42
|
+
/**
|
|
43
|
+
* 合并演化关系,尽可能保留所有的键值对。通常用于合并多个操作。
|
|
44
|
+
* evo0(A -> B) merge this(B' -> C) => (A -> C + A -> B (not in B') + B'(not in B) -> C)
|
|
45
|
+
* 相关函数:connectKeyMap(), connectValueMap(), mergeValueMap()
|
|
46
|
+
* @param evo2
|
|
47
|
+
*/
|
|
48
|
+
mergeKeyMap<KeyType0>(evo0: EvolutionMap<KeyType0, KeyType>): EvolutionMap<KeyType0 | KeyType, KeyType | ValueType>;
|
|
49
|
+
/**
|
|
50
|
+
* 使用新的 key 替换原有 key
|
|
51
|
+
* @param evo2 新 key => 旧 key
|
|
52
|
+
* @param keysToDelete 替换后需删除的键值
|
|
53
|
+
* @return 发生替换的键值对
|
|
54
|
+
*/
|
|
55
|
+
appendKey(evo0: EvolutionMap<KeyType, KeyType>, keysToDelete?: KeyType[]): void;
|
|
56
|
+
/**
|
|
57
|
+
* 使用新的 key 替换原有 key。若输入键值为空,则当 reserveReplacedKey 为 true 时会删除对应键值
|
|
58
|
+
* @param evo2 新 key => 旧 key
|
|
59
|
+
* @param deleteReplacedKeys 为 true 时,会删除被替换的键值
|
|
60
|
+
* @return 发生替换的键值对
|
|
61
|
+
*/
|
|
62
|
+
appendKey(evo0: EvolutionMap<KeyType | undefined, KeyType>, deleteReplacedKeys?: boolean): void;
|
|
63
|
+
/**
|
|
64
|
+
* 获取不重复的结果集
|
|
65
|
+
*/
|
|
66
|
+
uniqueValues(): ValueType[];
|
|
67
|
+
/**
|
|
68
|
+
* 生成反向演化关系,不保留空值的键
|
|
69
|
+
*/
|
|
70
|
+
reversed(): EvolutionMap<ValueType, KeyType>;
|
|
71
|
+
/**
|
|
72
|
+
* 生成反向演化关系,保留空值的键,并以 undefined 作为其新键进行返回
|
|
73
|
+
*/
|
|
74
|
+
reversedWithEmptyValue(): EvolutionMap<ValueType | undefined, KeyType>;
|
|
75
|
+
/**
|
|
76
|
+
* 清空未使用到的键
|
|
77
|
+
* @param usedKeys
|
|
78
|
+
* @returns 返回被清除的键值对
|
|
79
|
+
*/
|
|
80
|
+
clearUnusedKeys(usedKeys: Set<KeyType>): [KeyType, ValueType[]][];
|
|
81
|
+
/**
|
|
82
|
+
* 清空未使用到的值
|
|
83
|
+
* @param values
|
|
84
|
+
* @returns 返回被清除的键和值
|
|
85
|
+
*/
|
|
86
|
+
clearUnusedValues(usedValues: Set<ValueType>): {
|
|
87
|
+
keys: KeyType[];
|
|
88
|
+
values: ValueType[];
|
|
89
|
+
};
|
|
90
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Curve2 } from '../geometry/curve2';
|
|
2
|
+
import { PolyCurve } from './polycurve';
|
|
3
|
+
import { types } from '../type_define/i_types';
|
|
4
|
+
import { Vec2 } from '../base/vec2';
|
|
5
|
+
import { EN_GEO_TYPE } from '../type_define/i_element_type';
|
|
6
|
+
import { Tol } from '../base/tol';
|
|
7
|
+
import { DiscreteParam } from '../base/discrete_param';
|
|
8
|
+
/**
|
|
9
|
+
* 环,封闭且无自交的曲线序列
|
|
10
|
+
*/
|
|
11
|
+
export declare class Loop extends PolyCurve {
|
|
12
|
+
/**
|
|
13
|
+
* 由2点构造一个矩形Loop,逆时针
|
|
14
|
+
* @param points
|
|
15
|
+
*/
|
|
16
|
+
static createByRectangle(cornerPt1: types.IXY, cornerPt2: types.IXY): Loop;
|
|
17
|
+
/**
|
|
18
|
+
* 由一系列点构造Polyline
|
|
19
|
+
* @param points
|
|
20
|
+
*/
|
|
21
|
+
constructor(points?: types.IXY[]);
|
|
22
|
+
/**
|
|
23
|
+
* 由一系列点构造Polyline
|
|
24
|
+
* @param points
|
|
25
|
+
*/
|
|
26
|
+
constructor(curves?: Curve2[]);
|
|
27
|
+
/**
|
|
28
|
+
* 判断环是否封闭
|
|
29
|
+
*/
|
|
30
|
+
isClosed(tol?: Tol): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* @todo 计算有没有自交
|
|
33
|
+
* 环是否合法,封闭且无自交
|
|
34
|
+
*/
|
|
35
|
+
isValid(tol?: Tol): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* 提取所有直线/曲线的角点(或者说轮廓点),如果是曲线,可以用离散精度控制点的疏密程度
|
|
38
|
+
* @param params 对于曲线有用,控制曲线轮廓点的疏密程度
|
|
39
|
+
*/
|
|
40
|
+
toPath(params?: DiscreteParam): Vec2[];
|
|
41
|
+
/**
|
|
42
|
+
* 获取所有直线/曲线的端点
|
|
43
|
+
*/
|
|
44
|
+
getAllPoints(): Vec2[];
|
|
45
|
+
getType(): EN_GEO_TYPE.LOOP;
|
|
46
|
+
dump(): types.IDBLoop;
|
|
47
|
+
load(db: types.IDBLoop): this;
|
|
48
|
+
clone(): Loop;
|
|
49
|
+
makeStartEndConnected(): this;
|
|
50
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { Curve2 } from '../geometry/curve2';
|
|
2
|
+
import { types } from '../type_define/i_types';
|
|
3
|
+
import { Vec2 } from '../base/vec2';
|
|
4
|
+
import { EN_GEO_TYPE } from '../type_define/i_element_type';
|
|
5
|
+
import { Box2 } from '../base/box2';
|
|
6
|
+
import { Tol } from '../base/tol';
|
|
7
|
+
import { Geometry2d } from '../geometry/geometry2d';
|
|
8
|
+
/**
|
|
9
|
+
* @author tiansk
|
|
10
|
+
* 首尾相接且无自交,可以不封闭的曲线序列
|
|
11
|
+
*/
|
|
12
|
+
export declare class PolyCurve extends Geometry2d {
|
|
13
|
+
protected _curves: Curve2[];
|
|
14
|
+
/**
|
|
15
|
+
* 由一系列点构造Polyline
|
|
16
|
+
* @param points
|
|
17
|
+
*/
|
|
18
|
+
constructor(points?: types.IXY[]);
|
|
19
|
+
/**
|
|
20
|
+
* 由一系列点构造Polyline
|
|
21
|
+
* @param points
|
|
22
|
+
*/
|
|
23
|
+
constructor(curves?: Curve2[]);
|
|
24
|
+
/**
|
|
25
|
+
* 向序列中加一条曲线,直接加入,不作合法性检查
|
|
26
|
+
* @param curve 曲线
|
|
27
|
+
* @returns 返回Coedge
|
|
28
|
+
*/
|
|
29
|
+
addCurve(curve: Curve2): Curve2;
|
|
30
|
+
/**
|
|
31
|
+
* 偏移,偏移后不作合法性检查
|
|
32
|
+
* @param offsetValue 负值往左偏,正值往右偏
|
|
33
|
+
* @returns 成功返回true,失败返回false
|
|
34
|
+
*/
|
|
35
|
+
offset(offsetValue: number): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* 使相邻的coedge起点末点交于一点
|
|
38
|
+
*/
|
|
39
|
+
makeStartEndConnected(connectedHeadTail?: boolean): this;
|
|
40
|
+
/**
|
|
41
|
+
* 向序列中加一条曲线,直接加入,不作合法性检查
|
|
42
|
+
* @param curve 曲线
|
|
43
|
+
* @returns 返回Coedge
|
|
44
|
+
*/
|
|
45
|
+
insertCurve(fromIdx: number, ...curves: Curve2[]): void;
|
|
46
|
+
deleteByArrayIdx(idx: number): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* 返回曲线的拷贝
|
|
49
|
+
*/
|
|
50
|
+
copyAllCurves(): Curve2[];
|
|
51
|
+
/**
|
|
52
|
+
* 获取所有的曲线
|
|
53
|
+
*/
|
|
54
|
+
getAllCurves(): Curve2[];
|
|
55
|
+
/**
|
|
56
|
+
* 清空所有的coedge
|
|
57
|
+
*/
|
|
58
|
+
clear(): void;
|
|
59
|
+
isEmpty(): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* 是否是逆时针的环,计算时会自动封闭
|
|
62
|
+
* @returns 逆时针则返回true,否则返回false
|
|
63
|
+
*/
|
|
64
|
+
isAnticlockwise(): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* 逆时针变顺时针,顺时针变逆时针
|
|
67
|
+
*/
|
|
68
|
+
reverse(): this;
|
|
69
|
+
/**
|
|
70
|
+
* 该coedgelist的面积,计算时会自动封闭
|
|
71
|
+
* @returns 顺时针为面积负,逆时针为正
|
|
72
|
+
*/
|
|
73
|
+
calcArea(): number;
|
|
74
|
+
/**
|
|
75
|
+
* 合法性检查 1.首尾相接 2.无自交
|
|
76
|
+
* @returns 合法返回true,不合法返回false
|
|
77
|
+
*/
|
|
78
|
+
isValid(tol?: Tol): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* 是否只包含直线
|
|
81
|
+
*/
|
|
82
|
+
isOnlyLines(): boolean;
|
|
83
|
+
translate(offset: types.IXY): this;
|
|
84
|
+
rotate(angle: number, pivot: types.IXY): this;
|
|
85
|
+
scale(factor: number, center?: types.IXY): this;
|
|
86
|
+
transform(m: types.IMatrix3 | types.numberArrs3X3): this;
|
|
87
|
+
/**
|
|
88
|
+
* 反向,得到一个新的曲线对象
|
|
89
|
+
*/
|
|
90
|
+
reversed(): PolyCurve;
|
|
91
|
+
/**
|
|
92
|
+
* 矩阵变换,得到变换后的曲线对象
|
|
93
|
+
* @param m
|
|
94
|
+
*/
|
|
95
|
+
transformed(m: types.IMatrix3 | types.numberArrs3X3): PolyCurve;
|
|
96
|
+
getBBox(): Box2;
|
|
97
|
+
/**
|
|
98
|
+
* 提取角点
|
|
99
|
+
*/
|
|
100
|
+
toPath(): Vec2[];
|
|
101
|
+
/**
|
|
102
|
+
* 计算形心坐标
|
|
103
|
+
*/
|
|
104
|
+
getCentroidPoint(): Vec2;
|
|
105
|
+
getType(): EN_GEO_TYPE;
|
|
106
|
+
clone(): PolyCurve;
|
|
107
|
+
dump(): types.IDBPolyCurve;
|
|
108
|
+
load({ data }: types.IDBPolyCurve): this;
|
|
109
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { types } from '../type_define/i_types';
|
|
2
|
+
import { Loop } from './loop';
|
|
3
|
+
import { Curve2 } from '../geometry/curve2';
|
|
4
|
+
import { EN_GEO_TYPE } from '../type_define/i_element_type';
|
|
5
|
+
import { Vec2 } from '../base/vec2';
|
|
6
|
+
import { Box2 } from '../base/box2';
|
|
7
|
+
import { Tol } from '../base/tol';
|
|
8
|
+
import { Geometry2d } from '../geometry/geometry2d';
|
|
9
|
+
/**
|
|
10
|
+
* Polygon,可以有多个外环,和多个内环(孔洞)。外环(外轮廓)为逆时针,内环(孔洞)是顺时针环
|
|
11
|
+
*/
|
|
12
|
+
declare class Polygon extends Geometry2d {
|
|
13
|
+
/**
|
|
14
|
+
* 由2点构造一个矩形Loop,逆时针,然后再构造Polygon
|
|
15
|
+
* @param points
|
|
16
|
+
*/
|
|
17
|
+
static createByRectangle(cornerPt1: types.IXY, cornerPt2: types.IXY): Polygon;
|
|
18
|
+
/**
|
|
19
|
+
* polygonEx合成一个polygon
|
|
20
|
+
* @param polygonExs
|
|
21
|
+
*/
|
|
22
|
+
static fromPolygonEx(polygonExs: Polygon[]): Polygon;
|
|
23
|
+
readonly loops: Loop[];
|
|
24
|
+
/**
|
|
25
|
+
* 默认构造方法
|
|
26
|
+
*/
|
|
27
|
+
constructor();
|
|
28
|
+
/**
|
|
29
|
+
* 多个用点表示的多个环
|
|
30
|
+
*/
|
|
31
|
+
constructor(ptsArray: types.IXY[][]);
|
|
32
|
+
/**
|
|
33
|
+
* 多个用点表示的单个环
|
|
34
|
+
*/
|
|
35
|
+
constructor(pts: types.IXY[]);
|
|
36
|
+
/**
|
|
37
|
+
* 单个环
|
|
38
|
+
*/
|
|
39
|
+
constructor(loop: Loop);
|
|
40
|
+
/**
|
|
41
|
+
* 多个环
|
|
42
|
+
*/
|
|
43
|
+
constructor(loops: Loop[]);
|
|
44
|
+
getLoops(): Loop[];
|
|
45
|
+
isEmpty(): boolean;
|
|
46
|
+
reverse(): this;
|
|
47
|
+
/**
|
|
48
|
+
* 是否只包含直线
|
|
49
|
+
*/
|
|
50
|
+
isOnlyLines(): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* polygon是否合法
|
|
53
|
+
* - 空polygon也合法
|
|
54
|
+
* - 所有的内环都在外环内
|
|
55
|
+
* - 环之间没有交
|
|
56
|
+
* - 内环不能直接包含内环,外环不能直接包含外环,要交替包含
|
|
57
|
+
* @todo 内外环交替包含
|
|
58
|
+
*/
|
|
59
|
+
isValid(tol?: Tol): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* 向polygon中加入环,可以是外环,可以是内环
|
|
62
|
+
* @param loop
|
|
63
|
+
* @param sort 是否需要排序
|
|
64
|
+
* @returns 加入成功返回true,否则返回false
|
|
65
|
+
*/
|
|
66
|
+
addLoop(loop: Loop, sort?: boolean): boolean;
|
|
67
|
+
makeStartEndConnected(): void;
|
|
68
|
+
/**
|
|
69
|
+
* 删除所有环
|
|
70
|
+
* @returns 加入成功返回true,否则返回false
|
|
71
|
+
*/
|
|
72
|
+
deleteAllLoops(): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* 拷贝所有的曲线
|
|
75
|
+
*/
|
|
76
|
+
copyAllCurves(): Curve2[];
|
|
77
|
+
/**
|
|
78
|
+
* 获取所有的曲线
|
|
79
|
+
*/
|
|
80
|
+
getAllCurves(): Curve2[];
|
|
81
|
+
/**
|
|
82
|
+
* 计算Polygon的面积
|
|
83
|
+
*/
|
|
84
|
+
calcArea(): number;
|
|
85
|
+
getType(): EN_GEO_TYPE.POLYGON;
|
|
86
|
+
translate(offset: types.IXY): this;
|
|
87
|
+
rotate(angle: number, pivot: types.IXY): this;
|
|
88
|
+
/**
|
|
89
|
+
* 缩放
|
|
90
|
+
* @param factor 放大因子
|
|
91
|
+
* @param center 缩放中心
|
|
92
|
+
*/
|
|
93
|
+
scale(factor: number, center?: types.IXY): this;
|
|
94
|
+
transform(m: types.IMatrix3 | types.numberArrs3X3): this;
|
|
95
|
+
/**
|
|
96
|
+
* 反向,得到一个新的对象
|
|
97
|
+
*/
|
|
98
|
+
reversed(): Polygon;
|
|
99
|
+
/**
|
|
100
|
+
* 矩阵变换,得到变换后的对象
|
|
101
|
+
* @param m
|
|
102
|
+
*/
|
|
103
|
+
transformed(m: types.IMatrix3 | types.numberArrs3X3): Polygon;
|
|
104
|
+
getBBox(): Box2;
|
|
105
|
+
/**
|
|
106
|
+
* 提取角点
|
|
107
|
+
*/
|
|
108
|
+
toPaths(): Vec2[][];
|
|
109
|
+
dump(): types.IDBPolygon;
|
|
110
|
+
load({ data: dbLoops }: types.IDBPolygon): this;
|
|
111
|
+
clone(): Polygon;
|
|
112
|
+
/**
|
|
113
|
+
* 计算形心坐标
|
|
114
|
+
*/
|
|
115
|
+
getCentroidPoint(): Vec2;
|
|
116
|
+
private _sortLoopByArea;
|
|
117
|
+
}
|
|
118
|
+
export { Polygon };
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { Box3 } from '../base/box3';
|
|
2
|
+
import { Tol } from '../base/tol';
|
|
3
|
+
import { Vec2 } from '../base/vec2';
|
|
4
|
+
import { Vec3 } from '../base/vec3';
|
|
5
|
+
import { DiscreteParam } from '../base/discrete_param';
|
|
6
|
+
import { Coord3 } from '../base/coord3';
|
|
7
|
+
import { Surface } from '../geometry/surface';
|
|
8
|
+
import { Curve2 } from '../geometry/curve2';
|
|
9
|
+
import { Curve3 } from '../geometry/curve3d';
|
|
10
|
+
import { types } from '../type_define/i_types';
|
|
11
|
+
import { EN_GEO_TYPE } from '../type_define/i_element_type';
|
|
12
|
+
import { Polygon } from './polygon';
|
|
13
|
+
import { Interval } from '../base/interval';
|
|
14
|
+
import { ISurfaceTransformExtra } from '../type_define/i_geometry';
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* 裁剪曲面,描述无界曲面上的一个有边界的区域
|
|
18
|
+
*/
|
|
19
|
+
declare class TrimmedSurface extends Surface {
|
|
20
|
+
/**
|
|
21
|
+
* 根据给定坐标系与边界半长,生成表示平面
|
|
22
|
+
* @param coord
|
|
23
|
+
* @param halfLength
|
|
24
|
+
* @param halfWide
|
|
25
|
+
*/
|
|
26
|
+
static createPlane(coord: Coord3, halfLength: number, halfWide?: number): TrimmedSurface;
|
|
27
|
+
/**
|
|
28
|
+
* 从uv边界创建
|
|
29
|
+
* @param surface 底层的无限大曲面
|
|
30
|
+
* @param uRange u的参数域
|
|
31
|
+
* @param vRange v的参数域
|
|
32
|
+
* @param isPositive 是否同向的标记
|
|
33
|
+
*/
|
|
34
|
+
static createByRangeUV(surface: Surface, uRange: Interval, vRange: Interval, isPositive?: boolean): TrimmedSurface;
|
|
35
|
+
/**
|
|
36
|
+
* 从二维边界创建
|
|
37
|
+
* @param surface 底层的无限大曲面
|
|
38
|
+
* @param uvPolygon 无限大曲面上,二维区域的边界
|
|
39
|
+
* @param isPositive 是否同向的标记
|
|
40
|
+
*/
|
|
41
|
+
static createByBoundary2d(surface: Surface, uvLoops: Curve2[][], isPositive: boolean): TrimmedSurface;
|
|
42
|
+
/**
|
|
43
|
+
* 从三维边界创建
|
|
44
|
+
* @param surface 底层的无限大曲面
|
|
45
|
+
* @param loop3ds 无限大曲面上,三维区域的边界
|
|
46
|
+
* @param isPositive 是否同向的标记
|
|
47
|
+
*/
|
|
48
|
+
static createByBoundary3d(surface: Surface, loop3ds: Curve3[][], isPositive: boolean): TrimmedSurface;
|
|
49
|
+
private _surface;
|
|
50
|
+
private _bPositive;
|
|
51
|
+
private _uvPolygon;
|
|
52
|
+
private _loops;
|
|
53
|
+
constructor();
|
|
54
|
+
constructor(surface: Surface, uvLoops: Polygon, isPositive: boolean, loops?: Curve3[][]);
|
|
55
|
+
/**
|
|
56
|
+
* 获取底层无限大的曲面
|
|
57
|
+
*/
|
|
58
|
+
getSurface(): Surface;
|
|
59
|
+
/**
|
|
60
|
+
* 是否和无限大的曲面同向
|
|
61
|
+
*/
|
|
62
|
+
getSameDirWithSurface(): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* 获取无限大曲面uv参数域上的边界
|
|
65
|
+
*/
|
|
66
|
+
getUVPolygon(): Polygon;
|
|
67
|
+
/**
|
|
68
|
+
* 获取无限大曲面三维上的边界
|
|
69
|
+
*/
|
|
70
|
+
getLoops(): ReadonlyArray<ReadonlyArray<Curve3>>;
|
|
71
|
+
reverse(): this;
|
|
72
|
+
getPtAt(uv: types.IXY): Vec3;
|
|
73
|
+
getNormAt(uv: types.IXY): Vec3;
|
|
74
|
+
/**
|
|
75
|
+
* 获取某参数t处的n阶偏导数
|
|
76
|
+
* t : 参数t
|
|
77
|
+
* n : 导数的阶数 // 譬如n = 2,会计算曲线在参数t处的0阶导(即曲线点),1阶偏导(包含偏u、偏v),2阶偏导(包含偏uu、偏uv、偏vv)
|
|
78
|
+
*/
|
|
79
|
+
getDerivatives(uv: types.IXY, n?: number): Vec3[];
|
|
80
|
+
getUVAt(pt: types.IXYZ): Vec2;
|
|
81
|
+
containsPt(point: types.IXYZ, tol?: number): boolean;
|
|
82
|
+
containsCurve(curve: Curve3, tol?: number): boolean;
|
|
83
|
+
getDomainU(): Interval;
|
|
84
|
+
getDomainV(): Interval;
|
|
85
|
+
/**
|
|
86
|
+
* 获取等参曲线
|
|
87
|
+
* @param param 等参曲线处的参数
|
|
88
|
+
* @param useV true 时返回等 v 参数曲线,false 时返回等 u 参数曲线
|
|
89
|
+
*/
|
|
90
|
+
getIsoCurve(param: number, useV: boolean): Curve3;
|
|
91
|
+
/**
|
|
92
|
+
* 将三维曲线,转成参数域中的二维曲线
|
|
93
|
+
* @param curveOnSurface
|
|
94
|
+
*/
|
|
95
|
+
getCurve2d(curveOnSurface: Curve3): Curve2;
|
|
96
|
+
/**
|
|
97
|
+
* 将参数域中的二维曲线转成三维曲线
|
|
98
|
+
* @param curve
|
|
99
|
+
*/
|
|
100
|
+
getCurve3d(curve: Curve2): Curve3;
|
|
101
|
+
/**
|
|
102
|
+
*
|
|
103
|
+
* 计算包围盒
|
|
104
|
+
*/
|
|
105
|
+
getBBox(): Box3;
|
|
106
|
+
/**
|
|
107
|
+
* 是否和另一个曲面面完全重叠
|
|
108
|
+
* @param other
|
|
109
|
+
* @param tol
|
|
110
|
+
*/
|
|
111
|
+
isCoplanar(other: Surface, tol: Tol): boolean;
|
|
112
|
+
/**
|
|
113
|
+
* 乘上一个变换矩阵
|
|
114
|
+
*/
|
|
115
|
+
transform(mt: types.IMatrix4 | types.numberArrs4X4, extra?: ISurfaceTransformExtra): this;
|
|
116
|
+
/**
|
|
117
|
+
* 几何变换,得到新的几何对象
|
|
118
|
+
* @param m
|
|
119
|
+
*/
|
|
120
|
+
transformed(m: types.IMatrix4 | types.numberArrs4X4, extra?: ISurfaceTransformExtra): TrimmedSurface;
|
|
121
|
+
/**
|
|
122
|
+
* 深拷贝
|
|
123
|
+
*/
|
|
124
|
+
clone(): TrimmedSurface;
|
|
125
|
+
getType(): EN_GEO_TYPE.TRIM;
|
|
126
|
+
/**
|
|
127
|
+
* 抽取元数据,用于序列化
|
|
128
|
+
* @returns 返回js对象
|
|
129
|
+
*/
|
|
130
|
+
dump(): types.IDBTrimmedSur;
|
|
131
|
+
load({ data: [sur, flag, uvPolygon] }: types.IDBTrimmedSur): this;
|
|
132
|
+
tessellate(params?: DiscreteParam, tol?: Tol): types.IRenderNode;
|
|
133
|
+
discrete(params?: DiscreteParam, tol?: Tol): types.IMesh;
|
|
134
|
+
private _updateUvs;
|
|
135
|
+
}
|
|
136
|
+
export { TrimmedSurface };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare class CONST {
|
|
2
|
+
static readonly PI: number;
|
|
3
|
+
static readonly PI2: number;
|
|
4
|
+
static readonly PI_2: number;
|
|
5
|
+
static readonly PI_4: number;
|
|
6
|
+
static readonly PI_6: number;
|
|
7
|
+
static readonly PI_16: number;
|
|
8
|
+
static readonly NORMAL_ITER_NUM = 20;
|
|
9
|
+
static readonly MAX_ITER_NUM = 200;
|
|
10
|
+
static readonly PI_12: number;
|
|
11
|
+
static readonly MAX_SUBDEVIDE_DEPTH = 16;
|
|
12
|
+
static readonly MAX_INTERSECTION_NUM = 1000;
|
|
13
|
+
static readonly MODEL_MAX_LENGTH = 1000000;
|
|
14
|
+
static readonly APPROX_ARC_MIN: number;
|
|
15
|
+
static readonly APPROX_ARC_MAX: number;
|
|
16
|
+
static readonly MAX_INTEGER = 1e+100;
|
|
17
|
+
static readonly MAX_NEG_INTEGER = -1e+100;
|
|
18
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare enum EN_GEO_TYPE {
|
|
2
|
+
MATRIX_3 = "m3",
|
|
3
|
+
MATRIX_4 = "m4",
|
|
4
|
+
COORD_2 = "d2",
|
|
5
|
+
COORD_3 = "d3",
|
|
6
|
+
VEC_2 = "v2",
|
|
7
|
+
VEC_3 = "v3",
|
|
8
|
+
LN_2 = "l2",
|
|
9
|
+
LN_3 = "l3",
|
|
10
|
+
ARC_2 = "a2",
|
|
11
|
+
ARC_3 = "a3",
|
|
12
|
+
CIRCLE_3 = "c3",
|
|
13
|
+
INTERSECT_3D = "x3",
|
|
14
|
+
NURBS_CURVE_3D = "n3",
|
|
15
|
+
NURBS_CURVE_2D = "n2",
|
|
16
|
+
SMOOTHPOLY_2D = "s2",
|
|
17
|
+
SMOOTHPOLY_3D = "s3",
|
|
18
|
+
OFFSET_CURVE_2D = "f2",
|
|
19
|
+
OFFSET_CURVE_3D = "f3",
|
|
20
|
+
EXTEND_CURVE_2D = "e2",
|
|
21
|
+
POLY_CURVE = "pc",
|
|
22
|
+
LOOP = "lp",
|
|
23
|
+
POLYGON = "pg",
|
|
24
|
+
PLANE = "pl",
|
|
25
|
+
CYLINDER = "cd",
|
|
26
|
+
TRIM = "ts",
|
|
27
|
+
BREP_VERTEX = "bv",
|
|
28
|
+
BREP_COEDGE = "bc",
|
|
29
|
+
BREP_EDGE = "be",
|
|
30
|
+
BREP_WIRE = "bw",
|
|
31
|
+
BREP_FACE = "bf",
|
|
32
|
+
BREP_SHELL = "bs",
|
|
33
|
+
BREP_BODY = "bb"
|
|
34
|
+
}
|