Many improvements
This commit is contained in:
+2
-3
@@ -1,7 +1,6 @@
|
||||
import { anchor } from "../lib/geometry.js";
|
||||
import { lotAssumedNorthClockwiseDegrees } from "./settings.js";
|
||||
|
||||
export const topLeftLotCorner = anchor(-100.89895832874616, 46.82679973173392, {
|
||||
assumedNorthClockwiseDegrees: lotAssumedNorthClockwiseDegrees,
|
||||
export const topLeftLotCorner = anchor(-100.898958, 46.826799, {
|
||||
assumedNorthClockwiseDegrees: -11.25,
|
||||
});
|
||||
export const lotCorner = topLeftLotCorner;
|
||||
@@ -1,11 +1,12 @@
|
||||
import * as geo from "../lib/geometry.js";
|
||||
import { Fence, LotBoundary } from "../lib/yard-features.js";
|
||||
import { lotCorner } from "./anchors.js";
|
||||
|
||||
const lotBoundary = new LotBoundary().trace([
|
||||
[-100.89895832874616, 46.82679973173392],
|
||||
[-100.89839320971627, 46.8268766687031],
|
||||
[-100.89835104203355, 46.82673956300183],
|
||||
[-100.89891868391628, 46.82666533836659],
|
||||
]);
|
||||
const lotBoundary = new LotBoundary()
|
||||
.add(geo.offset(lotCorner))
|
||||
.add(geo.offset(lotCorner), geo.east(geo.ft(144)))
|
||||
.add(geo.offset(lotCorner), geo.east(geo.ft(144)), geo.south(geo.ft(51)))
|
||||
.add(geo.offset(lotCorner), geo.south(geo.ft(51)));
|
||||
|
||||
const picketFence = new Fence("Short picket fence", {
|
||||
fenceType: "Short picket",
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
import * as geo from "../lib/geometry.js";
|
||||
import { defineGroup, YardGridLine } from "../lib/yard-features.js";
|
||||
import { lotCorner } from "./anchors.js";
|
||||
|
||||
const GRID_SPACING_FEET = 10;
|
||||
const MIN_EAST_FEET = -20;
|
||||
const MAX_EAST_FEET = 180;
|
||||
const MIN_NORTH_FEET = -140;
|
||||
const MAX_NORTH_FEET = 20;
|
||||
|
||||
export const yardGridGroup = defineGroup("group:yard-grid", "Yard Grid");
|
||||
|
||||
function localPoint(eastFeet, northFeet) {
|
||||
return geo.offset(
|
||||
lotCorner,
|
||||
geo.east(geo.ft(eastFeet)),
|
||||
northFeet >= 0 ? geo.north(geo.ft(northFeet)) : geo.south(geo.ft(Math.abs(northFeet))),
|
||||
);
|
||||
}
|
||||
|
||||
function makeNorthLine(eastFeet) {
|
||||
return new YardGridLine(`Grid east ${eastFeet} ft`, {
|
||||
axis: "north",
|
||||
offsetFeet: eastFeet,
|
||||
spacingFeet: GRID_SPACING_FEET,
|
||||
})
|
||||
.inGroup(yardGridGroup)
|
||||
.add(localPoint(eastFeet, MIN_NORTH_FEET))
|
||||
.add(localPoint(eastFeet, MAX_NORTH_FEET));
|
||||
}
|
||||
|
||||
function makeEastLine(northFeet) {
|
||||
return new YardGridLine(`Grid north ${northFeet} ft`, {
|
||||
axis: "east",
|
||||
offsetFeet: northFeet,
|
||||
spacingFeet: GRID_SPACING_FEET,
|
||||
})
|
||||
.inGroup(yardGridGroup)
|
||||
.add(localPoint(MIN_EAST_FEET, northFeet))
|
||||
.add(localPoint(MAX_EAST_FEET, northFeet));
|
||||
}
|
||||
|
||||
function rangeByFeet(minFeet, maxFeet, spacingFeet) {
|
||||
const values = [];
|
||||
|
||||
for (let value = minFeet; value <= maxFeet; value += spacingFeet) {
|
||||
values.push(value);
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
const northLines = rangeByFeet(MIN_EAST_FEET, MAX_EAST_FEET, GRID_SPACING_FEET).map(makeNorthLine);
|
||||
const eastLines = rangeByFeet(MIN_NORTH_FEET, MAX_NORTH_FEET, GRID_SPACING_FEET).map(makeEastLine);
|
||||
|
||||
export const gridFeatures = [...northLines, ...eastLines];
|
||||
export const gridGroups = [yardGridGroup];
|
||||
+30
-15
@@ -1,6 +1,6 @@
|
||||
import { defineGroup, FlowerBed, Tree } from "../lib/yard-features.js";
|
||||
import { east, ft, lngLat, offset } from "../lib/geometry.js";
|
||||
import { topLeftLotCorner } from "./anchors.js";
|
||||
import { Daylily, defineGroup, FlowerBed, Tree } from "../lib/yard-features.js";
|
||||
import * as geo from "../lib/geometry.js";
|
||||
import { lotCorner } from "./anchors.js";
|
||||
|
||||
export const juniperTreesGroup = defineGroup("group:juniper-trees", "Juniper Trees");
|
||||
|
||||
@@ -47,60 +47,75 @@ const flowerBeds = [
|
||||
]),
|
||||
];
|
||||
|
||||
const daylilies = [
|
||||
new Daylily("You Had Me At Merlot", {
|
||||
daylilyDatabaseId: "194128",
|
||||
daylilyDatabaseUrl: "https://daylilydatabase.org/detail.php?id=194128",
|
||||
}).add(geo.offset(lotCorner), geo.east(geo.ft(28)), geo.south(geo.ft(45))),
|
||||
new Daylily("Mapping North Dakota", {
|
||||
daylilyDatabaseId: "158640",
|
||||
daylilyDatabaseUrl: "https://daylilydatabase.org/detail.php?id=158640",
|
||||
}).add(geo.offset(lotCorner), geo.east(geo.ft(28)), geo.south(geo.ft(47))),
|
||||
new Daylily("Daylily", {
|
||||
daylilyDatabaseId: "",
|
||||
daylilyDatabaseUrl: "",
|
||||
}).add(geo.offset(lotCorner), geo.east(geo.ft(31)), geo.south(geo.ft(47))),
|
||||
];
|
||||
|
||||
const trees = [
|
||||
new Tree("Japanese Empress Elm", {
|
||||
species: "Japanese Empress Elm",
|
||||
canopyDiameterMeters: 6,
|
||||
heightMeters: 7,
|
||||
}).add(lngLat(-100.89889018162828, 46.82675624026659)),
|
||||
}).add(geo.offset(lotCorner), geo.east(geo.ft(9)), geo.south(geo.ft(16))),
|
||||
new Tree("Boulevard Linden", {
|
||||
species: "Boulevard Linden",
|
||||
canopyDiameterMeters: 3,
|
||||
heightMeters: 6,
|
||||
plantedDate: "2021-06-08",
|
||||
}).add(lngLat(-100.8990003556445, 46.826776648309774)),
|
||||
}).add(geo.lngLat(-100.8990003556445, 46.826776648309774)),
|
||||
new Tree("Boulevard Linden 2", {
|
||||
species: "Boulevard Linden",
|
||||
canopyDiameterMeters: 3,
|
||||
heightMeters: 6,
|
||||
}).add(lngLat(-100.89898269567485, 46.826709328342595)),
|
||||
}).add(geo.lngLat(-100.89898269567485, 46.826709328342595)),
|
||||
new Tree("Evergreen", {
|
||||
species: "Evergreen",
|
||||
canopyDiameterMeters: 8,
|
||||
heightMeters: 15,
|
||||
}).add(lngLat(-100.89888268258135, 46.826680107011924)),
|
||||
}).add(geo.lngLat(-100.89888268258135, 46.826680107011924)),
|
||||
new Tree("Medora Juniper 1", {
|
||||
species: "Medora Juniper",
|
||||
canopyDiameterMeters: 1.5,
|
||||
heightMeters: 2.5,
|
||||
}).inGroup(juniperTreesGroup).add(lngLat(-100.89880933964611, 46.826705259550664)),
|
||||
}).inGroup(juniperTreesGroup).add(geo.lngLat(-100.89880933964611, 46.826705259550664)),
|
||||
new Tree("Medora Juniper 2", {
|
||||
species: "Medora Juniper",
|
||||
canopyDiameterMeters: 1.5,
|
||||
heightMeters: 2.5,
|
||||
}).inGroup(juniperTreesGroup).add(lngLat(-100.89877004677517, 46.82670396593881)),
|
||||
}).inGroup(juniperTreesGroup).add(geo.lngLat(-100.89877004677517, 46.82670396593881)),
|
||||
new Tree("Medora Juniper 3", {
|
||||
species: "Medora Juniper",
|
||||
canopyDiameterMeters: 1.5,
|
||||
heightMeters: 2.5,
|
||||
}).inGroup(juniperTreesGroup).add(lngLat(-100.898799106227, 46.82669830398086)),
|
||||
}).inGroup(juniperTreesGroup).add(geo.lngLat(-100.898799106227, 46.82669830398086)),
|
||||
new Tree("Medora Juniper 4", {
|
||||
species: "Medora Juniper",
|
||||
canopyDiameterMeters: 1.5,
|
||||
heightMeters: 2.5,
|
||||
}).inGroup(juniperTreesGroup).add(lngLat(-100.89878871410515, 46.82669251034885)),
|
||||
}).inGroup(juniperTreesGroup).add(geo.lngLat(-100.89878871410515, 46.82669251034885)),
|
||||
new Tree("Medora Juniper 5", {
|
||||
species: "Medora Juniper",
|
||||
canopyDiameterMeters: 1.5,
|
||||
heightMeters: 2.5,
|
||||
}).inGroup(juniperTreesGroup).add(lngLat(-100.8987812086838, 46.82671120797719)),
|
||||
}).inGroup(juniperTreesGroup).add(geo.lngLat(-100.8987812086838, 46.82671120797719)),
|
||||
new Tree("Offset Test Tree", {
|
||||
species: "Test tree",
|
||||
canopyDiameterMeters: 4,
|
||||
heightMeters: 5,
|
||||
note: "70 feet east of top-left lot corner using assumedNorth",
|
||||
}).add(offset(topLeftLotCorner), east(ft(70))),
|
||||
}).add(geo.offset(lotCorner), geo.east(geo.ft(70))),
|
||||
];
|
||||
|
||||
export const plantFeatures = [...flowerBeds, ...trees];
|
||||
export const plantGroups = [juniperTreesGroup];
|
||||
export const plantFeatures = [...flowerBeds, ...daylilies, ...trees];
|
||||
export const plantGroups = [juniperTreesGroup];
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
export const lotAssumedNorthClockwiseDegrees = -11.25369719051117;
|
||||
+4
-1
@@ -1,6 +1,7 @@
|
||||
import { collectYardData } from "../lib/yard-features.js";
|
||||
import { boundaryFeatures } from "./boundaries.js";
|
||||
import { buildingFeatures, buildingGroups } from "./buildings.js";
|
||||
import { gridFeatures, gridGroups } from "./grid.js";
|
||||
import { irrigationFeatures } from "./irrigation.js";
|
||||
import { pavementFeatures } from "./pavement.js";
|
||||
import { plantFeatures, plantGroups } from "./plants.js";
|
||||
@@ -8,6 +9,7 @@ import { plantFeatures, plantGroups } from "./plants.js";
|
||||
export const yardGeoJSON = collectYardData(
|
||||
[
|
||||
...boundaryFeatures,
|
||||
...gridFeatures,
|
||||
...buildingFeatures,
|
||||
...pavementFeatures,
|
||||
...plantFeatures,
|
||||
@@ -15,6 +17,7 @@ export const yardGeoJSON = collectYardData(
|
||||
],
|
||||
[
|
||||
...buildingGroups,
|
||||
...gridGroups,
|
||||
...plantGroups,
|
||||
],
|
||||
);
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user