{"id":2353,"date":"2026-05-08T11:57:54","date_gmt":"2026-05-08T04:57:54","guid":{"rendered":"https:\/\/www.hedwigus.com\/?p=2353"},"modified":"2026-05-08T15:55:38","modified_gmt":"2026-05-08T08:55:38","slug":"plywood-cutting-template","status":"publish","type":"post","link":"https:\/\/www.hedwigus.com\/index.php\/2026\/05\/08\/plywood-cutting-template\/","title":{"rendered":"Plywood Cutting Template"},"content":{"rendered":"\n<p><a href=\"https:\/\/www.hedwigus.com\/plywood.php\">https:\/\/www.hedwigus.com\/plywood.php<\/a><\/p>\n\n\n\n<p>Sebagai penggiat woodworking, tentu saja saya butuh sebuah tools untuk membuat pola potong di lembar plywood atau triplek. Tujuannya agar pemotongan lebih efisien dan tidak menyisakan lembar plywood yang mubazir, jadi bisa menghemat biaya.<\/p>\n\n\n\n<p>Sebelumnya saya menggambar pola langsung di plywood sebelum dipotong, dan ternyata proses demikian tidak terlalu efektif dan ada saja bagian yang tertinggal dan tidak ada lagi ruang di plywood yang dapat digunakan karena terlalu kecil (panjan atau lebar yang kurang). Dengan sedikit coding dan dibantu AI, saya coba buatkan sebuah tools untuk merencanakan pola potong terlebih dahulu, sehingga kita dapat membayangkan bagian-bagian yang akan kita potong sudah efisien dan tidak terlalu banyak bagian yang terbuang.<\/p>\n\n\n\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <style>\n        #body { font-family: sans-serif; margin: 20px; background: #f4f4f4; }\n        .container { display: flex; gap: 20px; }\n        .controls { background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); min-width: 300px; }\n        canvas { background: white; border: 2px solid #333; box-shadow: 0 2px 10px rgba(0,0,0,0.2); }\n        input { width: 60px; margin-bottom: 10px; }\n        button { background: #2ecc71; color: white; border: none; padding: 10px; cursor: pointer; width: 100%; border-radius: 4px; }\n        button:hover { background: #27ae60; }\n        label { display: inline-block; width: 120px; font-size: 0.9em; }\n        .piece-row { border-bottom: 1px solid #eee; padding: 5px 0; }\n    <\/style>\n<\/head>\n<body>\n\n    <h3>Plywood Cutting Optimizer<\/h3>\n\n    <div class=\"container\">\n        <div class=\"controls\">\n            <h3>Plywood Setting (cm)<\/h3>\n            <label>Sheet Width:<\/label> <input type=\"number\" id=\"sheetW\" value=\"120\"><br>\n            <label>Sheet Height:<\/label> <input type=\"number\" id=\"sheetH\" value=\"240\"><br>\n            <label>Blade:<\/label> <input type=\"number\" id=\"kerf\" value=\"0.4\" step=\"0.1\"><br>\n            \n            <h3>Pieces to Cut<\/h3>\n            <div id=\"pieceInputs\">\n                <div class=\"piece-row\">\n                    W: <input type=\"number\" class=\"pW\" value=\"40\"> \n                    H: <input type=\"number\" class=\"pH\" value=\"60\"> \n                    Qty: <input type=\"number\" class=\"pN\" value=\"4\">\n                <\/div>\n            <\/div>\n            <button onclick=\"addPieceRow()\" style=\"background:#3498db; margin-bottom:10px;\">+ Add Piece Type<\/button>\n            <button onclick=\"calculateLayout()\">Generate Template<\/button>\n        <\/div>\n\n        <div>\n            <canvas id=\"cutCanvas\"><\/canvas>\n        <\/div>\n    <\/div>\n\n<script>\nfunction addPieceRow() {\n    const div = document.createElement('div');\n    div.className = 'piece-row';\n    div.innerHTML = `W: <input type=\"number\" class=\"pW\" value=\"30\"> \n                     H: <input type=\"number\" class=\"pH\" value=\"30\"> \n                     Qty: <input type=\"number\" class=\"pN\" value=\"1\">`;\n    document.getElementById('pieceInputs').appendChild(div);\n}\n\nfunction calculateLayout() {\n    const sheetW = parseFloat(document.getElementById('sheetW').value);\n    const sheetH = parseFloat(document.getElementById('sheetH').value);\n    const kerf = parseFloat(document.getElementById('kerf').value);\n    \n    \/\/ Collect pieces from inputs\n    let allPieces = [];\n    const ws = document.querySelectorAll('.pW');\n    const hs = document.querySelectorAll('.pH');\n    const ns = document.querySelectorAll('.pN');\n\n    for(let i=0; i < ws.length; i++) {\n        let w = parseFloat(ws[i].value);\n        let h = parseFloat(hs[i].value);\n        let n = parseInt(ns[i].value);\n        for(let j=0; j < n; j++) {\n            \/\/ Normalize: Height is the larger dimension\n            let actualW = w < h ? w : h;\n            let actualH = w < h ? h : w;\n            allPieces.push({ w: actualW, h: actualH });\n        }\n    }\n\n    \/\/ Sort by height descending (Next-Fit Decreasing Height algorithm)\n    allPieces.sort((a, b) => b.h - a.h);\n\n    const canvas = document.getElementById('cutCanvas');\n    const ctx = canvas.getContext('2d');\n    \n    \/\/ Scale canvas to fit screen (approx 800px height)\n    const scale = 800 \/ sheetH;\n    canvas.width = sheetW * scale;\n    canvas.height = sheetH * scale;\n    \n    ctx.clearRect(0, 0, canvas.width, canvas.height);\n    ctx.scale(scale, scale);\n\n    let curX = 0;\n    let curY = 0;\n    let shelfH = 0;\n\n    allPieces.forEach(p => {\n        \/\/ If it doesn't fit horizontally, move to next shelf\n        if (curX + p.w > sheetW) {\n            curX = 0;\n            curY += shelfH + kerf;\n            shelfH = 0;\n        }\n\n        if (curY + p.h <= sheetH) {\n            \/\/ Draw piece\n            ctx.fillStyle = 'skyblue';\n            ctx.fillRect(curX, curY, p.w, p.h);\n            ctx.strokeStyle = '#2980b9';\n            ctx.lineWidth = 0.5;\n            ctx.strokeRect(curX, curY, p.w, p.h);\n\n            \/\/ Add text labels\n            ctx.fillStyle = 'black';\n            ctx.font = '4px Arial';\n            ctx.fillText(`${p.w}x${p.h}`, curX + 2, curY + p.h\/2);\n\n            shelfH = Math.max(shelfH, p.h);\n            curX += p.w + kerf;\n        } else {\n            console.warn(\"Piece too large to fit remaining space\");\n        }\n    });\n}\n\n\/\/ Initial Run\ncalculateLayout();\n<\/script>\n<\/body>\n<\/html>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/www.hedwigus.com\/plywood.php Sebagai penggiat woodworking, tentu saja saya butuh sebuah tools untuk membuat pola potong di lembar plywood atau triplek. Tujuannya agar pemotongan lebih efisien dan tidak menyisakan lembar plywood yang mubazir, jadi bisa menghemat biaya. Sebelumnya saya menggambar pola langsung di plywood sebelum dipotong, dan ternyata proses demikian tidak terlalu efektif dan ada saja bagian [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2358,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[17,138,87,1],"tags":[132,410,399,409,408],"class_list":["post-2353","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-challenge","category-hobby","category-personal","category-uncategorized","tag-ai","tag-bertukang","tag-coding","tag-plywood","tag-woodworkling","travel-monster-post","latest_post"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.hedwigus.com\/wp-content\/uploads\/2026\/05\/woodworking.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hedwigus.com\/index.php\/wp-json\/wp\/v2\/posts\/2353","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hedwigus.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hedwigus.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hedwigus.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hedwigus.com\/index.php\/wp-json\/wp\/v2\/comments?post=2353"}],"version-history":[{"count":9,"href":"https:\/\/www.hedwigus.com\/index.php\/wp-json\/wp\/v2\/posts\/2353\/revisions"}],"predecessor-version":[{"id":2367,"href":"https:\/\/www.hedwigus.com\/index.php\/wp-json\/wp\/v2\/posts\/2353\/revisions\/2367"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hedwigus.com\/index.php\/wp-json\/wp\/v2\/media\/2358"}],"wp:attachment":[{"href":"https:\/\/www.hedwigus.com\/index.php\/wp-json\/wp\/v2\/media?parent=2353"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hedwigus.com\/index.php\/wp-json\/wp\/v2\/categories?post=2353"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hedwigus.com\/index.php\/wp-json\/wp\/v2\/tags?post=2353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}