2021-06-30 10:57:02 +08:00
# sf_solidifyT
It solidifies two surfaces with triangular mesh.
**Since:** 3.1
## Parameters
- `points1` : A list of `[x, y, z]` s.
- `points2` : A list of `[x, y, z]` s.
- `triangles` : Determine which points are connected by an edge. All triangles have points in the same direction, counter-clockwise. See examples below.
## Examples
use < triangle / tri_delaunay . scad > ;
use < surface / sf_solidifyT . scad > ;
points = [for(i = [0:50]) rands(-300, 300, 2)];
triangles = tri_delaunay(points);
2021-12-04 12:16:20 +08:00
pts = [for(p = points) [p.x, p.y, rands(100, 150, 1)[0]]];
pts2 = [for(p = pts) [p.x, p.y, p.z - 100]];
2021-06-30 10:57:02 +08:00
sf_solidifyT(pts, pts2, triangles = triangles);
![sf_solidifyT ](images/lib3x-sf_solidifyT-1.JPG )
use < triangle / tri_delaunay . scad > ;
use < surface / sf_solidifyT . scad > ;
thickness = .2;
2022-04-06 17:44:11 +08:00
a_step = 15;
2021-06-30 10:57:02 +08:00
r_step = 0.2;
scale = 100;
2022-04-06 17:44:11 +08:00
function f(x, y) = (y ^ 2 - x ^ 2) / 4;
2021-06-30 10:57:02 +08:00
pts2d = [
2022-04-06 17:44:11 +08:00
for(a = [a_step:a_step:360], r = [r_step:r_step:2])
let(
x = r * cos(a),
y = r * sin(a)
)
[x, y]
2021-06-30 10:57:02 +08:00
];
2021-12-04 12:16:20 +08:00
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]];
2021-06-30 10:57:02 +08:00
triangles = tri_delaunay(pts2d);
sf_solidifyT(points1, points2, triangles);
![sf_solidifyT ](images/lib3x-sf_solidifyT-2.JPG )