1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-06 14:56:47 +02:00
This commit is contained in:
Justin Lin
2022-03-25 10:37:18 +08:00
parent 73c3e2d54c
commit cadbdc826d

View File

@@ -29,16 +29,15 @@ function _subdivide_project(points, faces, radius, detail) =
_tri_subdivide([for(i = face) points[i]], detail) _tri_subdivide([for(i = face) points[i]], detail)
], ],
flatten_points = [ flatten_points = [
for(pts_faces = subdivided_all) for(pts_faces = subdivided_all, p = pts_faces[0])
for(p = pts_faces[0]) p / norm(p) * radius
p / norm(p) * radius
], ],
pts_number_per_tri = len(subdivided_all[0][0]), pts_number_per_tri = len(subdivided_all[0][0]),
flatten_faces = [ flatten_faces = [
for(i = [0:len(subdivided_all) - 1]) for(i = [0:len(subdivided_all) - 1])
let(faces = subdivided_all[i][1]) let(faces = subdivided_all[i][1], off = [i, i, i] * pts_number_per_tri)
for(face = faces) for(face = faces)
face + [i, i, i] * pts_number_per_tri face + off
] ]
) )
[flatten_points, flatten_faces]; [flatten_points, flatten_faces];