geometrix 0.5.10 → 0.5.11

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 (90) hide show
  1. package/dist/index.d.ts +505 -0
  2. package/dist/index.js +3848 -0
  3. package/dist/index.js.map +1 -0
  4. package/package.json +6 -1
  5. package/.eslintignore +0 -17
  6. package/.eslintrc.cjs +0 -24
  7. package/.prettierignore +0 -15
  8. package/.prettierrc +0 -8
  9. package/src/aaExportContent.ts +0 -213
  10. package/src/aaExportFile.ts +0 -141
  11. package/src/aaParamGeom.ts +0 -62
  12. package/src/angle_utils.test.ts +0 -83
  13. package/src/angle_utils.ts +0 -98
  14. package/src/arc_to_stroke.ts +0 -73
  15. package/src/canvas_utils.test.ts +0 -28
  16. package/src/canvas_utils.ts +0 -159
  17. package/src/contour.test.ts +0 -37
  18. package/src/contour.ts +0 -806
  19. package/src/designParams.ts +0 -178
  20. package/src/figure.test.ts +0 -21
  21. package/src/figure.ts +0 -400
  22. package/src/index.ts +0 -16
  23. package/src/line.test.ts +0 -78
  24. package/src/line.ts +0 -359
  25. package/src/paramFile.ts +0 -52
  26. package/src/point.test.ts +0 -36
  27. package/src/point.ts +0 -246
  28. package/src/prepare_pax.ts +0 -102
  29. package/src/segment.test.ts +0 -26
  30. package/src/segment.ts +0 -701
  31. package/src/sub_design.ts +0 -16
  32. package/src/triangle_utils.test.ts +0 -38
  33. package/src/triangle_utils.ts +0 -112
  34. package/src/vector.test.ts +0 -28
  35. package/src/vector.ts +0 -122
  36. package/src/volume.ts +0 -50
  37. package/src/write_dxf.ts +0 -100
  38. package/src/write_openjscad.ts +0 -284
  39. package/src/write_openscad.ts +0 -305
  40. package/src/write_pax.ts +0 -73
  41. package/src/write_svg.ts +0 -101
  42. package/svg/any_triangle.svg +0 -156
  43. package/svg/arc_definition.svg +0 -506
  44. package/svg/construct_corner_rounded_ext_arc_ext_arc.svg +0 -378
  45. package/svg/construct_corner_rounded_int_arc_ext_arc.svg +0 -359
  46. package/svg/construct_corner_rounded_int_arc_int_arc.svg +0 -356
  47. package/svg/construct_corner_rounded_stroke_ext_arc.svg +0 -374
  48. package/svg/construct_corner_rounded_stroke_ext_arc_obtuse.svg +0 -370
  49. package/svg/construct_corner_rounded_stroke_ext_arc_obtuse_method2.svg +0 -311
  50. package/svg/construct_corner_rounded_stroke_int_arc.svg +0 -364
  51. package/svg/construct_corner_rounded_stroke_int_arc_obtuse.svg +0 -358
  52. package/svg/construct_corner_rounded_stroke_int_arc_obtuse_method2.svg +0 -237
  53. package/svg/construct_corner_rounded_stroke_stroke.svg +0 -280
  54. package/svg/construct_corner_wideacc.svg +0 -286
  55. package/svg/construct_corner_widened.svg +0 -278
  56. package/svg/construction_of_line_intersection_1.svg +0 -187
  57. package/svg/construction_of_line_intersection_2.svg +0 -189
  58. package/svg/contour_arc_definition_options.svg +0 -324
  59. package/svg/contour_point_absolute_relative.svg +0 -258
  60. package/svg/contour_tangential_two_arcs.svg +0 -531
  61. package/svg/contour_tangential_two_arcs_impossible_case.svg +0 -175
  62. package/svg/contour_tangential_two_arcs_requirements.svg +0 -364
  63. package/svg/corner_rounded_ext_arc_ext_arc.svg +0 -281
  64. package/svg/corner_rounded_int_arc_ext_arc.svg +0 -281
  65. package/svg/corner_rounded_int_arc_int_arc.svg +0 -279
  66. package/svg/corner_rounded_stroke_ext_arc.svg +0 -218
  67. package/svg/corner_rounded_stroke_int_arc.svg +0 -225
  68. package/svg/corner_rounded_stroke_stroke.svg +0 -174
  69. package/svg/geom_dev.svg +0 -14708
  70. package/svg/geom_modules.svg +0 -246
  71. package/svg/geom_user.svg +0 -58
  72. package/svg/line_axis_x_cases.svg +0 -1408
  73. package/svg/line_axis_y_cases.svg +0 -1369
  74. package/svg/line_distanceOrig.svg +0 -318
  75. package/svg/line_getAxisXIntersection.svg +0 -262
  76. package/svg/line_getAxisXIntersection_2.svg +0 -244
  77. package/svg/line_getAxisYIntersection.svg +0 -304
  78. package/svg/line_getAxisYIntersection_2.svg +0 -285
  79. package/svg/line_getAxisYIntersection_3.svg +0 -277
  80. package/svg/line_intersection.svg +0 -346
  81. package/svg/line_projectPoint.svg +0 -311
  82. package/svg/point_1.svg +0 -243
  83. package/svg/point_2.svg +0 -409
  84. package/svg/point_3.svg +0 -298
  85. package/svg/point_4.svg +0 -272
  86. package/svg/point_5.svg +0 -356
  87. package/svg/right_triangle.svg +0 -194
  88. package/svg/vector_definition.svg +0 -130
  89. package/tsconfig.json +0 -13
  90. package/vitest.config.ts +0 -7
@@ -1,374 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <!-- Created with Inkscape (http://www.inkscape.org/) -->
3
-
4
- <svg
5
- width="288.03998"
6
- height="273.62173"
7
- viewBox="0 0 76.210578 72.39575"
8
- version="1.1"
9
- id="svg5"
10
- inkscape:version="1.2.2 (1:1.2.2+202305151914+b0a8486541)"
11
- sodipodi:docname="geom.svg"
12
- inkscape:export-filename="arc_definition.svg"
13
- inkscape:export-xdpi="96"
14
- inkscape:export-ydpi="96"
15
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
16
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
17
- xmlns="http://www.w3.org/2000/svg"
18
- xmlns:svg="http://www.w3.org/2000/svg">
19
- <sodipodi:namedview
20
- id="namedview7"
21
- pagecolor="#ffffff"
22
- bordercolor="#666666"
23
- borderopacity="1.0"
24
- inkscape:showpageshadow="2"
25
- inkscape:pageopacity="0.0"
26
- inkscape:pagecheckerboard="0"
27
- inkscape:deskcolor="#d1d1d1"
28
- inkscape:document-units="px"
29
- showgrid="false"
30
- inkscape:zoom="1.36"
31
- inkscape:cx="333.08824"
32
- inkscape:cy="12727.574"
33
- inkscape:window-width="1366"
34
- inkscape:window-height="836"
35
- inkscape:window-x="0"
36
- inkscape:window-y="0"
37
- inkscape:window-maximized="1"
38
- inkscape:current-layer="layer1"
39
- showguides="true" />
40
- <defs
41
- id="defs2">
42
- <rect
43
- x="64.3368"
44
- y="10503.036"
45
- width="33.572208"
46
- height="27.715706"
47
- id="rect3655" />
48
- <rect
49
- x="209.60191"
50
- y="10739.295"
51
- width="58.998737"
52
- height="31.362017"
53
- id="rect3629" />
54
- <rect
55
- x="441.70547"
56
- y="10454.384"
57
- width="116.48731"
58
- height="28.208582"
59
- id="rect49656" />
60
- <rect
61
- x="367.05576"
62
- y="10442.883"
63
- width="32.882603"
64
- height="25.009695"
65
- id="rect49648" />
66
- <rect
67
- x="450.46594"
68
- y="10459.747"
69
- width="41.233315"
70
- height="38.021324"
71
- id="rect49640" />
72
- <rect
73
- x="86.404892"
74
- y="8251.748"
75
- width="70.081017"
76
- height="57.682091"
77
- id="rect2113-3-6" />
78
- <rect
79
- x="204.84335"
80
- y="8338.3955"
81
- width="83.852852"
82
- height="42.639156"
83
- id="rect2119-6-2" />
84
- <rect
85
- x="343.1825"
86
- y="8353.1172"
87
- width="64.674751"
88
- height="45.493374"
89
- id="rect2125-7-9" />
90
- <rect
91
- x="79.050255"
92
- y="8300.6836"
93
- width="282.30676"
94
- height="47.641037"
95
- id="rect1972-3-27" />
96
- <rect
97
- x="251.71738"
98
- y="8436.2734"
99
- width="62.168148"
100
- height="32.449692"
101
- id="rect9067-0" />
102
- <rect
103
- x="420.70566"
104
- y="8448.9414"
105
- width="77.717155"
106
- height="48.312233"
107
- id="rect9073-9" />
108
- <rect
109
- x="307.06467"
110
- y="8197.7441"
111
- width="48.524952"
112
- height="24.998806"
113
- id="rect2247-3-4-4" />
114
- <rect
115
- x="307.06467"
116
- y="8197.7441"
117
- width="48.524952"
118
- height="24.998806"
119
- id="rect2247-3-7" />
120
- <rect
121
- x="423.24832"
122
- y="10177.365"
123
- width="36.09647"
124
- height="24.909346"
125
- id="rect3942-6" />
126
- <rect
127
- x="441.70547"
128
- y="10454.384"
129
- width="116.48731"
130
- height="28.208582"
131
- id="rect49656-3" />
132
- </defs>
133
- <g
134
- inkscape:label="Layer 1"
135
- inkscape:groupmode="layer"
136
- id="layer1"
137
- transform="translate(-31.958803,-2770.4014)">
138
- <rect
139
- style="fill:#ffffff;stroke:#ffffff;stroke-width:0.264583"
140
- id="rect2407-5-3"
141
- width="75.945992"
142
- height="72.131241"
143
- x="32.091095"
144
- y="2770.5337"
145
- inkscape:export-filename="construct_corner_rounded_stroke_ext_arc.svg"
146
- inkscape:export-xdpi="96"
147
- inkscape:export-ydpi="96" />
148
- <path
149
- style="fill:none;stroke:#e6e6e6;stroke-width:0.264582px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
150
- d="m 38.597089,2832.7123 17.841639,-48.8025"
151
- id="path2057-6-5-7"
152
- sodipodi:nodetypes="cc" />
153
- <path
154
- style="fill:none;stroke:#ffaaaa;stroke-width:0.264583"
155
- id="path32086"
156
- sodipodi:type="arc"
157
- sodipodi:cx="88.992218"
158
- sodipodi:cy="2772.6306"
159
- sodipodi:rx="44.492115"
160
- sodipodi:ry="44.492115"
161
- sodipodi:start="1.2286603"
162
- sodipodi:end="2.926735"
163
- sodipodi:arc-type="arc"
164
- d="m 103.91933,2814.544 a 44.492115,44.492115 0 0 1 -36.526724,-3.016 44.492115,44.492115 0 0 1 -21.869485,-29.4113"
165
- sodipodi:open="true" />
166
- <path
167
- style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
168
- d="m 43.246457,2820.6886 13.42462,-36.7838"
169
- id="path2057-6-5"
170
- sodipodi:nodetypes="cc" />
171
- <text
172
- xml:space="preserve"
173
- transform="matrix(0.26458333,0,0,0.26458333,14.651272,633.8715)"
174
- id="text2111-2-4"
175
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect2113-3-6);display:inline"><tspan
176
- x="86.404297"
177
- y="8264.7246"
178
- id="tspan50130">p1</tspan></text>
179
- <text
180
- xml:space="preserve"
181
- transform="matrix(0.26458333,0,0,0.26458333,-1.0339899,573.7433)"
182
- id="text2117-9-7"
183
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect2119-6-2);display:inline"><tspan
184
- x="204.84375"
185
- y="8351.3711"
186
- id="tspan50132">p2</tspan></text>
187
- <text
188
- xml:space="preserve"
189
- transform="matrix(0.26458333,0,0,0.26458333,10.788956,593.64678)"
190
- id="text2123-1-4"
191
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect2125-7-9);display:inline"><tspan
192
- x="343.18164"
193
- y="8366.0938"
194
- id="tspan50134">p3</tspan></text>
195
- <circle
196
- style="fill:none;stroke:#d45500;stroke-width:0.264583"
197
- id="path2235-2-4"
198
- cx="59.873466"
199
- cy="2806.3718"
200
- r="10.633756" />
201
- <path
202
- style="fill:none;stroke:#b3b3b3;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
203
- d="m 44.409227,2800.6092 23.59958,8.5793"
204
- id="path2239-0-3" />
205
- <path
206
- style="fill:none;stroke:#666666;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
207
- d="m 49.005237,2804.7164 2.05055,0.7503 0.73431,-2.2371"
208
- id="path2251-0-8" />
209
- <text
210
- xml:space="preserve"
211
- transform="matrix(0.26458333,0,0,0.26458333,14.050915,636.53116)"
212
- id="text1970-1-6"
213
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect1972-3-27);display:inline"><tspan
214
- x="79.050781"
215
- y="8313.6602"
216
- id="tspan50136">construct cornerRounded(radius)
217
- </tspan><tspan
218
- x="79.050781"
219
- y="8331.9932"
220
- id="tspan50138">case stroke-ext-arc, acute</tspan></text>
221
- <path
222
- style="fill:none;stroke:#e6e6e6;stroke-width:0.264583"
223
- id="path8778-88"
224
- sodipodi:type="arc"
225
- sodipodi:cx="88.70002"
226
- sodipodi:cy="2772.2446"
227
- sodipodi:rx="33.899853"
228
- sodipodi:ry="33.899853"
229
- sodipodi:start="1.1432914"
230
- sodipodi:end="2.7898327"
231
- sodipodi:arc-type="slice"
232
- d="m 102.75495,2803.0936 a 33.899853,33.899853 0 0 1 -27.123826,0.4305 33.899853,33.899853 0 0 1 -18.755193,-19.5993 l 31.824089,-11.6802 z" />
233
- <path
234
- style="fill:none;stroke:#b3b3b3;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
235
- d="m 88.788323,2772.3449 -50.445205,58.5192"
236
- id="path8881-4"
237
- sodipodi:nodetypes="cc" />
238
- <path
239
- style="fill:none;stroke:#000000;stroke-width:0.264583"
240
- id="path8778-8-3"
241
- sodipodi:type="arc"
242
- sodipodi:cx="88.619835"
243
- sodipodi:cy="2772.0974"
244
- sodipodi:rx="33.899853"
245
- sodipodi:ry="33.899853"
246
- sodipodi:start="1.1432914"
247
- sodipodi:end="2.7898327"
248
- sodipodi:arc-type="arc"
249
- d="m 102.67477,2802.9464 a 33.899853,33.899853 0 0 1 -27.123831,0.4305 33.899853,33.899853 0 0 1 -18.755193,-19.5993"
250
- sodipodi:open="true" />
251
- <path
252
- style="fill:none;stroke:#0000ff;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
253
- d="m 88.904037,2772.4158 -22.03129,25.3246"
254
- id="path9063-1" />
255
- <text
256
- xml:space="preserve"
257
- transform="matrix(0.26458333,0,0,0.26458333,11.017181,553.13546)"
258
- id="text9065-49"
259
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect9067-0);display:inline;fill:#0000ff"><tspan
260
- x="251.7168"
261
- y="8449.25"
262
- id="tspan50140">r2</tspan></text>
263
- <text
264
- xml:space="preserve"
265
- transform="matrix(0.26458333,0,0,0.26458333,-22.047273,535.15488)"
266
- id="text9071-2"
267
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect9073-9);display:inline"><tspan
268
- x="420.70508"
269
- y="8461.918"
270
- id="tspan50142">p5</tspan></text>
271
- <path
272
- style="fill:none;stroke:#ffaaaa;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
273
- d="m 71.090916,2775.189 -16.407247,44.8995"
274
- id="path3938-4"
275
- sodipodi:nodetypes="cc" />
276
- <path
277
- style="fill:none;stroke:#008000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
278
- d="m 66.565755,2798.1885 -6.941267,7.926 -9.76,-3.4511"
279
- id="path2243-5-6"
280
- sodipodi:nodetypes="ccc" />
281
- <text
282
- xml:space="preserve"
283
- transform="matrix(0.26458333,0,0,0.26458333,-17.244895,631.42111)"
284
- id="text2245-69-3"
285
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect2247-3-7);display:inline;fill:#008000"><tspan
286
- x="307.06445"
287
- y="8210.7207"
288
- id="tspan50144">r</tspan></text>
289
- <text
290
- xml:space="preserve"
291
- transform="matrix(0.26458333,0,0,0.26458333,-28.857596,634.55247)"
292
- id="text2245-69-4-1"
293
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect2247-3-4-4);display:inline;fill:#008000"><tspan
294
- x="307.06445"
295
- y="8210.7207"
296
- id="tspan50146">r</tspan></text>
297
- <text
298
- xml:space="preserve"
299
- transform="matrix(0.26458333,0,0,0.26458333,-57.813929,8.148667)"
300
- id="text49638"
301
- style="font-size:12px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect49640);display:inline;fill:#ff00ff"><tspan
302
- x="450.4668"
303
- y="10470.363"
304
- id="tspan50148">1:pA</tspan></text>
305
- <path
306
- style="fill:none;stroke:#ff00ff;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
307
- d="m 69.790516,2779.2154 18.804278,-6.9003"
308
- id="path49644"
309
- sodipodi:nodetypes="cc" />
310
- <text
311
- xml:space="preserve"
312
- transform="matrix(0.26458333,0,0,0.26458333,-21.8352,7.5089036)"
313
- id="text49646"
314
- style="font-size:12px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect49648);display:inline;fill:#ff00ff"><tspan
315
- x="367.05664"
316
- y="10453.5"
317
- id="tspan50150">2:lA5</tspan></text>
318
- <path
319
- style="fill:none;stroke:#ff00ff;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
320
- d="m 68.899338,2781.5614 c 0,0 1.308447,-0.023 1.867522,-0.3167 0.499989,-0.2624 0.947347,-0.6999 1.181867,-1.2136 0.215379,-0.4717 0.13122,-1.5502 0.13122,-1.5502"
321
- id="path49652"
322
- sodipodi:nodetypes="caac" />
323
- <text
324
- xml:space="preserve"
325
- transform="matrix(0.26458333,0,0,0.26458333,-44.305719,12.418213)"
326
- id="text49654"
327
- style="font-size:12px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect49656);display:inline;fill:#ff00ff"><tspan
328
- x="441.70508"
329
- y="10465"
330
- id="tspan50152">4:aA=a125</tspan></text>
331
- <text
332
- xml:space="preserve"
333
- transform="matrix(0.26458333,0,0,0.26458333,-52.17088,113.44065)"
334
- id="text3940-1"
335
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect3942-6);display:inline"><tspan
336
- x="423.24805"
337
- y="10190.342"
338
- id="tspan50154">p7</tspan></text>
339
- <text
340
- xml:space="preserve"
341
- transform="matrix(0.26458333,0,0,0.26458333,-72.990365,17.597804)"
342
- id="text49654-6"
343
- style="font-size:12px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect49656-3);display:inline;fill:#ff00ff"><tspan
344
- x="441.70508"
345
- y="10465"
346
- id="tspan50156">3:a125</tspan></text>
347
- <path
348
- style="fill:none;stroke:#ff00ff;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
349
- d="m 55.67402,2786.3237 c 0,0 1.308447,-0.023 1.867522,-0.3167 0.499989,-0.2624 0.947347,-0.6999 1.181867,-1.2136 0.215379,-0.4717 0.13122,-1.5502 0.13122,-1.5502"
350
- id="path49652-7"
351
- sodipodi:nodetypes="caac" />
352
- <text
353
- xml:space="preserve"
354
- transform="matrix(0.26458333,0,0,0.26458333,-11.484327,-41.433179)"
355
- id="text3627"
356
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect3629);display:inline"><tspan
357
- x="209.60156"
358
- y="10752.272"
359
- id="tspan50158">p8</tspan></text>
360
- <path
361
- style="fill:none;stroke:#ffcc00;stroke-width:0.529167;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
362
- d="m 82.545501,2774.6011 c 0,0 -0.28938,1.3779 0,1.9658 0.298716,0.6069 1.608048,1.2377 1.608048,1.2377"
363
- id="path3633"
364
- sodipodi:nodetypes="cac" />
365
- <text
366
- xml:space="preserve"
367
- transform="matrix(0.26458333,0,0,0.26458333,51.863759,15.992629)"
368
- id="text3653"
369
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect3655);display:inline"><tspan
370
- x="64.335938"
371
- y="10516.012"
372
- id="tspan50160">p9</tspan></text>
373
- </g>
374
- </svg>