diff --git a/src/surface/sf_hull.scad b/src/surface/sf_hull.scad new file mode 100644 index 00000000..e46839fe --- /dev/null +++ b/src/surface/sf_hull.scad @@ -0,0 +1,49 @@ +module sf_hull(points, thickness) { + rows = len(points); + columns = len(points[0]); + + yi_range = [0:rows - 2]; + xi_range = [0:columns - 2]; + + half_thickness = thickness / 2; + + module hull_pts(tri) { + hull() { + translate(tri[0]) sphere(half_thickness); + translate(tri[1]) sphere(half_thickness); + translate(tri[2]) sphere(half_thickness); + } + } + + module tri_to_hull_faces(tri1, tri2) { + hull_pts(tri1); + hull_pts(tri2); + } + + twintri_lt = + [ + for(yi = yi_range) + for(xi = xi_range) + [ + [ + points[yi][xi], + points[yi][xi + 1], + points[yi + 1][xi] + ], + [ + points[yi + 1][xi], + points[yi][xi + 1], + points[yi + 1][xi + 1] + ] + ] + ]; + + for(twintri = twintri_lt) { + tri_to_hull_faces(twintri[0], twintri[1]); + } +} + +// override it to test +module test_function_grapher_faces(points, faces) { + +} \ No newline at end of file