Compare commits
511 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
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 | ||
|
dc5e063b25 | ||
|
aae8f688c0 | ||
|
60931ec8b9 | ||
|
5a15dd9fdb | ||
|
6bb3b445b4 | ||
|
66bb8ef643 | ||
|
4d02e6bb65 | ||
|
681d697840 | ||
|
8a8e28c61d | ||
|
55c2cd6fda | ||
|
273d32dc69 | ||
|
472d5c7ba7 | ||
|
eba7f63576 | ||
|
ec18d2eeeb | ||
|
51e5356f21 | ||
|
582050d096 | ||
|
b7d8d3e87c | ||
|
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 | ||
|
ac1167eacc | ||
|
691a8f3ff9 | ||
|
e6280ad9f4 | ||
|
0c6744c62d | ||
|
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 | ||
|
d1bd586bee | ||
|
f88b7bf8f3 | ||
|
fbd10cd25d | ||
|
dfe76bff78 | ||
|
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 | ||
|
8ceae06645 | ||
|
299b3869fd | ||
|
80fb650df4 | ||
|
919ae2f158 | ||
|
a851ee6bb7 | ||
|
340847cd19 | ||
|
5b21cc10d7 | ||
|
ab99a24352 | ||
|
f4696f231e | ||
|
218db7f7a8 | ||
|
bb8604e42b | ||
|
9182575ff2 | ||
|
ed9477ece5 | ||
|
56d2fb648f | ||
|
057ad863af | ||
|
002711ae3e | ||
|
8a5956e852 | ||
|
0eb1387f27 | ||
|
46dfe4ff25 | ||
|
323e81a82c | ||
|
61c6e9f70d | ||
|
2af270a8da | ||
|
c4c9831798 | ||
|
03ac58acaa | ||
|
2110b9cb31 | ||
|
93d7c0239d | ||
|
5a37620a5b | ||
|
8bc6a0b4c9 | ||
|
06831ffe15 | ||
|
df5775bd05 | ||
|
6f83a6192a | ||
|
85f8acdbee | ||
|
c75bf8bfee | ||
|
2d755a6cbf | ||
|
01fc0298f6 | ||
|
a07244fd47 | ||
|
e3443bf0e8 | ||
|
e2771ca01c | ||
|
643266f4a3 | ||
|
5a0a4a8fa4 | ||
|
78127faba6 | ||
|
d203fe4030 | ||
|
3be3a271e6 | ||
|
f5d813839b | ||
|
0a604c5793 | ||
|
f1a8d6f0dc | ||
|
af084fb043 | ||
|
0510b18516 | ||
|
78bfb2f31d | ||
|
e185e9b7e9 | ||
|
3fb08570c6 | ||
|
41db148815 | ||
|
beaebfcc37 | ||
|
6493eea0ac | ||
|
6299da9d23 | ||
|
e5850f871d | ||
|
85c75018f1 | ||
|
e84c7bc7a0 | ||
|
26db1cf25b | ||
|
f9d609087d | ||
|
14bbb3f205 | ||
|
3376b870a7 | ||
|
90d2f1ac9c | ||
|
fe8256ef0d | ||
|
7351e401c9 | ||
|
e26d1d3233 | ||
|
ad7819f1eb | ||
|
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 | ||
|
658fe213d6 | ||
|
184b0be7e8 | ||
|
e0874c5ca3 | ||
|
84f27c1ce3 | ||
|
2f8f51ad30 | ||
|
76bbb93724 | ||
|
f2f25fcc44 | ||
|
576470477a | ||
|
8f8e1f717a | ||
|
91d39de4a6 | ||
|
5e3d1ced28 | ||
|
1d812f8750 | ||
|
6854c86f90 | ||
|
ff63835009 | ||
|
f6a1050a01 | ||
|
aabc373798 | ||
|
e9e346cb51 | ||
|
810a1d3ece | ||
|
43a52bbaa0 | ||
|
fdefc03774 | ||
|
56d755ec06 | ||
|
b2abc0dde0 | ||
|
49398206de | ||
|
d2287ff119 | ||
|
731b4ff1ab | ||
|
bb45854f33 | ||
|
7648373e01 | ||
|
0e9710b8d4 | ||
|
69e6d24b08 | ||
|
47523ea95c | ||
|
99e91aafaa | ||
|
106be46e64 | ||
|
cc0e7499f9 | ||
|
840799f6cc | ||
|
10aed43d98 | ||
|
217878454a | ||
|
0b4d1e3840 | ||
|
dd90b4c106 | ||
|
ea39db6ca2 | ||
|
d904a0b629 | ||
|
eed652ee17 | ||
|
208fd1cb0f | ||
|
40280f6927 | ||
|
53cd4f3d4a | ||
|
31ce310080 | ||
|
46633f444a | ||
|
42d90d68ff | ||
|
8b70b3e2b4 | ||
|
59e9f97fa7 | ||
|
571ddccf5c | ||
|
68f2539726 | ||
|
b9518ad8ed | ||
|
944d63dc68 | ||
|
309a2086a3 | ||
|
b66c36fc55 | ||
|
31a2e1c54e | ||
|
80e296d9dc | ||
|
12b5df8a0f | ||
|
53f9583cf3 | ||
|
1401a00876 | ||
|
5dfb293702 | ||
|
2aca57c779 | ||
|
60dee6f872 | ||
|
c5ca8528d5 | ||
|
0cec181a0b | ||
|
b9a3d5c496 | ||
|
699de29c53 | ||
|
1f3022a3cc | ||
|
e081d03193 | ||
|
8f40ae8b30 | ||
|
afd460579e | ||
|
c0902b00cc | ||
|
a71b9fe174 | ||
|
90b2d542ef | ||
|
6a83c26e9b | ||
|
652f763c90 | ||
|
6babff457e | ||
|
429abba8ae | ||
|
561e2b69b1 | ||
|
7dbfbc3741 | ||
|
e0256a0925 | ||
|
599ffdb4ab | ||
|
00dfbd2366 | ||
|
d8027d45e2 | ||
|
a0f16c9cd6 | ||
|
04fd1590a7 | ||
|
4e1eca2df2 | ||
|
8457bd403c | ||
|
9f0693c3ae | ||
|
769894d1a3 | ||
|
3ec8d13a14 | ||
|
295ff73223 | ||
|
e20d104cc7 | ||
|
1fcf8b113f | ||
|
d771a88642 | ||
|
de31131741 | ||
|
944152d326 | ||
|
6d62ac0a11 | ||
|
9f2cb46427 | ||
|
5615800a56 | ||
|
90f860cbc7 | ||
|
6754d231fc | ||
|
e099ebd012 | ||
|
81e4f45f89 | ||
|
46ffc7601d | ||
|
31dba8711d | ||
|
ad983b8670 | ||
|
0d35fc2023 | ||
|
6851464068 | ||
|
b9d93bac84 | ||
|
645d0946c1 | ||
|
844c6e7d9b | ||
|
5597fa0ce1 | ||
|
64eaa6d7e1 | ||
|
840fc0eac5 | ||
|
98bac0bdff | ||
|
8f747f2e75 | ||
|
4e3016859c | ||
|
7c38ea2009 | ||
|
ce4d11cf52 | ||
|
b4e4f60902 | ||
|
feb0e351b6 | ||
|
e670ad6b9d | ||
|
bf1cc23f0f | ||
|
fa966bdde8 | ||
|
db8792fc4e | ||
|
7d5e18ff8c | ||
|
8722f971ba | ||
|
6c0a0bdfb0 | ||
|
156e15bc99 | ||
|
b2a521a11f | ||
|
597551e24a | ||
|
bf9a23d5c5 | ||
|
cbf59ce0b4 | ||
|
fafa551959 | ||
|
63dcbe259d | ||
|
4ea52e328e | ||
|
1a92c27b28 | ||
|
a3e2077b46 | ||
|
afa0e99fe5 | ||
|
09016a31cd | ||
|
ec102fbdee | ||
|
106695b988 | ||
|
ee31927015 | ||
|
e60c451033 | ||
|
53b7d7a628 | ||
|
77b3c4c9db | ||
|
bc7f57813b | ||
|
ad4a992c9d | ||
|
f8f7adbb45 | ||
|
f690952f1f | ||
|
ac209d6125 | ||
|
5d394d8738 | ||
|
b3ffb9ab72 | ||
|
665fb09864 | ||
|
f33d6c5671 | ||
|
f985e13231 | ||
|
7b1a683c74 | ||
|
ff8d36336e | ||
|
49be3b9b9f | ||
|
e13abc57ce | ||
|
6fbe42ba8f | ||
|
48e52fa48b | ||
|
0dbe93d16b | ||
|
bdaa05823c | ||
|
035e1fa1b4 | ||
|
33b3d6de67 | ||
|
305c2f9ee4 | ||
|
0958207e53 | ||
|
ed16cc3289 | ||
|
9c57a539b2 | ||
|
d09926285a | ||
|
a767e2240c | ||
|
f42a51d896 | ||
|
af7e39a97e | ||
|
0c45a94038 | ||
|
46777fa403 | ||
|
118ee961ee | ||
|
57ed5a8901 | ||
|
4fe79dc568 | ||
|
3603b92258 | ||
|
502dcdde9b | ||
|
daa281bb70 | ||
|
35132b603f | ||
|
ce14b4fec7 | ||
|
9e26bd35ec | ||
|
70db05592b | ||
|
b9bf11ebe9 | ||
|
32e582554c | ||
|
5972c4f551 | ||
|
f215f27f9f | ||
|
69f43afe46 | ||
|
8ada3785be | ||
|
42cc92e9b4 | ||
|
2354f9aeaa | ||
|
8385bbb145 | ||
|
f6c03d239f | ||
|
3e285fc1e8 | ||
|
66e1001ba4 | ||
|
4579614ddb | ||
|
e1bf720acb | ||
|
db004887d5 | ||
|
d746ff3078 | ||
|
fece5c2bde | ||
|
fad69acb2a | ||
|
f60d1558ce | ||
|
8e96639d5a | ||
|
7ec08a7603 | ||
|
3dd15d9f78 | ||
|
fe66e2effa | ||
|
87052bb172 | ||
|
e89804cadf | ||
|
47997a5cbd | ||
|
aee4e7b68a | ||
|
3efef1b2bb | ||
|
ce6ef4c039 | ||
|
07074ee47c | ||
|
334493c496 | ||
|
a3535ee529 | ||
|
691274cb07 | ||
|
022269a13b | ||
|
92f4e12a9a | ||
|
79f49b9262 | ||
|
7d45b16691 | ||
|
cca77c3c65 | ||
|
a8063a2be2 | ||
|
d6aae5fdf6 | ||
|
07ed786ea1 | ||
|
87f5a89cbb | ||
|
29e387cdcf |
69
README.md
@@ -1,13 +1,15 @@
|
||||
# dotSCAD
|
||||
# dotSCAD 2.0
|
||||
|
||||
> Helpful modules and functions when playing OpenSCAD.
|
||||
> **Reduce the burden of 3D modeling in mathematics.**
|
||||
|
||||

|
||||

|
||||
|
||||
[](https://github.com/JustinSDK/lib-openscad/blob/master/LICENSE)
|
||||
|
||||
## Introduction
|
||||
|
||||
**dotSCAD 2.0 is based on OpenSCAD 2019.05.** For old 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,10 +35,12 @@ 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.**
|
||||
|
||||
## Documentation
|
||||
|
||||
- 2D
|
||||
@@ -39,6 +53,7 @@ Too many dependencies? Because OpenSCAD doesn't provide namespace management, I
|
||||
- [hexagons](https://openhome.cc/eGossip/OpenSCAD/lib-hexagons.html)
|
||||
- [polytransversals](https://openhome.cc/eGossip/OpenSCAD/lib-polytransversals.html)
|
||||
- [multi_line_text](https://openhome.cc/eGossip/OpenSCAD/lib-multi_line_text.html)
|
||||
- [voronoi2d](https://openhome.cc/eGossip/OpenSCAD/lib-voronoi2d.html)
|
||||
|
||||
- 3D
|
||||
- [rounded_cube](https://openhome.cc/eGossip/OpenSCAD/lib-rounded_cube.html)
|
||||
@@ -49,19 +64,26 @@ Too many dependencies? Because OpenSCAD doesn't provide namespace management, I
|
||||
- [hull_polyline3d](https://openhome.cc/eGossip/OpenSCAD/lib-hull_polyline3d.html)
|
||||
- [function_grapher](https://openhome.cc/eGossip/OpenSCAD/lib-function_grapher.html)
|
||||
- [polysections](https://openhome.cc/eGossip/OpenSCAD/lib-polysections.html)
|
||||
- [starburst](https://openhome.cc/eGossip/OpenSCAD/lib-starburst.html)
|
||||
- [voronoi3d](https://openhome.cc/eGossip/OpenSCAD/lib-voronoi3d.html)
|
||||
|
||||
- Transformation
|
||||
- [along_with](https://openhome.cc/eGossip/OpenSCAD/lib-along_with.html)
|
||||
- [hollow_out](https://openhome.cc/eGossip/OpenSCAD/lib-hollow_out.html)
|
||||
- [bend](https://openhome.cc/eGossip/OpenSCAD/lib-bend.html)
|
||||
- [shear](https://openhome.cc/eGossip/OpenSCAD/lib-shear.html)
|
||||
|
||||
- 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/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)
|
||||
- [midpt_smooth](https://openhome.cc/eGossip/OpenSCAD/lib-midpt_smooth.html)
|
||||
- [trim_shape](https://openhome.cc/eGossip/OpenSCAD/lib-trim_shape.html)
|
||||
- [triangulate](https://openhome.cc/eGossip/OpenSCAD/lib-triangulate.html)
|
||||
|
||||
- Path
|
||||
- [arc_path](https://openhome.cc/eGossip/OpenSCAD/lib-arc_path.html)
|
||||
@@ -73,6 +95,7 @@ Too many dependencies? Because OpenSCAD doesn't provide namespace management, I
|
||||
- [golden_spiral](https://openhome.cc/eGossip/OpenSCAD/lib-golden_spiral.html)
|
||||
- [archimedean_spiral](https://openhome.cc/eGossip/OpenSCAD/lib-archimedean_spiral.html)
|
||||
- [sphere_spiral](https://openhome.cc/eGossip/OpenSCAD/lib-sphere_spiral.html)
|
||||
- [torus_knot](https://openhome.cc/eGossip/OpenSCAD/lib-torus_knot.html)
|
||||
|
||||
- Extrusion
|
||||
- [box_extrude](https://openhome.cc/eGossip/OpenSCAD/lib-box_extrude.html)
|
||||
@@ -95,6 +118,7 @@ Too many dependencies? Because OpenSCAD doesn't provide namespace management, I
|
||||
- [shape_path_extend](https://openhome.cc/eGossip/OpenSCAD/lib-shape_path_extend.html)
|
||||
|
||||
- 2D Shape Extrusion
|
||||
- [bend_extrude](https://openhome.cc/eGossip/OpenSCAD/lib-bend_extrude.html)
|
||||
- [path_extrude](https://openhome.cc/eGossip/OpenSCAD/lib-path_extrude.html)
|
||||
- [ring_extrude](https://openhome.cc/eGossip/OpenSCAD/lib-ring_extrude.html)
|
||||
- [helix_extrude](https://openhome.cc/eGossip/OpenSCAD/lib-helix_extrude.html)
|
||||
@@ -102,11 +126,34 @@ Too many dependencies? Because OpenSCAD doesn't provide namespace management, I
|
||||
- [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)
|
||||
|
||||
- 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)
|
||||
- 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)
|
||||
|
||||
- Matrix
|
||||
- [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)
|
||||
|
||||
- Turtle
|
||||
- [turtle/turtle2d](https://openhome.cc/eGossip/OpenSCAD/lib2-turtle2d.html)
|
||||
- [turtle/turtle3d](https://openhome.cc/eGossip/OpenSCAD/lib2-turtle3d.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)
|
||||
|
||||
## Bugs and Feedback
|
||||
|
||||
For bugs, questions and discussions please use the [Github Issues](https://github.com/JustinSDK/dotSCAD/issues).
|
||||
|
101
RELEASE.md
Normal file
@@ -0,0 +1,101 @@
|
||||
> Version numbers are based on [Semantic Versioning](https://semver.org/).
|
||||
|
||||
# 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.
|
||||
|
||||
# v1.3.2
|
||||
- All-in-one source file.
|
||||
- You can use `include <dotSCAD.scad>;` or `use <dotSCAD.scad>;` if you really don't want to care about dependencies.
|
||||
|
||||
- Bugfixes
|
||||
- `along_with`: Wrong variable scope.
|
||||
|
||||
# v1.3.1
|
||||
- Bugfixes
|
||||
- `in_polyline`: Wrong parameter name.
|
||||
- `in_shape`: Missing dependency.
|
||||
- `along_with`: Avoid warning when using 2D points.
|
||||
|
||||
# v1.3
|
||||
- New modules:
|
||||
- [bend_extrude](https://openhome.cc/eGossip/OpenSCAD/lib-bend_extrude.html)
|
||||
- [voronoi2d](https://openhome.cc/eGossip/OpenSCAD/lib-voronoi2d.html)
|
||||
- [voronoi3d](https://openhome.cc/eGossip/OpenSCAD/lib-voronoi3d.html)
|
||||
|
||||
- New functions:
|
||||
- [in_shape](https://openhome.cc/eGossip/OpenSCAD/lib-in_shape.html)
|
||||
- [in_polyline](https://openhome.cc/eGossip/OpenSCAD/lib-in_polyline.html)
|
||||
- [midpt_smooth](https://openhome.cc/eGossip/OpenSCAD/lib-midpt_smooth.html)
|
||||
- [trim_shape](https://openhome.cc/eGossip/OpenSCAD/lib-trim_shape.html)
|
||||
- [triangulate](https://openhome.cc/eGossip/OpenSCAD/lib-triangulate.html)
|
||||
|
||||
- New parameters:
|
||||
- `distance` of [shape_taiwan](https://openhome.cc/eGossip/OpenSCAD/lib-shape_taiwan.html)
|
||||
- `epsilon` of [bijection_offset](https://openhome.cc/eGossip/OpenSCAD/lib-bijection_offset.html)
|
||||
- `method` of [path_extrude](https://openhome.cc/eGossip/OpenSCAD/lib-path_extrude.html)
|
||||
- `method` of [along_with](https://openhome.cc/eGossip/OpenSCAD/lib-along_with.html)
|
||||
|
||||
# v1.2
|
||||
- New modules and functions:
|
||||
- [starburst](https://openhome.cc/eGossip/OpenSCAD/lib-starburst.html)
|
||||
- [torus_knot](https://openhome.cc/eGossip/OpenSCAD/lib-torus_knot.html)
|
||||
- [bijection_offset](https://openhome.cc/eGossip/OpenSCAD/lib-bijection_offset.html)
|
||||
- [path_scaling_sections](https://openhome.cc/eGossip/OpenSCAD/lib-path_scaling_sections.html)
|
||||
|
||||
- Others
|
||||
- Avoid warnings when using newer versions of OpenSCAD after 2015.03.
|
||||
|
||||
# v1.1.1
|
||||
- Bugfixes
|
||||
- `m_rotation` returns an identity matrix if `a` is 0.
|
||||
- The `path_pts` parameter of `path_extrude` accepts two or three points.
|
||||
- The `points` parameter of `along_with` accepts two or three points.
|
||||
|
||||
- Others
|
||||
- OpenSCAD has built-in matrix multiplication so `m_multiply` is not necessary.
|
||||
|
||||
# v1.1
|
||||
- New matrix functions:
|
||||
- [m_multiply](https://openhome.cc/eGossip/OpenSCAD/lib-m_multiply.html)
|
||||
- [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)
|
||||
|
||||
- New modules:
|
||||
- [shear](https://openhome.cc/eGossip/OpenSCAD/lib-shear.html)
|
||||
|
||||
- New Parameters:
|
||||
- added `v` parameter to [rotate_p](https://openhome.cc/eGossip/OpenSCAD/lib-rotate_p.html)
|
||||
|
||||
- Improved Performance:
|
||||
- [path_extrude](https://openhome.cc/eGossip/OpenSCAD/lib-path_extrude.html)
|
||||
- [align_with](https://openhome.cc/eGossip/OpenSCAD/lib-along_with.html)
|
||||
|
||||
# v1.0.1
|
||||
- Fixed `path_extrude` crossing problem. See [issue 3](https://github.com/JustinSDK/dotSCAD/issues/3).
|
||||
- Fixed `along_with` crossing problems (similar to `path_extrude`.)
|
||||
|
||||
# v1.0
|
||||
- First release.
|
BIN
TaiwaneseBlackBear.JPG
Normal file
After Width: | Height: | Size: 68 KiB |
BIN
WhirlingTaiwan.JPG
Normal file
After Width: | Height: | Size: 44 KiB |
114
all/dotSCAD.scad
Normal file
@@ -0,0 +1,114 @@
|
||||
include <along_with.scad>;
|
||||
include <arc.scad>;
|
||||
include <arc_path.scad>;
|
||||
include <archimedean_spiral.scad>;
|
||||
include <archimedean_spiral_extrude.scad>;
|
||||
include <bend.scad>;
|
||||
include <bend_extrude.scad>;
|
||||
include <bezier_curve.scad>;
|
||||
include <bezier_smooth.scad>;
|
||||
include <bezier_surface.scad>;
|
||||
include <bijection_offset.scad>;
|
||||
include <box_extrude.scad>;
|
||||
include <circle_path.scad>;
|
||||
include <cross_sections.scad>;
|
||||
include <crystal_ball.scad>;
|
||||
include <ellipse_extrude.scad>;
|
||||
include <function_grapher.scad>;
|
||||
include <golden_spiral.scad>;
|
||||
include <golden_spiral_extrude.scad>;
|
||||
include <helix.scad>;
|
||||
include <helix_extrude.scad>;
|
||||
include <hexagons.scad>;
|
||||
include <hollow_out.scad>;
|
||||
include <hull_polyline2d.scad>;
|
||||
include <hull_polyline3d.scad>;
|
||||
include <in_polyline.scad>;
|
||||
include <in_shape.scad>;
|
||||
include <line2d.scad>;
|
||||
include <line3d.scad>;
|
||||
<<<<<<< HEAD
|
||||
include <log.scad>;
|
||||
include <m_cumulate.scad>;
|
||||
include <m_mirror.scad>;
|
||||
include <m_rotation.scad>;
|
||||
include <m_scaling.scad>;
|
||||
include <m_shearing.scad>;
|
||||
include <m_translation.scad>;
|
||||
include <midpt_smooth.scad>;
|
||||
include <multi_line_text.scad>;
|
||||
include <parse_number.scad>;
|
||||
=======
|
||||
include <midpt_smooth.scad>;
|
||||
include <multi_line_text.scad>;
|
||||
>>>>>>> v2
|
||||
include <path_extrude.scad>;
|
||||
include <path_scaling_sections.scad>;
|
||||
include <paths2sections.scad>;
|
||||
include <pie.scad>;
|
||||
include <polyline2d.scad>;
|
||||
include <polyline3d.scad>;
|
||||
include <polysections.scad>;
|
||||
include <polytransversals.scad>;
|
||||
include <ring_extrude.scad>;
|
||||
include <rotate_p.scad>;
|
||||
include <rounded_cube.scad>;
|
||||
include <rounded_cylinder.scad>;
|
||||
include <rounded_extrude.scad>;
|
||||
include <rounded_square.scad>;
|
||||
include <shape_arc.scad>;
|
||||
include <shape_cyclicpolygon.scad>;
|
||||
include <shape_ellipse.scad>;
|
||||
include <shape_glued2circles.scad>;
|
||||
include <shape_path_extend.scad>;
|
||||
include <shape_pentagram.scad>;
|
||||
include <shape_pie.scad>;
|
||||
include <shape_square.scad>;
|
||||
include <shape_starburst.scad>;
|
||||
include <shape_superformula.scad>;
|
||||
include <shape_taiwan.scad>;
|
||||
include <shape_trapezium.scad>;
|
||||
include <shear.scad>;
|
||||
include <sphere_spiral.scad>;
|
||||
include <sphere_spiral_extrude.scad>;
|
||||
<<<<<<< HEAD
|
||||
include <split_str.scad>;
|
||||
include <starburst.scad>;
|
||||
include <stereographic_extrude.scad>;
|
||||
include <sub_str.scad>;
|
||||
include <torus_knot.scad>;
|
||||
include <triangulate.scad>;
|
||||
include <trim_shape.scad>;
|
||||
include <turtle2d.scad>;
|
||||
include <turtle3d.scad>;
|
||||
include <voronoi2d.scad>;
|
||||
include <voronoi3d.scad>;
|
||||
=======
|
||||
include <starburst.scad>;
|
||||
include <stereographic_extrude.scad>;
|
||||
include <torus_knot.scad>;
|
||||
include <triangulate.scad>;
|
||||
include <trim_shape.scad>;
|
||||
include <voronoi2d.scad>;
|
||||
include <voronoi3d.scad>;
|
||||
include <util/parse_number.scad>;
|
||||
include <util/split_str.scad>;
|
||||
include <util/sub_str.scad>;
|
||||
include <util/reverse.scad>;
|
||||
include <util/slice.scad>;
|
||||
include <util/sort.scad>;
|
||||
include <matrix/m_cumulate.scad>;
|
||||
include <matrix/m_mirror.scad>;
|
||||
include <matrix/m_rotation.scad>;
|
||||
include <matrix/m_scaling.scad>;
|
||||
include <matrix/m_shearing.scad>;
|
||||
include <matrix/m_translation.scad>;
|
||||
include <turtle/turtle2d.scad>;
|
||||
include <turtle/turtle3d.scad>;
|
||||
include <pixel/px_line.scad>;
|
||||
include <pixel/px_polyline.scad>;
|
||||
include <pixel/px_circle.scad>;
|
||||
include <pixel/px_cylinder.scad>;
|
||||
include <pixel/px_sphere.scad>;
|
||||
include <pixel/px_polygon.scad>;
|
||||
>>>>>>> v2
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 37 KiB |
BIN
docs/images/lib-bend_extrude-1.JPG
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
docs/images/lib-bend_extrude-2.JPG
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
docs/images/lib-bijection_offset-1.JPG
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
docs/images/lib-bijection_offset-2.JPG
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
docs/images/lib-circle_path-1.JPG
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
docs/images/lib-in_shape-1.JPG
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
docs/images/lib-m_cumulate-1.JPG
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
docs/images/lib-m_mirror-1.JPG
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
docs/images/lib-m_rotation-1.JPG
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
docs/images/lib-m_rotation-2.JPG
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
docs/images/lib-m_scaling-1.JPG
Normal file
After Width: | Height: | Size: 41 KiB |
BIN
docs/images/lib-m_shearing-1.JPG
Normal file
After Width: | Height: | Size: 46 KiB |
BIN
docs/images/lib-m_translation-1.JPG
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
docs/images/lib-midpt_smooth-1.JPG
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
docs/images/lib-path_extrude-4.JPG
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
docs/images/lib-path_extrude-5.JPG
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
docs/images/lib-path_extrude-6.JPG
Normal file
After Width: | Height: | Size: 41 KiB |
BIN
docs/images/lib-path_extrude-7.JPG
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
docs/images/lib-path_extrude-8.JPG
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
docs/images/lib-path_extrude-9.JPG
Normal file
After Width: | Height: | Size: 88 KiB |
BIN
docs/images/lib-path_scaling_sections-1.JPG
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
docs/images/lib-path_scaling_sections-2.JPG
Normal file
After Width: | Height: | Size: 46 KiB |
BIN
docs/images/lib-path_scaling_sections-3.JPG
Normal file
After Width: | Height: | Size: 64 KiB |
BIN
docs/images/lib-path_scaling_sections-4.JPG
Normal file
After Width: | Height: | Size: 40 KiB |
BIN
docs/images/lib-polysections-3.JPG
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
docs/images/lib-polysections-4.JPG
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
docs/images/lib-rotate_p-3.JPG
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
docs/images/lib-shear-1.JPG
Normal file
After Width: | Height: | Size: 46 KiB |
BIN
docs/images/lib-starburst-1.JPG
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
docs/images/lib-torus_knot-1.JPG
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
docs/images/lib-torus_knot-2.JPG
Normal file
After Width: | Height: | Size: 45 KiB |
BIN
docs/images/lib-triangulate-1.JPG
Normal file
After Width: | Height: | Size: 40 KiB |
BIN
docs/images/lib-trim_shape-1.JPG
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
docs/images/lib-voronoi2d-1.JPG
Normal file
After Width: | Height: | Size: 77 KiB |
BIN
docs/images/lib-voronoi2d-2.JPG
Normal file
After Width: | Height: | Size: 58 KiB |
BIN
docs/images/lib-voronoi3d-1.JPG
Normal file
After Width: | Height: | Size: 50 KiB |
BIN
docs/images/lib-voronoi3d-2.JPG
Normal file
After Width: | Height: | Size: 54 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_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 |
@@ -5,9 +5,10 @@ Puts children along the given path. If there's only one child, it will put the c
|
||||
## Parameters
|
||||
|
||||
- `points` : The points along the path.
|
||||
- `angles` : Rotate before translate each child. If not given, `angles` will be calculated automatically according to `points`.
|
||||
- `angles` : Rotate before translate each child. If not given, rotate children automatically according to `points` and `method`.
|
||||
- `twist` : If given, each child will be twisted before applying each element of `points` and `angles`.
|
||||
- `scale` : If given, each child will be scaled before applying each element of `points` and `angles`. It accepts a single value, `[sx, sy]` or `[sx, sy, sz]`.
|
||||
- `method` : Which method does `along_with` take to **guess** how to rotate children if `angles` is not specified? It accepts two value, `"AXIS_ANGLE"` (default) and `"EULER_ANGLE"`. See `path_extrude` for more information. **Since:** 1.3.
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -19,7 +20,7 @@ Puts children along the given path. If there's only one child, it will put the c
|
||||
points = circle_path(radius = 50);
|
||||
|
||||
along_with(points)
|
||||
sphere(5, center = true);
|
||||
sphere(5);
|
||||
|
||||

|
||||
|
||||
|
@@ -6,6 +6,7 @@ Creates an arc. You can pass a 2 element vector to define the central angle. Its
|
||||
|
||||
- `radius` : The radius of the circle.
|
||||
- `angle` : A single value or a 2 element vector which defines the central angle. The first element of the vector is the beginning angle in degrees, and the second element is the ending angle.
|
||||
- `width` : The width of the arc.
|
||||
- `width_mode` : The default value is `"LINE_CROSS"`. The arc line will move outward by `width / 2` and inward by `width / 2`. If it's `"LINE_OUTWARD"`, The arc line moves outward by `width`. The `"LINE_INWARD"` moves the arc line inward by `width`.
|
||||
- `$fa`, `$fs`, `$fn` : Check [the circle module](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_the_2D_Subsystem#circle) for more details.
|
||||
|
||||
|
@@ -15,8 +15,8 @@ Creates an arc path. You can pass a 2 element vector to define the central angle
|
||||
include <hull_polyline2d.scad>;
|
||||
|
||||
$fn = 24;
|
||||
points = arc_path(radius = 20, angle = [45, 290], width = 2);
|
||||
hull_polyline2d(points);
|
||||
points = arc_path(radius = 20, angle = [45, 290]);
|
||||
hull_polyline2d(points, width = 2);
|
||||
|
||||

|
||||
|
||||
@@ -24,8 +24,8 @@ Creates an arc path. You can pass a 2 element vector to define the central angle
|
||||
include <hull_polyline2d.scad>;
|
||||
|
||||
$fn = 24;
|
||||
points = arc_path(radius = 20, angle = 135, width = 2);
|
||||
hull_polyline2d(points);
|
||||
points = arc_path(radius = 20, angle = 135);
|
||||
hull_polyline2d(points, width = 2);
|
||||
|
||||

|
||||
|
||||
|
@@ -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.
|
||||
|
@@ -52,6 +52,4 @@ The arc shape is smoother if the `frags` value is larger.
|
||||
|
||||

|
||||
|
||||
This module is especially useful when you want to create things such as [zentangle bracelet](https://www.thingiverse.com/thing:1569263).
|
||||
|
||||
[](https://www.thingiverse.com/thing:1569263)
|
||||
This module is especially useful when you want to create things such as [PNG to pen holder](https://www.thingiverse.com/thing:1589493).
|
||||
|
36
docs/lib-bend_extrude.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# bend_extrude
|
||||
|
||||
The purpose of `bend_extrude` is to replace `bend` when you have a 2D shape. `bend_extrude` is faster and doesn't produce jagged edges.
|
||||
|
||||
**Since:** 1.3.
|
||||
|
||||
## Parameters
|
||||
|
||||
- `size` : The size of a square which can contain the target shape.
|
||||
- `thickness` : The thinkness used to extrude the shape.
|
||||
- `angle` : The central angle of the arc shape. The radius of the arc is calculated automatically.
|
||||
- `frags` : Number of fragments. The target shape will be cut into `frags` fragments and recombined into an arc object. The default value is 24.
|
||||
|
||||
## Examples
|
||||
|
||||
The containing square of the target shape should be laid down on the x-y plane. For example.
|
||||
|
||||
x = 9.25;
|
||||
y = 9.55;
|
||||
|
||||
%square(size = [x, y]);
|
||||
text("A");
|
||||
|
||||

|
||||
|
||||
Once you have the size of the containing square, you can use it as the `size` argument of the `bend_extrude` module.
|
||||
|
||||
include <bend_extrude.scad>;
|
||||
|
||||
x = 9.25;
|
||||
y = 9.55;
|
||||
|
||||
bend_extrude(size = [x, y], thickness = 1, angle = 270)
|
||||
text("A");
|
||||
|
||||

|
@@ -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.
|
||||
|
68
docs/lib-bijection_offset.md
Normal file
@@ -0,0 +1,68 @@
|
||||
# bijection_offset
|
||||
|
||||
Move 2D outlines outward or inward by a given amount. Each point of the offsetted shape is paired with exactly one point of the original shape.
|
||||
|
||||
**Since:** 1.2.
|
||||
|
||||
## Parameters
|
||||
|
||||
- `pts` : Points of a shape.
|
||||
- `d` : Amount to offset the shape. When negative, the shape is offset inwards.
|
||||
- `epsilon` : An upper bound on the relative error due to rounding in floating point arithmetic. Default to 0.0001. **Since:** 1.3.
|
||||
|
||||
## Examples
|
||||
|
||||
include <bijection_offset.scad>;
|
||||
|
||||
shape = [
|
||||
[15, 0],
|
||||
[15, 30],
|
||||
[0, 20],
|
||||
[-15, 40],
|
||||
[-15, 0]
|
||||
];
|
||||
|
||||
color("red") polygon(bijection_offset(shape, 3));
|
||||
color("orange") polygon(bijection_offset(shape, 2));
|
||||
color("yellow") polygon(bijection_offset(shape, 1));
|
||||
color("green") polygon(shape);
|
||||
color("blue") polygon(bijection_offset(shape, -1));
|
||||
color("indigo") polygon(bijection_offset(shape, -2));
|
||||
color("purple") polygon(bijection_offset(shape, -3));
|
||||
|
||||

|
||||
|
||||
include <bijection_offset.scad>;
|
||||
include <rotate_p.scad>;
|
||||
include <polysections.scad>;
|
||||
include <path_extrude.scad>;
|
||||
include <bezier_curve.scad>;
|
||||
|
||||
shape = [
|
||||
[5, 0],
|
||||
[3, 9],
|
||||
[0, 10],
|
||||
[-5, 0]
|
||||
];
|
||||
offsetted = bijection_offset(shape, 1);
|
||||
|
||||
offsetted2 = bijection_offset(shape, 2);
|
||||
offsetted3 = bijection_offset(shape, 3);
|
||||
|
||||
t_step = 0.05;
|
||||
|
||||
p0 = [0, 0, 0];
|
||||
p1 = [40, 60, 35];
|
||||
p2 = [-50, 70, 0];
|
||||
p3 = [20, 150, -35];
|
||||
p4 = [30, 50, -3];
|
||||
|
||||
path_pts = bezier_curve(t_step,
|
||||
[p0, p1, p2, p3, p4]
|
||||
);
|
||||
|
||||
path_extrude(concat(offsetted, shape), path_pts, "HOLLOW");
|
||||
path_extrude(concat(offsetted3, offsetted2), path_pts, "HOLLOW");
|
||||
|
||||

|
||||
|
@@ -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,8 +4,6 @@ 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.
|
||||
|
@@ -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.
|
||||
|
41
docs/lib-in_polyline.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# in_polyline
|
||||
|
||||
Checks wether a point is on a line.
|
||||
|
||||
**Since:** 1.3
|
||||
|
||||
## Parameters
|
||||
|
||||
- `line_pts` : The line points.
|
||||
- `pt` : The point to be checked.
|
||||
- `epsilon` : An upper bound on the relative error due to rounding in floating point arithmetic. Default to 0.0001.
|
||||
|
||||
## Examples
|
||||
|
||||
include <in_polyline.scad>;
|
||||
|
||||
pts = [
|
||||
[0, 0],
|
||||
[10, 0],
|
||||
[10, 10]
|
||||
];
|
||||
|
||||
echo(in_polyline(pts, [-2, -3])); // false
|
||||
echo(in_polyline(pts, [5, 0])); // true
|
||||
echo(in_polyline(pts, [10, 5])); // true
|
||||
echo(in_polyline(pts, [10, 15])); // false
|
||||
|
||||
----
|
||||
|
||||
include <in_polyline.scad>;
|
||||
|
||||
pts = [
|
||||
[10, 0, 10],
|
||||
[20, 0, 10],
|
||||
[20, 10, 10]
|
||||
];
|
||||
|
||||
echo(in_polyline(pts, [10, 0, 10])); // true
|
||||
echo(in_polyline(pts, [15, 0, 10])); // true
|
||||
echo(in_polyline(pts, [15, 1, 10])); // false
|
||||
echo(in_polyline(pts, [20, 11, 10])); // false
|
39
docs/lib-in_shape.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# in_shape
|
||||
|
||||
Checks wether a point is inside a shape.
|
||||
|
||||
**Since:** 1.3
|
||||
|
||||
## Parameters
|
||||
|
||||
- `shapt_pts` : The shape points.
|
||||
- `pt` : The point to be checked.
|
||||
- `include_edge` : If a point is on the edge of the shape, the function is default to return `false`. If `include_edge` is `true`, the function returns `true`.
|
||||
- `epsilon` : An upper bound on the relative error due to rounding in floating point arithmetic. Default to 0.0001.
|
||||
|
||||
## Examples
|
||||
|
||||
include <shape_taiwan.scad>;
|
||||
include <in_shape.scad>;
|
||||
|
||||
points = shape_taiwan(30);
|
||||
|
||||
%polygon(points);
|
||||
|
||||
n = 200;
|
||||
xs = rands(-9, 9, n);
|
||||
ys = rands(-16, 16, n);
|
||||
|
||||
pts = [
|
||||
for(i = [0:n - 1])
|
||||
let(p = [xs[i], ys[i]])
|
||||
if(in_shape(points, p, true))
|
||||
p
|
||||
];
|
||||
|
||||
for(p = pts) {
|
||||
translate(p)
|
||||
circle(.2);
|
||||
}
|
||||
|
||||

|
@@ -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");
|
||||
}
|
||||
|
||||

|
||||
|
23
docs/lib-m_mirror.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# m_mirror
|
||||
|
||||
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 <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]);
|
||||
|
||||

|
||||
|
26
docs/lib-midpt_smooth.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# midpt_smooth
|
||||
|
||||
Given a 2D path, this function constructs a mid-point smoothed version by joining the mid-points of the lines of the path.
|
||||
|
||||
**Since:** 1.3
|
||||
|
||||
## Parameters
|
||||
|
||||
- `points` : The path points.
|
||||
- `n` : Perform mid-point smoothing n times.
|
||||
- `closed` : Is the points a 2D shape? If it's `true`, the function takes the last point and the first one to calculate a middle point. Default to `false`.
|
||||
|
||||
## Examples
|
||||
|
||||
include <hull_polyline2d.scad>;
|
||||
include <shape_taiwan.scad>;
|
||||
include <bijection_offset.scad>;
|
||||
include <midpt_smooth.scad>;
|
||||
|
||||
taiwan = shape_taiwan(50);
|
||||
smoothed = midpt_smooth(taiwan, 20, true);
|
||||
|
||||
translate([0, 0, 0]) hull_polyline2d(taiwan, .25);
|
||||
#translate([10, 0, 0]) hull_polyline2d(smoothed, .25);
|
||||
|
||||

|
@@ -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
|
||||
@@ -13,7 +11,8 @@ When using this module, you should use points to represent the 2D shape. If your
|
||||
- `triangles` : `"SOLID"` (default), `"HOLLOW"` or user-defined indexes. See example below.
|
||||
- `twist` : The number of degrees of through which the shape is extruded.
|
||||
- `scale` : Scales the 2D shape by this value over the length of the extrusion. Scale can be a scalar or a vector.
|
||||
- `closed` : If the first point and the last point of `path_pts` has the same coordinate, setting `closed` to `true` will connect them automatically.
|
||||
- `closed` : If the first point and the last point of `path_pts` has the same coordinate, setting `closed` to `true` will connect them automatically.
|
||||
- `method` : Which method does `path_extrude` take to **guess** how to generate sections? It accepts two value, `"AXIS_ANGLE"` (default) and `"EULER_ANGLE"`. **Since:** 1.3.
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -123,6 +122,186 @@ When using this module, you should use points to represent the 2D shape. If your
|
||||
|
||||

|
||||
|
||||
## About `path_extrude` (Important!!)
|
||||
|
||||
**`path_extrude` is actually a workaround when you have/provide only path points.**
|
||||
|
||||
If you want to extrude a shape along a path precisely, providing enough information about how to rotate sections is necessary. If you want to extrude a shape along a helix, `helix_extrude` is more suitable because it knows how to dig out necessary data for rotating sections precisely.
|
||||
|
||||
include <helix.scad>;
|
||||
include <rotate_p.scad>;
|
||||
include <cross_sections.scad>;
|
||||
include <polysections.scad>;
|
||||
include <helix_extrude.scad>;
|
||||
|
||||
shape_pts = [
|
||||
[0,0],
|
||||
[3, 1],
|
||||
[0, 2]
|
||||
];
|
||||
|
||||
helix_extrude(shape_pts,
|
||||
radius = 5,
|
||||
levels = 5,
|
||||
level_dist = 3,
|
||||
vt_dir = "SPI_UP"
|
||||
);
|
||||
|
||||

|
||||
|
||||
If you have only points, what `path_extrude` can do is to **guess** data about rotations. The different algorithm will dig out different data. For example:
|
||||
|
||||
include <helix.scad>;
|
||||
include <rotate_p.scad>;
|
||||
include <polysections.scad>;
|
||||
include <helix.scad>;
|
||||
include <path_extrude.scad>;
|
||||
|
||||
shape_pts = [
|
||||
[0,0],
|
||||
[3, 1],
|
||||
[0, 2]
|
||||
];
|
||||
|
||||
points = helix(
|
||||
radius = 5,
|
||||
levels = 5,
|
||||
level_dist = 3,
|
||||
vt_dir = "SPI_UP"
|
||||
);
|
||||
|
||||
path_extrude(shape_pts, points);
|
||||
|
||||

|
||||
|
||||
You might think this is wrong. Actually, it's not. It's the correct/default behavior of `path_extrude`. Because **you don't provide other information**, what `path_extrude` can do is to **guess** how to generate sections from points. You think it's a bug in `path_extrude` because your brain has information that path points do not provide.
|
||||
|
||||
The `method` parameter is default to `"AXIS_ANGLE"`, a way to guess information from points. It accepts `"EULER_ANGLE"`, too.
|
||||
|
||||
include <rotate_p.scad>;
|
||||
include <polysections.scad>;
|
||||
include <helix.scad>;
|
||||
include <path_extrude.scad>;
|
||||
|
||||
shape_pts = [
|
||||
[0,0],
|
||||
[3, 1],
|
||||
[0, 2]
|
||||
];
|
||||
|
||||
points = helix(
|
||||
radius = 5,
|
||||
levels = 5,
|
||||
level_dist = 3,
|
||||
vt_dir = "SPI_UP"
|
||||
);
|
||||
|
||||
path_extrude(shape_pts, points, method = "EULER_ANGLE");
|
||||
|
||||

|
||||
|
||||
`"EULER_ANGLE"` generates the same section at the same point. You might think the model is correct. But, that's because what it guesses from points just match your expectation.
|
||||
|
||||
`"EULER_ANGLE"` will generate an abrupt when the path is exactly vertical. [The problem happened in (older) Blender, too.](https://download.blender.org/documentation/htmlI/ch09s04.html)
|
||||
|
||||
include <rotate_p.scad>;
|
||||
include <polysections.scad>;
|
||||
include <path_extrude.scad>;
|
||||
|
||||
shape_pts = [[5, -5], [5, 5], [-5, 5], [-5, -5]];
|
||||
|
||||
path_pts = [
|
||||
[20, 20, 0],
|
||||
[18.2, 18.2, 2],
|
||||
[16.8, 16.8, 4],
|
||||
[15.8, 15.8, 6],
|
||||
[15.2, 15.2, 8],
|
||||
[15, 15, 10],
|
||||
[15.2, 15.2, 12],
|
||||
[15.8, 15.8, 14],
|
||||
[16.8, 16.8, 16],
|
||||
[18.2, 18.2, 18],
|
||||
[20, 20, 20]
|
||||
];
|
||||
|
||||
path_extrude(shape_pts, path_pts, method = "EULER_ANGLE");
|
||||
|
||||

|
||||
|
||||
The problem doesn't happen when `method` is `"AXIS_ANGLE"`.
|
||||
|
||||
include <rotate_p.scad>;
|
||||
include <polysections.scad>;
|
||||
include <path_extrude.scad>;
|
||||
|
||||
shape_pts = [[5, -5], [5, 5], [-5, 5], [-5, -5]];
|
||||
|
||||
path_pts = [
|
||||
[20, 20, 0],
|
||||
[18.2, 18.2, 2],
|
||||
[16.8, 16.8, 4],
|
||||
[15.8, 15.8, 6],
|
||||
[15.2, 15.2, 8],
|
||||
[15, 15, 10],
|
||||
[15.2, 15.2, 12],
|
||||
[15.8, 15.8, 14],
|
||||
[16.8, 16.8, 16],
|
||||
[18.2, 18.2, 18],
|
||||
[20, 20, 20]
|
||||
];
|
||||
|
||||
path_extrude(shape_pts, path_pts, method = "AXIS_ANGLE");
|
||||
|
||||

|
||||
|
||||
So, which is the correct method? Both methods are correct when you provide only points. `method` is just a way you tell `path_extrude` how to guess more information when extruding.
|
||||
|
||||
`"EULER_ANGLE"` will generate an abrupt when the path is exactly vertical. Some users might think it's a bug so `"AXIS_ANGLE"` is the default value.
|
||||
|
||||
`"EULER_ANGLE"`, however, generates the same section at the same point. This means that you don't have to adjust sections if you want to extrude along a closed path. It's an advantage when extruding. For example:
|
||||
|
||||
include <shape_pentagram.scad>;
|
||||
include <rotate_p.scad>;
|
||||
include <polysections.scad>;
|
||||
include <path_extrude.scad>;
|
||||
include <torus_knot.scad>;
|
||||
|
||||
p = 2;
|
||||
q = 3;
|
||||
phi_step = 0.05;
|
||||
star_radius = 0.5;
|
||||
|
||||
pts = torus_knot(p, q, phi_step);
|
||||
|
||||
shape_pentagram_pts = shape_pentagram(star_radius);
|
||||
|
||||
// not closed perfectly
|
||||
translate([-8, 0, 0]) path_extrude(
|
||||
shape_pentagram_pts,
|
||||
concat(pts, [pts[0]]),
|
||||
closed = true,
|
||||
method = "AXIS_ANGLE"
|
||||
);
|
||||
|
||||
// adjust it
|
||||
path_extrude(
|
||||
shape_pentagram_pts,
|
||||
concat(pts, [pts[0]]),
|
||||
closed = true,
|
||||
twist = 188,
|
||||
method = "AXIS_ANGLE"
|
||||
);
|
||||
|
||||
// "EULER_ANGLE" is easy in this situation
|
||||
translate([0, 8, 0]) path_extrude(
|
||||
shape_pentagram_pts,
|
||||
concat(pts, [pts[0]]),
|
||||
closed = true,
|
||||
method = "EULER_ANGLE"
|
||||
);
|
||||
|
||||

|
||||
|
||||
Both methods are useful. If `"AXIS_ANGLE"` doesn't guess out what you want, choose `"EULER_ANGLE"`, and vice versa.
|
||||
|
||||
For more information, see [#issue 3](https://github.com/JustinSDK/dotSCAD/issues/3) and [#issue 5](https://github.com/JustinSDK/dotSCAD/issues/5).
|
@@ -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
|
||||
|
@@ -1,11 +1,12 @@
|
||||
# rotate_p
|
||||
|
||||
Rotates a point `a` degrees around an arbitrary axis. It behaves as the built-in `rotate` module
|
||||
Rotates a point `a` degrees about the axis of the coordinate system or around an arbitrary axis. It behaves as the built-in `rotate` module
|
||||
|
||||
## Parameters
|
||||
|
||||
- `point` : A 3D point `[x, y, z]` or a 2D point `[x, y]`.
|
||||
- `a` : If it's `[deg_x, deg_y, deg_z]`, the rotation is applied in the order `x`, `y`, `z`. If it's `[deg_x, deg_y]`, the rotation is applied in the order `x`, `y`. If it's`[deg_x]`, the rotation is only applied to the `x` axis. If it's an number, the rotation is only applied to the `z` axis.
|
||||
- `a` : If it's `[deg_x, deg_y, deg_z]`, the rotation is applied in the order `x`, `y`, `z`. If it's `[deg_x, deg_y]`, the rotation is applied in the order `x`, `y`. If it's`[deg_x]`, the rotation is only applied to the `x` axis. If it's an number, the rotation is only applied to the `z` axis or an arbitrary axis.
|
||||
- `v`: A vector allows you to set an arbitrary axis about which the object will be rotated. When `a` is an array, the `v` argument is ignored. **Since:** 1.1.
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -60,4 +61,22 @@ The `rotate_p` function is useful in some situations. For example, you probably
|
||||
|
||||
%sphere(radius);
|
||||
|
||||

|
||||

|
||||
|
||||
include <rotate_p.scad>;
|
||||
|
||||
v = [10, 10, 10];
|
||||
|
||||
hull() {
|
||||
sphere(1);
|
||||
translate(v)
|
||||
sphere(1);
|
||||
}
|
||||
|
||||
p = [10, 10, 0];
|
||||
for(i = [0:20:340]) {
|
||||
translate(rotate_p(p, a = i, v = v))
|
||||
sphere(1);
|
||||
}
|
||||
|
||||

|
@@ -6,6 +6,7 @@ Returns shape points of a regular cyclic polygon. They can be used with xxx_extr
|
||||
|
||||
- `sides` : The radius of the circle.
|
||||
- `circle_r` : The radius of the circumcircle.
|
||||
- `corner_r` : The radius of the circle at a corner.
|
||||
- `$fa`, `$fs`, `$fn` : Check [the circle module](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_the_2D_Subsystem#circle) for more details.
|
||||
|
||||
## Examples
|
||||
|
@@ -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.
|
||||
|
@@ -6,7 +6,7 @@ Returns shape points of a star. They can be used with xxx_extrude modules of dot
|
||||
|
||||
- `r1` : The outer radius of the starburst.
|
||||
- `r2` : The inner radius of the starburst.
|
||||
- `n` : The number of vertices.
|
||||
- `n` : The burst number.
|
||||
|
||||
|
||||
## Examples
|
||||
|
@@ -5,6 +5,7 @@ Returns shape points of [Taiwan](https://www.google.com.tw/maps?q=taiwan&um=1&ie
|
||||
## Parameters
|
||||
|
||||
- `h` : The height of Taiwan.
|
||||
- `distance` : Used for simplifying the shape. If the distance between a point and its previous points is not greater than `distance`, the point will be kept. Default to 0. **Since:** 1.3.
|
||||
|
||||
## Examples
|
||||
|
||||
|
52
docs/lib-shear.md
Normal file
@@ -0,0 +1,52 @@
|
||||
# shear
|
||||
|
||||
Shear all child elements along the X-axis, Y-axis, or Z-axis in 3D.
|
||||
|
||||
**Since:** 1.1
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
- `sx` : An array `[SHy, SHz]`. The new coordinates of child elements are `(x + SHy * y + SHz * z, y, z)`.
|
||||
- `sy` : An array `[SHx, SHz]`. The new coordinates of child elements are `(x, y + SHx * x + SHz * z, z)`.
|
||||
- `sz` : An array `[SHx, SHy]`. The new coordinates of child elements are `(x, y, z + SHx * x + SHy * y)`.
|
||||
|
||||
## Examples
|
||||
|
||||
include <shear.scad>;
|
||||
|
||||
color("red") {
|
||||
shear(sx = [1, 0])
|
||||
cube(1);
|
||||
|
||||
translate([2, 0, 0]) shear(sx = [0, 1])
|
||||
cube(1);
|
||||
|
||||
translate([4, 0, 0]) shear(sx = [1, 1])
|
||||
cube(1);
|
||||
}
|
||||
|
||||
translate([0, -3, 0]) color("green") {
|
||||
shear(sy = [1, 0])
|
||||
cube(1);
|
||||
|
||||
translate([2, 0, 0]) shear(sy = [0, 1])
|
||||
cube(1);
|
||||
|
||||
translate([4, 0, 0]) shear(sy = [1, 1])
|
||||
cube(1);
|
||||
}
|
||||
|
||||
translate([0, -5, 0]) color("blue") {
|
||||
shear(sz = [1, 0])
|
||||
cube(1);
|
||||
|
||||
translate([2, 0, 0]) shear(sz = [0, 1])
|
||||
cube(1);
|
||||
|
||||
translate([4, 0, 0]) shear(sz = [1, 1])
|
||||
cube(1);
|
||||
}
|
||||
|
||||

|
||||
|
@@ -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.
|
||||
|
24
docs/lib-starburst.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# starburst
|
||||
|
||||
A 3D version of `shape_starburst`.
|
||||
|
||||
**Since:** 1.2.
|
||||
|
||||
## Parameters
|
||||
|
||||
- `r1` : The outer radius of the starburst.
|
||||
- `r2` : The inner radius of the starburst.
|
||||
- `n` : The number of vertices.
|
||||
- `height` : The height of the starburst.
|
||||
|
||||
## Examples
|
||||
|
||||
include <starburst.scad>;
|
||||
|
||||
starburst(10, 5, 5, 5);
|
||||
translate([20, 0, 0]) starburst(10, 5, 6, 5);
|
||||
translate([40, 0, 0]) starburst(10, 5, 12, 10);
|
||||
translate([60, 0, 0]) starburst(10, 5, 4, 3);
|
||||
|
||||

|
||||
|
40
docs/lib-torus_knot.md
Normal file
@@ -0,0 +1,40 @@
|
||||
# torus_knot
|
||||
|
||||
Generate a path of [The (p,q)-torus knot](https://en.wikipedia.org/wiki/Torus_knot).
|
||||
|
||||
**Since:** 1.2.
|
||||
|
||||

|
||||
|
||||
## Parameters
|
||||
|
||||
- `p` : The p parameter of The (p,q)-torus knot.
|
||||
- `q` : The q parameter of The (p,q)-torus knot.
|
||||
- `phi_step` : The amount when increasing phi.
|
||||
|
||||
## Examples
|
||||
|
||||
include <shape_pentagram.scad>;
|
||||
include <rotate_p.scad>;
|
||||
include <polysections.scad>;
|
||||
include <path_extrude.scad>;
|
||||
include <torus_knot.scad>;
|
||||
|
||||
p = 2;
|
||||
q = 3;
|
||||
phi_step = 0.05;
|
||||
star_radius = 0.5;
|
||||
|
||||
pts = torus_knot(p, q, phi_step);
|
||||
|
||||
shape_pentagram_pts = shape_pentagram(star_radius);
|
||||
|
||||
path_extrude(
|
||||
shape_pentagram_pts,
|
||||
concat(pts, [pts[0]]),
|
||||
closed = true,
|
||||
method = "EULER_ANGLE"
|
||||
);
|
||||
|
||||

|
||||
|
42
docs/lib-triangulate.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# triangulate
|
||||
|
||||
Given a 2D shape. This function performs a simple polygon triangulation algorithm and returns the indices of each triangle.
|
||||
|
||||
**Since:** 1.3.
|
||||
|
||||
## Parameters
|
||||
|
||||
- `shape_pts` : The shape points.
|
||||
- `epsilon` : An upper bound on the relative error due to rounding in floating point arithmetic. Default to 0.0001.
|
||||
|
||||
## Examples
|
||||
|
||||
include <triangulate.scad>;
|
||||
|
||||
shape = [
|
||||
[0, 0],
|
||||
[10, 0],
|
||||
[12, 5],
|
||||
[5, 10],
|
||||
[10, 15],
|
||||
[0, 20],
|
||||
[-5, 18],
|
||||
[-18, 3],
|
||||
[-4, 10]
|
||||
];
|
||||
|
||||
tris = triangulate(shape);
|
||||
|
||||
difference() {
|
||||
polygon(shape);
|
||||
|
||||
for(tri = tris) {
|
||||
offset(-.2)
|
||||
polygon([for(idx = tri) shape[idx]]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||

|
||||
|
33
docs/lib-trim_shape.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# trim_shape
|
||||
|
||||
Given a tangled-edge shape. This function trims the shape to a non-tangled shape. It's intended to be a helper function after using `bijection_offset`.
|
||||
|
||||
**Since:** 1.3.
|
||||
|
||||
## Parameters
|
||||
|
||||
- `shape_pts` : The shape points.
|
||||
- `from` : The index of the start point you want to trim.
|
||||
- `to` : The index of the last point you want to trim.
|
||||
- `epsilon` : An upper bound on the relative error due to rounding in floating point arithmetic. Default to 0.0001.
|
||||
|
||||
## Examples
|
||||
|
||||
include <hull_polyline2d.scad>;
|
||||
include <trim_shape.scad>;
|
||||
include <shape_taiwan.scad>;
|
||||
include <bijection_offset.scad>;
|
||||
include <midpt_smooth.scad>;
|
||||
|
||||
taiwan = shape_taiwan(50);
|
||||
offseted = bijection_offset(taiwan, -2);
|
||||
trimmed = trim_shape(offseted, 3, len(offseted) - 6);
|
||||
smoothed = midpt_smooth(trimmed, 3);
|
||||
|
||||
#hull_polyline2d(taiwan, .1);
|
||||
%translate([25, 0, 0])
|
||||
hull_polyline2d(offseted, .2);
|
||||
hull_polyline2d(smoothed, .1);
|
||||
|
||||

|
||||
|
47
docs/lib-voronoi2d.md
Normal file
@@ -0,0 +1,47 @@
|
||||
# voronoi2d
|
||||
|
||||
Creats a [Voronoi diagram](https://en.wikipedia.org/wiki/Voronoi_diagram). The initial region for each cell is calculated automatically from the given points by the following code:
|
||||
|
||||
xs = [for(p = points) p[0]];
|
||||
ys = [for(p = points) abs(p[1])];
|
||||
region_size = max([(max(xs) - min(xs) / 2), (max(ys) - min(ys)) / 2]);
|
||||
|
||||
**Since:** 1.3.
|
||||
|
||||
## Parameters
|
||||
|
||||
- `points` : Points for each cell.
|
||||
- `spacing` : Distance between cells. Default to 1.
|
||||
- `r`, `delta`, `chamfer` : The outlines of each cell can be moved outward or inward. These parameters have the same effect as [`offset`](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset).
|
||||
- `region_type` : The initial shape for each cell can be `"square"` or `"circle"`. Default to `"square"`.
|
||||
|
||||
## Examples
|
||||
|
||||
include <voronoi2d.scad>;
|
||||
|
||||
xs = rands(-20, 20, 50);
|
||||
ys = rands(-20, 20, 50);
|
||||
|
||||
points = [for(i = [0:len(xs) - 1]) [xs[i], ys[i]]];
|
||||
|
||||
voronoi2d(points);
|
||||
translate([60, 0, 0])
|
||||
voronoi(points, region_type = "circle");
|
||||
|
||||

|
||||
|
||||
include <voronoi2d.scad>;
|
||||
include <hollow_out.scad>;
|
||||
|
||||
xs = rands(0, 40, 50);
|
||||
ys = rands(0, 20, 50);
|
||||
|
||||
points = [for(i = [0:len(xs) - 1]) [xs[i], ys[i]]];
|
||||
|
||||
difference() {
|
||||
square([40, 20]);
|
||||
voronoi2d(points);
|
||||
}
|
||||
hollow_out(shell_thickness = 1) square([40, 20]);
|
||||
|
||||

|
60
docs/lib-voronoi3d.md
Normal file
@@ -0,0 +1,60 @@
|
||||
# voronoi3d
|
||||
|
||||
Creats a 3D version of [Voronoi diagram](https://en.wikipedia.org/wiki/Voronoi_diagram). The initial space for each cell is calculated automatically from the given points by the following code:
|
||||
|
||||
xs = [for(p = points) p[0]];
|
||||
ys = [for(p = points) abs(p[1])];
|
||||
zs = [for(p = points) abs(p[2])];
|
||||
space_size = max([(max(xs) - min(xs) / 2), (max(ys) - min(ys)) / 2, (max(zs) - min(zs)) / 2]);
|
||||
// cube([space_size, space_size * 2, space_size * 2]);
|
||||
|
||||
The preview or rendering of 3D Voronoi is slow. If you want to use this module, render and export the 3D Voronoi model first. Then, `import` the model to do what you want.
|
||||
|
||||
**Since:** 1.3.
|
||||
|
||||
## Parameters
|
||||
|
||||
- `points` : Points for each cell.
|
||||
- `spacing` : Distance between cells. Default to 1.
|
||||
|
||||
## Examples
|
||||
|
||||
include <voronoi3d.scad>;
|
||||
|
||||
r = 30;
|
||||
|
||||
zas = rands(0, 359, 12);
|
||||
yas = rands(0, 179, 12);
|
||||
|
||||
points = [
|
||||
for(i = [0:len(zas) - 1])
|
||||
[
|
||||
r * cos(yas[i]) * cos(zas[i]),
|
||||
r * cos(yas[i]) * sin(zas[i]),
|
||||
r * sin(yas[i])
|
||||
]
|
||||
];
|
||||
|
||||
#for(pt = points) {
|
||||
translate(pt) cube(1);
|
||||
}
|
||||
|
||||
intersection() {
|
||||
sphere(r);
|
||||
voronoi3d(points);
|
||||
}
|
||||
|
||||

|
||||
|
||||
If you render, export and save the previous model as `voronoi3d.stl`, the following code will generate a Voronoi sphere.
|
||||
|
||||
r = 30;
|
||||
thickness = 2;
|
||||
|
||||
difference() {
|
||||
sphere(r);
|
||||
scale(1.01) import("voronoi3d.stl");
|
||||
sphere(r - thickness);
|
||||
}
|
||||
|
||||

|
32
docs/lib2-m_cumulate.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# m_cumulate
|
||||
|
||||
The power of using transformation matrice is that you can cumulate all transformations in a matrix. This function multipies all transformation matrice.
|
||||
|
||||
**Since:** 1.1
|
||||
|
||||
## Parameters
|
||||
|
||||
The dir changed since 2.0.
|
||||
|
||||
- `matrice` : A list of 4x4 transformation matrice.
|
||||
|
||||
## Examples
|
||||
|
||||
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)]
|
||||
);
|
||||
|
||||
multmatrix(m)
|
||||
cube(1);
|
||||
|
||||
multmatrix(m)
|
||||
sphere(1);
|
||||
|
||||
|
||||

|
||||
|
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]);
|
||||
|
||||

|
||||
|
47
docs/lib2-m_rotation.md
Normal file
@@ -0,0 +1,47 @@
|
||||
# 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
|
||||
|
||||
## Parameters
|
||||
|
||||
- `a` : If it's `[deg_x, deg_y, deg_z]`, the rotation is applied in the order `x`, `y`, `z`. If it's `[deg_x, deg_y]`, the rotation is applied in the order `x`, `y`. If it's`[deg_x]`, the rotation is only applied to the `x` axis. If it's an number, the rotation is only applied to the `z` axis or an arbitrary axis.
|
||||
- `v`: A vector allows you to set an arbitrary axis about which the object will be rotated. When `a` is an array, the `v` argument is ignored.
|
||||
|
||||
## Examples
|
||||
|
||||
include <matrix/m_rotation.scad>;
|
||||
|
||||
point = [20, 0, 0];
|
||||
a = [0, -45, 45];
|
||||
|
||||
hull() {
|
||||
sphere(1);
|
||||
multmatrix(m_rotation(a))
|
||||
translate(point)
|
||||
sphere(1);
|
||||
}
|
||||
|
||||

|
||||
|
||||
include <m_rotation.scad>;
|
||||
|
||||
v = [10, 10, 10];
|
||||
|
||||
hull() {
|
||||
sphere(1);
|
||||
translate(v)
|
||||
sphere(1);
|
||||
}
|
||||
|
||||
p = [10, 10, 0];
|
||||
for(i = [0:20:340]) {
|
||||
multmatrix(m_rotation(a = i, v = v))
|
||||
translate(p)
|
||||
sphere(1);
|
||||
}
|
||||
|
||||

|
23
docs/lib2-m_scaling.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# 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
|
||||
|
||||
## Parameters
|
||||
|
||||
- `v` : Elements will be scaled using the vector.
|
||||
|
||||
## Examples
|
||||
|
||||
include <matrix/m_scaling.scad>;
|
||||
|
||||
cube(10);
|
||||
translate([15, 0, 0])
|
||||
multmatrix(m_scaling([0.5, 1, 2]))
|
||||
cube(10);
|
||||
|
||||

|
||||
|
53
docs/lib2-m_shearing.md
Normal file
@@ -0,0 +1,53 @@
|
||||
# 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
|
||||
|
||||
## Parameters
|
||||
|
||||
- `sx` : An array `[SHy, SHz]`. The new coordinates of child elements are `(x + SHy * y + SHz * z, y, z)`.
|
||||
- `sy` : An array `[SHx, SHz]`. The new coordinates of child elements are `(x, y + SHx * x + SHz * z, z)`.
|
||||
- `sz` : An array `[SHx, SHy]`. The new coordinates of child elements are `(x, y, z + SHx * x + SHy * y)`.
|
||||
|
||||
## Examples
|
||||
|
||||
include <matrix/m_shearing.scad>;
|
||||
|
||||
color("red") {
|
||||
multmatrix(m_shearing(sx = [1, 0]))
|
||||
cube(1);
|
||||
|
||||
translate([2, 0, 0]) multmatrix(m_shearing(sx = [0, 1]))
|
||||
cube(1);
|
||||
|
||||
translate([4, 0, 0]) multmatrix(m_shearing(sx = [1, 1]))
|
||||
cube(1);
|
||||
}
|
||||
|
||||
translate([0, -3, 0]) color("green") {
|
||||
multmatrix(m_shearing(sy = [1, 0]))
|
||||
cube(1);
|
||||
|
||||
translate([2, 0, 0]) multmatrix(m_shearing(sy = [0, 1]))
|
||||
cube(1);
|
||||
|
||||
translate([4, 0, 0]) multmatrix(m_shearing(sy = [1, 1]))
|
||||
cube(1);
|
||||
}
|
||||
|
||||
translate([0, -5, 0]) color("blue") {
|
||||
multmatrix(m_shearing(sz = [1, 0]))
|
||||
cube(1);
|
||||
|
||||
translate([2, 0, 0]) multmatrix(m_shearing(sz = [0, 1]))
|
||||
cube(1);
|
||||
|
||||
translate([4, 0, 0]) multmatrix(m_shearing(sz = [1, 1]))
|
||||
cube(1);
|
||||
}
|
||||
|
||||

|
||||
|
22
docs/lib2-m_translation.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# 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
|
||||
|
||||
## Parameters
|
||||
|
||||
- `v` : Elements will be translated along the vector.
|
||||
|
||||
## Examples
|
||||
|
||||
include <matrix/m_translation.scad>;
|
||||
|
||||
cube(2, center = true);
|
||||
multmatrix(m_translation([5, 0, 0]))
|
||||
sphere(1);
|
||||
|
||||

|
||||
|