mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-20 05:21:38 +02:00
use for comp
This commit is contained in:
@@ -43,7 +43,7 @@ module sf_thickenT(points, thickness, triangles = undef, direction = "BOTH", con
|
|||||||
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];
|
tri = cnn_tris[search([mid], points)[0]][0];
|
||||||
nv = _face_normal([points[tri[0]], points[tri[1]], points[tri[2]]]);
|
nv = _face_normal([for(i = [0:2]) points[tri[i]]]);
|
||||||
off = dir_v * thickness;
|
off = dir_v * thickness;
|
||||||
pts = [for(p = points) p + off];
|
pts = [for(p = points) p + off];
|
||||||
|
|
||||||
@@ -60,11 +60,7 @@ module sf_thickenT(points, thickness, triangles = undef, direction = "BOTH", con
|
|||||||
let(
|
let(
|
||||||
normals = [
|
normals = [
|
||||||
for(tri = cnn_tris[i])
|
for(tri = cnn_tris[i])
|
||||||
_face_normal([
|
_face_normal([for(j = [0:2]) points[tri[j]]])
|
||||||
points[tri[0]],
|
|
||||||
points[tri[1]],
|
|
||||||
points[tri[2]]]
|
|
||||||
)
|
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
sum(normals) / len(normals)
|
sum(normals) / len(normals)
|
||||||
|
Reference in New Issue
Block a user