mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-04-13 02:31:58 +02:00
added polytransversals
This commit is contained in:
parent
aea69f60db
commit
96c1e517d6
@ -32,6 +32,7 @@ Some modules may depend on other modules. For example, the `polyline2d` module d
|
||||
- [circular_sector](https://openhome.cc/eGossip/OpenSCAD/lib-circular_sector.html)
|
||||
- [arc](https://openhome.cc/eGossip/OpenSCAD/lib-arc.html)
|
||||
- [hexagons](https://openhome.cc/eGossip/OpenSCAD/lib-hexagons.html)
|
||||
- [polytransversals](https://openhome.cc/eGossip/OpenSCAD/lib-polytransversals.html)
|
||||
|
||||
- 3D
|
||||
- [rounded_cube](https://openhome.cc/eGossip/OpenSCAD/lib-rounded_cube.html)
|
||||
|
BIN
docs/images/lib-polytransversals-1.JPG
Normal file
BIN
docs/images/lib-polytransversals-1.JPG
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
BIN
docs/images/lib-polytransversals-2.JPG
Normal file
BIN
docs/images/lib-polytransversals-2.JPG
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
BIN
docs/images/lib-polytransversals-3.JPG
Normal file
BIN
docs/images/lib-polytransversals-3.JPG
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
42
docs/lib-polytransversals.md
Normal file
42
docs/lib-polytransversals.md
Normal file
@ -0,0 +1,42 @@
|
||||
# polytransversals
|
||||
|
||||
Crosscutting a polyline at different points gets several transversals. This module can operate reversely. It uses transversals to construct a polyline. For example, imagine that you have the following transversals:
|
||||
|
||||

|
||||
|
||||
This module can use them to construct the polyline:
|
||||
|
||||

|
||||
|
||||
When using this module, you should use points to represent each transversal.
|
||||
|
||||
You can view it as a better polyline2d module. If you have only the points of a path, using `polyline2d` or `hull_polyline2d` is a simple solution. If you know the transversals along a path, you can use `polytransversals` to get a better polyline.
|
||||
|
||||
## Parameters
|
||||
|
||||
- `transversals` : A list of transversals. Each transversal is represented by a list of points. See the example below.
|
||||
|
||||
## Examples
|
||||
|
||||
include <rotate_p.scad>;
|
||||
include <polytransversals.scad>;
|
||||
include <hull_polyline2d.scad>;
|
||||
|
||||
r = 35;
|
||||
tran_pts = [[-5, 0], [0, 5], [5, 0]];
|
||||
|
||||
trans = [
|
||||
for(a = [0:10:120])
|
||||
[
|
||||
for(p = tran_pts)
|
||||
rotate_p(p, [0, 0, a]) + [r * cos(a), r * sin(a)]
|
||||
]
|
||||
];
|
||||
|
||||
polytransversals(trans);
|
||||
|
||||
#for(tran = trans) {
|
||||
hull_polyline2d(tran, 0.5);
|
||||
}
|
||||
|
||||

|
@ -3,7 +3,6 @@
|
||||
*
|
||||
* Crosscutting a polyline at different points gets several transversals.
|
||||
* This module can operate reversely. It uses transversals to construct a polyline.
|
||||
*
|
||||
* @copyright Justin Lin, 2017
|
||||
* @license https://opensource.org/licenses/lgpl-3.0.html
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user