mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-15 11:14:17 +02:00
based on vertex normal
This commit is contained in:
@@ -41,8 +41,9 @@ module sf_thickenT(points, thickness, triangles = undef, direction = "BOTH", con
|
|||||||
if(is_list(direction)) {
|
if(is_list(direction)) {
|
||||||
dir_v = direction / norm(direction);
|
dir_v = direction / norm(direction);
|
||||||
mid = sorted(points)[leng_pts / 2];
|
mid = sorted(points)[leng_pts / 2];
|
||||||
tri = cnn_tris[search([mid], points)[0]][0];
|
tris = cnn_tris[search([mid], points)[0]];
|
||||||
nv = _face_normal([for(i = [2, 1, 0]) points[tri[i]]]); // OpenSCAD requires clockwise
|
nvs = [for(tri = tris) _face_normal([for(i = [2, 1, 0]) points[tri[i]]])]; // OpenSCAD requires clockwise
|
||||||
|
nv = sum(nvs) / len(nvs);
|
||||||
off = dir_v * thickness;
|
off = dir_v * thickness;
|
||||||
pts = [for(p = points) p + off];
|
pts = [for(p = points) p + off];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user