mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-10 16:54:23 +02:00
add sf_hull
This commit is contained in:
49
src/surface/sf_hull.scad
Normal file
49
src/surface/sf_hull.scad
Normal file
@@ -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) {
|
||||
|
||||
}
|
Reference in New Issue
Block a user