@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.
Files changed (459) hide show
  1. package/index.cjs +226 -0
  2. package/package.json +19 -37
  3. package/types/algorithm/bool_operate/bool2d/bool2d.d.ts +22 -0
  4. package/types/algorithm/bool_operate/bool2d/difference.d.ts +9 -0
  5. package/types/algorithm/bool_operate/bool2d/intersect.d.ts +9 -0
  6. package/types/algorithm/bool_operate/bool2d/split.d.ts +3 -0
  7. package/types/algorithm/bool_operate/bool2d/union.d.ts +9 -0
  8. package/types/algorithm/bool_operate/bool2d/utils.d.ts +40 -0
  9. package/types/algorithm/bool_operate/bool_operate_clipper.d.ts +18 -0
  10. package/types/algorithm/bool_operate/polycurve_polygon_bool.d.ts +13 -0
  11. package/types/algorithm/bool_operate_2d.d.ts +67 -0
  12. package/types/algorithm/calc_d.d.ts +85 -0
  13. package/types/algorithm/calc_offset.d.ts +70 -0
  14. package/types/algorithm/calc_overlap.d.ts +56 -0
  15. package/types/algorithm/calc_project.d.ts +29 -0
  16. package/types/algorithm/calc_x.d.ts +215 -0
  17. package/types/algorithm/calculate_util/geometry_subdevide_infos.d.ts +73 -0
  18. package/types/algorithm/calculate_util/iterative_method.d.ts +30 -0
  19. package/types/algorithm/discrete/discrete_curve.d.ts +31 -0
  20. package/types/algorithm/discrete/discrete_refiner.d.ts +35 -0
  21. package/types/algorithm/discrete/discrete_surface.d.ts +74 -0
  22. package/types/algorithm/discrete/discrete_topology.d.ts +32 -0
  23. package/types/algorithm/discrete/discrete_util.d.ts +96 -0
  24. package/types/algorithm/discrete/grid_discrete_data.d.ts +58 -0
  25. package/types/algorithm/discrete/libtess.d.ts +12 -0
  26. package/types/algorithm/discrete/uniform_grid_discrete.d.ts +3 -0
  27. package/types/algorithm/distance/base_calc_distance/curves_distance_util.d.ts +20 -0
  28. package/types/algorithm/distance/base_calc_distance/define_of_calculate_distance.d.ts +12 -0
  29. package/types/algorithm/distance/curve2ds_distance/arc2s_distance.d.ts +17 -0
  30. package/types/algorithm/distance/curve2ds_distance/line2d_to_arc2d_distance.d.ts +17 -0
  31. package/types/algorithm/distance/curve2ds_distance/line2s_distance.d.ts +15 -0
  32. package/types/algorithm/distance/curve2s_distance.d.ts +15 -0
  33. package/types/algorithm/distance/curve3ds_distance/line3d_to_line3d_distance_paramed.d.ts +12 -0
  34. package/types/algorithm/distance/curve3s_distance.d.ts +31 -0
  35. package/types/algorithm/distance/pt_to_curve2_signed_distance.d.ts +17 -0
  36. package/types/algorithm/distance/pt_to_curve3_distance.d.ts +25 -0
  37. package/types/algorithm/distance/pt_to_curve_distance_info.d.ts +12 -0
  38. package/types/algorithm/distance/pt_to_surface_distance.d.ts +17 -0
  39. package/types/algorithm/distance/pts_to_curves_distance.d.ts +13 -0
  40. package/types/algorithm/distance/pts_to_pts_distance.d.ts +7 -0
  41. package/types/algorithm/geometry_merge.d.ts +22 -0
  42. package/types/algorithm/index.d.ts +32 -0
  43. package/types/algorithm/intersect/box_cut_line.d.ts +6 -0
  44. package/types/algorithm/intersect/curve_self_x.d.ts +13 -0
  45. package/types/algorithm/intersect/curve_surface_x.d.ts +34 -0
  46. package/types/algorithm/intersect/curve_surface_x_util.d.ts +32 -0
  47. package/types/algorithm/intersect/curves_x/circulars_x.d.ts +35 -0
  48. package/types/algorithm/intersect/curves_x/linear_circular_x.d.ts +40 -0
  49. package/types/algorithm/intersect/curves_x/lines_x.d.ts +17 -0
  50. package/types/algorithm/intersect/curves_x/lines_x_util.d.ts +4 -0
  51. package/types/algorithm/intersect/curves_x.d.ts +26 -0
  52. package/types/algorithm/intersect/curves_x_util.d.ts +35 -0
  53. package/types/algorithm/intersect/intersect_info_util.d.ts +9 -0
  54. package/types/algorithm/intersect/surface_self_x.d.ts +8 -0
  55. package/types/algorithm/intersect/surfaces_x.d.ts +53 -0
  56. package/types/algorithm/intersect/surfaces_x_complex.d.ts +29 -0
  57. package/types/algorithm/intersect/surfaces_x_special.d.ts +16 -0
  58. package/types/algorithm/intersect/surfaces_x_util.d.ts +41 -0
  59. package/types/algorithm/intersect/x_info.d.ts +65 -0
  60. package/types/algorithm/loop_property/loop-area.d.ts +49 -0
  61. package/types/algorithm/loop_property/loop-centroid.d.ts +40 -0
  62. package/types/algorithm/merge_geometry/halfplane.d.ts +24 -0
  63. package/types/algorithm/merge_geometry/merge_curve.d.ts +14 -0
  64. package/types/algorithm/merge_geometry/merge_point.d.ts +18 -0
  65. package/types/algorithm/mesh/clip_mesh.d.ts +27 -0
  66. package/types/algorithm/mesh/extrude_clip.d.ts +236 -0
  67. package/types/algorithm/mesh/mesh_assist.d.ts +21 -0
  68. package/types/algorithm/mesh/mesh_contour.d.ts +26 -0
  69. package/types/algorithm/mesh/mesh_util.d.ts +115 -0
  70. package/types/algorithm/offset/loop2d_offset.d.ts +22 -0
  71. package/types/algorithm/offset/polygon_offset.d.ts +27 -0
  72. package/types/algorithm/overlap/curve_surface_coincide.d.ts +6 -0
  73. package/types/algorithm/overlap/curves_colinear.d.ts +38 -0
  74. package/types/algorithm/overlap/curves_merge.d.ts +74 -0
  75. package/types/algorithm/overlap/curves_overlap.d.ts +34 -0
  76. package/types/algorithm/overlap/i_overlap.d.ts +9 -0
  77. package/types/algorithm/overlap/surfaces_coplaner.d.ts +5 -0
  78. package/types/algorithm/pattern/blocks2Geometry.d.ts +50 -0
  79. package/types/algorithm/pattern/math.d.ts +42 -0
  80. package/types/algorithm/pattern/pattern.d.ts +43 -0
  81. package/types/algorithm/pattern/pattern_util.d.ts +53 -0
  82. package/types/algorithm/pattern/pave.d.ts +33 -0
  83. package/types/algorithm/pj/curves_oj.d.ts +19 -0
  84. package/types/algorithm/pj/curves_pj.d.ts +19 -0
  85. package/types/algorithm/pj/loops_pj.d.ts +13 -0
  86. package/types/algorithm/pj/pj_type.d.ts +46 -0
  87. package/types/algorithm/pj/pt_loop_pj.d.ts +24 -0
  88. package/types/algorithm/pj/pt_polygon_pj.d.ts +18 -0
  89. package/types/algorithm/pj/pt_polygon_position_judger.d.ts +11 -0
  90. package/types/algorithm/position_judge.d.ts +72 -0
  91. package/types/algorithm/project/curve3d_to_plane_project.d.ts +11 -0
  92. package/types/algorithm/project/curve_curve_project.d.ts +9 -0
  93. package/types/algorithm/search_graph/iloops_polygonex.d.ts +28 -0
  94. package/types/algorithm/search_graph/loop_tree_node.d.ts +30 -0
  95. package/types/algorithm/search_graph/loops_to_loop_tree_search_graph.d.ts +25 -0
  96. package/types/algorithm/search_graph/polygon_polygonex.d.ts +13 -0
  97. package/types/algorithm/search_graph/search_loop2d.d.ts +20 -0
  98. package/types/algorithm/search_graph/search_polyline.d.ts +11 -0
  99. package/types/algorithm/search_graph.d.ts +45 -0
  100. package/types/algorithm/topology_edit.d.ts +10 -0
  101. package/types/base/box.d.ts +100 -0
  102. package/types/base/box2.d.ts +17 -0
  103. package/types/base/box3.d.ts +20 -0
  104. package/types/base/coord.d.ts +10 -0
  105. package/types/base/coord2.d.ts +92 -0
  106. package/types/base/coord3.d.ts +139 -0
  107. package/types/base/discrete_param.d.ts +28 -0
  108. package/types/base/euler.d.ts +102 -0
  109. package/types/base/geo_element.d.ts +54 -0
  110. package/types/base/interval.d.ts +122 -0
  111. package/types/base/ivector.d.ts +126 -0
  112. package/types/base/matrix.d.ts +108 -0
  113. package/types/base/matrix3.d.ts +118 -0
  114. package/types/base/matrix4.d.ts +166 -0
  115. package/types/base/matrix_util.d.ts +5 -0
  116. package/types/base/period_inverval.d.ts +127 -0
  117. package/types/base/quaternion.d.ts +39 -0
  118. package/types/base/tangent_cone.d.ts +11 -0
  119. package/types/base/tilt_box.d.ts +11 -0
  120. package/types/base/tol.d.ts +120 -0
  121. package/types/base/vec.d.ts +46 -0
  122. package/types/base/vec2.d.ts +146 -0
  123. package/types/base/vec3.d.ts +158 -0
  124. package/types/brep-src/algorithm/alg_const.d.ts +23 -0
  125. package/types/brep-src/algorithm/alg_types.d.ts +47 -0
  126. package/types/brep-src/algorithm/algorithm_util/base_define.d.ts +7 -0
  127. package/types/brep-src/algorithm/algorithm_util/body_base_util.d.ts +4 -0
  128. package/types/brep-src/algorithm/algorithm_util/curve_solid_analysis.d.ts +28 -0
  129. package/types/brep-src/algorithm/algorithm_util/face_face_analysis.d.ts +39 -0
  130. package/types/brep-src/algorithm/algorithm_util/search_wire.d.ts +8 -0
  131. package/types/brep-src/algorithm/body_builder/basic_body_builder.d.ts +15 -0
  132. package/types/brep-src/algorithm/body_builder/extrude_body.d.ts +23 -0
  133. package/types/brep-src/algorithm/body_builder/sweep_body.d.ts +37 -0
  134. package/types/brep-src/algorithm/body_builder.d.ts +36 -0
  135. package/types/brep-src/algorithm/body_util.d.ts +21 -0
  136. package/types/brep-src/algorithm/bool_sk/brep_converter.d.ts +11 -0
  137. package/types/brep-src/algorithm/brep_calc_project.d.ts +50 -0
  138. package/types/brep-src/algorithm/brep_calc_x.d.ts +34 -0
  139. package/types/brep-src/algorithm/brep_pj.d.ts +47 -0
  140. package/types/brep-src/algorithm/index.d.ts +5 -0
  141. package/types/brep-src/algorithm/intersect/curve_face_overlap.d.ts +10 -0
  142. package/types/brep-src/algorithm/intersect/face_face_intersect.d.ts +22 -0
  143. package/types/brep-src/algorithm/intersect/face_faces_intersect.d.ts +15 -0
  144. package/types/brep-src/algorithm/intersect/line_face_intersect.d.ts +16 -0
  145. package/types/brep-src/algorithm/podition_judge/body_pj.d.ts +25 -0
  146. package/types/brep-src/algorithm/podition_judge/extrude_pj.d.ts +28 -0
  147. package/types/brep-src/algorithm/podition_judge/pt_body_pj.d.ts +32 -0
  148. package/types/brep-src/algorithm/project/body_project.d.ts +8 -0
  149. package/types/brep-src/algorithm/project/face_project.d.ts +20 -0
  150. package/types/brep-src/algorithm/project/face_surface_project.d.ts +8 -0
  151. package/types/brep-src/algorithm/project/space_project.d.ts +26 -0
  152. package/types/brep-src/algorithm/project/space_project_simple.d.ts +10 -0
  153. package/types/brep-src/algorithm/project/view_project.d.ts +25 -0
  154. package/types/brep-src/algorithm/shell_builder/create_shell_from_curves.d.ts +38 -0
  155. package/types/brep-src/algorithm/shell_builder.d.ts +25 -0
  156. package/types/brep-src/algorithm/shell_edit/add_edges/add_edges.d.ts +14 -0
  157. package/types/brep-src/algorithm/shell_edit/add_edges/add_edges_core.d.ts +11 -0
  158. package/types/brep-src/algorithm/shell_edit/copy_faces.d.ts +20 -0
  159. package/types/brep-src/algorithm/shell_edit/delete_faces_edges/delete_edge.d.ts +9 -0
  160. package/types/brep-src/algorithm/shell_edit/delete_faces_edges/delete_faces_edges.d.ts +17 -0
  161. package/types/brep-src/algorithm/shell_edit/faces_boolean/faces_boolean.d.ts +19 -0
  162. package/types/brep-src/algorithm/shell_edit/faces_boolean/faces_shells_boolean.d.ts +13 -0
  163. package/types/brep-src/algorithm/shell_edit/faces_boolean/octree.d.ts +11 -0
  164. package/types/brep-src/algorithm/shell_edit/isolate_faces.d.ts +21 -0
  165. package/types/brep-src/algorithm/shell_edit/merge_connect_faces.d.ts +14 -0
  166. package/types/brep-src/algorithm/shell_edit/merge_edges.d.ts +8 -0
  167. package/types/brep-src/algorithm/shell_edit/move_operators/move_edges.d.ts +31 -0
  168. package/types/brep-src/algorithm/shell_edit/move_operators/move_faces.d.ts +14 -0
  169. package/types/brep-src/algorithm/shell_edit/operator/dispose_topo.d.ts +2 -0
  170. package/types/brep-src/algorithm/shell_edit/operator/merge_connect_edge.d.ts +3 -0
  171. package/types/brep-src/algorithm/shell_edit/operator/merge_connect_face.d.ts +2 -0
  172. package/types/brep-src/algorithm/shell_edit/operator/merge_overlap_edge.d.ts +3 -0
  173. package/types/brep-src/algorithm/shell_edit/operator/merge_shell.d.ts +11 -0
  174. package/types/brep-src/algorithm/shell_edit/operator/merge_vertex.d.ts +2 -0
  175. package/types/brep-src/algorithm/shell_edit/operator/split_edge.d.ts +4 -0
  176. package/types/brep-src/algorithm/shell_edit/operator/split_shell.d.ts +6 -0
  177. package/types/brep-src/algorithm/shell_edit/pull_push_face/pull_push_face.d.ts +18 -0
  178. package/types/brep-src/algorithm/shell_edit/pull_push_face/pull_push_face_core.d.ts +6 -0
  179. package/types/brep-src/algorithm/shell_edit/pull_push_face/pull_push_face_preview.d.ts +16 -0
  180. package/types/brep-src/algorithm/shell_edit/pull_push_face/pull_push_face_preview_core.d.ts +24 -0
  181. package/types/brep-src/algorithm/shell_edit/roundinng/2d_rounding.d.ts +22 -0
  182. package/types/brep-src/algorithm/shell_edit/shell_modeling_base.d.ts +10 -0
  183. package/types/brep-src/algorithm/shell_edit/shell_modeling_result.d.ts +21 -0
  184. package/types/brep-src/algorithm/shell_edit/smooth/detect_loop_util.d.ts +27 -0
  185. package/types/brep-src/algorithm/shell_edit/smooth/shell_modeling_util.d.ts +24 -0
  186. package/types/brep-src/algorithm/shell_edit/smooth/smooth_util.d.ts +22 -0
  187. package/types/brep-src/algorithm/shell_edit/split_edge.d.ts +10 -0
  188. package/types/brep-src/algorithm/shell_edit.d.ts +119 -0
  189. package/types/brep-src/algorithm/shell_valid/base_brep_topo_error.d.ts +176 -0
  190. package/types/brep-src/algorithm/shell_valid/diagnose_shell.d.ts +14 -0
  191. package/types/brep-src/brep/brep_body.d.ts +19 -0
  192. package/types/brep-src/brep/coedge3d.d.ts +83 -0
  193. package/types/brep-src/brep/edge.d.ts +96 -0
  194. package/types/brep-src/brep/face.d.ts +150 -0
  195. package/types/brep-src/brep/shell.d.ts +166 -0
  196. package/types/brep-src/brep/topo_object.d.ts +40 -0
  197. package/types/brep-src/brep/vertex.d.ts +48 -0
  198. package/types/brep-src/brep/wire.d.ts +66 -0
  199. package/types/brep-src/continuous/continuous_edge.d.ts +17 -0
  200. package/types/brep-src/continuous/continuous_face.d.ts +10 -0
  201. package/types/brep-src/continuous/continuous_util.d.ts +60 -0
  202. package/types/brep-src/continuous/continuous_uv.d.ts +24 -0
  203. package/types/brep-src/continuous/index.d.ts +4 -0
  204. package/types/brep-src/index.d.ts +14 -0
  205. package/types/brep-src/type_define/i_types.d.ts +46 -0
  206. package/types/brep-src/util/util.d.ts +23 -0
  207. package/types/conversion/units_conversion.d.ts +14 -0
  208. package/types/geometry/arc2d.d.ts +249 -0
  209. package/types/geometry/arc3d.d.ts +204 -0
  210. package/types/geometry/circle3d.d.ts +92 -0
  211. package/types/geometry/circular_surface.d.ts +52 -0
  212. package/types/geometry/coord_based_surface.d.ts +25 -0
  213. package/types/geometry/curve.d.ts +228 -0
  214. package/types/geometry/curve2.d.ts +62 -0
  215. package/types/geometry/curve3d.d.ts +66 -0
  216. package/types/geometry/cylinder.d.ts +73 -0
  217. package/types/geometry/discrete_arrow.d.ts +3 -0
  218. package/types/geometry/extend_curve2.d.ts +75 -0
  219. package/types/geometry/geometry2d.d.ts +35 -0
  220. package/types/geometry/geometry3d.d.ts +36 -0
  221. package/types/geometry/intersect_curve3.d.ts +90 -0
  222. package/types/geometry/ln2.d.ts +168 -0
  223. package/types/geometry/ln3.d.ts +152 -0
  224. package/types/geometry/nurbs_curve2.d.ts +106 -0
  225. package/types/geometry/nurbs_curve3.d.ts +191 -0
  226. package/types/geometry/offset_curve2.d.ts +63 -0
  227. package/types/geometry/offset_curve3.d.ts +97 -0
  228. package/types/geometry/offset_parameter_mapper.d.ts +72 -0
  229. package/types/geometry/plane.d.ts +109 -0
  230. package/types/geometry/polyline.d.ts +12 -0
  231. package/types/geometry/smooth_poly2.d.ts +78 -0
  232. package/types/geometry/smooth_poly3.d.ts +85 -0
  233. package/types/geometry/surface.d.ts +173 -0
  234. package/types/index.d.ts +78 -0
  235. package/types/io/obj_parser.d.ts +4 -0
  236. package/types/io/svgparser.d.ts +22 -0
  237. package/types/loader/loader.d.ts +23 -0
  238. package/types/loader/register_geo.d.ts +7 -0
  239. package/types/math/gauss_integration.d.ts +13 -0
  240. package/types/math/inv_bilinear.d.ts +33 -0
  241. package/types/solve_equations/cubic_equation.d.ts +7 -0
  242. package/types/solve_equations/linear_system.d.ts +6 -0
  243. package/types/solve_equations/nonlinear_system.d.ts +11 -0
  244. package/types/solve_equations/plurality.d.ts +9 -0
  245. package/types/solve_equations/polynomial_equation.d.ts +6 -0
  246. package/types/solve_equations/quadratic_equation.d.ts +6 -0
  247. package/types/solve_equations/quartic_equation.d.ts +6 -0
  248. package/types/solve_equations/solve_equation_util.d.ts +50 -0
  249. package/types/test_util/loop_generator.d.ts +21 -0
  250. package/types/topology/evolution_map.d.ts +90 -0
  251. package/types/topology/loop.d.ts +50 -0
  252. package/types/topology/polycurve.d.ts +109 -0
  253. package/types/topology/polygon.d.ts +118 -0
  254. package/types/topology/trimmed_surface.d.ts +136 -0
  255. package/types/type_define/const.d.ts +18 -0
  256. package/types/type_define/i_element.d.ts +9 -0
  257. package/types/type_define/i_element_type.d.ts +34 -0
  258. package/types/type_define/i_geometry.d.ts +191 -0
  259. package/types/type_define/i_types.d.ts +280 -0
  260. package/types/util/array_util.d.ts +8 -0
  261. package/types/util/assert.d.ts +21 -0
  262. package/types/util/clipper2_util.d.ts +5 -0
  263. package/types/util/clipper_format_converter.d.ts +21 -0
  264. package/types/util/clipper_util.d.ts +10 -0
  265. package/types/util/curve_util.d.ts +72 -0
  266. package/types/util/geom_util.d.ts +23 -0
  267. package/types/util/log.d.ts +19 -0
  268. package/types/util/math_error.d.ts +37 -0
  269. package/types/util/surface_util.d.ts +13 -0
  270. package/types/util/util.d.ts +18 -0
  271. package/types/util/uv_util.d.ts +68 -0
  272. package/types/verb/export_verb.d.ts +2 -0
  273. package/types/wasm/a2d.d.ts +19 -0
  274. package/types/wasm/bx2.d.ts +16 -0
  275. package/types/wasm/c2d.d.ts +29 -0
  276. package/types/wasm/elli.d.ts +19 -0
  277. package/types/wasm/grapher2d.d.ts +39 -0
  278. package/types/wasm/grapherutil.d.ts +9 -0
  279. package/types/wasm/l2d.d.ts +14 -0
  280. package/types/wasm/loader.d.ts +8 -0
  281. package/types/wasm/pt.d.ts +19 -0
  282. package/types/wasm/wasm-geom.d.ts +296 -0
  283. package/types/wasm/wasminstance.d.ts +19 -0
  284. package/types/wasm/wrapper.d.ts +82 -0
  285. package/README.md +0 -21
  286. package/dist/constants/geom_type.d.ts +0 -13
  287. package/dist/constants/geom_type.d.ts.map +0 -1
  288. package/dist/constants/geom_type.js +0 -17
  289. package/dist/constants/math_const.d.ts +0 -9
  290. package/dist/constants/math_const.d.ts.map +0 -1
  291. package/dist/constants/math_const.js +0 -12
  292. package/dist/core/box2.d.ts +0 -71
  293. package/dist/core/box2.d.ts.map +0 -1
  294. package/dist/core/box2.js +0 -243
  295. package/dist/core/coord2d.d.ts +0 -62
  296. package/dist/core/coord2d.d.ts.map +0 -1
  297. package/dist/core/coord2d.js +0 -155
  298. package/dist/core/geom_base.d.ts +0 -19
  299. package/dist/core/geom_base.d.ts.map +0 -1
  300. package/dist/core/geom_base.js +0 -18
  301. package/dist/core/mat3.d.ts +0 -101
  302. package/dist/core/mat3.d.ts.map +0 -1
  303. package/dist/core/mat3.js +0 -290
  304. package/dist/core/vec2.d.ts +0 -138
  305. package/dist/core/vec2.d.ts.map +0 -1
  306. package/dist/core/vec2.js +0 -297
  307. package/dist/curves/arc2.d.ts +0 -49
  308. package/dist/curves/arc2.d.ts.map +0 -1
  309. package/dist/curves/arc2.js +0 -265
  310. package/dist/curves/bspline2.d.ts +0 -150
  311. package/dist/curves/bspline2.d.ts.map +0 -1
  312. package/dist/curves/bspline2.js +0 -793
  313. package/dist/curves/circle2.d.ts +0 -42
  314. package/dist/curves/circle2.d.ts.map +0 -1
  315. package/dist/curves/circle2.js +0 -135
  316. package/dist/curves/circle_curve2.d.ts +0 -38
  317. package/dist/curves/circle_curve2.d.ts.map +0 -1
  318. package/dist/curves/circle_curve2.js +0 -112
  319. package/dist/curves/curve2.d.ts +0 -214
  320. package/dist/curves/curve2.d.ts.map +0 -1
  321. package/dist/curves/curve2.js +0 -238
  322. package/dist/curves/ellipse2.d.ts +0 -42
  323. package/dist/curves/ellipse2.d.ts.map +0 -1
  324. package/dist/curves/ellipse2.js +0 -125
  325. package/dist/curves/ellipse_arc2.d.ts +0 -49
  326. package/dist/curves/ellipse_arc2.d.ts.map +0 -1
  327. package/dist/curves/ellipse_arc2.js +0 -184
  328. package/dist/curves/ellipse_curve2.d.ts +0 -56
  329. package/dist/curves/ellipse_curve2.d.ts.map +0 -1
  330. package/dist/curves/ellipse_curve2.js +0 -262
  331. package/dist/curves/interval.d.ts +0 -112
  332. package/dist/curves/interval.d.ts.map +0 -1
  333. package/dist/curves/interval.js +0 -200
  334. package/dist/curves/line2.d.ts +0 -64
  335. package/dist/curves/line2.d.ts.map +0 -1
  336. package/dist/curves/line2.js +0 -193
  337. package/dist/curves/period_interval.d.ts +0 -129
  338. package/dist/curves/period_interval.d.ts.map +0 -1
  339. package/dist/curves/period_interval.js +0 -240
  340. package/dist/discretize/discretize_defaults.d.ts +0 -12
  341. package/dist/discretize/discretize_defaults.d.ts.map +0 -1
  342. package/dist/discretize/discretize_defaults.js +0 -12
  343. package/dist/discretize/discretize_engine.d.ts +0 -33
  344. package/dist/discretize/discretize_engine.d.ts.map +0 -1
  345. package/dist/discretize/discretize_engine.js +0 -347
  346. package/dist/discretize/discretize_errors.d.ts +0 -15
  347. package/dist/discretize/discretize_errors.d.ts.map +0 -1
  348. package/dist/discretize/discretize_errors.js +0 -30
  349. package/dist/discretize/discretize_options.d.ts +0 -18
  350. package/dist/discretize/discretize_options.d.ts.map +0 -1
  351. package/dist/discretize/discretize_options.js +0 -19
  352. package/dist/discretize/discretize_types.d.ts +0 -36
  353. package/dist/discretize/discretize_types.d.ts.map +0 -1
  354. package/dist/discretize/discretize_types.js +0 -1
  355. package/dist/discretize/internal/curve_guards.d.ts +0 -35
  356. package/dist/discretize/internal/curve_guards.d.ts.map +0 -1
  357. package/dist/discretize/internal/curve_guards.js +0 -62
  358. package/dist/discretize/internal/postprocess.d.ts +0 -5
  359. package/dist/discretize/internal/postprocess.d.ts.map +0 -1
  360. package/dist/discretize/internal/postprocess.js +0 -109
  361. package/dist/discretize/internal/sampling_utils.d.ts +0 -8
  362. package/dist/discretize/internal/sampling_utils.d.ts.map +0 -1
  363. package/dist/discretize/internal/sampling_utils.js +0 -36
  364. package/dist/discretize/register_builtin_strategies.d.ts +0 -3
  365. package/dist/discretize/register_builtin_strategies.d.ts.map +0 -1
  366. package/dist/discretize/register_builtin_strategies.js +0 -10
  367. package/dist/discretize/strategies/bspline_strategy.d.ts +0 -4
  368. package/dist/discretize/strategies/bspline_strategy.d.ts.map +0 -1
  369. package/dist/discretize/strategies/bspline_strategy.js +0 -115
  370. package/dist/discretize/strategies/circle_strategy.d.ts +0 -7
  371. package/dist/discretize/strategies/circle_strategy.d.ts.map +0 -1
  372. package/dist/discretize/strategies/circle_strategy.js +0 -55
  373. package/dist/discretize/strategies/ellipse_strategy.d.ts +0 -7
  374. package/dist/discretize/strategies/ellipse_strategy.d.ts.map +0 -1
  375. package/dist/discretize/strategies/ellipse_strategy.js +0 -86
  376. package/dist/discretize/strategies/line_strategy.d.ts +0 -4
  377. package/dist/discretize/strategies/line_strategy.d.ts.map +0 -1
  378. package/dist/discretize/strategies/line_strategy.js +0 -40
  379. package/dist/discretize/strategy_registry.d.ts +0 -9
  380. package/dist/discretize/strategy_registry.d.ts.map +0 -1
  381. package/dist/discretize/strategy_registry.js +0 -34
  382. package/dist/index.d.ts +0 -30
  383. package/dist/index.d.ts.map +0 -1
  384. package/dist/index.js +0 -24
  385. package/dist/intersections/analytic_x_algorithm.d.ts +0 -10
  386. package/dist/intersections/analytic_x_algorithm.d.ts.map +0 -1
  387. package/dist/intersections/analytic_x_algorithm.js +0 -83
  388. package/dist/intersections/curve_x_engine.d.ts +0 -9
  389. package/dist/intersections/curve_x_engine.d.ts.map +0 -1
  390. package/dist/intersections/curve_x_engine.js +0 -27
  391. package/dist/intersections/index.d.ts +0 -5
  392. package/dist/intersections/index.d.ts.map +0 -1
  393. package/dist/intersections/index.js +0 -11
  394. package/dist/intersections/internal/certification.d.ts +0 -34
  395. package/dist/intersections/internal/certification.d.ts.map +0 -1
  396. package/dist/intersections/internal/certification.js +0 -238
  397. package/dist/intersections/internal/interval_clipping.d.ts +0 -29
  398. package/dist/intersections/internal/interval_clipping.d.ts.map +0 -1
  399. package/dist/intersections/internal/interval_clipping.js +0 -123
  400. package/dist/intersections/internal/kind.d.ts +0 -4
  401. package/dist/intersections/internal/kind.d.ts.map +0 -1
  402. package/dist/intersections/internal/kind.js +0 -16
  403. package/dist/intersections/internal/pair.d.ts +0 -9
  404. package/dist/intersections/internal/pair.d.ts.map +0 -1
  405. package/dist/intersections/internal/pair.js +0 -14
  406. package/dist/intersections/internal/result.d.ts +0 -20
  407. package/dist/intersections/internal/result.d.ts.map +0 -1
  408. package/dist/intersections/internal/result.js +0 -125
  409. package/dist/intersections/internal/sampling.d.ts +0 -15
  410. package/dist/intersections/internal/sampling.d.ts.map +0 -1
  411. package/dist/intersections/internal/sampling.js +0 -131
  412. package/dist/intersections/internal/segment.d.ts +0 -32
  413. package/dist/intersections/internal/segment.d.ts.map +0 -1
  414. package/dist/intersections/internal/segment.js +0 -137
  415. package/dist/intersections/internal/tolerance.d.ts +0 -10
  416. package/dist/intersections/internal/tolerance.d.ts.map +0 -1
  417. package/dist/intersections/internal/tolerance.js +0 -20
  418. package/dist/intersections/intersector.d.ts +0 -6
  419. package/dist/intersections/intersector.d.ts.map +0 -1
  420. package/dist/intersections/intersector.js +0 -1
  421. package/dist/intersections/numeric_x_algorithm.d.ts +0 -10
  422. package/dist/intersections/numeric_x_algorithm.d.ts.map +0 -1
  423. package/dist/intersections/numeric_x_algorithm.js +0 -73
  424. package/dist/intersections/solvers/bspline_self_solver.d.ts +0 -7
  425. package/dist/intersections/solvers/bspline_self_solver.d.ts.map +0 -1
  426. package/dist/intersections/solvers/bspline_self_solver.js +0 -308
  427. package/dist/intersections/solvers/line_line_pair_solver.d.ts +0 -7
  428. package/dist/intersections/solvers/line_line_pair_solver.d.ts.map +0 -1
  429. package/dist/intersections/solvers/line_line_pair_solver.js +0 -35
  430. package/dist/intersections/solvers/pair_solvers.d.ts +0 -94
  431. package/dist/intersections/solvers/pair_solvers.d.ts.map +0 -1
  432. package/dist/intersections/solvers/pair_solvers.js +0 -1078
  433. package/dist/intersections/solvers/polyline_pair_intersector.d.ts +0 -51
  434. package/dist/intersections/solvers/polyline_pair_intersector.d.ts.map +0 -1
  435. package/dist/intersections/solvers/polyline_pair_intersector.js +0 -731
  436. package/dist/intersections/types.d.ts +0 -11
  437. package/dist/intersections/types.d.ts.map +0 -1
  438. package/dist/intersections/types.js +0 -1
  439. package/dist/serialize/dump_types.d.ts +0 -101
  440. package/dist/serialize/dump_types.d.ts.map +0 -1
  441. package/dist/serialize/dump_types.js +0 -5
  442. package/dist/serialize/geom_mgr.d.ts +0 -24
  443. package/dist/serialize/geom_mgr.d.ts.map +0 -1
  444. package/dist/serialize/geom_mgr.js +0 -30
  445. package/dist/types/type_define.d.ts +0 -29
  446. package/dist/types/type_define.d.ts.map +0 -1
  447. package/dist/types/type_define.js +0 -10
  448. package/dist/types/type_guard.d.ts +0 -46
  449. package/dist/types/type_guard.d.ts.map +0 -1
  450. package/dist/types/type_guard.js +0 -5
  451. package/dist/utils/math_error.d.ts +0 -16
  452. package/dist/utils/math_error.d.ts.map +0 -1
  453. package/dist/utils/math_error.js +0 -35
  454. package/dist/utils/math_utils.d.ts +0 -9
  455. package/dist/utils/math_utils.d.ts.map +0 -1
  456. package/dist/utils/math_utils.js +0 -25
  457. package/dist/utils/precision.d.ts +0 -29
  458. package/dist/utils/precision.d.ts.map +0 -1
  459. package/dist/utils/precision.js +0 -44
@@ -0,0 +1,24 @@
1
+ import { PtLoopPJType } from './pj_type';
2
+ import { Vec2 } from '../../base/vec2';
3
+ import { Loop } from '../../topology/loop';
4
+ import { Curve2 } from '../../geometry/curve2';
5
+ /**
6
+ *
7
+ * 点与Loop的位置关系判断
8
+ * [参考文献](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.88.5498&rep=rep1&type=pdf)
9
+ */
10
+ declare class PtLoopPJ {
11
+ /**
12
+ * @param point
13
+ * @param loop
14
+ * @param tolerance
15
+ * @returns `CurvesPJType`
16
+ */
17
+ static execute(pt: Vec2, loop: Loop, eps?: number): {
18
+ type: PtLoopPJType;
19
+ curve?: Curve2;
20
+ };
21
+ private static _dealHorizontalLineLoop;
22
+ private static _getRefPt;
23
+ }
24
+ export { PtLoopPJ };
@@ -0,0 +1,18 @@
1
+ import { PtLoopPJType } from './pj_type';
2
+ import { Vec2 } from '../../base/vec2';
3
+ import { Polygon } from '../../topology/polygon';
4
+ /**
5
+ *
6
+ * 点和PolygonEx的位置关系判断
7
+ */
8
+ export declare class PtPolygonPJ {
9
+ /**
10
+ * 点与Polygon的位置关系判断
11
+ *
12
+ * @param point
13
+ * @param polygon
14
+ * @param tolerance
15
+ * @returns `CurvesPJType`
16
+ */
17
+ static execute(pt: Vec2, polygon: Polygon, tolerance?: number): PtLoopPJType;
18
+ }
@@ -0,0 +1,11 @@
1
+ import { types } from '../../type_define/i_types';
2
+ import { PtLoopPJType } from './pj_type';
3
+ /**
4
+ * 仅用于点和多边形的内外关系判断
5
+ * 通过对边的排序,使得对多个点的判断效率为 O(n log(m)),n为点数,m为边数
6
+ */
7
+ export declare class PtPolygonPositionJudger {
8
+ private _tree;
9
+ constructor(pointLoops: types.IXY[][]);
10
+ judge(point: types.IXY, eps?: number): PtLoopPJType;
11
+ }
@@ -0,0 +1,72 @@
1
+ import { CurvesPJType, LoopsPJType, PtLoopPJType } from './pj/pj_type';
2
+ import { Vec } from '../base/vec';
3
+ import { Curve } from '../geometry/curve';
4
+ import { Vec3 } from '../base/vec3';
5
+ import { Plane } from '../geometry/plane';
6
+ import { Loop } from '../topology/loop';
7
+ import { Vec2 } from '../base/vec2';
8
+ import { Polygon } from '../topology/polygon';
9
+ import { Curve2 } from '../geometry/curve2';
10
+ export interface IPtLoopResult {
11
+ type: PtLoopPJType;
12
+ curve?: Curve2;
13
+ }
14
+ declare class PJ {
15
+ /**
16
+ * 点是否在平面的右侧,
17
+ *
18
+ * 规定:点在平面法线一侧为右侧,否则为左侧
19
+ *
20
+ * @param point 任意一点
21
+ * @param plane 任意平面
22
+ */
23
+ static isPtAbovePlane(point: Vec3, plane: Plane): boolean;
24
+ /**
25
+ * 曲线与曲线的位置关系判断:相交,重叠,不相交。
26
+ * 支持 直线和圆弧
27
+ * @param curve1
28
+ * @param curve2
29
+ * @param tolerance
30
+ * @returns `CurvesPJType`
31
+ */
32
+ static curveToCurve<PointType extends Vec>(curve1: Curve<PointType>, curve2: Curve<PointType>, distanceTol?: number, angleTol?: number): CurvesPJType;
33
+ /**
34
+ * 曲线和曲线是否重叠关系判断:不重叠,重叠,部分重叠
35
+ * 支持直线、圆弧
36
+ * @param curve1
37
+ * @param curve2
38
+ * @param distanceTol
39
+ * @param angleTol
40
+ */
41
+ static curvesOverlap<PointType extends Vec>(curve1: Curve<PointType>, curve2: Curve<PointType>, distanceTol?: number, angleTol?: number): CurvesPJType;
42
+ /**
43
+ * 点与Loop的位置关系判断:ONEDGE, ONVERTEX,IN,OUT
44
+ *
45
+ * @param point
46
+ * @param loop
47
+ * @param tolerance
48
+ * @returns `CurvesPJType`
49
+ */
50
+ static ptToLoop(pt: Vec2, loop: Loop, tolerance?: number): IPtLoopResult;
51
+ /**
52
+ * 点与Polygon的位置关系判断
53
+ *
54
+ * @param point
55
+ * @param Polygon
56
+ * @param tol
57
+ * @returns `CurvesPJType`
58
+ */
59
+ static ptToPolygon(pt: Vec2, polygon: Polygon, tol?: number): PtLoopPJType;
60
+ /**
61
+ * Loop1与Loop2的位置关系判断:相离、外切、相交、内切、包含
62
+ * 逆时针的环为外环,顺时针的环为内环
63
+ *
64
+ * @param curve 2d曲线
65
+ * @param loop
66
+ * @param tolerance
67
+ * @param tangentIsIntersect 如果是true将内切和外切的情况判断为intersect;如果是false,则外切的情况认为是out,内切的情况认为是contain或者in。默认为false
68
+ * @returns `CurvesPJType`
69
+ */
70
+ static loopToLoop(loop1: Loop, loop2: Loop, tol?: number, tangentIsIntersect?: boolean): LoopsPJType;
71
+ }
72
+ export { PJ };
@@ -0,0 +1,11 @@
1
+ import { Plane } from '../../geometry/plane';
2
+ import { Curve3 } from '../../geometry/curve3d';
3
+ import { Curve2 } from '../../geometry/curve2';
4
+ import { Tol } from '../../base/tol';
5
+ export declare class Curve3ProjectToPlane {
6
+ private _plane;
7
+ private _curve;
8
+ private _tol;
9
+ constructor(curve: Curve3, plane: Plane, tol?: Tol);
10
+ execute(): Curve2 | undefined;
11
+ }
@@ -0,0 +1,9 @@
1
+ import { Interval } from '../../base/interval';
2
+ import { ILine } from '../../type_define/i_geometry';
3
+ import { Vec } from '../../base/vec';
4
+ /**
5
+ * curve1 向 curve2 投影,返回一个区间,该区间代表投影后的线在 curve2 参数域上的区间
6
+ */
7
+ export declare class CurvesProject {
8
+ static lines<VectorType extends Vec>(line1: ILine<VectorType>, line2: ILine<VectorType>): Interval;
9
+ }
@@ -0,0 +1,28 @@
1
+ import { Loop } from '../../topology/loop';
2
+ interface INestedLoop {
3
+ loop: ILoop;
4
+ nesting: INestedLoop[];
5
+ level: number;
6
+ isCCW: boolean;
7
+ }
8
+ interface ILoop {
9
+ reverse(): any;
10
+ }
11
+ /**
12
+ * Polygon变成PolygonEx
13
+ */
14
+ export declare class ILoopsToPolygonExes {
15
+ /**
16
+ * 根据Polygon内部环的嵌套包含关系,将Polygon拆分成polygonEx
17
+ * 条件:Polygon环之间不相交
18
+ * @param polygon
19
+ * @param keepPositive 是否保持结果都是正向的(外环逆时针,内环顺时针)
20
+ * @param considerLoopDir 是否考虑环之间的相对方向(如果不考虑,则会将所有的直接子环作为内环,如果考虑,则只会将方向相反的直接子环作为内环)
21
+ * @param convertToLoop 转换成Loop的方法
22
+ */
23
+ static execute<T>(polygon: ILoop[], keepPositive: boolean, considerLoopDir?: boolean, convertToLoop?: (iLoop: T) => Loop): T[][];
24
+ static getNestedLoops(loops: ILoop[], convertToLoop: (iLoop: ILoop) => Loop): INestedLoop[];
25
+ static createFaces(nestedLoop: INestedLoop, considerLoopDir: boolean, usedLoopMap: Map<ILoop, boolean>, newFaces: INestedLoop[][]): void;
26
+ private static _loopContainsLoop;
27
+ }
28
+ export {};
@@ -0,0 +1,30 @@
1
+ import { Loop } from '../../topology/loop';
2
+ import { Polygon } from '../../topology/polygon';
3
+ /**
4
+ * 根据包含关系创建的loop树节点
5
+ */
6
+ declare class LoopTreeNode {
7
+ children: LoopTreeNode[];
8
+ data?: Loop;
9
+ addToChild(node: LoopTreeNode): void;
10
+ isPolygonValid(): boolean;
11
+ /**
12
+ * 转成一个合法的polygon
13
+ */
14
+ makeValid(isAntiClock: boolean): void;
15
+ /**
16
+ * 搜集所有的loop
17
+ */
18
+ collectLoops(loops: Loop[]): void;
19
+ /**
20
+ * 搜集所有的loop
21
+ */
22
+ collectHoles(polygons: Polygon[]): void;
23
+ /**
24
+ * 搜集所有的PolygonExes
25
+ */
26
+ collectNewPolygonExes(polygons: Polygon[]): void;
27
+ private _makeClockwise;
28
+ private _makeAnticlockwise;
29
+ }
30
+ export { LoopTreeNode };
@@ -0,0 +1,25 @@
1
+ import { LoopTreeNode } from './loop_tree_node';
2
+ import { Loop } from '../../topology/loop';
3
+ /**
4
+ * 根据包含关系,将loop[],组成polygon
5
+ */
6
+ declare class LoopsToLoopTreeSearchGraph {
7
+ static scale: number;
8
+ /**
9
+ * 根据包含关系,将loop[],组成polygon
10
+ * @param curve
11
+ * @param polygon
12
+ */
13
+ static execute(loops: Loop[]): LoopTreeNode;
14
+ private static _ptToKey;
15
+ private static _ptsToKey;
16
+ private static _polyTreeToLoopTree;
17
+ /**
18
+ * clipper布尔运算时会自动合并边,并且会圆整整数,因此采用一个点去拓扑追踪原来的环
19
+ * @param path
20
+ * @param originLoops
21
+ * @param loops
22
+ */
23
+ private static _findLoop;
24
+ }
25
+ export { LoopsToLoopTreeSearchGraph };
@@ -0,0 +1,13 @@
1
+ import { Polygon } from '../../topology/polygon';
2
+ /**
3
+ * Polygon变成PolygonEx
4
+ */
5
+ export declare class PolygonToPolygonExes {
6
+ /**
7
+ * 根据Polygon内部环的嵌套包含关系,将Polygon拆分成polygonEx
8
+ * 条件:Polygon环之间不相交
9
+ * @param polygon
10
+ * @returns polygon[]
11
+ */
12
+ static execute(polygon: Polygon): Polygon[];
13
+ }
@@ -0,0 +1,20 @@
1
+ import { Curve2 } from '../../geometry/curve2';
2
+ import { Loop } from '../../topology/loop';
3
+ /**
4
+ *
5
+ * 搜索环
6
+ */
7
+ export declare class SearchLoop2D {
8
+ /**
9
+ * 从输入的有向曲线中找到所有的最小环
10
+ * 条件:曲线已经求交打断过的,且没有同向完全重叠的曲线
11
+ * @param curve2ds 输入的有向曲线
12
+ * @param bMin true -> 找最小环, false -> 找最大环
13
+ * @param distTol 距离容差
14
+ */
15
+ static execute(curve2ds: Curve2[], bMin: boolean, distTol?: number): Loop[];
16
+ private static _findMaxTurning2D;
17
+ private static _getAppropriateUnitStepLength;
18
+ private static _calcStepAngle;
19
+ private static _getAppropriateParamStep;
20
+ }
@@ -0,0 +1,11 @@
1
+ import { Curve2 } from '../../geometry/curve2';
2
+ import { PolyCurve } from '../../topology/polycurve';
3
+ import { Loop } from '../../topology/loop';
4
+ /**
5
+ * 搜索简单Polyline,简单Polyline就是Coedge只在端点处相交,且交点最多连接2条线
6
+ */
7
+ export declare class SearchSimpleLoop {
8
+ static execute(_curve2ds: Curve2[], tolerance?: number): (PolyCurve | Loop)[];
9
+ private static _findAndRemoveLongestCurve;
10
+ private static _findAndRemoveNextCurve;
11
+ }
@@ -0,0 +1,45 @@
1
+ import { Curve2 } from '../geometry/curve2';
2
+ import { Polygon } from '../topology/polygon';
3
+ import { Loop } from '../topology/loop';
4
+ import { PolyCurve } from '../topology/polycurve';
5
+ /**
6
+ * 搜索算法:搜环,搜polygon,搜洞
7
+ */
8
+ declare class SearchGraph {
9
+ /**
10
+ * 从一堆有向的曲线中搜索环
11
+ * @param curves
12
+ * @param bMin true则找到最小环,false则找到最大环
13
+ * @param distanceTol
14
+ */
15
+ static searchLoop2D(curves: Curve2[], bMin: boolean, distanceTol?: number): Loop[];
16
+ /**
17
+ * 搜索简单环
18
+ * 假设输入的曲线中,每个连接点处,最多只有两个曲线
19
+ * @param curves
20
+ * @param polygon
21
+ */
22
+ static simpleLoop(curves: Curve2[], tolerance?: number): (PolyCurve | Loop)[];
23
+ /**
24
+ * 输入一堆线,按包含关系搜索出合法polygon
25
+ * 假设输入的曲线中,每个连接点处,最多只有两个曲线
26
+ * @param curves
27
+ * @param polygon
28
+ */
29
+ static simplePolygon(curves: Curve2[], tolerance?: number): Polygon | undefined;
30
+ /**
31
+ * 根据包含关系,将loop[],组成polygonEx
32
+ * 条件:环之间不相交
33
+ * @param loops
34
+ * @returns polygon[]
35
+ */
36
+ static loopsToPolygonExes(loops: Loop[]): Polygon[];
37
+ /**
38
+ * 根据包含关系,将polygon,组成polygonEx
39
+ * 条件:Polygon环之间不相交
40
+ * @param polygon
41
+ * @returns polygon[]
42
+ */
43
+ static polygonToPolygonExes(polygon: Polygon): Polygon[];
44
+ }
45
+ export { SearchGraph };
@@ -0,0 +1,10 @@
1
+ import { Loop } from '../topology/loop';
2
+ import { Polygon } from '../topology/polygon';
3
+ export declare class TopologyEdit {
4
+ /**
5
+ * 只支持一个外环多个内环,不支持多个外环
6
+ * @param polygon 要分割的polygon
7
+ */
8
+ static splitPolygonRegion(polygon: Polygon): Loop;
9
+ private static _splitLoopLoopRegion;
10
+ }
@@ -0,0 +1,100 @@
1
+ import { Vec } from './vec';
2
+ import { types } from '../type_define/i_types';
3
+ /**
4
+ * AABB包围盒
5
+ */
6
+ export declare abstract class Box<PointType extends Vec> {
7
+ max: PointType;
8
+ min: PointType;
9
+ constructor();
10
+ abstract clone(): Box<PointType>;
11
+ /**
12
+ * 包围盒置空,改变自己
13
+ */
14
+ abstract makeEmpty(): this;
15
+ /**
16
+ * 包围盒扩展,改变自己
17
+ * @param point
18
+ */
19
+ abstract expandByPoint(...point: types.IXY[] | PointType[]): this;
20
+ /**
21
+ * 是否包含点
22
+ * @param point
23
+ * @param tolerance
24
+ */
25
+ abstract containsPt(point: types.IXY | PointType, tolerance: number): boolean;
26
+ /**
27
+ * 计算到点或包围盒的平方距离
28
+ * @param that
29
+ */
30
+ abstract getSquareDistanceTo(that: types.IXY | PointType | Box<PointType>): number;
31
+ /**
32
+ * 根据传入的中心点和包围盒尺寸重置包围盒,改变自己
33
+ * @param center
34
+ * @param size
35
+ */
36
+ abstract setFromCenterAndSize(center: types.IXY | PointType, size: types.IXY | PointType): this;
37
+ /**
38
+ * 获取包围盒的角点
39
+ */
40
+ abstract getCornerPts(): PointType[];
41
+ /**
42
+ * 包围盒扩展,改变自己
43
+ * @param point
44
+ */
45
+ expandByScalar(scale: number): this;
46
+ /**
47
+ * 根据传入的点重置包围盒,改变自己
48
+ * @param points
49
+ */
50
+ setFromPoints(points?: types.IXY[] | PointType[]): this;
51
+ /**
52
+ * 获取中点
53
+ */
54
+ getCenter(): PointType;
55
+ /**
56
+ * 获取包围盒大小,最大点减去最小点
57
+ */
58
+ getSize(): PointType;
59
+ /**
60
+ * 是否包含包围盒
61
+ * @param box
62
+ * @param eps
63
+ */
64
+ containsBox(box: Box<PointType>, eps?: number): boolean;
65
+ /**
66
+ * 是否和另一个包围盒有交
67
+ * @param box
68
+ * @param tolerance
69
+ */
70
+ intersectsBox(box: Box<PointType>, tolerance?: number): boolean;
71
+ /**
72
+ * 包围盒的合并,改变自己
73
+ * @param box
74
+ */
75
+ union(box: Box<PointType>): this;
76
+ /**
77
+ * 包围盒是否退化,即在x、或y、或z方向长度为0
78
+ */
79
+ isZeroSizeBox(): boolean;
80
+ /**
81
+ * 包围盒是否合法,max >= min
82
+ */
83
+ isValid(): boolean;
84
+ /**
85
+ * 包围盒是否相等
86
+ * @param other
87
+ * @param tol
88
+ */
89
+ equals(other: Box<PointType>, tol?: number): boolean;
90
+ /**
91
+ * 包围盒的平移,改变自己
92
+ * @param offset
93
+ */
94
+ translate(offset: types.IXY | PointType): this;
95
+ /**
96
+ * 复制,使得自己和另一个包围盒一样大小,改变自己
97
+ * @param another
98
+ */
99
+ copy(another: Box<PointType>): this;
100
+ }
@@ -0,0 +1,17 @@
1
+ import { Box } from './box';
2
+ import { Vec2 } from './vec2';
3
+ import { types } from '../type_define/i_types';
4
+ /**
5
+ * 二维AABB包围盒
6
+ */
7
+ declare class Box2 extends Box<Vec2> {
8
+ constructor(points?: types.IXY[]);
9
+ makeEmpty(): this;
10
+ getCornerPts(): Vec2[];
11
+ expandByPoint(...points: types.IXY[]): this;
12
+ containsPt(point: types.IXY, tolerance?: number): boolean;
13
+ getSquareDistanceTo(that: types.IXY | Box2): number;
14
+ setFromCenterAndSize(center: types.IXY, size: types.IXY): this;
15
+ clone(): Box2;
16
+ }
17
+ export { Box2 };
@@ -0,0 +1,20 @@
1
+ import { Box } from './box';
2
+ import { Vec3 } from './vec3';
3
+ import { types } from '../type_define/i_types';
4
+ /**
5
+ * 三维AABB包围盒
6
+ */
7
+ declare class Box3 extends Box<Vec3> {
8
+ constructor(points?: types.IXYZ[]);
9
+ makeEmpty(): this;
10
+ /**
11
+ * 前四个点为底面角点,后四个为顶面角点,点顺序为逆时针(从上往下看)
12
+ */
13
+ getCornerPts(): Vec3[];
14
+ expandByPoint(...points: types.IXYZ[]): this;
15
+ containsPt(point: types.IXYZ, tolerance?: number): boolean;
16
+ getSquareDistanceTo(that: types.IXYZ | Box3): number;
17
+ setFromCenterAndSize(center: types.IXYZ, size: types.IXYZ): this;
18
+ clone(): Box3;
19
+ }
20
+ export { Box3 };
@@ -0,0 +1,10 @@
1
+ import { GeoElement } from './geo_element';
2
+ import { Vec } from './vec';
3
+ /**
4
+ * 坐标系
5
+ */
6
+ export declare abstract class Coord<VectorType extends Vec> extends GeoElement {
7
+ constructor();
8
+ abstract getDx(): VectorType;
9
+ abstract getDy(): VectorType;
10
+ }
@@ -0,0 +1,92 @@
1
+ import { Vec2 } from './vec2';
2
+ import { types } from '../type_define/i_types';
3
+ import { EN_GEO_TYPE } from '../type_define/i_element_type';
4
+ import { Coord } from './coord';
5
+ import { Matrix3 } from './matrix3';
6
+ /**
7
+ * 二维坐标系
8
+ */
9
+ export declare class Coord2 extends Coord<Vec2> {
10
+ /**
11
+ * 构造XOY坐标系
12
+ */
13
+ static XOY(): Coord2;
14
+ private _origin;
15
+ private _xDir;
16
+ private _yDir;
17
+ constructor(origin?: types.IXY, xDir?: types.IXY);
18
+ /**
19
+ * 获取X方向
20
+ */
21
+ getDx(): Vec2;
22
+ /**
23
+ * 设置X方向
24
+ * @param v
25
+ */
26
+ setDx(v: types.IXY): void;
27
+ /**
28
+ * 获取Y方向
29
+ */
30
+ getDy(): Vec2;
31
+ /**
32
+ * 获取原点
33
+ */
34
+ getOrigin(): Vec2;
35
+ /**
36
+ * 设置原点
37
+ */
38
+ setOrigin(origin: types.IXY): void;
39
+ /**
40
+ * 将当前坐标系平移,改变自己
41
+ * @param delta
42
+ */
43
+ translate(delta: types.IXY): this;
44
+ /**
45
+ * 坐标系平移,得到一个新的坐标系对象
46
+ * @param delta
47
+ */
48
+ translated(delta: types.IXY): Coord2;
49
+ /**
50
+ * 将当前坐标系变换,改变自己。非等比缩放时,保证 dx 方向能正确变换
51
+ * @param matrix
52
+ */
53
+ transform(matrix: types.IMatrix3 | types.numberArrs3X3): this;
54
+ /**
55
+ * 坐标系变换,得到一个新的坐标系对象。非等比缩放时,保证 dx 方向能正确变换
56
+ * @param matrix
57
+ */
58
+ transformed(matrix: types.IMatrix3 | types.numberArrs3X3): Coord2;
59
+ /**
60
+ * 根据局部坐标系的点获取世界坐标系的点
61
+ * @param uv
62
+ */
63
+ getWorldPtAt(uv: types.IXY): Vec2;
64
+ /**
65
+ * 根据世界坐标系的点获取局部坐标系的点
66
+ * @param worldPt
67
+ */
68
+ getLocalPtAt(worldPt: types.IXY): Vec2;
69
+ /**
70
+ * 根据局部坐标系的向量获取世界坐标系的向量
71
+ * @param localVec
72
+ */
73
+ getWorldVectorAt(localVec: types.IXY): Vec2;
74
+ /**
75
+ * 根据世界坐标系的向量获取局部坐标系的向量
76
+ * @param worldVec
77
+ */
78
+ getLocalVectorAt(worldVec: types.IXY): Vec2;
79
+ /**
80
+ * 构造一个矩阵,将局部坐标系的(x, y)变换到世界坐标系
81
+ */
82
+ getLocalToWorldMatrix(): Matrix3;
83
+ /**
84
+ * 构造一个矩阵,将世界坐标系位置变换到局部坐标系
85
+ */
86
+ getWorldToLocalMatrix(): Matrix3;
87
+ dump(): types.IDBCoordinate2;
88
+ load({ data: [o, x] }: types.IDBCoordinate2): this;
89
+ clone(): Coord2;
90
+ getType(): EN_GEO_TYPE.COORD_2;
91
+ private _updateY;
92
+ }