geändert: polyhaus.scad
fixed trigonometric functions fixed translation added DEBUG statements added comments
This commit is contained in:
parent
64d7ec6ace
commit
38a21e79cf
1 changed files with 131 additions and 56 deletions
179
polyhaus.scad
179
polyhaus.scad
|
|
@ -10,6 +10,9 @@ garagediameter=ringdiameter+2000;
|
||||||
garageheigth=4000;
|
garageheigth=4000;
|
||||||
sides=6;
|
sides=6;
|
||||||
|
|
||||||
|
outer_wall_woodwidth=50;
|
||||||
|
outer_wall_strawwidth=1000;
|
||||||
|
|
||||||
// The House Modules
|
// The House Modules
|
||||||
module ngon(
|
module ngon(
|
||||||
diameter=5,
|
diameter=5,
|
||||||
|
|
@ -45,11 +48,16 @@ module ring(
|
||||||
{
|
{
|
||||||
//do the math for the radii
|
//do the math for the radii
|
||||||
angle=(0.5*360/sides);
|
angle=(0.5*360/sides);
|
||||||
radius_in_circle=(asin(angle)*ringdiameter)-wallstrength;
|
radius_in_circle=(sin(angle)*ringdiameter)-wallstrength;
|
||||||
side_length=2*acos(0.5*360/sides)*radius_in_circle;
|
echo("DEBUG RING radius_in_circle");
|
||||||
radius_in_diameter=radius_in_circle/ asin(angle);
|
echo(radius_in_circle);
|
||||||
#
|
side_length=2*cos(0.5*360/sides)*radius_in_circle;
|
||||||
difference() {
|
echo("DEBUG RING side_length");
|
||||||
|
echo(side_length);
|
||||||
|
radius_in_diameter=radius_in_circle/ sin(angle);
|
||||||
|
echo("DEBUG RING radius_in_diameter");
|
||||||
|
echo(radius_in_diameter);
|
||||||
|
#difference() {
|
||||||
ngon(
|
ngon(
|
||||||
height=ringheigth,
|
height=ringheigth,
|
||||||
diameter=ringdiameter,
|
diameter=ringdiameter,
|
||||||
|
|
@ -74,11 +82,13 @@ module living(
|
||||||
{
|
{
|
||||||
|
|
||||||
angle=(0.5*360/sides);
|
angle=(0.5*360/sides);
|
||||||
radius_in_circle=(asin(angle)*ringdiameter)-wallstrength;
|
radius_in_circle=(sin(angle)*ringdiameter)-wallstrength;
|
||||||
radius_in_diameter=radius_in_circle/ asin(angle);
|
radius_in_diameter=radius_in_circle/ sin(angle);
|
||||||
side_length=2*acos(0.5*360/sides)*radius_in_circle;
|
side_length=2*acos(0.5*360/sides)*radius_in_circle;
|
||||||
#difference() {
|
#
|
||||||
|
difference() {
|
||||||
%ring();
|
%ring();
|
||||||
|
echo("DEBUG LIVING building inner ring");
|
||||||
translate([0,0,+floorstrength])
|
translate([0,0,+floorstrength])
|
||||||
ring(
|
ring(
|
||||||
ringdiameter=radius_in_diameter,
|
ringdiameter=radius_in_diameter,
|
||||||
|
|
@ -87,23 +97,32 @@ module living(
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outer_wall_woodwidth=50;
|
|
||||||
outer_wall_strawwidth=1000;
|
|
||||||
|
|
||||||
module spar(
|
module spar(
|
||||||
width,
|
spar_width,
|
||||||
depth,
|
spar_depth,
|
||||||
height
|
spar_height
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
echo("DEBUG SPAR creating spar");
|
||||||
|
echo("DEBUG SPAR spar vars");
|
||||||
|
echo(
|
||||||
|
spar_width,
|
||||||
|
spar_depth,
|
||||||
|
spar_height
|
||||||
|
);
|
||||||
|
|
||||||
translate(
|
translate(
|
||||||
[0.5*width,
|
[0.5*spar_width,
|
||||||
0.5*depth,
|
0.5*spar_depth,
|
||||||
0] )
|
0] )
|
||||||
cube(
|
cube(
|
||||||
width,
|
size=[
|
||||||
depth,
|
spar_width,
|
||||||
height
|
spar_depth,
|
||||||
|
spar_height
|
||||||
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -116,41 +135,76 @@ module outer_wall(
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
angle=0.5*360/sides;
|
angle=0.5*360/sides;
|
||||||
radius_in_circle=(asin(angle)*ringdiameter)-wallstrength;
|
echo("DEBUG angle");
|
||||||
side_length=2*acos(angle)*radius_in_circle;
|
echo(angle);
|
||||||
|
radius_in_circle=floor(
|
||||||
|
0.5*(sin(angle)*ringdiameter)-
|
||||||
|
wallstrength
|
||||||
|
);
|
||||||
|
echo("DEBUG radius_in_circle");
|
||||||
|
echo(radius_in_circle);
|
||||||
|
side_length=round(
|
||||||
|
2*cos(angle)*radius_in_circle
|
||||||
|
);
|
||||||
|
echo("DEBUG side_lenght");
|
||||||
|
echo(side_length);
|
||||||
elements=floor(side_length/(outer_wall_woodwidth+outer_wall_strawwidth));
|
elements=floor(side_length/(outer_wall_woodwidth+outer_wall_strawwidth));
|
||||||
|
echo("DEBUG elements");
|
||||||
|
echo(elements);
|
||||||
for(side=[1:sides] )
|
for(side=[1:sides] )
|
||||||
{
|
{
|
||||||
|
echo("DEBUG running through sides");
|
||||||
echo(side);
|
echo(side);
|
||||||
rotate(
|
rotate(
|
||||||
[0,0,2*angle]
|
[0,0,2*angle]
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
echo(" DEBUG OUTER WALL building spars")
|
||||||
if (elements%2==1)
|
if (elements%2==1)
|
||||||
{
|
{
|
||||||
echo("DEBUG uneven number");
|
echo("DEBUG uneven number");
|
||||||
// center the middle modeline
|
// center the middle modeline
|
||||||
for (spar= [0:elements])
|
for (spar= [0:elements])
|
||||||
{
|
{
|
||||||
offset= 0.5* outer_wall_strawwidth + spar*(outer_wall_woodwidth+outer_wall_strawwidth);
|
echo("DEBUG OUTER WALL planking");
|
||||||
translate (
|
echo("DEBUG OUTER WALL spar");
|
||||||
[
|
echo(spar);
|
||||||
0,
|
offset = (
|
||||||
radius_in_circle,
|
0.5* outer_wall_strawwidth +
|
||||||
offset
|
spar*(outer_wall_woodwidth +
|
||||||
] )
|
outer_wall_strawwidth)
|
||||||
spar(
|
);
|
||||||
width=outer_wall_woodwidth,
|
echo("DEBUG OUTER WALL offset for spar");
|
||||||
depth=wallstrength,
|
echo(offset);
|
||||||
height=level
|
echo("DEBUG OUTER WALL spar vars");
|
||||||
|
echo(
|
||||||
|
outer_wall_woodwidth,
|
||||||
|
wallstrength,
|
||||||
|
level
|
||||||
);
|
);
|
||||||
translate (
|
translate (
|
||||||
[
|
[
|
||||||
0,
|
0,
|
||||||
radius_in_circle,
|
offset,
|
||||||
-offset
|
radius_in_circle
|
||||||
] )
|
] )
|
||||||
spar();
|
spar(
|
||||||
|
spar_width=outer_wall_woodwidth,
|
||||||
|
spar_depth=wallstrength,
|
||||||
|
spar_height=level
|
||||||
|
);
|
||||||
|
translate (
|
||||||
|
[
|
||||||
|
0,
|
||||||
|
-offset,
|
||||||
|
radius_in_circle
|
||||||
|
] )
|
||||||
|
spar(
|
||||||
|
spar_width=outer_wall_woodwidth,
|
||||||
|
spar_depth=wallstrength,
|
||||||
|
spar_height=level
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (elements%2==0)
|
if (elements%2==0)
|
||||||
|
|
@ -159,31 +213,52 @@ module outer_wall(
|
||||||
// center the middle modeline
|
// center the middle modeline
|
||||||
for (spar= [0:elements])
|
for (spar= [0:elements])
|
||||||
{
|
{
|
||||||
offset= 0.5* outer_wall_strawwidth + spar*(outer_wall_woodwidth+outer_wall_strawwidth);
|
echo("DEBUG OUTER WALL planking");
|
||||||
translate (
|
echo("DEBUG OUTER WALL spar");
|
||||||
[0,
|
echo(spar);
|
||||||
radius_in_circle,
|
offset= (0.5* outer_wall_strawwidth +
|
||||||
offset] )
|
spar*(outer_wall_woodwidth+
|
||||||
spar(
|
outer_wall_strawwidth));
|
||||||
width=outer_wall_woodwidth,
|
echo("DEBUG OUTER WALL offset for spar");
|
||||||
depth=wallstrength,
|
echo(offset);
|
||||||
height=level
|
echo("DEBUG OUTER WALL spar vars");
|
||||||
|
echo(
|
||||||
|
outer_wall_woodwidth,
|
||||||
|
wallstrength,
|
||||||
|
level
|
||||||
);
|
);
|
||||||
|
// positive spar
|
||||||
translate (
|
translate (
|
||||||
[0,
|
[
|
||||||
radius_in_circle,
|
offset,
|
||||||
-offset
|
0,
|
||||||
|
radius_in_circle
|
||||||
] )
|
] )
|
||||||
spar();
|
spar(
|
||||||
|
spar_width=outer_wall_woodwidth,
|
||||||
|
spar_depth=wallstrength,
|
||||||
|
spar_height=level
|
||||||
|
);
|
||||||
|
// negative spar
|
||||||
|
translate (
|
||||||
|
[
|
||||||
|
-offset,
|
||||||
|
0,
|
||||||
|
radius_in_circle
|
||||||
|
] )
|
||||||
|
spar(
|
||||||
|
spar_width=outer_wall_woodwidth,
|
||||||
|
spar_depth=wallstrength,
|
||||||
|
spar_height=level
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//living();
|
living();
|
||||||
//translate([0,0,level]) living();
|
translate([0,0,level]) living();
|
||||||
//garage();
|
garage();
|
||||||
outer_wall();
|
outer_wall();
|
||||||
|
//ring();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue