Technical green wall calculator and quantity taker | VineaGreen

Layout calculator and bill of quantities

Enter the desired wall dimensions, and the system will automatically generate a customized technical drawing and a complete list of components for ordering from VineaGreen.

Entering dimensions for the area

Total boxes for purchase

0 Crates
  • The calculation is based on 18 units in each box.
  • Height automatically adjusted to multiples of 25 cm.

Technical drawing (scale 1:10)

Waiting for data entry...

Full bill of quantities (BOM)

0 base units

© VineaGreen. All rights reserved.

"; svg.innerHTML = ''; return; } // Step 1: Logic - Fitting strictly INSIDE (Floor calculation) const cols = Math.floor(w / 40); const blocks25 = Math.floor(h / 25); const rows = blocks25 * 2; // Each 25cm block is 2 units of 12.5cm const finalW = cols * 40; const finalH = blocks25 * 25; const totalUnits = cols <= 0) { document.getElementById('statusLabel').innerText = "0"; document.getElementById('bomTable').innerText = "
Please enter larger area dimensions.
"; svg.innerHTML = ''; return; } // Step 2: Quantities for BOM const boxes = Math.ceil(totalUnits / 18); const passRubbers = (cols > 1) ? (cols - 1) * rows : 0; // Connections between units const plugRubbers = rows * 2; // Two ends per row (right and left) const topCaps = cols; // Caps on top of the uppermost units const sideCaps = blocks25; // One per 25cm block per side const totalUnits * 4; // Middle mounts holding 4 units each const25 * 2; sideBars + middleBars; // Total wall mounts needed // --- Box contents and Deficit Calculation --- const incBars = boxes * 12; const incSideCapsRight = boxes * 3; const incSideCapsLeft = boxes * 3; const incTopCaps = boxes * 3; const incPlugRubbers = boxes * 12; const incPassRubbers = boxes * 15; const incPots = boxes * 72; // 18 units * 4 pots per unit // Calculation of what is missing and needs to be ordered separately (does not go below 0) const misBars = Math.max(0, totalBars - incBars); const misSideCapsRight = Math.max(0, sideCaps - incSideCapsRight); const misSideCapsLeft = Math.max(0, sideCaps - incSideCapsLeft); const misTopCaps = Math.max(0, topCaps - incTopCaps); const misPlugRubbers = Math.max(0, plugRubbers - incPlugRubbers); const misPassRubbers = Math.max(0, passRubbers - incPassRubbers); const misPots = Math.max(0, totalPots - incPots); // --- Calculate the percentage of space utilization --- const fillPercentage = ((finalW * finalH) / (w * h) * 100).toFixed(1); // Step 3: Update UI document.getElementById('boxCountDisplay').innerText = boxes; document.getElementById('unitBadge').innerText = `${totalUnits} base units`; document.getElementById('statusLabel').innerHTML = `Execution dimensions: ${finalW}x${finalH} cm |  Space utilization: ${fillPercentage}%`; // Step 4: Generate BOM Rows const components = [ { name: 'Vinea Base Units (40x12.5 cm)', required: totalUnits, unit: 'יח\'' }, { name: 'Boxes (18 units per box)', required: boxes, unit: 'Boxes' }, { name: 'Flowerpots (4 per unit)', required: totalPots, included: incPots, missing: misPots, unit: 'יח\'', isAccessory: true }, { name: 'Connection Bars', required: totalBars, included: incBars, missing: misBars, unit: 'יח\'', isAccessory: true }, { name: 'Transition Rubbers (Horizontal Connection Between Units)', required: passRubbers, included: incPassRubbers, missing: misPassRubbers, unit: 'יח\'', isAccessory: true }, { name: 'Stopper Rubbers (End Closure - Two sides)', required: plugRubbers, included: incPlugRubbers, missing: misPlugRubbers, unit: 'יח\'', isAccessory: true }, { name: 'Top caps (top row cover)', required: topCaps, included: incTopCaps, missing: misTopCaps, unit: 'יח\'', isAccessory: true }, { name: 'Right side caps (per 25 cm height)', required: sideCaps, included: incSideCapsRight, missing: misSideCapsRight, unit: 'יח\'', isAccessory: true }, { name: 'Left side caps (per 25 cm height)', required: sideCaps, included: incSideCapsLeft, missing: misSideCapsLeft, unit: 'יח\'', isAccessory: true } ]; const table = document.getElementById('bomTable'); table.innerHTML = components.map(item => { let statusHtml = ''; // Display missing status for accessories if (item.isAccessory) { if (item.missing > 0) { statusHtml = `Missing to complete: ${item.missing}`; } else { statusHtml = `Sufficient quantity in boxes`; } } else if (item.isPlant) { statusHtml = `Order separately`; } return `
${item.name} ${item.isAccessory ? `Total required: ${item.required} | Included in boxes: ${item.included}` : ''}
${statusHtml} ${item.required} ${item.unit}
`; }).join(''); // Step 5: Render SVG renderLayout(cols, rows, blocks25, finalW, finalH, w, h); } function renderLayout(cols, rows, blocks25, fw, fh, origW, origH) { svg.innerHTML = ''; const scale = 2.0; const margin = 80; // enlarged to make room for the dimensions text const unitW = 40 * scale; const unitH = 12.5 * scale; // Set dynamic SVG size based on the LARGER of the two areas (original vs final) const drawW = Math.max(fw, origW) * scale; const drawH = Math.max(fh, origH) * scale; const totalSvgW = drawW + (margin * 2); const totalSvgH = drawH + (margin * 2); svg.setAttribute('viewBox', `0 0 ${totalSvgW} ${totalSvgH}`); svg.setAttribute('width', totalSvgW); svg.setAttribute('height', totalSvgH); // --- Calculate offset to center the green wall within the area --- const offsetX = (drawW - (fw * scale)) / 2; const offsetY = (drawH - (fh * scale)) / 2; const startX = margin + offsetX; const startY = margin + offsetY; // --- 1. Draw Original Wall Area (Background) --- const origRect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); origRect.setAttribute('x', margin); origRect.setAttribute('y', margin); origRect.setAttribute('width', origW * scale); origRect.setAttribute('height', origH * scale); origRect.setAttribute('fill', '#f3f4f6'); // very light gray origRect.setAttribute('stroke', '#9ca3af'); // gray dashed line origRect.setAttribute('stroke-dasharray', '8,8'); origRect.setAttribute('stroke-width', '2'); svg.appendChild(origRect); // Labels for Original Wall const lOrigW = document.createElementNS("http://www.w3.org/2000/svg", "text"); lOrigW.setAttribute('x', margin + (origW * scale) / 2); lOrigW.setAttribute('y', margin - 20); lOrigW.setAttribute('text-anchor', 'middle'); lOrigW.setAttribute('fill', '#6b7280'); lOrigW.setAttribute('font-size', '16'); lOrigW.textContent = `Original area: ${origW} cm`; svg.appendChild(lOrigW); const lOrigH = document.createElementNS("http://www.w3.org/2000/svg", "text"); lOrigH.setAttribute('x', margin - 20); lOrigH.setAttribute('y', margin + (origH * scale) / 2); lOrigH.setAttribute('text-anchor', 'middle'); lOrigH.setAttribute('font-size', '16'); lOrigH.setAttribute('rotate(-90, ${margin - 20})'); `${origH} cm`; svg.appendChild(lOrigH); // --- 2. Draw Base Units (Green Wall) --- for (let r = 0; r < rows; r++) { for (let c = 0; c < cols; c++) { const rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); rect.setAttribute('x', startX + (c * unitW)); rect.setAttribute('y', startY + (r * unitH)); rect.setAttribute('width', unitW); rect.setAttribute('height', unitH); // Alternating colors for visualization rect.setAttribute('fill', (r % 2 === 0) ? '#8bc34a' : '#7cb342'); rect.setAttribute('stroke', '#2d5a27'); rect.setAttribute('stroke-width', '1.5'); svg.appendChild(rect); // Add 4 Plants per unit const sectionW = unitW / 4; // Divide unit width into 4 equal parts for (let p = 0; p < 4; p++) { const plantGroup = document.createElementNS("http://www.w3.org/2000/svg", "g"); const cx = startX + (c * unitW) + (p * sectionW) + (sectionW / 2); const cy = startY + (r * unitH) + (unitH * 0.5); // Center vertically // Outer plant representation (dark green) const plantOuter = document.createElementNS("http://www.w3.org/2000/svg", "circle"); plantOuter.setAttribute('cx', cx); plantOuter.setAttribute('cy', cy); plantOuter.setAttribute('r', unitH * 0.35); plantOuter.setAttribute('fill', '#1a3617'); plantOuter.setAttribute('opacity', '0.6'); // Inner plant representation (vibrant green) const plantInner = document.createElementNS("http://www.w3.org/2000/svg", "circle"); plantInner.setAttribute('cx', cx); plantInner.setAttribute('cy', cy); plantInner.setAttribute('r', unitH * 0.15); plantInner.setAttribute('fill', '#cddc39'); plantGroup.appendChild(plantOuter); plantGroup.appendChild(plantInner); svg.appendChild(plantGroup); } // Add Top Cap indicator if (r === 0) { const cap = document.createElementNS("http://www.w3.org/2000/svg", "rect"); cap.setAttribute('x', startX + (c * unitW)); cap.setAttribute('y', startY - 5); cap.setAttribute('width', unitW); cap.setAttribute('height', '5'); cap.setAttribute('fill', '#2d5a27'); svg.appendChild(cap); } } } // Draw Wall Bars (Brackets) for (let b = 0; b < blocks25; b++) { const yCenter = startY + (b * (unitH * 2)) + unitH; // Center of the 2-unit block // Left Side Bar const lBar = document.createElementNS("http://www.w3.org/2000/svg", "rect"); lBar.setAttribute('x', startX - 15); lBar.setAttribute('y', yCenter - 10); lBar.setAttribute('width', '5'); lBar.setAttribute('height', '20'); lBar.setAttribute('fill', '#64748b'); // Slate-500 lBar.setAttribute('rx', '1'); svg.appendChild(lBar); // Right Side Bar const rBar = document.createElementNS("http://www.w3.org/2000/svg", "rect"); rBar.setAttribute('x', startX + (cols * unitW) + 10); rBar.setAttribute('y', yCenter - 10); rBar.setAttribute('width', '5'); rBar.setAttribute('height', '20'); rBar.setAttribute('fill', '#64748b'); // Slate-500 rBar.setAttribute('rx', '1'); svg.appendChild(rBar); // Middle Bars for (let c = 1; c < cols; c++) { const mBar = document.createElementNS("http://www.w3.org/2000/svg", "rect"); mBar.setAttribute('x', startX + (c * unitW) - 4); mBar.setAttribute('y', yCenter - 10); mBar.setAttribute('width', '8'); mBar.setAttribute('height', '20'); mBar.setAttribute('fill', '#64748b'); // Slate-500 mBar.setAttribute('rx', '2'); svg.appendChild(mBar); } } // Draw Side Caps (Every 25cm = 2 units) for (let b = 0; b < blocks25; b++) { const yPos = startY + (b * (unitH * 2)); // Left Side Cap const lCap = document.createElementNS("http://www.w3.org/2000/svg", "rect"); lCap.setAttribute('x', startX - 10); lCap.setAttribute('y', yPos); lCap.setAttribute('width', '10'); lCap.setAttribute('height', unitH * 2); lCap.setAttribute('fill', '#1a3617'); lCap.setAttribute('rx', '2'); svg.appendChild(lCap); // Right Side Cap const rCap = document.createElementNS("http://www.w3.org/2000/svg", "rect"); rCap.setAttribute('x', startX + (cols * unitW)); rCap.setAttribute('y', yPos); rCap.setAttribute('width', '10'); rCap.setAttribute('height', unitH * 2); rCap.setAttribute('fill', '#1a3617'); rCap.setAttribute('rx', '2'); svg.appendChild(rCap); } // --- 3. Labels for Final Green Wall Dimensions --- const lFinalW = document.createElementNS("http://www.w3.org/2000/svg", "text"); lFinalW.setAttribute('x', startX + (fw * scale) / 2); lFinalW.setAttribute('y', startY + (fh * scale) + 30); lFinalW.setAttribute('text-anchor', 'middle'); lFinalW.setAttribute('fill', '#2d5a27'); lFinalW.setAttribute('font-weight', 'bold'); lFinalW.setAttribute('font-size', '18'); lFinalW.textContent = `execution: ${fw} cm`; svg.appendChild(lFinalW); const lFinalH = document.createElementNS("http://www.w3.org/2000/svg", "text"); const lFinalHx = startX + (fw * scale) + 30; const lFinalHy = startY + (fh * scale) / 2; lFinalH.setAttribute('x', lFinalHx); lFinalH.setAttribute('y', 'middle'); lFinalH.setAttribute('font-weight', '18'); lFinalH.setAttribute('transform', ${lFinalHx} ${lFinalHy})`); lFinalH.textContent = `${fh} cm`; svg.appendChild(lFinalH); } // Attach Event Listeners btn.addEventListener('click', performCalculation); // Allow calculation on pressing Enter in inputs [wInput, hInput].forEach(inp => { inp.addEventListener('keypress', (e) => { if (e.key === 'Enter') performCalculation(); }); }); // Initialize empty state message on load document.getElementById('bomTable').innerHTML = "
Please enter dimensions and click Calculate to see the bill of quantities.
";