Compare commits
345 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
1d946647eb | ||
|
c5a99c3223 | ||
|
39e363d59c | ||
|
9478d1ec60 | ||
|
134ca1b364 | ||
|
e7c38fa876 | ||
|
bd8f755a6c | ||
|
91d5c40336 | ||
|
5c8c0b8139 | ||
|
324693a38f | ||
|
14a6348771 | ||
|
7d9cb94f22 | ||
|
90a29ceecd | ||
|
e7bfb3c951 | ||
|
59eb3a1dc2 | ||
|
e49c40e0f0 | ||
|
d822688eaf | ||
|
d25b73dbda | ||
|
22dce8fee2 | ||
|
abd287b29e | ||
|
a82827e389 | ||
|
c6a661e074 | ||
|
0490da4b91 | ||
|
364488970b | ||
|
4eda143bbb | ||
|
2a87a2221f | ||
|
39cbc9a069 | ||
|
55e64dcb53 | ||
|
154436382c | ||
|
90c6db16d5 | ||
|
0ec9f0e0e5 | ||
|
218830d252 | ||
|
84f3636bf0 | ||
|
d9dd44db29 | ||
|
9577f68d13 | ||
|
7a8c152607 | ||
|
345603551b | ||
|
610c9588bd | ||
|
7b1095d130 | ||
|
884892a3f1 | ||
|
2600504dd5 | ||
|
f27250d285 | ||
|
5016231000 | ||
|
402aa95289 | ||
|
50d11142d5 | ||
|
031438a4df | ||
|
9063d9da05 | ||
|
3fbee973a9 | ||
|
3b5af34041 | ||
|
824aefefd9 | ||
|
4cdeb5b4a6 | ||
|
9271c79a3a | ||
|
3b2b07ae25 | ||
|
214b0a2640 | ||
|
29da8be872 | ||
|
10930e8b1c | ||
|
756ed377c3 | ||
|
300f72a959 | ||
|
faf53b3846 | ||
|
2376e429d1 | ||
|
b0817f2339 | ||
|
0304233cdc | ||
|
4176cb476e | ||
|
3901e4f1ea | ||
|
9022cb731d | ||
|
b76a2f9c32 | ||
|
bb2f10043f | ||
|
5b65cc16a7 | ||
|
8cdfe435ee | ||
|
1cddbc3453 | ||
|
50621b0306 | ||
|
8dad1bd4b6 | ||
|
c6b0c30fd8 | ||
|
a6d0c85dbe | ||
|
87deb39a4b | ||
|
bfa0fd2b11 | ||
|
2bd663d46b | ||
|
5c1c6a7463 | ||
|
ca92286690 | ||
|
cbff19c33e | ||
|
43b22a0f4c | ||
|
6bda39ecef | ||
|
37c3a647a5 | ||
|
59ae93ba5f | ||
|
6d6f62c77f | ||
|
a8ae7c18e4 | ||
|
9c3c92ab13 | ||
|
f1116dc8cf | ||
|
5a44454547 | ||
|
57d46eda8d | ||
|
4a19b445ab | ||
|
675f80159e | ||
|
1132451009 | ||
|
c78fb13731 | ||
|
a53c202c48 | ||
|
ccbd81b88e | ||
|
a14c5676d4 | ||
|
e9440e55d6 | ||
|
8f1d6a6e1a | ||
|
95dc133d0d | ||
|
dbdf8a757d | ||
|
d6affc1ff5 | ||
|
f7e81a78e3 | ||
|
63a5e53572 | ||
|
006572c5bf | ||
|
3678b8b6d7 | ||
|
89eb57652b | ||
|
0a24f4fc67 | ||
|
6e8277c91d | ||
|
9071ac3788 | ||
|
f1b1239950 | ||
|
71b6203d9c | ||
|
fa0e77ebaf | ||
|
6e38061655 | ||
|
ac2c420487 | ||
|
a29b851500 | ||
|
bc17a2df19 | ||
|
d701b537f0 | ||
|
4683ff5a46 | ||
|
06c1ef94bc | ||
|
e2958b6ae1 | ||
|
a2971ec1d0 | ||
|
1634403e28 | ||
|
57da4b39ad | ||
|
5374999967 | ||
|
60f3698200 | ||
|
83b1843f3f | ||
|
b2d2940ef1 | ||
|
3c0c524186 | ||
|
4eef2c6dde | ||
|
af9cfb16e4 | ||
|
9340f73f1a | ||
|
66d02d02e2 | ||
|
44165275e7 | ||
|
dcda61390c | ||
|
58a7a20c53 | ||
|
d0bc8c0f7f | ||
|
26fcdbe8e3 | ||
|
704ed1e725 | ||
|
702aab846e | ||
|
fbc07cec80 | ||
|
b1b61fddbf | ||
|
89096ad329 | ||
|
e5b1a6cf93 | ||
|
523ce3cb33 | ||
|
ea36c97ac7 | ||
|
5e7b5f1691 | ||
|
8fb3d5b579 | ||
|
cafa0ebd06 | ||
|
a2fee75749 | ||
|
0725d945de | ||
|
41ebc07fd0 | ||
|
c59fdc5f1d | ||
|
23ed306148 | ||
|
657c10a9cc | ||
|
8da1912fff | ||
|
fd375dd50f | ||
|
69e2a79488 | ||
|
e5af7b3027 | ||
|
9c532acce4 | ||
|
1d085c35d0 | ||
|
09d898c035 | ||
|
12e6af2492 | ||
|
f3a5ce76e3 | ||
|
8ca4e12b22 | ||
|
e021750d7b | ||
|
43fa3fb5fd | ||
|
853da1f9e2 | ||
|
346cea1db8 | ||
|
c6ca52aba8 | ||
|
5863a5c3f6 | ||
|
43d614ba7c | ||
|
fb0672480f | ||
|
3d1a4cbb33 | ||
|
0494ef7f32 | ||
|
9850227fe4 | ||
|
4f22f8489a | ||
|
210844c9f8 | ||
|
e9095eaff5 | ||
|
950c7a5937 | ||
|
9cbac21f17 | ||
|
30f83865f1 | ||
|
b6d86ab4ba | ||
|
2355820034 | ||
|
679e3aae62 | ||
|
21754293c8 | ||
|
d4a865080c | ||
|
b79131f9bc | ||
|
7aad397860 | ||
|
b209c40d99 | ||
|
d8122150a1 | ||
|
e507f71619 | ||
|
966f6f6850 | ||
|
d35fe91246 | ||
|
2f9509c249 | ||
|
0810d86314 | ||
|
52e43aa03c | ||
|
d875d41e4c | ||
|
82ec74eee1 | ||
|
3390b0587d | ||
|
433040f363 | ||
|
8cc0eeebc3 | ||
|
803906e8cd | ||
|
03f4939fe1 | ||
|
066e5fc55d | ||
|
aeb9dec141 | ||
|
bfa3d6b8ff | ||
|
4fb0f9ac7b | ||
|
e5eeb77292 | ||
|
2e5b245167 | ||
|
a37c6030e9 | ||
|
13ca93e9db | ||
|
749079767d | ||
|
d8a444099f | ||
|
0dc5544e2e | ||
|
ac41769faa | ||
|
bcbc4e09a5 | ||
|
888460d2e3 | ||
|
c5be2d398a | ||
|
798676e2eb | ||
|
ad6b0ae4f1 | ||
|
9829c5c201 | ||
|
fd6fbbc92f | ||
|
6aaab429fb | ||
|
d00f51edcb | ||
|
0c1e85e5db | ||
|
ed3b8c1422 | ||
|
7574f0aa3d | ||
|
62c4e1c656 | ||
|
af88ee6e86 | ||
|
30d60d643f | ||
|
0d63029c4c | ||
|
c58e019b69 | ||
|
249cced4c7 | ||
|
2a4bd4c006 | ||
|
569a0091c3 | ||
|
beaf6fb776 | ||
|
9f8614397b | ||
|
0c3c0286e9 | ||
|
026cd9391e | ||
|
58a293f6c8 | ||
|
0e6d98fd1e | ||
|
7d8bfc6099 | ||
|
2844a30d91 | ||
|
9b0c825f92 | ||
|
428af98b5d | ||
|
505e384343 | ||
|
9fe43dc7b2 | ||
|
9955169c75 | ||
|
d350362c47 | ||
|
26a0d7a62e | ||
|
091f071cb5 | ||
|
401c6baca4 | ||
|
bbe59b9dbb | ||
|
02fd718ca7 | ||
|
a00945ae1f | ||
|
a599842933 | ||
|
da08e75e73 | ||
|
a129aa547c | ||
|
eceb3fa282 | ||
|
a16a8373d3 | ||
|
4a516bf64d | ||
|
43285d49b1 | ||
|
3d081ed0c3 | ||
|
9ad1835322 | ||
|
05737e0512 | ||
|
8b65a1cb5c | ||
|
179701330f | ||
|
50f87275e0 | ||
|
f8037bf484 | ||
|
3f3d799870 | ||
|
3bb5553698 | ||
|
ad826cfb77 | ||
|
fabfd1a9ce | ||
|
ecd8311921 | ||
|
2939d03879 | ||
|
2d3315f9ad | ||
|
7c8dec3671 | ||
|
6bed665368 | ||
|
5a5ee9cc0c | ||
|
3784469c59 | ||
|
1544546cdd | ||
|
7bd7326794 | ||
|
0a117e0c09 | ||
|
3b48de2c47 | ||
|
0295b0ded0 | ||
|
4bddf3ca33 | ||
|
a8472c0831 | ||
|
a56cf44b4c | ||
|
a213a797a0 | ||
|
4cd74cb0bf | ||
|
b722d178e7 | ||
|
bf8cb44595 | ||
|
6e3d3e0a4b | ||
|
352ca21300 | ||
|
5399224ff0 | ||
|
574e4b695a | ||
|
2e1959f3ef | ||
|
8829123ade | ||
|
1812e732bb | ||
|
021716cf80 | ||
|
3f499ca32d | ||
|
a11eae4aaa | ||
|
61f7988820 | ||
|
7d47d56bdd | ||
|
1a6ce7ea0a | ||
|
9c487ec304 | ||
|
5d593ecbc3 | ||
|
9153c997eb | ||
|
904e15667d | ||
|
cdccc4723b | ||
|
88775366db | ||
|
0d188fa96c | ||
|
fd1b426d4f | ||
|
e1a5fcb928 | ||
|
d77581d717 | ||
|
81f5e05840 | ||
|
e312c03414 | ||
|
6c6093d46b | ||
|
61faa5ae06 | ||
|
ccfca4e246 | ||
|
f4fa300fac | ||
|
404a01b29b | ||
|
3cae424fb4 | ||
|
ad926d2def | ||
|
96f9d8c38a | ||
|
3c43ef8fc2 | ||
|
0d71103959 | ||
|
da07c95497 | ||
|
ccafbe8a3a | ||
|
bed658178e | ||
|
7b6e873b2a | ||
|
780ecc3c06 | ||
|
97f4cfa60d | ||
|
66bf0f89bf | ||
|
246fc3006c | ||
|
aa42d2cd4e | ||
|
4583305c76 | ||
|
f3473e8765 | ||
|
e855403d7a | ||
|
d3a51b280a | ||
|
9863b718a0 | ||
|
0551981b07 | ||
|
e6639cd01c | ||
|
8d39873360 |
2
LICENSE
@@ -1,7 +1,7 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="84" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="84" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h47v20H0z"/><path fill="#007ec6" d="M47 0h37v20H47z"/><path fill="url(#b)" d="M0 0h84v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"><text x="23.5" y="15" fill="#010101" fill-opacity=".3">license</text><text x="23.5" y="14">license</text><text x="64.5" y="15" fill="#010101" fill-opacity=".3">LGPL</text><text x="64.5" y="14">LGPL</text></g></svg>
|
Before Width: | Height: | Size: 793 B |
223
README.md
@@ -1,10 +1,8 @@
|
||||
# dotSCAD 3.1
|
||||
# dotSCAD 3.2
|
||||
|
||||
> **Reduce the burden of mathematics/algorithm when playing OpenSCAD.**
|
||||
|
||||

|
||||
|
||||
[](https://github.com/JustinSDK/lib-openscad/blob/master/LICENSE)
|
||||

|
||||
|
||||
## Introduction
|
||||
|
||||
@@ -12,7 +10,7 @@ Some of my [3D models](https://github.com/JustinSDK/dotSCAD#examples) require co
|
||||
|
||||
The idea of the name dotSCAD comes from the filename extension ".scad" of OpenSCAD.
|
||||
|
||||
## Get Started
|
||||
## Getting started
|
||||
|
||||
OpenSCAD uses three library locations, the installation library, built-in library, and user defined libraries. 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.
|
||||
|
||||
@@ -39,111 +37,110 @@ These examples incubate dotSCAD and dotSCAD refactors these examples. See [examp
|
||||
|
||||
[](examples#dogfooding-examples)
|
||||
|
||||
# API Documentation
|
||||
# API Reference
|
||||
|
||||
## 2D Module
|
||||
|
||||
Signature | Description
|
||||
--|--
|
||||
[**arc**(radius, angle, width = 1, width_mode = "LINE_CROSS")](https://openhome.cc/eGossip/OpenSCAD/lib3x-arc.html) | create an arc.
|
||||
[**arc**(radius, angle[, width, width_mode"])](https://openhome.cc/eGossip/OpenSCAD/lib3x-arc.html) | create an arc.
|
||||
[**hexagons**(radius, spacing, levels)](https://openhome.cc/eGossip/OpenSCAD/lib3x-hexagons.html) | create hexagons in a hexagon.
|
||||
[**hull_polyline2d**(points, width = 1)](https://openhome.cc/eGossip/OpenSCAD/lib3x-hull_polyline2d.html) | create a 2D polyline from a list of `[x, y]`.
|
||||
[**line2d**(p1, p2, width = 1, p1Style = "CAP_SQUARE", p2Style = "CAP_SQUARE")](https://openhome.cc/eGossip/OpenSCAD/lib3x-line2d.html) | create a line from two points.
|
||||
[**multi_line_text**(lines, line_spacing = 15, size = 10, font = "Arial", ...)](https://openhome.cc/eGossip/OpenSCAD/lib3x-multi_line_text.html) | create multi-line text from a list of strings.
|
||||
[**line2d**(p1, p2[, width, p1Style, p2Style])](https://openhome.cc/eGossip/OpenSCAD/lib3x-line2d.html) | create a line from two points.
|
||||
[**multi_line_text**(lines[, line_spacing, size, font, ...])](https://openhome.cc/eGossip/OpenSCAD/lib3x-multi_line_text.html) | create multi-line text from a list of strings.
|
||||
[**pie**(radius, angle)](https://openhome.cc/eGossip/OpenSCAD/lib3x-pie.html) | create polyline2de a pie (circular sector).
|
||||
[**polyline2d**(points, width = 1, startingStyle = "CAP_SQUARE", endingStyle = "CAP_SQUARE", ...)](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyline2d.html) | create a polyline from a list of `[x, y]` coordinates.
|
||||
[**polyline2d**(points[, width, startingStyle, endingStyle, ...])](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyline2d.html) | create a polyline from a list of `[x, y]` coordinates.
|
||||
[**polygon_hull**(points)](https://openhome.cc/eGossip/OpenSCAD/lib3x-polygon_hull.html) | create a convex polygon by hulling a list of points. It avoids using hull and small 2D primitives to create the polygon.
|
||||
[**rounded_square**(size, corner_r, center = false)](https://openhome.cc/eGossip/OpenSCAD/lib3x-rounded_square.html) | create a rounded square in the first quadrant.
|
||||
[**rounded_square**(size, corner_r[, center])](https://openhome.cc/eGossip/OpenSCAD/lib3x-rounded_square.html) | create a rounded square in the first quadrant.
|
||||
|
||||
## 3D Module
|
||||
|
||||
Signature | Description
|
||||
--|--
|
||||
[**crystal_ball**(radius, theta = 360, phi = 180, thickness = undef)](https://openhome.cc/eGossip/OpenSCAD/lib3x-crystal_ball.html) | create a crystal ball based on [spherical coordinates (r, θ, φ) used in mathematics](https://en.wikipedia.org/wiki/Spherical_coordinate_system).
|
||||
[**hull_polyline3d**(points, diameter = 1)](https://openhome.cc/eGossip/OpenSCAD/lib3x-hull_polyline3d.html) | create a 3D polyline from a list of `[x, y, z]`.
|
||||
[**line3d**(p1, p2, diameter = 1, p1Style = "CAP_CIRCLE", p2Style = "CAP_CIRCLE")](https://openhome.cc/eGossip/OpenSCAD/lib3x-line3d.html) | create a 3D line from two points.
|
||||
[**loft**(sections, slices = 1)](https://openhome.cc/eGossip/OpenSCAD/lib3x-loft.html) | develop a smooth skin between crosssections with different geometries.
|
||||
[**crystal_ball**(radius[, theta, phi, thickness])](https://openhome.cc/eGossip/OpenSCAD/lib3x-crystal_ball.html) | create a crystal ball based on [spherical coordinates (r, θ, φ) used in mathematics](https://en.wikipedia.org/wiki/Spherical_coordinate_system).
|
||||
[**line3d**(p1, p2[, diameter, p1Style, p2Style])](https://openhome.cc/eGossip/OpenSCAD/lib3x-line3d.html) | create a 3D line from two points.
|
||||
[**loft**(sections[, slices])](https://openhome.cc/eGossip/OpenSCAD/lib3x-loft.html) | develop a smooth skin between crosssections with different geometries.
|
||||
[**polyhedron_hull**(points)](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedron_hull.html) | create a convex polyhedron by hulling a list of points. It avoids using `hull` and small 3D primitives to create the polyhedron.
|
||||
[**polyline3d**(points, diameter, startingStyle = "CAP_CIRCLE", endingStyle = "CAP_CIRCLE")](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyline3d.html) | create a polyline from a list of `[x, y, z]`.
|
||||
[**rounded_cube**(size, corner_r, center = false)](https://openhome.cc/eGossip/OpenSCAD/lib3x-rounded_cube.html) | create a cube in the first octant.
|
||||
[**rounded_cylinder**(radius, h, round_r, convexity = 2, center = false)](https://openhome.cc/eGossip/OpenSCAD/lib3x-rounded_cylinder.html) | create a rounded cylinder.
|
||||
[**starburst**(r1, r2, n, height)](https://openhome.cc/eGossip/OpenSCAD/lib3x-starburst.html) | a 3D version of [`shape_starburst`](https://openhome.cc/eGossip/OpenSCAD/lib3x-starburst.html).
|
||||
[**sweep**(sections, triangles = "SOLID")](https://openhome.cc/eGossip/OpenSCAD/lib3x-sweep.html) | develop a smooth skin from crosssections with the same umber of sides.
|
||||
[**polyline3d**(points, diameter[, startingStyle, endingStyle])](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyline3d.html) | create a polyline from a list of `[x, y, z]`.
|
||||
[**rounded_cube**(size, corner_r[, center])](https://openhome.cc/eGossip/OpenSCAD/lib3x-rounded_cube.html) | create a cube in the first octant.
|
||||
[**rounded_cylinder**(radius, h, round_r[, convexity, center])](https://openhome.cc/eGossip/OpenSCAD/lib3x-rounded_cylinder.html) | create a rounded cylinder.
|
||||
[**sweep**(sections[, triangles])](https://openhome.cc/eGossip/OpenSCAD/lib3x-sweep.html) | develop a smooth skin from crosssections with the same umber of sides.
|
||||
|
||||
## Transformation
|
||||
|
||||
Signature | Description
|
||||
--|--
|
||||
[**along_with**(points, angles, twist = 0, scale = 1.0, method = "AXIS_ANGLE")](https://openhome.cc/eGossip/OpenSCAD/lib3x-along_with.html) | put children along the given path. If there's only one child, put the child for each point.
|
||||
[**bend**(size, angle, frags = 24)](https://openhome.cc/eGossip/OpenSCAD/lib3x-bend.html) | bend a 3D object.
|
||||
[**along_with**(points, angles[, twist, scale, method])](https://openhome.cc/eGossip/OpenSCAD/lib3x-along_with.html) | put children along the given path. If there's only one child, put the child for each point.
|
||||
[**bend**(size, angle[, frags])](https://openhome.cc/eGossip/OpenSCAD/lib3x-bend.html) | bend a 3D object.
|
||||
[**hollow_out**(shell_thickness) ](https://openhome.cc/eGossip/OpenSCAD/lib3x-hollow_out.html)| hollow out a 2D object.
|
||||
[**shear**(sx = [0, 0], sy = [0, 0], sz = [0, 0])](https://openhome.cc/eGossip/OpenSCAD/lib3x-shear.html) | shear all child elements along the X-axis, Y-axis, or Z-axis.
|
||||
[**shear**([sx, sy, sz])](https://openhome.cc/eGossip/OpenSCAD/lib3x-shear.html) | shear all child elements along the X-axis, Y-axis, or Z-axis.
|
||||
[**select**(i)](https://openhome.cc/eGossip/OpenSCAD/lib3x-select.html) | select module objects.
|
||||
[**polyline_join**(points)](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyline_join.html) | place a join on each point. Hull each pair of joins and union all convex hulls.
|
||||
|
||||
## 2D Function
|
||||
|
||||
Signature | Description
|
||||
--|--
|
||||
[**bijection_offset**(pts, d, epsilon = 0.0001)](https://openhome.cc/eGossip/OpenSCAD/lib3x-bijection_offset.html) | 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.
|
||||
[**bijection_offset**(pts, d[, epsilon])](https://openhome.cc/eGossip/OpenSCAD/lib3x-bijection_offset.html) | 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.
|
||||
[**contours**(points, threshold)](https://openhome.cc/eGossip/OpenSCAD/lib3x-contours.html) | compute contour polygons by applying [marching squares](https://en.wikipedia.org/wiki/Marching_squares) to a rectangular list of numeric values.
|
||||
[**in_shape**(shapt_pts, pt, include_edge = false, epsilon = 0.0001)](https://openhome.cc/eGossip/OpenSCAD/lib3x-in_shape.html) | check whether a point is inside a shape.
|
||||
[**trim_shape**(shape_pts, from, to, epsilon = 0.0001)](https://openhome.cc/eGossip/OpenSCAD/lib3x-trim_shape.html) | trim a tangled-edge shape to a non-tangled shape.
|
||||
[**in_shape**(shapt_pts, pt[, include_edge, epsilon])](https://openhome.cc/eGossip/OpenSCAD/lib3x-in_shape.html) | check whether a point is inside a shape.
|
||||
[**trim_shape**(shape_pts, from, to[, epsilon])](https://openhome.cc/eGossip/OpenSCAD/lib3x-trim_shape.html) | trim a tangled-edge shape to a non-tangled shape.
|
||||
|
||||
## 2D/3D Function
|
||||
|
||||
Signature | Description
|
||||
--|--
|
||||
[**angle_between**(vt1, vt2)](https://openhome.cc/eGossip/OpenSCAD/lib3x-angle_between.html) | return the angle between two vectors.
|
||||
[**bezier_smooth**(path_pts, round_d, t_step = 0.1, closed = false, angle_threshold = 0)](https://openhome.cc/eGossip/OpenSCAD/lib3x-bezier_smooth.html) | use bazier curves to smooth a path.
|
||||
[**cross_sections**(shape_pts, path_pts, angles, twist = 0, scale = 1.0)](https://openhome.cc/eGossip/OpenSCAD/lib3x-cross_sections.html) | given a 2D shape, points and angles along the path, this function returns all cross-sections.
|
||||
[**in_polyline**(line_pts, pt, epsilon = 0.0001)](https://openhome.cc/eGossip/OpenSCAD/lib3x-in_polyline.html) | check whether a point is on a line.
|
||||
[**lines_intersection**(line1, line2, ext = false, epsilon = 0.0001)](https://openhome.cc/eGossip/OpenSCAD/lib3x-lines_intersection.html) | find the intersection of two line segments. Return `[]` if lines don't intersect.
|
||||
[**paths2sections**(paths)](https://openhome.cc/eGossip/OpenSCAD/lib3x-paths2sections.html) | given a list of paths, this function returns all cross-sections described by those paths.
|
||||
[**bezier_smooth**(path_pts, round_d[, t_step, closed, angle_threshold])](https://openhome.cc/eGossip/OpenSCAD/lib3x-bezier_smooth.html) | use bazier curves to smooth a path.
|
||||
[**cross_sections**(shape_pts, path_pts, angles[, twist, scale])](https://openhome.cc/eGossip/OpenSCAD/lib3x-cross_sections.html) | given a 2D shape, points and angles along the path, this function returns all cross-sections.
|
||||
[**in_polyline**(line_pts, pt[, epsilon])](https://openhome.cc/eGossip/OpenSCAD/lib3x-in_polyline.html) | check whether a point is on a line.
|
||||
[**lines_intersection**(line1, line2[, ext, epsilon])](https://openhome.cc/eGossip/OpenSCAD/lib3x-lines_intersection.html) | find the intersection of two line segments. Return `[]` if lines don't intersect.
|
||||
[**rails2sections**(rails)](https://openhome.cc/eGossip/OpenSCAD/lib3x-rails2sections.html) | create sections along rails.
|
||||
[**path_scaling_sections**(shape_pts, edge_path)](https://openhome.cc/eGossip/OpenSCAD/lib3x-path_scaling_sections.html) | given an edge path with the first point at the outline of a shape, this function uses the path to calculate scaling factors and returns all scaled sections in the reversed order of the edge path.
|
||||
[**midpt_smooth**(points, n, closed = false)](https://openhome.cc/eGossip/OpenSCAD/lib3x-midpt_smooth.html) | given a 2D path, this function constructs a mid-point smoothed version by joining the mid-points of the lines of the path.
|
||||
[**midpt_smooth**(points, n[, closed])](https://openhome.cc/eGossip/OpenSCAD/lib3x-midpt_smooth.html) | given a 2D path, this function constructs a mid-point smoothed version by joining the mid-points of the lines of the path.
|
||||
|
||||
## Path
|
||||
|
||||
Signature | Description
|
||||
--|--
|
||||
[**arc_path**(radius, angle)](https://openhome.cc/eGossip/OpenSCAD/lib3x-arc_path.html) | create an arc path.
|
||||
[**archimedean_spiral**(arm_distance, init_angle, point_distance, num_of_points, rt_dir = "CT_CLK")](https://openhome.cc/eGossip/OpenSCAD/lib3x-archimedean_spiral.html) | get all points and angles on the path of an archimedean spiral.
|
||||
[**bauer_spiral**(n, radius = 1, rt_dir = "CT_CLK")](https://openhome.cc/eGossip/OpenSCAD/lib3x-bauer_spiral.html) | create visually even spacing of n points on the surface of the sphere. Successive points will all be approximately the same distance apart.
|
||||
[**archimedean_spiral**(arm_distance, init_angle, point_distance, num_of_points[, rt_dir])](https://openhome.cc/eGossip/OpenSCAD/lib3x-archimedean_spiral.html) | get all points and angles on the path of an archimedean spiral.
|
||||
[**bauer_spiral**(n, radius = 1[, rt_dir])](https://openhome.cc/eGossip/OpenSCAD/lib3x-bauer_spiral.html) | create visually even spacing of n points on the surface of the sphere. Successive points will all be approximately the same distance apart.
|
||||
[**bezier_curve**(t_step, points)](https://openhome.cc/eGossip/OpenSCAD/lib3x-bezier_curve.html) | given a set of control points, this function returns points of the Bézier path.
|
||||
[**bspline_curve**(t_step, degree, points, knots, weights)](https://openhome.cc/eGossip/OpenSCAD/lib3x-bspline_curve.html) | B-spline interpolation using [de Boor's algorithm](https://en.wikipedia.org/wiki/De_Boor%27s_algorithm).
|
||||
[**curve**(t_step, points, tightness = 0)](https://openhome.cc/eGossip/OpenSCAD/lib3x-curve.html) | create a curved path. An implementation of [Centripetal Catmull-Rom spline](https://en.wikipedia.org/wiki/Centripetal_Catmull%E2%80%93Rom_spline).
|
||||
[**fibonacci_lattice**(n, radius = 1, dir = "CT_CLK")](https://openhome.cc/eGossip/OpenSCAD/lib3x-fibonacci_lattice.html) | create visually even spacing of n points on the surface of the sphere. Nearest-neighbor points will all be approximately the same distance apart.
|
||||
[**golden_spiral**(from, to, point_distance, rt_dir = "CT_CLK")](https://openhome.cc/eGossip/OpenSCAD/lib3x-golden_spiral.html) | get all points and angles on the path of a golden spiral based on Fibonacci numbers. The distance between two points is almost constant.
|
||||
[**helix**(radius, levels, level_dist, vt_dir = "SPI_DOWN", rt_dir = "CT_CLK")](https://openhome.cc/eGossip/OpenSCAD/lib3x-helix.html) | get all points on the path of a spiral around a cylinder.
|
||||
[**sphere_spiral**(radius, za_step, z_circles = 1, begin_angle = 0, end_angle = 0, ...) ](https://openhome.cc/eGossip/OpenSCAD/lib3x-sphere_spiral.html)| create all points and angles on the path of a spiral around a sphere. It returns a vector of `[[x, y, z], [ax, ay, az]]`.
|
||||
[**curve**(t_step, points[, tightness])](https://openhome.cc/eGossip/OpenSCAD/lib3x-curve.html) | create a curved path. An implementation of [Centripetal Catmull-Rom spline](https://en.wikipedia.org/wiki/Centripetal_Catmull%E2%80%93Rom_spline).
|
||||
[**fibonacci_lattice**(n, radius = 1[, dir])](https://openhome.cc/eGossip/OpenSCAD/lib3x-fibonacci_lattice.html) | create visually even spacing of n points on the surface of the sphere. Nearest-neighbor points will all be approximately the same distance apart.
|
||||
[**golden_spiral**(from, to, point_distance[, rt_dir)]](https://openhome.cc/eGossip/OpenSCAD/lib3x-golden_spiral.html) | get all points and angles on the path of a golden spiral based on Fibonacci numbers. The distance between two points is almost constant.
|
||||
[**helix**(radius, levels, level_dist[, vt_dir, rt_dir])](https://openhome.cc/eGossip/OpenSCAD/lib3x-helix.html) | get all points on the path of a spiral around a cylinder.
|
||||
[**sphere_spiral**(radius, za_step[, z_circles, begin_angle, end_angle, ...]) ](https://openhome.cc/eGossip/OpenSCAD/lib3x-sphere_spiral.html)| create all points and angles on the path of a spiral around a sphere. It returns a vector of `[[x, y, z], [ax, ay, az]]`.
|
||||
[**torus_knot**(p, q, phi_step)](https://openhome.cc/eGossip/OpenSCAD/lib3x-torus_knot.html) | generate a path of [The (p,q)-torus knot](https://en.wikipedia.org/wiki/Torus_knot).
|
||||
|
||||
## Extrusion
|
||||
|
||||
Signature | Description
|
||||
--|--
|
||||
[**bend_extrude**(size, thickness, angle, frags = 24)](https://openhome.cc/eGossip/OpenSCAD/lib3x-bend_extrude.html) | extrude and bend a 2D shape.
|
||||
[**box_extrude**(height, shell_thickness, bottom_thickness, offset_mode = "delta", chamfer = false, ...)](https://openhome.cc/eGossip/OpenSCAD/lib3x-box_extrude.html) | create a box (container) from a 2D object.
|
||||
[**ellipse_extrude**(semi_minor_axis, height, center = false, convexity = 10, twist = 0, slices = 20)](https://openhome.cc/eGossip/OpenSCAD/lib3x-ellipse_extrude.html) | extrude a 2D object along the path of an ellipse from 0 to 180 degrees.
|
||||
[**rounded_extrude**(size, round_r, angle = 90, twist = 0, convexity = 10)](https://openhome.cc/eGossip/OpenSCAD/lib3x-rounded_extrude.html) | extrude a 2D object roundly from 0 to 180 degrees.
|
||||
[**bend_extrude**(size, thickness, angle[, frags])](https://openhome.cc/eGossip/OpenSCAD/lib3x-bend_extrude.html) | extrude and bend a 2D shape.
|
||||
[**box_extrude**(height, shell_thickness, bottom_thickness[, offset_mode, chamfer, ...])](https://openhome.cc/eGossip/OpenSCAD/lib3x-box_extrude.html) | create a box (container) from a 2D object.
|
||||
[**ellipse_extrude**(semi_minor_axis, height[, center, convexity, twist, slices])](https://openhome.cc/eGossip/OpenSCAD/lib3x-ellipse_extrude.html) | extrude a 2D object along the path of an ellipse from 0 to 180 degrees.
|
||||
[**rounded_extrude**(size, round_r[, angle, twist, convexity])](https://openhome.cc/eGossip/OpenSCAD/lib3x-rounded_extrude.html) | extrude a 2D object roundly from 0 to 180 degrees.
|
||||
[**stereographic_extrude**(shadow_side_leng)](https://openhome.cc/eGossip/OpenSCAD/lib3x-stereographic_extrude.html) | take a 2D polygon as input and extend it onto a sphere.
|
||||
|
||||
## 2D Shape
|
||||
|
||||
Signature | Description
|
||||
--|--
|
||||
[**shape_arc**(radius, angle, width, width_mode = "LINE_CROSS")](https://openhome.cc/eGossip/OpenSCAD/lib3x-shape_arc.html) | return points on the path of an arc shape.
|
||||
[**shape_arc**(radius, angle, width[, width_mode])](https://openhome.cc/eGossip/OpenSCAD/lib3x-shape_arc.html) | return points on the path of an arc shape.
|
||||
[**shape_circle**(radius, n)](https://openhome.cc/eGossip/OpenSCAD/lib3x-shape_circle.html) | return points on the path of a circle.
|
||||
[**shape_cyclicpolygon**(sides, circle_r, corner_r)](https://openhome.cc/eGossip/OpenSCAD/lib3x-shape_cyclicpolygon.html) | return points on the path of a regular cyclic polygon.
|
||||
[**shape_ellipse**(axes)](https://openhome.cc/eGossip/OpenSCAD/lib3x-shape_ellipse.html) | return points on the path of an ellipse.
|
||||
[**shape_liquid_splitting**(radius, centre_dist, tangent_angle = 30, t_step = 0.1)](https://openhome.cc/eGossip/OpenSCAD/lib3x-shape_liquid_splitting.html) | return shape points of two splitting liquid shapes, kind of how cells divide.
|
||||
[**shape_path_extend**(stroke_pts, path_pts, scale = 1.0, closed = false)](https://openhome.cc/eGossip/OpenSCAD/lib3x-shape_path_extend.html) | extend a 2D stroke along a path to create a 2D shape.
|
||||
[**shape_liquid_splitting**(radius, centre_dist[, tangent_angle, t_step])](https://openhome.cc/eGossip/OpenSCAD/lib3x-shape_liquid_splitting.html) | return shape points of two splitting liquid shapes, kind of how cells divide.
|
||||
[**shape_path_extend**(stroke_pts, path_pts[, scale, closed])](https://openhome.cc/eGossip/OpenSCAD/lib3x-shape_path_extend.html) | extend a 2D stroke along a path to create a 2D shape.
|
||||
[**shape_pentagram**(r)](https://openhome.cc/eGossip/OpenSCAD/lib3x-shape_pentagram.html) | return shape points of a pentagram.
|
||||
[**shape_pie**(radius, angle)](https://openhome.cc/eGossip/OpenSCAD/lib3x-shape_pie.html) | return shape points of a pie (circular sector) shape.
|
||||
[**shape_square**(size, corner_r = 0)](https://openhome.cc/eGossip/OpenSCAD/lib3x-shape_square.html) | return shape points of a rounded square or rectangle.
|
||||
[**shape_starburst**(r1, r2, n)](https://openhome.cc/eGossip/OpenSCAD/lib3x-shape_starburst.html) | returns shape points of a star.
|
||||
[**shape_superformula**(phi_step, m1, m2, n1, n2 = 1, n3 = 1, a = 1, b = 1)](https://openhome.cc/eGossip/OpenSCAD/lib3x-shape_superformula.html) | return shape points of [Superformula](https://en.wikipedia.org/wiki/Superformula).
|
||||
[**shape_taiwan**(h, distance = 0)](https://openhome.cc/eGossip/OpenSCAD/lib3x-shape_taiwan.html) | return shape points of [Taiwan](https://www.google.com.tw/maps?q=taiwan&um=1&ie=UTF-8&sa=X&ved=0ahUKEwjai9XrqurTAhVIopQKHbEHClwQ_AUICygC).
|
||||
[**shape_trapezium**(length, h, corner_r = 0)](https://openhome.cc/eGossip/OpenSCAD/lib3x-shape_trapezium.html) | return shape points of an isosceles trapezoid.
|
||||
[**shape_square**(size[, corner_r])](https://openhome.cc/eGossip/OpenSCAD/lib3x-shape_square.html) | return shape points of a rounded square or rectangle.
|
||||
[**shape_star**([outer_radius, inner_radius, n])](https://openhome.cc/eGossip/OpenSCAD/lib3x-shape_star.html) | create a 2D star.
|
||||
[**shape_superformula**(phi_step, m1, m2, n1, [n2, n3, a, b])](https://openhome.cc/eGossip/OpenSCAD/lib3x-shape_superformula.html) | return shape points of [Superformula](https://en.wikipedia.org/wiki/Superformula).
|
||||
[**shape_taiwan**(h[, distance])](https://openhome.cc/eGossip/OpenSCAD/lib3x-shape_taiwan.html) | return shape points of [Taiwan](https://www.google.com.tw/maps?q=taiwan&um=1&ie=UTF-8&sa=X&ved=0ahUKEwjai9XrqurTAhVIopQKHbEHClwQ_AUICygC).
|
||||
[**shape_trapezium**(length, h[, corner_r])](https://openhome.cc/eGossip/OpenSCAD/lib3x-shape_trapezium.html) | return shape points of an isosceles trapezoid.
|
||||
|
||||
## 2D Shape Extrusion
|
||||
|
||||
@@ -153,7 +150,7 @@ These examples incubate dotSCAD and dotSCAD refactors these examples. See [examp
|
||||
[**golden_spiral_extrude**(shape_pts, from, to, point_distance, ...)](https://openhome.cc/eGossip/OpenSCAD/lib3x-golden_spiral_extrude.html) | extrude a 2D shape along the path of a golden spiral.
|
||||
[**helix_extrude**(shape_pts, radius, levels, level_dist, ...)](https://openhome.cc/eGossip/OpenSCAD/lib3x-helix_extrude.html) | extrude a 2D shape along a helix path.
|
||||
[**path_extrude**(shape_pts, path_pts, ...)](https://openhome.cc/eGossip/OpenSCAD/lib3x-path_extrude.html) | extrude a 2D shape along a path.
|
||||
[**ring_extrude**(shape_pts, radius, angle = 360, ...)](https://openhome.cc/eGossip/OpenSCAD/lib3x-ring_extrude.html) | rotational extrusion spins a 2D shape around the Z-axis.
|
||||
[**ring_extrude**(shape_pts, radius[, angle = 360])](https://openhome.cc/eGossip/OpenSCAD/lib3x-ring_extrude.html) | rotational extrusion spins a 2D shape around the Z-axis.
|
||||
[**sphere_spiral_extrude**(shape_pts, radius, za_step, ...)](https://openhome.cc/eGossip/OpenSCAD/lib3x-sphere_spiral_extrude.html) | extrude a 2D shape along the path of a sphere spiral.
|
||||
|
||||
## Util
|
||||
@@ -163,13 +160,13 @@ These examples incubate dotSCAD and dotSCAD refactors these examples. See [examp
|
||||
Signature | Description
|
||||
--|--
|
||||
[**util/bsearch**(sorted, target)](https://openhome.cc/eGossip/OpenSCAD/lib3x-bsearch.html) | search a value in a list whose elements must be sorted by zyx.
|
||||
[**util/has**(lt, elem, sorted = false)](https://openhome.cc/eGossip/OpenSCAD/lib3x-has.html) | return `true` if `lt` contains elem.
|
||||
[**util/has**(lt, elem[, sorted])](https://openhome.cc/eGossip/OpenSCAD/lib3x-has.html) | return `true` if `lt` contains elem.
|
||||
[**util/find_index**(lt, test)](https://openhome.cc/eGossip/OpenSCAD/lib3x-find_index.html) | return the index of the first element that satisfies the testing function.
|
||||
[**util/dedup**(lt, ...)](https://openhome.cc/eGossip/OpenSCAD/lib3x-dedup.html) | eliminate duplicate vectors.
|
||||
[**util/flat**(lt, depth = 1)](https://openhome.cc/eGossip/OpenSCAD/lib3x-flat.html) | return a new list with all sub-list elements concatenated into it recursively up to the specified depth.
|
||||
[**util/flat**(lt[, depth])](https://openhome.cc/eGossip/OpenSCAD/lib3x-flat.html) | return a new list with all sub-list elements concatenated into it recursively up to the specified depth.
|
||||
[**util/reverse**(lt)](https://openhome.cc/eGossip/OpenSCAD/lib3x-reverse.html) | reverse a list.
|
||||
[**util/slice**(lt, begin, end)](https://openhome.cc/eGossip/OpenSCAD/lib3x-slice.html) | return a list selected from `begin` to `end`, or to the `end` of the list (`end` not included).
|
||||
[**util/sort**(lt, by = "idx", idx = 0)](https://openhome.cc/eGossip/OpenSCAD/lib3x-sort.html) | sort a list.
|
||||
[**util/sort**(lt[, by, idx])](https://openhome.cc/eGossip/OpenSCAD/lib3x-sort.html) | sort a list.
|
||||
[**util/sum**(lt)](https://openhome.cc/eGossip/OpenSCAD/lib3x-sum.html) | use `+` to sum up all elements in a list.
|
||||
[**util/swap**(lt, i, j)](https://openhome.cc/eGossip/OpenSCAD/lib3x-swap.html) | swap two elements in a list.
|
||||
[**util/zip**(lts, combine)](https://openhome.cc/eGossip/OpenSCAD/lib3x-zip.html) | make a list that aggregates elements from each of the lists.
|
||||
@@ -181,8 +178,8 @@ These examples incubate dotSCAD and dotSCAD refactors these examples. See [examp
|
||||
Signature | Description
|
||||
--|--
|
||||
[**util/choose**(choices, seed)](https://openhome.cc/eGossip/OpenSCAD/lib3x-choose.html) | choose an element from the given list.
|
||||
[**util/rand**(min_value = 0, max_value = 1, seed_value = undef)](https://openhome.cc/eGossip/OpenSCAD/lib3x-rand.html) | generate a pseudo random number.
|
||||
[**util/shuffle**(lt, seed = undef)](https://openhome.cc/eGossip/OpenSCAD/lib3x-shuffle.html) | randomizes the order of the elements.
|
||||
[**util/rand**([min_value, max_value, seed_value])](https://openhome.cc/eGossip/OpenSCAD/lib3x-rand.html) | generate a pseudo random number.
|
||||
[**util/shuffle**(lt[, seed])](https://openhome.cc/eGossip/OpenSCAD/lib3x-shuffle.html) | randomizes the order of the elements.
|
||||
|
||||
### util/string
|
||||
|
||||
@@ -235,7 +232,7 @@ These examples incubate dotSCAD and dotSCAD refactors these examples. See [examp
|
||||
[**matrix/m_mirror**(v)](https://openhome.cc/eGossip/OpenSCAD/lib3x-m_mirror.html) | generate a transformation matrix which can pass into `multmatrix` to mirror the child element on a plane through the origin.
|
||||
[**matrix/m_rotation**(a, v)](https://openhome.cc/eGossip/OpenSCAD/lib3x-m_rotation.html) | Generate a transformation matrix which can pass into `multmatrix` to rotate the child element about the axis of the coordinate system or around an arbitrary axis.
|
||||
[**matrix/m_scaling**(s)](https://openhome.cc/eGossip/OpenSCAD/lib3x-m_scaling.html) | generate a transformation matrix which can pass into `multmatrix` to scale its child elements using the specified vector.
|
||||
[**matrix/m_shearing**(sx = [0, 0], sy = [0, 0], sz = [0, 0])](https://openhome.cc/eGossip/OpenSCAD/lib3x-m_shearing.html) | generate a transformation matrix which can pass into `multmatrix` to shear all child elements along the X-axis, Y-axis, or Z-axis in 3D.
|
||||
[**matrix/m_shearing**([sx, sy, sz])](https://openhome.cc/eGossip/OpenSCAD/lib3x-m_shearing.html) | generate a transformation matrix which can pass into `multmatrix` to shear all child elements along the X-axis, Y-axis, or Z-axis in 3D.
|
||||
[**matrix/m_translation**(v)](https://openhome.cc/eGossip/OpenSCAD/lib3x-m_translation.html) | generate a transformation matrix which can pass into multmatrix to translates (moves) its child elements along the specified vector.
|
||||
[**maxtrix/m_transpose**(m)](https://openhome.cc/eGossip/OpenSCAD/lib3x-m_transpose.html) | transpose a matrix.
|
||||
|
||||
@@ -245,10 +242,10 @@ These examples incubate dotSCAD and dotSCAD refactors these examples. See [examp
|
||||
--|--
|
||||
[**ptf/ptf_bend**(size, point, radius, angle)](https://openhome.cc/eGossip/OpenSCAD/lib3x-ptf_bend.html) | transform a point inside a rectangle to a point of an arc.
|
||||
[**ptf/ptf_circle**(size, point)](https://openhome.cc/eGossip/OpenSCAD/lib3x-ptf_circle.html) | transform a point inside a rectangle to a point inside a circle.
|
||||
[**ptf/ptf_ring**(size, point, radius, angle = 360, twist = 0)](https://openhome.cc/eGossip/OpenSCAD/lib3x-ptf_ring.html) | transform a point inside a rectangle to a point of a ring.
|
||||
[**ptf/ptf_ring**(size, point, radius[, angle, twist])](https://openhome.cc/eGossip/OpenSCAD/lib3x-ptf_ring.html) | transform a point inside a rectangle to a point of a ring.
|
||||
[**ptf/ptf_rotate**(point, a, v)](https://openhome.cc/eGossip/OpenSCAD/lib3x-ptf_rotate.html) | rotate a point a degrees around the axis of the coordinate system or an arbitrary axis.
|
||||
[**ptf/ptf_sphere**(size, point, radius, angle = [180, 360])](https://openhome.cc/eGossip/OpenSCAD/lib3x-ptf_sphere.html) | transform a point inside a rectangle to a point of a sphere.
|
||||
[**ptf/ptf_torus**(size, point, radius, angle = [360, 360], twist = 0)](https://openhome.cc/eGossip/OpenSCAD/lib3x-ptf_torus.html) | transform a point inside a rectangle to a point of a torus.
|
||||
[**ptf/ptf_sphere**(size, point, radius[, angle])](https://openhome.cc/eGossip/OpenSCAD/lib3x-ptf_sphere.html) | transform a point inside a rectangle to a point of a sphere.
|
||||
[**ptf/ptf_torus**(size, point, radius[, angle, twist])](https://openhome.cc/eGossip/OpenSCAD/lib3x-ptf_torus.html) | transform a point inside a rectangle to a point of a torus.
|
||||
[**ptf/ptf_x_twist**(size, point, angle)](https://openhome.cc/eGossip/OpenSCAD/lib3x-ptf_x_twist.html) | twist a point along the x-axis.
|
||||
[**ptf/ptf_y_twist**(size, point, angle)](https://openhome.cc/eGossip/OpenSCAD/lib3x-ptf_y_twist.html) | twist a point along the y-axis.
|
||||
|
||||
@@ -258,8 +255,8 @@ These examples incubate dotSCAD and dotSCAD refactors these examples. See [examp
|
||||
--|--
|
||||
[**triangle/tri_circumcenter**(shape_pts)](https://openhome.cc/eGossip/OpenSCAD/lib3x-tri_circumcenter.html) | return the circumcenter of a triangle.
|
||||
[**triangle/tri_incenter**(shape_pts)](https://openhome.cc/eGossip/OpenSCAD/lib3x-tri_incenter.html) | return the incenter of a triangle.
|
||||
[**triangle/tri_ear_clipping**(shape_pts, ret = "TRI_INDICES", ...)](https://openhome.cc/eGossip/OpenSCAD/lib3x-tri_ear_clipping.html) | triangulation by [ear clipping](https://en.wikipedia.org/wiki/Polygon_triangulation#Ear_clipping_method).
|
||||
[**triangle/tri_delaunay**(points, ret = "TRI_INDICES")](https://openhome.cc/eGossip/OpenSCAD/lib3x-tri_delaunay.html) | Join a set of points to make a [Delaunay triangulation](https://en.wikipedia.org/wiki/Delaunay_triangulation).
|
||||
[**triangle/tri_ear_clipping**(shape_pts[, ret, ...])](https://openhome.cc/eGossip/OpenSCAD/lib3x-tri_ear_clipping.html) | triangulation by [ear clipping](https://en.wikipedia.org/wiki/Polygon_triangulation#Ear_clipping_method).
|
||||
[**triangle/tri_delaunay**(points[, ret])](https://openhome.cc/eGossip/OpenSCAD/lib3x-tri_delaunay.html) | Join a set of points to make a [Delaunay triangulation](https://en.wikipedia.org/wiki/Delaunay_triangulation).
|
||||
[**triangle/tri_delaunay_indices**(d)](https://openhome.cc/eGossip/OpenSCAD/lib3x-tri_delaunay_indices.html) | return triangle indices from a delaunay object.
|
||||
[**triangle/tri_delaunay_shapes**(d)](https://openhome.cc/eGossip/OpenSCAD/lib3x-tri_delaunay_shapes.html) | return triangle shapes from a delaunay object.
|
||||
[**triangle/tri_delaunay_voronoi**(d)](https://openhome.cc/eGossip/OpenSCAD/lib3x-tri_delaunay_voronoi.html) | return [Voronoi](https://en.wikipedia.org/wiki/Voronoi_diagram) cells from a delaunay object.
|
||||
@@ -270,10 +267,10 @@ These examples incubate dotSCAD and dotSCAD refactors these examples. See [examp
|
||||
|
||||
Signature | Description
|
||||
--|--
|
||||
[**turtle/footprints2**(cmds, start = [0, 0])](https://openhome.cc/eGossip/OpenSCAD/lib3x-footprints2.html) | drive a turtle with `["forward", length]` or `["turn", angle]`. This function is intended to use a turtle to imitate freehand drawing.
|
||||
[**turtle/footprints3**(cmds, start = [0, 0, 0])](https://openhome.cc/eGossip/OpenSCAD/lib3x-footprints3.html) | a 3D verion of `footprint2`.
|
||||
[**turtle/lsystem2**(axiom, rules, n, angle, leng = 1, heading = 0, ...)](https://openhome.cc/eGossip/OpenSCAD/lib3x-lsystem2.html) | 2D implementation of [L-system](https://en.wikipedia.org/wiki/L-system).
|
||||
[**turtle/lsystem3**(axiom, rules, n, angle, leng = 1, heading = 0, ...)](https://openhome.cc/eGossip/OpenSCAD/lib3x-lsystem3.html) | 3D implementation of [L-system](https://en.wikipedia.org/wiki/L-system).
|
||||
[**turtle/footprints2**(cmds[, start])](https://openhome.cc/eGossip/OpenSCAD/lib3x-footprints2.html) | drive a turtle with `["forward", length]` or `["turn", angle]`. This function is intended to use a turtle to imitate freehand drawing.
|
||||
[**turtle/footprints3**(cmds[, start])](https://openhome.cc/eGossip/OpenSCAD/lib3x-footprints3.html) | a 3D verion of `footprint2`.
|
||||
[**turtle/lsystem2**(axiom, rules, n, angle[, leng, heading, ...])](https://openhome.cc/eGossip/OpenSCAD/lib3x-lsystem2.html) | 2D implementation of [L-system](https://en.wikipedia.org/wiki/L-system).
|
||||
[**turtle/lsystem3**(axiom, rules, n, angle[, leng, heading, ...])](https://openhome.cc/eGossip/OpenSCAD/lib3x-lsystem3.html) | 3D implementation of [L-system](https://en.wikipedia.org/wiki/L-system).
|
||||
[**turtle/t2d**(t, cmd, point, angle, leng)](https://openhome.cc/eGossip/OpenSCAD/lib3x-t2d.html) | an implementation of Turtle Graphics.
|
||||
[**turtle/t3d**(t, cmd, point, unit_vectors, leng, angle)](https://openhome.cc/eGossip/OpenSCAD/lib3x-t3d.html) | a 3D version of `t2d`.
|
||||
|
||||
@@ -281,40 +278,40 @@ These examples incubate dotSCAD and dotSCAD refactors these examples. See [examp
|
||||
|
||||
Signature | Description
|
||||
--|--
|
||||
[**voxel/vx_ascii**(char, center = false, invert = false)](https://openhome.cc/eGossip/OpenSCAD/lib3x-vx_ascii.html) | generate 8x8 voxel points of printable ASCII characters (codes 32dec to 126dec).
|
||||
[**voxel/vx_ascii**(char[, center, invert])](https://openhome.cc/eGossip/OpenSCAD/lib3x-vx_ascii.html) | generate 8x8 voxel points of printable ASCII characters (codes 32dec to 126dec).
|
||||
[**voxel/vx_bezier**(p1, p2, p3, p4)](https://openhome.cc/eGossip/OpenSCAD/lib3x-vx_bezier.html) | return voxel-by-voxel points of Bézier Curve.
|
||||
[**voxel/vx_circle**(radius, filled = false)](https://openhome.cc/eGossip/OpenSCAD/lib3x-vx_circle.html) | return points that can be used to draw a voxel-style circle.
|
||||
[**voxel/vx_contour**(points, sorted = false)](https://openhome.cc/eGossip/OpenSCAD/lib3x-vx_contour.html) | return the contour which encircles the area.
|
||||
[**voxel/vx_curve**(points, tightness = 0)](https://openhome.cc/eGossip/OpenSCAD/lib3x-vx_curve.html) | the curve is drawn only from the 2nd control point to the second-last control point.
|
||||
[**voxel/vx_cylinder**(r, h, filled = false, thickness = 1)](https://openhome.cc/eGossip/OpenSCAD/lib3x-vx_cylinder.html) | return points that can be used to draw a voxel-style cylinder.
|
||||
[**voxel/vx_circle**(radius[, filled])](https://openhome.cc/eGossip/OpenSCAD/lib3x-vx_circle.html) | return points that can be used to draw a voxel-style circle.
|
||||
[**voxel/vx_contour**(points[, sorted])](https://openhome.cc/eGossip/OpenSCAD/lib3x-vx_contour.html) | return the contour which encircles the area.
|
||||
[**voxel/vx_curve**(points[, tightness])](https://openhome.cc/eGossip/OpenSCAD/lib3x-vx_curve.html) | the curve is drawn only from the 2nd control point to the second-last control point.
|
||||
[**voxel/vx_cylinder**(r, h[, filled, thickness])](https://openhome.cc/eGossip/OpenSCAD/lib3x-vx_cylinder.html) | return points that can be used to draw a voxel-style cylinder.
|
||||
[**voxel/vx_difference**(points1, points2)](https://openhome.cc/eGossip/OpenSCAD/lib3x-vx_difference.html) | create a difference of two lists of points.
|
||||
[**voxel/vx_from**(binaries, center = false, invert = false)](https://openhome.cc/eGossip/OpenSCAD/lib3x-vx_from.html) | given a list of 0s and 1s that represent a black-and-white image. This function translates them into voxel points.
|
||||
[**voxel/vx_gray**(levels, center = false, invert = false, normalize = false)](https://openhome.cc/eGossip/OpenSCAD/lib3x-vx_gray.html) | given a list of numbers (0 ~ 255) that represent a gray image. This function translates them into a list of `[x, y, level]`s.
|
||||
[**voxel/vx_from**(binaries[, center, invert])](https://openhome.cc/eGossip/OpenSCAD/lib3x-vx_from.html) | given a list of 0s and 1s that represent a black-and-white image. This function translates them into voxel points.
|
||||
[**voxel/vx_gray**(levels[, center, invert, normalize])](https://openhome.cc/eGossip/OpenSCAD/lib3x-vx_gray.html) | given a list of numbers (0 ~ 255) that represent a gray image. This function translates them into a list of `[x, y, level]`s.
|
||||
[**voxel/vx_intersection**(points1, points2)](https://openhome.cc/eGossip/OpenSCAD/lib3x-vx_intersection.html) | create an intersection of two lists of points.
|
||||
[**voxel/vx_line**(p1, p2)](https://openhome.cc/eGossip/OpenSCAD/lib3x-vx_line.html) | given two points. it returns points that can be used to draw a voxel-style line.
|
||||
[**voxel/vx_polygon**(points, filled = false)](https://openhome.cc/eGossip/OpenSCAD/lib3x-vx_polygon.html) | return points that can be used to draw a voxel-style polygon.
|
||||
[**voxel/vx_polygon**(points[, filled])](https://openhome.cc/eGossip/OpenSCAD/lib3x-vx_polygon.html) | return points that can be used to draw a voxel-style polygon.
|
||||
[**voxel/vx_polyline**(points)](https://openhome.cc/eGossip/OpenSCAD/lib3x-vx_polyline.html) | return points that can be used to draw a voxel-style polyline.
|
||||
[**voxel/vx_sphere**(radius, filled = false, thickness = 1)](https://openhome.cc/eGossip/OpenSCAD/lib3x-vx_sphere.html) | return points that can be used to draw a voxel-style sphere.
|
||||
[**voxel/vx_sphere**(radius[, filled, thickness])](https://openhome.cc/eGossip/OpenSCAD/lib3x-vx_sphere.html) | return points that can be used to draw a voxel-style sphere.
|
||||
[**voxel/vx_union**(points1, points2)](https://openhome.cc/eGossip/OpenSCAD/lib3x-vx_union.html) | create a union of two lists of points.
|
||||
|
||||
## Part
|
||||
|
||||
Signature | Description
|
||||
--|--
|
||||
[**part/cone**(radius, length = 0, spacing = 0.5, angle = 50, void = false, ends = false)](https://openhome.cc/eGossip/OpenSCAD/lib3x-cone.html) | create a cone for rotatable models.
|
||||
[**part/connector_peg**(radius, height, spacing = 0.5, void = false, ends = false)](https://openhome.cc/eGossip/OpenSCAD/lib3x-connector_peg.html) | create a connector peg.
|
||||
[**part/joint_T**(shaft_r, shaft_h, t_leng, thickness, spacing = 0.5, center = false)](https://openhome.cc/eGossip/OpenSCAD/lib3x-joint_T.html) | create a joint_T for rotatable models.
|
||||
[**part/cone**(radius[, length, spacing, angle, void, ends])](https://openhome.cc/eGossip/OpenSCAD/lib3x-cone.html) | create a cone for rotatable models.
|
||||
[**part/connector_peg**(radius, height[, spacing, void, ends])](https://openhome.cc/eGossip/OpenSCAD/lib3x-connector_peg.html) | create a connector peg.
|
||||
[**part/joint_T**(shaft_r, shaft_h, t_leng, thickness,[ spacing, center])](https://openhome.cc/eGossip/OpenSCAD/lib3x-joint_T.html) | create a joint_T for rotatable models.
|
||||
|
||||
## Surface
|
||||
|
||||
Signature | Description
|
||||
--|--
|
||||
[**surface/sf_bend**(levels, radius, thickness, depth, angle = 180, invert = false)](https://openhome.cc/eGossip/OpenSCAD/lib3x-sf_bend.html) | bend a photo.
|
||||
[**surface/sf_ring**(levels, radius, thickness, depth, angle = 360, twist = 0, invert = false)](https://openhome.cc/eGossip/OpenSCAD/lib3x-sf_ring.html) | turn a photo into a ring.
|
||||
[**surface/sf_solidify**(surface1, surface2, slicing = "SLASH")](https://openhome.cc/eGossip/OpenSCAD/lib3x-sf_solidify.html) | solidify two square surfaces.
|
||||
[**surface/sf_sphere**(levels, radius, thickness, depth, angle = [180, 360], invert = false)](https://openhome.cc/eGossip/OpenSCAD/lib3x-sf_sphere.html) | map a photo onto a sphere.
|
||||
[**surface/sf_square**(levels, thickness, depth, x_twist = 0, y_twist = 0, invert = false)](https://openhome.cc/eGossip/OpenSCAD/lib3x-sf_square.html) | turn a photo into a twistable square.
|
||||
[**surface/sf_torus**(levels, radius, thickness, depth, angle = [360, 360], twist = 0, invert = false)](https://openhome.cc/eGossip/OpenSCAD/lib3x-sf_torus.html) | turn a photo to a torus.
|
||||
[**surface/sf_bend**(levels, radius, thickness, depth[, angle, invert])](https://openhome.cc/eGossip/OpenSCAD/lib3x-sf_bend.html) | bend a photo.
|
||||
[**surface/sf_ring**(levels, radius, thickness, depth[, angle, twist, invert])](https://openhome.cc/eGossip/OpenSCAD/lib3x-sf_ring.html) | turn a photo into a ring.
|
||||
[**surface/sf_solidify**(surface1, surface2[, slicing])](https://openhome.cc/eGossip/OpenSCAD/lib3x-sf_solidify.html) | solidify two square surfaces.
|
||||
[**surface/sf_sphere**(levels, radius, thickness, depth[, angle, invert)]](https://openhome.cc/eGossip/OpenSCAD/lib3x-sf_sphere.html) | map a photo onto a sphere.
|
||||
[**surface/sf_square**(levels, thickness, depth[, x_twist, y_twist, invert])](https://openhome.cc/eGossip/OpenSCAD/lib3x-sf_square.html) | turn a photo into a twistable square.
|
||||
[**surface/sf_torus**(levels, radius, thickness, depth[, angle, twist, invert])](https://openhome.cc/eGossip/OpenSCAD/lib3x-sf_torus.html) | turn a photo to a torus.
|
||||
[**surface/sf_curve**(levels, curve_path, ...)](https://openhome.cc/eGossip/OpenSCAD/lib3x-sf_curve.html) | curve a photo.
|
||||
[**surface/sf_splines**(ctrl_pts, row_spline, column_spline)](https://openhome.cc/eGossip/OpenSCAD/lib3x-sf_splines.html) | generalized-spline surface.
|
||||
[**surface/sf_thicken**(points, thickness, ...)](https://openhome.cc/eGossip/OpenSCAD/lib3x-sf_thicken.html) | thicken a surface.
|
||||
@@ -325,38 +322,54 @@ These examples incubate dotSCAD and dotSCAD refactors these examples. See [examp
|
||||
|
||||
Signature | Description
|
||||
--|--
|
||||
[**noise/nz_cell**(points, p, dist = "euclidean")](https://openhome.cc/eGossip/OpenSCAD/lib3x-nz_cell.html) | an implementation of [Worley noise](https://en.wikipedia.org/wiki/Worley_noise).
|
||||
[**noise/nz_perlin1**(x, seed = undef)](https://openhome.cc/eGossip/OpenSCAD/lib3x-nz_perlin1.html) | return the 1D [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise) value at the x coordinate.
|
||||
[**noise/nz_perlin1s**(xs, seed = undef)](https://openhome.cc/eGossip/OpenSCAD/lib3x-nz_perlin1s.html) | return 1D [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise) values at x coordinates.
|
||||
[**noise/nz_perlin2**(x, y, seed = undef)](https://openhome.cc/eGossip/OpenSCAD/lib3x-nz_perlin2.html) | return the 2D [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise) value at the (x, y) coordinate.
|
||||
[**noise/nz_perlin2s**(points, seed = undef)](https://openhome.cc/eGossip/OpenSCAD/lib3x-nz_perlin2s.html) | return 2D [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise) values at (x, y) coordinates.
|
||||
[**noise/nz_perlin3**(x, y, z, seed = undef)](https://openhome.cc/eGossip/OpenSCAD/lib3x-nz_perlin3.html) | return the 3D [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise) value at the (x, y, z) coordinate.
|
||||
[**noise/nz_perlin3s**(points, seed = undef)](https://openhome.cc/eGossip/OpenSCAD/lib3x-nz_perlin3s.html) | return 3D [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise) values at (x, y, z) coordinates.
|
||||
[**noise/nz_worley2**(x, y, seed = undef, grid_w = 10, dist = "euclidean")](https://openhome.cc/eGossip/OpenSCAD/lib3x-nz_worley2.html) | return the 2D [Worley noise](https://en.wikipedia.org/wiki/Worley_noise) value at the (x, y) coordinate.
|
||||
[**noise/nz_worley2s**(points, seed = undef, grid_w = 10, dist = "euclidean")](https://openhome.cc/eGossip/OpenSCAD/lib3x-nz_worley2s.html) | return 2D [Worley noise](https://en.wikipedia.org/wiki/Worley_noise) values at (x, y) coordinates.
|
||||
[**noise/nz_worley3**(x, y, z, seed = undef, tile_w = 10, dist = "euclidean")](https://openhome.cc/eGossip/OpenSCAD/lib3x-nz_worley3.html) | return the 3D [Worley noise](https://en.wikipedia.org/wiki/Worley_noise) value at the (x, y, z) coordinate.
|
||||
[**noise/nz_worley3s**(points, seed = undef, tile_w = 10, dist = "euclidean")](https://openhome.cc/eGossip/OpenSCAD/lib3x-nz_worley3s.html) | return 3D [Worley noise](https://en.wikipedia.org/wiki/Worley_noise) values at (x, y, z) coordinates.
|
||||
[**noise/nz_cell**(points, p[, dist])](https://openhome.cc/eGossip/OpenSCAD/lib3x-nz_cell.html) | an implementation of [Worley noise](https://en.wikipedia.org/wiki/Worley_noise).
|
||||
[**noise/nz_perlin1**(x[, seed])](https://openhome.cc/eGossip/OpenSCAD/lib3x-nz_perlin1.html) | return the 1D [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise) value at the x coordinate.
|
||||
[**noise/nz_perlin1s**(xs[, seed])](https://openhome.cc/eGossip/OpenSCAD/lib3x-nz_perlin1s.html) | return 1D [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise) values at x coordinates.
|
||||
[**noise/nz_perlin2**(x, y[, seed])](https://openhome.cc/eGossip/OpenSCAD/lib3x-nz_perlin2.html) | return the 2D [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise) value at the (x, y) coordinate.
|
||||
[**noise/nz_perlin2s**(points[, seed])](https://openhome.cc/eGossip/OpenSCAD/lib3x-nz_perlin2s.html) | return 2D [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise) values at (x, y) coordinates.
|
||||
[**noise/nz_perlin3**(x, y, z[, seed])](https://openhome.cc/eGossip/OpenSCAD/lib3x-nz_perlin3.html) | return the 3D [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise) value at the (x, y, z) coordinate.
|
||||
[**noise/nz_perlin3s**(points[, seed])](https://openhome.cc/eGossip/OpenSCAD/lib3x-nz_perlin3s.html) | return 3D [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise) values at (x, y, z) coordinates.
|
||||
[**noise/nz_worley2**(x, y[, seed, grid_w, dist])](https://openhome.cc/eGossip/OpenSCAD/lib3x-nz_worley2.html) | return the 2D [Worley noise](https://en.wikipedia.org/wiki/Worley_noise) value at the (x, y) coordinate.
|
||||
[**noise/nz_worley2s**(points[, seed, grid_w, dist])](https://openhome.cc/eGossip/OpenSCAD/lib3x-nz_worley2s.html) | return 2D [Worley noise](https://en.wikipedia.org/wiki/Worley_noise) values at (x, y) coordinates.
|
||||
[**noise/nz_worley3**(x, y, z[, seed, grid_w, dist])](https://openhome.cc/eGossip/OpenSCAD/lib3x-nz_worley3.html) | return the 3D [Worley noise](https://en.wikipedia.org/wiki/Worley_noise) value at the (x, y, z) coordinate.
|
||||
[**noise/nz_worley3s**(points[, seed, grid_w, dist])](https://openhome.cc/eGossip/OpenSCAD/lib3x-nz_worley3s.html) | return 3D [Worley noise](https://en.wikipedia.org/wiki/Worley_noise) values at (x, y, z) coordinates.
|
||||
|
||||
## Voronoi
|
||||
|
||||
Signature | Description
|
||||
--|--
|
||||
[**voronoi/vrn2_cells_from**(points)](https://openhome.cc/eGossip/OpenSCAD/lib3x-vrn2_cells_from.html) | create cell shapes of [Voronoi](https://en.wikipedia.org/wiki/Voronoi_diagram) from a list of points.
|
||||
[**voronoi/vrn2_cells_space**(size, grid_w, seed = undef)](https://openhome.cc/eGossip/OpenSCAD/lib3x-vrn2_cells_space.html) | create cell shapes of [Voronoi](https://en.wikipedia.org/wiki/Voronoi_diagram) in the first quadrant.
|
||||
[**voronoi/vrn2_from**(points, spacing = 1, ...)](https://openhome.cc/eGossip/OpenSCAD/lib3x-vrn2_from.html) | create a [Voronoi](https://en.wikipedia.org/wiki/Voronoi_diagram) from a list of points.
|
||||
[**voronoi/vrn2_space**(size, grid_w, seed = undef, spacing = 1, ...)](https://openhome.cc/eGossip/OpenSCAD/lib3x-vrn2_space.html) | create a [Voronoi](https://en.wikipedia.org/wiki/Voronoi_diagram) in the first quadrant.
|
||||
[**voronoi/vrn3_from**(points, spacing = 1)](https://openhome.cc/eGossip/OpenSCAD/lib3x-vrn3_from.html) | create a 3D version of [Voronoi](https://en.wikipedia.org/wiki/Voronoi_diagram).
|
||||
[**voronoi/vrn3_space**(size, grid_w, seed = undef, spacing = 1)](https://openhome.cc/eGossip/OpenSCAD/lib3x-vrn3_space.html) | create a [Voronoi](https://en.wikipedia.org/wiki/Voronoi_diagram) in the first octant.
|
||||
[**voronoi/vrn2_cells_space**(size, grid_w[, seed])](https://openhome.cc/eGossip/OpenSCAD/lib3x-vrn2_cells_space.html) | create cell shapes of [Voronoi](https://en.wikipedia.org/wiki/Voronoi_diagram) in the first quadrant.
|
||||
[**voronoi/vrn2_from**(points[, spacing, ...])](https://openhome.cc/eGossip/OpenSCAD/lib3x-vrn2_from.html) | create a [Voronoi](https://en.wikipedia.org/wiki/Voronoi_diagram) from a list of points.
|
||||
[**voronoi/vrn2_space**(size, grid_w[, seed, spacing, ...])](https://openhome.cc/eGossip/OpenSCAD/lib3x-vrn2_space.html) | create a [Voronoi](https://en.wikipedia.org/wiki/Voronoi_diagram) in the first quadrant.
|
||||
[**voronoi/vrn3_from**(points[, spacing])](https://openhome.cc/eGossip/OpenSCAD/lib3x-vrn3_from.html) | create a 3D version of [Voronoi](https://en.wikipedia.org/wiki/Voronoi_diagram).
|
||||
[**voronoi/vrn3_space**(size, grid_w[, seed, spacing])](https://openhome.cc/eGossip/OpenSCAD/lib3x-vrn3_space.html) | create a [Voronoi](https://en.wikipedia.org/wiki/Voronoi_diagram) in the first octant.
|
||||
|
||||
## Maze
|
||||
|
||||
Signature | Description
|
||||
--|--
|
||||
[**maze/mz_square_cells**(rows, columns, start = [0, 0], ...)](https://openhome.cc/eGossip/OpenSCAD/lib3x-mz_square_cells.html) | return cell data of a square maze.
|
||||
[**maze/mz_square_cells**(rows, columns[, start, ...])](https://openhome.cc/eGossip/OpenSCAD/lib3x-mz_square_cells.html) | return cell data of a square maze.
|
||||
[**maze/mz_square_get**(cell, query)](https://openhome.cc/eGossip/OpenSCAD/lib3x-mz_square_get.html) | a helper for getting data from a square-maze cell.
|
||||
[**maze/mz_square_walls**(cells, rows, columns, cell_width, ...)](https://openhome.cc/eGossip/OpenSCAD/lib3x-mz_square_walls.html) | a helper for creating square wall data from maze cells.
|
||||
[**maze/mz_hex_walls**(cells, rows, columns, cell_radius, ...)](https://openhome.cc/eGossip/OpenSCAD/lib3x-mz_hex_walls.html) | a helper for creating hex wall data from maze cells.
|
||||
[**maze/mz_square_initialize**(rows, columns, mask)](https://openhome.cc/eGossip/OpenSCAD/lib3x-mz_square_initialize.html) | a helper for initializing cell data of a maze.
|
||||
[**maze/mz_hamiltonian**(rows, columns, start = [0, 0], seed = undef)](https://openhome.cc/eGossip/OpenSCAD/lib3x-mz_hamiltonian.html) | create a hamiltonian path from a maze.
|
||||
[**maze/mz_theta_cells**(rows, beginning_number, start = [0, 0], seed = undef)](https://openhome.cc/eGossip/OpenSCAD/lib3x-mz_theta_cells.html) | return cell data of a theta maze.
|
||||
[**maze/mz_hamiltonian**(rows, columns[, start, seed])](https://openhome.cc/eGossip/OpenSCAD/lib3x-mz_hamiltonian.html) | create a hamiltonian path from a maze.
|
||||
[**maze/mz_theta_cells**(rows, beginning_number[, start, seed])](https://openhome.cc/eGossip/OpenSCAD/lib3x-mz_theta_cells.html) | return cell data of a theta maze.
|
||||
[**maze/mz_theta_get**(cell, query)](https://openhome.cc/eGossip/OpenSCAD/lib3x-mz_theta_get.html) | a helper for getting data from a theta-maze cell.
|
||||
|
||||
## Polyhedra
|
||||
|
||||
Signature | Description
|
||||
--|--
|
||||
[**polyhedra/star**([outerRadius, innerRadius, height, n])](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedra_star.html) | create a 3D star.
|
||||
[**polyhedra/polar_zonohedra**(n[, theta])](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedra_polar_zonohedra.html) | create a [polar zonohedra](https://mathworld.wolfram.com/PolarZonohedron.html).
|
||||
[**polyhedra/tetrahedron**(radius[, detail])](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedra_tetrahedron.html) | create a tetrahedron.
|
||||
[**polyhedra/hexahedron**(radius[, detail])](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedra_hexahedron.html) | create a hexahedron.
|
||||
[**polyhedra/octahedron**(radius[, detail])](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedra_octahedron.html) | create a octahedron.
|
||||
[**polyhedra/dodecahedron**(radius[, detail])](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedra_dodecahedron.html) | create a dodecahedron.
|
||||
[**polyhedra/icosahedron**(radius[, detail])](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedra_icosahedron.html) | create a icosahedron.
|
||||
[**polyhedra/superellipsoid**(radius[, detail])](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedra_superellipsoid.html) | create a superellipsoid.
|
||||
|
||||
----
|
||||
|
||||
|
51
RELEASE.md
@@ -1,5 +1,56 @@
|
||||
> Version numbers are based on [Semantic Versioning](https://semver.org/).
|
||||
|
||||
# v3.2
|
||||
|
||||
## Deprecated:
|
||||
|
||||
Name | Description
|
||||
--|--
|
||||
**paths2sections** | use **rails2sections** instead.
|
||||
**hull_polyline2d**, **hull_polyline3d** | use **polyline_join** instead.
|
||||
**shape_starburst**, **shape_pentagram** | use **shape_star** instead.
|
||||
**starburst** | use **polyhedra/star** instead.
|
||||
|
||||
## New parameters:
|
||||
|
||||
- `angle_between` adds `ccw`.
|
||||
|
||||
## New modules/functions:
|
||||
|
||||
### Matrix
|
||||
|
||||
## 2D/3D Function
|
||||
|
||||
Signature | Description
|
||||
--|--
|
||||
[**rails2sections**(rails)](https://openhome.cc/eGossip/OpenSCAD/lib3x-rails2sections.html) | create sections along rails.
|
||||
|
||||
## Transformation
|
||||
|
||||
Signature | Description
|
||||
--|--
|
||||
[**select**(i)](https://openhome.cc/eGossip/OpenSCAD/lib3x-select.html) | select module objects.
|
||||
[**polyline_join**(points)](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyline_join.html) | place a join on each point. Hull each pair of joins and union all convex hulls.
|
||||
|
||||
## 2D Shape
|
||||
|
||||
Signature | Description
|
||||
--|--
|
||||
[**shape_star**([outer_radius, inner_radius, n])](https://openhome.cc/eGossip/OpenSCAD/lib3x-shape_star.html) | create a 2D star.
|
||||
|
||||
## Polyhedra
|
||||
|
||||
Signature | Description
|
||||
--|--
|
||||
[**polyhedra/star**([outerRadius, innerRadius, height, n])](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedra_star.html) | create a 3D star.
|
||||
[**polyhedra/polar_zonohedra**(n[, theta])](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedra_polar_zonohedra.html) | create a [polar zonohedra](https://mathworld.wolfram.com/PolarZonohedron.html).
|
||||
[**polyhedra/tetrahedron**(radius[, detail])](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedra_tetrahedron.html) | create a tetrahedron.
|
||||
[**polyhedra/hexahedron**(radius[, detail])](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedra_hexahedron.html) | create a hexahedron.
|
||||
[**polyhedra/octahedron**(radius[, detail])](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedra_octahedron.html) | create a octahedron.
|
||||
[**polyhedra/dodecahedron**(radius[, detail])](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedra_dodecahedron.html) | create a dodecahedron.
|
||||
[**polyhedra/icosahedron**(radius[, detail])](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedra_icosahedron.html) | create a icosahedron.
|
||||
[**polyhedra/superellipsoid**(radius[, detail])](https://openhome.cc/eGossip/OpenSCAD/lib3x-polyhedra_superellipsoid.html) | create a superellipsoid.
|
||||
|
||||
# v3.1
|
||||
|
||||
## Deprecated:
|
||||
|
BIN
docs/images/lib3x-polyhedra_dodecahedron-1.JPG
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
docs/images/lib3x-polyhedra_hexahedron-1.JPG
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
docs/images/lib3x-polyhedra_icosahedron-1.JPG
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
docs/images/lib3x-polyhedra_octahedron-1.JPG
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
docs/images/lib3x-polyhedra_polar_zonohedra-1.JPG
Normal file
After Width: | Height: | Size: 41 KiB |
BIN
docs/images/lib3x-polyhedra_star-1.JPG
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
docs/images/lib3x-polyhedra_superellipsoid-1.JPG
Normal file
After Width: | Height: | Size: 77 KiB |
BIN
docs/images/lib3x-polyhedra_tetrahedron-1.JPG
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
docs/images/lib3x-polyline_join-1.JPG
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
docs/images/lib3x-polyline_join-2.JPG
Normal file
After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
BIN
docs/images/lib3x-rails2sections-1.JPG
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
docs/images/lib3x-rails2sections-2.JPG
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
docs/images/lib3x-shape_star-1.JPG
Normal file
After Width: | Height: | Size: 32 KiB |
@@ -73,7 +73,8 @@ Puts children along the given path. If there's only one child, it will put the c
|
||||
scale([2, 1])
|
||||
circle(1.25, $fn = 24);
|
||||
}
|
||||
|
||||
|
||||
rotate([90, 0, 0])
|
||||
for(a = [0:30:330]) {
|
||||
rotate(a)
|
||||
translate([5, 0, 0])
|
||||
|
@@ -11,21 +11,21 @@ Creates an arc path. You can pass a 2 element vector to define the central angle
|
||||
|
||||
## Examples
|
||||
|
||||
use <arc_path.scad>;
|
||||
use <hull_polyline2d.scad>;
|
||||
|
||||
$fn = 24;
|
||||
points = arc_path(radius = 20, angle = [45, 290]);
|
||||
hull_polyline2d(points, width = 2);
|
||||
use <arc_path.scad>;
|
||||
use <polyline_join.scad>;
|
||||
|
||||
$fn = 24;
|
||||
points = arc_path(radius = 20, angle = [45, 290]);
|
||||
polyline_join(points) circle(1);
|
||||
|
||||

|
||||
|
||||
use <arc_path.scad>;
|
||||
use <hull_polyline2d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
|
||||
$fn = 24;
|
||||
points = arc_path(radius = 20, angle = 135);
|
||||
hull_polyline2d(points, width = 2);
|
||||
polyline_join(points) circle(1);
|
||||
|
||||

|
||||
|
||||
|
@@ -48,7 +48,7 @@ An `init_angle` less than 180 degrees is not recommended because the function us
|
||||
|
||||

|
||||
|
||||
include <archimedean_spiral.scad>;
|
||||
use <archimedean_spiral.scad>;
|
||||
|
||||
t = "3.141592653589793238462643383279502884197169399375105820974944592307816406286";
|
||||
|
||||
@@ -60,8 +60,8 @@ An `init_angle` less than 180 degrees is not recommended because the function us
|
||||
);
|
||||
|
||||
for(i = [0: len(points) - 1]) {
|
||||
translate(points[i][0])
|
||||
rotate(points[i][1] + 90)
|
||||
translate(points[i].x)
|
||||
rotate(points[i].y + 90)
|
||||
text(t[i], valign = "center", halign = "center");
|
||||
}
|
||||
|
||||
|
@@ -15,7 +15,7 @@ Creates visually even spacing of n points on the surface of the sphere. Successi
|
||||
## Examples
|
||||
|
||||
use <bauer_spiral.scad>;
|
||||
use <hull_polyline3d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
|
||||
n = 200;
|
||||
radius = 20;
|
||||
@@ -26,7 +26,7 @@ Creates visually even spacing of n points on the surface of the sphere. Successi
|
||||
sphere(1, $fn = 24);
|
||||
}
|
||||
|
||||
hull_polyline3d(pts, 1);
|
||||
polyline_join(pts) sphere(.5);
|
||||
|
||||

|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# bezier_curve
|
||||
|
||||
Given a set of control points, the `bezier_curve` function returns points of the Bézier path. Combined with the `polyline`, `polyline3d` or `hull_polyline3d` module defined in my library, you can create a Bézier curve.
|
||||
Given a set of control points, the `bezier_curve` function returns points of the Bézier path.
|
||||
|
||||
## Parameters
|
||||
|
||||
@@ -9,13 +9,13 @@ Given a set of control points, the `bezier_curve` function returns points of the
|
||||
|
||||
## Examples
|
||||
|
||||
If you have four control points and combine with the `hull_polyline3d` module:
|
||||
If you have four control points:
|
||||
|
||||
use <hull_polyline3d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <bezier_curve.scad>;
|
||||
|
||||
t_step = 0.05;
|
||||
width = 2;
|
||||
radius = 2;
|
||||
|
||||
p0 = [0, 0, 0];
|
||||
p1 = [40, 60, 35];
|
||||
@@ -26,6 +26,7 @@ If you have four control points and combine with the `hull_polyline3d` module:
|
||||
[p0, p1, p2, p3]
|
||||
);
|
||||
|
||||
hull_polyline3d(points, width);
|
||||
polyline_join(points)
|
||||
sphere(radius);
|
||||
|
||||

|
||||
|
@@ -12,7 +12,7 @@ Given a path, the `bezier_smooth` function uses bazier curves to smooth all corn
|
||||
|
||||
## Examples
|
||||
|
||||
use <hull_polyline3d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <bezier_smooth.scad>;
|
||||
|
||||
width = 2;
|
||||
@@ -25,15 +25,15 @@ Given a path, the `bezier_smooth` function uses bazier curves to smooth all corn
|
||||
[-10, -10, 50]
|
||||
];
|
||||
|
||||
hull_polyline3d(
|
||||
path_pts, width
|
||||
);
|
||||
polyline_join(path_pts)
|
||||
sphere(width / 2);
|
||||
|
||||
smoothed_path_pts = bezier_smooth(path_pts, round_d);
|
||||
|
||||
color("red") translate([30, 0, 0]) hull_polyline3d(
|
||||
smoothed_path_pts, width
|
||||
);
|
||||
color("red")
|
||||
translate([30, 0, 0])
|
||||
polyline_join(smoothed_path_pts)
|
||||
sphere(width / 2);
|
||||
|
||||

|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# 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.
|
||||
[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.
|
||||
|
||||
**Since:** 2.1
|
||||
|
||||
|
@@ -11,7 +11,7 @@ Computes contour polygons by applying [marching squares](https://en.wikipedia.or
|
||||
|
||||
## Examples
|
||||
|
||||
use <hull_polyline2d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <surface/sf_thicken.scad>;
|
||||
use <contours.scad>;
|
||||
|
||||
@@ -36,7 +36,8 @@ Computes contour polygons by applying [marching squares](https://en.wikipedia.or
|
||||
translate([0, 0, z])
|
||||
linear_extrude(1)
|
||||
for(isoline = contours(points, z)) {
|
||||
hull_polyline2d(isoline, width = 1);
|
||||
polyline_join(isoline)
|
||||
circle(.5);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -17,7 +17,7 @@ Draws a curved line from control points. The curve is drawn only from the 2nd co
|
||||
## Examples
|
||||
|
||||
use <curve.scad>;
|
||||
use <hull_polyline3d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
|
||||
pts = [
|
||||
[28, 2, 1],
|
||||
@@ -32,12 +32,14 @@ Draws a curved line from control points. The curve is drawn only from the 2nd co
|
||||
tightness = 0;
|
||||
points = curve(t_step, pts, tightness);
|
||||
|
||||
hull_polyline3d(points, 1);
|
||||
polyline_join(points)
|
||||
sphere(.5);
|
||||
|
||||
#for(pt = pts) {
|
||||
translate(pt)
|
||||
sphere(1);
|
||||
}
|
||||
#hull_polyline3d(pts, .1);
|
||||
#polyline_join(pts)
|
||||
sphere(.05);
|
||||
|
||||

|
@@ -31,7 +31,7 @@ Creates visually even spacing of n points on the surface of the sphere. Nearest-
|
||||

|
||||
|
||||
use <fibonacci_lattice.scad>;
|
||||
use <hull_polyline3d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
|
||||
n = 200;
|
||||
radius = 20;
|
||||
@@ -49,7 +49,8 @@ Creates visually even spacing of n points on the surface of the sphere. Nearest-
|
||||
];
|
||||
|
||||
for(spiral = spirals) {
|
||||
hull_polyline3d(spiral, 1);
|
||||
polyline_join(spiral)
|
||||
sphere(.5);
|
||||
}
|
||||
|
||||

|
@@ -11,7 +11,7 @@ Drive a turtle with `["forward", length]` or `["turn", angle]`. This function is
|
||||
|
||||
## Examples
|
||||
|
||||
use <polyline2d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <turtle/footprints2.scad>;
|
||||
|
||||
function arc_cmds(radius, angle, steps) =
|
||||
@@ -48,7 +48,8 @@ Drive a turtle with `["forward", length]` or `["turn", angle]`. This function is
|
||||
)
|
||||
);
|
||||
|
||||
polyline2d(poly, width = 1);
|
||||
polyline_join(poly)
|
||||
circle(.5);
|
||||
|
||||

|
||||
|
||||
|
@@ -11,7 +11,7 @@ A 3D verion of [footprint2](https://openhome.cc/eGossip/OpenSCAD/lib3x-footprint
|
||||
|
||||
## Examples
|
||||
|
||||
use <hull_polyline3d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <turtle/footprints3.scad>;
|
||||
|
||||
function xy_arc_cmds(radius, angle, steps) =
|
||||
@@ -49,7 +49,8 @@ A 3D verion of [footprint2](https://openhome.cc/eGossip/OpenSCAD/lib3x-footprint
|
||||
)
|
||||
);
|
||||
|
||||
hull_polyline3d(poly, thickness = 1);
|
||||
polyline_join(poly)
|
||||
sphere(.5);
|
||||
|
||||

|
||||
|
||||
|
@@ -7,7 +7,7 @@ This function deletes the mapping for the specified key from a [util/map/hashmap
|
||||
## Parameters
|
||||
|
||||
- `map` : The original map.
|
||||
- `key` : Adds the specified element to the specified set
|
||||
- `key` : The specified key.
|
||||
- `eq` : A equality function. If it's ignored, use `==` to compare elements.
|
||||
- `hash` : A hash function. If it's ignored, convert each element to a string and hash it.
|
||||
|
||||
|
@@ -7,7 +7,7 @@ This function gets the value of the specified key from a [util/map/hashmap](http
|
||||
## Parameters
|
||||
|
||||
- `map` : The original map.
|
||||
- `key` : Adds the specified element to the specified set
|
||||
- `key` : The specified key.
|
||||
- `eq` : A equality function. If it's ignored, use `==` to compare elements.
|
||||
- `hash` : A hash function. If it's ignored, convert each element to a string and hash it.
|
||||
|
||||
|
@@ -7,6 +7,10 @@ Puts a key/value pair to a [util/map/hashmap](https://openhome.cc/eGossip/OpenSC
|
||||
## Parameters
|
||||
|
||||
- `map` : The original map.
|
||||
- `key` : The specified key.
|
||||
- `value` : The specified value.
|
||||
- `eq` : A equality function. If it's ignored, use `==` to compare elements.
|
||||
- `hash` : A hash function. If it's ignored, convert each element to a string and hash it.
|
||||
|
||||
## Examples
|
||||
|
||||
|
@@ -14,7 +14,7 @@ Gets all points on the path of a spiral around a cylinder. Its `$fa`, `$fs` and
|
||||
## Examples
|
||||
|
||||
use <helix.scad>;
|
||||
use <hull_polyline3d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
|
||||
$fn = 12;
|
||||
|
||||
@@ -30,12 +30,13 @@ Gets all points on the path of a spiral around a cylinder. Its `$fa`, `$fs` and
|
||||
translate(p) sphere(5);
|
||||
}
|
||||
|
||||
hull_polyline3d(points, 2);
|
||||
polyline_join(points)
|
||||
sphere(1);
|
||||
|
||||

|
||||
|
||||
use <helix.scad>;
|
||||
use <hull_polyline3d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
|
||||
$fn = 12;
|
||||
|
||||
@@ -47,7 +48,8 @@ Gets all points on the path of a spiral around a cylinder. Its `$fa`, `$fs` and
|
||||
rt_dir = "CLK"
|
||||
);
|
||||
|
||||
hull_polyline3d(points, 2);
|
||||
polyline_join(points)
|
||||
sphere(1);
|
||||
|
||||
%cylinder(h = 100, r1 = 40, r2 = 20);
|
||||
|
||||
|
@@ -1,22 +0,0 @@
|
||||
# hull_polyline2d
|
||||
|
||||
Creates a 2D polyline from a list of `[x, y]` coordinates. As the name says, it uses the built-in hull operation for each pair of points (created by the `circle` module). It's slow. However, it can be used to create metallic effects for a small `$fn`, large `$fa` or `$fs`.
|
||||
|
||||
## Parameters
|
||||
|
||||
- `points` : The list of `[x, y]` points of the polyline. The points are indexed from 0 to n-1.
|
||||
- `width` : The line width. Default to 1.
|
||||
- `$fa`, `$fs`, `$fn` : Check [the circle module](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_the_2D_Subsystem#circle) for more details.
|
||||
|
||||
## Examples
|
||||
|
||||
use <hull_polyline2d.scad>;
|
||||
|
||||
$fn = 4;
|
||||
|
||||
hull_polyline2d(
|
||||
points = [[1, 2], [-5, -4], [-5, 3], [5, 5]],
|
||||
width = 1
|
||||
);
|
||||
|
||||

|
@@ -1,45 +0,0 @@
|
||||
# hull_polyline3d
|
||||
|
||||
Creates a 3D polyline from a list of `[x, y, z]` coordinates. As the name says, it uses the built-in hull operation for each pair of points (created by the `sphere` module). It's slow. However, it can be used to create metallic effects for a small `$fn`, large `$fa` or `$fs`.
|
||||
|
||||
## Parameters
|
||||
|
||||
- `points` : The list of `[x, y, z]` points of the polyline. The points are indexed from 0 to n-1.
|
||||
- `diameter` : The line diameter. Default to 1.
|
||||
- `$fa`, `$fs`, `$fn` : Check [the sphere module](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#sphere) for more details.
|
||||
|
||||
## Examples
|
||||
|
||||
use <hull_polyline3d.scad>;
|
||||
|
||||
hull_polyline3d(
|
||||
points = [
|
||||
[1, 2, 3],
|
||||
[4, -5, -6],
|
||||
[-1, -3, -5],
|
||||
[0, 0, 0]
|
||||
],
|
||||
diameter = 1,
|
||||
$fn = 3
|
||||
);
|
||||
|
||||

|
||||
|
||||
use <hull_polyline3d.scad>;
|
||||
|
||||
r = 50;
|
||||
points = [
|
||||
for(a = [0:180])
|
||||
[
|
||||
r * cos(-90 + a) * cos(a),
|
||||
r * cos(-90 + a) * sin(a),
|
||||
r * sin(-90 + a)
|
||||
]
|
||||
];
|
||||
|
||||
for(i = [0:7]) {
|
||||
rotate(45 * i)
|
||||
hull_polyline3d(points, 2, $fn = 3);
|
||||
}
|
||||
|
||||

|
@@ -11,7 +11,7 @@ When having uniform cross sections, you can use [sweep](https://openhome.cc/eGos
|
||||
|
||||
## Examples
|
||||
|
||||
use <shape_starburst.scad>;
|
||||
use <shape_star.scad>;
|
||||
use <shape_circle.scad>;
|
||||
use <ptf/ptf_rotate.scad>;
|
||||
use <loft.scad>;
|
||||
@@ -19,7 +19,7 @@ When having uniform cross sections, you can use [sweep](https://openhome.cc/eGos
|
||||
sects = [
|
||||
for(i = 10; i >= 4; i = i - 1)
|
||||
[
|
||||
for(p = shape_starburst(15, 12, i % 2 == 1 ? i : i - 1)) ptf_rotate([p[0], p[1], 5 * (i - 4)], i * 10)
|
||||
for(p = shape_star(15, 12, i % 2 == 1 ? i : i - 1)) ptf_rotate([p.x, p.y, 5 * (i - 4)], i * 10)
|
||||
]
|
||||
];
|
||||
loft(sects, slices = 3);
|
||||
@@ -28,16 +28,16 @@ When having uniform cross sections, you can use [sweep](https://openhome.cc/eGos
|
||||
difference() {
|
||||
loft(
|
||||
[
|
||||
[for(p = shape_circle(10, $fn = 3)) [p[0], p[1], 15]],
|
||||
[for(p = shape_circle(15, $fn = 24)) [p[0], p[1], 0]]
|
||||
[for(p = shape_circle(10, $fn = 3)) [p.x, p.y, 15]],
|
||||
[for(p = shape_circle(15, $fn = 24)) [p.x, p.y, 0]]
|
||||
],
|
||||
slices = 4
|
||||
);
|
||||
|
||||
loft(
|
||||
[
|
||||
[for(p = shape_circle(8, $fn = 3)) [p[0], p[1], 15.1]],
|
||||
[for(p = shape_circle(13, $fn = 24)) [p[0], p[1], -0.1]]
|
||||
[for(p = shape_circle(8, $fn = 3)) [p.x, p.y, 15.1]],
|
||||
[for(p = shape_circle(13, $fn = 24)) [p.x, p.y, -0.1]]
|
||||
],
|
||||
slices = 4
|
||||
);
|
||||
|
@@ -33,14 +33,11 @@
|
||||
[lsystem3-collections.scad](https://github.com/JustinSDK/dotSCAD/blob/master/examples/turtle/lsystem3_collection.scad) collects several L-system grammars. Here's one of them.
|
||||
|
||||
use <turtle/lsystem3.scad>;
|
||||
use <hull_polyline3d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
|
||||
for(line = hilbert_curve()) {
|
||||
hull_polyline3d(
|
||||
[line[0], line[1]],
|
||||
thickness = 0.5,
|
||||
$fn = 4
|
||||
);
|
||||
polyline_join([line[0], line[1]])
|
||||
sphere(.25, $fn = 4);
|
||||
}
|
||||
|
||||
function hilbert_curve(n = 3, angle = 90, leng = 1, heading = 0, start = [0, 0, 0]) =
|
||||
@@ -60,14 +57,11 @@
|
||||
// a stochastic L-system
|
||||
|
||||
use <turtle/lsystem3.scad>;
|
||||
use <hull_polyline3d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
|
||||
for(line = vine()) {
|
||||
hull_polyline3d(
|
||||
[line[0], line[1]],
|
||||
thickness = 0.5,
|
||||
$fn = 4
|
||||
);
|
||||
polyline_join([line[0], line[1]])
|
||||
sphere(.25, $fn = 4);
|
||||
}
|
||||
|
||||
function vine(n = 3, angle = 18, leng = 1, heading = 0, start = [0, 0, 0]) =
|
||||
|
@@ -12,14 +12,14 @@ Given a 2D path, this function constructs a mid-point smoothed version by joinin
|
||||
|
||||
## Examples
|
||||
|
||||
use <hull_polyline2d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <shape_taiwan.scad>;
|
||||
use <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);
|
||||
translate([0, 0, 0]) polyline_join(taiwan) circle(.125);
|
||||
#translate([10, 0, 0]) polyline_join(smoothed) circle(.125);
|
||||
|
||||

|
@@ -14,13 +14,14 @@ Creates a hamiltonian path from a maze. The path is the result of maze traversal
|
||||
## Examples
|
||||
|
||||
use <maze/mz_hamiltonian.scad>;
|
||||
use <hull_polyline2d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
|
||||
rows = 5;
|
||||
columns = 10;
|
||||
|
||||
path = mz_hamiltonian(rows, columns, [0, 0]);
|
||||
hull_polyline2d(path, .5);
|
||||
polyline_join(path)
|
||||
circle(.25);
|
||||
|
||||

|
||||
|
||||
|
@@ -17,7 +17,7 @@ It's a helper for creating wall data from maze cells. You can transform wall poi
|
||||
|
||||
use <maze/mz_square_cells.scad>;
|
||||
use <maze/mz_hex_walls.scad>;
|
||||
use <hull_polyline2d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
|
||||
rows = 10;
|
||||
columns = 12;
|
||||
@@ -28,7 +28,8 @@ It's a helper for creating wall data from maze cells. You can transform wall poi
|
||||
walls = mz_hex_walls(cells, rows, columns, cell_width);
|
||||
|
||||
for(wall = walls) {
|
||||
hull_polyline2d(wall, wall_thickness, $fn = 24);
|
||||
polyline_join(wall)
|
||||
circle(wall_thickness, $fn = 24);
|
||||
}
|
||||
|
||||

|
@@ -25,7 +25,7 @@ The value of `type` is the wall type of the cell. It can be `0`, `1`, `2` or `3`
|
||||
## Examples
|
||||
|
||||
use <maze/mz_theta_cells.scad>;
|
||||
use <hull_polyline2d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
|
||||
rows = 8;
|
||||
beginning_number = 8;
|
||||
@@ -58,11 +58,13 @@ The value of `type` is the wall type of the cell. It can be `0`, `1`, `2` or `3`
|
||||
outerVt2 = vt_from_angle(theta2, outerR);
|
||||
|
||||
if(type == INWARD_WALL || type == INWARD_CCW_WALL) {
|
||||
hull_polyline2d([innerVt1, innerVt2], width = wall_thickness);
|
||||
polyline_join([innerVt1, innerVt2])
|
||||
circle(wall_thickness / 2);
|
||||
}
|
||||
|
||||
if(type == CCW_WALL || type == INWARD_CCW_WALL) {
|
||||
hull_polyline2d([innerVt2, outerVt2], width = wall_thickness);
|
||||
polyline_join([innerVt1, innerVt2])
|
||||
circle(wall_thickness / 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -73,7 +75,8 @@ The value of `type` is the wall type of the cell. It can be `0`, `1`, `2` or `3`
|
||||
for(theta = [0:thetaStep:360 - thetaStep]) {
|
||||
vt1 = vt_from_angle(theta, r);
|
||||
vt2 = vt_from_angle(theta + thetaStep, r);
|
||||
hull_polyline2d([vt1, vt2], width = wall_thickness);
|
||||
polyline_join([vt1, vt2])
|
||||
circle(wall_thickness / 2);
|
||||
}
|
||||
|
||||

|
@@ -13,7 +13,7 @@ It's a helper for getting data from a theta-maze cell.
|
||||
|
||||
use <maze/mz_theta_cells.scad>;
|
||||
use <maze/mz_theta_get.scad>;
|
||||
use <hull_polyline2d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
|
||||
rows = 8;
|
||||
beginning_number = 8;
|
||||
@@ -39,11 +39,13 @@ It's a helper for getting data from a theta-maze cell.
|
||||
outerVt2 = vt_from_angle(theta2, outerR);
|
||||
|
||||
if(type == "INWARD_WALL" || type == "INWARD_CCW_WALL") {
|
||||
hull_polyline2d([innerVt1, innerVt2], width = wall_thickness);
|
||||
polyline_join([innerVt1, innerVt2])
|
||||
circle(wall_thickness / 2);
|
||||
}
|
||||
|
||||
if(type == "CCW_WALL" || type == "INWARD_CCW_WALL") {
|
||||
hull_polyline2d([innerVt2, outerVt2], width = wall_thickness);
|
||||
polyline_join([innerVt1, innerVt2])
|
||||
circle(wall_thickness / 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -53,7 +55,8 @@ It's a helper for getting data from a theta-maze cell.
|
||||
for(theta = [0:thetaStep:360 - thetaStep]) {
|
||||
vt1 = vt_from_angle(theta, r);
|
||||
vt2 = vt_from_angle(theta + thetaStep, r);
|
||||
hull_polyline2d([vt1, vt2], width = wall_thickness);
|
||||
polyline_join([vt1, vt2])
|
||||
circle(wall_thickness / 2);
|
||||
}
|
||||
|
||||

|
@@ -26,8 +26,8 @@ It's an implementation of [Worley noise](https://en.wikipedia.org/wiki/Worley_no
|
||||
|
||||
feature_points = [for(pt_angle = pts_angles) pt_angle[0] + half_size];
|
||||
noised = [
|
||||
for(y = [0:size[1] - 1])
|
||||
for(x = [0:size[0] - 1])
|
||||
for(y = [0:size.y - 1])
|
||||
for(x = [0:size.x - 1])
|
||||
[x, y, nz_cell(feature_points, [x, y])]
|
||||
];
|
||||
|
||||
|
@@ -11,13 +11,12 @@ Returns the 1D [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise) value
|
||||
|
||||
## Examples
|
||||
|
||||
use <hull_polyline2d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <util/rand.scad>;
|
||||
use <noise/nz_perlin1.scad>;
|
||||
|
||||
seed = rand();
|
||||
hull_polyline2d(
|
||||
[for(x = [0:.1:10]) [x, nz_perlin1(x, seed)]], width = .1
|
||||
);
|
||||
polyline_join([for(x = [0:.1:10]) [x, nz_perlin1(x, seed)]])
|
||||
circle(.05);
|
||||
|
||||

|
@@ -11,13 +11,14 @@ Returns 1D [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise) values at
|
||||
|
||||
## Examples
|
||||
|
||||
use <hull_polyline2d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <noise/nz_perlin1s.scad>;
|
||||
|
||||
xs = [for(x = [0:.1:10]) x];
|
||||
ys = nz_perlin1s(xs);
|
||||
points = [for(i = [0:len(xs) - 1]) [xs[i], ys[i]]];
|
||||
|
||||
hull_polyline2d(points, width = .1);
|
||||
polyline_join(points)
|
||||
circle(.05);
|
||||
|
||||

|
@@ -13,7 +13,7 @@ Returns the 2D [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise) value
|
||||
## Examples
|
||||
|
||||
use <util/rand.scad>;
|
||||
use <hull_polyline2d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <surface/sf_thicken.scad>;
|
||||
use <noise/nz_perlin2.scad>;
|
||||
use <contours.scad>;
|
||||
@@ -31,7 +31,8 @@ Returns the 2D [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise) value
|
||||
|
||||
translate([11, 0])
|
||||
for(isoline = contours(points, 0)) {
|
||||
hull_polyline2d(isoline, width = .1);
|
||||
polyline_join(isoline)
|
||||
circle(.05);
|
||||
}
|
||||
|
||||

|
@@ -27,12 +27,12 @@ It divides the space into grids. The nucleus of each cell is randomly placed in
|
||||
seed = 51;
|
||||
|
||||
points = [
|
||||
for(y = [0:size[1] - 1])
|
||||
for(x = [0:size[0] - 1])
|
||||
for(y = [0:size.y - 1])
|
||||
for(x = [0:size.x - 1])
|
||||
[x, y]
|
||||
];
|
||||
|
||||
cells = [for(p = points) nz_worley2(p[0], p[1], seed, grid_w, dist)];
|
||||
cells = [for(p = points) nz_worley2(p.x, p.y, seed, grid_w, dist)];
|
||||
|
||||
max_dist = max([for(c = cells) c[2]]);
|
||||
for(i = [0:len(cells) - 1]) {
|
||||
|
@@ -25,8 +25,8 @@ It divides the space into grids. The nucleus of each cell is randomly placed in
|
||||
seed = 51;
|
||||
|
||||
points = [
|
||||
for(y = [0:size[1] - 1])
|
||||
for(x = [0:size[0] - 1])
|
||||
for(y = [0:size.y - 1])
|
||||
for(x = [0:size.x - 1])
|
||||
[x, y]
|
||||
];
|
||||
|
||||
|
@@ -26,7 +26,7 @@ It divides the space into grids. The nucleus of each cell is randomly placed in
|
||||
|
||||
points = vx_sphere(20);
|
||||
|
||||
cells = [for(p = points) nz_worley3(p[0], p[1], p[2], seed, grid_w, dist)];
|
||||
cells = [for(p = points) nz_worley3(p.x, p.y, p.z, seed, grid_w, dist)];
|
||||
|
||||
max_dist = max([for(c = cells) c[3]]);
|
||||
for(i = [0:len(cells) - 1]) {
|
||||
|
@@ -18,12 +18,12 @@ It divides the space into grids. The nucleus of each cell is randomly placed in
|
||||
use <voxel/vx_sphere.scad>;
|
||||
use <noise/nz_worley3s.scad>;
|
||||
|
||||
tile_w = 10;
|
||||
grid_w = 10;
|
||||
dist = "euclidean"; // [euclidean, manhattan, chebyshev, border]
|
||||
seed = 51;
|
||||
|
||||
points = vx_sphere(20);
|
||||
cells = nz_worley3s(points, seed, tile_w, dist);
|
||||
cells = nz_worley3s(points, seed, grid_w, dist);
|
||||
|
||||
for(i = [0:len(cells) - 1]) {
|
||||
c = (norm([cells[i][0], cells[i][1], cells[i][2]]) % 20) / 20;
|
||||
|
@@ -15,7 +15,7 @@ You can use any point as the first point of the edge path. Just remember that yo
|
||||
|
||||
## Examples
|
||||
|
||||
use <hull_polyline3d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <shape_taiwan.scad>;
|
||||
use <path_scaling_sections.scad>;
|
||||
use <sweep.scad>;
|
||||
@@ -33,12 +33,13 @@ You can use any point as the first point of the edge path. Just remember that yo
|
||||
fst_pt + [0, 0, 60]
|
||||
];
|
||||
|
||||
#hull_polyline3d(edge_path);
|
||||
#polyline_join(edge_path)
|
||||
sphere(.5);
|
||||
sweep(path_scaling_sections(taiwan, edge_path));
|
||||
|
||||

|
||||
|
||||
use <hull_polyline3d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <shape_taiwan.scad>;
|
||||
use <path_scaling_sections.scad>;
|
||||
use <sweep.scad>;
|
||||
@@ -58,7 +59,8 @@ You can use any point as the first point of the edge path. Just remember that yo
|
||||
fst_pt + [0, 0, 60]
|
||||
]);
|
||||
|
||||
#hull_polyline3d(edge_path);
|
||||
#polyline_join(edge_path)
|
||||
sphere(.5);
|
||||
sweep(path_scaling_sections(taiwan, edge_path));
|
||||
|
||||

|
||||
@@ -67,7 +69,7 @@ You can use any point as the first point of the edge path. Just remember that yo
|
||||
use <path_scaling_sections.scad>;
|
||||
use <sweep.scad>;
|
||||
use <bezier_curve.scad>;
|
||||
use <rotate_p.scad>;
|
||||
use <ptf/ptf_rotate.scad>;
|
||||
|
||||
taiwan = shape_taiwan(100);
|
||||
fst_pt = [13, 0, 0];
|
||||
@@ -91,7 +93,7 @@ You can use any point as the first point of the edge path. Just remember that yo
|
||||
for(i = [0:leng - 1])
|
||||
[
|
||||
for(p = sections[i])
|
||||
rotate_p(p, twist_step * i)
|
||||
ptf_rotate(p, twist_step * i)
|
||||
]
|
||||
];
|
||||
|
||||
@@ -99,11 +101,11 @@ You can use any point as the first point of the edge path. Just remember that yo
|
||||
|
||||

|
||||
|
||||
use <hull_polyline3d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <shape_taiwan.scad>;
|
||||
use <path_scaling_sections.scad>;
|
||||
use <sweep.scad>;
|
||||
use <rotate_p.scad>;
|
||||
use <ptf/ptf_rotate.scad>;
|
||||
|
||||
taiwan = shape_taiwan(100);
|
||||
|
||||
@@ -115,15 +117,16 @@ You can use any point as the first point of the edge path. Just remember that yo
|
||||
a = atan2(fst_pt[1], fst_pt[0]);
|
||||
edge_path = [
|
||||
fst_pt,
|
||||
fst_pt + rotate_p([0, 0, 10], a),
|
||||
fst_pt + rotate_p([10, 0, 20], a),
|
||||
fst_pt + rotate_p([8, 0, 30], a),
|
||||
fst_pt + rotate_p([10, 0, 40], a),
|
||||
fst_pt + rotate_p([0, 0, 50], a),
|
||||
fst_pt + rotate_p([0, 0, 60], a)
|
||||
fst_pt + ptf_rotate([0, 0, 10], a),
|
||||
fst_pt + ptf_rotate([10, 0, 20], a),
|
||||
fst_pt + ptf_rotate([8, 0, 30], a),
|
||||
fst_pt + ptf_rotate([10, 0, 40], a),
|
||||
fst_pt + ptf_rotate([0, 0, 50], a),
|
||||
fst_pt + ptf_rotate([0, 0, 60], a)
|
||||
];
|
||||
|
||||
#hull_polyline3d(edge_path);
|
||||
#polyline_join(edge_path)
|
||||
sphere(.5);
|
||||
sweep(path_scaling_sections(taiwan, edge_path));
|
||||
|
||||

|
@@ -11,7 +11,7 @@ You paths should be indexed count-clockwisely.
|
||||
## Examples
|
||||
|
||||
use <paths2sections.scad>;
|
||||
use <hull_polyline3d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <sweep.scad>;
|
||||
|
||||
paths = [
|
||||
@@ -26,14 +26,15 @@ You paths should be indexed count-clockwisely.
|
||||
sweep(sections);
|
||||
|
||||
#for(path = paths) {
|
||||
hull_polyline3d(path, 0.5);
|
||||
polyline_join(path)
|
||||
sphere(.25);
|
||||
}
|
||||
|
||||

|
||||
|
||||
use <bezier_curve.scad>;
|
||||
use <paths2sections.scad>;
|
||||
use <hull_polyline3d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <sweep.scad>;
|
||||
|
||||
t_step = 0.05;
|
||||
@@ -59,7 +60,8 @@ You paths should be indexed count-clockwisely.
|
||||
sweep(sections);
|
||||
|
||||
#for(path = paths) {
|
||||
hull_polyline3d(path, 0.5);
|
||||
polyline_join(path)
|
||||
sphere(.25);
|
||||
}
|
||||
|
||||

|
||||
|
22
docs/lib3x-polyhedra_dodecahedron.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# dodecahedron
|
||||
|
||||
Creates a dodecahedron.
|
||||
|
||||
**Since:** 3.2
|
||||
|
||||
## Parameters
|
||||
|
||||
- `radius` : Radius of the dodecahedron.
|
||||
- `detail` : Default to 0. Setting this to a value greater than 0 adds vertices making it no longer a dodecahedron.
|
||||
|
||||
## Examples
|
||||
|
||||
use <polyhedra/dodecahedron.scad>;
|
||||
|
||||
for(i = [0:5]) {
|
||||
translate([i * 2, 0])
|
||||
dodecahedron(radius = 1, detail = i);
|
||||
}
|
||||
|
||||

|
||||
|
22
docs/lib3x-polyhedra_hexahedron.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# hexahedron
|
||||
|
||||
Creates a hexahedron.
|
||||
|
||||
**Since:** 3.2
|
||||
|
||||
## Parameters
|
||||
|
||||
- `radius` : Radius of the hexahedron.
|
||||
- `detail` : Default to 0. Setting this to a value greater than 0 adds vertices making it no longer a hexahedron.
|
||||
|
||||
## Examples
|
||||
|
||||
use <polyhedra/hexahedron.scad>;
|
||||
|
||||
for(i = [0:5]) {
|
||||
translate([i * 2, 0])
|
||||
hexahedron(radius = 1, detail = i);
|
||||
}
|
||||
|
||||

|
||||
|
22
docs/lib3x-polyhedra_icosahedron.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# icosahedron
|
||||
|
||||
Creates a icosahedron.
|
||||
|
||||
**Since:** 3.2
|
||||
|
||||
## Parameters
|
||||
|
||||
- `radius` : Radius of the icosahedron.
|
||||
- `detail` : Default to 0. Setting this to a value greater than 0 adds vertices making it no longer a icosahedron.
|
||||
|
||||
## Examples
|
||||
|
||||
use <polyhedra/icosahedron.scad>;
|
||||
|
||||
for(i = [0:5]) {
|
||||
translate([i * 2, 0])
|
||||
icosahedron(radius = 1, detail = i);
|
||||
}
|
||||
|
||||

|
||||
|
22
docs/lib3x-polyhedra_octahedron.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# octahedron
|
||||
|
||||
Creates a octahedron.
|
||||
|
||||
**Since:** 3.2
|
||||
|
||||
## Parameters
|
||||
|
||||
- `radius` : Radius of the octahedron.
|
||||
- `detail` : Default to 0. Setting this to a value greater than 0 adds vertices making it no longer a octahedron.
|
||||
|
||||
## Examples
|
||||
|
||||
use <polyhedra/octahedron.scad>;
|
||||
|
||||
for(i = [0:5]) {
|
||||
translate([i * 2, 0])
|
||||
octahedron(radius = 1, detail = i);
|
||||
}
|
||||
|
||||

|
||||
|
22
docs/lib3x-polyhedra_polar_zonohedra.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# polar_zonohedra
|
||||
|
||||
Creates a [polar zonohedra](https://mathworld.wolfram.com/PolarZonohedron.html).
|
||||
|
||||
**Since:** 3.2
|
||||
|
||||
## Parameters
|
||||
|
||||
- `n` : n equal rhombs surrounding one vertex. (rotational symmetry)
|
||||
- `theta` : the pitch angle of the edges. Default to 35.5.
|
||||
|
||||
## Examples
|
||||
|
||||
use <polyhedra/polar_zonohedra.scad>;
|
||||
|
||||
for(n = [3:8]) {
|
||||
translate([0.5 * n * (n - 3), 0, 0])
|
||||
polar_zonohedra(n);
|
||||
}
|
||||
|
||||

|
||||
|
24
docs/lib3x-polyhedra_star.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# star
|
||||
|
||||
Create a star. Default to a pentagram.
|
||||
|
||||
**Since:** 3.2
|
||||
|
||||
## Parameters
|
||||
|
||||
- `outer_radius`: The outer radius of the star. Default to 1.
|
||||
- `inner_radius`: The inner radius of the star. Default to 0.381966.
|
||||
- `height`: The star height. Default to 0.5.
|
||||
- `n`: The burst number. Default to 5.
|
||||
|
||||
## Examples
|
||||
|
||||
use <polyhedra/star.scad>;
|
||||
|
||||
for(i = [3:6]) {
|
||||
translate([(i - 3) * 2, 0])
|
||||
star(n = i);
|
||||
}
|
||||
|
||||

|
||||
|
27
docs/lib3x-polyhedra_superellipsoid.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# superellipsoid
|
||||
|
||||
Creates a [superellipsoid](https://en.wikipedia.org/wiki/Superellipsoid).
|
||||
|
||||
**Since:** 3.2
|
||||
|
||||
## Parameters
|
||||
|
||||
- `e` : The east-west parameter.
|
||||
- `n` : The north-south parameter.
|
||||
|
||||
## Examples
|
||||
|
||||
use <polyhedra/superellipsoid.scad>;
|
||||
|
||||
$fn = 24;
|
||||
|
||||
step = 0.5;
|
||||
|
||||
for(e = [0:step:4]) {
|
||||
for(n = [0:step:4])
|
||||
translate([e / step, n / step] * 3)
|
||||
superellipsoid(e, n);
|
||||
}
|
||||
|
||||

|
||||
|
22
docs/lib3x-polyhedra_tetrahedron.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# tetrahedron
|
||||
|
||||
Creates a tetrahedron.
|
||||
|
||||
**Since:** 3.2
|
||||
|
||||
## Parameters
|
||||
|
||||
- `radius` : Radius of the tetrahedron.
|
||||
- `detail` : Default to 0. Setting this to a value greater than 0 adds vertices making it no longer a tetrahedron.
|
||||
|
||||
## Examples
|
||||
|
||||
use <polyhedra/tetrahedron.scad>;
|
||||
|
||||
for(i = [0:5]) {
|
||||
translate([i * 2, 0])
|
||||
tetrahedron(radius = 1, detail = i);
|
||||
}
|
||||
|
||||

|
||||
|
42
docs/lib3x-polyline_join.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# polyline_join
|
||||
|
||||
Place a join on each point. Hull each pair of joins and union all convex hulls.
|
||||
|
||||
**Since:** 3.2
|
||||
|
||||
## Parameters
|
||||
|
||||
- `points` : a list of points.
|
||||
|
||||
## Examples
|
||||
|
||||
use <polyline_join.scad>;
|
||||
|
||||
polyline_join([[0, 0], [10, 0], [10, 10], [0, 10]])
|
||||
square(1);
|
||||
|
||||
polyline_join([[15, 0], [25, 0], [25, 10], [15, 10]]) {
|
||||
square(1);
|
||||
circle(1);
|
||||
square(1);
|
||||
circle(2);
|
||||
}
|
||||
|
||||

|
||||
|
||||
use <polyline_join.scad>;
|
||||
|
||||
polyline_join([[0, 0, 0], [10, 0, 0], [10, 0, 10], [10, 10, 10]])
|
||||
cube(1);
|
||||
|
||||
polyline_join([[15, 0, 0], [25, 0, 0], [25, 0, 10], [25, 10, 10]]) {
|
||||
cube(1);
|
||||
sphere(1);
|
||||
cube(1);
|
||||
sphere(2);
|
||||
}
|
||||
|
||||

|
||||
|
||||
|
||||
|
@@ -1,141 +0,0 @@
|
||||
# polysections
|
||||
|
||||
Crosscutting a tube-like shape at different points gets several cross-sections. This module can operate reversely. It uses cross-sections to construct a tube-like shape. For example, imagine that you have the following cross-sections:
|
||||
|
||||

|
||||
|
||||
This module can use them to construct the following model:
|
||||
|
||||

|
||||
|
||||
Looks like extruding along the path? Yes, it can perform the task; however, it's more flexible.
|
||||
|
||||
You can also view it as a better polyline3d module if you want. If you have only the points of a path, using `polyline3d` or `hull_polyline3d` is a simple solution. If you know the cross sections along a path, you can use `polysections` to do more.
|
||||
|
||||
When using this module, you should use points to represent each cross section. The points of your cross section should have count-clockwise indexes. For example:
|
||||
|
||||

|
||||
|
||||
If your cross section is hollow, set the `triangles` parameter to `"HOLLOW"` and index the points as the following:
|
||||
|
||||

|
||||
|
||||
You can cut triangles by yourself. For example, the above shape can be cut into triangles such as:
|
||||
|
||||

|
||||
|
||||
The indexes of the above triangles is:
|
||||
|
||||
[
|
||||
[0, 3, 1],
|
||||
[1, 3, 4],
|
||||
[1, 4, 2],
|
||||
[2, 4, 5],
|
||||
[2, 5, 0],
|
||||
[0, 5, 3]
|
||||
]
|
||||
|
||||
When defining triangles, you can use clockwise or counter-clockwise indexes.
|
||||
|
||||
## Parameters
|
||||
|
||||
- `sections` : A list of cross-sections. Each cross-section is represented by a list of points. See the example below.
|
||||
- `triangles` : `"SOLID"` (default), `"HOLLOW"`, or user-defined indexes. See example below.
|
||||
|
||||
## Examples
|
||||
|
||||
use <rotate_p.scad>;
|
||||
use <polysections.scad>;
|
||||
|
||||
section1 = [
|
||||
[20, 0, 0],
|
||||
[18, 9, 0],
|
||||
[15, 10, 0],
|
||||
[10, 0, 0]
|
||||
];
|
||||
|
||||
// spin section1
|
||||
sections = [
|
||||
for(i = [0:55])
|
||||
[
|
||||
for(p = section1)
|
||||
let(pt = rotate_p(p, [90, 0, 10 * i]))
|
||||
[pt[0], pt[1] , pt[2] + i]
|
||||
]
|
||||
];
|
||||
|
||||
polysections(sections);
|
||||
|
||||

|
||||
|
||||
use <rotate_p.scad>;
|
||||
use <polysections.scad>;
|
||||
|
||||
section1 = [
|
||||
// outer
|
||||
[20, 0, 0],
|
||||
[18, 9, 0],
|
||||
[15, 10, 0],
|
||||
[10, 0, 0],
|
||||
// inner
|
||||
[18, 2, 0],
|
||||
[17, 7, 0],
|
||||
[15, 7, 0],
|
||||
[12, 2, 0]
|
||||
];
|
||||
|
||||
// spin section1
|
||||
sections = [
|
||||
for(i = [0:55])
|
||||
[
|
||||
for(p = section1)
|
||||
let(pt = rotate_p(p, [90, 0, 10 * i]))
|
||||
[pt[0], pt[1] , pt[2] + i]
|
||||
]
|
||||
];
|
||||
|
||||
polysections(sections, "HOLLOW");
|
||||
|
||||

|
||||
|
||||
use <rotate_p.scad>;
|
||||
use <polysections.scad>;
|
||||
|
||||
section1 = [
|
||||
// outer
|
||||
[30, 0, 0],
|
||||
[15, 10, 0],
|
||||
[10, 0, 0],
|
||||
// inner
|
||||
[26, 1, 0],
|
||||
[15, 8, 0],
|
||||
[12, 1, 0],
|
||||
];
|
||||
|
||||
// spin section1
|
||||
sections = [
|
||||
for(i = [0:55])
|
||||
[
|
||||
for(p = section1)
|
||||
let(pt = rotate_p(p, [90, 0, 10 * i]))
|
||||
[pt[0], pt[1] , pt[2] + i]
|
||||
]
|
||||
];
|
||||
|
||||
polysections(
|
||||
sections = sections,
|
||||
triangles = [
|
||||
[0, 3, 1],
|
||||
[1, 3, 4],
|
||||
[1, 4, 2],
|
||||
[2, 4, 5],
|
||||
[2, 5, 0],
|
||||
[0, 5, 3]
|
||||
]
|
||||
);
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
|
@@ -13,29 +13,31 @@ Transform a point inside a rectangle to a point inside a circle. You can use it
|
||||
|
||||
## Examples
|
||||
|
||||
use <hull_polyline3d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <ptf/ptf_circle.scad>;
|
||||
|
||||
size = [10, 10];
|
||||
|
||||
rows = [
|
||||
for(y = [0:size[1]])
|
||||
[for(x = [0:size[0]]) [x, y]]
|
||||
for(y = [0:size.y])
|
||||
[for(x = [0:size.x]) [x, y]]
|
||||
];
|
||||
|
||||
columns = [
|
||||
for(x = [0:size[0]])
|
||||
[for(y = [0:size[1]]) [x, y]]
|
||||
for(x = [0:size.x])
|
||||
[for(y = [0:size.y]) [x, y]]
|
||||
];
|
||||
|
||||
for(line = rows) {
|
||||
transformed = [for(p = line) ptf_circle(size, p)];
|
||||
hull_polyline3d(transformed, thickness = .1);
|
||||
polyline_join(transformed)
|
||||
sphere(.05);
|
||||
}
|
||||
|
||||
for(line = columns) {
|
||||
transformed = [for(p = line) ptf_circle(size, p)];
|
||||
hull_polyline3d(transformed, thickness = .1);
|
||||
polyline_join(transformed)
|
||||
sphere(.05);
|
||||
}
|
||||
|
||||

|
||||
|
@@ -16,30 +16,32 @@ Transforms a point inside a rectangle to a point of a ring. It can create things
|
||||
|
||||
## Examples
|
||||
|
||||
use <hull_polyline3d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <ptf/ptf_ring.scad>;
|
||||
|
||||
size = [20, 10];
|
||||
radius = 5;
|
||||
|
||||
rows = [
|
||||
for(y = [0:size[1]])
|
||||
[for(x = [0:size[0]]) [x, y]]
|
||||
for(y = [0:size.y])
|
||||
[for(x = [0:size.x]) [x, y]]
|
||||
];
|
||||
|
||||
columns = [
|
||||
for(x = [0:size[0]])
|
||||
[for(y = [0:size[1]]) [x, y]]
|
||||
for(x = [0:size.x])
|
||||
[for(y = [0:size.y]) [x, y]]
|
||||
];
|
||||
|
||||
for(line = rows) {
|
||||
transformed = [for(p = line) ptf_ring(size, p, radius, 360, 180)];
|
||||
hull_polyline3d(transformed, thickness = .5);
|
||||
polyline_join(transformed)
|
||||
sphere(.25);
|
||||
}
|
||||
|
||||
for(line = columns) {
|
||||
transformed = [for(p = line) ptf_ring(size, p, radius, 360, 180)];
|
||||
hull_polyline3d(transformed, thickness = .5);
|
||||
polyline_join(transformed)
|
||||
sphere(.25);
|
||||
}
|
||||
|
||||

|
||||
|
@@ -26,7 +26,7 @@ Rotates a point `a` degrees around the axis of the coordinate system or an arbit
|
||||
sphere(1);
|
||||
}
|
||||
|
||||

|
||||

|
||||
|
||||
use <ptf/ptf_rotate.scad>;
|
||||
|
||||
@@ -48,7 +48,7 @@ Rotates a point `a` degrees around the axis of the coordinate system or an arbit
|
||||
|
||||
%sphere(radius);
|
||||
|
||||

|
||||

|
||||
|
||||
use <ptf/ptf_rotate.scad>;
|
||||
|
||||
@@ -66,4 +66,4 @@ Rotates a point `a` degrees around the axis of the coordinate system or an arbit
|
||||
sphere(1);
|
||||
}
|
||||
|
||||

|
||||

|
@@ -15,7 +15,7 @@ Transforms a point inside a rectangle to a point of a sphere. It can create thin
|
||||
|
||||
## Examples
|
||||
|
||||
use <hull_polyline3d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <ptf/ptf_sphere.scad>;
|
||||
|
||||
size = [20, 10];
|
||||
@@ -23,23 +23,25 @@ Transforms a point inside a rectangle to a point of a sphere. It can create thin
|
||||
angle = [180, 270];
|
||||
|
||||
rows = [
|
||||
for(y = [0:size[1]])
|
||||
[for(x = [0:size[0]]) [x, y]]
|
||||
for(y = [0:size.y])
|
||||
[for(x = [0:size.x]) [x, y]]
|
||||
];
|
||||
|
||||
columns = [
|
||||
for(x = [0:size[0]])
|
||||
[for(y = [0:size[1]]) [x, y]]
|
||||
for(x = [0:size.x])
|
||||
[for(y = [0:size.y]) [x, y]]
|
||||
];
|
||||
|
||||
for(line = rows) {
|
||||
transformed = [for(p = line) ptf_sphere(size, p, radius, angle)];
|
||||
hull_polyline3d(transformed, thickness = .5);
|
||||
polyline_join(transformed)
|
||||
sphere(.25);
|
||||
}
|
||||
|
||||
for(line = columns) {
|
||||
transformed = [for(p = line) ptf_sphere(size, p, radius, angle)];
|
||||
hull_polyline3d(transformed, thickness = .5);
|
||||
polyline_join(transformed)
|
||||
sphere(.25);
|
||||
}
|
||||
|
||||

|
||||
|
@@ -16,7 +16,7 @@ Transforms a point inside a rectangle to a point of a torus. It can create thing
|
||||
|
||||
## Examples
|
||||
|
||||
use <hull_polyline3d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <ptf/ptf_torus.scad>;
|
||||
|
||||
size = [20, 10];
|
||||
@@ -25,23 +25,25 @@ Transforms a point inside a rectangle to a point of a torus. It can create thing
|
||||
twist = 90;
|
||||
|
||||
rows = [
|
||||
for(y = [0:size[1]])
|
||||
[for(x = [0:size[0]]) [x, y]]
|
||||
for(y = [0:size.y])
|
||||
[for(x = [0:size.x]) [x, y]]
|
||||
];
|
||||
|
||||
columns = [
|
||||
for(x = [0:size[0]])
|
||||
[for(y = [0:size[1]]) [x, y]]
|
||||
for(x = [0:size.x])
|
||||
[for(y = [0:size.y]) [x, y]]
|
||||
];
|
||||
|
||||
for(line = rows) {
|
||||
transformed = [for(p = line) ptf_torus(size, p, radius, angle, twist)];
|
||||
hull_polyline3d(transformed, thickness = .5);
|
||||
polyline_join(transformed)
|
||||
sphere(.25);
|
||||
}
|
||||
|
||||
for(line = columns) {
|
||||
transformed = [for(p = line) ptf_torus(size, p, radius, angle, twist)];
|
||||
hull_polyline3d(transformed, thickness = .5);
|
||||
polyline_join(transformed)
|
||||
sphere(.25);
|
||||
}
|
||||
|
||||

|
||||
|
@@ -14,29 +14,31 @@ Twist a point along the x-axis. You can use it to create something such as a [tw
|
||||
|
||||
## Examples
|
||||
|
||||
use <hull_polyline3d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <ptf/ptf_x_twist.scad>;
|
||||
|
||||
size = [20, 10];
|
||||
|
||||
rows = [
|
||||
for(y = [0:size[1]])
|
||||
[for(x = [0:size[0]]) [x, y]]
|
||||
for(y = [0:size.y])
|
||||
[for(x = [0:size.x]) [x, y]]
|
||||
];
|
||||
|
||||
columns = [
|
||||
for(x = [0:size[0]])
|
||||
[for(y = [0:size[1]]) [x, y]]
|
||||
for(x = [0:size.x])
|
||||
[for(y = [0:size.y]) [x, y]]
|
||||
];
|
||||
|
||||
for(line = rows) {
|
||||
twisted = [for(p = line) ptf_x_twist(size, p, 90)];
|
||||
hull_polyline3d(twisted, thickness = .1);
|
||||
polyline_join(twisted)
|
||||
sphere(.05);
|
||||
}
|
||||
|
||||
for(line = columns) {
|
||||
twisted = [for(p = line) ptf_x_twist(size, p, 90)];
|
||||
hull_polyline3d(twisted, thickness = .1);
|
||||
polyline_join(twisted)
|
||||
sphere(.05);
|
||||
}
|
||||
|
||||

|
||||
|
@@ -14,29 +14,31 @@ Twist a point along the y-axis. You can use it to create something such as a [tw
|
||||
|
||||
## Examples
|
||||
|
||||
use <hull_polyline3d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <ptf/ptf_y_twist.scad>;
|
||||
|
||||
size = [10, 20];
|
||||
|
||||
rows = [
|
||||
for(y = [0:size[1]])
|
||||
[for(x = [0:size[0]]) [x, y]]
|
||||
for(y = [0:size.y])
|
||||
[for(x = [0:size.x]) [x, y]]
|
||||
];
|
||||
|
||||
columns = [
|
||||
for(x = [0:size[0]])
|
||||
[for(y = [0:size[1]]) [x, y]]
|
||||
for(x = [0:size.x])
|
||||
[for(y = [0:size.y]) [x, y]]
|
||||
];
|
||||
|
||||
for(line = rows) {
|
||||
twisted = [for(p = line) ptf_y_twist(size, p, 90)];
|
||||
hull_polyline3d(twisted, thickness = .1);
|
||||
polyline_join(twisted)
|
||||
sphere(.05);
|
||||
}
|
||||
|
||||
for(line = columns) {
|
||||
twisted = [for(p = line) ptf_y_twist(size, p, 90)];
|
||||
hull_polyline3d(twisted, thickness = .1);
|
||||
polyline_join(twisted)
|
||||
sphere(.05);
|
||||
}
|
||||
|
||||

|
||||
|
69
docs/lib3x-rails2sections.md
Normal file
@@ -0,0 +1,69 @@
|
||||
# rails2sections
|
||||
|
||||
Create sections along rails. Combined with the `sweep` module, you can describe a more complex model.
|
||||
|
||||
Rails should be indexed count-clockwisely.
|
||||
|
||||
**Since:** 3.2
|
||||
|
||||
## Parameters
|
||||
|
||||
- `rails` : A list of rails used to describe the surface of the model.
|
||||
|
||||
## Examples
|
||||
|
||||
use <rails2sections.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <sweep.scad>;
|
||||
|
||||
rails = [
|
||||
[[5, 0, 5], [15, 10, 10], [25, 20, 5]],
|
||||
[[-5, 0, 5], [-15, 10, 10], [-25, 20, 5]],
|
||||
[[-5, 0, -5], [-15, 10, -10], [-25, 20, -5]],
|
||||
[[5, 0, -5], [15, 10, -10], [25, 20, -5]]
|
||||
];
|
||||
|
||||
sections = rails2sections(rails);
|
||||
|
||||
sweep(sections);
|
||||
|
||||
#for(path = rails) {
|
||||
polyline_join(path)
|
||||
sphere(.25);
|
||||
}
|
||||
|
||||

|
||||
|
||||
use <bezier_curve.scad>;
|
||||
use <rails2sections.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <sweep.scad>;
|
||||
|
||||
t_step = 0.05;
|
||||
|
||||
rails = [
|
||||
bezier_curve(t_step,
|
||||
[[1.25, 0, 5], [5, 20, 5], [16, 20, -2], [18, 20, 10], [30, 15, 8]]
|
||||
),
|
||||
bezier_curve(t_step,
|
||||
[[-1.25, 0, 5], [0, 20, 5], [16, 22, -2], [18, 20, 10], [30, 25, 8]]
|
||||
),
|
||||
bezier_curve(t_step,
|
||||
[[-1.25, 0, -5], [0, 20, -5], [16, 20, 1], [18, 27, -3], [20, 27, -5]]
|
||||
),
|
||||
bezier_curve(t_step,
|
||||
[[1.25, 0, -5], [5, 20, -5], [16, 20, 1], [18, 17.5, -3], [20, 17.5, -5]]
|
||||
)
|
||||
];
|
||||
|
||||
|
||||
sections = rails2sections(rails);
|
||||
|
||||
sweep(sections);
|
||||
|
||||
#for(path = rails) {
|
||||
polyline_join(path)
|
||||
sphere(.25);
|
||||
}
|
||||
|
||||

|
@@ -1,82 +0,0 @@
|
||||
# rotate_p
|
||||
|
||||
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 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
|
||||
|
||||
You can use the code below to create a line.
|
||||
|
||||
use <rotate_p.scad>;
|
||||
|
||||
hull() {
|
||||
sphere(1);
|
||||
rotate([0, -45, 45])
|
||||
translate([20, 0, 0])
|
||||
sphere(1);
|
||||
}
|
||||
|
||||
The following code has the same effect.
|
||||
|
||||
use <rotate_p.scad>;
|
||||
|
||||
point = [20, 0, 0];
|
||||
a = [0, -45, 45];
|
||||
|
||||
hull() {
|
||||
sphere(1);
|
||||
translate(rotate_p(point, a))
|
||||
rotate(a)
|
||||
sphere(1);
|
||||
}
|
||||
|
||||

|
||||
|
||||
The `rotate_p` function is useful in some situations. For example, you probably want to get all points on the path of a spiral around a sphere.
|
||||
|
||||
use <rotate_p.scad>;
|
||||
|
||||
radius = 40;
|
||||
step_angle = 10;
|
||||
z_circles = 20;
|
||||
|
||||
points = [for(a = [0:step_angle:90 * z_circles])
|
||||
rotate_p(
|
||||
[radius, 0, 0],
|
||||
[0, -90 + 2 * a / z_circles, a]
|
||||
)
|
||||
];
|
||||
|
||||
// Once you get all points on the path, you can place anything at each point.
|
||||
// I just place a sphere as a simple demonstration.
|
||||
for(p = points) {
|
||||
translate(p)
|
||||
sphere(1);
|
||||
}
|
||||
|
||||
%sphere(radius);
|
||||
|
||||

|
||||
|
||||
use <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);
|
||||
}
|
||||
|
||||

|
37
docs/lib3x-select.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# select
|
||||
|
||||
Selects module objects.
|
||||
|
||||
**Since:** 3.2
|
||||
|
||||
## Parameters
|
||||
|
||||
- `i` : An index value, range, or list. Select all module objects if `i` is ignored.
|
||||
|
||||
## Examples
|
||||
|
||||
If you write code like this:
|
||||
|
||||
i = 0;
|
||||
|
||||
if(i == 0) {
|
||||
sphere(1);
|
||||
}
|
||||
else if(i == 1) {
|
||||
cube(1);
|
||||
}
|
||||
else if(i == 2) {
|
||||
cylinder(1, 1);
|
||||
}
|
||||
|
||||
You may use `select`:
|
||||
|
||||
use <select.scad>;
|
||||
|
||||
i = 0;
|
||||
|
||||
select(i) {
|
||||
sphere(1);
|
||||
cube(1);
|
||||
cylinder(1, 1);
|
||||
}
|
@@ -20,7 +20,7 @@ Follow the steps described in [img2gray](https://github.com/JustinSDK/img2gray).
|
||||
|
||||
## Examples
|
||||
|
||||
use <hull_polyline3d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <bezier_curve.scad>;
|
||||
use <surface/sf_curve.scad>;
|
||||
|
||||
@@ -146,4 +146,5 @@ Follow the steps described in [img2gray](https://github.com/JustinSDK/img2gray).
|
||||
|
||||
sf_curve(levels, curve_path, thickness, depth, invert);
|
||||
|
||||
#hull_polyline3d(curve_path, 5);
|
||||
#polyline_join(curve_path)
|
||||
sphere(2.5);
|
@@ -18,8 +18,8 @@ It solidifies two surfaces with triangular mesh.
|
||||
points = [for(i = [0:50]) rands(-300, 300, 2)];
|
||||
triangles = tri_delaunay(points);
|
||||
|
||||
pts = [for(p = points) [p[0], p[1], rands(100, 150, 1)[0]]];
|
||||
pts2 = [for(p = pts) [p[0], p[1], p[2] - 100]];
|
||||
pts = [for(p = points) [p.x, p.y, rands(100, 150, 1)[0]]];
|
||||
pts2 = [for(p = pts) [p.x, p.y, p.z - 100]];
|
||||
|
||||
sf_solidifyT(pts, pts2, triangles = triangles);
|
||||
|
||||
@@ -45,8 +45,8 @@ It solidifies two surfaces with triangular mesh.
|
||||
[x, y]
|
||||
];
|
||||
|
||||
points1 = [for(p = pts2d) scale * [p[0], p[1], f(p[0], p[1])]];
|
||||
points2 = [for(p = points1) [p[0], p[1], p[2] - scale * thickness]];
|
||||
points1 = [for(p = pts2d) scale * [p.x, p.y, f(p.x, p.y)]];
|
||||
points2 = [for(p = points1) [p.x, p.y, p.z - scale * thickness]];
|
||||
triangles = tri_delaunay(pts2d);
|
||||
|
||||
|
||||
|
22
docs/lib3x-shape_star.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# shape_star
|
||||
|
||||
Create a star. Default to a pentagram.
|
||||
|
||||
**Since:** 3.2
|
||||
|
||||
## Parameters
|
||||
|
||||
- `outer_radius`: the outer radius of the star. Default to 1.
|
||||
- `inner_radius`: the inner radius of the star. Default to 0.381966.
|
||||
- `n`: the burst number. Default to 5.
|
||||
|
||||
## Examples
|
||||
|
||||
use <shape_star.scad>;
|
||||
|
||||
polygon(shape_star());
|
||||
translate([3, 0, 0])
|
||||
polygon(shape_star(n = 8));
|
||||
|
||||

|
||||
|
@@ -14,7 +14,7 @@ Creates all points and angles on the path of a spiral around a sphere. It return
|
||||
|
||||
## Examples
|
||||
|
||||
use <hull_polyline3d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <sphere_spiral.scad>;
|
||||
|
||||
points_angles = sphere_spiral(
|
||||
@@ -25,7 +25,8 @@ Creates all points and angles on the path of a spiral around a sphere. It return
|
||||
end_angle = 90
|
||||
);
|
||||
|
||||
hull_polyline3d([for(pa = points_angles) pa[0]], 1);
|
||||
polyline_join([for(pa = points_angles) pa[0]])
|
||||
sphere(.5);
|
||||
|
||||
%sphere(40);
|
||||
|
||||
@@ -54,7 +55,7 @@ Creates all points and angles on the path of a spiral around a sphere. It return
|
||||
|
||||

|
||||
|
||||
use <hull_polyline3d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <sphere_spiral.scad>;
|
||||
|
||||
points_angles = sphere_spiral(
|
||||
@@ -64,7 +65,8 @@ Creates all points and angles on the path of a spiral around a sphere. It return
|
||||
|
||||
for(a = [0:30:360]) {
|
||||
rotate(a)
|
||||
hull_polyline3d([for(pa = points_angles) pa[0]], 2);
|
||||
polyline_join([for(pa = points_angles) pa[0]])
|
||||
sphere(1);
|
||||
}
|
||||
|
||||

|
||||
|
@@ -40,7 +40,7 @@ The indexes of the above triangles is:
|
||||
|
||||
## Examples
|
||||
|
||||
use <rotate_p.scad>;
|
||||
use <ptf/ptf_rotate.scad>;
|
||||
use <sweep.scad>;
|
||||
|
||||
section1 = [
|
||||
@@ -55,8 +55,8 @@ The indexes of the above triangles is:
|
||||
for(i = [0:55])
|
||||
[
|
||||
for(p = section1)
|
||||
let(pt = rotate_p(p, [90, 0, 10 * i]))
|
||||
[pt[0], pt[1] , pt[2] + i]
|
||||
let(pt = ptf_rotate(p, [90, 0, 10 * i]))
|
||||
[pt.x, pt.y , pt.z + i]
|
||||
]
|
||||
];
|
||||
|
||||
@@ -64,7 +64,7 @@ The indexes of the above triangles is:
|
||||
|
||||

|
||||
|
||||
use <rotate_p.scad>;
|
||||
use <ptf/ptf_rotate.scad>;
|
||||
use <sweep.scad>;
|
||||
|
||||
section1 = [
|
||||
@@ -85,8 +85,8 @@ The indexes of the above triangles is:
|
||||
for(i = [0:55])
|
||||
[
|
||||
for(p = section1)
|
||||
let(pt = rotate_p(p, [90, 0, 10 * i]))
|
||||
[pt[0], pt[1] , pt[2] + i]
|
||||
let(pt = ptf_rotate(p, [90, 0, 10 * i]))
|
||||
[pt.x, pt.y , pt.z + i]
|
||||
]
|
||||
];
|
||||
|
||||
@@ -94,7 +94,7 @@ The indexes of the above triangles is:
|
||||
|
||||

|
||||
|
||||
use <rotate_p.scad>;
|
||||
use <ptf/ptf_rotate.scad>;
|
||||
use <sweep.scad>;
|
||||
|
||||
section1 = [
|
||||
@@ -113,8 +113,8 @@ The indexes of the above triangles is:
|
||||
for(i = [0:55])
|
||||
[
|
||||
for(p = section1)
|
||||
let(pt = rotate_p(p, [90, 0, 10 * i]))
|
||||
[pt[0], pt[1] , pt[2] + i]
|
||||
let(pt = ptf_rotate(p, [90, 0, 10 * i]))
|
||||
[pt.x, pt.y , pt.z + i]
|
||||
]
|
||||
];
|
||||
|
||||
|
@@ -81,7 +81,7 @@ The code below creates the same drawing.
|
||||
|
||||

|
||||
|
||||
use <hull_polyline2d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <turtle/t2d.scad>;
|
||||
|
||||
side_leng = 100;
|
||||
@@ -100,10 +100,8 @@ The code below creates the same drawing.
|
||||
["forward", side_leng]
|
||||
]);
|
||||
|
||||
hull_polyline2d(
|
||||
[for(turtle = [t, t2, t3, t]) t2d(turtle, "point")],
|
||||
thickness
|
||||
);
|
||||
polyline_join([for(turtle = [t, t2, t3, t]) t2d(turtle, "point")])
|
||||
circle(thickness / 2);
|
||||
}
|
||||
|
||||
module sierpinski_triangle(t, side_leng, min_leng, thickness) {
|
||||
|
@@ -20,7 +20,7 @@ For more details, please see [3D turtle graphics](https://openhome.cc/eGossip/Op
|
||||
## Examples
|
||||
|
||||
use <turtle/t3d.scad>;
|
||||
use <hull_polyline3d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
|
||||
leng = 10;
|
||||
angle = 120;
|
||||
@@ -37,10 +37,9 @@ For more details, please see [3D turtle graphics](https://openhome.cc/eGossip/Op
|
||||
["xforward", leng]
|
||||
]);
|
||||
|
||||
hull_polyline3d(
|
||||
[for(turtle = [t, t2, t3, t4]) t3d(turtle, "point")],
|
||||
thickness
|
||||
);
|
||||
polyline_join(
|
||||
[for(turtle = [t, t2, t3, t4]) t3d(turtle, "point")]
|
||||
) sphere(thickness / 2);
|
||||
|
||||

|
||||
|
||||
|
@@ -12,7 +12,7 @@ Join a set of points to make a [Delaunay triangulation](https://en.wikipedia.org
|
||||
## Examples
|
||||
|
||||
use <triangle/tri_delaunay.scad>;
|
||||
use <hull_polyline2d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
|
||||
points = [for(i = [0:20]) rands(-100, 100, 2)];
|
||||
|
||||
@@ -32,7 +32,8 @@ Join a set of points to make a [Delaunay triangulation](https://en.wikipedia.org
|
||||
color("red")
|
||||
linear_extrude(3)
|
||||
for(t = tri_delaunay(points, ret = "VORONOI_CELLS")) {
|
||||
hull_polyline2d(concat(t, [t[0]]), 2);
|
||||
polyline_join(concat(t, [t[0]]))
|
||||
circle(1);
|
||||
}
|
||||
|
||||

|
||||
|
@@ -14,7 +14,7 @@ A method of [`tri_delaunay`](lib3x-tri_delaunay.html). Returns the indices from
|
||||
use <triangle/tri_delaunay_indices.scad>;
|
||||
use <triangle/tri_delaunay_shapes.scad>;
|
||||
use <triangle/tri_delaunay_voronoi.scad>;
|
||||
use <hull_polyline2d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
|
||||
points = [for(i = [0:20]) rands(-100, 100, 2)];
|
||||
|
||||
@@ -36,7 +36,8 @@ A method of [`tri_delaunay`](lib3x-tri_delaunay.html). Returns the indices from
|
||||
color("red")
|
||||
linear_extrude(3)
|
||||
for(t = tri_delaunay_voronoi(delaunay)) {
|
||||
hull_polyline2d(concat(t, [t[0]]), 2);
|
||||
polyline_join(concat(t, [t[0]]))
|
||||
circle(1);
|
||||
}
|
||||
|
||||

|
||||
|
@@ -14,7 +14,7 @@ A method of [`tri_delaunay`](lib3x-tri_delaunay.html). Returns triangle shapes f
|
||||
use <triangle/tri_delaunay_indices.scad>;
|
||||
use <triangle/tri_delaunay_shapes.scad>;
|
||||
use <triangle/tri_delaunay_voronoi.scad>;
|
||||
use <hull_polyline2d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
|
||||
points = [for(i = [0:20]) rands(-100, 100, 2)];
|
||||
|
||||
@@ -36,7 +36,8 @@ A method of [`tri_delaunay`](lib3x-tri_delaunay.html). Returns triangle shapes f
|
||||
color("red")
|
||||
linear_extrude(3)
|
||||
for(t = tri_delaunay_voronoi(delaunay)) {
|
||||
hull_polyline2d(concat(t, [t[0]]), 2);
|
||||
polyline_join(concat(t, [t[0]]))
|
||||
circle(1);
|
||||
}
|
||||
|
||||

|
||||
|
@@ -14,7 +14,7 @@ A method of [`tri_delaunay`](lib3x-tri_delaunay.html). Returns voronoi cells fro
|
||||
use <triangle/tri_delaunay_indices.scad>;
|
||||
use <triangle/tri_delaunay_shapes.scad>;
|
||||
use <triangle/tri_delaunay_voronoi.scad>;
|
||||
use <hull_polyline2d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
|
||||
points = [for(i = [0:20]) rands(-100, 100, 2)];
|
||||
|
||||
@@ -36,7 +36,8 @@ A method of [`tri_delaunay`](lib3x-tri_delaunay.html). Returns voronoi cells fro
|
||||
color("red")
|
||||
linear_extrude(3)
|
||||
for(t = tri_delaunay_voronoi(delaunay)) {
|
||||
hull_polyline2d(concat(t, [t[0]]), 2);
|
||||
polyline_join(concat(t, [t[0]]))
|
||||
circle(1);
|
||||
}
|
||||
|
||||

|
||||
|
@@ -13,7 +13,7 @@ Given a tangled-edge shape. This function trims the shape to a non-tangled shape
|
||||
|
||||
## Examples
|
||||
|
||||
use <hull_polyline2d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <trim_shape.scad>;
|
||||
use <shape_taiwan.scad>;
|
||||
use <bijection_offset.scad>;
|
||||
@@ -24,10 +24,13 @@ Given a tangled-edge shape. This function trims the shape to a non-tangled shape
|
||||
trimmed = trim_shape(offseted, 3, len(offseted) - 6);
|
||||
smoothed = midpt_smooth(trimmed, 3);
|
||||
|
||||
#hull_polyline2d(taiwan, .1);
|
||||
#polyline_join(taiwan)
|
||||
circle(.05);
|
||||
%translate([25, 0, 0])
|
||||
hull_polyline2d(offseted, .2);
|
||||
hull_polyline2d(smoothed, .1);
|
||||
polyline_join(offseted)
|
||||
circle(.1);
|
||||
polyline_join(smoothed)
|
||||
circle(.05);
|
||||
|
||||

|
||||
|
||||
|
@@ -10,7 +10,7 @@ Create cell shapes of Voronoi from a list of points.
|
||||
|
||||
## Examples
|
||||
|
||||
use <hull_polyline2d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <voronoi/vrn2_cells_from.scad>;
|
||||
|
||||
points = [for(i = [0:50]) rands(-100, 100, 2)];
|
||||
@@ -21,7 +21,8 @@ Create cell shapes of Voronoi from a list of points.
|
||||
cell = cells[i];
|
||||
|
||||
linear_extrude(1)
|
||||
hull_polyline2d(concat(cell, [cell[0]]), width = 1);
|
||||
polyline_join(concat(cell, [cell[0]]))
|
||||
circle(.5);
|
||||
|
||||
color(rands(0, 1, 3))
|
||||
translate(pt)
|
||||
|
@@ -12,7 +12,7 @@ Create cell shapes of Voronoi in the first quadrant. You specify a space and a g
|
||||
|
||||
## Examples
|
||||
|
||||
use <hull_polyline2d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <voronoi/vrn2_cells_space.scad>;
|
||||
|
||||
size = [20, 20];
|
||||
@@ -24,7 +24,8 @@ Create cell shapes of Voronoi in the first quadrant. You specify a space and a g
|
||||
cell_poly = cell[1];
|
||||
|
||||
linear_extrude(1)
|
||||
hull_polyline2d(concat(cell_poly, [cell_poly[0]]), width = 1);
|
||||
polyline_join(concat(cell_poly, [cell_poly[0]]))
|
||||
circle(.5);
|
||||
|
||||
color(rands(0, 1, 3))
|
||||
translate(cell_pt)
|
||||
@@ -35,7 +36,7 @@ Create cell shapes of Voronoi in the first quadrant. You specify a space and a g
|
||||
|
||||

|
||||
|
||||
use <hull_polyline3d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
use <ptf/ptf_torus.scad>;
|
||||
use <voronoi/vrn2_cells_space.scad>;
|
||||
|
||||
@@ -48,7 +49,8 @@ Create cell shapes of Voronoi in the first quadrant. You specify a space and a g
|
||||
for(cell = cells) {
|
||||
cell_poly = [for(p = cell[1]) ptf_torus(size, p, [10, 5], [360, 360])];
|
||||
|
||||
hull_polyline3d(cell_poly, thickness = 1);
|
||||
polyline_join(cell_poly)
|
||||
sphere(.5);
|
||||
}
|
||||
|
||||

|
@@ -12,7 +12,7 @@ Draws a voxel-by-voxel curve from control points. The curve is drawn only from t
|
||||
## Examples
|
||||
|
||||
use <voxel/vx_curve.scad>;
|
||||
use <hull_polyline3d.scad>;
|
||||
use <polyline_join.scad>;
|
||||
|
||||
pts = [
|
||||
[28, 2, 1],
|
||||
@@ -32,6 +32,7 @@ Draws a voxel-by-voxel curve from control points. The curve is drawn only from t
|
||||
translate(pt)
|
||||
sphere(1);
|
||||
}
|
||||
#hull_polyline3d(pts, .1);
|
||||
#polyline_join(pts)
|
||||
sphere(.05);
|
||||
|
||||

|
||||
|
@@ -16,7 +16,7 @@ Returns points that can be used to draw a voxel-style polygon.
|
||||
|
||||
pentagram = [
|
||||
for(pt = shape_pentagram(15))
|
||||
[round(pt[0]), round(pt[1])]
|
||||
[round(pt.x), round(pt.y)]
|
||||
];
|
||||
|
||||
for(pt = vx_polygon(pentagram)) {
|
||||
|
@@ -15,7 +15,7 @@ Given a list of points. `vx_polyline` returns points that can be used to draw a
|
||||
|
||||
pentagram = [
|
||||
for(pt = shape_pentagram(15))
|
||||
[round(pt[0]), round(pt[1])]
|
||||
[round(pt.x), round(pt.y)]
|
||||
];
|
||||
|
||||
for(pt = vx_polyline(concat(pentagram, [pentagram[0]]))) {
|
||||
@@ -37,7 +37,7 @@ Given a list of points. `vx_polyline` returns points that can be used to draw a
|
||||
points = [
|
||||
for(pa = points_angles)
|
||||
let(pt = pa[0])
|
||||
[round(pt[0]), round(pt[1]), round(pt[2])]
|
||||
[round(pt.x), round(pt.y), round(pt.z)]
|
||||
];
|
||||
|
||||
for(a = [0:30:330]) {
|
||||
|
220
examples/caterpillar.scad
Normal file
@@ -0,0 +1,220 @@
|
||||
use <arc.scad>;
|
||||
use <pie.scad>;
|
||||
use <hollow_out.scad>;
|
||||
|
||||
$fn = 96;
|
||||
|
||||
module track(radius) {
|
||||
module wheels(radius) {
|
||||
module wheel() {
|
||||
rotate_extrude()
|
||||
translate([radius, 0, 0])
|
||||
circle(radius / 2);
|
||||
}
|
||||
|
||||
for(i = [0:4:8]) {
|
||||
translate([radius * i, 0, 0])
|
||||
wheel();
|
||||
}
|
||||
}
|
||||
|
||||
module track_profile() {
|
||||
hull() {
|
||||
circle(1.7 * radius );
|
||||
translate([radius * 8, 0, 0])
|
||||
circle(1.7 * radius);
|
||||
}
|
||||
}
|
||||
|
||||
translate([-radius * 4, 0, -radius])
|
||||
scale([1, 1, 1.5]) {
|
||||
color("black")
|
||||
linear_extrude(radius * 1.5)
|
||||
hollow_out(shell_thickness = 0.45 * radius)
|
||||
track_profile();
|
||||
|
||||
color("white")
|
||||
translate([0, 0, radius * 0.75])
|
||||
scale([1, 1, 1.5])
|
||||
wheels(radius);
|
||||
}
|
||||
}
|
||||
|
||||
module body(radius) {
|
||||
module eye() {
|
||||
translate([-radius / 15, 0, 0])
|
||||
rotate([0, 0, 90])
|
||||
arc(radius / 2, [0, 180], radius / 5, width_mode = "LINE_OUTWARD");
|
||||
|
||||
translate([0, radius / 3, 0])
|
||||
circle(radius / 3);
|
||||
}
|
||||
|
||||
module eyebrow() {
|
||||
rotate([0, 0, 90])
|
||||
arc(radius / 1.25, [25, 155], radius / 10, width_mode = "LINE_OUTWARD");
|
||||
}
|
||||
|
||||
scale([1, 1, 0.9]) {
|
||||
color("yellow")
|
||||
sphere(radius * 4);
|
||||
|
||||
color("Aqua")
|
||||
rotate([85, 0, 90])
|
||||
intersection() {
|
||||
linear_extrude(radius * 4.5)
|
||||
pie(radius * 3.5, [0, 180]);
|
||||
difference() {
|
||||
sphere(radius * 4 + radius / 5);
|
||||
sphere(radius * 4);
|
||||
}
|
||||
}
|
||||
|
||||
// eyes
|
||||
color("black") {
|
||||
rotate([0, 65, 16])
|
||||
linear_extrude(radius * 4.25)
|
||||
eye();
|
||||
|
||||
rotate([0, 65, -16])
|
||||
linear_extrude(radius * 4.25)
|
||||
eye();
|
||||
}
|
||||
|
||||
// eyebrows
|
||||
color("black") {
|
||||
rotate([0, 55, 20])
|
||||
linear_extrude(radius * 4.25)
|
||||
eyebrow();
|
||||
|
||||
rotate([0, 55, -20])
|
||||
linear_extrude(radius * 4.25)
|
||||
eyebrow();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module arm(radius) {
|
||||
translate([0, 0, -radius]) {
|
||||
translate([0, 0, radius / 2])
|
||||
linear_extrude(radius) {
|
||||
translate([0, -radius * 0.75, 0])
|
||||
square([radius * 9, radius * 1.5]);
|
||||
rotate(80)
|
||||
translate([0, -radius * 0.5, 0])
|
||||
square([radius * 9, radius]);
|
||||
}
|
||||
|
||||
translate([0, 0, radius * 0.25])
|
||||
linear_extrude(radius * 1.5)
|
||||
circle(radius);
|
||||
|
||||
linear_extrude(radius * 2)
|
||||
translate([radius * 9, 0, 0])
|
||||
circle(radius);
|
||||
}
|
||||
}
|
||||
|
||||
module glove(radius) {
|
||||
scale([0.8, 0.8, 1.2]) {
|
||||
color("white") {
|
||||
hull() {
|
||||
scale([1.1, 1, 0.5])
|
||||
sphere(radius * 2.5);
|
||||
|
||||
translate([-radius * 1.75, 0, radius / 1.5])
|
||||
scale([1, 1.75, 0.8])
|
||||
sphere(radius);
|
||||
}
|
||||
|
||||
translate([-radius * 2.5, 0, radius / 1.5])
|
||||
scale([1.2, 2, 1])
|
||||
sphere(radius);
|
||||
|
||||
rotate(-10)
|
||||
translate([0, -radius * 2.5, 0])
|
||||
scale([1.75, 1, 0.8])
|
||||
sphere(radius / 1.5);
|
||||
}
|
||||
|
||||
color("black")
|
||||
intersection() {
|
||||
scale([1.1, 1, 0.55])
|
||||
sphere(radius * 2.5);
|
||||
|
||||
union() {
|
||||
translate([0, radius * 0.75, -radius * 2])
|
||||
linear_extrude(radius)
|
||||
square([radius * 2, radius / 4], center = true);
|
||||
|
||||
translate([0, -radius * 0.75, -radius * 2])
|
||||
linear_extrude(radius)
|
||||
square([radius * 2, radius / 4], center = true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module big_caterpillar(radius) {
|
||||
translate([0, -radius * 4, 0])
|
||||
rotate([90, 0, 0])
|
||||
track(radius);
|
||||
|
||||
translate([0, 0, radius * 3])
|
||||
body(radius);
|
||||
|
||||
translate([0, radius * 4, 0])
|
||||
rotate([90, 0, 0])
|
||||
track(radius);
|
||||
|
||||
color("yellow")
|
||||
translate([radius * 6, -radius * 4.5, radius * 9.5])
|
||||
rotate([90, 135, 0])
|
||||
arm(radius);
|
||||
|
||||
translate([radius * 10.75, -radius * 4.5, radius / 2.325])
|
||||
rotate([0, 70, 180])
|
||||
glove(radius);
|
||||
}
|
||||
|
||||
module small_caterpillar(radius) {
|
||||
body_pts = [
|
||||
[0, 0, -radius / 3],
|
||||
[radius * 1.5, 0, 0],
|
||||
[radius * 3, 0, radius],
|
||||
[radius * 4.25, 0, radius * 2]
|
||||
];
|
||||
|
||||
color("LimeGreen")
|
||||
for(p = body_pts) {
|
||||
translate(p)
|
||||
sphere(radius);
|
||||
}
|
||||
|
||||
module eye() {
|
||||
color("white")
|
||||
translate([0, 0, 0])
|
||||
sphere(radius / 1.5);
|
||||
color("black")
|
||||
translate([.5 * radius, radius / 4, 0])
|
||||
sphere(radius / 3);
|
||||
color("white")
|
||||
translate([.655 * radius, radius / 2.75, 0])
|
||||
sphere(radius / 6);
|
||||
}
|
||||
|
||||
half_r = radius / 2;
|
||||
translate([radius * 4.75, 0, radius * 3]) {
|
||||
translate([0, half_r, 0]) eye();
|
||||
translate([0, -half_r, 0]) eye();
|
||||
}
|
||||
}
|
||||
|
||||
module caterpillars(radius) {
|
||||
big_caterpillar(radius);
|
||||
translate([radius * 3.5, -radius * 4.5, radius * 9.75])
|
||||
rotate([0, -15, 0])
|
||||
scale([0.8, 0.8, 0.8]) small_caterpillar(radius);
|
||||
}
|
||||
|
||||
caterpillars(5);
|
225
examples/daruma.scad
Normal file
@@ -0,0 +1,225 @@
|
||||
use <shear.scad>;
|
||||
|
||||
text = "順暢";
|
||||
font = "思源黑體 Heavy";
|
||||
font_size = 15;
|
||||
nose = true;
|
||||
smoothing = false; // warning: previewing is slow if it's true.
|
||||
|
||||
scale(smoothing ? 0.985 : 1)
|
||||
daruma(nose);
|
||||
|
||||
wish_decoration(text, font, font_size);
|
||||
|
||||
module daruma(nose) {
|
||||
radius = 10;
|
||||
|
||||
module body() {
|
||||
translate([0, 0, radius * 2.75])
|
||||
shear(sy = [.025, 0])
|
||||
minkowski() {
|
||||
linear_extrude(radius * 2, scale = 0.4)
|
||||
translate([0, -radius / 4])
|
||||
circle(radius);
|
||||
|
||||
sphere(radius * 4, $fn = 48);
|
||||
}
|
||||
}
|
||||
|
||||
module mask_face() {
|
||||
module bend_extrude(size, thickness, angle, frags = 24) {
|
||||
x = size[0];
|
||||
y = size[1];
|
||||
frag_width = x / frags ;
|
||||
frag_angle = angle / frags;
|
||||
half_frag_width = 0.5 * frag_width;
|
||||
half_frag_angle = 0.5 * frag_angle;
|
||||
r = half_frag_width / sin(half_frag_angle);
|
||||
s = (r - thickness) / r;
|
||||
|
||||
module get_frag(i) {
|
||||
offsetX = i * frag_width;
|
||||
translate([0, y / 2, 0])
|
||||
linear_extrude(thickness, scale = s)
|
||||
translate([-offsetX - half_frag_width, -y / 2, 0])
|
||||
intersection() {
|
||||
translate([x, 0, 0])
|
||||
mirror([1, 0, 0])
|
||||
children();
|
||||
translate([offsetX, 0, 0])
|
||||
square([frag_width, y]);
|
||||
}
|
||||
}
|
||||
|
||||
offsetY = -r * cos(half_frag_angle) ;
|
||||
|
||||
rotate(angle - 90)
|
||||
mirror([0, 1, 0])
|
||||
mirror([0, 0, 1])
|
||||
for(i = [0 : frags - 1]) {
|
||||
rotate(i * frag_angle + half_frag_angle)
|
||||
translate([0, offsetY, 0])
|
||||
rotate([-90, 0, 0])
|
||||
get_frag(i)
|
||||
children();
|
||||
}
|
||||
}
|
||||
|
||||
translate([0, -radius, radius * 1.4])
|
||||
scale([1.27, 1, 1])
|
||||
rotate([-24, 0, 0])
|
||||
rotate(225)
|
||||
bend_extrude(size = [radius * 16, radius * 8], thickness = radius, angle = 180, frags = 36)
|
||||
translate([radius * 4, radius * 2.5])
|
||||
hull() {
|
||||
$fn = 12;
|
||||
translate([0, radius * 1.75])
|
||||
circle(radius * 1.2);
|
||||
|
||||
translate([radius * 1.45, radius * 1.5])
|
||||
circle(radius * 1.25, $fn = 24);
|
||||
|
||||
translate([-radius * 1.45, radius * 1.5])
|
||||
circle(radius * 1.25, $fn = 24);
|
||||
|
||||
translate([radius * 1.85, radius * 0.25])
|
||||
rotate(25)
|
||||
scale([1, 1.3])
|
||||
circle(radius * 1.3);
|
||||
|
||||
translate([-radius * 1.85, radius * 0.25])
|
||||
rotate(-25)
|
||||
scale([1, 1.3])
|
||||
circle(radius * 1.3);
|
||||
|
||||
translate([radius * 2.75, -radius * 1.2])
|
||||
circle(radius / 2);
|
||||
|
||||
translate([-radius * 2.75, -radius * 1.2])
|
||||
circle(radius / 2);
|
||||
}
|
||||
}
|
||||
|
||||
module eyes_nose() {
|
||||
module eye() {
|
||||
translate([radius * 1.4, -3.1 * radius, radius * 5.9])
|
||||
rotate([66, 0, 15])
|
||||
linear_extrude(radius / 4, scale = 0.9)
|
||||
circle(radius * 1.15);
|
||||
}
|
||||
|
||||
eye();
|
||||
|
||||
mirror([1, 0, 0])
|
||||
eye();
|
||||
|
||||
// nose
|
||||
if(nose) {
|
||||
translate([0, -3.75 * radius, radius * 4.85])
|
||||
rotate([67.5, 0, 0])
|
||||
linear_extrude(radius / 4, scale = 0.9)
|
||||
circle(radius * 0.4);
|
||||
}
|
||||
}
|
||||
|
||||
if(smoothing) {
|
||||
minkowski() {
|
||||
union() {
|
||||
difference() {
|
||||
body();
|
||||
mask_face();
|
||||
}
|
||||
eyes_nose();
|
||||
}
|
||||
sphere(radius / 9.5, $fn = 8);
|
||||
}
|
||||
} else {
|
||||
difference() {
|
||||
body();
|
||||
mask_face();
|
||||
}
|
||||
eyes_nose();
|
||||
}
|
||||
}
|
||||
|
||||
module wish_decoration(text, font, font_size) {
|
||||
$fn = 48;
|
||||
|
||||
translate([0, -2, 0])
|
||||
intersection() {
|
||||
union() {
|
||||
wish();
|
||||
|
||||
decoration();
|
||||
mirror([1, 0, 0])
|
||||
decoration();
|
||||
}
|
||||
|
||||
translate([0, 0, 31])
|
||||
sphere(52.25);
|
||||
}
|
||||
|
||||
module wish() {
|
||||
if(len(text) == 1) {
|
||||
translate([0, -43, 21])
|
||||
rotate([90, 0, 0])
|
||||
linear_extrude(10, scale = .8)
|
||||
text(
|
||||
text,
|
||||
font = font,
|
||||
size = font_size,
|
||||
valign = "center",
|
||||
halign = "center"
|
||||
);
|
||||
}
|
||||
else {
|
||||
translate([0, -43, 29.5])
|
||||
rotate([85, 0, 0])
|
||||
linear_extrude(10, scale = .8)
|
||||
text(
|
||||
text[0],
|
||||
font = font,
|
||||
size = font_size,
|
||||
valign = "center",
|
||||
halign = "center"
|
||||
);
|
||||
|
||||
translate([0, -42.5, 12])
|
||||
rotate([105, 0, 0])
|
||||
linear_extrude(10, scale = .8)
|
||||
text(
|
||||
text[1],
|
||||
font = font,
|
||||
size = font_size,
|
||||
valign = "center",
|
||||
halign = "center"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
module decoration() {
|
||||
translate([18, -38, 21])
|
||||
rotate([100, 0, 0])
|
||||
linear_extrude(10, scale = .8)
|
||||
scale(.85)
|
||||
scale([1, 1.825])
|
||||
offset(.5)
|
||||
difference() {
|
||||
circle(10);
|
||||
translate([-9, 0])
|
||||
circle(11.5);
|
||||
}
|
||||
|
||||
translate([28, -30, 21])
|
||||
rotate([100, 0, 30])
|
||||
linear_extrude(10, scale = .8)
|
||||
scale(.7)
|
||||
scale([1, 1.825])
|
||||
offset(.5)
|
||||
difference() {
|
||||
circle(10);
|
||||
translate([-9, 0])
|
||||
circle(11.5);
|
||||
}
|
||||
}
|
||||
}
|
@@ -11,11 +11,11 @@ beginning_radius = 15;
|
||||
thickness = 2;
|
||||
fn = 180;
|
||||
amplitude = 10;
|
||||
curve_step = 0.02;
|
||||
curve_step = 0.01;
|
||||
smoothness = 15;
|
||||
// Perlin noise 2D or 3D
|
||||
perlin = 2; // [2, 3]
|
||||
bottom = "NO"; // ["YES", "NO"]
|
||||
bottom = "YES"; // ["YES", "NO"]
|
||||
epsilon = 0.000001;
|
||||
|
||||
distorted_vase(beginning_radius, thickness, fn, amplitude, curve_step, smoothness, perlin, epsilon);
|
||||
@@ -77,7 +77,10 @@ module distorted_vase(beginning_radius, thickness, fn, amplitude,curve_step, smo
|
||||
sweep(all, triangles = "HOLLOW");
|
||||
|
||||
if(bottom == "YES") {
|
||||
linear_extrude(thickness)
|
||||
polygon([for(p = offset_noisy[len(offset_noisy) - 1]) [p[0], p[1]]]);
|
||||
sweep([
|
||||
for(section = noisy)
|
||||
if(section[0][2] < thickness)
|
||||
section
|
||||
]);
|
||||
}
|
||||
}
|
112
examples/dragon/dragon_and_pearl.scad
Normal file
@@ -0,0 +1,112 @@
|
||||
use <bezier_curve.scad>;
|
||||
use <shear.scad>;
|
||||
use <along_with.scad>;
|
||||
use <bezier_smooth.scad>;
|
||||
use <fibonacci_lattice.scad>;
|
||||
use <polyhedron_hull.scad>;
|
||||
use <dragon_head.scad>;
|
||||
use <dragon_scales.scad>;
|
||||
use <dragon_foot.scad>;
|
||||
|
||||
dragon_and_perl();
|
||||
|
||||
module one_segment(body_r, body_fn, one_scale_data) {
|
||||
// scales
|
||||
rotate([-90, 0, 0])
|
||||
dragon_body_scales(body_r, body_fn, one_scale_data);
|
||||
|
||||
// dorsal fin
|
||||
translate([0, 3.2, -3])
|
||||
rotate([-61, 0, 0])
|
||||
shear(sy = [0, 2.25])
|
||||
linear_extrude(3.25, scale = 0.3)
|
||||
square([1.5, 10], center = true);
|
||||
|
||||
// belly
|
||||
translate([0, -2.5, .8])
|
||||
rotate([-5, 0, 0])
|
||||
scale([1, 1, 1.4])
|
||||
sphere(body_r * 0.966, $fn = 8);
|
||||
|
||||
}
|
||||
|
||||
module tail() {
|
||||
$fn = 4;
|
||||
tail_scales(75, 2.5, 4.25, -4, 1.25);
|
||||
tail_scales(100, 1.25, 4.5, -7, 1);
|
||||
tail_scales(110, 1.25, 3, -9, 1);
|
||||
tail_scales(120, 2.5, 2, -9, 1);
|
||||
}
|
||||
|
||||
module dragon_and_perl() {
|
||||
function __angy_angz(p1, p2) =
|
||||
let(
|
||||
dx = p2.x - p1.x,
|
||||
dy = p2.y - p1.y,
|
||||
dz = p2.z - p1.z,
|
||||
ya = atan2(dz, sqrt(pow(dx, 2) + pow(dy, 2))),
|
||||
za = atan2(dy, dx)
|
||||
) [ya, za];
|
||||
|
||||
body_path = bezier_curve(0.02, [
|
||||
[0, 7.5, 15],
|
||||
[0, 30, 0],
|
||||
[-30, 50, -55],
|
||||
[-50, 70, 0],
|
||||
[20, 90, 60],
|
||||
[50, 110, 0],
|
||||
[0, 130, -30],
|
||||
[-10, 150, 0],
|
||||
[-5, 170, 0]
|
||||
]);
|
||||
leng_body_path = len(body_path);
|
||||
angy_angz = __angy_angz(body_path[0], body_path[1]);
|
||||
|
||||
translate([1, 7, 14])
|
||||
rotate([-135, 0, 3])
|
||||
scale(1.15)
|
||||
rotate([0, angy_angz[0], angy_angz[1]])
|
||||
dragon_head();
|
||||
|
||||
body_r = 6;
|
||||
body_fn = 12;
|
||||
scale_fn = 4;
|
||||
scale_tilt_a = 6;
|
||||
one_body_scale_data = one_body_scale(body_r, body_fn, scale_fn, scale_tilt_a);
|
||||
|
||||
along_with(body_path, scale = [0.25, 0.25, 0.5], method = "EULER_ANGLE")
|
||||
one_segment(body_r, body_fn, one_body_scale_data);
|
||||
|
||||
ayz = __angy_angz(body_path[leng_body_path - 2], body_path[leng_body_path - 1]);
|
||||
|
||||
translate(body_path[leng_body_path - 1])
|
||||
rotate([0, ayz[0] + 82, ayz[1]])
|
||||
mirror([0, 0, 1])
|
||||
rotate(-12)
|
||||
scale([0.3, 0.3, 0.6])
|
||||
tail();
|
||||
|
||||
translate([-5, 25, -12.5])
|
||||
rotate([-20, 0, -15])
|
||||
foot();
|
||||
|
||||
translate([-10, 15, -6.5])
|
||||
rotate([-60, 45, 25])
|
||||
mirror([1, 0, 0])
|
||||
foot();
|
||||
|
||||
translate([11.5, 107, -.5])
|
||||
rotate([-10, 20, -50])
|
||||
scale(0.65)
|
||||
foot();
|
||||
|
||||
translate([7, 108, .25])
|
||||
rotate([5, 20, 60])
|
||||
rotate([10, -30, 0])
|
||||
scale(0.65)
|
||||
mirror([1, 0, 0])
|
||||
foot();
|
||||
|
||||
translate([-27.5, 11.75, -14])
|
||||
polyhedron_hull(fibonacci_lattice(66, 7));
|
||||
}
|
42
examples/dragon/dragon_claw.scad
Normal file
@@ -0,0 +1,42 @@
|
||||
use <curve.scad>;
|
||||
use <polyline2d.scad>;
|
||||
use <ptf/ptf_rotate.scad>;
|
||||
use <util/dedup.scad>;
|
||||
|
||||
module dragon_claw() {
|
||||
pts = [
|
||||
[0, 0.55], [1, 0.45], [2.5, 0.375], [6, 0.825], [8, -0.375],
|
||||
[8, -0.375], [6, 1.875], [4, 1.6], [1.8, 2.5], [1.5, 2.8], [1.2, 3.3], [1.05, 3.8], [1, 4], [0, 8]
|
||||
];
|
||||
|
||||
$fn = 16;
|
||||
|
||||
a = 360 / $fn;
|
||||
x = 6.2 * cos(a);
|
||||
y = 6.2 * sin(a);
|
||||
path = [
|
||||
[0, 0], [2.5, 0], [x, y], [x + 1, y + 1]
|
||||
];
|
||||
path2 = [
|
||||
for(i = len(path) - 1; i > -1; i = i - 1)
|
||||
ptf_rotate([path[i][0], -path[i][1]], a * 2)
|
||||
];
|
||||
|
||||
t_step = 0.25;
|
||||
claw_path_basic = concat(curve(t_step, path), curve(t_step, path2));
|
||||
claw_path1 = [for(p = claw_path_basic) [p[0] * 1.15, p[1] * 1.1]];
|
||||
claw_path2 = [for(p = claw_path_basic) ptf_rotate(p * 1.2, a * 2)];
|
||||
claw_path3 = [for(p = claw_path_basic) ptf_rotate(p * 1.15, a * 4)];
|
||||
claw_path4 = [for(p = claw_path_basic) ptf_rotate(p * 1.1, a * 6)];
|
||||
claw_path5 = [for(p = claw_path_basic) ptf_rotate(p, a * 11)];
|
||||
|
||||
rotate(-15)
|
||||
scale([1.15, 1.3, 1])
|
||||
rotate(15)
|
||||
intersection() {
|
||||
rotate_extrude($fn = 7)
|
||||
polygon(pts);
|
||||
linear_extrude(5)
|
||||
polygon(dedup(concat(claw_path1, claw_path2, claw_path3, claw_path4, [[-2, -.75], [-1.45, -1.45]], claw_path5, [[1.45, -1.45], [2, -.75]])));
|
||||
}
|
||||
}
|
44
examples/dragon/dragon_foot.scad
Normal file
@@ -0,0 +1,44 @@
|
||||
use <along_with.scad>;
|
||||
use <dragon_scales.scad>;
|
||||
use <dragon_claw.scad>;
|
||||
|
||||
module knee() {
|
||||
$fn = 4;
|
||||
scale([1,0.85, 1]) union() {
|
||||
knee_scales(75, 2.5, 4.25, -4, 1.25);
|
||||
knee_scales(100, 1.25, 4.5, -7, 1);
|
||||
knee_scales(110, 1.25, 3, -9, 1);
|
||||
knee_scales(120, 2.5, 2, -9, 1);
|
||||
}
|
||||
}
|
||||
|
||||
module foot() {
|
||||
upper_arm_r = 3.6;
|
||||
lower_arm_r = 2.7;
|
||||
arm_fn = 6;
|
||||
scale_fn = 4;
|
||||
scale_tilt_a = 6;
|
||||
|
||||
upper_arm_path = [[.5, 1, 10], [1.25, 6.25, 11.25], [2, 11.5, 12.5], [2, 16.75, 13.75], [1.9, 20, 14.25]];
|
||||
lower_arm_path = [[2, 22, 14], [3.5, 21, 10], [4.5, 20.3, 7]];
|
||||
|
||||
upper_arm_scale_data = one_body_scale(upper_arm_r, arm_fn, scale_fn, scale_tilt_a);
|
||||
lower_arm_scale_data = one_body_scale(lower_arm_r, arm_fn, scale_fn, scale_tilt_a);
|
||||
|
||||
along_with(upper_arm_path, scale = 0.75, method = "EULER_ANGLE")
|
||||
rotate([-90, 0, 0])
|
||||
dragon_body_scales(upper_arm_r, arm_fn, upper_arm_scale_data);
|
||||
along_with(lower_arm_path, scale = 0.7, method = "EULER_ANGLE")
|
||||
rotate([-90, 0, 0])
|
||||
dragon_body_scales(lower_arm_r, arm_fn, lower_arm_scale_data);
|
||||
|
||||
translate([2.25, 14.5, 12.75])
|
||||
scale([0.7, 1.15, .8])
|
||||
rotate([108, 9, 1])
|
||||
knee();
|
||||
|
||||
translate([6.4, 18.95, .25])
|
||||
rotate([11, 13, 185])
|
||||
scale([1.2, 1.2, 1.2])
|
||||
dragon_claw();
|
||||
}
|
138
examples/dragon/dragon_head.scad
Normal file
@@ -0,0 +1,138 @@
|
||||
use <ellipse_extrude.scad>;
|
||||
use <curve.scad>;
|
||||
use <sweep.scad>;
|
||||
use <rails2sections.scad>;
|
||||
use <shape_trapezium.scad>;
|
||||
use <ptf/ptf_rotate.scad>;
|
||||
|
||||
module dragon_head() {
|
||||
module hair() {
|
||||
for(i = [16:36]) {
|
||||
rotate(i * 10 + rands(0, 5, 1, i)[0])
|
||||
translate([0, -13, 0])
|
||||
rotate([8 + rands(0, 2, 1, i)[0], 0, 0])
|
||||
linear_extrude(12 + rands(0, 5, 1, i)[0], scale = 0.05, twist = 50 - rands(0, 100, 1, seed = i)[0])
|
||||
translate([0, 10, 0])
|
||||
circle(3, $fn = 5);
|
||||
}
|
||||
|
||||
for(i = [0:35]) {
|
||||
rotate(i * 12 + rands(0, 5, 1, i)[0])
|
||||
translate([0, -11.5, 0])
|
||||
rotate([4 + rands(0, 2, 1, i)[0], 0, 0])
|
||||
linear_extrude(14 + rands(0, 5, 1, i)[0], scale = 0.05, twist = 50 - rands(0, 100, 1, seed = i + 1)[0])
|
||||
translate([0, 10, 0])
|
||||
circle(3.5, $fn = 6);
|
||||
}
|
||||
|
||||
for(i = [0:35]) {
|
||||
rotate(i * 10)
|
||||
translate([0, -10, 0])
|
||||
rotate([2, 0, 0])
|
||||
linear_extrude(16 + rands(0, 5, 1, i)[0], scale = 0.05, twist = 50 - rands(0, 100, 1, seed = i + 2)[0])
|
||||
translate([0, 10, 0])
|
||||
circle(3.5, $fn = 5);
|
||||
}
|
||||
}
|
||||
|
||||
module one_horn() {
|
||||
translate([-9, -4, -2])
|
||||
rotate([45, -25, 0])
|
||||
linear_extrude(27.5, scale = 0.1, twist = -90)
|
||||
translate([7.5, 0, 0])
|
||||
circle(3, $fn = 4);
|
||||
}
|
||||
|
||||
module mouth() {
|
||||
path1 = curve(0.4, [[0, -8, -1], [0, -11, .25], [0, -12, 5], [0, -9, 5], [0, -4, 6], [0, -0.5, 8], [0, 5, 6.5], [0, 8, 6], [0, 12, 1], [0, 16, 0]]);
|
||||
path2 = [for(p = path1) ptf_rotate(p, [0, -12, 0]) * 0.9 + [-2, 0, 0]];
|
||||
path3 = [for(i = [0:len(path1) - 1]) [-i / 6 - 1.5, i / 1.65 - 9, 0]];
|
||||
path4 = [for(p = path3) [-p[0], p[1], p[2]]];
|
||||
path5 = [for(p = path2) [-p[0], p[1], p[2]]];
|
||||
|
||||
translate([0, 0, -2])
|
||||
rotate([90, 0, -90])
|
||||
sweep(rails2sections([path1, path2, path3, path4, path5]));
|
||||
|
||||
translate([0, 0, -3.25])
|
||||
rotate([90, 0, -90])
|
||||
ellipse_extrude(5.5, slices = 2)
|
||||
polygon(
|
||||
shape_trapezium([5, 18],
|
||||
h = 20,
|
||||
corner_r = 2, $fn = 4)
|
||||
);
|
||||
|
||||
scale([1.5, 1, 1])
|
||||
intersection() {
|
||||
mirror([1, 0, 0])
|
||||
translate([0, 0, -2.25])
|
||||
rotate([85, 0, -90])
|
||||
ellipse_extrude(4, slices = 2)
|
||||
polygon(
|
||||
shape_trapezium([5, 18],
|
||||
h = 20,
|
||||
corner_r = 2, $fn = 5)
|
||||
);
|
||||
|
||||
|
||||
jpath1 = curve(0.4, [[-10, 16], [0, 8], [4, 5], [3, 0], [2, -5], [2, -10], [0, -13.5], [-3, -14]]);
|
||||
rotate([90, -4, 0])
|
||||
linear_extrude(25, center = true)
|
||||
polygon(jpath1);
|
||||
}
|
||||
|
||||
translate([0, -2.5, -11])
|
||||
rotate([0, 95, 0])
|
||||
linear_extrude(1.4, scale = 0.1)
|
||||
translate([.4, 0, 0])
|
||||
circle(.5, $fn = 6);
|
||||
|
||||
translate([0, 2.5, -11])
|
||||
rotate([0, 95, 0])
|
||||
linear_extrude(1.5, scale = 0.1)
|
||||
translate([.4, 0, 0])
|
||||
circle(.5, $fn = 6);
|
||||
}
|
||||
|
||||
module one_eye() {
|
||||
translate([-5, 2.5, -2])
|
||||
rotate([-5, -8, -10])
|
||||
scale([1, 1, 1.75])
|
||||
sphere(1.75, $fn = 6);
|
||||
|
||||
translate([-5.1, 3.75, -2.25])
|
||||
rotate([-25, 0, 75])
|
||||
sphere(0.65, $fn = 6);
|
||||
}
|
||||
|
||||
module one_beard() {
|
||||
translate([-10, -12, -10])
|
||||
rotate(180)
|
||||
linear_extrude(8, scale = 0.15, twist = 35)
|
||||
translate([-9, -10, 0])
|
||||
circle(1, $fn = 8);
|
||||
}
|
||||
// mouth();
|
||||
rotate([0, 15, 0])
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,50 +1,8 @@
|
||||
use <bezier_curve.scad>;
|
||||
use <ellipse_extrude.scad>;
|
||||
use <path_extrude.scad>;
|
||||
use <shape_circle.scad>;
|
||||
use <torus_knot.scad>;
|
||||
use <util/reverse.scad>;
|
||||
|
||||
torus_knot_dragon();
|
||||
|
||||
module torus_knot_dragon() {
|
||||
phi_step = 0.04;
|
||||
|
||||
knot = torus_knot(2, 3, phi_step);
|
||||
dragon_body_path = reverse([for(i = [9:len(knot) - 3]) knot[i]]);
|
||||
|
||||
body_shape = concat(
|
||||
bezier_curve(0.25,
|
||||
[
|
||||
[30, -35], [16, 0], [4, 13],
|
||||
[3, -5], [0, 26], [-3, -5],
|
||||
[-4, 13], [-16, 0], [-30, -35]
|
||||
]
|
||||
),
|
||||
bezier_curve(0.25,
|
||||
[[-22, -35], [-15, -45], [0, -55], [15, -45], [22, -35]]
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
pts = [for(p = body_shape) p * 0.015];
|
||||
p = dragon_body_path[0];
|
||||
|
||||
path_extrude(pts, concat([p + [0.00001, 0.0000055, 0.000008]], dragon_body_path), scale = 0.9);
|
||||
|
||||
translate([2.975, -0.75, -0.75])
|
||||
scale(0.01825)
|
||||
rotate([-52, -9, -25])
|
||||
dragon_head();
|
||||
|
||||
translate([1.84, 1.635, -0.885])
|
||||
rotate([104.95, -154.35, 66.25])
|
||||
ellipse_extrude(1.2, slices = 7, twist = 15)
|
||||
scale(0.9 * 0.0150)
|
||||
polygon(body_shape);
|
||||
}
|
||||
|
||||
module dragon_head() {
|
||||
module dragon_head_low_poly() {
|
||||
module palate() {
|
||||
t_step = 0.15;
|
||||
|