Skip to content

Commit 2fcf503

Browse files
Merge pull request #3 from TerribleCoding/dev_1.2
v1.2
2 parents 37ab4e6 + f7947fb commit 2fcf503

5 files changed

Lines changed: 78 additions & 64 deletions

File tree

README.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# AnySection
1+
<img src="assets/ico/tool-logo.png" height="52pt">
22

3-
A powerful web tool for calculating phisical and mechanical properties of standard geometry bars.
3+
AnySection is a powerful web tool for calculating phisical and mechanical properties of standard geometry bars.
44

55
Can be used by designers and engineers as a quick estimation tool, as well as by students as a geometry tool, or simply to find material data from the database.
66

@@ -34,11 +34,12 @@ A button for getting back to the main page is provided on every profile page, di
3434

3535
## Known bugs and issues
3636

37-
#### Ellipse perimeter not precise
37+
#### Ellipse perimeter not exact
3838

39-
The formula used to get the perimeter is not the best available.
40-
The more "squished" the ellipse, the more imprecise the result.
41-
Will be fixed in next versions.
39+
The formula used to get the perimeter is not an exact calculation, however is roughly the best approximation available.
40+
Notice that the more "squished" the ellipse, the more imprecise the result.
41+
The formula has been updated to a better one - this one - in version 1.2 and the approximation is totally suitable for the intended use of this tool.
42+
This might mean that it won't be upgraded to an even more precise calculation (infinite series are not infinite in programming).
4243

4344
## Next improvements to be added
4445

@@ -47,7 +48,6 @@ Note: _The order of this list might not match the order these features will be a
4748
- More materials in the database
4849
- Materials divided in groups, in order to filter the available ones
4950
- Result finder (let the program change an input to return a specific result)
50-
- Limiting inputs to positive values
5151
- Limiting inputs to generate valid geometry (e.g. a tube D=10, t=6 is not valid)
5252
- Canvas to see the shape change dynamically while typing and changing data
5353
- Shape will be downloadable in many file formats, to speed up engineers' work
@@ -72,6 +72,15 @@ _Work Time: 1h_
7272
- Fixed issue #1 - Favicon not working.
7373
- Added a dimension swapper button for rectangles and ellipses. Click it to swap width and height rapidly.
7474

75+
#### v1.2
76+
77+
_Release date: April 25, 2021_
78+
79+
_Work Time: 45min_
80+
81+
- Limited numerical inputs to positive values
82+
- Improved precision for ellipses' perimeter
83+
7584
## Team & Credits
7685

7786
#### Team

index.html

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
1-
<!doctype html>
2-
<html lang="en-US">
3-
4-
<head>
5-
<title>AnySection</title>
6-
<script src="https://cdn.jsdelivr.net/npm/p5@1.3.0/lib/p5.js"></script>
7-
<link rel="stylesheet" type="text/css" href="style.css">
8-
<link rel="icon" type="image/x-icon" href="assets/ico/favicon.ico">
9-
</head>
10-
11-
<body>
12-
<div>
13-
<h1>
14-
<!--AnySection-->
15-
</h1>
16-
<img src="assets/ico/tool-logo.png" alt="AnySection" class="tool-logo">
17-
<h3>Select a profile shape</h3>
18-
</div>
19-
<div class="container" id="container"></div>
20-
<!--
21-
<div class="menu">
22-
<a href="../lang.html"><img src="assets/ico/translate.svg" class="ico"></a>
23-
<a href="pages/math.html"><img src="assets/ico/math.svg" class="ico"></a>
24-
</div>
25-
-->
26-
<script src="script.js"></script>
27-
<div class="copyright">
28-
<p class="copyright">Project developed by</p>
29-
<a href=".." target="_blank">
30-
<img src="assets/ico/TClogo-inline.svg" class="logo">
31-
</a>
32-
<p class="copyright">and hosted on</p>
33-
<a href="https://github.com/TerribleCoding" target="_blank">
34-
<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Logo.png" class="logo">
35-
</a>
36-
<br>
37-
<a href="https://github.com/TerribleCoding/Profiles-Calculator" target="_blank">
38-
<p class="copyright">AnySection v1.1</p>
39-
</a>
40-
<div style="height: 30px;">
41-
<a href="https://www.buymeacoffee.com/terriblecoding" target="_blank">
42-
<img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee"
43-
style="height: 40px !important;">
44-
</a>
45-
</div>
46-
</div>
47-
</body>
48-
1+
<!doctype html>
2+
<html lang="en-US">
3+
4+
<head>
5+
<title>AnySection</title>
6+
<script src="https://cdn.jsdelivr.net/npm/p5@1.3.0/lib/p5.js"></script>
7+
<link rel="stylesheet" type="text/css" href="style.css">
8+
<link rel="icon" type="image/x-icon" href="assets/ico/favicon.ico">
9+
</head>
10+
11+
<body>
12+
<div>
13+
<h1>
14+
<!--AnySection-->
15+
</h1>
16+
<img src="assets/ico/tool-logo.png" alt="AnySection" class="tool-logo">
17+
<h3>Select a profile shape</h3>
18+
</div>
19+
<div class="container" id="container"></div>
20+
<!--
21+
<div class="menu">
22+
<a href="../lang.html"><img src="assets/ico/translate.svg" class="ico"></a>
23+
<a href="pages/math.html"><img src="assets/ico/math.svg" class="ico"></a>
24+
</div>
25+
-->
26+
<script src="script.js"></script>
27+
<div class="copyright">
28+
<p class="copyright">Project developed by</p>
29+
<a href=".." target="_blank">
30+
<img src="assets/ico/TClogo-inline.svg" class="logo">
31+
</a>
32+
<p class="copyright">and hosted on</p>
33+
<a href="https://github.com/TerribleCoding/AnySection" target="_blank">
34+
<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Logo.png" class="logo">
35+
</a>
36+
<br>
37+
<a href="https://github.com/TerribleCoding/AnySection/releases" target="_blank">
38+
<p class="copyright">AnySection v1.2</p>
39+
</a>
40+
<div style="height: 30px;">
41+
<a href="https://www.buymeacoffee.com/terriblecoding" target="_blank">
42+
<img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee"
43+
style="height: 40px !important;">
44+
</a>
45+
</div>
46+
</div>
47+
</body>
48+
4949
</html>

pages/common.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ function preload() {
2727
if (par != null) {
2828
let inp = createInput();
2929
inp.attribute('type', 'number');
30+
inp.attribute('min', '0');
3031
inp.parent(par);
3132
inp.changed(updateResults);
3233
dim[e] = inp;
@@ -37,6 +38,7 @@ function preload() {
3738
if (par != null) {
3839
let inp = createInput();
3940
inp.attribute('type', 'number');
41+
inp.attribute('min', '0');
4042
inp.parent(par);
4143
inp.changed(updateResults);
4244
mat[e] = inp;
@@ -55,11 +57,6 @@ function preload() {
5557
Wb: document.getElementById('resistanceB'),
5658
F: document.getElementById('traction')
5759
}
58-
// for (let p in res) {
59-
// if (res[p] == null) {
60-
// delete res[p];
61-
// }
62-
// }
6360
}
6461

6562
function setup() {

pages/elliptic-bar.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
function Perimeter() {
22
let A = floatElseZero(dim.A.elt.value);
33
let B = floatElseZero(dim.B.elt.value);
4-
return 2 * PI * sqrt((A * A + B * B) / 8);
4+
let a = A / 2;
5+
let b = B / 2;
6+
let h = pow(a - b, 2) / pow(a + b, 2);
7+
let factor = 1 + 3 * h / (10 + sqrt(4 - 3 * h));
8+
return PI * (a + b) * factor;
59
}
610

711
function Area() {

pages/hollow-elliptic-bar.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ function Perimeter() {
22
let A = floatElseZero(dim.A.elt.value);
33
let B = floatElseZero(dim.B.elt.value);
44
let t = floatElseZero(dim.t.elt.value);
5-
let outerSqrt = sqrt((pow(A, 2) + pow(B, 2)) / 8);
6-
let innerSqrt = sqrt((pow(A - 2 * t, 2) + pow(B - 2 * t, 2)) / 8);
7-
return 2 * PI * (outerSqrt + innerSqrt);
5+
let a = A / 2;
6+
let b = B / 2;
7+
let hOut = pow(a - b, 2) / pow(a + b, 2);
8+
let outer = PI * (a + b) * (1 + 3 * hOut / (10 + sqrt(4 - 3 * hOut)));
9+
let hInn = pow(a - b, 2) / pow(a + b - 2 * t, 2);
10+
let inner = PI * (a + b - 2 * t) * (1 + 3 * hInn / (10 + sqrt(4 - 3 * hInn)));
11+
return outer + inner;
812
}
913

1014
function Area() {

0 commit comments

Comments
 (0)