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
187
polyhaus.scad
187
polyhaus.scad
|
|
@ -10,6 +10,9 @@ garagediameter=ringdiameter+2000;
|
|||
garageheigth=4000;
|
||||
sides=6;
|
||||
|
||||
outer_wall_woodwidth=50;
|
||||
outer_wall_strawwidth=1000;
|
||||
|
||||
// The House Modules
|
||||
module ngon(
|
||||
diameter=5,
|
||||
|
|
@ -45,11 +48,16 @@ module ring(
|
|||
{
|
||||
//do the math for the radii
|
||||
angle=(0.5*360/sides);
|
||||
radius_in_circle=(asin(angle)*ringdiameter)-wallstrength;
|
||||
side_length=2*acos(0.5*360/sides)*radius_in_circle;
|
||||
radius_in_diameter=radius_in_circle/ asin(angle);
|
||||
#
|
||||
difference() {
|
||||
radius_in_circle=(sin(angle)*ringdiameter)-wallstrength;
|
||||
echo("DEBUG RING radius_in_circle");
|
||||
echo(radius_in_circle);
|
||||
side_length=2*cos(0.5*360/sides)*radius_in_circle;
|
||||
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(
|
||||
height=ringheigth,
|
||||
diameter=ringdiameter,
|
||||
|
|
@ -74,36 +82,47 @@ module living(
|
|||
{
|
||||
|
||||
angle=(0.5*360/sides);
|
||||
radius_in_circle=(asin(angle)*ringdiameter)-wallstrength;
|
||||
radius_in_diameter=radius_in_circle/ asin(angle);
|
||||
radius_in_circle=(sin(angle)*ringdiameter)-wallstrength;
|
||||
radius_in_diameter=radius_in_circle/ sin(angle);
|
||||
side_length=2*acos(0.5*360/sides)*radius_in_circle;
|
||||
#difference() {
|
||||
#
|
||||
difference() {
|
||||
%ring();
|
||||
echo("DEBUG LIVING building inner ring");
|
||||
translate([0,0,+floorstrength])
|
||||
ring(
|
||||
ringdiameter=radius_in_diameter,
|
||||
ringstrength=ringstrength-2*wallstrength,
|
||||
ringheigth=level-(floorstrength+ceilingstrength));
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
outer_wall_woodwidth=50;
|
||||
outer_wall_strawwidth=1000;
|
||||
|
||||
module spar(
|
||||
width,
|
||||
depth,
|
||||
height
|
||||
spar_width,
|
||||
spar_depth,
|
||||
spar_height
|
||||
)
|
||||
{
|
||||
echo("DEBUG SPAR creating spar");
|
||||
echo("DEBUG SPAR spar vars");
|
||||
echo(
|
||||
spar_width,
|
||||
spar_depth,
|
||||
spar_height
|
||||
);
|
||||
|
||||
translate(
|
||||
[0.5*width,
|
||||
0.5*depth,
|
||||
[0.5*spar_width,
|
||||
0.5*spar_depth,
|
||||
0] )
|
||||
cube(
|
||||
width,
|
||||
depth,
|
||||
height
|
||||
size=[
|
||||
spar_width,
|
||||
spar_depth,
|
||||
spar_height
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -116,41 +135,76 @@ module outer_wall(
|
|||
)
|
||||
{
|
||||
angle=0.5*360/sides;
|
||||
radius_in_circle=(asin(angle)*ringdiameter)-wallstrength;
|
||||
side_length=2*acos(angle)*radius_in_circle;
|
||||
echo("DEBUG angle");
|
||||
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));
|
||||
for (side=[1:sides] )
|
||||
echo("DEBUG elements");
|
||||
echo(elements);
|
||||
for(side=[1:sides] )
|
||||
{
|
||||
echo("DEBUG running through sides");
|
||||
echo(side);
|
||||
rotate(
|
||||
[0,0,2*angle]
|
||||
)
|
||||
{
|
||||
if (elements%2==1)
|
||||
{
|
||||
echo(" DEBUG OUTER WALL building spars")
|
||||
if (elements%2==1)
|
||||
{
|
||||
echo("DEBUG uneven number");
|
||||
// center the middle modeline
|
||||
for (spar= [0:elements])
|
||||
{
|
||||
offset= 0.5* outer_wall_strawwidth + spar*(outer_wall_woodwidth+outer_wall_strawwidth);
|
||||
translate (
|
||||
[
|
||||
0,
|
||||
radius_in_circle,
|
||||
offset
|
||||
] )
|
||||
spar(
|
||||
width=outer_wall_woodwidth,
|
||||
depth=wallstrength,
|
||||
height=level
|
||||
echo("DEBUG OUTER WALL planking");
|
||||
echo("DEBUG OUTER WALL spar");
|
||||
echo(spar);
|
||||
offset = (
|
||||
0.5* outer_wall_strawwidth +
|
||||
spar*(outer_wall_woodwidth +
|
||||
outer_wall_strawwidth)
|
||||
);
|
||||
echo("DEBUG OUTER WALL offset for spar");
|
||||
echo(offset);
|
||||
echo("DEBUG OUTER WALL spar vars");
|
||||
echo(
|
||||
outer_wall_woodwidth,
|
||||
wallstrength,
|
||||
level
|
||||
);
|
||||
translate (
|
||||
[
|
||||
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)
|
||||
|
|
@ -159,31 +213,52 @@ module outer_wall(
|
|||
// center the middle modeline
|
||||
for (spar= [0:elements])
|
||||
{
|
||||
offset= 0.5* outer_wall_strawwidth + spar*(outer_wall_woodwidth+outer_wall_strawwidth);
|
||||
translate (
|
||||
[0,
|
||||
radius_in_circle,
|
||||
offset] )
|
||||
spar(
|
||||
width=outer_wall_woodwidth,
|
||||
depth=wallstrength,
|
||||
height=level
|
||||
echo("DEBUG OUTER WALL planking");
|
||||
echo("DEBUG OUTER WALL spar");
|
||||
echo(spar);
|
||||
offset= (0.5* outer_wall_strawwidth +
|
||||
spar*(outer_wall_woodwidth+
|
||||
outer_wall_strawwidth));
|
||||
echo("DEBUG OUTER WALL offset for spar");
|
||||
echo(offset);
|
||||
echo("DEBUG OUTER WALL spar vars");
|
||||
echo(
|
||||
outer_wall_woodwidth,
|
||||
wallstrength,
|
||||
level
|
||||
);
|
||||
// positive spar
|
||||
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();
|
||||
//translate([0,0,level]) living();
|
||||
//garage();
|
||||
living();
|
||||
translate([0,0,level]) living();
|
||||
garage();
|
||||
outer_wall();
|
||||
|
||||
|
||||
//ring();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue