mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-09-09 06:11:01 +02:00
added polytransversals
This commit is contained in:
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);
|
||||
}
|
||||
|
||||

|
Reference in New Issue
Block a user