1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-19 13:01:37 +02:00

create bottom

This commit is contained in:
Justin Lin
2021-09-19 09:32:37 +08:00
parent dcda61390c
commit 44165275e7

View File

@@ -7,20 +7,28 @@ use <polyhedron_hull.scad>;
use <util/every.scad>;
basket_radius = 40;
radius_in_plane = basket_radius / 1.25 / cos(36);
radius_in_plane = basket_radius;
n = 4;
line_diameter = 2;
bottom_radius = 8;
bottom_height = 3;
shell_random_threshold = 0.5; // 0 ~ 1
$fn = 4;
penrose_basket(basket_radius, radius_in_plane, n, line_diameter, shell_random_threshold);
module penrose_basket(basket_radius, radius_in_plane, n, line_diameter, shell_random_threshold) {
tris = tile_penrose3(n);
penrose_basket(basket_radius, radius_in_plane, n, line_diameter, bottom_radius, bottom_height, shell_random_threshold);
module penrose_basket(basket_radius, radius_in_plane, n, line_diameter, bottom_radius, bottom_height, shell_random_threshold) {
tris = [for(t = tile_penrose3(n)) t[1] * radius_in_plane];
for(t = tris) {
if(every(t[1], function(p) norm(p * radius_in_plane) < radius_in_plane * 1.25)) {
pts = [for(p = t[1] * radius_in_plane) ptf_c2sphere(p, basket_radius)];
if(every(t, function(p) norm(p) < radius_in_plane * 1.25)) {
pts = [
for(p = t)
let(cp = ptf_c2sphere(p, basket_radius))
norm(p) < bottom_radius ?
[cp[0], cp[1], -cp[2] + 2 * basket_radius - bottom_height * 2] :
cp
];
hull_polyline3d(
pts,