geometrix 0.5.10 → 0.5.12

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 (89) hide show
  1. package/dist/index.d.ts +505 -0
  2. package/dist/index.js +3848 -0
  3. package/package.json +7 -1
  4. package/.eslintignore +0 -17
  5. package/.eslintrc.cjs +0 -24
  6. package/.prettierignore +0 -15
  7. package/.prettierrc +0 -8
  8. package/src/aaExportContent.ts +0 -213
  9. package/src/aaExportFile.ts +0 -141
  10. package/src/aaParamGeom.ts +0 -62
  11. package/src/angle_utils.test.ts +0 -83
  12. package/src/angle_utils.ts +0 -98
  13. package/src/arc_to_stroke.ts +0 -73
  14. package/src/canvas_utils.test.ts +0 -28
  15. package/src/canvas_utils.ts +0 -159
  16. package/src/contour.test.ts +0 -37
  17. package/src/contour.ts +0 -806
  18. package/src/designParams.ts +0 -178
  19. package/src/figure.test.ts +0 -21
  20. package/src/figure.ts +0 -400
  21. package/src/index.ts +0 -16
  22. package/src/line.test.ts +0 -78
  23. package/src/line.ts +0 -359
  24. package/src/paramFile.ts +0 -52
  25. package/src/point.test.ts +0 -36
  26. package/src/point.ts +0 -246
  27. package/src/prepare_pax.ts +0 -102
  28. package/src/segment.test.ts +0 -26
  29. package/src/segment.ts +0 -701
  30. package/src/sub_design.ts +0 -16
  31. package/src/triangle_utils.test.ts +0 -38
  32. package/src/triangle_utils.ts +0 -112
  33. package/src/vector.test.ts +0 -28
  34. package/src/vector.ts +0 -122
  35. package/src/volume.ts +0 -50
  36. package/src/write_dxf.ts +0 -100
  37. package/src/write_openjscad.ts +0 -284
  38. package/src/write_openscad.ts +0 -305
  39. package/src/write_pax.ts +0 -73
  40. package/src/write_svg.ts +0 -101
  41. package/svg/any_triangle.svg +0 -156
  42. package/svg/arc_definition.svg +0 -506
  43. package/svg/construct_corner_rounded_ext_arc_ext_arc.svg +0 -378
  44. package/svg/construct_corner_rounded_int_arc_ext_arc.svg +0 -359
  45. package/svg/construct_corner_rounded_int_arc_int_arc.svg +0 -356
  46. package/svg/construct_corner_rounded_stroke_ext_arc.svg +0 -374
  47. package/svg/construct_corner_rounded_stroke_ext_arc_obtuse.svg +0 -370
  48. package/svg/construct_corner_rounded_stroke_ext_arc_obtuse_method2.svg +0 -311
  49. package/svg/construct_corner_rounded_stroke_int_arc.svg +0 -364
  50. package/svg/construct_corner_rounded_stroke_int_arc_obtuse.svg +0 -358
  51. package/svg/construct_corner_rounded_stroke_int_arc_obtuse_method2.svg +0 -237
  52. package/svg/construct_corner_rounded_stroke_stroke.svg +0 -280
  53. package/svg/construct_corner_wideacc.svg +0 -286
  54. package/svg/construct_corner_widened.svg +0 -278
  55. package/svg/construction_of_line_intersection_1.svg +0 -187
  56. package/svg/construction_of_line_intersection_2.svg +0 -189
  57. package/svg/contour_arc_definition_options.svg +0 -324
  58. package/svg/contour_point_absolute_relative.svg +0 -258
  59. package/svg/contour_tangential_two_arcs.svg +0 -531
  60. package/svg/contour_tangential_two_arcs_impossible_case.svg +0 -175
  61. package/svg/contour_tangential_two_arcs_requirements.svg +0 -364
  62. package/svg/corner_rounded_ext_arc_ext_arc.svg +0 -281
  63. package/svg/corner_rounded_int_arc_ext_arc.svg +0 -281
  64. package/svg/corner_rounded_int_arc_int_arc.svg +0 -279
  65. package/svg/corner_rounded_stroke_ext_arc.svg +0 -218
  66. package/svg/corner_rounded_stroke_int_arc.svg +0 -225
  67. package/svg/corner_rounded_stroke_stroke.svg +0 -174
  68. package/svg/geom_dev.svg +0 -14708
  69. package/svg/geom_modules.svg +0 -246
  70. package/svg/geom_user.svg +0 -58
  71. package/svg/line_axis_x_cases.svg +0 -1408
  72. package/svg/line_axis_y_cases.svg +0 -1369
  73. package/svg/line_distanceOrig.svg +0 -318
  74. package/svg/line_getAxisXIntersection.svg +0 -262
  75. package/svg/line_getAxisXIntersection_2.svg +0 -244
  76. package/svg/line_getAxisYIntersection.svg +0 -304
  77. package/svg/line_getAxisYIntersection_2.svg +0 -285
  78. package/svg/line_getAxisYIntersection_3.svg +0 -277
  79. package/svg/line_intersection.svg +0 -346
  80. package/svg/line_projectPoint.svg +0 -311
  81. package/svg/point_1.svg +0 -243
  82. package/svg/point_2.svg +0 -409
  83. package/svg/point_3.svg +0 -298
  84. package/svg/point_4.svg +0 -272
  85. package/svg/point_5.svg +0 -356
  86. package/svg/right_triangle.svg +0 -194
  87. package/svg/vector_definition.svg +0 -130
  88. package/tsconfig.json +0 -13
  89. package/vitest.config.ts +0 -7
@@ -1,359 +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.03995"
6
- height="312.45416"
7
- viewBox="0 0 76.210569 82.670163"
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.1893044"
31
- inkscape:cx="159.75725"
32
- inkscape:cy="12156.265"
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="false" />
40
- <defs
41
- id="defs2">
42
- <rect
43
- x="86.404892"
44
- y="8251.748"
45
- width="70.081017"
46
- height="57.682091"
47
- id="rect2113-3-7-8-5-2" />
48
- <rect
49
- x="204.84335"
50
- y="8338.3955"
51
- width="83.852852"
52
- height="42.639156"
53
- id="rect2119-6-9-4-2-2" />
54
- <rect
55
- x="343.1825"
56
- y="8353.1172"
57
- width="64.674751"
58
- height="45.493374"
59
- id="rect2125-7-2-5-5-8" />
60
- <rect
61
- x="307.06467"
62
- y="8197.7441"
63
- width="48.524952"
64
- height="24.998806"
65
- id="rect2247-5-0-0-4-9" />
66
- <rect
67
- x="79.050255"
68
- y="8300.6836"
69
- width="260.3663"
70
- height="53.235889"
71
- id="rect1972-3-2-3-7-73" />
72
- <rect
73
- x="251.71738"
74
- y="8436.2734"
75
- width="62.168148"
76
- height="32.449692"
77
- id="rect9067-3-6-4-6" />
78
- <rect
79
- x="420.70566"
80
- y="8448.9414"
81
- width="77.717155"
82
- height="48.312233"
83
- id="rect9073-7-1-4-1" />
84
- <rect
85
- x="439.93347"
86
- y="9157.3789"
87
- width="51.895821"
88
- height="43.12149"
89
- id="rect22942-3-29" />
90
- <rect
91
- x="310.89185"
92
- y="9159.2021"
93
- width="33.538937"
94
- height="27.888342"
95
- id="rect22948-0-3" />
96
- <rect
97
- x="423.24832"
98
- y="10177.365"
99
- width="36.09647"
100
- height="24.909346"
101
- id="rect3942-9-3" />
102
- <rect
103
- x="450.46594"
104
- y="10459.747"
105
- width="41.233315"
106
- height="38.021324"
107
- id="rect49640-2-6-7" />
108
- <rect
109
- x="450.46594"
110
- y="10459.747"
111
- width="59.67897"
112
- height="39.07893"
113
- id="rect49640-2-6-0-3" />
114
- </defs>
115
- <g
116
- inkscape:label="Layer 1"
117
- inkscape:groupmode="layer"
118
- id="layer1"
119
- transform="translate(-38.997169,-3092.3826)">
120
- <path
121
- style="fill:none;stroke:#ffaaaa;stroke-width:0.264583"
122
- id="path2547"
123
- sodipodi:type="arc"
124
- sodipodi:cx="98.240036"
125
- sodipodi:cy="3105.502"
126
- sodipodi:rx="44.61198"
127
- sodipodi:ry="44.61198"
128
- sodipodi:start="1.4477386"
129
- sodipodi:end="3.3695217"
130
- sodipodi:open="true"
131
- sodipodi:arc-type="arc"
132
- d="M 103.71604,3149.7766 A 44.61198,44.61198 0 0 1 65.084611,3135.3507 44.61198,44.61198 0 0 1 54.78188,3095.4214" />
133
- <path
134
- style="fill:none;stroke:#ffaaaa;stroke-width:0.264583"
135
- id="path2596"
136
- sodipodi:type="arc"
137
- sodipodi:cx="84.936226"
138
- sodipodi:cy="3133.6433"
139
- sodipodi:rx="24.395113"
140
- sodipodi:ry="24.395113"
141
- sodipodi:start="2.0848116"
142
- sodipodi:end="4.4609042"
143
- sodipodi:arc-type="arc"
144
- d="M 72.941695,3154.886 A 24.395113,24.395113 0 0 1 60.750982,3130.4503 24.395113,24.395113 0 0 1 78.86569,3110.0156"
145
- sodipodi:open="true" />
146
- <rect
147
- style="fill:#ffffff;stroke:#ffffff;stroke-width:0.264583"
148
- id="rect2407-5-5-0-7-9"
149
- width="75.945992"
150
- height="82.40551"
151
- x="39.129463"
152
- y="3092.5149"
153
- inkscape:export-filename="construct_corner_rounded_int_arc_ext_arc.svg"
154
- inkscape:export-xdpi="96"
155
- inkscape:export-ydpi="96" />
156
- <text
157
- xml:space="preserve"
158
- transform="matrix(0.26458333,0,0,0.26458333,25.767386,963.55315)"
159
- id="text2111-2-2-3-8-7"
160
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect2113-3-7-8-5-2);display:inline"><tspan
161
- x="86.404297"
162
- y="8264.7246"
163
- id="tspan24183">p1</tspan></text>
164
- <text
165
- xml:space="preserve"
166
- transform="matrix(0.26458333,0,0,0.26458333,6.7738878,894.05935)"
167
- id="text2117-9-2-2-6-7"
168
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect2119-6-9-4-2-2);display:inline"><tspan
169
- x="204.84375"
170
- y="8351.3711"
171
- id="tspan24185">p2</tspan></text>
172
- <text
173
- xml:space="preserve"
174
- transform="matrix(0.26458333,0,0,0.26458333,10.587402,926.9404)"
175
- id="text2123-1-8-0-8-6"
176
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect2125-7-2-5-5-8);display:inline"><tspan
177
- x="343.18164"
178
- y="8366.0938"
179
- id="tspan24187">p3</tspan></text>
180
- <text
181
- xml:space="preserve"
182
- transform="matrix(0.26458333,0,0,0.26458333,-16.295394,953.39768)"
183
- id="text2245-6-6-5-4-3"
184
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect2247-5-0-0-4-9);display:inline;fill:#008000"><tspan
185
- x="307.06445"
186
- y="8210.7207"
187
- id="tspan24189">r</tspan></text>
188
- <text
189
- xml:space="preserve"
190
- transform="matrix(0.26458333,0,0,0.26458333,20.638241,967.82202)"
191
- id="text1970-1-2-7-3-6"
192
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect1972-3-2-3-7-73);display:inline"><tspan
193
- x="79.050781"
194
- y="8313.6602"
195
- id="tspan24191">construct cornerRounded(radius)
196
- </tspan><tspan
197
- x="79.050781"
198
- y="8331.9932"
199
- id="tspan24193">case int-arc-ext-arc</tspan></text>
200
- <path
201
- style="fill:none;stroke:#e6e6e6;stroke-width:0.264583"
202
- id="path8778-9-6-1-56"
203
- sodipodi:type="arc"
204
- sodipodi:cx="-2844.4731"
205
- sodipodi:cy="1249.2944"
206
- sodipodi:rx="33.899853"
207
- sodipodi:ry="33.899853"
208
- sodipodi:start="1.1432914"
209
- sodipodi:end="2.7898327"
210
- sodipodi:arc-type="slice"
211
- d="m -2830.4182,1280.1434 a 33.899853,33.899853 0 0 1 -27.1238,0.4305 33.899853,33.899853 0 0 1 -18.7552,-19.5993 l 31.8241,-11.6802 z"
212
- transform="matrix(-0.43078663,-0.90245381,-0.90245381,0.43078663,0,0)"
213
- inkscape:transform-center-x="15.354513"
214
- inkscape:transform-center-y="17.006646" />
215
- <path
216
- style="fill:none;stroke:#b3b3b3;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
217
- d="m 97.709367,3105.1907 -55.07793,36.6486"
218
- id="path8881-3-5-4-3"
219
- sodipodi:nodetypes="cc" />
220
- <path
221
- style="fill:none;stroke:#0000ff;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
222
- d="m 97.917367,3105.2336 -28.57376,18.867"
223
- id="path9063-9-9-2-9"
224
- sodipodi:nodetypes="cc" />
225
- <text
226
- xml:space="preserve"
227
- transform="matrix(0.26458333,0,0,0.26458333,13.840144,878.0628)"
228
- id="text9065-4-3-0-4"
229
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect9067-3-6-4-6);display:inline;fill:#0000ff"><tspan
230
- x="251.7168"
231
- y="8449.25"
232
- id="tspan24195">r3</tspan></text>
233
- <text
234
- xml:space="preserve"
235
- transform="matrix(0.26458333,0,0,0.26458333,-25.774158,896.1245)"
236
- id="text9071-7-7-6-8"
237
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect9073-7-1-4-1);display:inline"><tspan
238
- x="420.70508"
239
- y="8461.918"
240
- id="tspan24197">p4</tspan></text>
241
- <path
242
- style="fill:none;stroke:#e6e6e6;stroke-width:0.264583"
243
- id="path22803-8-1"
244
- sodipodi:type="arc"
245
- sodipodi:cx="-499.63055"
246
- sodipodi:cy="3094.3193"
247
- sodipodi:rx="34.172989"
248
- sodipodi:ry="34.172989"
249
- sodipodi:start="2.9452743"
250
- sodipodi:end="4.2600932"
251
- sodipodi:arc-type="slice"
252
- d="m -533.14713,3100.9851 a 34.172989,34.172989 0 0 1 18.5819,-37.4025 l 14.93468,30.7367 z"
253
- inkscape:transform-center-x="17.15886"
254
- inkscape:transform-center-y="-7.1831739"
255
- transform="rotate(-10.712023)" />
256
- <path
257
- style="fill:none;stroke:#000000;stroke-width:0.264583"
258
- id="path22803-4-9-2"
259
- sodipodi:type="arc"
260
- sodipodi:cx="-499.77805"
261
- sodipodi:cy="3094.2744"
262
- sodipodi:rx="34.172989"
263
- sodipodi:ry="34.172989"
264
- sodipodi:start="2.9452743"
265
- sodipodi:end="4.2600932"
266
- sodipodi:arc-type="arc"
267
- d="m -533.29462,3100.9402 a 34.172989,34.172989 0 0 1 18.5819,-37.4025"
268
- sodipodi:open="true"
269
- inkscape:transform-center-x="27.505905"
270
- inkscape:transform-center-y="-7.1998986"
271
- transform="rotate(-10.712023)" />
272
- <circle
273
- style="fill:none;stroke:#d45500;stroke-width:0.264583"
274
- id="path2235-2-9-6-2-9"
275
- cx="60.747887"
276
- cy="3129.8096"
277
- r="10.633756" />
278
- <path
279
- style="fill:none;stroke:#cccccc;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
280
- d="m 84.451747,3133.488 -48.25955,-7.5588"
281
- id="path22936-6-3"
282
- sodipodi:nodetypes="cc" />
283
- <path
284
- style="fill:none;stroke:#008080;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
285
- d="m 84.465887,3133.7461 -34.25657,-5.6239"
286
- id="path22938-6-9"
287
- sodipodi:nodetypes="cc" />
288
- <text
289
- xml:space="preserve"
290
- transform="matrix(0.26458333,0,0,0.26458333,-43.411233,709.34074)"
291
- id="text22940-4-0"
292
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect22942-3-29);display:inline;fill:#008080"><tspan
293
- x="439.93359"
294
- y="9170.3555"
295
- id="tspan24199">r2</tspan></text>
296
- <text
297
- xml:space="preserve"
298
- transform="matrix(0.26458333,0,0,0.26458333,17.047778,679.11523)"
299
- id="text22946-9-8"
300
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect22948-0-3);display:inline"><tspan
301
- x="310.89258"
302
- y="9172.1797"
303
- id="tspan24201">p5</tspan></text>
304
- <path
305
- style="fill:none;stroke:#000000;stroke-width:0.264583"
306
- id="path8778-8-1-6-9-8"
307
- sodipodi:type="arc"
308
- sodipodi:cx="-2844.0552"
309
- sodipodi:cy="1249.5969"
310
- sodipodi:rx="33.899853"
311
- sodipodi:ry="33.899853"
312
- sodipodi:start="1.1432914"
313
- sodipodi:end="2.7898327"
314
- sodipodi:arc-type="arc"
315
- d="m -2830.0002,1280.4459 a 33.899853,33.899853 0 0 1 -27.1239,0.4305 33.899853,33.899853 0 0 1 -18.7552,-19.5993"
316
- sodipodi:open="true"
317
- transform="matrix(-0.43078663,-0.90245381,-0.90245381,0.43078663,0,0)"
318
- inkscape:transform-center-x="15.40577"
319
- inkscape:transform-center-y="17.36844" />
320
- <text
321
- xml:space="preserve"
322
- transform="matrix(0.26458333,0,0,0.26458333,-56.673705,437.08563)"
323
- id="text3940-2-6"
324
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect3942-9-3);display:inline"><tspan
325
- x="423.24805"
326
- y="10190.342"
327
- id="tspan24203">p7</tspan></text>
328
- <path
329
- style="fill:none;stroke:#ff00ff;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
330
- d="m 84.489546,3133.8456 13.288176,-28.4702"
331
- id="path2694" />
332
- <path
333
- style="fill:none;stroke:#ff00ff;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
334
- d="m 93.30792,3108.3978 c 0,0 0.184524,1.4974 0.713465,1.9379 0.311711,0.2596 1.199248,0.2069 1.199248,0.2069"
335
- id="path2696"
336
- sodipodi:nodetypes="cac" />
337
- <text
338
- xml:space="preserve"
339
- transform="matrix(0.26458333,0,0,0.26458333,-27.90756,353.53109)"
340
- id="text49638-7-2-5"
341
- style="font-size:12px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect49640-2-6-7);display:inline;fill:#ff00ff"><tspan
342
- x="450.4668"
343
- y="10470.363"
344
- id="tspan24205">1:l54</tspan></text>
345
- <text
346
- xml:space="preserve"
347
- transform="matrix(0.26458333,0,0,0.26458333,-22.549817,341.45858)"
348
- id="text49638-7-2-2-5"
349
- style="font-size:12px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect49640-2-6-0-3);display:inline;fill:#ff00ff"><tspan
350
- x="450.4668"
351
- y="10470.363"
352
- id="tspan24207">2:a457</tspan></text>
353
- <path
354
- style="fill:none;stroke:#008000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
355
- d="m 60.871397,3129.8522 8.513515,-5.8334"
356
- id="path2243-3-3-5-8-7"
357
- sodipodi:nodetypes="cc" />
358
- </g>
359
- </svg>