mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-10 16:54:23 +02:00
refactor
This commit is contained in:
@@ -5,6 +5,7 @@ use <pp/pp_poisson2.scad>
|
|||||||
|
|
||||||
radius = 20;
|
radius = 20;
|
||||||
$fn = 6; // multiples of 6
|
$fn = 6; // multiples of 6
|
||||||
|
model = "DOLL"; // [DOLL, EYES]
|
||||||
|
|
||||||
if($preview) {
|
if($preview) {
|
||||||
points = pp_poisson2([150, 150], radius * 2.25);
|
points = pp_poisson2([150, 150], radius * 2.25);
|
||||||
@@ -26,16 +27,7 @@ module tetrapod_doll() {
|
|||||||
atan2(v.y, v.x)
|
atan2(v.y, v.x)
|
||||||
];
|
];
|
||||||
|
|
||||||
module eye() {
|
module doll() {
|
||||||
color("white")
|
|
||||||
difference() {
|
|
||||||
translate([radius / 5.75 / 2, 0, 0])
|
|
||||||
sphere(radius / 5.75, $fn = 48);
|
|
||||||
translate([-radius / 2, 0, 0])
|
|
||||||
cube(radius, center = true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
vertices = geom_tetrahedron(radius = radius)[0];
|
vertices = geom_tetrahedron(radius = radius)[0];
|
||||||
|
|
||||||
ayz = __angy_angz(vertices[0], [0, 0, 0]);
|
ayz = __angy_angz(vertices[0], [0, 0, 0]);
|
||||||
@@ -66,8 +58,21 @@ module tetrapod_doll() {
|
|||||||
scale(1.05)
|
scale(1.05)
|
||||||
eye();
|
eye();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module eye() {
|
||||||
|
color("white")
|
||||||
|
difference() {
|
||||||
|
translate([radius / 5.75 / 2, 0, 0])
|
||||||
|
sphere(radius / 5.75, $fn = 48);
|
||||||
|
translate([-radius / 2, 0, 0])
|
||||||
|
cube(radius, center = true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if($preview) {
|
if($preview) {
|
||||||
|
doll();
|
||||||
|
|
||||||
rotate(40)
|
rotate(40)
|
||||||
translate([radius * .2, 0, radius * .6])
|
translate([radius * .2, 0, radius * .6])
|
||||||
eye();
|
eye();
|
||||||
@@ -88,6 +93,10 @@ module tetrapod_doll() {
|
|||||||
translate([radius / 5, 0, 0])
|
translate([radius / 5, 0, 0])
|
||||||
sphere(radius / 5.75 / 2, $fn = 48);
|
sphere(radius / 5.75 / 2, $fn = 48);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if(model == "DOLL") {
|
||||||
|
doll();
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
translate([radius, 0, 0])
|
translate([radius, 0, 0])
|
||||||
rotate([0, -90, 0])
|
rotate([0, -90, 0])
|
||||||
@@ -97,4 +106,5 @@ module tetrapod_doll() {
|
|||||||
rotate([0, -90, 0])
|
rotate([0, -90, 0])
|
||||||
eye();
|
eye();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user