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,225 +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="312.45416"
7
- viewBox="0 0 76.210578 82.670163"
8
- version="1.1"
9
- id="svg5"
10
- inkscape:version="1.2.2 (1:1.2.2+202212051552+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.6819304"
31
- inkscape:cx="244.95663"
32
- inkscape:cy="8505.4055"
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" />
48
- <rect
49
- x="204.84335"
50
- y="8338.3955"
51
- width="83.852852"
52
- height="42.639156"
53
- id="rect2119-6-9" />
54
- <rect
55
- x="343.1825"
56
- y="8353.1172"
57
- width="64.674751"
58
- height="45.493374"
59
- id="rect2125-7-2" />
60
- <rect
61
- x="307.06467"
62
- y="8197.7441"
63
- width="48.524952"
64
- height="24.998806"
65
- id="rect2247-5-0" />
66
- <rect
67
- x="79.050255"
68
- y="8300.6836"
69
- width="229.94412"
70
- height="49.053104"
71
- id="rect1972-3-2" />
72
- <rect
73
- x="251.71738"
74
- y="8436.2734"
75
- width="62.168148"
76
- height="32.449692"
77
- id="rect9067-3" />
78
- <rect
79
- x="420.70566"
80
- y="8448.9414"
81
- width="77.717155"
82
- height="48.312233"
83
- id="rect9073-7" />
84
- </defs>
85
- <g
86
- inkscape:label="Layer 1"
87
- inkscape:groupmode="layer"
88
- id="layer1"
89
- transform="translate(-25.048876,-2293.4939)">
90
- <rect
91
- style="fill:#ffffff;stroke:#ffffff;stroke-width:0.264583"
92
- id="rect2407-5-5"
93
- width="75.945992"
94
- height="82.40551"
95
- x="25.181166"
96
- y="2293.6262"
97
- inkscape:export-filename="corner_rounded_stroke_closing_arc.svg"
98
- inkscape:export-xdpi="96"
99
- inkscape:export-ydpi="96" />
100
- <path
101
- style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
102
- d="M 36.336528,2343.7761 49.76114,2306.9923"
103
- id="path2057-6-9"
104
- sodipodi:nodetypes="cc" />
105
- <text
106
- xml:space="preserve"
107
- transform="matrix(0.26458333,0,0,0.26458333,8.7220642,158.56627)"
108
- id="text2111-2-2"
109
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect2113-3-7);display:inline"><tspan
110
- x="86.404297"
111
- y="8264.7246"
112
- id="tspan50652">p1</tspan></text>
113
- <text
114
- xml:space="preserve"
115
- transform="matrix(0.26458333,0,0,0.26458333,-7.1744059,95.15284)"
116
- id="text2117-9-2"
117
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect2119-6-9);display:inline"><tspan
118
- x="204.84375"
119
- y="8351.3711"
120
- id="tspan50654">p2</tspan></text>
121
- <text
122
- xml:space="preserve"
123
- transform="matrix(0.26458333,0,0,0.26458333,-40.225963,146.84341)"
124
- id="text2123-1-8"
125
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect2125-7-2);display:inline"><tspan
126
- x="343.18164"
127
- y="8366.0938"
128
- id="tspan50656">p3</tspan></text>
129
- <circle
130
- style="fill:none;stroke:#d45500;stroke-width:0.264583"
131
- id="path2235-2-9"
132
- cx="51.869133"
133
- cy="2331.9346"
134
- r="10.633756" />
135
- <path
136
- style="fill:none;stroke:#b3b3b3;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
137
- d="m 36.431928,2326.5153 23.59958,8.5793"
138
- id="path2239-0-7" />
139
- <path
140
- style="fill:none;stroke:#008000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
141
- d="m 51.809528,2332.0343 6.00609,8.7752"
142
- id="path2243-3-3" />
143
- <text
144
- xml:space="preserve"
145
- transform="matrix(0.26458333,0,0,0.26458333,-24.293278,165.76214)"
146
- id="text2245-6-6"
147
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect2247-5-0);display:inline;fill:#008000"><tspan
148
- x="307.06445"
149
- y="8210.7207"
150
- id="tspan50658">r</tspan></text>
151
- <path
152
- style="fill:none;stroke:#666666;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
153
- d="m 41.027938,2330.6225 2.05055,0.7503 0.73431,-2.2371"
154
- id="path2251-0-1" />
155
- <text
156
- xml:space="preserve"
157
- transform="matrix(0.26458333,0,0,0.26458333,6.6899469,168.91551)"
158
- id="text1970-1-2"
159
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect1972-3-2);display:inline"><tspan
160
- x="79.050781"
161
- y="8313.6602"
162
- id="tspan50660">cornerRounded(radius)
163
- </tspan><tspan
164
- x="79.050781"
165
- y="8331.9932"
166
- id="tspan50662">case stroke-int-arc</tspan></text>
167
- <path
168
- style="fill:none;stroke:#e6e6e6;stroke-width:0.264583"
169
- id="path8778-9"
170
- sodipodi:type="arc"
171
- sodipodi:cx="-2083.3591"
172
- sodipodi:cy="-1051.8947"
173
- sodipodi:rx="33.899853"
174
- sodipodi:ry="33.899853"
175
- sodipodi:start="1.1432914"
176
- sodipodi:end="2.7898327"
177
- sodipodi:arc-type="slice"
178
- d="m -2069.3042,-1021.0457 a 33.899853,33.899853 0 0 1 -27.1238,0.4305 33.899853,33.899853 0 0 1 -18.7552,-19.5992 l 31.8241,-11.6803 z"
179
- transform="rotate(-117.49458)"
180
- inkscape:transform-center-x="-16.990157"
181
- inkscape:transform-center-y="-1.8953049" />
182
- <path
183
- style="fill:none;stroke:#b3b3b3;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
184
- d="m 80.254177,2330.1255 -51.310491,3.6469"
185
- id="path8881-3"
186
- sodipodi:nodetypes="cc" />
187
- <path
188
- style="fill:none;stroke:#000000;stroke-width:0.264583"
189
- id="path8778-8-1"
190
- sodipodi:type="arc"
191
- sodipodi:cx="-2083.3904"
192
- sodipodi:cy="-1051.8229"
193
- sodipodi:rx="33.899853"
194
- sodipodi:ry="33.899853"
195
- sodipodi:start="1.1432914"
196
- sodipodi:end="2.7898327"
197
- sodipodi:arc-type="arc"
198
- d="m -2069.3354,-1020.9739 a 33.899853,33.899853 0 0 1 -27.1239,0.4305 33.899853,33.899853 0 0 1 -18.7552,-19.5993"
199
- sodipodi:open="true"
200
- transform="rotate(-117.49458)"
201
- inkscape:transform-center-x="-27.506279"
202
- inkscape:transform-center-y="-1.9007211" />
203
- <path
204
- style="fill:none;stroke:#0000ff;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
205
- d="m 62.499425,2331.2432 -33.565873,2.5222"
206
- id="path9063-9"
207
- sodipodi:nodetypes="cc" />
208
- <text
209
- xml:space="preserve"
210
- transform="matrix(0.26458333,0,0,0.26458333,-31.679394,96.93901)"
211
- id="text9065-4"
212
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect9067-3);display:inline;fill:#0000ff"><tspan
213
- x="251.7168"
214
- y="8449.25"
215
- id="tspan50664">r2</tspan></text>
216
- <text
217
- xml:space="preserve"
218
- transform="matrix(0.26458333,0,0,0.26458333,-85.03675,94.133865)"
219
- id="text9071-7"
220
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect9073-7);display:inline"><tspan
221
- x="420.70508"
222
- y="8461.918"
223
- id="tspan50666">p4</tspan></text>
224
- </g>
225
- </svg>
@@ -1,174 +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="277.27301"
7
- viewBox="0 0 76.210578 73.361816"
8
- version="1.1"
9
- id="svg5"
10
- inkscape:version="1.2.2 (1:1.2.2+202212051552+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.6819304"
31
- inkscape:cx="195.01401"
32
- inkscape:cy="8178.4002"
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="79.050255"
44
- y="8300.6836"
45
- width="229.94412"
46
- height="49.053104"
47
- id="rect1972" />
48
- <rect
49
- x="307.06467"
50
- y="8197.7441"
51
- width="48.524952"
52
- height="24.998806"
53
- id="rect2247" />
54
- <rect
55
- x="343.1825"
56
- y="8353.1172"
57
- width="64.674751"
58
- height="45.493374"
59
- id="rect2125" />
60
- <rect
61
- x="204.84335"
62
- y="8338.3955"
63
- width="83.852852"
64
- height="42.639156"
65
- id="rect2119" />
66
- <rect
67
- x="86.404892"
68
- y="8251.748"
69
- width="70.081017"
70
- height="57.682091"
71
- id="rect2113" />
72
- </defs>
73
- <g
74
- inkscape:label="Layer 1"
75
- inkscape:groupmode="layer"
76
- id="layer1"
77
- transform="translate(-17.660253,-2134.5342)">
78
- <rect
79
- style="fill:#ffffff;stroke:#ffffff;stroke-width:0.264583"
80
- id="rect2407"
81
- width="75.945992"
82
- height="73.097221"
83
- x="17.792545"
84
- y="2134.6665" />
85
- <path
86
- style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
87
- d="m 28.947906,2179.9917 13.424612,-36.7838 37.606816,47.6448"
88
- id="path2057" />
89
- <text
90
- xml:space="preserve"
91
- transform="scale(0.26458333)"
92
- id="text2111"
93
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect2113);display:inline"><tspan
94
- x="86.404297"
95
- y="8264.7246"
96
- id="tspan8515">p1</tspan></text>
97
- <text
98
- xml:space="preserve"
99
- transform="matrix(0.26458333,0,0,0.26458333,-14.563028,-68.631679)"
100
- id="text2117"
101
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect2119);display:inline"><tspan
102
- x="204.84375"
103
- y="8351.3711"
104
- id="tspan8517">p2</tspan></text>
105
- <text
106
- xml:space="preserve"
107
- transform="matrix(0.26458333,0,0,0.26458333,-11.812581,-18.696084)"
108
- id="text2123"
109
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect2125);display:inline"><tspan
110
- x="343.18164"
111
- y="8366.0938"
112
- id="tspan8519">p3</tspan></text>
113
- <circle
114
- style="fill:none;stroke:#d45500;stroke-width:0.264583"
115
- id="path2235"
116
- cx="45.819485"
117
- cy="2164.8347"
118
- r="10.633756" />
119
- <path
120
- style="fill:none;stroke:#cccccc;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
121
- d="m 42.372518,2143.2079 7.34278,49.3147"
122
- id="path2237" />
123
- <path
124
- style="fill:none;stroke:#b3b3b3;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
125
- d="m 30.441879,2159.3157 23.59958,8.5793"
126
- id="path2239" />
127
- <path
128
- style="fill:none;stroke:#b3b3b3;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
129
- d="m 60.239756,2153.1783 -20.609,16.267"
130
- id="path2241" />
131
- <path
132
- style="fill:none;stroke:#008000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
133
- d="m 45.819485,2164.8347 6.00609,8.7752"
134
- id="path2243" />
135
- <text
136
- xml:space="preserve"
137
- transform="matrix(0.26458333,0,0,0.26458333,-30.283322,-1.4377202)"
138
- id="text2245"
139
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect2247);display:inline;fill:#008000"><tspan
140
- x="307.06445"
141
- y="8210.7207"
142
- id="tspan8521">r</tspan></text>
143
- <path
144
- style="fill:none;stroke:#666666;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
145
- d="m 35.037887,2163.4229 2.05055,0.7503 0.734317,-2.2371"
146
- id="path2251" />
147
- <path
148
- style="fill:none;stroke:#666666;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
149
- d="m 52.598768,2159.1564 1.041252,1.3089 1.395198,-1.2941"
150
- id="path2253" />
151
- <path
152
- style="fill:none;stroke:#88aa00;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
153
- d="m 40.041374,2149.8127 c 0,0 0.953149,0.9014 1.560976,0.9574 0.60282,0.055 1.695458,-0.6509 1.695458,-0.6509"
154
- id="path2255"
155
- sodipodi:nodetypes="cac" />
156
- <path
157
- style="fill:none;stroke:#88aa00;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
158
- d="m 43.264568,2148.5278 c 0,0 0.92189,0.2477 1.350238,0.1052 0.489544,-0.1629 1.163399,-1.0209 1.163399,-1.0209"
159
- id="path2304"
160
- sodipodi:nodetypes="cac" />
161
- <text
162
- xml:space="preserve"
163
- transform="matrix(0.26458333,0,0,0.26458333,-0.78654661,1.3918188)"
164
- id="text1970"
165
- style="font-size:14.6667px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect1972);display:inline"><tspan
166
- x="79.050781"
167
- y="8313.6602"
168
- id="tspan8523">cornerRounded(radius)
169
- </tspan><tspan
170
- x="79.050781"
171
- y="8331.9932"
172
- id="tspan8525">case stroke-stroke</tspan></text>
173
- </g>
174
- </svg>