i18n
This commit is contained in:
1 parent
5dc977f9dd
commit
41987f8ea8
17 files changed
+1258
-210
No files matched your search
@@ -1,108 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="1400" height="1080" viewBox="0 0 1400 1080">
|
||||
<defs><pattern id="hachures" width="8" height="8" patternUnits="userSpaceOnUse" patternTransform="rotate(45)"><rect width="8" height="8" fill="#f1f3f5"/><line x1="0" y1="0" x2="0" y2="8" stroke="#adb5bd" stroke-width="1.5"/></pattern></defs>
|
||||
<rect width="1400" height="1080" fill="#ffffff"/>
|
||||
<line x1="700" y1="20" x2="700" y2="1060" stroke="#dee2e6" stroke-width="1.5"/>
|
||||
<line x1="20" y1="540" x2="1380" y2="540" stroke="#dee2e6" stroke-width="1.5"/>
|
||||
<text x="30" y="50" text-anchor="start" style="font-family:Arial,Helvetica,sans-serif;font-size:27.5px;font-weight:bold;fill:#343a40">1 Dimensions de la boîte</text>
|
||||
<polygon points="150,365 470,365 470,205 150,205" fill="#f1f3f5" stroke="#212529" stroke-width="2" stroke-linejoin="miter" />
|
||||
<polygon points="150,205 470,205 574.85,131.58 254.85,131.58" fill="#e9ecef" stroke="#212529" stroke-width="2" stroke-linejoin="miter" stroke-dasharray="7,5"/>
|
||||
<polygon points="470,365 574.85,291.58 574.85,131.58 470,205" fill="#dee2e6" stroke="#212529" stroke-width="2" stroke-linejoin="miter" />
|
||||
<text x="310" y="294.6" text-anchor="middle" style="font-family:Arial,Helvetica,sans-serif;font-size:20px;font-weight:normal;fill:#adb5bd">Avant</text>
|
||||
<text x="362.43" y="161.89" text-anchor="middle" style="font-family:Arial,Helvetica,sans-serif;font-size:20px;font-weight:normal;fill:#adb5bd">Couvercle</text>
|
||||
<polyline points="150,369 150,401" fill="none" stroke="#d9480f" stroke-width="1" stroke-linejoin="miter" stroke-dasharray="3,3"/>
|
||||
<polyline points="470,369 470,401" fill="none" stroke="#d9480f" stroke-width="1" stroke-linejoin="miter" stroke-dasharray="3,3"/>
|
||||
<polyline points="150,395 470,395" fill="none" stroke="#d9480f" stroke-width="1.6" stroke-linejoin="miter" />
|
||||
<polygon points="150,395 159,390.95 159,399.05" fill="#d9480f"/>
|
||||
<polygon points="470,395 461,399.05 461,390.95" fill="#d9480f"/>
|
||||
<text x="310" y="425" text-anchor="middle" style="font-family:Arial,Helvetica,sans-serif;font-size:21.25px;font-weight:bold;fill:#d9480f;paint-order:stroke;stroke:#ffffff;stroke-width:5px;stroke-linejoin:round">Longueur</text>
|
||||
<polyline points="472.29,368.28 492.94,397.77" fill="none" stroke="#d9480f" stroke-width="1" stroke-linejoin="miter" stroke-dasharray="3,3"/>
|
||||
<polyline points="577.15,294.86 597.79,324.35" fill="none" stroke="#d9480f" stroke-width="1" stroke-linejoin="miter" stroke-dasharray="3,3"/>
|
||||
<polyline points="489.5,392.85 594.35,319.43" fill="none" stroke="#d9480f" stroke-width="1.6" stroke-linejoin="miter" />
|
||||
<polygon points="489.5,392.85 494.55,384.37 499.2,391.01" fill="#d9480f"/>
|
||||
<polygon points="594.35,319.43 589.3,327.91 584.66,321.28" fill="#d9480f"/>
|
||||
<text x="573.47" y="408.7" text-anchor="middle" style="font-family:Arial,Helvetica,sans-serif;font-size:21.25px;font-weight:bold;fill:#d9480f;paint-order:stroke;stroke:#ffffff;stroke-width:5px;stroke-linejoin:round">Largeur</text>
|
||||
<polyline points="146,365 114,365" fill="none" stroke="#d9480f" stroke-width="1" stroke-linejoin="miter" stroke-dasharray="3,3"/>
|
||||
<polyline points="146,205 114,205" fill="none" stroke="#d9480f" stroke-width="1" stroke-linejoin="miter" stroke-dasharray="3,3"/>
|
||||
<polyline points="120,365 120,205" fill="none" stroke="#d9480f" stroke-width="1.6" stroke-linejoin="miter" />
|
||||
<polygon points="120,365 115.95,356 124.05,356" fill="#d9480f"/>
|
||||
<polygon points="120,205 124.05,214 115.95,214" fill="#d9480f"/>
|
||||
<text x="60" y="292.5" text-anchor="middle" style="font-family:Arial,Helvetica,sans-serif;font-size:21.25px;font-weight:bold;fill:#d9480f;paint-order:stroke;stroke:#ffffff;stroke-width:5px;stroke-linejoin:round">Hauteur</text>
|
||||
<text x="30" y="472.5" text-anchor="start" style="font-family:Arial,Helvetica,sans-serif;font-size:20px;font-weight:normal;fill:#343a40">Couvercle (pointillés) : « Boîte fermée ». Décochée : 5 pièces,</text>
|
||||
<text x="30" y="500" text-anchor="start" style="font-family:Arial,Helvetica,sans-serif;font-size:20px;font-weight:normal;fill:#343a40">bord haut des côtés droit. Minimum : 5 × l'épaisseur.</text>
|
||||
<text x="730" y="50" text-anchor="start" style="font-family:Arial,Helvetica,sans-serif;font-size:27.5px;font-weight:bold;fill:#343a40">2 Épaisseur et type de dimensions</text>
|
||||
<polygon points="850,150 880,150 880,370 850,370" fill="url(#hachures)" stroke="#212529" stroke-width="1.6" stroke-linejoin="miter" />
|
||||
<polygon points="1220,150 1250,150 1250,370 1220,370" fill="url(#hachures)" stroke="#212529" stroke-width="1.6" stroke-linejoin="miter" />
|
||||
<polygon points="850,340 1250,340 1250,370 850,370" fill="url(#hachures)" stroke="#212529" stroke-width="1.6" stroke-linejoin="miter" />
|
||||
<text x="1050" y="361" text-anchor="middle" style="font-family:Arial,Helvetica,sans-serif;font-size:18.75px;font-weight:normal;fill:#343a40;paint-order:stroke;stroke:#ffffff;stroke-width:5px;stroke-linejoin:round">Fond</text>
|
||||
<polyline points="850,146 850,86" fill="none" stroke="#d9480f" stroke-width="1" stroke-linejoin="miter" stroke-dasharray="3,3"/>
|
||||
<polyline points="1250,146 1250,86" fill="none" stroke="#d9480f" stroke-width="1" stroke-linejoin="miter" stroke-dasharray="3,3"/>
|
||||
<polyline points="850,92 1250,92" fill="none" stroke="#d9480f" stroke-width="1.6" stroke-linejoin="miter" />
|
||||
<polygon points="850,92 859,87.95 859,96.05" fill="#d9480f"/>
|
||||
<polygon points="1250,92 1241,96.05 1241,87.95" fill="#d9480f"/>
|
||||
<text x="1050" y="77" text-anchor="middle" style="font-family:Arial,Helvetica,sans-serif;font-size:21.25px;font-weight:bold;fill:#d9480f;paint-order:stroke;stroke:#ffffff;stroke-width:5px;stroke-linejoin:round">Extérieure</text>
|
||||
<polyline points="880,214 880,216" fill="none" stroke="#1971c2" stroke-width="1" stroke-linejoin="miter" stroke-dasharray="3,3"/>
|
||||
<polyline points="1220,214 1220,216" fill="none" stroke="#1971c2" stroke-width="1" stroke-linejoin="miter" stroke-dasharray="3,3"/>
|
||||
<polyline points="880,210 1220,210" fill="none" stroke="#1971c2" stroke-width="1.6" stroke-linejoin="miter" />
|
||||
<polygon points="880,210 889,205.95 889,214.05" fill="#1971c2"/>
|
||||
<polygon points="1220,210 1211,214.05 1211,205.95" fill="#1971c2"/>
|
||||
<text x="1050" y="240" text-anchor="middle" style="font-family:Arial,Helvetica,sans-serif;font-size:21.25px;font-weight:bold;fill:#1971c2;paint-order:stroke;stroke:#ffffff;stroke-width:5px;stroke-linejoin:round">Intérieure</text>
|
||||
<polyline points="1220,214 1220,216" fill="none" stroke="#d9480f" stroke-width="1" stroke-linejoin="miter" stroke-dasharray="3,3"/>
|
||||
<polyline points="1250,214 1250,216" fill="none" stroke="#d9480f" stroke-width="1" stroke-linejoin="miter" stroke-dasharray="3,3"/>
|
||||
<polyline points="1220,210 1250,210" fill="none" stroke="#d9480f" stroke-width="1.6" stroke-linejoin="miter" />
|
||||
<polygon points="1220,210 1229,205.95 1229,214.05" fill="#d9480f"/>
|
||||
<polygon points="1250,210 1241,214.05 1241,205.95" fill="#d9480f"/>
|
||||
<text x="1235" y="240" text-anchor="middle" style="font-family:Arial,Helvetica,sans-serif;font-size:21.25px;font-weight:bold;fill:#d9480f;paint-order:stroke;stroke:#ffffff;stroke-width:5px;stroke-linejoin:round"></text>
|
||||
<text x="1266" y="216" text-anchor="start" style="font-family:Arial,Helvetica,sans-serif;font-size:21.25px;font-weight:bold;fill:#d9480f;paint-order:stroke;stroke:#ffffff;stroke-width:5px;stroke-linejoin:round">Épaisseur</text>
|
||||
<text x="730" y="472.5" text-anchor="start" style="font-family:Arial,Helvetica,sans-serif;font-size:20px;font-weight:normal;fill:#343a40">Extérieures : cotes hors tout. Intérieures : l'extension ajoute</text>
|
||||
<text x="730" y="500" text-anchor="start" style="font-family:Arial,Helvetica,sans-serif;font-size:20px;font-weight:normal;fill:#343a40">2 épaisseurs (1 seule en hauteur si la boîte est ouverte).</text>
|
||||
<text x="30" y="590" text-anchor="start" style="font-family:Arial,Helvetica,sans-serif;font-size:27.5px;font-weight:bold;fill:#343a40">3 Largeur des créneaux</text>
|
||||
<polygon points="70,640 70,667.6 92.4,667.6 92.4,667.6 166,667.6 166,690 239.6,690 239.6,667.6 313.2,667.6 313.2,690 386.8,690 386.8,667.6 460.4,667.6 460.4,690 534,690 534,667.6 607.6,667.6 607.6,667.6 630,667.6 630,640" fill="#f8f9fa" stroke="#adb5bd" stroke-width="1.4" stroke-linejoin="miter" />
|
||||
<polygon points="70,890 70,740 92.4,740 92.4,740 166,740 166,762.4 239.6,762.4 239.6,740 313.2,740 313.2,762.4 386.8,762.4 386.8,740 460.4,740 460.4,762.4 534,762.4 534,740 607.6,740 607.6,740 630,740 630,890" fill="#f1f3f5" stroke="#212529" stroke-width="2" stroke-linejoin="miter" />
|
||||
<text x="642" y="670" text-anchor="start" style="font-family:Arial,Helvetica,sans-serif;font-size:18.75px;font-weight:normal;fill:#adb5bd;paint-order:stroke;stroke:#ffffff;stroke-width:5px;stroke-linejoin:round">Couvercle</text>
|
||||
<text x="642" y="800" text-anchor="start" style="font-family:Arial,Helvetica,sans-serif;font-size:18.75px;font-weight:normal;fill:#adb5bd;paint-order:stroke;stroke:#ffffff;stroke-width:5px;stroke-linejoin:round">Avant</text>
|
||||
<polyline points="386.8,744 386.8,796" fill="none" stroke="#d9480f" stroke-width="1" stroke-linejoin="miter" stroke-dasharray="3,3"/>
|
||||
<polyline points="460.4,744 460.4,796" fill="none" stroke="#d9480f" stroke-width="1" stroke-linejoin="miter" stroke-dasharray="3,3"/>
|
||||
<polyline points="386.8,790 460.4,790" fill="none" stroke="#d9480f" stroke-width="1.6" stroke-linejoin="miter" />
|
||||
<polygon points="386.8,790 395.8,785.95 395.8,794.05" fill="#d9480f"/>
|
||||
<polygon points="460.4,790 451.4,794.05 451.4,785.95" fill="#d9480f"/>
|
||||
<text x="423.6" y="822.5" text-anchor="middle" style="font-family:Arial,Helvetica,sans-serif;font-size:21.25px;font-weight:bold;fill:#d9480f;paint-order:stroke;stroke:#ffffff;stroke-width:5px;stroke-linejoin:round">Créneau</text>
|
||||
<polyline points="198.8,740 196.8,740" fill="none" stroke="#1971c2" stroke-width="1" stroke-linejoin="miter" stroke-dasharray="3,3"/>
|
||||
<polyline points="198.8,762.4 196.8,762.4" fill="none" stroke="#1971c2" stroke-width="1" stroke-linejoin="miter" stroke-dasharray="3,3"/>
|
||||
<polyline points="202.8,740 202.8,762.4" fill="none" stroke="#1971c2" stroke-width="1.6" stroke-linejoin="miter" />
|
||||
<polygon points="202.8,740 206.85,749 198.75,749" fill="#1971c2"/>
|
||||
<polygon points="202.8,762.4 198.75,753.4 206.85,753.4" fill="#1971c2"/>
|
||||
<text x="180.3" y="758.7" text-anchor="middle" style="font-family:Arial,Helvetica,sans-serif;font-size:21.25px;font-weight:bold;fill:#1971c2;paint-order:stroke;stroke:#ffffff;stroke-width:5px;stroke-linejoin:round"></text>
|
||||
<text x="202.8" y="790.4" text-anchor="middle" style="font-family:Arial,Helvetica,sans-serif;font-size:18.75px;font-weight:bold;fill:#1971c2;paint-order:stroke;stroke:#ffffff;stroke-width:5px;stroke-linejoin:round">Profondeur = épaisseur</text>
|
||||
<text x="30" y="1012.5" text-anchor="start" style="font-family:Arial,Helvetica,sans-serif;font-size:20px;font-weight:normal;fill:#343a40">0 = 3 × l'épaisseur. Largeur ajustée pour un nombre impair</text>
|
||||
<text x="30" y="1040" text-anchor="start" style="font-family:Arial,Helvetica,sans-serif;font-size:20px;font-weight:normal;fill:#343a40">de créneaux par bord (ici 7 sur l'avant).</text>
|
||||
<text x="730" y="590" text-anchor="start" style="font-family:Arial,Helvetica,sans-serif;font-size:27.5px;font-weight:bold;fill:#343a40">4 Compensation du kerf</text>
|
||||
<polygon points="850,772 958,772 958,700 1102,700 1102,772 1246,772 1246,934 850,934" fill="#f1f3f5" stroke="#343a40" stroke-width="1.6" stroke-linejoin="miter" stroke-dasharray="6,4"/>
|
||||
<polygon points="839.2,761.2 947.2,761.2 947.2,689.2 1112.8,689.2 1112.8,761.2 1256.8,761.2 1256.8,944.8 839.2,944.8" fill="none" stroke="#e03131" stroke-width="2.2" stroke-linejoin="miter" />
|
||||
<polyline points="958,704 958,706" fill="none" stroke="#d9480f" stroke-width="1" stroke-linejoin="miter" stroke-dasharray="3,3"/>
|
||||
<polyline points="1102,704 1102,706" fill="none" stroke="#d9480f" stroke-width="1" stroke-linejoin="miter" stroke-dasharray="3,3"/>
|
||||
<polyline points="958,700 1102,700" fill="none" stroke="#d9480f" stroke-width="1.6" stroke-linejoin="miter" />
|
||||
<polygon points="958,700 967,695.95 967,704.05" fill="#d9480f"/>
|
||||
<polygon points="1102,700 1093,704.05 1093,695.95" fill="#d9480f"/>
|
||||
<text x="1030" y="730" text-anchor="middle" style="font-family:Arial,Helvetica,sans-serif;font-size:21.25px;font-weight:bold;fill:#d9480f;paint-order:stroke;stroke:#ffffff;stroke-width:5px;stroke-linejoin:round"></text>
|
||||
<text x="1030" y="736" text-anchor="middle" style="font-family:Arial,Helvetica,sans-serif;font-size:18.75px;font-weight:bold;fill:#d9480f;paint-order:stroke;stroke:#ffffff;stroke-width:5px;stroke-linejoin:round">Créneau voulu</text>
|
||||
<polyline points="947.2,685.2 947.2,643.2" fill="none" stroke="#e03131" stroke-width="1" stroke-linejoin="miter" stroke-dasharray="3,3"/>
|
||||
<polyline points="1112.8,685.2 1112.8,643.2" fill="none" stroke="#e03131" stroke-width="1" stroke-linejoin="miter" stroke-dasharray="3,3"/>
|
||||
<polyline points="947.2,649.2 1112.8,649.2" fill="none" stroke="#e03131" stroke-width="1.6" stroke-linejoin="miter" />
|
||||
<polygon points="947.2,649.2 956.2,645.15 956.2,653.25" fill="#e03131"/>
|
||||
<polygon points="1112.8,649.2 1103.8,653.25 1103.8,645.15" fill="#e03131"/>
|
||||
<text x="1030" y="634.2" text-anchor="middle" style="font-family:Arial,Helvetica,sans-serif;font-size:20px;font-weight:bold;fill:#e03131;paint-order:stroke;stroke:#ffffff;stroke-width:5px;stroke-linejoin:round">Dessiné : créneau + kerf</text>
|
||||
<polyline points="1246,812 1246,814" fill="none" stroke="#1971c2" stroke-width="1" stroke-linejoin="miter" stroke-dasharray="3,3"/>
|
||||
<polyline points="1256.8,812 1256.8,814" fill="none" stroke="#1971c2" stroke-width="1" stroke-linejoin="miter" stroke-dasharray="3,3"/>
|
||||
<polyline points="1246,808 1256.8,808" fill="none" stroke="#1971c2" stroke-width="1.6" stroke-linejoin="miter" />
|
||||
<polygon points="1246,808 1255,803.95 1255,812.05" fill="#1971c2"/>
|
||||
<polygon points="1256.8,808 1247.8,812.05 1247.8,803.95" fill="#1971c2"/>
|
||||
<text x="1251.4" y="838" text-anchor="middle" style="font-family:Arial,Helvetica,sans-serif;font-size:21.25px;font-weight:bold;fill:#1971c2;paint-order:stroke;stroke:#ffffff;stroke-width:5px;stroke-linejoin:round"></text>
|
||||
<text x="1270.8" y="814" text-anchor="start" style="font-family:Arial,Helvetica,sans-serif;font-size:20px;font-weight:bold;fill:#1971c2;paint-order:stroke;stroke:#ffffff;stroke-width:5px;stroke-linejoin:round">kerf / 2</text>
|
||||
<polyline points="860,970 900,970" fill="none" stroke="#e03131" stroke-width="2.2" stroke-linejoin="miter" />
|
||||
<text x="910" y="976" text-anchor="start" style="font-family:Arial,Helvetica,sans-serif;font-size:18.75px;font-weight:normal;fill:#343a40">trait dessiné</text>
|
||||
<polyline points="1050,970 1090,970" fill="none" stroke="#343a40" stroke-width="1.6" stroke-linejoin="miter" stroke-dasharray="6,4"/>
|
||||
<text x="1100" y="976" text-anchor="start" style="font-family:Arial,Helvetica,sans-serif;font-size:18.75px;font-weight:normal;fill:#343a40">cote après découpe</text>
|
||||
<text x="730" y="1012.5" text-anchor="start" style="font-family:Arial,Helvetica,sans-serif;font-size:20px;font-weight:normal;fill:#343a40">Le laser enlève kerf / 2 de chaque côté du trait : le contour</text>
|
||||
<text x="730" y="1040" text-anchor="start" style="font-family:Arial,Helvetica,sans-serif;font-size:20px;font-weight:normal;fill:#343a40">est élargi d'autant. Défaut 0,1 mm ; 0 = pas de compensation.</text>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 15 KiB |
+99
-42
@@ -3,10 +3,11 @@
|
||||
"""
|
||||
Genere le schema explicatif des parametres de l'extension.
|
||||
|
||||
python docs/schema_parametres.py # les deux versions
|
||||
python docs/schema_parametres.py readme # docs/parametres.svg + .png (README)
|
||||
python docs/schema_parametres.py dialogue # images/parametres.png (onglet
|
||||
# « Schéma » de la boite de dialogue)
|
||||
python docs/schema_parametres.py # les deux versions
|
||||
python docs/schema_parametres.py fr # docs/parametres.svg + .png (README)
|
||||
python docs/schema_parametres.py en # docs/parameters_en.svg
|
||||
# + images/parameters_en.png (onglet
|
||||
# « Diagram » de la boite de dialogue)
|
||||
|
||||
Les formes sont calculees par box_core (memes fonctions que l'extension),
|
||||
le schema reste donc fidele au resultat reel. L'export PNG passe par
|
||||
@@ -39,25 +40,85 @@ FONT = "font-family:Arial,Helvetica,sans-serif"
|
||||
INKSCAPE = [r"C:\Program Files\Inkscape\bin\inkscape.com", "/usr/bin/inkscape",
|
||||
"/Applications/Inkscape.app/Contents/MacOS/inkscape"]
|
||||
|
||||
# L'extension n'existe qu'en francais : deux versions du meme schema.
|
||||
# La version « dialogue » est affichee reduite (900 px de large) dans la boite de
|
||||
# dialogue : textes x 1.25 pour rester lisibles.
|
||||
# Version par langue : textes, fichiers produits, largeur du PNG et agrandissement
|
||||
# des textes (la version anglaise est affichee reduite dans la boite de dialogue :
|
||||
# 900 px de large, textes x 1.25 pour rester lisibles). Inkscape ne traduit pas
|
||||
# le chemin d'une image : la boite de dialogue montre la version anglaise.
|
||||
VERSIONS = {
|
||||
"readme": {
|
||||
"fr": {
|
||||
"svg": os.path.join(HERE, "parametres.svg"),
|
||||
"png": os.path.join(HERE, "parametres.png"),
|
||||
"png_width": 1400,
|
||||
"font_scale": 1.0,
|
||||
"text": {
|
||||
"title1": "Dimensions de la boîte",
|
||||
"front": "Avant",
|
||||
"lid": "Couvercle",
|
||||
"length": "Longueur",
|
||||
"width": "Largeur",
|
||||
"height": "Hauteur",
|
||||
"note1": ["Couvercle (pointillés) : « Boîte fermée ». Décochée : 5 pièces,",
|
||||
"bord haut des côtés droit. Minimum : 5 × l'épaisseur."],
|
||||
"title2": "Épaisseur et type de dimensions",
|
||||
"bottom": "Fond",
|
||||
"exterior": "Extérieure",
|
||||
"interior": "Intérieure",
|
||||
"thickness": "Épaisseur",
|
||||
"note2": ["Extérieures : cotes hors tout. Intérieures : l'extension ajoute",
|
||||
"2 épaisseurs (1 seule en hauteur si la boîte est ouverte)."],
|
||||
"title3": "Largeur des créneaux",
|
||||
"finger": "Créneau",
|
||||
"depth": "Profondeur = épaisseur",
|
||||
"note3": ["0 = 3 × l'épaisseur. Largeur ajustée pour un nombre impair",
|
||||
"de créneaux par bord (ici {} sur l'avant)."],
|
||||
"title4": "Compensation du kerf",
|
||||
"wanted": "Créneau voulu",
|
||||
"drawn": "Dessiné : créneau + kerf",
|
||||
"legend_drawn": "trait dessiné",
|
||||
"legend_cut": "cote après découpe",
|
||||
"note4": ["Le laser enlève kerf / 2 de chaque côté du trait : le contour",
|
||||
"est élargi d'autant. Défaut 0,1 mm ; 0 = pas de compensation."],
|
||||
},
|
||||
},
|
||||
"dialogue": {
|
||||
"svg": os.path.join(HERE, "parametres_dialogue.svg"),
|
||||
"png": os.path.join(ROOT, "images", "parametres.png"),
|
||||
"en": {
|
||||
"svg": os.path.join(HERE, "parameters_en.svg"),
|
||||
"png": os.path.join(ROOT, "images", "parameters_en.png"),
|
||||
"png_width": 900,
|
||||
"font_scale": 1.25,
|
||||
"text": {
|
||||
"title1": "Box dimensions",
|
||||
"front": "Front",
|
||||
"lid": "Lid",
|
||||
"length": "Length",
|
||||
"width": "Width",
|
||||
"height": "Height",
|
||||
"note1": ["Lid (dashed): \"Closed box\". Unchecked: 5 parts, straight",
|
||||
"top edge on the sides. Minimum: 5 × the thickness."],
|
||||
"title2": "Thickness and dimension type",
|
||||
"bottom": "Bottom",
|
||||
"exterior": "Exterior",
|
||||
"interior": "Interior",
|
||||
"thickness": "Thickness",
|
||||
"note2": ["Exterior: overall sizes. Interior: the extension adds",
|
||||
"2 thicknesses (only 1 in height for an open box)."],
|
||||
"title3": "Finger width",
|
||||
"finger": "Finger",
|
||||
"depth": "Depth = thickness",
|
||||
"note3": ["0 = 3 × the thickness. The width is adjusted to get an",
|
||||
"odd number of fingers per edge ({} on the front here)."],
|
||||
"title4": "Kerf compensation",
|
||||
"wanted": "Wanted finger",
|
||||
"drawn": "Drawn: finger + kerf",
|
||||
"legend_drawn": "drawn stroke",
|
||||
"legend_cut": "size after cutting",
|
||||
"note4": ["The laser removes kerf / 2 on each side of the stroke: the",
|
||||
"outline is widened accordingly. Default 0.1 mm; 0 = none."],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
out = []
|
||||
T = {}
|
||||
FS = 1.0
|
||||
|
||||
|
||||
@@ -139,7 +200,7 @@ def place(points, x0, y0, scale):
|
||||
|
||||
def panel_1():
|
||||
"""Longueur, largeur, hauteur : boite en perspective cavaliere."""
|
||||
panel_title(30, 50, 1, "Dimensions de la boîte")
|
||||
panel_title(30, 50, 1, T["title1"])
|
||||
s = 3.2 # px par mm
|
||||
length, width, height = 100, 80, 50
|
||||
dx, dy = 0.5 * math.cos(math.radians(35)), -0.5 * math.sin(math.radians(35))
|
||||
@@ -154,24 +215,22 @@ def panel_1():
|
||||
polygon([p(0, 0, Z), p(L, 0, Z), p(L, P, Z), p(0, P, Z)], EDGE, 2, "#e9ecef",
|
||||
'stroke-dasharray="7,5"')
|
||||
polygon([p(L, 0, 0), p(L, P, 0), p(L, P, Z), p(L, 0, Z)], EDGE, 2, "#dee2e6")
|
||||
text(*p(L / 2, 0, Z / 2 - 3), "Avant", size=16, color=GHOST, anchor="middle", halo=False)
|
||||
text(*p(L / 2, P / 2, Z + 2), "Couvercle", size=16, color=GHOST, anchor="middle",
|
||||
text(*p(L / 2, 0, Z / 2 - 3), T["front"], size=16, color=GHOST, anchor="middle", halo=False)
|
||||
text(*p(L / 2, P / 2, Z + 2), T["lid"], size=16, color=GHOST, anchor="middle",
|
||||
halo=False)
|
||||
dimension(p(0, 0, 0), p(L, 0, 0), 30, "Longueur")
|
||||
dimension(p(L, 0, 0), p(L, P, 0), 34, "Largeur", label_shift=44)
|
||||
dimension(p(0, 0, 0), p(0, 0, Z), -30, "Hauteur", label_shift=48)
|
||||
note(30, 500, ["Couvercle (pointillés) : « Boîte fermée ». Décochée : 5 pièces,",
|
||||
"bord haut des côtés droit. Minimum : 5 × l'épaisseur."])
|
||||
dimension(p(0, 0, 0), p(L, 0, 0), 30, T["length"])
|
||||
dimension(p(L, 0, 0), p(L, P, 0), 34, T["width"], label_shift=44)
|
||||
dimension(p(0, 0, 0), p(0, 0, Z), -30, T["height"], label_shift=48)
|
||||
note(30, 500, T["note1"])
|
||||
|
||||
|
||||
def panel_2():
|
||||
"""Epaisseur et dimensions interieures / exterieures : coupe verticale."""
|
||||
ox = 700
|
||||
panel_title(ox + 30, 50, 2, "Épaisseur et type de dimensions")
|
||||
panel_title(ox + 30, 50, 2, T["title2"])
|
||||
s = 5.0
|
||||
t, width, height = 6, 80, 44 # epaisseur exageree pour la lisibilite
|
||||
x0, y0 = ox + 150, 150
|
||||
hatch = 'fill="url(#hachures)"'
|
||||
|
||||
def rect(x, y, w, h):
|
||||
polygon(place([(x, y), (x + w, y), (x + w, y + h), (x, y + h)], x0, y0, s),
|
||||
@@ -180,26 +239,24 @@ def panel_2():
|
||||
rect(0, 0, t, height) # cote gauche
|
||||
rect(width - t, 0, t, height) # cote droit
|
||||
rect(0, height - t, width, t) # fond
|
||||
del hatch
|
||||
text(x0 + width / 2 * s, y0 + (height - t / 2) * s + 6, "Fond", size=15,
|
||||
text(x0 + width / 2 * s, y0 + (height - t / 2) * s + 6, T["bottom"], size=15,
|
||||
color=INK, anchor="middle")
|
||||
|
||||
top = y0
|
||||
dimension((x0, top), (x0 + width * s, top), -58, "Extérieure", label_shift=18)
|
||||
dimension((x0, top), (x0 + width * s, top), -58, T["exterior"], label_shift=18)
|
||||
dimension((x0 + t * s, top + 60), (x0 + (width - t) * s, top + 60), 0,
|
||||
"Intérieure", color=DIM2)
|
||||
T["interior"], color=DIM2)
|
||||
dimension((x0 + (width - t) * s, y0 + 12 * s), (x0 + width * s, y0 + 12 * s), 0,
|
||||
"", color=DIM)
|
||||
text(x0 + width * s + 16, y0 + 12 * s + 6, "Épaisseur", size=17, color=DIM,
|
||||
text(x0 + width * s + 16, y0 + 12 * s + 6, T["thickness"], size=17, color=DIM,
|
||||
weight="bold")
|
||||
note(ox + 30, 500, ["Extérieures : cotes hors tout. Intérieures : l'extension ajoute",
|
||||
"2 épaisseurs (1 seule en hauteur si la boîte est ouverte)."])
|
||||
note(ox + 30, 500, T["note2"])
|
||||
|
||||
|
||||
def panel_3():
|
||||
"""Creneaux : bord male de l'avant et bord femelle du couvercle."""
|
||||
oy = 540
|
||||
panel_title(30, oy + 50, 3, "Largeur des créneaux")
|
||||
panel_title(30, oy + 50, 3, T["title3"])
|
||||
length, t = 100, 4
|
||||
finger = 3 * t # valeur par defaut (parametre a 0)
|
||||
s = 5.6
|
||||
@@ -221,25 +278,24 @@ def panel_3():
|
||||
lid = [(x, 2 * lid_y - y) for x, y in edge(box_core.FEMALE, lid_y, 50)]
|
||||
polygon(lid, GHOST, 1.4, "#f8f9fa")
|
||||
polygon(edge(box_core.MALE, front_y, 150), EDGE, 2, FILL)
|
||||
text(x0 + length * s + 12, lid_y - 20, "Couvercle", size=15, color=GHOST)
|
||||
text(x0 + length * s + 12, front_y + 60, "Avant", size=15, color=GHOST)
|
||||
text(x0 + length * s + 12, lid_y - 20, T["lid"], size=15, color=GHOST)
|
||||
text(x0 + length * s + 12, front_y + 60, T["front"], size=15, color=GHOST)
|
||||
|
||||
segs = box_core.edge_segments(length, t, finger, box_core.MALE)
|
||||
a, b, _ = segs[4]
|
||||
dimension((x0 + a * s, front_y), (x0 + b * s, front_y), 50, "Créneau", label_shift=20)
|
||||
dimension((x0 + a * s, front_y), (x0 + b * s, front_y), 50, T["finger"], label_shift=20)
|
||||
c, d, _ = segs[1]
|
||||
mid = x0 + (c + d) / 2 * s
|
||||
dimension((mid, front_y), (mid, front_y + t * s), 0, "", color=DIM2)
|
||||
text(mid, front_y + t * s + 28, "Profondeur = épaisseur", size=15, color=DIM2,
|
||||
text(mid, front_y + t * s + 28, T["depth"], size=15, color=DIM2,
|
||||
weight="bold", anchor="middle")
|
||||
note(30, oy + 500, ["0 = 3 × l'épaisseur. Largeur ajustée pour un nombre impair",
|
||||
"de créneaux par bord (ici {} sur l'avant).".format(len(segs))])
|
||||
note(30, oy + 500, [line.format(len(segs)) for line in T["note3"]])
|
||||
|
||||
|
||||
def panel_4():
|
||||
"""Kerf : contour dessine decale de kerf / 2 vers l'exterieur."""
|
||||
ox, oy = 700, 540
|
||||
panel_title(ox + 30, oy + 50, 4, "Compensation du kerf")
|
||||
panel_title(ox + 30, oy + 50, 4, T["title4"])
|
||||
t, finger, kerf = 4, 8, 1.2 # kerf exagere pour la lisibilite
|
||||
s = 18
|
||||
x0, y0 = ox + 150, oy + 160
|
||||
@@ -251,21 +307,20 @@ def panel_4():
|
||||
|
||||
k = kerf / 2
|
||||
dimension((x0 + 6 * s, y0 + 0), (x0 + (6 + finger) * s, y0), 0, "")
|
||||
text(x0 + (6 + finger / 2) * s, y0 + 36, "Créneau voulu", size=15, color=DIM,
|
||||
text(x0 + (6 + finger / 2) * s, y0 + 36, T["wanted"], size=15, color=DIM,
|
||||
anchor="middle", weight="bold")
|
||||
dimension((x0 + (6 - k) * s, y0 - k * s), (x0 + (6 + finger + k) * s, y0 - k * s), -40,
|
||||
"Dessiné : créneau + kerf", color=LASER, size=16)
|
||||
T["drawn"], color=LASER, size=16)
|
||||
dimension((x0 + 22 * s, y0 + 6 * s), (x0 + (22 + k) * s, y0 + 6 * s), 0, "", color=DIM2)
|
||||
text(x0 + (22 + k) * s + 14, y0 + 6 * s + 6, "kerf / 2", size=16, color=DIM2,
|
||||
weight="bold")
|
||||
|
||||
lx, ly = x0 + 10, y0 + 13 * s + 36
|
||||
polyline([(lx, ly), (lx + 40, ly)], LASER, 2.2)
|
||||
text(lx + 50, ly + 6, "trait dessiné", size=15, halo=False)
|
||||
text(lx + 50, ly + 6, T["legend_drawn"], size=15, halo=False)
|
||||
polyline([(lx + 190, ly), (lx + 230, ly)], INK, 1.6, 'stroke-dasharray="6,4"')
|
||||
text(lx + 240, ly + 6, "cote après découpe", size=15, halo=False)
|
||||
note(ox + 30, oy + 500, ["Le laser enlève kerf / 2 de chaque côté du trait : le contour",
|
||||
"est élargi d'autant. Défaut 0,1 mm ; 0 = pas de compensation."])
|
||||
text(lx + 240, ly + 6, T["legend_cut"], size=15, halo=False)
|
||||
note(ox + 30, oy + 500, T["note4"])
|
||||
|
||||
|
||||
def export_png(svg_path, png_path, width):
|
||||
@@ -285,6 +340,8 @@ def build(name):
|
||||
global FS
|
||||
version = VERSIONS[name]
|
||||
out.clear()
|
||||
T.clear()
|
||||
T.update(version["text"])
|
||||
FS = version["font_scale"]
|
||||
|
||||
out.append('<defs><pattern id="hachures" width="8" height="8" '
|
||||
|
||||
Reference in new issue
Block a user