...
 
Commits (2)
......@@ -11,3 +11,35 @@ type:
./compile.sh
check ./data folder for outgoing scad, txt and svg files
can add the contents of data/out.scad to tree.scad to see what the forest garden
plus property looks like.
Unless you have an extremely fast computer it would be prudent to first open
tree.scad in OpenSCAD and get out to a zoom where you can see the whole property
easily. Then copy paste the contents of out.scad to the end in the editor.
for example using
cat data/out.scad |xclip
Note you should double check the plants are suitable for your soil and hardyness
before buying, Plants for a future database is not infallible. You can also
update the sql file according to your preferences. Also some of the hardyness
set at 0 are not actually hardy in zone 0, but the pfaf people simply didn't
know the hardiness at time of entry, so they may need to be updated.
Another example the server.js script be default ignores (non nitrogen fixers) with
edibility Rating less than 3. So you may want to either lower that, or raise the
edibility rating of desirable plants higher than 3. For example the humble
Inkberry (Ilex glabra) is the only caffeine leaf bearing shrub in hardyness
zones 3-7 but by default it's edibility is only 1. Can raise that to three for
this evergreen tea/coffee substitue to be part of your edible food forest
garden.
TODO:
There is still much to be done, for instance splitting it into rows, so can
actually walk between the plants and harvest. Also if your property is not
completely flat you may need to make some adjustments to how you distribute your
plants. Every site has it's own specific needs. This is for generic
recommendations only. No warranty.
......@@ -26,8 +26,8 @@ const available = false;
const golden = 1.618;
const land_offset = 5;
const land_length = 200;
const land_width = 200;
const land_length = 100;
const land_width = 100;
//const max_height = 40;
//const crown_overlap = 0;//1-1/golden;
const emergent_height = [30,100]; /* >=, < meters */
......@@ -36,7 +36,7 @@ const tree_height = [5,15]; /* =>, < meters */
const shrub_height = [1.5,5]; /* =>, < meters */
const herb_height = [0.5,1.5]; /* =>, < meters */
const ground_cover_height = [0, 0.5]; /* =>, < meters */
const hardyness = 2;
const hardyness = 5;
const input_json = {
Hardyness: hardyness,
......@@ -95,7 +95,11 @@ const input_json = {
]
};
const strict = true;
const strict = "true";
function derive_depth(height) {
return height; //height/Math.tan(0.4);
}
function check_available(config, plant) {
return config.available.filter((name) => {
......@@ -405,16 +409,12 @@ function fill_height_row(full_plant_list, height, row_length) {
return total;
}
function derive_depth(height) {
return height/Math.tan(0.4);
}
function row_to_SCAD(row_plants, direction) {
let row_fill = 0;
return row_plants.reduce((total, plant, index) => {
const depth = land_offset + derive_depth(plant.Height);
const radius = derive_radius(plant);
const overlap_reduction = plant.Height < 5? 2:
plant.Height > 10? -1/golden: 0;
const overlap_reduction = derive_overlap_reduction(plant.Height);
//const this_crown_overlap = crown_overlap - overlap_reduction;
const offset = plant.Height < 5 && index % 2 == 0? radius : 0;
const spacing = (radius + radius*overlap_reduction);
......
//!OpenSCAD
// tree
// trunk
trunk_ratio = 0.034;
module trunk(height, radius) {
color("Sienna", 1.0) {
cylinder(h=height, r=radius);
}
}
// canopy
module canopy(height, radius, canopy_height) {
color("green", 0.1) {
translate([0,0,height-canopy_height/2]) {
resize([radius*2, radius*2, canopy_height]) {
sphere(r=radius);
}
}
}
}
function m_to_mm(m) = m*1000;
module tree(height_in_m, width_in_m, x_loc, y_loc) {
translate ([m_to_mm(x_loc), m_to_mm(y_loc), 0]) {
canopy_height = height_in_m < width_in_m? height_in_m:
height_in_m < 5? width_in_m :
width_in_m > height_in_m*golden? height_in_m*golden :
height_in_m < 10? width_in_m :
height_in_m < 31? 10: 20;
trunk(m_to_mm(height_in_m), m_to_mm(width_in_m/2*trunk_ratio));
canopy(m_to_mm(height_in_m), m_to_mm(width_in_m/2),
m_to_mm(canopy_height));
}
}
/*
module line() {
tree(3,3,7,7);
tree(10,10,18.6,18.6);
tree(5,5,10.3,10.3);
tree(15,15,27,27);
tree(20,20,35,35);
tree(30,30,50,50);
}
module many_tree() {
}
many_tree(tree_array);
line();
mirror([0,0]) {
line();
}
*/
full_road_width = m_to_mm(3+1.3*2);
module road() {
// 3m wide
// 1.3m shoulder*2
road_width = m_to_mm(3);
translate([-full_road_width/2,0,0]){
color("wheat") {
cube([full_road_width, m_to_mm(100), 10], center=false);
}
}
translate([-road_width/2,0,0]){
color("lightgrey") {
cube([road_width, m_to_mm(100), 20], center=false);
}
}
}
full_path_width = m_to_mm(1.3*2);
path_width = m_to_mm(3);
module path() {
// 3m wide
// 1.3m shoulder*2
translate([0,-full_path_width/2,0]){
color("wheat") {
cube([m_to_mm(100), full_path_width, 10], center=false);
}
}
}
module slough (length, width, depth, offset) {
polyhedron (points=[[0,0,0],[0,length,0],[offset,length,-depth],
[offset,0,-depth],
[width,0,0],[width,length,0]],
faces=[[0,1,2,3],[1,5,6,2],[0,4,7,3],[0,1,5,4],[5,2,3,4]]);
}
slough_width = m_to_mm(3);
golden = 1.618;
module the_slough() {
length = m_to_mm(100)/golden;
width = slough_width;
depth = m_to_mm(1.06);
offset = m_to_mm(1.85);
color("cyan") {
translate([full_road_width/2,slough_width*3,0]) {
slough(length, width, depth, offset);
}
}
}
module green_field() {
translate([full_road_width/2, slough_width,0]) {
color("green",0.1) {
cube(size=[m_to_mm(48*2),m_to_mm(48*2),100], center=false);
}
}
}
module slough2() {
translate([0,-full_road_width/2+path_width/2,0]) {
mirror([1,0,0]) {
rotate([0,0,90]) {
the_slough();
}
}
}
}
module tinyhome() {
color("brown") {
translate([m_to_mm(100-61), m_to_mm(61), 0]) {
cube(size=[m_to_mm(2.5), m_to_mm(6), m_to_mm(3)], center=false);
}}
}
module person() {
color("blue") {
translate([m_to_mm(100-61), m_to_mm(58), m_to_mm(1)]) {
resize([m_to_mm(0.3), m_to_mm(0.7), m_to_mm(2)]){
sphere(d=m_to_mm(2));
}
}
}
}
module a_road(from, to, radius) {
fx=from[0];
fy=from[1];
tx=to[0];
ty=to[1];
polyhedron(points=
[[fx+radius,fy-radius,0],[fx-radius,fy-radius,0],
[tx-radius,ty+radius,0],[tx+radius,ty+radius,0],
[fx+radius,fy+radius,10],[fx-radius,fy-radius,10],
[tx+radius,ty+radius,10],[tx-radius,ty-radius,10]],
faces=[[0,3,2,1],[4,5,6,7],[0,1,4,5],[0,4,6,2],[1,5,7,3]]);
}
function m2mm(m)=m*1000;
a_road([m2mm(6),m2mm(5)],[m2mm(6),m2mm(100-6*2)], m2mm(0.6));
a_road([m2mm(6+5),m2mm(5)],[m2mm(6+5),m2mm(100)], m2mm(0.3));
a_road([m2mm(16),m2mm(5)],[m2mm(16),m2mm(100)], m2mm(0.6));
a_road([m2mm(6),m2mm(5)],[m2mm(100),m2mm(5)], m2mm(0.6));
a_road([m2mm(6),m2mm(11)],[m2mm(100),m2mm(11)], m2mm(0.3));
a_road([m2mm(6),m2mm(16)],[m2mm(100),m2mm(16)], m2mm(0.6));
road();
path();
the_slough();
green_field();
slough2();
tinyhome();
person();
// add lines from out.scad after