Compare commits
634 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
40579752ab | ||
|
2ef63ddd38 | ||
|
a2cd79cfa7 | ||
|
24cbc8924c | ||
|
98f62e9b29 | ||
|
0c15ed2954 | ||
|
4b663aa563 | ||
|
8caa2f02d6 | ||
|
107837bbdd | ||
|
3ccb725645 | ||
|
426f2623f7 | ||
|
16637b098c | ||
|
e42d70c11e | ||
|
385258bbc9 | ||
|
7db613cef2 | ||
|
6cacd821e8 | ||
|
702a2c9577 | ||
|
132bdba10f | ||
|
3d29408155 | ||
|
9fb90341af | ||
|
3cd041d2bf | ||
|
b0c299e0a4 | ||
|
9210fee4fc | ||
|
f3c39702ac | ||
|
fabdfb6bed | ||
|
b8901a9d3c | ||
|
fb383f787b | ||
|
f64c0b6612 | ||
|
e5e734c440 | ||
|
7b5996c756 | ||
|
2e271bab3c | ||
|
92324ba78f | ||
|
cb2a580de0 | ||
|
4b37babadb | ||
|
982cbefec5 | ||
|
0badb22b54 | ||
|
6c15fc2fe0 | ||
|
7ba82e0279 | ||
|
44857c2875 | ||
|
ce549c54cf | ||
|
5a7fc3130b | ||
|
12c490481a | ||
|
aa82cd4af4 | ||
|
8c6f3aad2d | ||
|
0aa52ae97f | ||
|
3577813f62 | ||
|
3f356e0e7c | ||
|
602c7e6541 | ||
|
a9270db161 | ||
|
7ef6e6fbf7 | ||
|
7e71667694 | ||
|
9556f60050 | ||
|
69cbd7e88a | ||
|
9d751ada18 | ||
|
5d67b717e0 | ||
|
07b95f0240 | ||
|
e7e0494aa1 | ||
|
5fcd2c473e | ||
|
19185c677a | ||
|
64ada004ba | ||
|
1fc7cad25e | ||
|
4e7c46d495 | ||
|
98f6a46c9b | ||
|
1d969a2cd4 | ||
|
48ec27ff2c | ||
|
533a5b2833 | ||
|
e3ff941430 | ||
|
e933aee5a8 | ||
|
f31cfde720 | ||
|
1aeae78e5d | ||
|
7f92f417c5 | ||
|
373e3c3064 | ||
|
8404b3332e | ||
|
bc9818b59b | ||
|
f03296c672 | ||
|
df52a9e52e | ||
|
c335111b44 | ||
|
5212f6ffc4 | ||
|
36b4cdf0d2 | ||
|
aba9f192b9 | ||
|
b7026a1b92 | ||
|
cf70c376ac | ||
|
f8bfe807a0 | ||
|
2f6e3e9252 | ||
|
38fe5aded2 | ||
|
693d5465ba | ||
|
2da3c97212 | ||
|
aa6afab346 | ||
|
3b13717d3d | ||
|
0210035a50 | ||
|
c7dacfddd8 | ||
|
92c32b70a1 | ||
|
6a6b9289af | ||
|
ebf6dc5bca | ||
|
ca40a5c120 | ||
|
5f8e4fed0f | ||
|
4fad8da2fa | ||
|
7488f62df7 | ||
|
33276552e9 | ||
|
58d03af46b | ||
|
df97574a66 | ||
|
ea401ce009 | ||
|
3d3ad1151a | ||
|
918fde08a1 | ||
|
fe27685932 | ||
|
a6131f8da3 | ||
|
103f848a80 | ||
|
e3ef5a3de9 | ||
|
5e0bdc068b | ||
|
939161bdba | ||
|
0309699822 | ||
|
08c51370dd | ||
|
dfec4ba772 | ||
|
8bb38eceb2 | ||
|
00521289f3 | ||
|
4c8c578fbf | ||
|
78b45beaa2 | ||
|
e4ac6dcb98 | ||
|
ea0fee1148 | ||
|
2cd6e31a65 | ||
|
ddbed585b0 | ||
|
81cb948a53 | ||
|
7333d474e1 | ||
|
aa6a1a9453 | ||
|
8a2667b8f1 | ||
|
566acf7a99 | ||
|
954948480b | ||
|
b56c516fe7 | ||
|
78f7b0b4aa | ||
|
0fc52bd023 | ||
|
f9f22d9fc2 | ||
|
348f04b10f | ||
|
19e57f965e | ||
|
86fb7c1279 | ||
|
55400c9d2c | ||
|
1be93b3bb1 | ||
|
a6c3e1ee8a | ||
|
bb686e7077 | ||
|
4123be7a66 | ||
|
f924000a4a | ||
|
8456295e0a | ||
|
d3611493fb | ||
|
91b127210b | ||
|
f599107da2 | ||
|
78a28239dd | ||
|
114cece327 | ||
|
ef9035120d | ||
|
33a09d4332 | ||
|
f29e410654 | ||
|
34dc0d2f3a | ||
|
3704abf382 | ||
|
d258a062ea | ||
|
3330ac3f7d | ||
|
ad5dbbc143 | ||
|
e2eb36bb57 | ||
|
2fc63d1904 | ||
|
1f9ee747ae | ||
|
374000df9c | ||
|
c5bfc89c4a | ||
|
ad07fbe1b5 | ||
|
68afaab061 | ||
|
8b239c22a3 | ||
|
828e3ae5ff | ||
|
275a01396a | ||
|
75284851e9 | ||
|
bf1f3ce23e | ||
|
08a414909e | ||
|
9e0dc10ed4 | ||
|
2f16883109 | ||
|
45ccf8aed3 | ||
|
927d551620 | ||
|
2129c09fb9 | ||
|
76306a2a80 | ||
|
6451029b9f | ||
|
cbea572747 | ||
|
386e8b934e | ||
|
6b906292aa | ||
|
03bca85e34 | ||
|
237232dc07 | ||
|
a3a0767ea3 | ||
|
719217ad6c | ||
|
3c3e2b7356 | ||
|
50903803c3 | ||
|
e6aec7f07e | ||
|
3cb8f8fb7d | ||
|
7a588bb95b | ||
|
8e8a09b030 | ||
|
a1185cc9c7 | ||
|
7dcf44cd67 | ||
|
5e86912b2e | ||
|
6d95a8bf9f | ||
|
d4bec58375 | ||
|
d8dafe7224 | ||
|
4d5cf0e59b | ||
|
eb9b13841f | ||
|
afa3dbcd62 | ||
|
7634a0dd72 | ||
|
4c7ef79c17 | ||
|
4914dda1ac | ||
|
1229716878 | ||
|
e87321fc32 | ||
|
d0712918a2 | ||
|
373f10a52b | ||
|
0edf8c2946 | ||
|
3252461b32 | ||
|
e572b6bf1f | ||
|
25366f54e6 | ||
|
cf1d60045f | ||
|
e145a137f0 | ||
|
0623296ad9 | ||
|
538ed7b38e | ||
|
bc8bf7f67b | ||
|
f5f0c7d5f8 | ||
|
842bb858c0 | ||
|
0205686b9f | ||
|
e6eca1f526 | ||
|
1c43b879f9 | ||
|
89d1233c9f | ||
|
ae217d6426 | ||
|
2760ba2b65 | ||
|
47228742ed | ||
|
e327df46f3 | ||
|
ba71c3099f | ||
|
553e47a010 | ||
|
d2d9a0b48f | ||
|
3ae965216b | ||
|
e83ac7489a | ||
|
a308bc7422 | ||
|
368c6db77e | ||
|
4c6130f851 | ||
|
1a15d307a6 | ||
|
b8295ab5f1 | ||
|
256971467c | ||
|
34303057a2 | ||
|
9fe1994049 | ||
|
bfcd168e4b | ||
|
c8a5993787 | ||
|
f439c17c1f | ||
|
d7d34fa322 | ||
|
32361d57c5 | ||
|
247574c2e4 | ||
|
bd0325979f | ||
|
dace753dde | ||
|
1ba1ceddc7 | ||
|
bfba37c99f | ||
|
ccd0be5551 | ||
|
ff2cf213da | ||
|
10744c9337 | ||
|
b022b859cc | ||
|
0a0f18b323 | ||
|
f266d18efa | ||
|
d86be387f1 | ||
|
4174cde9d8 | ||
|
dc31063b4c | ||
|
1b07f29fa8 | ||
|
a19da610fb | ||
|
c4d1207cf8 | ||
|
9e026d98ee | ||
|
5f816e4d5b | ||
|
25a8c24c4e | ||
|
113a7f876c | ||
|
921e67f511 | ||
|
ed2845a4e8 | ||
|
df4ebba3c3 | ||
|
e6fe09c649 | ||
|
93c53d213d | ||
|
8f770f713b | ||
|
0dacbb8bee | ||
|
83a8382aea | ||
|
8fc3939cae | ||
|
ba29e95bf5 | ||
|
55a8675550 | ||
|
dce3d0018b | ||
|
9f1276d232 | ||
|
1d46034298 | ||
|
76c703dfc2 | ||
|
8957fb0e1d | ||
|
4b539c3b3e | ||
|
1f1744a58e | ||
|
7c14a6339e | ||
|
181602df7a | ||
|
d50bc8d5a8 | ||
|
3a4f168835 | ||
|
daefe1e8d1 | ||
|
d5b232cdb5 | ||
|
c4372b13c8 | ||
|
db6adbb195 | ||
|
aa7be463f8 | ||
|
c7e00eaed5 | ||
|
22d2cfa413 | ||
|
ec399f3926 | ||
|
4708f039fc | ||
|
60ba1b8ae1 | ||
|
7088e1652a | ||
|
0f78b248f6 | ||
|
cc6b19984b | ||
|
355d78da86 | ||
|
3d8b1dcab7 | ||
|
75a95fa8d9 | ||
|
f66c19945f | ||
|
a06f4ad267 | ||
|
e32402649c | ||
|
76c7d15179 | ||
|
132fa734e9 | ||
|
606fd3310c | ||
|
8700b0527c | ||
|
6398003513 | ||
|
e91c1b24ad | ||
|
2a207bf709 | ||
|
86a7f9bb9d | ||
|
a900d5bf3b | ||
|
a226e0a625 | ||
|
d692f700f7 | ||
|
e3e5d91ea9 | ||
|
108450b029 | ||
|
00f1b3a63d | ||
|
993bd617aa | ||
|
4dc5fdd1d9 | ||
|
d98c3ee6f6 | ||
|
6c570ef757 | ||
|
1af801f54a | ||
|
b72ae73c2e | ||
|
b144df1db1 | ||
|
dde70b656c | ||
|
5504ef1b89 | ||
|
d246d4b8f8 | ||
|
65497a1bd2 | ||
|
9927662c90 | ||
|
1be303c2fe | ||
|
a5a477f602 | ||
|
801bc1afae | ||
|
1c2e9b3293 | ||
|
a115f06e7c | ||
|
a9ee80d42f | ||
|
b673a41c4f | ||
|
40d71b3b3f | ||
|
9c4a783f02 | ||
|
16e06de537 | ||
|
8655ab4df4 | ||
|
38717abd1a | ||
|
9ec796696c | ||
|
bbf6f7d5ca | ||
|
2db1b5fedc | ||
|
ef7adbdbc0 | ||
|
76f8debeb2 | ||
|
fd6fce1eae | ||
|
e83fa5f249 | ||
|
db28df088b | ||
|
bf7a481011 | ||
|
4754438be4 | ||
|
fcb0d89a27 | ||
|
a5039c8f5a | ||
|
99e68cfb31 | ||
|
6bda7cc3fa | ||
|
fd5cb7f54c | ||
|
4916d30c08 | ||
|
ade18af430 | ||
|
e9aa9f6c36 | ||
|
e31a7b7883 | ||
|
f25c02a37d | ||
|
d7c9a326cc | ||
|
ee2e4d1c0e | ||
|
fa8a524c90 | ||
|
c718d58e15 | ||
|
c71b612d01 | ||
|
c0c98c125e | ||
|
5dc3132fcf | ||
|
2cde1a5bcb | ||
|
aeda6fc34c | ||
|
9940e18fff | ||
|
f400281c15 | ||
|
749a9a95ae | ||
|
f5b3024b09 | ||
|
8d9f6d5f9b | ||
|
cc38eee4ed | ||
|
86f94d2499 | ||
|
6737b4a43e | ||
|
3dde9f2745 | ||
|
3ac4136043 | ||
|
70879d4c73 | ||
|
840f8df3ae | ||
|
49e13d920a | ||
|
948410ec56 | ||
|
8576d93dd8 | ||
|
47a3f9c155 | ||
|
93c7ea5c9d | ||
|
cfda38c8bd | ||
|
d3640830c4 | ||
|
dac87e49c5 | ||
|
843063db31 | ||
|
30c1e0fb13 | ||
|
8727bfbf8b | ||
|
c12e160e03 | ||
|
110bc5c400 | ||
|
8fdd195949 | ||
|
4c65e12a88 | ||
|
1816aad98e | ||
|
28e8a5c4b2 | ||
|
d849034bc7 | ||
|
2c1f8faa56 | ||
|
b998cc8f32 | ||
|
e126b1af1d | ||
|
b256bf7c90 | ||
|
3c830cc90d | ||
|
76b973d824 | ||
|
90c05523ce | ||
|
0cfa510874 | ||
|
9b6c17ace4 | ||
|
43f84ba478 | ||
|
8ee52bd672 | ||
|
5a15dd9fdb | ||
|
66bb8ef643 | ||
|
4d02e6bb65 | ||
|
681d697840 | ||
|
8a8e28c61d | ||
|
55c2cd6fda | ||
|
273d32dc69 | ||
|
472d5c7ba7 | ||
|
eba7f63576 | ||
|
ec18d2eeeb | ||
|
51e5356f21 | ||
|
582050d096 | ||
|
ed6ddec02c | ||
|
ab0504607d | ||
|
b3ae216b72 | ||
|
a6caaac787 | ||
|
f915b07289 | ||
|
1ff5d848d2 | ||
|
8de9c7f138 | ||
|
92c1667194 | ||
|
e26e6d7472 | ||
|
47b5b91b0a | ||
|
cda26241dd | ||
|
cfa0d211ed | ||
|
0a73460884 | ||
|
774229e3f9 | ||
|
b1c3e371a3 | ||
|
e45c16fe3f | ||
|
2b36c42c99 | ||
|
bec487baba | ||
|
ce0daaf6bc | ||
|
46c25aa51e | ||
|
f542661e2a | ||
|
172e1f8ceb | ||
|
31c6ee8599 | ||
|
d9199bf9ed | ||
|
3b57412108 | ||
|
fd684a10cb | ||
|
aa5fc938d0 | ||
|
691a8f3ff9 | ||
|
e6280ad9f4 | ||
|
6d858125c2 | ||
|
cad5623248 | ||
|
07fd4e47e3 | ||
|
108a232981 | ||
|
912adba419 | ||
|
53a69477d6 | ||
|
5f3bfb391d | ||
|
16509eec6c | ||
|
15a03b7fb2 | ||
|
deec59b408 | ||
|
8fa2de0a60 | ||
|
5d012ece48 | ||
|
b1687bece2 | ||
|
2d9562c8b6 | ||
|
c8e1244651 | ||
|
862fabcd3a | ||
|
1a28d90853 | ||
|
9d1804a4d1 | ||
|
502ef06db2 | ||
|
810f298c70 | ||
|
0408ec9cbe | ||
|
be05e3b68e | ||
|
65119984fd | ||
|
bdb4dace7f | ||
|
4aff538837 | ||
|
c0fb254c43 | ||
|
dd03a9f3db | ||
|
eca1d20c70 | ||
|
d9f065a734 | ||
|
a5d2c24ea1 | ||
|
aa12110504 | ||
|
8f0b40322e | ||
|
d4aaee1db9 | ||
|
ee89119f2f | ||
|
f88b7bf8f3 | ||
|
fbd10cd25d | ||
|
d743f36086 | ||
|
f1eda43ac0 | ||
|
569171971b | ||
|
cb4b3e6685 | ||
|
eaed7ff34f | ||
|
2c00ef8525 | ||
|
17c62ba293 | ||
|
ae78c61491 | ||
|
e9b1e7f61f | ||
|
9ed4e1c42b | ||
|
72197670cb | ||
|
b9d88334c5 | ||
|
937b6a35bd | ||
|
5aec44eba8 | ||
|
2f6a170d2c | ||
|
5fff65c0d1 | ||
|
3aa5d552c0 | ||
|
631d0c8506 | ||
|
5d8abc1028 | ||
|
59ae810383 | ||
|
ccce2706f0 | ||
|
c680780d11 | ||
|
0d829b7185 | ||
|
e3706e1f87 | ||
|
9f1aa6a653 | ||
|
67a7d20880 | ||
|
7cc01a05c6 | ||
|
f9dd9deb53 | ||
|
a747bcff3a | ||
|
d94381dee2 | ||
|
8ef20b16e3 | ||
|
de1d0166e6 | ||
|
eb8305966d | ||
|
2d74627e45 | ||
|
945aeacdc4 | ||
|
17b731ad8f | ||
|
3830a2e523 | ||
|
62840eb510 | ||
|
d6021374ba | ||
|
43e5e66529 | ||
|
dde0156642 | ||
|
edabcb8f79 | ||
|
f7398f0d84 | ||
|
0f37651bc3 | ||
|
2df7a64ad7 | ||
|
0b4097fd09 | ||
|
0bad260d46 | ||
|
e414d2859b | ||
|
c9d0122779 | ||
|
daed828c9a | ||
|
340847cd19 | ||
|
ab99a24352 | ||
|
218db7f7a8 | ||
|
bb8604e42b | ||
|
9182575ff2 | ||
|
ed9477ece5 | ||
|
56d2fb648f | ||
|
057ad863af | ||
|
002711ae3e | ||
|
8a5956e852 | ||
|
0eb1387f27 | ||
|
46dfe4ff25 | ||
|
323e81a82c | ||
|
61c6e9f70d | ||
|
2af270a8da | ||
|
c4c9831798 | ||
|
03ac58acaa | ||
|
2110b9cb31 | ||
|
93d7c0239d | ||
|
5a37620a5b | ||
|
8bc6a0b4c9 | ||
|
06831ffe15 | ||
|
df5775bd05 | ||
|
2d755a6cbf | ||
|
01fc0298f6 | ||
|
a07244fd47 | ||
|
e3443bf0e8 | ||
|
643266f4a3 | ||
|
5a0a4a8fa4 | ||
|
78127faba6 | ||
|
d203fe4030 | ||
|
3be3a271e6 | ||
|
f5d813839b | ||
|
0a604c5793 | ||
|
f1a8d6f0dc | ||
|
af084fb043 | ||
|
0510b18516 | ||
|
78bfb2f31d | ||
|
e185e9b7e9 | ||
|
3fb08570c6 | ||
|
41db148815 | ||
|
beaebfcc37 | ||
|
6493eea0ac | ||
|
6299da9d23 | ||
|
e5850f871d | ||
|
85c75018f1 | ||
|
e84c7bc7a0 | ||
|
f9d609087d | ||
|
14bbb3f205 | ||
|
3376b870a7 | ||
|
90d2f1ac9c | ||
|
fe8256ef0d | ||
|
7351e401c9 | ||
|
e26d1d3233 | ||
|
957e5ab5d5 | ||
|
0218724b48 | ||
|
8983b01b30 | ||
|
7c59a3e11b | ||
|
f433a79c31 | ||
|
700f46bfef | ||
|
e34bc73def | ||
|
cec42209f2 | ||
|
758b14715f | ||
|
f89794e3cc | ||
|
edd022bca2 | ||
|
c5c9ca40c9 | ||
|
423fc36f1c | ||
|
283b091c7c | ||
|
bf0601eaef | ||
|
8c4d2b5333 | ||
|
88b0868358 | ||
|
68ad185712 | ||
|
2e1def3556 | ||
|
9a2e66f999 | ||
|
e1985e85b0 | ||
|
c31145be3b | ||
|
fee00580be | ||
|
5a836b02d6 | ||
|
bec05fb5b4 | ||
|
15c1a98b8d | ||
|
e170918a5d | ||
|
5a7c13a548 | ||
|
f34f2e0bbf | ||
|
f47267c656 | ||
|
2e2079a323 | ||
|
627909fc9e | ||
|
fcddf7b187 | ||
|
eaeb0d1e28 | ||
|
6b64ca01ab | ||
|
df0f293825 | ||
|
37e272e333 | ||
|
799790932e | ||
|
a56d443686 | ||
|
d581e60678 | ||
|
d1ae9174a9 | ||
|
9d63c4ffeb | ||
|
db6c77a523 |
79
README.md
@@ -1,13 +1,15 @@
|
||||
# dotSCAD 1.3
|
||||
# dotSCAD 2.1
|
||||
|
||||
> Reduce the burden of 3D modeling in mathematics. Compatible with OpenSCAD 2015.03 or laters.
|
||||
> **Reduce the burden of 3D modeling in mathematics.**
|
||||
|
||||

|
||||

|
||||
|
||||
[](https://github.com/JustinSDK/lib-openscad/blob/master/LICENSE)
|
||||
[](https://github.com/JustinSDK/lib-openscad/blob/master/LICENSE)
|
||||
|
||||
## Introduction
|
||||
|
||||
**Based on OpenSCAD 2019.05.** For old OpenSCAD versions, please use dotSCAD 1.3. You can download all versions from the [releases](https://github.com/JustinSDK/dotSCAD/releases).
|
||||
|
||||
OpenSCAD uses three library locations, the installation library, built-in library, and user defined libraries. It's convenient to set `OPENSCADPATH`. Check [Setting OPENSCADPATH](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Libraries#Setting_OPENSCADPATH) in [OpenSCAD User Manual/Libraries](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Libraries) for details.
|
||||
|
||||
Every module or function is located in the file which has the same name as the module or the function. For example, if you want to use the `line2d` module to draw a line, `include <line2d.scad>;` first.
|
||||
@@ -16,6 +18,16 @@ Every module or function is located in the file which has the same name as the m
|
||||
|
||||
line2d(p1 = [0, 0], p2 = [5, 0], width = 1);
|
||||
|
||||
Some module files are organized in a directory. For example, px_circle.scad exists in `pixel` directory. You have to prefix the directory name when including `px_circle`.
|
||||
|
||||
include <pixel/px_circle.scad>;
|
||||
points = px_circle(radius = 10);
|
||||
for(pt = points) {
|
||||
translate(pt) square(1);
|
||||
}
|
||||
|
||||
## Dependencies
|
||||
|
||||
Some modules depend on other modules. For example, the `polyline2d` module depends on the `line2d` module, so you also have to `include <line2d.scad>;` besides `include <polyline3d.scad>;`.
|
||||
|
||||
include <line2d.scad>;
|
||||
@@ -23,11 +35,11 @@ Some modules depend on other modules. For example, the `polyline2d` module depen
|
||||
|
||||
polyline2d(points = [[1, 2], [-5, -4], [-5, 3], [5, 5]], width = 1);
|
||||
|
||||
If OpenSCAD generates "WARNING: Ignoring unknown xxx function" or "WARNING: Ignoring unknown xxx module" when using one module of dotSCAD. Just try to `include <xxx.scad>;`.
|
||||
If OpenSCAD generates "WARNING: Ignoring unknown xxx function" or "WARNING: Ignoring unknown xxx module" when using one module of dotSCAD. Just try to `include <xxx.scad>;` or `include <dir/xxx.scad>` if xxx.scad exists in `dir` directory.
|
||||
|
||||
Too many dependencies? Because OpenSCAD doesn't provide namespace management, I personally think that exposing dependencies is better than hiding them. In this way, users can have their own way to manage dependencies. How to categorize dependencies is up to you. For example, you can include your commonly-used modules and functions in "commonly_used.scad" and then `include <commonly_used.scad>;` in the ".scad" file of your project.
|
||||
|
||||
If you really don't want to care about dependencies, `include <dotSCAD.scad>;` or `use <dotSCAD.scad>;` come to save you.
|
||||
**If you really don't want to care about dependencies, `include <dotSCAD.scad>;` or `use <dotSCAD.scad>;` come to save you.**
|
||||
|
||||
## Documentation
|
||||
|
||||
@@ -63,12 +75,9 @@ If you really don't want to care about dependencies, `include <dotSCAD.scad>;` o
|
||||
|
||||
- Functon
|
||||
- [rotate_p](https://openhome.cc/eGossip/OpenSCAD/lib-rotate_p.html)
|
||||
- [sub_str](https://openhome.cc/eGossip/OpenSCAD/lib-sub_str.html)
|
||||
- [split_str](https://openhome.cc/eGossip/OpenSCAD/lib-split_str.html)
|
||||
- [parse_number](https://openhome.cc/eGossip/OpenSCAD/lib-parse_number.html)
|
||||
- [cross_sections](https://openhome.cc/eGossip/OpenSCAD/lib-cross_sections.html)
|
||||
- [paths2sections](https://openhome.cc/eGossip/OpenSCAD/lib-paths2sections.html)
|
||||
- [path_scaling_sections](https://openhome.cc/eGossip/OpenSCAD/lib-path_scaling_sections.html)
|
||||
- [path_scaling_sections](https://openhome.cc/eGossip/OpenSCAD/lib2-path_scaling_sections.html)
|
||||
- [bijection_offset](https://openhome.cc/eGossip/OpenSCAD/lib-bijection_offset.html)
|
||||
- [in_polyline](https://openhome.cc/eGossip/OpenSCAD/lib-in_polyline.html)
|
||||
- [in_shape](https://openhome.cc/eGossip/OpenSCAD/lib-in_shape.html)
|
||||
@@ -79,7 +88,8 @@ If you really don't want to care about dependencies, `include <dotSCAD.scad>;` o
|
||||
- Path
|
||||
- [arc_path](https://openhome.cc/eGossip/OpenSCAD/lib-arc_path.html)
|
||||
- [circle_path](https://openhome.cc/eGossip/OpenSCAD/lib-circle_path.html)
|
||||
- [bezier_curve](https://openhome.cc/eGossip/OpenSCAD/lib-bezier_curve.html)
|
||||
- [bspline_curve](https://openhome.cc/eGossip/OpenSCAD/lib2-bspline_curve.html)
|
||||
- [bezier_curve](https://openhome.cc/eGossip/OpenSCAD/lib-bezier_curve.html)
|
||||
- [bezier_surface](https://openhome.cc/eGossip/OpenSCAD/lib-bezier_surface.html)
|
||||
- [bezier_smooth](https://openhome.cc/eGossip/OpenSCAD/lib-bezier_smooth.html)
|
||||
- [helix](https://openhome.cc/eGossip/OpenSCAD/lib-helix.html)
|
||||
@@ -117,19 +127,46 @@ If you really don't want to care about dependencies, `include <dotSCAD.scad>;` o
|
||||
- [archimedean_spiral_extrude](https://openhome.cc/eGossip/OpenSCAD/lib-archimedean_spiral_extrude.html)
|
||||
- [sphere_spiral_extrude](https://openhome.cc/eGossip/OpenSCAD/lib-sphere_spiral_extrude.html)
|
||||
|
||||
- Utilities
|
||||
- [util/sub_str](https://openhome.cc/eGossip/OpenSCAD/lib2-sub_str.html)
|
||||
- [util/split_str](https://openhome.cc/eGossip/OpenSCAD/lib2-split_str.html)
|
||||
- [util/parse_number](https://openhome.cc/eGossip/OpenSCAD/lib2-parse_number.html)
|
||||
- [util/reverse](https://openhome.cc/eGossip/OpenSCAD/lib2-reverse.html)
|
||||
- [util/slice](https://openhome.cc/eGossip/OpenSCAD/lib2-slice.html)
|
||||
- [util/sort](https://openhome.cc/eGossip/OpenSCAD/lib2-sort.html)
|
||||
- [util/rand](https://openhome.cc/eGossip/OpenSCAD/lib2-rand.html)
|
||||
- [util/fibseq](https://openhome.cc/eGossip/OpenSCAD/lib2-fibseq.html)
|
||||
|
||||
- Matrix
|
||||
- [m_cumulate](https://openhome.cc/eGossip/OpenSCAD/lib-m_cumulate.html)
|
||||
- [m_translation](https://openhome.cc/eGossip/OpenSCAD/lib-m_translation.html)
|
||||
- [m_rotation](https://openhome.cc/eGossip/OpenSCAD/lib-m_rotation.html)
|
||||
- [m_scaling](https://openhome.cc/eGossip/OpenSCAD/lib-m_scaling.html)
|
||||
- [m_mirror](https://openhome.cc/eGossip/OpenSCAD/lib-m_mirror.html)
|
||||
- [m_shearing](https://openhome.cc/eGossip/OpenSCAD/lib-m_shearing.html)
|
||||
- [matrix/m_cumulate](https://openhome.cc/eGossip/OpenSCAD/lib2-m_cumulate.html)
|
||||
- [matrix/m_translation](https://openhome.cc/eGossip/OpenSCAD/lib2-m_translation.html)
|
||||
- [matrix/m_rotation](https://openhome.cc/eGossip/OpenSCAD/lib2-m_rotation.html)
|
||||
- [matrix/m_scaling](https://openhome.cc/eGossip/OpenSCAD/lib2-m_scaling.html)
|
||||
- [matrix/m_mirror](https://openhome.cc/eGossip/OpenSCAD/lib2-m_mirror.html)
|
||||
- [matrix/m_shearing](https://openhome.cc/eGossip/OpenSCAD/lib2-m_shearing.html)
|
||||
|
||||
- Other
|
||||
- [turtle2d](https://openhome.cc/eGossip/OpenSCAD/lib-turtle2d.html)
|
||||
- [turtle3d](https://openhome.cc/eGossip/OpenSCAD/lib-turtle3d.html)
|
||||
- [log](https://openhome.cc/eGossip/OpenSCAD/lib-log.html)
|
||||
- Turtle
|
||||
- [turtle/turtle2d](https://openhome.cc/eGossip/OpenSCAD/lib2-turtle2d.html)
|
||||
- [turtle/turtle3d](https://openhome.cc/eGossip/OpenSCAD/lib2-turtle3d.html)
|
||||
- [turtle/t2d](https://openhome.cc/eGossip/OpenSCAD/lib2-t2d.html)
|
||||
- [turtle/t3d](https://openhome.cc/eGossip/OpenSCAD/lib2-t3d.html)
|
||||
|
||||
- Pixel
|
||||
- [pixel/px_line](https://openhome.cc/eGossip/OpenSCAD/lib2-px_line.html)
|
||||
- [pixel/px_polyline](https://openhome.cc/eGossip/OpenSCAD/lib2-px_polyline.html)
|
||||
- [pixel/px_circle](https://openhome.cc/eGossip/OpenSCAD/lib2-px_circle.html)
|
||||
- [pixel/px_cylinder](https://openhome.cc/eGossip/OpenSCAD/lib2-px_cylinder.html)
|
||||
- [pixel/px_sphere](https://openhome.cc/eGossip/OpenSCAD/lib2-px_sphere.html)
|
||||
- [pixel/px_polygon](https://openhome.cc/eGossip/OpenSCAD/lib2-px_polygon.html)
|
||||
- [pixel/px_from](https://openhome.cc/eGossip/OpenSCAD/lib2-px_from.html)
|
||||
- [pixel/px_ascii](https://openhome.cc/eGossip/OpenSCAD/lib2-px_ascii.html)
|
||||
- [pixel/px_gray](https://openhome.cc/eGossip/OpenSCAD/lib2-px_gray.html)
|
||||
|
||||
- Part
|
||||
- [part/connector_peg](https://openhome.cc/eGossip/OpenSCAD/lib2-connector_peg.html)
|
||||
- [part/cone](https://openhome.cc/eGossip/OpenSCAD/lib2-cone.html)
|
||||
- [part/joint_T](https://openhome.cc/eGossip/OpenSCAD/lib2-joint_T.html)
|
||||
|
||||
## Bugs and Feedback
|
||||
|
||||
For bugs, questions and discussions please use the [Github Issues](https://github.com/JustinSDK/dotSCAD/issues).
|
||||
|
38
RELEASE.md
@@ -1,5 +1,43 @@
|
||||
> Version numbers are based on [Semantic Versioning](https://semver.org/).
|
||||
|
||||
# v2.1
|
||||
- Bugfixes
|
||||
- `bend_extrude`: fix wrong rotation.
|
||||
- `bijection_offset`: fix point order.
|
||||
- New parameters.
|
||||
- `box_extrude`: new `twist` parameter.
|
||||
- `crystall_ball`: new `thickness` parameter.
|
||||
- New modules and functions.
|
||||
- [bspline_curve](https://openhome.cc/eGossip/OpenSCAD/lib2-bspline_curve.html)
|
||||
- [util/rand](https://openhome.cc/eGossip/OpenSCAD/lib2-rand.html)
|
||||
- [util/fibseq](https://openhome.cc/eGossip/OpenSCAD/lib2-fibseq.html)
|
||||
- [pixel/px_from](https://openhome.cc/eGossip/OpenSCAD/lib2-px_from.html)
|
||||
- [pixel/px_ascii](https://openhome.cc/eGossip/OpenSCAD/lib2-px_ascii.html)
|
||||
- [pixel/px_gray](https://openhome.cc/eGossip/OpenSCAD/lib2-px_gray.html)
|
||||
- [part/connector_peg](https://openhome.cc/eGossip/OpenSCAD/lib2-connector_peg.html)
|
||||
- [part/cone](https://openhome.cc/eGossip/OpenSCAD/lib2-cone.html)
|
||||
- [part/joint_T](https://openhome.cc/eGossip/OpenSCAD/lib2-joint_T.html)
|
||||
- [turtle/t2d](https://openhome.cc/eGossip/OpenSCAD/lib2-t2d.html)
|
||||
- [turtle/t3d](https://openhome.cc/eGossip/OpenSCAD/lib2-t3d.html)
|
||||
|
||||
# v2.0
|
||||
- Use new features of OpenSCAD-2019.05 to refactor internal implementation.
|
||||
- Delete the `log` module which is never used.
|
||||
- Directory changed.
|
||||
- `m_cumulate`, `m_mirror`, `m_rotation`, `m_scaling`, `m_shearing` and `m_translation` are moved into the `matrix` directory.
|
||||
- `turtle2d` and `turtle3d` are moved into the `turtle` directory.
|
||||
- `parse_number`, `split_str` and `sub_str` are moved into the `util` directory.
|
||||
- New modules and functions.
|
||||
- [pixel/px_line](https://openhome.cc/eGossip/OpenSCAD/lib2-px_line.html)
|
||||
- [pixel/px_polyline](https://openhome.cc/eGossip/OpenSCAD/lib2-px_polyline.html)
|
||||
- [pixel/px_circle](https://openhome.cc/eGossip/OpenSCAD/lib2-px_circle.html)
|
||||
- [pixel/px_cylinder](https://openhome.cc/eGossip/OpenSCAD/lib2-px_cylinder.html)
|
||||
- [pixel/px_sphere](https://openhome.cc/eGossip/OpenSCAD/lib2-px_sphere.html)
|
||||
- [pixel/px_polygon](https://openhome.cc/eGossip/OpenSCAD/lib2-px_polygon.html)
|
||||
- [util/reverse](https://openhome.cc/eGossip/OpenSCAD/lib2-reverse.html)
|
||||
- [util/slice](https://openhome.cc/eGossip/OpenSCAD/lib2-slice.html)
|
||||
- [util/sort](https://openhome.cc/eGossip/OpenSCAD/lib2-sort.html)
|
||||
|
||||
# v1.3.3
|
||||
- Bugfixes
|
||||
- `in_shape`: Wrong variable name.
|
||||
|
BIN
docs/images/caterpillar.JPG
Normal file
After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
BIN
docs/images/lib2-bspline_curve-1.JPG
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
docs/images/lib2-bspline_curve-2.JPG
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
docs/images/lib2-bspline_curve-3.JPG
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
docs/images/lib2-cone-1.JPG
Normal file
After Width: | Height: | Size: 67 KiB |
BIN
docs/images/lib2-cone-2.JPG
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
docs/images/lib2-cone-3.JPG
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
docs/images/lib2-connector_peg-1.JPG
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
docs/images/lib2-connector_peg-2.JPG
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
docs/images/lib2-connector_peg-3.JPG
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
docs/images/lib2-joint_T-1.JPG
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
docs/images/lib2-joint_T-2.JPG
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
docs/images/lib2-px_ascii-1.JPG
Normal file
After Width: | Height: | Size: 155 KiB |
BIN
docs/images/lib2-px_ascii-2.JPG
Normal file
After Width: | Height: | Size: 61 KiB |
BIN
docs/images/lib2-px_circle-1.JPG
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
docs/images/lib2-px_circle-2.JPG
Normal file
After Width: | Height: | Size: 62 KiB |
BIN
docs/images/lib2-px_cylinder-1.JPG
Normal file
After Width: | Height: | Size: 53 KiB |
BIN
docs/images/lib2-px_cylinder-2.JPG
Normal file
After Width: | Height: | Size: 66 KiB |
BIN
docs/images/lib2-px_from-1.JPG
Normal file
After Width: | Height: | Size: 40 KiB |
BIN
docs/images/lib2-px_from-2.JPG
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
docs/images/lib2-px_from-3.JPG
Normal file
After Width: | Height: | Size: 65 KiB |
BIN
docs/images/lib2-px_gray-1.JPG
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
docs/images/lib2-px_gray-2.JPG
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
docs/images/lib2-px_line-1.JPG
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
docs/images/lib2-px_line-2.JPG
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
docs/images/lib2-px_polygon-1.JPG
Normal file
After Width: | Height: | Size: 71 KiB |
BIN
docs/images/lib2-px_polyline-1.JPG
Normal file
After Width: | Height: | Size: 46 KiB |
BIN
docs/images/lib2-px_polyline-2.JPG
Normal file
After Width: | Height: | Size: 51 KiB |
BIN
docs/images/lib2-px_sphere-1.JPG
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
docs/images/lib2-t2d-1.JPG
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
docs/images/lib2-t2d-2.JPG
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
docs/images/lib2-t3d-1.JPG
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
docs/images/lib2-t3d-2.JPG
Normal file
After Width: | Height: | Size: 73 KiB |
@@ -4,8 +4,6 @@ Extrudes a 2D shape along the path of an archimedean spiral.
|
||||
|
||||
When using this module, you should use points to represent the 2D shape. If your 2D shape is not solid, indexes of triangles are required. See [polysections](https://openhome.cc/eGossip/OpenSCAD/lib-polysections.html) for details.
|
||||
|
||||
Dependencies: `rotate_p`, `archimedean_spiral`, `cross_sections`, `polysections`.
|
||||
|
||||
## Parameters
|
||||
|
||||
- `shape_pts` : A list of points represent a shape. See the example below.
|
||||
|
@@ -5,7 +5,7 @@ Given a set of control points, the `bezier_curve` function returns points of the
|
||||
## Parameters
|
||||
|
||||
- `t_step` : The distance between two points of the Bézier path.
|
||||
- `points` : A set of `[x, y, z]` control points.
|
||||
- `points` : A list of `[x, y]` or `[x, y, z]` control points.
|
||||
|
||||
## Examples
|
||||
|
||||
|
@@ -2,8 +2,6 @@
|
||||
|
||||
Given a path, the `bezier_smooth` function uses bazier curves to smooth all corners. You can use it to create smooth lines or rounded shapes.
|
||||
|
||||
Dependencies: the `bezier_curve` function.
|
||||
|
||||
## Parameters
|
||||
|
||||
- `path_pts` : A list of points represent the path.
|
||||
|
@@ -2,8 +2,6 @@
|
||||
|
||||
Given a set of control points, the `bezier_surface` function returns points of the Bézier surface. Combined with the `function_grapher` module defined in my library, you can create a Bézier surface.
|
||||
|
||||
It depends on the `bezier_curve` function so remember to include bezier_curve.scad.
|
||||
|
||||
## Parameters
|
||||
|
||||
- `t_step` : The distance between two points of the Bézier path.
|
||||
|
@@ -8,6 +8,7 @@ Creates a box (container) from a 2D object.
|
||||
- `shell_thickness` : The thickness between the exterior and interior.
|
||||
- `offset_mode` : `"delta"` (default) or `"r"`. See [offset](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset) for details.
|
||||
- `chamfer` : Default `false`. See [offset](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset) for details.
|
||||
- `twist`, `slices`, `scale`: The same as `linear_extrude`. **Since:** 2.1.
|
||||
|
||||
## Examples
|
||||
|
||||
|
@@ -2,8 +2,6 @@
|
||||
|
||||
Given a 2D shape, points and angles along the path, this function will return all cross-sections. Combined with the `polysections` module, you can create a specific path extrusion.
|
||||
|
||||
It depends on the `rotate_p` function. Remember to include "rotate_p.scad".
|
||||
|
||||
## Parameters
|
||||
|
||||
- `shape_pts`: A list of points represent a shape. See the example below.
|
||||
|
@@ -4,13 +4,12 @@ Uses spherical coordinate system to create a crystal ball.
|
||||
|
||||

|
||||
|
||||
Dependencies: `rotate_p`, `cross_sections`, `polysections`, `ring_extrude`, `shape_pie`.
|
||||
|
||||
## Parameters
|
||||
|
||||
- `radius` : The radial distance r.
|
||||
- `theta` : The azimuthal angle. It defaults to 360. It also accepts a 2 element vector. The first element of the vector is the beginning angle in degrees, and the second element is the ending angle.
|
||||
- `phi` : The polar angle. It defaults to 180. It also accepts a 2 element vector. The first element of the vector is the beginning angle in degrees, and the second element is the ending angle.
|
||||
- `thickness` : The thickness of the ball. **Since:** 2.1.
|
||||
- `$fa`, `$fs`, `$fn` : Check [the circle module](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_the_2D_Subsystem#circle) or [the sphere module](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#sphere) for more details. The final fragments will be a multiple of 4 to fit edges.
|
||||
|
||||
## Examples
|
||||
@@ -19,31 +18,32 @@ Dependencies: `rotate_p`, `cross_sections`, `polysections`, `ring_extrude`, `sha
|
||||
include <cross_sections.scad>;
|
||||
include <polysections.scad>;
|
||||
include <ring_extrude.scad>;
|
||||
include <shape_pie.scad>;
|
||||
include <crystal_ball.scad>;
|
||||
|
||||
|
||||
crystal_ball(radius = 6);
|
||||
|
||||
|
||||
translate([12, 0, 0])
|
||||
crystal_ball(
|
||||
radius = 6,
|
||||
theta = 270,
|
||||
$fn = 12
|
||||
);
|
||||
|
||||
crystal_ball(
|
||||
radius = 6,
|
||||
theta = 270,
|
||||
thickness = 1,
|
||||
$fn = 12
|
||||
);
|
||||
|
||||
translate([24, 0, 0])
|
||||
crystal_ball(
|
||||
radius = 6,
|
||||
theta = 270,
|
||||
phi = 90,
|
||||
$fn = 12
|
||||
);
|
||||
|
||||
crystal_ball(
|
||||
radius = 6,
|
||||
theta = 270,
|
||||
phi = 90,
|
||||
$fn = 12
|
||||
);
|
||||
|
||||
translate([36, 0, 0])
|
||||
crystal_ball(
|
||||
radius = 6,
|
||||
theta = [-30, 270],
|
||||
phi = [30, 60]
|
||||
);
|
||||
crystal_ball(
|
||||
radius = 6,
|
||||
theta = [-30, 270],
|
||||
phi = [30, 60],
|
||||
thickness = 2
|
||||
);
|
||||
|
||||

|
||||
|
@@ -2,8 +2,6 @@
|
||||
|
||||
Given a set of points `[x, y, f(x, y)]` where `f(x, y)` is a mathematics function, the `function_grapher` module can create the graph of `f(x, y)`.
|
||||
|
||||
It depends on the `line3d`, `polyline3d`, `hull_polyline3d` modules so you have to include "line3d.scad", "polyline3d.scad" and "hull_polyline3d.scad".
|
||||
|
||||
## Parameters
|
||||
|
||||
- `points` : A set of points `[x, y, f(x, y)]`. See examples below.
|
||||
|
@@ -4,8 +4,6 @@ Gets all points and angles on the path of a golden spiral based on Fibonacci num
|
||||
|
||||
It returns a vector of `[[x, y], angle]`.
|
||||
|
||||
Because of depending on `circle_path` and `rotate_p`, remember to include "circle_path.scad" and "rotate_p.scad".
|
||||
|
||||
## Parameters
|
||||
|
||||
- `from` : The nth Fibonacci number you wanna start from.
|
||||
|
@@ -4,8 +4,6 @@ Extrudes a 2D shape along the path of a golden spiral.
|
||||
|
||||
When using this module, you should use points to represent the 2D shape. If your 2D shape is not solid, indexes of triangles are required. See [polysections](https://openhome.cc/eGossip/OpenSCAD/lib-polysections.html) for details.
|
||||
|
||||
Dependencies: `circle_path`, `rotate_p`, `golden_spiral`, `cross_sections`, `polysections`.
|
||||
|
||||
## Parameters
|
||||
|
||||
- `shape_pts` : A list of points represent a shape. See the example below.
|
||||
|
@@ -6,8 +6,6 @@ When using this module, you should use points to represent the 2D shape. If your
|
||||
|
||||
Its `$fa`, `$fs` and `$fn` parameters are consistent with the `cylinder` module.
|
||||
|
||||
Dependencies: `helix`, `rotate_p`, `cross_sections`, `polysections`.
|
||||
|
||||
## Parameters
|
||||
|
||||
- `shape_pts` : A list of points represent a shape. See the example below.
|
||||
|
@@ -1,46 +0,0 @@
|
||||
# log
|
||||
|
||||
A log module which supports simple level configurations and color titles.
|
||||
|
||||
## Parameters
|
||||
|
||||
- `$log_level` : The accepted values are `"OFF"` (-1), `"INFO"` (20),
|
||||
`"WARNING"` (30), `"ERROR"` (40) or positive integers. The default value is `"INFO"`.
|
||||
- `level` : The accepted values are `"OFF"` (-1), `"INFO"` (20),
|
||||
`"WARNING"` (30), `"ERROR"` (40) or positive integers. If the value is greater or equal to `$log_level`, the `echo` message will display in the console.
|
||||
- `level_color` : Controls the color of level title. It accepts the same values as the CSS `color` property.
|
||||
|
||||
## Examples
|
||||
|
||||
include <log.scad>;
|
||||
|
||||
log()
|
||||
echo(" INFO message");
|
||||
|
||||
log("WARNING")
|
||||
echo(" WARNING message");
|
||||
|
||||
log("ERROR") {
|
||||
echo(" ERROR message 1");
|
||||
echo(" ERROR message 2");
|
||||
}
|
||||
|
||||

|
||||
|
||||
include <log.scad>;
|
||||
|
||||
$log_level = "WARNING";
|
||||
|
||||
log()
|
||||
echo(" INFO message");
|
||||
|
||||
log("WARNING", "purple")
|
||||
echo(" WARNING message");
|
||||
|
||||
log("ERROR", "rgb(255, 100, 100)") {
|
||||
echo(" ERROR message 1");
|
||||
echo(" ERROR message 2");
|
||||
}
|
||||
|
||||

|
||||
|
@@ -1,16 +0,0 @@
|
||||
# parse_number
|
||||
|
||||
Parses the string argument as an number. It depends on the `split_str` and the `sub_str` functions so remember to include split_str.scad and sub_str.scad.
|
||||
|
||||
## Parameters
|
||||
|
||||
- `t` : A string containing the number representation to be parsed.
|
||||
|
||||
## Examples
|
||||
|
||||
include <sub_str.scad>;
|
||||
include <split_str.scad>;
|
||||
include <parse_number.scad>;
|
||||
|
||||
echo(parse_number("10") + 1); // ECHO: 11
|
||||
echo(parse_number("-1.1") + 1); // ECHO: -0.1
|
@@ -2,8 +2,6 @@
|
||||
|
||||
It extrudes a 2D shape along a path. This module is suitable for a path created by a continuous function.
|
||||
|
||||
It depends on the `rotate_p` function and the `polysections` module. Remember to include "rotate_p.scad" and "polysections.scad".
|
||||
|
||||
When using this module, you should use points to represent the 2D shape. If your 2D shape is not solid, indexes of triangles are required. See [polysections](https://openhome.cc/eGossip/OpenSCAD/lib-polysections.html) for details.
|
||||
|
||||
## Parameters
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# polyline2d
|
||||
|
||||
Creates a polyline from a list of `x`, `y` coordinates. When the end points are `CAP_ROUND`, you can use `$fa`, `$fs` or `$fn` to controll the circle module used internally. It depends on the `line2d` module so you have to `include` line2d.scad.
|
||||
Creates a polyline from a list of `x`, `y` coordinates. When the end points are `CAP_ROUND`, you can use `$fa`, `$fs` or `$fn` to controll the circle module used internally.
|
||||
|
||||
## Parameters
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# polyline3d
|
||||
|
||||
Creates a polyline from a list of `[x, y, z]` coordinates. It depends on the `line3d` module so you have to `include` line3d.scad.
|
||||
Creates a polyline from a list of `[x, y, z]` coordinates.
|
||||
|
||||
## Parameters
|
||||
|
||||
|
@@ -4,8 +4,6 @@ Rotational extrusion spins a 2D shape around the Z-axis. It's similar to the bui
|
||||
|
||||
Because we cannot retrieve the shape points of built-in 2D modules, it's necessary to provide `shapt_pts` and `triangles`.
|
||||
|
||||
This module depends on `rotate_p`, `cross_section` and `polysections`. Remember to include corresponding ".scad".
|
||||
|
||||
If your 2D shape is not solid, indexes of triangles are required. See [polysections](https://openhome.cc/eGossip/OpenSCAD/lib-polysections.html) for details.
|
||||
|
||||
## Parameters
|
||||
|
@@ -2,8 +2,6 @@
|
||||
|
||||
Returns shape points of two glued circles. They can be used with xxx_extrude modules of dotSCAD. The shape points can be also used with the built-in polygon module.
|
||||
|
||||
Dependencies: `rotate_p`, `bezier_curve`, `shape_pie`.
|
||||
|
||||
## Parameters
|
||||
|
||||
- `radius` : The radius of two circles.
|
||||
|
@@ -4,8 +4,6 @@ It extends a 2D stroke along a path to create a 2D shape. This module is suitabl
|
||||
|
||||
When using this function, you should use points to represent the 2D stroke.
|
||||
|
||||
It depends on the `rotate_p` function. Remember to include "rotate_p.scad".
|
||||
|
||||
## Parameters
|
||||
|
||||
- `stroke_pts` : A list of points represent a stroke. See the example below.
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# sphere_spiral
|
||||
|
||||
Creates all points and angles on the path of a spiral around a sphere. It returns a vector of `[[x, y, z], [ax, ay, az]]`. `[x, y, z]` is actually obtained from rotating `[radius, 0, 0]` by `[ax, ay, az]`. It depends on the `rotate_p` function. Remember to include rotate_p.scad first.
|
||||
Creates all points and angles on the path of a spiral around a sphere. It returns a vector of `[[x, y, z], [ax, ay, az]]`. `[x, y, z]` is actually obtained from rotating `[radius, 0, 0]` by `[ax, ay, az]`.
|
||||
|
||||
## Parameters
|
||||
|
||||
|
@@ -4,8 +4,6 @@ Extrudes a 2D shape along the path of a sphere spiral.
|
||||
|
||||
When using this module, you should use points to represent the 2D shape. If your 2D shape is not solid, indexes of triangles are required. See [polysections](https://openhome.cc/eGossip/OpenSCAD/lib-polysections.html) for details.
|
||||
|
||||
Dependencies: `rotate_p`, `sphere_spiral`, `cross_sections`, `polysections`.
|
||||
|
||||
## Parameters
|
||||
|
||||
- `shape_pts` : A list of points represent a shape. See the example below.
|
||||
|
86
docs/lib2-bspline_curve.md
Normal file
@@ -0,0 +1,86 @@
|
||||
# bspline_curve
|
||||
|
||||
[B-spline](https://en.wikipedia.org/wiki/B-spline) interpolation using [de Boor's algorithm](https://en.wikipedia.org/wiki/De_Boor%27s_algorithm). This function returns points of the B-spline path. Combined with the `polyline`, `polyline3d` or `hull_polyline3d` module, you can create a B-spline curve.
|
||||
|
||||
**Since:** 2.1
|
||||
|
||||
## Parameters
|
||||
|
||||
- `t_step` : The increment amount along the curve in the [0, 1] range.
|
||||
- `degree` : The degree of B-spline. Must be less than or equal to `len(points) - 1`.
|
||||
- `points` : A list of `[x, y]` or `[x, y, z]` control points.
|
||||
- `knots` : The knot vector. It's a non-decreasing sequence with length `len(points) + degree + 1`. If not provided, a uniform knot vector is generated automatically.
|
||||
- `weights` : The weights of control points. If not provided, the weight of each point is 1.
|
||||
|
||||
## Examples
|
||||
|
||||
include <bspline_curve.scad>;
|
||||
|
||||
points = [
|
||||
[-10, 0],
|
||||
[-5, 5],
|
||||
[ 5, -5],
|
||||
[ 10, 0]
|
||||
];
|
||||
|
||||
color("red") for(p = points) {
|
||||
translate(p)
|
||||
sphere(0.5);
|
||||
}
|
||||
|
||||
// knots: [0, 1, 2, 3, 4, 5, 6]
|
||||
// weights: [1, 1, 1, 1]
|
||||
for(p = bspline_curve(0.01, 2, points)) {
|
||||
translate(p)
|
||||
sphere(0.1);
|
||||
}
|
||||
|
||||

|
||||
|
||||
include <bspline_curve.scad>;
|
||||
|
||||
points = [
|
||||
[-10, 0],
|
||||
[-5, 5],
|
||||
[ 5, -5],
|
||||
[ 10, 0]
|
||||
];
|
||||
|
||||
// a non-uniform B-spline curve
|
||||
knots = [0, 1/8, 1/4, 1/2, 3/4, 4/5, 1];
|
||||
|
||||
color("red") for(p = points) {
|
||||
translate(p)
|
||||
sphere(0.5);
|
||||
}
|
||||
|
||||
for(p = bspline_curve(0.01, 2, points, knots)) {
|
||||
translate(p)
|
||||
sphere(0.1);
|
||||
}
|
||||
|
||||

|
||||
|
||||
include <bspline_curve.scad>;
|
||||
|
||||
points = [
|
||||
[-10, 0],
|
||||
[-5, 5],
|
||||
[ 5, -5],
|
||||
[ 10, 0]
|
||||
];
|
||||
|
||||
// For a clamped B-spline curve, the first `degree + 1` and the last `degree + 1` knots must be identical.
|
||||
knots = [0, 0, 0, 1, 2, 2, 2];
|
||||
|
||||
color("red") for(p = points) {
|
||||
translate(p)
|
||||
sphere(0.5);
|
||||
}
|
||||
|
||||
for(p = bspline_curve(0.01, 2, points, knots)) {
|
||||
translate(p)
|
||||
sphere(0.1);
|
||||
}
|
||||
|
||||

|
67
docs/lib2-cone.md
Normal file
@@ -0,0 +1,67 @@
|
||||
# cone
|
||||
|
||||
Create a cone for rotatable models.
|
||||
|
||||

|
||||
|
||||
**Since:** 2.1
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
- `radius` : The radius of the cone.
|
||||
- `length` : The length of the cone.
|
||||
- `spacing` : The spacing between the cone and void component. Default to `0.5`.
|
||||
- `angle` : The angle between the bottom and hypotenuse. Default to `50` degree.
|
||||
- `void` : The void component for differencing. It's used to create a cavity for a cone. Default to `false`.
|
||||
- `ends` : Default to `false`. To create a double-ended cone, set it to `true`.
|
||||
|
||||
## Examples
|
||||
|
||||
include <part/cone.scad>;
|
||||
|
||||
radius = 2.5;
|
||||
length = 2;
|
||||
spacing = 0.5;
|
||||
|
||||
$fn = 48;
|
||||
|
||||
cone(
|
||||
radius = radius,
|
||||
spacing = spacing,
|
||||
length = 2
|
||||
);
|
||||
|
||||
%cone(
|
||||
radius = radius,
|
||||
spacing = spacing,
|
||||
length = 2,
|
||||
void = true
|
||||
);
|
||||
|
||||

|
||||
|
||||
include <part/cone.scad>;
|
||||
|
||||
radius = 2.5;
|
||||
length = 2;
|
||||
spacing = 0.5;
|
||||
|
||||
$fn = 48;
|
||||
|
||||
cone(
|
||||
radius = radius,
|
||||
spacing = spacing,
|
||||
length = 2,
|
||||
ends = true
|
||||
);
|
||||
|
||||
%cone(
|
||||
radius = radius,
|
||||
spacing = spacing,
|
||||
length = 2,
|
||||
void = true,
|
||||
ends = true
|
||||
);
|
||||
|
||||

|
60
docs/lib2-connector_peg.md
Normal file
@@ -0,0 +1,60 @@
|
||||
# connector_peg
|
||||
|
||||
Create a connector peg.
|
||||
|
||||

|
||||
|
||||
**Since:** 2.1
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
- `radius` : The shaft radius of the peg.
|
||||
- `height` : The height of the pag. Default to `2.5 * radius`.
|
||||
- `spacing` : The spacing between the peg and void component. Default to `0.5`.
|
||||
- `void` : The void component for differencing. It's used to create a cavity for a peg. Default to `false`.
|
||||
- `ends` : Default to `false`. To create a double-ended peg, set it to `true`.
|
||||
|
||||
## Examples
|
||||
|
||||
include <part/connector_peg.scad>;
|
||||
|
||||
radius = 2.5;
|
||||
spacing = 0.5;
|
||||
|
||||
$fn = 48;
|
||||
|
||||
connector_peg(
|
||||
radius = radius,
|
||||
spacing = spacing
|
||||
);
|
||||
|
||||
%connector_peg(
|
||||
radius = radius,
|
||||
spacing = spacing,
|
||||
void = true
|
||||
);
|
||||
|
||||

|
||||
|
||||
include <part/connector_peg.scad>;
|
||||
|
||||
radius = 2.5;
|
||||
spacing = 0.5;
|
||||
|
||||
$fn = 48;
|
||||
|
||||
connector_peg(
|
||||
radius = radius,
|
||||
spacing = spacing,
|
||||
ends = true
|
||||
);
|
||||
|
||||
%connector_peg(
|
||||
radius = radius,
|
||||
spacing = spacing,
|
||||
ends = true,
|
||||
void = true
|
||||
);
|
||||
|
||||

|
16
docs/lib2-fibseq.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# fibseq
|
||||
|
||||
Generate a Fibonacci sequence.
|
||||
|
||||
**Since:**: 2.1
|
||||
|
||||
## Parameters
|
||||
|
||||
- `from` : The nth Fibonacci number you wanna start from.
|
||||
- `to` : The nth Fibonacci number you wanna go to.
|
||||
|
||||
## Examples
|
||||
|
||||
include <util/fibseq.scad>;
|
||||
|
||||
echo(fibseq(1, 10)); // ECHO: [1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
|
32
docs/lib2-joint_T.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# joint_T
|
||||
|
||||
Create a joint_T for rotatable models.
|
||||
|
||||

|
||||
|
||||
**Since:** 2.1
|
||||
|
||||
## Parameters
|
||||
|
||||
- `shaft_r` : The shaft radius of the joint_T.
|
||||
- `shaft_h` : The height of the shaft.
|
||||
- `t_leng` : The length of the T part.
|
||||
- `thickness` : The thicnkess of the ring.
|
||||
- `spacing` : The spacing between the shaft and the ring. Default to `0.5`.
|
||||
- `center` : `false` (default) for z ranges from 0 to `shaft_h`. `true` for z ranges from `-shaft_h / 2` to `shaft_h / 2`.
|
||||
|
||||
## Examples
|
||||
|
||||
include <part/joint_T.scad>;
|
||||
|
||||
$fn = 48;
|
||||
|
||||
joint_T(
|
||||
shaft_r = 2,
|
||||
shaft_h = 15,
|
||||
t_leng = 15,
|
||||
thickness = 2,
|
||||
spacing = 0.5
|
||||
);
|
||||
|
||||

|
@@ -6,14 +6,16 @@ The power of using transformation matrice is that you can cumulate all transform
|
||||
|
||||
## Parameters
|
||||
|
||||
The dir changed since 2.0.
|
||||
|
||||
- `matrice` : A list of 4x4 transformation matrice.
|
||||
|
||||
## Examples
|
||||
|
||||
include <m_rotation.scad>;
|
||||
include <m_scaling.scad>;
|
||||
include <m_translation.scad>;
|
||||
include <m_cumulate.scad>
|
||||
include <matrix/m_rotation.scad>;
|
||||
include <matrix/m_scaling.scad>;
|
||||
include <matrix/m_translation.scad>;
|
||||
include <matrix/m_cumulate.scad>
|
||||
|
||||
m = m_cumulate([
|
||||
m_translation([10, 20, 10]), m_scaling(2), m_rotation(60)]
|
25
docs/lib2-m_mirror.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# m_mirror
|
||||
|
||||
The dir changed since 2.0.
|
||||
|
||||
Generate a 4x4 transformation matrix which can pass into `multmatrix` to mirror the child element on a plane through the origin.
|
||||
|
||||
**Since:** 1.1
|
||||
|
||||
## Parameters
|
||||
|
||||
- `v` : The normal vector of a plane intersecting the origin through which to mirror the object.
|
||||
|
||||
## Examples
|
||||
|
||||
include <matrix/m_mirror.scad>;
|
||||
|
||||
rotate([0, 0, 10])
|
||||
cube([3, 2, 1]);
|
||||
|
||||
multmatrix(m_mirror([1, 1, 0]))
|
||||
rotate([0, 0, 10])
|
||||
cube([3, 2, 1]);
|
||||
|
||||

|
||||
|
@@ -1,5 +1,7 @@
|
||||
# m_rotation
|
||||
|
||||
The dir changed since 2.0.
|
||||
|
||||
Generate a 4x4 transformation matrix which can pass into `multmatrix` to rotate the child element about the axis of the coordinate system or around an arbitrary axis.
|
||||
|
||||
**Since:** 1.1
|
||||
@@ -11,7 +13,7 @@ Generate a 4x4 transformation matrix which can pass into `multmatrix` to rotate
|
||||
|
||||
## Examples
|
||||
|
||||
include <m_rotation.scad>;
|
||||
include <matrix/m_rotation.scad>;
|
||||
|
||||
point = [20, 0, 0];
|
||||
a = [0, -45, 45];
|
@@ -1,5 +1,7 @@
|
||||
# m_scaling
|
||||
|
||||
The dir changed since 2.0.
|
||||
|
||||
Generate a 4x4 transformation matrix which can pass into `multmatrix` to scale its child elements using the specified vector.
|
||||
|
||||
**Since:** 1.1
|
||||
@@ -10,7 +12,7 @@ Generate a 4x4 transformation matrix which can pass into `multmatrix` to scale i
|
||||
|
||||
## Examples
|
||||
|
||||
include <m_scaling.scad>;
|
||||
include <matrix/m_scaling.scad>;
|
||||
|
||||
cube(10);
|
||||
translate([15, 0, 0])
|
@@ -1,5 +1,7 @@
|
||||
# m_shearing
|
||||
|
||||
The dir changed since 2.0.
|
||||
|
||||
Generate a 4x4 transformation matrix which can pass into `multmatrix` to shear all child elements along the X-axis, Y-axis, or Z-axis in 3D.
|
||||
|
||||
**Since:** 1.1
|
||||
@@ -12,7 +14,7 @@ Generate a 4x4 transformation matrix which can pass into `multmatrix` to shear a
|
||||
|
||||
## Examples
|
||||
|
||||
include <m_shearing.scad>;
|
||||
include <matrix/m_shearing.scad>;
|
||||
|
||||
color("red") {
|
||||
multmatrix(m_shearing(sx = [1, 0]))
|
@@ -1,5 +1,7 @@
|
||||
# m_translation
|
||||
|
||||
The dir changed since 2.0.
|
||||
|
||||
Generate a 4x4 transformation matrix which can pass into `multmatrix` to translates (moves) its child elements along the specified vector.
|
||||
|
||||
**Since:** 1.1
|
||||
@@ -10,7 +12,7 @@ Generate a 4x4 transformation matrix which can pass into `multmatrix` to transla
|
||||
|
||||
## Examples
|
||||
|
||||
include <m_translation.scad>;
|
||||
include <matrix/m_translation.scad>;
|
||||
|
||||
cube(2, center = true);
|
||||
multmatrix(m_translation([5, 0, 0]))
|
18
docs/lib2-parse_number.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# parse_number
|
||||
|
||||
The dir changed since 2.0.
|
||||
|
||||
Parses the string argument as an number.
|
||||
|
||||
## Parameters
|
||||
|
||||
- `t` : A string containing the number representation to be parsed.
|
||||
|
||||
## Examples
|
||||
|
||||
include <util/sub_str.scad>;
|
||||
include <util/split_str.scad>;
|
||||
include <util/parse_number.scad>;
|
||||
|
||||
echo(parse_number("10") + 1); // ECHO: 11
|
||||
echo(parse_number("-1.1") + 1); // ECHO: -0.1
|
@@ -18,7 +18,6 @@ You can use any point as the first point of the edge path. Just remember that yo
|
||||
include <hull_polyline3d.scad>;
|
||||
include <shape_taiwan.scad>;
|
||||
include <path_scaling_sections.scad>;
|
||||
include <m_scaling.scad>;
|
||||
include <polysections.scad>;
|
||||
|
||||
taiwan = shape_taiwan(100);
|
||||
@@ -42,7 +41,6 @@ You can use any point as the first point of the edge path. Just remember that yo
|
||||
include <hull_polyline3d.scad>;
|
||||
include <shape_taiwan.scad>;
|
||||
include <path_scaling_sections.scad>;
|
||||
include <m_scaling.scad>;
|
||||
include <polysections.scad>;
|
||||
include <bezier_curve.scad>;
|
||||
|
||||
@@ -67,7 +65,6 @@ You can use any point as the first point of the edge path. Just remember that yo
|
||||
|
||||
include <shape_taiwan.scad>;
|
||||
include <path_scaling_sections.scad>;
|
||||
include <m_scaling.scad>;
|
||||
include <polysections.scad>;
|
||||
include <bezier_curve.scad>;
|
||||
include <rotate_p.scad>;
|
||||
@@ -105,7 +102,6 @@ You can use any point as the first point of the edge path. Just remember that yo
|
||||
include <hull_polyline3d.scad>;
|
||||
include <shape_taiwan.scad>;
|
||||
include <path_scaling_sections.scad>;
|
||||
include <m_scaling.scad>;
|
||||
include <polysections.scad>;
|
||||
include <rotate_p.scad>;
|
||||
|
42
docs/lib2-px_ascii.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# px_ascii
|
||||
|
||||
Generate 8x8 pixel points of printable ASCII characters (codes 32dec to 126dec). You can use these points to build pixel-style models.
|
||||
|
||||
**Since:** 2.1
|
||||
|
||||
## Parameters
|
||||
|
||||
- `char` : A printable ASCII character.
|
||||
- `center`: . If `true`, object is centered in X- and Y-axis. Otherwise, the object is placed in the positive quadrant. Defaults to `false`.
|
||||
- `invert`: Inverts points of the character. Default to `false`.
|
||||
|
||||
## Examples
|
||||
|
||||
include <pixel/px_from.scad>;
|
||||
include <pixel/px_ascii.scad>;
|
||||
|
||||
for(i = [0:94]) {
|
||||
translate([8 * (i % 10), -8 * floor(i / 10), 0])
|
||||
for(p = px_ascii(chr(i + 32))) {
|
||||
translate(p)
|
||||
linear_extrude(1, scale = 0.8)
|
||||
square(1);
|
||||
}
|
||||
}
|
||||
|
||||

|
||||
|
||||
include <pixel/px_from.scad>;
|
||||
include <pixel/px_ascii.scad>;
|
||||
|
||||
t = "dotSCAD";
|
||||
|
||||
for(i = [0:len(t) - 1]) {
|
||||
translate([i * 8, 0])
|
||||
for(pt = px_ascii(t[i], invert = true)) {
|
||||
translate(pt)
|
||||
sphere(0.5, $fn = 24);
|
||||
}
|
||||
}
|
||||
|
||||

|
32
docs/lib2-px_circle.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# px_circle
|
||||
|
||||
Returns points that can be used to draw a pixel-style circle.
|
||||
|
||||
**Since:** 2.0
|
||||
|
||||
## Parameters
|
||||
|
||||
- `radius` : The circle radius. The value must be an integer.
|
||||
- `filled` : Default to `false`. Set it `true` if you want a filled circle.
|
||||
|
||||
## Examples
|
||||
|
||||
include <pixel/px_circle.scad>;
|
||||
|
||||
for(pt = px_circle(10)) {
|
||||
translate(pt)
|
||||
square(1, center = true);
|
||||
}
|
||||
|
||||

|
||||
|
||||
include <pixel/px_circle.scad>;
|
||||
|
||||
for(pt = px_circle(10, filled = true)) {
|
||||
translate(pt)
|
||||
linear_extrude(1, scale = 0.5)
|
||||
square(1, center = true);
|
||||
}
|
||||
|
||||

|
||||
|
33
docs/lib2-px_cylinder.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# px_cylinder
|
||||
|
||||
Returns points that can be used to draw a pixel-style cylinder.
|
||||
|
||||
**Since:** 2.0
|
||||
|
||||
## Parameters
|
||||
|
||||
- `radius` : The radius of the cylinder. It also accepts a vector `[r1, r2]`. `r1` is the bottom radius and `r2` is the top radius of a cone. Values must be an integer.
|
||||
- `h` : The height of the cylinder or cone.
|
||||
- `filled` : Default to `false`. Set it `true` if you want a filled cylinder.
|
||||
- `thickness`: Default to 1. The thickness when `filled` is `false`. The value must be an integer.
|
||||
|
||||
## Examples
|
||||
|
||||
include <pixel/px_cylinder.scad>;
|
||||
|
||||
for(pt = px_cylinder([10, 15], 10)) {
|
||||
translate(pt)
|
||||
cube(1, center = true);
|
||||
}
|
||||
|
||||

|
||||
|
||||
include <pixel/px_cylinder.scad>;
|
||||
|
||||
for(pt = px_cylinder([20, 15], h = 10, thickness = 3)) {
|
||||
translate(pt)
|
||||
cube(1, center = true);
|
||||
}
|
||||
|
||||

|
||||
|
108
docs/lib2-px_from.md
Normal file
@@ -0,0 +1,108 @@
|
||||
# px_from
|
||||
|
||||
Given a list of 0s and 1s that represent a black-and-white image. This function translates them into pixel points. You can use these points to build pixel-style models.
|
||||
|
||||
**Since:** 2.1
|
||||
|
||||
## Parameters
|
||||
|
||||
- `binaries` : A list of 0s and 1s.
|
||||
- `center`: . If `true`, object is centered in X- and Y-axis. Otherwise, the object is placed in the positive quadrant. Defaults to `false`.
|
||||
- `invert`: Inverts how binaries are translated into points. Default to `false`. 1s are translated into points. Otherwise, 0s are translated into points.
|
||||
|
||||
## Examples
|
||||
|
||||
include <pixel/px_from.scad>;
|
||||
|
||||
pts = px_from([
|
||||
[0,0,0,0,0,0,0,0],
|
||||
[0,0,0,1,1,0,0,0],
|
||||
[0,0,1,1,1,1,0,0],
|
||||
[0,1,1,0,0,1,1,0],
|
||||
[0,1,1,0,0,1,1,0],
|
||||
[0,1,1,1,1,1,1,0],
|
||||
[0,1,1,0,0,1,1,0],
|
||||
[0,0,0,0,0,0,0,0]
|
||||
]);
|
||||
|
||||
for(pt = pts) {
|
||||
translate(pt) square(1);
|
||||
}
|
||||
|
||||
translate([8, 0]) for(pt = pts) {
|
||||
translate(pt) text("A", font="Arial Black", 1);
|
||||
}
|
||||
|
||||

|
||||
|
||||
I provide a tool [img2binary](https://github.com/JustinSDK/img2binary) for converting an image into 0 and 1. A black and white picture is suggested. 0 is for black and 1 is for white. Given an image like this:
|
||||
|
||||

|
||||
|
||||
The tool converts it into binaries. Combined with the `pixel_from`, you can build a model like this:
|
||||
|
||||
include <pixel/px_from.scad>;
|
||||
|
||||
pts = px_from([
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1],
|
||||
[1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1],
|
||||
[1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1],
|
||||
[1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1],
|
||||
[1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1],
|
||||
[1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1],
|
||||
[1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1],
|
||||
[1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1],
|
||||
[1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1],
|
||||
[1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1],
|
||||
[1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1],
|
||||
[1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
|
||||
], invert = true);
|
||||
|
||||
for(pt = pts) {
|
||||
translate(pt) sphere(.5, $fn = 24);
|
||||
}
|
||||
|
||||

|
187
docs/lib2-px_gray.md
Normal file
@@ -0,0 +1,187 @@
|
||||
# px_gray
|
||||
|
||||
Given a list of numbers (0 ~ 255) that represent a gray image. This function translates them into a list of `[x, y, level]`s.
|
||||
|
||||
**Since:** 2.1
|
||||
|
||||
## Parameters
|
||||
|
||||
- `levels` : A list of numbers (0 ~ 255).
|
||||
- `center`: . If `true`, object is centered in X- and Y-axis. Otherwise, the object is placed in the positive quadrant. Defaults to `false`.
|
||||
- `invert`: Inverts the `level` value of the returned `[x, y, value]`. Default to `false`.
|
||||
- `normalize`: Normalize the `level` value of the returned `[x, y, value]`. Default to `false`. If it's `true`, the `level` value ranges from 0 to 1.
|
||||
|
||||
## Examples
|
||||
|
||||
include <pixel/px_gray.scad>;
|
||||
|
||||
levels = [
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 170, 170, 170, 170, 170, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 170, 170, 170, 170, 170, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 0, 0, 0, 170, 170, 170, 170, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 170, 170, 170, 170, 170, 170, 170, 170, 170, 0, 0, 0, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 0, 0, 0, 170, 170, 170, 170, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 170, 170, 170, 170, 170, 170, 170, 170, 170, 0, 0, 0, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 0, 0, 0, 170, 170, 170, 170, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 170, 170, 170, 170, 170, 170, 170, 170, 170, 0, 0, 0, 255, 255, 255, 255],
|
||||
[255, 255, 0, 0, 170, 170, 170, 170, 170, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 0, 0, 255, 255],
|
||||
[255, 255, 0, 0, 170, 170, 170, 170, 170, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 0, 0, 255, 255],
|
||||
[255, 255, 0, 0, 170, 170, 170, 85, 85, 85, 85, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 85, 85, 85, 85, 85, 170, 170, 170, 170, 170, 170, 170, 0, 0, 255, 255],
|
||||
[255, 255, 0, 0, 170, 170, 170, 85, 85, 85, 85, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 85, 85, 85, 85, 85, 170, 170, 170, 170, 170, 170, 170, 0, 0, 255, 255],
|
||||
[0, 0, 85, 85, 85, 85, 85, 85, 85, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 0, 0],
|
||||
[0, 0, 85, 85, 85, 85, 85, 85, 85, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 0, 0],
|
||||
[0, 0, 85, 85, 85, 85, 85, 85, 85, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 0, 0],
|
||||
[0, 0, 85, 85, 85, 85, 85, 85, 85, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 85, 85, 85, 85, 85, 170, 170, 170, 170, 170, 85, 85, 0, 0],
|
||||
[0, 0, 85, 85, 85, 85, 85, 85, 85, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 85, 85, 85, 85, 85, 170, 170, 170, 170, 170, 85, 85, 0, 0],
|
||||
[0, 0, 170, 170, 85, 85, 85, 85, 85, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 85, 85, 85, 170, 170, 170, 170, 170, 170, 170, 170, 170, 0, 0],
|
||||
[0, 0, 170, 170, 85, 85, 85, 85, 85, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 85, 85, 85, 170, 170, 170, 170, 170, 170, 170, 170, 170, 0, 0],
|
||||
[0, 0, 170, 170, 170, 170, 170, 85, 85, 85, 85, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 85, 85, 85, 85, 85, 170, 170, 170, 170, 170, 170, 170, 170, 170, 0, 0],
|
||||
[0, 0, 170, 170, 170, 170, 170, 85, 85, 85, 85, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 85, 85, 85, 85, 85, 170, 170, 170, 170, 170, 170, 170, 170, 170, 0, 0],
|
||||
[0, 0, 170, 170, 170, 170, 170, 85, 85, 85, 85, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 85, 85, 85, 85, 85, 170, 170, 170, 170, 170, 170, 170, 170, 170, 0, 0],
|
||||
[0, 0, 170, 170, 170, 170, 170, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 170, 170, 170, 170, 170, 85, 85, 0, 0],
|
||||
[0, 0, 170, 170, 170, 170, 170, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 170, 170, 170, 170, 170, 85, 85, 0, 0],
|
||||
[0, 0, 170, 170, 85, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 85, 85, 85, 85, 85, 85, 0, 0],
|
||||
[0, 0, 170, 170, 85, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 85, 85, 85, 85, 85, 85, 0, 0],
|
||||
[0, 0, 170, 170, 85, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 85, 85, 85, 85, 85, 85, 0, 0],
|
||||
[255, 255, 0, 0, 0, 0, 0, 0, 0, 170, 170, 170, 170, 170, 0, 0, 170, 170, 170, 170, 170, 0, 0, 170, 170, 170, 170, 170, 0, 0, 0, 0, 0, 0, 0, 255, 255],
|
||||
[255, 255, 0, 0, 0, 0, 0, 0, 0, 170, 170, 170, 170, 170, 0, 0, 170, 170, 170, 170, 170, 0, 0, 170, 170, 170, 170, 170, 0, 0, 0, 0, 0, 0, 0, 255, 255],
|
||||
[255, 255, 255, 255, 0, 0, 0, 170, 170, 170, 170, 170, 170, 170, 0, 0, 170, 170, 170, 170, 170, 0, 0, 170, 170, 170, 170, 170, 170, 170, 0, 0, 0, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 0, 0, 0, 170, 170, 170, 170, 170, 170, 170, 0, 0, 170, 170, 170, 170, 170, 0, 0, 170, 170, 170, 170, 170, 170, 170, 0, 0, 0, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 0, 0, 0, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 0, 0, 0, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 0, 0, 0, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 0, 0, 0, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 0, 0, 0, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 0, 0, 0, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 0, 0, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 0, 0, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 0, 0, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 0, 0, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255]
|
||||
];
|
||||
|
||||
dots = px_gray(levels, center = true);
|
||||
for(dot = dots) {
|
||||
g = 1 - dot[1] / 255;
|
||||
h = dot[1] / 85;
|
||||
color([g, g, g])
|
||||
translate(dot[0])
|
||||
linear_extrude(h)
|
||||
square(1);
|
||||
}
|
||||
|
||||

|
||||
|
||||
I provide a tool [img2gray](https://github.com/JustinSDK/img2gray) for converting an image into data required by this function. Given an image like this:
|
||||
|
||||

|
||||
|
||||
After converting the image, use the data in the text file as the `levels` value of `pixel_gray`, you can build a model like this:
|
||||
|
||||
include <pixel/px_gray.scad>;
|
||||
|
||||
levels = [
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 180, 219, 255, 255, 224, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 85, 62, 173, 255, 255, 222, 154, 168, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 147, 16, 73, 166, 190, 8, 17, 99, 97, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 151, 11, 26, 153, 111, 61, 58, 40, 128, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 137, 73, 74, 154, 131, 24, 18, 95, 192, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 217, 153, 162, 152, 97, 82, 120, 155, 66, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 194, 146, 146, 131, 118, 96, 75, 46, 46, 191, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 185, 139, 130, 117, 99, 78, 53, 38, 64, 168, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 194, 108, 102, 95, 74, 60, 38, 47, 89, 85, 153, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 101, 77, 67, 52, 38, 48, 82, 109, 73, 48, 222, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 225, 70, 40, 42, 57, 84, 107, 92, 62, 38, 164, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 215, 100, 89, 102, 115, 91, 72, 44, 47, 105, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 112, 114, 102, 86, 68, 51, 41, 66, 101, 94, 140, 194, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 156, 93, 80, 65, 51, 36, 59, 97, 100, 69, 49, 110, 93, 223, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 222, 70, 54, 47, 45, 69, 96, 110, 91, 58, 40, 92, 76, 70, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 226, 225, 222, 141, 104, 111, 140, 144, 109, 77, 41, 49, 87, 64, 42, 197, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 221, 227, 223, 224, 228, 227, 220, 166, 129, 116, 46, 74, 89, 42, 40, 155, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 224, 224, 224, 224, 227, 223, 169, 130, 129, 129, 88, 100, 58, 37, 62, 176, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 227, 222, 226, 226, 226, 226, 216, 134, 130, 127, 130, 118, 76, 42, 54, 92, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 225, 226, 223, 228, 225, 228, 221, 182, 131, 131, 129, 128, 112, 41, 56, 95, 182, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 202, 212, 209, 212, 220, 225, 225, 153, 129, 125, 127, 130, 120, 86, 118, 208, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 176, 176, 193, 191, 198, 201, 209, 134, 129, 128, 128, 127, 128, 185, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 154, 149, 152, 166, 168, 174, 181, 130, 128, 131, 131, 123, 128, 125, 189, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 142, 116, 123, 128, 138, 140, 145, 136, 128, 124, 131, 128, 130, 131, 133, 222, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 206, 184, 224, 178, 158, 145, 108, 124, 131, 125, 130, 131, 129, 127, 130, 130, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 225, 221, 226, 224, 222, 102, 100, 128, 131, 125, 127, 128, 128, 127, 129, 144, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 227, 224, 227, 224, 194, 125, 117, 122, 128, 128, 124, 130, 128, 126, 129, 132, 145, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 227, 225, 228, 224, 169, 128, 129, 95, 92, 127, 132, 124, 130, 130, 123, 127, 129, 172, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 229, 227, 226, 227, 222, 136, 128, 122, 88, 83, 106, 128, 127, 133, 123, 132, 130, 128, 129, 185, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 229, 223, 219, 219, 216, 205, 199, 196, 188, 179, 192, 212, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 227, 225, 226, 225, 207, 131, 129, 124, 80, 80, 82, 103, 131, 126, 126, 131, 128, 129, 128, 130, 200, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 225, 225, 224, 224, 224, 224, 223, 219, 215, 205, 201, 194, 183, 176, 158, 162, 210, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 226, 224, 224, 228, 174, 128, 126, 207, 178, 89, 84, 84, 115, 129, 126, 125, 127, 127, 127, 127, 134, 226, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 226, 222, 227, 225, 222, 227, 227, 225, 223, 224, 223, 220, 215, 208, 196, 192, 179, 171, 168, 146, 138, 195, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 225, 225, 225, 225, 229, 144, 132, 132, 255, 255, 164, 77, 82, 83, 114, 129, 128, 129, 131, 129, 126, 124, 142, 255, 255, 255, 255, 255, 255, 255, 255, 255, 229, 222, 226, 225, 222, 224, 223, 225, 223, 222, 223, 224, 226, 221, 214, 209, 204, 192, 188, 179, 160, 160, 144, 134, 137, 225, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 224, 225, 226, 227, 211, 131, 130, 149, 255, 255, 255, 140, 79, 85, 82, 127, 126, 126, 129, 129, 128, 127, 124, 154, 255, 255, 255, 255, 255, 255, 255, 255, 228, 225, 221, 219, 219, 218, 220, 222, 222, 223, 223, 220, 223, 223, 219, 217, 203, 195, 191, 183, 174, 160, 150, 135, 128, 113, 186, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 228, 225, 224, 226, 187, 132, 131, 186, 255, 255, 255, 255, 122, 80, 85, 89, 124, 131, 127, 128, 130, 127, 129, 131, 156, 255, 255, 255, 255, 255, 225, 221, 218, 213, 207, 195, 188, 190, 197, 194, 195, 211, 219, 220, 223, 223, 218, 210, 208, 201, 189, 182, 174, 162, 153, 147, 129, 114, 97, 175, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 226, 225, 227, 225, 160, 131, 127, 255, 255, 255, 255, 255, 255, 118, 81, 77, 91, 122, 129, 134, 124, 130, 130, 129, 127, 192, 255, 255, 255, 229, 219, 205, 181, 181, 173, 178, 179, 176, 176, 174, 169, 162, 172, 192, 214, 218, 218, 217, 204, 201, 191, 181, 175, 165, 159, 145, 131, 118, 106, 87, 181, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 220, 255, 228, 223, 222, 137, 124, 143, 255, 255, 255, 255, 255, 255, 223, 93, 81, 79, 101, 125, 127, 129, 129, 125, 134, 130, 122, 208, 255, 218, 201, 178, 177, 180, 172, 186, 173, 180, 177, 183, 178, 181, 183, 177, 175, 143, 168, 219, 200, 205, 197, 189, 187, 176, 164, 152, 150, 134, 125, 106, 93, 73, 198, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 223, 223, 228, 220, 196, 131, 129, 172, 255, 255, 255, 255, 255, 255, 255, 221, 91, 80, 84, 97, 129, 127, 126, 127, 126, 128, 131, 130, 217, 184, 180, 152, 123, 125, 185, 174, 181, 179, 180, 175, 181, 173, 183, 175, 177, 178, 153, 142, 181, 209, 197, 190, 181, 174, 166, 158, 144, 134, 120, 110, 90, 86, 75, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 223, 226, 229, 224, 168, 126, 131, 217, 255, 255, 255, 255, 255, 255, 255, 255, 221, 81, 81, 82, 105, 128, 127, 130, 126, 131, 129, 175, 184, 173, 99, 92, 133, 136, 100, 160, 179, 179, 177, 183, 177, 182, 177, 177, 180, 179, 179, 165, 145, 137, 189, 194, 181, 167, 166, 156, 142, 134, 127, 108, 95, 76, 62, 114, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 226, 255, 220, 228, 225, 137, 133, 132, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 201, 83, 80, 84, 108, 131, 129, 128, 128, 134, 180, 172, 180, 158, 170, 175, 175, 154, 87, 176, 177, 179, 177, 173, 177, 136, 132, 180, 175, 168, 171, 164, 132, 121, 180, 181, 168, 161, 153, 147, 132, 116, 110, 95, 85, 60, 57, 211, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 228, 223, 227, 220, 206, 132, 128, 159, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 183, 87, 79, 80, 114, 126, 133, 131, 173, 181, 182, 174, 172, 186, 170, 185, 180, 72, 180, 177, 181, 177, 110, 99, 123, 138, 106, 104, 159, 163, 158, 159, 122, 124, 175, 165, 158, 148, 142, 129, 120, 107, 90, 78, 66, 51, 113, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 223, 225, 224, 226, 182, 129, 131, 196, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 148, 83, 83, 84, 122, 124, 153, 176, 178, 180, 174, 184, 164, 174, 180, 174, 111, 180, 176, 170, 99, 154, 174, 181, 184, 169, 173, 98, 155, 161, 150, 151, 116, 112, 158, 156, 145, 133, 125, 119, 102, 89, 81, 58, 55, 85, 223, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 229, 229, 223, 225, 150, 127, 131, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 209, 117, 80, 82, 89, 121, 180, 179, 180, 176, 158, 72, 69, 61, 83, 184, 175, 173, 181, 175, 148, 178, 177, 174, 175, 177, 169, 156, 119, 159, 151, 145, 141, 95, 100, 151, 142, 133, 122, 114, 97, 87, 74, 58, 53, 72, 168, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 227, 227, 225, 226, 218, 133, 129, 143, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 190, 153, 112, 83, 78, 124, 175, 182, 179, 173, 78, 89, 176, 163, 51, 128, 178, 179, 178, 177, 175, 180, 176, 176, 175, 170, 165, 162, 157, 151, 147, 139, 140, 122, 70, 134, 136, 132, 118, 107, 94, 83, 71, 54, 54, 79, 124, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 226, 224, 223, 224, 193, 131, 133, 184, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 176, 115, 127, 131, 129, 151, 178, 179, 172, 167, 118, 175, 169, 100, 58, 78, 179, 177, 177, 162, 96, 59, 69, 61, 99, 163, 161, 157, 155, 147, 144, 138, 130, 128, 100, 83, 127, 123, 114, 102, 90, 78, 66, 54, 56, 79, 105, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 225, 227, 223, 225, 160, 126, 130, 229, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 229, 85, 67, 87, 87, 175, 177, 183, 180, 179, 186, 175, 77, 27, 28, 81, 176, 183, 176, 80, 81, 178, 164, 160, 48, 75, 159, 158, 149, 144, 138, 133, 128, 124, 117, 77, 90, 117, 106, 96, 86, 73, 59, 51, 68, 80, 113, 225, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 228, 225, 227, 223, 222, 139, 128, 133, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 195, 140, 114, 169, 178, 182, 180, 173, 178, 180, 66, 34, 37, 131, 172, 178, 151, 62, 169, 168, 149, 66, 47, 31, 149, 145, 143, 139, 134, 127, 128, 115, 111, 101, 53, 114, 100, 91, 79, 68, 54, 53, 66, 89, 114, 211, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 225, 225, 223, 224, 205, 132, 130, 164, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 165, 178, 176, 177, 180, 176, 181, 154, 83, 111, 177, 174, 183, 172, 165, 173, 174, 83, 23, 15, 30, 135, 148, 140, 134, 131, 124, 120, 112, 105, 98, 52, 94, 96, 84, 72, 60, 53, 61, 77, 95, 118, 214, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 224, 225, 225, 227, 175, 128, 129, 209, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 168, 31, 145, 173, 183, 178, 179, 174, 181, 177, 177, 176, 181, 178, 175, 173, 167, 161, 166, 100, 33, 25, 55, 142, 143, 134, 133, 123, 120, 115, 107, 104, 93, 65, 59, 88, 77, 66, 54, 53, 67, 80, 107, 131, 212, 255, 222, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 225, 225, 227, 221, 147, 126, 136, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 229, 77, 4, 11, 45, 166, 167, 177, 179, 177, 176, 179, 180, 173, 172, 167, 174, 167, 166, 171, 156, 158, 106, 88, 141, 137, 131, 128, 127, 118, 113, 111, 101, 98, 93, 73, 52, 78, 68, 59, 53, 60, 74, 90, 111, 131, 202, 82, 4, 12, 36, 99, 148, 196, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 225, 226, 225, 222, 208, 134, 129, 150, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 186, 29, 7, 2, 4, 17, 173, 175, 165, 168, 174, 172, 173, 170, 172, 170, 173, 162, 162, 160, 153, 156, 147, 148, 144, 133, 138, 130, 126, 115, 118, 109, 102, 97, 91, 81, 77, 76, 74, 60, 50, 56, 69, 84, 100, 116, 151, 38, 3, 1, 1, 1, 2, 2, 3, 18, 45, 113, 163, 222, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 229, 219, 226, 226, 188, 129, 132, 192, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 104, 9, 2, 1, 2, 2, 9, 149, 188, 187, 167, 168, 165, 167, 166, 164, 162, 162, 161, 157, 153, 150, 147, 143, 141, 136, 131, 126, 124, 116, 114, 108, 101, 96, 91, 84, 79, 73, 85, 66, 53, 51, 65, 76, 93, 109, 130, 157, 18, 4, 1, 3, 1, 2, 1, 5, 1, 3, 9, 0, 9, 38, 227, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 224, 225, 228, 223, 155, 131, 130, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 196, 39, 1, 1, 5, 3, 3, 7, 3, 92, 174, 188, 196, 192, 171, 157, 159, 159, 158, 155, 153, 150, 148, 144, 139, 135, 132, 130, 125, 120, 118, 110, 107, 101, 95, 90, 84, 77, 70, 64, 78, 57, 53, 61, 72, 85, 108, 124, 140, 135, 11, 7, 0, 0, 0, 1, 3, 1, 3, 1, 1, 6, 1, 7, 107, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 227, 222, 229, 226, 218, 134, 128, 144, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 132, 7, 2, 5, 3, 1, 2, 1, 3, 11, 40, 160, 178, 175, 188, 189, 190, 184, 172, 159, 150, 145, 143, 142, 140, 135, 129, 126, 123, 118, 113, 109, 104, 100, 94, 89, 84, 78, 70, 64, 59, 72, 57, 60, 70, 85, 99, 112, 128, 158, 90, 2, 8, 0, 0, 1, 2, 1, 1, 1, 0, 0, 31, 48, 0, 51, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 226, 225, 226, 223, 199, 132, 125, 178, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 207, 53, 0, 4, 2, 3, 3, 3, 1, 7, 1, 5, 8, 122, 159, 170, 175, 174, 176, 176, 175, 175, 174, 169, 159, 150, 141, 136, 130, 125, 120, 114, 107, 103, 99, 94, 87, 82, 78, 71, 62, 57, 53, 56, 60, 76, 81, 91, 108, 127, 151, 177, 25, 9, 4, 0, 5, 1, 2, 1, 0, 5, 7, 42, 104, 145, 47, 12, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 225, 227, 224, 227, 167, 131, 130, 215, 255, 255, 255, 255, 255, 255, 255, 255, 255, 148, 6, 5, 4, 1, 1, 2, 0, 1, 1, 0, 4, 7, 6, 59, 139, 154, 160, 168, 168, 167, 165, 165, 166, 164, 158, 153, 150, 148, 143, 137, 131, 124, 117, 112, 105, 100, 93, 87, 80, 70, 61, 56, 53, 56, 69, 80, 92, 111, 124, 144, 160, 116, 11, 3, 0, 0, 0, 1, 1, 5, 3, 4, 103, 98, 177, 146, 79, 5, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 228, 222, 228, 225, 225, 141, 129, 140, 255, 255, 255, 255, 255, 255, 255, 255, 255, 72, 5, 2, 5, 1, 2, 4, 2, 1, 1, 1, 4, 2, 4, 4, 21, 139, 138, 149, 148, 152, 154, 156, 155, 152, 150, 147, 144, 141, 139, 136, 131, 125, 119, 112, 107, 98, 93, 86, 79, 69, 59, 52, 50, 55, 70, 86, 92, 106, 122, 133, 155, 164, 30, 8, 3, 1, 0, 3, 2, 0, 5, 12, 134, 151, 95, 83, 88, 81, 20, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 225, 222, 227, 225, 202, 131, 129, 164, 255, 255, 255, 255, 255, 255, 255, 255, 56, 5, 2, 4, 0, 1, 7, 0, 1, 7, 1, 5, 3, 4, 4, 39, 203, 188, 116, 134, 136, 137, 140, 142, 141, 139, 137, 135, 134, 128, 126, 122, 117, 112, 107, 100, 94, 88, 81, 74, 67, 59, 54, 55, 61, 72, 79, 91, 107, 120, 135, 154, 160, 30, 14, 1, 1, 0, 5, 0, 5, 6, 17, 190, 184, 114, 128, 111, 78, 74, 8, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 226, 224, 227, 224, 176, 130, 129, 194, 255, 255, 255, 255, 255, 255, 255, 141, 6, 1, 3, 2, 3, 4, 2, 2, 1, 2, 4, 1, 3, 5, 103, 223, 212, 197, 133, 105, 121, 125, 126, 127, 127, 127, 126, 123, 120, 119, 117, 111, 105, 100, 95, 87, 81, 77, 70, 61, 55, 52, 53, 63, 75, 85, 93, 103, 121, 133, 143, 108, 11, 8, 3, 4, 1, 1, 2, 1, 4, 49, 190, 203, 170, 108, 193, 164, 118, 45, 48, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 227, 227, 227, 224, 219, 149, 127, 129, 255, 255, 255, 255, 255, 255, 255, 255, 13, 3, 1, 3, 5, 1, 1, 1, 1, 4, 2, 1, 3, 6, 153, 213, 202, 194, 177, 127, 80, 101, 110, 106, 115, 115, 112, 113, 108, 108, 105, 100, 94, 92, 89, 84, 77, 72, 65, 55, 52, 56, 52, 65, 78, 86, 95, 109, 120, 122, 93, 23, 7, 5, 1, 3, 0, 0, 3, 2, 5, 57, 208, 201, 179, 136, 151, 227, 193, 130, 55, 85, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 228, 255, 223, 225, 217, 130, 131, 153, 255, 255, 255, 255, 255, 255, 255, 131, 1, 2, 1, 0, 0, 2, 0, 8, 0, 0, 0, 3, 14, 62, 133, 179, 186, 164, 151, 105, 118, 89, 81, 95, 96, 94, 97, 103, 94, 99, 92, 87, 82, 77, 75, 67, 61, 56, 53, 48, 50, 65, 69, 84, 87, 102, 101, 74, 42, 9, 6, 9, 0, 2, 4, 0, 0, 0, 1, 1, 39, 190, 187, 180, 159, 109, 169, 255, 201, 112, 36, 163, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 197, 210, 197, 164, 255, 255, 255, 255, 255, 255, 255, 42, 6, 4, 0, 3, 1, 2, 2, 0, 4, 3, 2, 16, 87, 154, 134, 157, 150, 144, 112, 80, 120, 175, 102, 72, 76, 79, 81, 77, 79, 75, 77, 72, 68, 62, 61, 56, 55, 53, 53, 66, 72, 79, 84, 51, 22, 10, 6, 1, 3, 4, 2, 5, 1, 1, 0, 0, 2, 6, 2, 39, 96, 139, 163, 152, 127, 80, 169, 215, 180, 100, 9, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 211, 183, 151, 191, 255, 255, 255, 255, 220, 10, 1, 1, 1, 3, 0, 1, 0, 2, 0, 1, 6, 80, 181, 165, 141, 135, 116, 112, 92, 64, 117, 99, 109, 66, 58, 56, 65, 60, 63, 63, 62, 58, 55, 53, 52, 53, 58, 62, 69, 74, 84, 81, 22, 2, 6, 2, 2, 3, 1, 3, 0, 0, 1, 1, 0, 1, 3, 5, 97, 117, 176, 149, 134, 121, 97, 71, 125, 163, 122, 55, 37, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 218, 192, 156, 117, 255, 255, 255, 255, 158, 1, 0, 0, 1, 0, 0, 2, 2, 1, 2, 0, 35, 113, 89, 81, 88, 108, 74, 69, 61, 75, 120, 138, 104, 112, 15, 56, 55, 53, 54, 51, 53, 56, 56, 60, 60, 66, 74, 82, 89, 94, 73, 14, 6, 8, 2, 2, 4, 1, 4, 0, 6, 7, 1, 5, 0, 1, 18, 135, 103, 143, 117, 123, 104, 86, 67, 74, 129, 80, 98, 15, 138, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 210, 187, 160, 106, 142, 255, 255, 255, 104, 1, 5, 1, 2, 0, 3, 1, 0, 0, 5, 3, 71, 154, 123, 102, 67, 88, 78, 79, 97, 117, 148, 173, 105, 5, 8, 64, 185, 121, 77, 72, 71, 73, 77, 82, 86, 91, 96, 100, 109, 64, 9, 5, 4, 1, 2, 1, 2, 0, 2, 5, 0, 0, 2, 1, 2, 37, 201, 144, 99, 80, 69, 86, 84, 72, 77, 109, 148, 153, 53, 20, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 223, 201, 181, 144, 96, 117, 255, 255, 255, 79, 4, 1, 1, 5, 0, 1, 0, 2, 0, 5, 2, 128, 207, 186, 153, 106, 45, 20, 32, 74, 81, 31, 9, 2, 7, 88, 255, 255, 255, 199, 146, 107, 99, 99, 95, 107, 108, 117, 117, 85, 6, 3, 2, 1, 5, 2, 0, 0, 1, 1, 4, 0, 1, 4, 4, 77, 202, 182, 104, 169, 144, 120, 79, 94, 84, 95, 121, 120, 28, 0, 127, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 217, 204, 187, 163, 124, 79, 139, 255, 255, 255, 18, 1, 4, 1, 0, 2, 4, 1, 0, 5, 0, 16, 178, 255, 219, 185, 115, 71, 1, 0, 1, 3, 3, 3, 19, 148, 255, 255, 255, 255, 255, 255, 255, 224, 203, 172, 175, 159, 163, 155, 17, 4, 5, 0, 0, 0, 0, 1, 0, 4, 2, 1, 2, 0, 2, 83, 216, 199, 160, 113, 217, 191, 151, 86, 4, 1, 0, 2, 1, 5, 48, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 213, 255, 255, 255, 255, 255, 255, 225, 212, 198, 181, 160, 127, 89, 77, 193, 255, 255, 255, 19, 1, 0, 0, 1, 0, 5, 0, 1, 3, 0, 34, 201, 255, 255, 189, 108, 38, 1, 1, 2, 0, 2, 52, 201, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 131, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 5, 0, 1, 6, 128, 208, 196, 179, 132, 133, 255, 212, 158, 81, 3, 0, 1, 0, 4, 69, 214, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 208, 193, 199, 208, 206, 205, 198, 193, 180, 166, 149, 123, 87, 73, 138, 217, 255, 255, 255, 104, 0, 1, 1, 3, 1, 2, 9, 0, 0, 5, 36, 193, 226, 211, 169, 107, 2, 7, 0, 6, 6, 75, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 17, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 2, 4, 80, 194, 185, 173, 149, 104, 145, 255, 210, 147, 62, 4, 6, 2, 0, 74, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 205, 186, 168, 154, 151, 140, 120, 95, 70, 86, 139, 143, 125, 255, 255, 255, 118, 4, 2, 1, 1, 6, 0, 0, 1, 0, 0, 35, 141, 165, 167, 113, 72, 2, 0, 3, 8, 134, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 165, 4, 1, 1, 1, 0, 0, 1, 1, 1, 0, 3, 1, 7, 76, 95, 149, 156, 147, 123, 89, 143, 206, 181, 111, 36, 3, 0, 6, 73, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 214, 177, 136, 105, 81, 113, 145, 156, 88, 84, 255, 255, 255, 197, 4, 3, 1, 1, 1, 1, 1, 4, 0, 5, 23, 130, 85, 91, 110, 5, 6, 2, 32, 196, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 71, 9, 1, 1, 0, 0, 0, 0, 1, 1, 3, 0, 2, 46, 151, 172, 140, 132, 117, 97, 65, 121, 122, 127, 72, 3, 1, 5, 127, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 219, 204, 188, 165, 145, 120, 82, 69, 182, 255, 255, 255, 64, 2, 4, 1, 0, 6, 1, 0, 3, 0, 10, 133, 139, 134, 30, 3, 2, 72, 217, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 17, 2, 1, 1, 0, 0, 0, 0, 1, 1, 0, 6, 7, 113, 140, 120, 120, 91, 88, 66, 73, 126, 97, 108, 42, 2, 5, 138, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 224, 210, 196, 179, 161, 138, 118, 83, 60, 141, 255, 255, 255, 255, 100, 29, 3, 1, 1, 1, 0, 6, 2, 4, 56, 121, 33, 5, 6, 127, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 204, 6, 4, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 48, 103, 73, 69, 112, 68, 64, 78, 108, 150, 162, 73, 6, 15, 134, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 219, 211, 199, 186, 169, 154, 135, 106, 159, 213, 169, 203, 255, 255, 255, 255, 255, 219, 152, 93, 41, 9, 0, 0, 0, 8, 2, 3, 20, 159, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 168, 0, 2, 1, 0, 0, 1, 1, 1, 1, 1, 0, 5, 97, 157, 141, 104, 89, 71, 95, 106, 135, 94, 22, 7, 14, 198, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 227, 222, 218, 207, 199, 187, 176, 162, 147, 126, 114, 255, 255, 170, 113, 135, 255, 255, 255, 255, 255, 255, 255, 255, 255, 179, 100, 48, 11, 4, 57, 209, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 123, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 6, 164, 204, 176, 133, 65, 3, 3, 2, 0, 7, 3, 15, 199, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 226, 228, 227, 224, 222, 216, 209, 204, 196, 185, 174, 163, 153, 134, 115, 151, 255, 209, 157, 103, 67, 216, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 228, 217, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 94, 0, 1, 2, 0, 3, 1, 0, 2, 0, 1, 1, 25, 220, 255, 203, 147, 63, 7, 0, 1, 2, 8, 35, 198, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 215, 211, 211, 203, 209, 202, 196, 188, 178, 172, 165, 150, 138, 125, 105, 151, 255, 184, 133, 86, 66, 156, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 91, 5, 0, 0, 5, 2, 2, 5, 0, 0, 5, 0, 42, 255, 255, 200, 134, 46, 0, 2, 3, 2, 49, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 194, 182, 172, 197, 193, 185, 185, 174, 169, 161, 149, 145, 126, 114, 94, 131, 200, 162, 118, 79, 68, 129, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 93, 0, 0, 0, 3, 0, 0, 0, 2, 6, 0, 4, 52, 206, 210, 176, 98, 19, 5, 3, 0, 53, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 198, 111, 36, 182, 173, 177, 163, 164, 157, 143, 135, 129, 112, 101, 83, 82, 177, 135, 97, 62, 84, 138, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 162, 0, 1, 3, 0, 1, 5, 0, 0, 4, 2, 2, 60, 141, 158, 129, 86, 2, 0, 6, 74, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 229, 143, 2, 165, 165, 159, 152, 63, 61, 135, 123, 115, 104, 89, 70, 59, 128, 113, 79, 66, 103, 160, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 196, 8, 0, 0, 1, 2, 0, 4, 5, 0, 1, 0, 48, 124, 81, 88, 45, 5, 3, 105, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 164, 7, 111, 147, 146, 140, 41, 28, 123, 112, 99, 87, 75, 60, 63, 87, 89, 65, 80, 131, 210, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 73, 2, 2, 0, 3, 0, 0, 2, 0, 3, 0, 38, 149, 142, 74, 0, 0, 103, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 44, 60, 132, 126, 129, 43, 11, 103, 96, 90, 73, 61, 62, 71, 100, 90, 93, 128, 192, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 107, 46, 11, 0, 2, 4, 0, 0, 1, 2, 8, 100, 50, 5, 14, 136, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 147, 21, 115, 114, 106, 64, 3, 71, 83, 70, 58, 56, 73, 92, 112, 144, 177, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 188, 118, 56, 17, 6, 2, 10, 0, 3, 3, 11, 169, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 48, 68, 95, 94, 72, 2, 33, 68, 53, 64, 73, 91, 114, 136, 163, 211, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 186, 127, 58, 8, 2, 25, 169, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 210, 102, 76, 69, 67, 12, 14, 53, 67, 77, 89, 108, 138, 158, 206, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 204, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 229, 139, 79, 57, 0, 58, 90, 102, 116, 140, 158, 212, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 228, 169, 135, 124, 128, 136, 167, 198, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
|
||||
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]
|
||||
];
|
||||
|
||||
dots = px_gray(levels, center = true, normalize = true);
|
||||
for(dot = dots) {
|
||||
translate(dot[0])
|
||||
square(dot[1]);
|
||||
}
|
||||
|
||||

|
31
docs/lib2-px_line.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# px_line
|
||||
|
||||
Given two points. `px_line` returns points that can be used to draw a pixel-style line.
|
||||
|
||||
**Since:** 2.0
|
||||
|
||||
## Parameters
|
||||
|
||||
- `p1` : The start point `[x, y]` or `[x, y, z]`. x, y, z must be integer.
|
||||
- `p2` : The end point `[x, y]` or `[x, y, z]`. x, y, z must be integer.
|
||||
|
||||
## Examples
|
||||
|
||||
include <pixel/px_line.scad>;
|
||||
|
||||
for(pt = px_line([-10, 0], [20, 50])) {
|
||||
translate(pt)
|
||||
square(1, center = true);
|
||||
}
|
||||
|
||||

|
||||
|
||||
include <pixel/px_line.scad>;
|
||||
|
||||
for(pt = px_line([-10, 0, -10], [20, 50, 10])) {
|
||||
translate(pt)
|
||||
cube(1, center = true);
|
||||
}
|
||||
|
||||

|
||||
|
39
docs/lib2-px_polygon.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# px_polygon
|
||||
|
||||
Returns points that can be used to draw a pixel-style polygon.
|
||||
|
||||
**Since:** 2.0
|
||||
|
||||
## Parameters
|
||||
|
||||
- `points` : A list of points. Each point can be `[x, y]`. x, y must be integer.
|
||||
- `filled` : Default to `false`. Set it `true` if you want a filled polygon.
|
||||
|
||||
## Examples
|
||||
|
||||
include <in_shape.scad>;
|
||||
include <pixel/px_line.scad>;
|
||||
include <pixel/px_polyline.scad>;
|
||||
include <pixel/px_polygon.scad>;
|
||||
include <shape_pentagram.scad>;
|
||||
|
||||
pentagram = [
|
||||
for(pt = shape_pentagram(15))
|
||||
[round(pt[0]), round(pt[1])]
|
||||
];
|
||||
|
||||
for(pt = px_polygon(pentagram)) {
|
||||
translate(pt)
|
||||
linear_extrude(1, scale = 0.5)
|
||||
square(1, center = true);
|
||||
}
|
||||
|
||||
translate([30, 0])
|
||||
for(pt = px_polygon(pentagram, filled = true)) {
|
||||
translate(pt)
|
||||
linear_extrude(1, scale = 0.5)
|
||||
square(1, center = true);
|
||||
}
|
||||
|
||||

|
||||
|
55
docs/lib2-px_polyline.md
Normal file
@@ -0,0 +1,55 @@
|
||||
# px_polyline
|
||||
|
||||
Given a list of points. `px_polyline` returns points that can be used to draw a pixel-style polyline.
|
||||
|
||||
**Since:** 2.0
|
||||
|
||||
## Parameters
|
||||
|
||||
- `points` : A list of points. Each point can be `[x, y]` or `[x, y, z]`. x, y, z must be integer.
|
||||
|
||||
## Examples
|
||||
|
||||
include <pixel/px_line.scad>;
|
||||
include <pixel/px_polyline.scad>;
|
||||
include <shape_pentagram.scad>;
|
||||
|
||||
pentagram = [
|
||||
for(pt = shape_pentagram(15))
|
||||
[round(pt[0]), round(pt[1])]
|
||||
];
|
||||
|
||||
for(pt = px_polyline(concat(pentagram, [pentagram[0]]))) {
|
||||
translate(pt)
|
||||
linear_extrude(1, scale = 0.5)
|
||||
square(1, center = true);
|
||||
}
|
||||
|
||||

|
||||
|
||||
include <pixel/px_line.scad>;
|
||||
include <pixel/px_polyline.scad>;
|
||||
include <rotate_p.scad>;
|
||||
include <sphere_spiral.scad>;
|
||||
|
||||
points_angles = sphere_spiral(
|
||||
radius = 20,
|
||||
za_step = 5
|
||||
);
|
||||
|
||||
points = [
|
||||
for(pa = points_angles)
|
||||
let(pt = pa[0])
|
||||
[round(pt[0]), round(pt[1]), round(pt[2])]
|
||||
];
|
||||
|
||||
for(a = [0:30:330]) {
|
||||
rotate(a)
|
||||
for(pt = px_polyline(points)) {
|
||||
translate(pt)
|
||||
cube(1, center = true);
|
||||
}
|
||||
}
|
||||
|
||||

|
||||
|
22
docs/lib2-px_sphere.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# px_sphere
|
||||
|
||||
Returns points that can be used to draw a pixel-style sphere.
|
||||
|
||||
**Since:** 2.0
|
||||
|
||||
## Parameters
|
||||
|
||||
- `radius` : The radius of the sphere. The value must be an integer.
|
||||
- `filled` : Default to `false`. Set it `true` if you want a filled sphere.
|
||||
- `thickness`: Default to 1. The thickness when `filled` is `false`. The value must be an integer.
|
||||
|
||||
## Examples
|
||||
|
||||
include <pixel/px_sphere.scad>;
|
||||
|
||||
for(pt = px_sphere(10)) {
|
||||
translate(pt)
|
||||
cube(1, center = true);
|
||||
}
|
||||
|
||||

|
21
docs/lib2-rand.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# rand
|
||||
|
||||
Random number generator. Generates a pseudo random number.
|
||||
|
||||
**Since:** 2.1
|
||||
|
||||
## Parameters
|
||||
|
||||
- `min_value` : Minimum value of random number range. Default to 0.
|
||||
- `max_value` : Maximum value of random number range. Default to 1.
|
||||
- `seed_value` : Optional. Seed value for random number generator for repeatable results.
|
||||
|
||||
## Examples
|
||||
|
||||
include <util/rand.scad>;
|
||||
|
||||
echo(rand());
|
||||
echo(rand(1, 10));
|
||||
echo(rand(seed_value = 4));
|
||||
|
||||
|
16
docs/lib2-reverse.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# reverse
|
||||
|
||||
Reverse a list.
|
||||
|
||||
**Since:**: 2.0
|
||||
|
||||
## Parameters
|
||||
|
||||
- `lt` : The list to be reversed.
|
||||
|
||||
## Examples
|
||||
|
||||
include <util/reverse.scad>;
|
||||
|
||||
echo(reverse([1, 2, 3])); // ECHO: [3, 2, 1]
|
||||
|
18
docs/lib2-slice.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# slice
|
||||
|
||||
Returns a list selected from `begin` to `end`, or to the `end` of the list (`end` not included).
|
||||
|
||||
**Since:** 2.0
|
||||
|
||||
## Parameters
|
||||
|
||||
- `lt` : The original list.
|
||||
- `begin` : The beginning index, inclusive.
|
||||
- `end` : The ending index, exclusive. If it's omitted, the list begins with the character at the specified `begin` and extends to the end of the original list.
|
||||
|
||||
## Examples
|
||||
|
||||
include <util/slice.scad>;
|
||||
|
||||
echo(slice([for(c = "helloworld") c], 0, 5)); // ECHO: ["h", "e", "l", "l", "o"]
|
||||
echo(slice([for(c = "helloworld") c], 5)); // ECHO: ["w", "o", "r", "l", "d"]
|
32
docs/lib2-sort.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# sort
|
||||
|
||||
Sorts the elements of a list in ascending order. The list is a list-of-list construct, such as `[[a0, a1, a2...], [b0, b1, b2,...], [c0, c1, c2,...],...]`. When sorting, the function looks only at one index position of each sublist.
|
||||
|
||||
**Since:** 2.0
|
||||
|
||||
## Parameters
|
||||
|
||||
- `lt` : The original list.
|
||||
- `by` : Can be `"x"`、`"y"`、`"z"`, or `"idx"` (Default).
|
||||
- `idx` : When `by` is `"idx"`, the value of `idx` is used. The Default value is 0.
|
||||
|
||||
## Examples
|
||||
|
||||
include <util/sort.scad>;
|
||||
|
||||
assert(
|
||||
[[2, 0, 0], [5, 0, 0], [7, 0, 0], [9, 0, 0], [10, 0, 0]] ==
|
||||
sort([[10, 0, 0], [5, 0, 0], [7, 0, 0], [2, 0, 0], [9, 0, 0]])
|
||||
);
|
||||
|
||||
assert(
|
||||
[[2, 0, 0], [5, 0, 0], [7, 0, 0], [9, 0, 0], [10, 0, 0]] ==
|
||||
sort([[10, 0, 0], [5, 0, 0], [7, 0, 0], [2, 0, 0], [9, 0, 0]], by = "x")
|
||||
);
|
||||
|
||||
assert(
|
||||
[[0, 2, 0], [0, 5, 0], [0, 7, 0], [0, 9, 0], [0, 10, 0]] ==
|
||||
sort([[0, 10, 0], [0, 5, 0], [0, 7, 0], [0, 2, 0], [0, 9, 0]], by = "idx", idx = 1)
|
||||
);
|
||||
|
||||
|
@@ -1,6 +1,8 @@
|
||||
# split_str
|
||||
|
||||
Splits the given string around matches of the given delimiting character. It depeneds on the `sub_str` function so remember to `include <sub_str.scad>`.
|
||||
The dir changed since 2.0.
|
||||
|
||||
Splits the given string around matches of the given delimiting character.
|
||||
|
||||
## Parameters
|
||||
|
||||
@@ -9,8 +11,8 @@ Splits the given string around matches of the given delimiting character. It dep
|
||||
|
||||
## Examples
|
||||
|
||||
include <sub_str.scad>;
|
||||
include <split_str.scad>;
|
||||
include <util/sub_str.scad>;
|
||||
include <util/split_str.scad>;
|
||||
|
||||
echo(split_str("hello,world", ",")); // ECHO: ["hello", "world"]
|
||||
|
@@ -1,6 +1,8 @@
|
||||
# sub_str
|
||||
|
||||
Returns a new string that is a substring of the given string.
|
||||
The dir changed since 2.0.
|
||||
|
||||
Returns the part of the string from `begin` to `end`, or to the `end` of the string (`end` not included).
|
||||
|
||||
## Parameters
|
||||
|
||||
@@ -10,7 +12,7 @@ Returns a new string that is a substring of the given string.
|
||||
|
||||
## Examples
|
||||
|
||||
include <sub_str.scad>;
|
||||
include <util/sub_str.scad>;
|
||||
|
||||
echo(sub_str("helloworld", 0, 5)); // ECHO: "hello"
|
||||
echo(sub_str("helloworld", 5)); // ECHO: "world"
|
127
docs/lib2-t2d.md
Normal file
@@ -0,0 +1,127 @@
|
||||
# t2d
|
||||
|
||||
An implementation of Turtle Graphics with Fluent API. It moves on the xy plane. You can get the cooridinate `[x, y]` or `angle` of its current position.
|
||||
|
||||
**Since:** 2.1
|
||||
|
||||
## Parameters
|
||||
|
||||
- `t` : The data of a turtle. `t2d()` with no arguments will return a turtle with the point `[0, 0]` and the angle `0`.
|
||||
- `cmd` : It accepts a string or a list of commands.
|
||||
- Given a string: `"turn"`, `"forward"`, `"point"` or `"angle"`. If `"turn"` is provided, the `angle` parameter is required. If `"forward"` is provided, `leng` is required. `"point"` and `"angle"` are used to get respective data from a turtle.
|
||||
- Given a list: `[[cmd1, value], [cmd2, value2], ...]`. For example, `[["forward", 10], ["turn", 120]]` will forward a turtle 10mm and turn it 120 degrees.
|
||||
- `point` : Set the position of a turtle.
|
||||
- `angle` : Set the angle of a turtle if `cmd` is not provided. Turn a turtle if `cmd` is `"turn"`.
|
||||
- `leng` : Forward a turtle if `cmd` is `"forward"`.
|
||||
|
||||
## Examples
|
||||
|
||||
include <line2d.scad>;
|
||||
include <turtle/t2d.scad>;
|
||||
|
||||
module turtle_spiral(t, times, side_leng, angle, width) {
|
||||
$fn = 24;
|
||||
if(times != 0) {
|
||||
t1 = t2d(t, "turn", angle = angle);
|
||||
t2 = t2d(t1, "forward", leng = side_leng);
|
||||
|
||||
line2d(
|
||||
t2d(t, "point"),
|
||||
t2d(t2, "point"),
|
||||
width,
|
||||
p1Style = "CAP_ROUND",
|
||||
p2Style = "CAP_ROUND"
|
||||
);
|
||||
|
||||
turtle_spiral(t2, times - 1, side_leng, angle, width);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
turtle_spiral(
|
||||
t2d(point = [0, 0], angle = 0),
|
||||
times = 5,
|
||||
side_leng = 10,
|
||||
angle = 144,
|
||||
width = 1
|
||||
);
|
||||
|
||||
The code below creates the same drawing.
|
||||
|
||||
include <line2d.scad>;
|
||||
include <turtle/t2d.scad>;
|
||||
|
||||
module turtle_spiral(t, times, side_leng, angle, width) {
|
||||
$fn = 24;
|
||||
if(times != 0) {
|
||||
t1 = t2d(t, [
|
||||
["turn", angle],
|
||||
["forward", side_leng]
|
||||
]);
|
||||
|
||||
line2d(
|
||||
t2d(t, "point"),
|
||||
t2d(t1, "point"),
|
||||
width,
|
||||
p1Style = "CAP_ROUND",
|
||||
p2Style = "CAP_ROUND"
|
||||
);
|
||||
|
||||
turtle_spiral(t1, times - 1, side_leng, angle, width);
|
||||
}
|
||||
}
|
||||
|
||||
turtle_spiral(
|
||||
t2d(point = [0, 0], angle = 0),
|
||||
times = 5,
|
||||
side_leng = 10,
|
||||
angle = 144,
|
||||
width = 1
|
||||
);
|
||||
|
||||

|
||||
|
||||
include <hull_polyline2d.scad>;
|
||||
include <turtle/t2d.scad>;
|
||||
|
||||
side_leng = 100;
|
||||
min_leng = 4;
|
||||
thickness = 0.5;
|
||||
|
||||
sierpinski_triangle(
|
||||
t2d(point = [0, 0], angle = 0),
|
||||
side_leng, min_leng, thickness, $fn = 3
|
||||
);
|
||||
|
||||
module triangle(t, side_leng, thickness) {
|
||||
t2 = t2d(t, "forward", leng = side_leng);
|
||||
t3 = t2d(t2, [
|
||||
["turn", 120],
|
||||
["forward", side_leng]
|
||||
]);
|
||||
|
||||
hull_polyline2d(
|
||||
[for(turtle = [t, t2, t3, t]) t2d(turtle, "point")],
|
||||
thickness
|
||||
);
|
||||
}
|
||||
|
||||
module sierpinski_triangle(t, side_leng, min_leng, thickness) {
|
||||
triangle(t, side_leng, thickness);
|
||||
|
||||
if(side_leng >= min_leng) {
|
||||
half_leng = side_leng / 2;
|
||||
t2 = t2d(t, "forward", leng = half_leng);
|
||||
t3 = t2d(t, [
|
||||
["turn", 60],
|
||||
["forward", half_leng],
|
||||
["turn", -60]
|
||||
]);
|
||||
|
||||
for(turtle = [t, t2, t3]) {
|
||||
sierpinski_triangle(turtle, half_leng, min_leng, thickness);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||

|
86
docs/lib2-t3d.md
Normal file
@@ -0,0 +1,86 @@
|
||||
# t3d
|
||||
|
||||
An implementation of 3D Turtle Graphics with Fluent API. When using the function, imagine that you are sitting on a turtle. You move or turn the turtle from the your viewpoint, not the viewpoint of OpenSCAD coordinates.
|
||||
|
||||
For more details, please see [3D turtle graphics](https://openhome.cc/eGossip/OpenSCAD/3DTurtleGraphics.html).
|
||||
|
||||
**Since:** 2.1
|
||||
|
||||
## Parameters
|
||||
|
||||
- `t` : The data of a turtle. `t3d()` with no arguments will return a turtle with the point `[0, 0, 0]` and the unit vectors `[[1, 0, 0], [0, 1, 0], [0, 0, 1]]`.
|
||||
- `cmd` : It accepts a string or a list of commands.
|
||||
- Given a string: `"xturn"`, `"yturn"`, `"zturn"`, `"xforward"`, `"yforward"`, `"zforward"`, `"point"` or `"unit_vectors"`. If `"xturn"`, `"yturn"` or `"zturn"` is provided, the `angle` parameter is required. If `"xforward"`, `"yforward"` or `"zforward"` is provided, `leng` is required. `"point"` and `"unit_vectors"` are used to get respective data from a turtle.
|
||||
- Given a list: `[[cmd1, value], [cmd2, value2], ...]`. For example, `[["xforward", 10], ["zturn", 120]]` will forward a turtle 10mm along the x axis and turn it 120 degrees around the z axis from your viewpoint.
|
||||
- `point` : Set the position of a turtle.
|
||||
- `unit_vectors` : Set the unit vectors of a turtle.
|
||||
- `angle` : Set the angle of a turtle if `cmd` is not provided. Turn a turtle if `cmd` is `"xturn"`, `"yturn"` or `"zturn"`.
|
||||
- `leng` : Forward a turtle if `cmd` is `"xforward"`, `"yforward"` or `"zforward"`.
|
||||
|
||||
## Examples
|
||||
|
||||
include <turtle/t3d.scad>;
|
||||
include <hull_polyline3d.scad>;
|
||||
|
||||
leng = 10;
|
||||
angle = 120;
|
||||
thickness = 1;
|
||||
|
||||
t = t3d(point = [0, 0, 0]);
|
||||
t2 = t3d(t, "xforward", leng = leng);
|
||||
t3 = t3d(t2, [
|
||||
["zturn", angle],
|
||||
["xforward", leng]
|
||||
]);
|
||||
t4 = t3d(t3, [
|
||||
["zturn", angle],
|
||||
["xforward", leng]
|
||||
]);
|
||||
|
||||
hull_polyline3d(
|
||||
[for(turtle = [t, t2, t3, t4]) t3d(turtle, "point")],
|
||||
thickness
|
||||
);
|
||||
|
||||

|
||||
|
||||
include <line3d.scad>;
|
||||
include <turtle/t3d.scad>;
|
||||
|
||||
module tree(t, leng, leng_scale1, leng_scale2, leng_limit,
|
||||
angleZ, angleX, width) {
|
||||
if(leng > leng_limit) {
|
||||
t2 = t3d(t, "xforward", leng = leng);
|
||||
|
||||
line3d(
|
||||
t3d(t, "point"), t3d(t2, "point"),
|
||||
width);
|
||||
|
||||
tree(
|
||||
t3d(t2, "zturn", angle = angleZ),
|
||||
leng * leng_scale1, leng_scale1, leng_scale2, leng_limit,
|
||||
angleZ, angleX,
|
||||
width);
|
||||
|
||||
tree(
|
||||
t3d(t2, "xturn", angle = angleX),
|
||||
leng * leng_scale2, leng_scale1, leng_scale2, leng_limit,
|
||||
angleZ, angleX,
|
||||
width);
|
||||
}
|
||||
}
|
||||
|
||||
leng = 100;
|
||||
leng_limit = 1;
|
||||
leng_scale1 = 0.4;
|
||||
leng_scale2 = 0.9;
|
||||
angleZ = 60;
|
||||
angleX = 135;
|
||||
width = 2;
|
||||
|
||||
t = t3d(point = [0, 0, 0]);
|
||||
|
||||
tree(t, leng, leng_scale1, leng_scale2, leng_limit,
|
||||
angleZ, angleX, width);
|
||||
|
||||

|
@@ -1,11 +1,13 @@
|
||||
# turtle2d
|
||||
|
||||
The dir changed since 2.0.
|
||||
|
||||
An OpenSCAD implementation of Turtle Graphics. It moves on the xy plane. You can get the cooridinate `[x, y]` or `angle` of its current position.
|
||||
|
||||
## Parameters
|
||||
|
||||
- `cmd` : A string command. Different commands use different numbers of arguments.
|
||||
- `"create"` : Creates a turtle data. The command needs three arguments `x`, `y` and `angle`. For example, use `turtle2d("create", 5, 10, 30)` to create a turtle located at `[0, 0]` with an angle `30` degrees.
|
||||
- `"create"` : Creates a turtle data. The command needs three arguments `x`, `y` and `angle`. For example, use `turtle2d("create", 5, 10, 30)` to create a turtle located at `[5, 10]` with an angle `30` degrees.
|
||||
- `"x"` : Sets or gets the `x` coordinate of a turtle. If you provide a turtle data and the `x` coordinate, such as `turtle2d("x", turtle, 20)`, it will sets the `x` coordinate. Giving a turtle data only will return the `x` coordinate.
|
||||
- `"y"` : Sets or gets the `y` coordinate of a turtle. If you provide a turtle data and the `y` coordinate, such as `turtle2d("y", turtle, 20)`, it will sets the `y` coordinate. Giving a turtle data only will return the `y` coordinate.
|
||||
- `"angle"` : Sets or gets the angle of a turtle. If you provide a turtle data and the angle, such as `turtle2d("angle", turtle, 45)`, it will sets the angle. Giving a turtle data only will return the angle.
|
||||
@@ -16,7 +18,7 @@ An OpenSCAD implementation of Turtle Graphics. It moves on the xy plane. You can
|
||||
## Examples
|
||||
|
||||
include <line2d.scad>;
|
||||
include <turtle2d.scad>;
|
||||
include <turtle/turtle2d.scad>;
|
||||
|
||||
module turtle_spiral(t_before, times, side_leng, angle, width) {
|
||||
$fn = 24;
|
||||
@@ -47,7 +49,7 @@ An OpenSCAD implementation of Turtle Graphics. It moves on the xy plane. You can
|
||||

|
||||
|
||||
include <line2d.scad>;
|
||||
include <turtle2d.scad>;
|
||||
include <turtle/turtle2d.scad>;
|
||||
|
||||
module turtle_spiral(t_before, side_leng, d_step, min_leng, angle, width) {
|
||||
$fn = 24;
|
@@ -1,11 +1,11 @@
|
||||
# turtle3d
|
||||
|
||||
The dir changed since 2.0.
|
||||
|
||||
An OpenSCAD implementation of 3D Turtle Graphics. When using the function, imagine that you are sitting on the turtle. You move or turn the turtle from the your viewpoint, not the viewpoint of OpenSCAD coordinates.
|
||||
|
||||
For more details, please see [3D turtle graphics](https://openhome.cc/eGossip/OpenSCAD/3DTurtleGraphics.html).
|
||||
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
- `cmd` : A string command. Different commands use different numbers of arguments.
|
||||
@@ -17,7 +17,7 @@ For more details, please see [3D turtle graphics](https://openhome.cc/eGossip/Op
|
||||
|
||||
## Examples
|
||||
|
||||
include <turtle3d.scad>;
|
||||
include <turtle/turtle3d.scad>;
|
||||
include <hull_polyline3d.scad>;
|
||||
|
||||
leng = 10;
|
||||
@@ -47,7 +47,7 @@ For more details, please see [3D turtle graphics](https://openhome.cc/eGossip/Op
|
||||
|
||||

|
||||
|
||||
include <turtle3d.scad>;
|
||||
include <turtle/turtle3d.scad>;
|
||||
include <hull_polyline3d.scad>;
|
||||
|
||||
module tree(t, leng, leng_scale1, leng_scale2, leng_limit,
|
7
examples/README.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# Dogfooding Examples
|
||||
|
||||
These examples incubate dotSCAD and dotSCAD refactors these examples.
|
||||
|
||||
- [Gallery](https://www.myminifactory.com/users/JustinSDK)
|
||||
|
||||
[](https://www.myminifactory.com/users/JustinSDK)
|
38
examples/bearing_captured_in_mobius_cut.scad
Normal file
@@ -0,0 +1,38 @@
|
||||
include <rotate_p.scad>;
|
||||
include <circle_path.scad>;
|
||||
include <cross_sections.scad>;
|
||||
include <polysections.scad>;
|
||||
include <ring_extrude.scad>;
|
||||
|
||||
ball_radius = 10;
|
||||
mobius_radius = 30;
|
||||
ring_radius = 60;
|
||||
spacing = 0.5;
|
||||
with_ball = "YES";
|
||||
fn = 96;
|
||||
|
||||
module bearing_captured_in_mobius_cut(ball_radius, mobius_radius, ring_radius, spacing, with_ball, fn) {
|
||||
$fn = fn;
|
||||
|
||||
ball_track_radius = ball_radius + spacing;
|
||||
trans_pt = [mobius_radius - ball_track_radius + ball_track_radius / 3, 0, 0];
|
||||
|
||||
circle_points = [for(p = circle_path(ball_track_radius)) p + trans_pt];
|
||||
|
||||
difference() {
|
||||
rotate_extrude()
|
||||
translate([ring_radius, 0, 0])
|
||||
circle(mobius_radius);
|
||||
|
||||
ring_extrude(circle_points, radius = ring_radius, twist = 180);
|
||||
|
||||
rotate([180, 0, 0])
|
||||
ring_extrude(circle_points, radius = ring_radius, twist = 180);
|
||||
}
|
||||
|
||||
if(with_ball == "YES") {
|
||||
translate([ring_radius, 0, 0] + trans_pt) sphere(ball_radius);
|
||||
}
|
||||
}
|
||||
|
||||
bearing_captured_in_mobius_cut(ball_radius, mobius_radius, ring_radius, spacing, with_ball, fn);
|
84
examples/cat_corner_protector.scad
Normal file
@@ -0,0 +1,84 @@
|
||||
include <rotate_p.scad>;
|
||||
include <cross_sections.scad>;
|
||||
include <polysections.scad>;
|
||||
include <ring_extrude.scad>;
|
||||
include <crystal_ball.scad>;
|
||||
|
||||
radius = 15;
|
||||
|
||||
module cat_corner_protector(radius) {
|
||||
module ear() {
|
||||
translate([0, 0, radius * 0.85])
|
||||
rotate([45, -90, 0])
|
||||
translate([0, 0, -radius])
|
||||
intersection() {
|
||||
crystal_ball(
|
||||
radius = radius,
|
||||
theta = 360,
|
||||
phi = 90,
|
||||
thickness = 1
|
||||
);
|
||||
|
||||
linear_extrude(radius * 1.5)
|
||||
hull() {
|
||||
translate([radius * 0.4, 0, 0])
|
||||
circle(radius * 0.1);
|
||||
circle(radius * 0.5, $fn = 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module beard_cube() {
|
||||
linear_extrude(radius * 1.05)
|
||||
square([radius * 0.0275, radius * 0.3], center = true);
|
||||
}
|
||||
|
||||
color("white") rotate([50, 0, 25]) ear();
|
||||
color("white") rotate([0, -50, -25]) ear();
|
||||
|
||||
// beards
|
||||
color("black") intersection() {
|
||||
crystal_ball(
|
||||
radius = radius * 1.05,
|
||||
theta = 360,
|
||||
phi = 90,
|
||||
thickness = radius * 0.05
|
||||
);
|
||||
|
||||
union() {
|
||||
rotate([0, 70, -5]) beard_cube();
|
||||
rotate([0, 65, -5]) beard_cube();
|
||||
rotate([0, 70, 95]) beard_cube();
|
||||
rotate([0, 65, 95]) beard_cube();
|
||||
}
|
||||
}
|
||||
|
||||
// face
|
||||
color("white")
|
||||
difference() {
|
||||
sphere(radius);
|
||||
translate([-radius * 0.25 , -radius * 0.25, -radius * 1.25])
|
||||
cube([radius * 1.5, radius * 1.5, radius * 1.5]);
|
||||
}
|
||||
|
||||
// nose
|
||||
color("black")
|
||||
scale([1, 1, 0.75])
|
||||
translate([radius * 0.6, radius * 0.6, radius * 0.55])
|
||||
sphere(radius * 0.125);
|
||||
|
||||
// eyes
|
||||
color("black")
|
||||
translate([radius * 0.1, radius * 0.75, radius * 0.525])
|
||||
sphere(radius * 0.115);
|
||||
|
||||
color("black")
|
||||
translate([radius * 0.75, radius * 0.1, radius * 0.525])
|
||||
sphere(radius * 0.115);
|
||||
|
||||
}
|
||||
|
||||
rotate(-135) cat_corner_protector(radius, $fn = 36);
|
||||
|
||||
|
||||
|
255
examples/chrome_dino.scad
Normal file
@@ -0,0 +1,255 @@
|
||||
include <pixel/px_circle.scad>;
|
||||
include <in_shape.scad>;
|
||||
include <pixel/px_line.scad>;
|
||||
include <pixel/px_polyline.scad>;
|
||||
include <pixel/px_polygon.scad>;
|
||||
|
||||
w = 5;
|
||||
merged_dino = false;
|
||||
eye_spacing = 0.4;
|
||||
base_x_blocks = 10;
|
||||
base_y_blocks = 6;
|
||||
|
||||
part = "DEMO"; // [DINO, EYE, CACTUS, BASE, DEMO]
|
||||
|
||||
module chrome_dino(w, merged = false) {
|
||||
module body(w) {
|
||||
difference() {
|
||||
polygon([
|
||||
[0, 0],
|
||||
[0, w],
|
||||
[-3 * w, w],
|
||||
[-3 * w, 2 * w],
|
||||
[-4 * w, 2 * w],
|
||||
[-4 * w, 3 * w],
|
||||
[-5 * w, 3 * w],
|
||||
[-5 * w, 9 * w],
|
||||
[-4 * w, 9 * w],
|
||||
[-4 * w, 7 * w],
|
||||
[-3 * w, 7 * w],
|
||||
[-3 * w, 6 * w],
|
||||
[-2 * w, 6 * w],
|
||||
[-2 * w, 5 * w],
|
||||
[0, 5 * w],
|
||||
[0, 6 * w],
|
||||
[w, 6 * w],
|
||||
[w, 7 * w],
|
||||
[3 * w, 7 * w],
|
||||
[3 * w, 8 * w],
|
||||
[4 * w, 8 * w],
|
||||
[4 * w, 9 * w],
|
||||
[5 * w, 9 * w],
|
||||
[5 * w, 15 * w],
|
||||
[6 * w, 15 * w],
|
||||
[6 * w, 16 * w],
|
||||
[14 * w, 16 * w],
|
||||
[14 * w, 15 * w],
|
||||
[15 * w, 15 * w],
|
||||
[15 * w, 11 * w],
|
||||
[11 * w, 11 * w],
|
||||
[11 * w, 10 * w],
|
||||
[13 * w, 10 * w],
|
||||
[13 * w, 9 * w],
|
||||
[10 * w, 9 * w],
|
||||
[10 * w, 3 * w],
|
||||
[9 * w, 3 * w],
|
||||
[9 * w, 2 * w],
|
||||
[8 * w, 2 * w],
|
||||
[8 * w, w],
|
||||
[7 * w, w],
|
||||
[7 * w, 0],
|
||||
]);
|
||||
|
||||
translate([7 * w, 14 * w]) square(w, center = true);
|
||||
}
|
||||
}
|
||||
|
||||
module hand(w) {
|
||||
polygon([
|
||||
[10 * w, 7 * w],
|
||||
[12 * w, 7 * w],
|
||||
[12 * w, 5 * w],
|
||||
[11 * w, 5 * w],
|
||||
[11 * w, 6 * w],
|
||||
[10 * w, 6 * w]
|
||||
]);
|
||||
}
|
||||
|
||||
module leg_l(w) {
|
||||
polygon([
|
||||
[5 * w, 0],
|
||||
[5 * w, -w],
|
||||
[6 * w, -w],
|
||||
[6 * w, -4 * w],
|
||||
[8 * w, -4 * w],
|
||||
[8 * w, -3 * w],
|
||||
[7 * w, -3 * w],
|
||||
[7 * w, 0],
|
||||
]);
|
||||
}
|
||||
|
||||
module leg_r(w) {
|
||||
polygon([
|
||||
[w, 0],
|
||||
[w, -4 * w],
|
||||
[3 * w, -4 * w],
|
||||
[3 * w, -3 * w],
|
||||
[2 * w, -3 * w],
|
||||
[2 * w, -2 * w],
|
||||
[3 * w, -2 * w],
|
||||
[3 * w, -w],
|
||||
[4 * w, -w],
|
||||
[4 * w, 0]
|
||||
]);
|
||||
}
|
||||
|
||||
module dino_left(w) {
|
||||
linear_extrude(w * 2.5) body(w);
|
||||
linear_extrude(w * 2) {
|
||||
hand(w);
|
||||
leg_l(w);
|
||||
}
|
||||
}
|
||||
|
||||
module dino_right(w) {
|
||||
linear_extrude(w * 2.5) mirror([1, 0, 0]) body(w);
|
||||
linear_extrude(w * 2) mirror([1, 0, 0]) {
|
||||
hand(w);
|
||||
leg_r(w);
|
||||
}
|
||||
}
|
||||
|
||||
if(merged) {
|
||||
dino_left(w);
|
||||
translate([0, 0, w * 5]) rotate([0, 180, 0]) dino_right(w);
|
||||
} else {
|
||||
translate([w * 6, 0, 0]) dino_left(w);
|
||||
translate([w * -6, 0, 0]) dino_right(w);
|
||||
}
|
||||
}
|
||||
|
||||
module blocks(points) {
|
||||
for(pt = points) {
|
||||
translate(pt) square(1);
|
||||
};
|
||||
}
|
||||
|
||||
module cactus(w) {
|
||||
linear_extrude(w * 3) {
|
||||
translate([2 * w, w * 7])
|
||||
scale(w)
|
||||
blocks(
|
||||
px_polygon([
|
||||
[0, 2],
|
||||
[3, 2],
|
||||
[5, 4],
|
||||
[5, 10],
|
||||
[5, 10],
|
||||
[3, 10],
|
||||
[3, 6],
|
||||
[0, 4],
|
||||
|
||||
], filled = true)
|
||||
);
|
||||
|
||||
translate([-2 * w, w * 5])
|
||||
scale(w)
|
||||
blocks(
|
||||
px_polygon([
|
||||
[-1, 0],
|
||||
[-3, 0],
|
||||
[-6, 2],
|
||||
[-6, 6],
|
||||
[-6, 6],
|
||||
[-4, 6],
|
||||
[-4, 4],
|
||||
[-1, 2],
|
||||
|
||||
], filled = true)
|
||||
);
|
||||
|
||||
scale(w)
|
||||
blocks(
|
||||
px_polygon([
|
||||
[-2, 0],
|
||||
[2, 0],
|
||||
[2, 20],
|
||||
[1, 22],
|
||||
[0, 22],
|
||||
[-1, 22],
|
||||
[-2, 20]
|
||||
], filled = true)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
module base(w, base_x_blocks, base_y_blocks) {
|
||||
linear_extrude(w) {
|
||||
translate([0, -w])
|
||||
square([base_x_blocks * w, base_y_blocks * w + 2 * w]);
|
||||
|
||||
translate([0, base_y_blocks * w / 2])
|
||||
scale(w)
|
||||
blocks(px_circle(base_y_blocks / 2, filled = true));
|
||||
|
||||
translate([base_x_blocks * w, base_y_blocks * w / 2])
|
||||
scale(w)
|
||||
blocks(px_circle(base_y_blocks / 2, filled = true));
|
||||
}
|
||||
}
|
||||
|
||||
module eye(w, eye_spacing) {
|
||||
translate([0, 0, -eye_spacing])
|
||||
rotate([0, -90, 0])
|
||||
linear_extrude(w * 5)
|
||||
offset(delta = -eye_spacing) square(w);
|
||||
}
|
||||
|
||||
if(part == "DINO") {
|
||||
chrome_dino(w, merged_dino);
|
||||
}
|
||||
else if(part == "EYE") {
|
||||
eye(w, eye_spacing);
|
||||
}
|
||||
else if(part == "CACTUS") {
|
||||
cactus(w);
|
||||
}
|
||||
else if(part == "BASE") {
|
||||
base(w, base_x_blocks, base_y_blocks);
|
||||
}
|
||||
else if(part == "DEMO") {
|
||||
wd = 5;
|
||||
translate([0, wd * 5.5, wd * 5])
|
||||
rotate([90, 0, 0]) {
|
||||
color("DimGray") chrome_dino(wd, true);
|
||||
color("white")
|
||||
linear_extrude(wd * 5)
|
||||
translate([7 * wd, 14 * wd]) square(wd, center = true);
|
||||
}
|
||||
color("white") base(wd, 10, 6);
|
||||
|
||||
translate([wd * 25, wd * 10, 0]) {
|
||||
translate([wd * 4.25, wd * 4.25, 0])
|
||||
color("SlateGray")
|
||||
rotate([90, 0, 0])
|
||||
cactus(wd);
|
||||
|
||||
color("white") base(wd, 10, 6);
|
||||
}
|
||||
|
||||
translate([-wd * 35, wd * 10, 0]) {
|
||||
color("SlateGray") {
|
||||
translate([wd * 4.25, wd * 4, 0])
|
||||
rotate([90, 0, 0])
|
||||
mirror([1, 0, 0])
|
||||
cactus(wd);
|
||||
|
||||
scale(0.75)
|
||||
translate([wd * 30, wd * 5, 0])
|
||||
rotate([90, 0, 0])
|
||||
cactus(wd);
|
||||
}
|
||||
color("white") base(wd, 30, 6);
|
||||
}
|
||||
|
||||
}
|
189
examples/dancing_cubes.scad
Normal file
@@ -0,0 +1,189 @@
|
||||
include <rounded_square.scad>;
|
||||
include <part/joint_T.scad>;
|
||||
include <shape_taiwan.scad>;
|
||||
|
||||
rows = 3; // [2:100]
|
||||
cube_width = 20;
|
||||
|
||||
spacing = 0.4;
|
||||
shaft_r = 1.9;
|
||||
edge_width = 2;
|
||||
|
||||
pattern_thickness = 1.5;
|
||||
|
||||
dancing_cubes_with(rows, cube_width, shaft_r, spacing, edge_width, pattern_thickness, center = true)
|
||||
linear_extrude(pattern_thickness)
|
||||
polygon(shape_taiwan(cube_width * rows - edge_width));
|
||||
|
||||
module a_dancing_cube_no_joint(cube_width, holes, hole_radius, edge_width) {
|
||||
module part_for_carve_a_sink(hole_radius, height, edge_width) {
|
||||
module part_for_h_carving() {
|
||||
leng = hole_radius + edge_width + .1;
|
||||
rotate([0, 90, 0])
|
||||
linear_extrude(leng)
|
||||
circle(hole_radius);
|
||||
|
||||
rotate([-90, 0, 0])
|
||||
linear_extrude(leng)
|
||||
circle(hole_radius);
|
||||
|
||||
linear_extrude(2 * hole_radius, center = true)
|
||||
square(leng);
|
||||
}
|
||||
|
||||
linear_extrude(height)
|
||||
circle(hole_radius);
|
||||
|
||||
translate([0, 0, height / 4])
|
||||
part_for_h_carving();
|
||||
|
||||
translate([0, 0, height * 3 / 4])
|
||||
part_for_h_carving();
|
||||
}
|
||||
|
||||
corner_r = hole_radius + edge_width;
|
||||
|
||||
module carved_parts() {
|
||||
offset_v = cube_width - corner_r;
|
||||
translate([corner_r, corner_r, 0])
|
||||
rotate(180)
|
||||
part_for_carve_a_sink(hole_radius, cube_width, edge_width);
|
||||
|
||||
translate([offset_v, corner_r, 0])
|
||||
rotate(270)
|
||||
part_for_carve_a_sink(hole_radius, cube_width, edge_width);
|
||||
|
||||
if(holes > 2) {
|
||||
translate([offset_v, offset_v, 0])
|
||||
rotate(360)
|
||||
part_for_carve_a_sink(hole_radius, cube_width, edge_width);
|
||||
} else if(holes > 3) {
|
||||
translate([corner_r, offset_v, 0])
|
||||
rotate(90)
|
||||
part_for_carve_a_sink(hole_radius, cube_width, edge_width);
|
||||
}
|
||||
}
|
||||
|
||||
neg_half_w = -cube_width / 2;
|
||||
rotate(135)
|
||||
translate([neg_half_w, neg_half_w])
|
||||
difference() {
|
||||
linear_extrude(cube_width)
|
||||
rounded_square(cube_width, corner_r);
|
||||
carved_parts();
|
||||
}
|
||||
}
|
||||
|
||||
module dancing_cubes(rows, cube_width, shaft_r, spacing, edge_width, center = false) {
|
||||
$fn = 36;
|
||||
|
||||
half_cube_width = cube_width / 2;
|
||||
hole_radius = shaft_r + spacing;
|
||||
corner_r = hole_radius + edge_width;
|
||||
t_leng = edge_width + spacing + hole_radius;
|
||||
cube_offset = cube_width + spacing;
|
||||
|
||||
function is_corner(row, column) =
|
||||
(row == 0 && (column == 0 || column == rows - 1)) ||
|
||||
(row == rows - 1 && (column == 0 || column == rows - 1));
|
||||
|
||||
module corner_cube(row, column) {
|
||||
a = row == 0 && column == 0 ? 0 :
|
||||
row == 0 && column == rows - 1 ? -90 :
|
||||
row == rows - 1 && column == 0 ? 90 : 180;
|
||||
|
||||
rotate(a)
|
||||
a_dancing_cube_no_joint(cube_width, 2, hole_radius, edge_width);
|
||||
}
|
||||
|
||||
function is_side(row, column) =
|
||||
row * column == 0 ||
|
||||
row == rows - 1 ||
|
||||
column == rows - 1;
|
||||
|
||||
module side_cube(row, column) {
|
||||
a = column == 0 ? 0 :
|
||||
row == 0 ? -90 :
|
||||
column == rows - 1 ? 180 : 90;
|
||||
|
||||
rotate(a)
|
||||
a_dancing_cube_no_joint(cube_width, 3, hole_radius, edge_width);
|
||||
}
|
||||
|
||||
function is_even(n) = n % 2 == 0;
|
||||
|
||||
module joint_H() {
|
||||
module half_H() {
|
||||
translate([-t_leng, 0])
|
||||
joint_T(shaft_r, half_cube_width, t_leng, edge_width, spacing = spacing);
|
||||
|
||||
translate([-t_leng, 0, half_cube_width])
|
||||
joint_T(shaft_r, half_cube_width, t_leng, edge_width, spacing = spacing);
|
||||
}
|
||||
half_H();
|
||||
mirror([1, 0, 0]) half_H();
|
||||
}
|
||||
|
||||
center_offset = center ? (cube_width + spacing) * rows / 2 : 0;
|
||||
offset_v = half_cube_width + spacing - center_offset;
|
||||
translate([offset_v, offset_v]) {
|
||||
for(r = [0:rows - 1]) {
|
||||
for(c = [0:rows - 1]) {
|
||||
translate([cube_offset * r, cube_offset * c, 0])
|
||||
rotate(is_even(r + c) ? 45 : -45) {
|
||||
if(is_corner(r, c)) {
|
||||
corner_cube(r, c);
|
||||
} else if(is_side(r, c)) {
|
||||
side_cube(r, c);
|
||||
} else {
|
||||
a_dancing_cube_no_joint(cube_width, 4, hole_radius, edge_width);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
joint_offset_x = half_cube_width - corner_r;
|
||||
joint_offset_y = spacing + half_cube_width;
|
||||
|
||||
for(r = [0:rows - 2]) {
|
||||
for(c = [0:rows - 1]) {
|
||||
offset_c = c * cube_offset;
|
||||
offset_r = joint_offset_y + cube_offset * r;
|
||||
|
||||
translate([
|
||||
offset_c + (is_even(r + c) ? -joint_offset_x : joint_offset_x),
|
||||
offset_r
|
||||
])
|
||||
rotate(90)
|
||||
joint_H();
|
||||
|
||||
translate([
|
||||
offset_r,
|
||||
offset_c + (is_even(r + c) ? joint_offset_x : -joint_offset_x)
|
||||
]) joint_H();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module dancing_cubes_with(rows, cube_width, shaft_r, spacing, edge_width, pattern_thickness, center = false) {
|
||||
half_w = cube_width / 2;
|
||||
range_width = (cube_width + spacing) * rows;
|
||||
|
||||
color("green") translate([0, 0, cube_width])
|
||||
intersection() {
|
||||
dancing_cubes(rows, cube_width, shaft_r, spacing, edge_width, center = center);
|
||||
|
||||
intersection() {
|
||||
linear_extrude(pattern_thickness)
|
||||
square(range_width, center = center);
|
||||
children();
|
||||
}
|
||||
}
|
||||
|
||||
dancing_cubes(rows, cube_width, shaft_r, spacing, edge_width, center = center);
|
||||
}
|
||||
|
||||
|
199
examples/dragon.scad
Normal file
@@ -0,0 +1,199 @@
|
||||
include <helix.scad>;
|
||||
include <bezier_curve.scad>;
|
||||
include <along_with.scad>;
|
||||
include <shape_trapezium.scad>;
|
||||
include <ellipse_extrude.scad>;
|
||||
|
||||
r1 = 25;
|
||||
r2 = 15;
|
||||
levels = 3;
|
||||
level_dist = 20;
|
||||
|
||||
module scales(ang, leng, radius, height, thickness) {
|
||||
module one_scale() {
|
||||
rotate([0, ang, 0])
|
||||
linear_extrude(thickness, center = true)
|
||||
scale([leng, 1])
|
||||
circle(1, $fn = 4);
|
||||
}
|
||||
|
||||
for(a = [0:30:330]) {
|
||||
rotate(a)
|
||||
translate([radius, 0, height])
|
||||
one_scale();
|
||||
|
||||
rotate(a + 15)
|
||||
translate([radius, 0, height + 1.75])
|
||||
one_scale();
|
||||
}
|
||||
}
|
||||
|
||||
module one_segment() {
|
||||
// scales
|
||||
scale([1,0.85,1]) union() {
|
||||
scales(60, 4, 5, 0, 1.5);
|
||||
scales(75, 2.5, 5, -4, 1.25);
|
||||
scales(100, 1.25, 4.5, -7, 1);
|
||||
scales(110, 1.25, 3, -9, 1);
|
||||
scales(120, 2.5, 2, -9, 1);
|
||||
}
|
||||
|
||||
// hair
|
||||
for(i = [0:5]) {
|
||||
rotate([15 -15 * i, 0, 0])
|
||||
translate([0, 3, -4])
|
||||
rotate([45, 0, 0])
|
||||
rotate([0, 90, 0])
|
||||
linear_extrude(2, center = true)
|
||||
scale([3.5, 2, 1])
|
||||
circle(3, $fn = 3);
|
||||
}
|
||||
|
||||
scale([1, 1, 1.1]) sphere(5);
|
||||
|
||||
// belly
|
||||
translate([0, -3, 1])
|
||||
rotate([-10, 0, 0])
|
||||
scale([1.1, 0.8, 1.25])
|
||||
sphere(5, $fn = 8);
|
||||
|
||||
}
|
||||
|
||||
module head(angy_angz) {
|
||||
module hair() {
|
||||
for(i = [18:35]) {
|
||||
rotate(i * 10)
|
||||
translate([0, -14, 0])
|
||||
rotate([9, 0, 0])
|
||||
linear_extrude(15, scale = 0, twist = 30)
|
||||
translate([0, 10, 0])
|
||||
circle(3, $fn = 3);
|
||||
}
|
||||
|
||||
for(i = [0:35]) {
|
||||
rotate(i * 10)
|
||||
translate([0, -12, 0])
|
||||
rotate([5, 0, 0])
|
||||
linear_extrude(20, scale = 0, twist = 30)
|
||||
translate([0, 10, 0])
|
||||
circle(2, $fn = 3);
|
||||
}
|
||||
|
||||
for(i = [0:35]) {
|
||||
rotate(i * 10)
|
||||
translate([0, -10, 0])
|
||||
rotate([2, 0, 0])
|
||||
linear_extrude(22, scale = 0, twist = -30)
|
||||
translate([0, 10, 0])
|
||||
circle(3, $fn = 3);
|
||||
}
|
||||
}
|
||||
|
||||
module one_horn() {
|
||||
translate([-10, -4, -1])
|
||||
rotate([40, -25, 0])
|
||||
linear_extrude(30, scale = 0, twist = -90)
|
||||
translate([7.5, 0, 0])
|
||||
circle(3, $fn = 4);
|
||||
}
|
||||
|
||||
module mouth() {
|
||||
translate([0, 0, -2])
|
||||
rotate([90, 0, -90])
|
||||
ellipse_extrude(8, slices = 2)
|
||||
polygon(
|
||||
shape_trapezium([4, 15],
|
||||
h = 22,
|
||||
corner_r = 0)
|
||||
);
|
||||
|
||||
translate([0, 0, -3])
|
||||
rotate([90, 0, -90])
|
||||
ellipse_extrude(6, slices = 4)
|
||||
polygon(
|
||||
shape_trapezium([6, 20],
|
||||
h = 20,
|
||||
corner_r = 0)
|
||||
);
|
||||
|
||||
mirror([1, 0, 0])
|
||||
translate([0, 0, -3])
|
||||
rotate([85, 0, -90])
|
||||
ellipse_extrude(4, slices = 2)
|
||||
polygon(
|
||||
shape_trapezium([6, 19],
|
||||
h = 20,
|
||||
corner_r = 0)
|
||||
);
|
||||
}
|
||||
|
||||
module one_eye() {
|
||||
translate([-5, 3, -2])
|
||||
rotate([-15, 0, 75])
|
||||
scale([1, 1, 1.5])
|
||||
sphere(1.5, $fn = 5);
|
||||
|
||||
translate([-5.5, 3.5, -2.5])
|
||||
rotate([-15, 0, 75])
|
||||
sphere(0.5, $fn = 12);
|
||||
}
|
||||
|
||||
module one_beard() {
|
||||
translate([-11, -12, -11])
|
||||
rotate(180)
|
||||
linear_extrude(10, scale = 0, twist = 90)
|
||||
translate([-10, -10, 0])
|
||||
circle(0.75, $fn = 6);
|
||||
}
|
||||
|
||||
|
||||
|
||||
rotate([0, angy_angz[0] + 15, angy_angz[1]])
|
||||
translate([0, 0, -25 / 2])
|
||||
scale(1.15) {
|
||||
scale([0.8, 0.9, 1]) hair();
|
||||
|
||||
translate([0, 0, 2]) {
|
||||
rotate(-90) {
|
||||
one_horn();
|
||||
mirror([-1, 0, 0]) one_horn();
|
||||
}
|
||||
|
||||
mouth();
|
||||
|
||||
one_eye();
|
||||
mirror([0, 1, 0]) one_eye();
|
||||
|
||||
one_beard();
|
||||
mirror([0, 1, 0]) one_beard();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module dragon() {
|
||||
path_pts = helix(
|
||||
radius = [r1, r2],
|
||||
levels = levels,
|
||||
level_dist = level_dist,
|
||||
vt_dir = "SPI_DOWN",
|
||||
rt_dir = "CLK",
|
||||
$fn = 36
|
||||
);
|
||||
|
||||
|
||||
angy_angz = __angy_angz(path_pts[0], path_pts[1]);
|
||||
|
||||
|
||||
scale(1.1)
|
||||
along_with(path_pts, scale = 0.7, method = "EULER_ANGLE")
|
||||
one_segment();
|
||||
|
||||
translate([19, 0, 65])
|
||||
rotate([95, 0, 0])
|
||||
head(angy_angz);
|
||||
}
|
||||
|
||||
translate([0, 0, 6]) dragon($fn = 12);
|
||||
linear_extrude(65, scale = 0.4) circle(30);
|
||||
translate([0, 0, 65]) linear_extrude(15, scale = 0.01) circle(30 * 0.4);
|
||||
|
126
examples/floor_stand/floor_stand.scad
Normal file
@@ -0,0 +1,126 @@
|
||||
module floor_stand(width, height, thickness, spacing) {
|
||||
half_w = width / 2;
|
||||
half_h = height / 2;
|
||||
half_th = thickness / 2;
|
||||
|
||||
double_spacing = spacing * 2;
|
||||
|
||||
$fn = 24;
|
||||
|
||||
points = [
|
||||
[half_w, -half_h], [width / 2.25, half_h],
|
||||
[-width / 2.25, half_h], [-half_w, -half_h]
|
||||
];
|
||||
|
||||
module board_base() {
|
||||
translate([0, -half_h, 0])
|
||||
difference() {
|
||||
polygon(points);
|
||||
|
||||
translate([0, -half_h, 0])
|
||||
scale([0.6, 0.1])
|
||||
polygon(points);
|
||||
}
|
||||
}
|
||||
|
||||
module board_U() {
|
||||
angles = [0, 90, 0];
|
||||
difference() {
|
||||
union() {
|
||||
linear_extrude(thickness, center = true)
|
||||
difference() {
|
||||
board_base();
|
||||
square([width / 1.5, height / 3], center = true);
|
||||
}
|
||||
rotate(angles)
|
||||
linear_extrude(width / 2.25 * 2, center = true)
|
||||
circle(half_th);
|
||||
}
|
||||
|
||||
rotate(angles) {
|
||||
linear_extrude(width / 1.5, center = true)
|
||||
circle(thickness, $fn = 24);
|
||||
|
||||
cone(half_th - spacing, length = half_w / 1.5 - spacing, spacing = spacing, ends = true, void = true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module board_T() {
|
||||
linear_extrude(thickness, center = true)
|
||||
union() {
|
||||
difference() {
|
||||
board_base();
|
||||
square([width, height / 3], center = true);
|
||||
}
|
||||
|
||||
translate([0, -height / 12 - spacing / 2, 0])
|
||||
difference() {
|
||||
square([width / 1.5 - double_spacing, height / 6 + spacing], center = true);
|
||||
square([width / 1.5 - thickness * 2, height / 6], center = true);
|
||||
}
|
||||
}
|
||||
|
||||
rotate([0, 90, 0]) {
|
||||
linear_extrude(width / 1.5 - double_spacing, center = true)
|
||||
circle(half_th, $fn = 24);
|
||||
cone(half_th - spacing, length = half_w / 1.5 - spacing, spacing = spacing, ends = true);
|
||||
}
|
||||
}
|
||||
|
||||
module border() {
|
||||
translate([0, 0, half_th])
|
||||
color("black")
|
||||
linear_extrude(half_th / 2)
|
||||
hollow_out(shell_thickness = font_size / 4)
|
||||
offset(half_w / 10)
|
||||
scale([0.75, 0.675])
|
||||
polygon(points);
|
||||
}
|
||||
|
||||
module stick() {
|
||||
linear_extrude(thickness * 0.75)
|
||||
square([width / 12, half_w], center = true);
|
||||
}
|
||||
|
||||
module decorate() {
|
||||
rotate([-80, 0, 0])
|
||||
difference() {
|
||||
rotate([80, 0, 0])
|
||||
difference() {
|
||||
union() {
|
||||
color("yellow") children();
|
||||
translate([0, -height / 1.8, 0]) border();
|
||||
}
|
||||
// slot
|
||||
translate([0, -half_h - thickness, -half_th])
|
||||
stick();
|
||||
}
|
||||
|
||||
translate([0, 0, -height - half_th])
|
||||
linear_extrude(thickness)
|
||||
square(width, center = true);
|
||||
}
|
||||
}
|
||||
// stick
|
||||
translate([width, 0, 0])
|
||||
stick();
|
||||
|
||||
translate([0, 0, half_th])
|
||||
decorate()
|
||||
board_U();
|
||||
|
||||
translate([0, 0, half_th])
|
||||
rotate(180)
|
||||
decorate()
|
||||
board_T();
|
||||
|
||||
children(0);
|
||||
if($children == 1) {
|
||||
rotate(180)
|
||||
children(0);
|
||||
}
|
||||
else {
|
||||
children(1);
|
||||
}
|
||||
}
|
81
examples/floor_stand/floor_stand_symbol.scad
Normal file
@@ -0,0 +1,81 @@
|
||||
include <util/sub_str.scad>;
|
||||
include <util/split_str.scad>;
|
||||
include <multi_line_text.scad>;
|
||||
include <shape_taiwan.scad>;
|
||||
include <hollow_out.scad>;
|
||||
include <floor_stand.scad>;
|
||||
include <part/cone.scad>;
|
||||
|
||||
text = " Taiwan";
|
||||
font = "Arial Black";
|
||||
font_size = 5;
|
||||
line_spacing = 7;
|
||||
|
||||
stand_width = 40;
|
||||
stand_height = 80;
|
||||
stand_thickness = 4;
|
||||
stand_spacing = 0.5;
|
||||
|
||||
symbol_source = "DEFAULT"; // [DEFAULT, PNG, UNICODE]
|
||||
|
||||
/* [FOR PNG SYMBOL] */
|
||||
symbol_png = ""; // [image_surface:100x100]
|
||||
|
||||
/* [FOR UNICODE SYMBOL] */
|
||||
symbol_unicode = "X";
|
||||
symbol_font = "Webdings";
|
||||
symbol_font_size = 20;
|
||||
|
||||
module content(text, font, font_size, symbol_png, symbol_unicode, symbol_font, symbol_font_size, height, thickness, line_spacing) {
|
||||
half_h = height / 2;
|
||||
half_th = thickness / 2;
|
||||
|
||||
translate([0, -height / 1.8, thickness]) {
|
||||
color("black")
|
||||
linear_extrude(half_th / 2)
|
||||
union() {
|
||||
translate([0, -half_h / 3, 0])
|
||||
multi_line_text(
|
||||
split_str(text, " "),
|
||||
font = font,
|
||||
size = font_size,
|
||||
line_spacing = line_spacing,
|
||||
valign = "center",
|
||||
halign = "center"
|
||||
);
|
||||
}
|
||||
|
||||
if(symbol_source == "DEFAULT") {
|
||||
color("green")
|
||||
translate([0, half_h / 5, 0])
|
||||
scale([0.6, 0.6, 1])
|
||||
linear_extrude(half_th / 2)
|
||||
polygon(shape_taiwan(half_h * 1.5));
|
||||
}
|
||||
else if(symbol_source == "UNICODE") {
|
||||
color("black")
|
||||
linear_extrude(half_th / 2)
|
||||
translate([0, half_h / 5, 0])
|
||||
text(symbol_unicode, font = symbol_font, size = symbol_font_size, valign = "center", halign = "center");
|
||||
}
|
||||
else {
|
||||
symbol_png_size = 100;
|
||||
symbol_png_scale = 0.25;
|
||||
|
||||
color("black")
|
||||
translate([0, half_h / 5, half_th / 4])
|
||||
scale([symbol_png_scale, symbol_png_scale, 1])
|
||||
difference() {
|
||||
cube([symbol_png_size * 0.99, symbol_png_size * 0.99, stand_thickness / 4], center = true);
|
||||
|
||||
translate([0, 0, -50])
|
||||
scale([1, 1, 100])
|
||||
surface(symbol_png, center = true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
floor_stand(stand_width, stand_height, stand_thickness, stand_spacing)
|
||||
content(text, font, font_size, symbol_png, symbol_unicode, symbol_font, symbol_font_size, stand_height, stand_thickness, line_spacing);
|
36
examples/floor_stand/floor_stand_text.scad
Normal file
@@ -0,0 +1,36 @@
|
||||
include <util/sub_str.scad>;
|
||||
include <util/split_str.scad>;
|
||||
include <hollow_out.scad>;
|
||||
include <floor_stand.scad>;
|
||||
include <multi_line_text.scad>;
|
||||
include <part/cone.scad>;
|
||||
|
||||
text = "Coder at Work";
|
||||
font = "Arial Black";
|
||||
font_size = 6;
|
||||
line_spacing = 10;
|
||||
|
||||
stand_width = 40;
|
||||
stand_height = 80;
|
||||
stand_thickness = 4;
|
||||
stand_spacing = 0.5;
|
||||
|
||||
module words(text, font, font_size, height, thickness, line_spacing) {
|
||||
half_th = thickness / 2;
|
||||
|
||||
color("black")
|
||||
translate([0, -height / 1.8, thickness])
|
||||
linear_extrude(half_th / 2) {
|
||||
multi_line_text(
|
||||
split_str(text, " "),
|
||||
font = font,
|
||||
size = font_size,
|
||||
line_spacing = line_spacing,
|
||||
valign = "center",
|
||||
halign = "center"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
floor_stand(stand_width, stand_height, stand_thickness, stand_spacing)
|
||||
words(text, font, font_size, stand_height, stand_thickness, line_spacing);
|
101
examples/heart_chain.scad
Normal file
@@ -0,0 +1,101 @@
|
||||
include <archimedean_spiral.scad>;
|
||||
include <arc.scad>;
|
||||
|
||||
chars = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989";
|
||||
|
||||
|
||||
module heart(radius, center = false) {
|
||||
rotated_angle = 45;
|
||||
diameter = radius * 2;
|
||||
|
||||
module heart_sub_component() {
|
||||
translate([-radius * cos(rotated_angle), 0, 0])
|
||||
rotate(-rotated_angle) union() {
|
||||
circle(radius);
|
||||
translate([0, -radius, 0])
|
||||
square(diameter);
|
||||
}
|
||||
}
|
||||
|
||||
offsetX = center ? 0 : radius + radius * cos(45);
|
||||
offsetY = center ? 1.5 * radius * sin(45) - 0.5 * radius : 3 * radius * sin(45);
|
||||
translate([offsetX, offsetY, 0]) {
|
||||
heart_sub_component();
|
||||
mirror([1, 0, 0]) heart_sub_component();
|
||||
}
|
||||
}
|
||||
|
||||
module heart_with_ears(heart_width, thickness, spacing) {
|
||||
module ear(radius, thickness, spacing) {
|
||||
width = radius / 1.5;
|
||||
|
||||
linear_extrude(thickness)
|
||||
arc(radius, [0, 240], width, "LINE_OUTWARD");
|
||||
|
||||
translate([0, 0, thickness + spacing])
|
||||
linear_extrude(thickness)
|
||||
arc(radius, [240, 360], width, "LINE_OUTWARD");
|
||||
|
||||
linear_extrude(thickness * 2 + spacing)
|
||||
arc(radius, [0, 20], width, "LINE_OUTWARD");
|
||||
}
|
||||
|
||||
heart_radius = 0.5 * heart_width / (1 + cos(45));
|
||||
ring_radius = heart_radius / 3;
|
||||
ring_x = (heart_width / 2 + spacing) * 1.075;
|
||||
ring_y = heart_radius * sin(60);
|
||||
ring_thickness = 0.5 * (thickness - spacing);
|
||||
|
||||
linear_extrude(thickness)
|
||||
heart(heart_radius, center = true);
|
||||
|
||||
translate([ring_x, ring_y, 0])
|
||||
rotate(-40)
|
||||
ear(ring_radius, ring_thickness, spacing);
|
||||
|
||||
translate([-ring_x, ring_y, 0])
|
||||
rotate(125)
|
||||
ear(ring_radius, ring_thickness, spacing);
|
||||
}
|
||||
|
||||
module text_heart(char, width, thickness, spacing) {
|
||||
radius = 0.5 * width / (1 + cos(45));
|
||||
half_thickness = thickness / 2;
|
||||
difference() {
|
||||
heart_with_ears(width, thickness, spacing);
|
||||
translate([0, 0, half_thickness])
|
||||
linear_extrude(half_thickness)
|
||||
offset(-half_thickness)
|
||||
heart(radius, center = true);
|
||||
}
|
||||
translate([0, radius / 4, half_thickness])
|
||||
linear_extrude(half_thickness)
|
||||
text(char, font = "Arial Black", size = radius * 1.2, valign = "center", halign="center");
|
||||
}
|
||||
|
||||
module heart_chain(chars) {
|
||||
$fn = 48;
|
||||
heart_thickness = 2.5;
|
||||
heart_width = 18;
|
||||
spacing = 0.5;
|
||||
leng = len(chars);
|
||||
|
||||
points_angles = archimedean_spiral(
|
||||
arm_distance = 20,
|
||||
init_angle = 720,
|
||||
point_distance = 23.8,
|
||||
num_of_points = leng
|
||||
);
|
||||
|
||||
for(i = [0:leng - 1]) {
|
||||
pt = points_angles[i][0];
|
||||
angle = points_angles[i][1];
|
||||
translate(pt)
|
||||
rotate(angle + 90)
|
||||
text_heart(chars[i], heart_width, heart_thickness, spacing);
|
||||
}
|
||||
}
|
||||
|
||||
heart_chain(chars);
|
||||
|
||||
|