initial commit

This commit is contained in:
Dennis Gunia
2025-09-11 21:57:16 +02:00
commit ebd90083e7
10 changed files with 541 additions and 0 deletions

View File

@@ -0,0 +1,120 @@
//
// Parametric Split-Flap Generator V1.0
// (c) Dennis Gunia 2025 - www.dennisgunia.de
//
// Generates printable 3d multi-material model for each flap!
//
flap_width = 42.8*1; // flap width
flap_height = 35; // flap height
flap_thickness = 1; // flap thickness
flap_recess = 18; // recessed area in mm
flap_recess_width = 2; // recessed area width
flap_tap_width = 1; // flap tap width (shoud be smaller than d)
flap_tap_offset = 1; // margin to flap top
char_bottom = "A"; // char for front (top)
char_top = "W"; // char for back (previous)
// alternate SVG
svg_top = "";
svg_top_scale = 0.8;
svg_bottom = "";
svg_bottom_scale = 0.8;
// Font settings
font_bottom = "TW Cen MT Condensed:style=Bold";
font_bottom_size = 40;
font_bottom_y_scale = 1.3;
font_top = "TW Cen MT Condensed:style=Bold";
font_top_size = 40;
font_top_y_scale = 1.3;
// export step
exp_step = 0;
// Generate single sided text
module text2d(t, size, font, rotate180=false, y_scale){
rotate(rotate180 ? 180 : 0)
scale([1,y_scale])
text(t, size=size, font=font, halign="center", valign="center");
}
// Generate base
module base_plate(){
color([0.1,0.1,0.1])
translate([0,flap_height/-2,0]){
union(){
linear_extrude(flap_thickness)
square([flap_width - flap_recess_width*2, flap_height], center=true);
//generate tab
translate([(flap_width/2)*-1,flap_height/2-(flap_tap_offset+flap_tap_width),0]){
linear_extrude(flap_thickness)
square([flap_width, flap_tap_width]);
};
// generate lower part
translate([(flap_width/2)*-1,(flap_height/2)*-1,0]){
linear_extrude(flap_thickness)
square([flap_width, flap_height-flap_recess]);
};
}
}
}
// Generate and translate Text
module text_component(str_bottom, str_top,oversize){
if (len(svg_bottom) == 0){
// generate bottom text
translate([0,0,-oversize]){
mirror([1,0,0])
linear_extrude(height=0.4+oversize)
text2d(str_bottom,font_top_size,font_bottom,false,font_bottom_y_scale);
}
} else {
// generate bottm shape from svg
translate([0,0,-oversize]){
mirror([1,0,0])
linear_extrude(height=0.4+oversize)
scale([svg_bottom_scale,svg_bottom_scale])
import(svg_bottom, center=true);
}
}
if (len(svg_top) == 0){
// generate top text
translate([0,0,flap_thickness-0.4+oversize]){
linear_extrude(height=0.4+oversize)
text2d(str_top,font_top_size,font_top,true,font_top_y_scale);
}
} else {
// generate bottm shape from svg
translate([0,0,flap_thickness-0.4+oversize]){
rotate(180)
linear_extrude(height=0.4+oversize)
scale([svg_top_scale,svg_top_scale])
import(svg_top, center=true);
}
}
}
// assemble final flap
module base(){
difference(){
base_plate();
text_component(char_bottom,char_top,0.1);
}
}
module txt1(){
difference(){
color("white")
text_component(char_bottom,char_top,0.0);
translate([flap_width/-2,0,-0.1]) cube([flap_width,flap_height,flap_thickness+0.2]);
}
}
if (exp_step == 0){
group("base")
base();
} else {
group("text")
txt1();
}

View File

@@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 110.01 122.88" style="enable-background:new 0 0 110.01 122.88" xml:space="preserve"><style type="text/css">.st0{fill-rule:evenodd;clip-rule:evenodd;}</style><g><path class="st0" d="M1.87,14.69h22.66L24.5,14.3V4.13C24.5,1.86,26.86,0,29.76,0c2.89,0,5.26,1.87,5.26,4.13V14.3l-0.03,0.39 h38.59l-0.03-0.39V4.13C73.55,1.86,75.91,0,78.8,0c2.89,0,5.26,1.87,5.26,4.13V14.3l-0.03,0.39h24.11c1.03,0,1.87,0.84,1.87,1.87 v19.46c0,1.03-0.84,1.87-1.87,1.87H1.87C0.84,37.88,0,37.04,0,36.01V16.55C0,15.52,0.84,14.69,1.87,14.69L1.87,14.69z M0.47,42.19 h109.08c0.26,0,0.46,0.21,0.46,0.46l0,0v79.76c0,0.25-0.21,0.46-0.46,0.46l-109.08,0c-0.25,0-0.47-0.21-0.47-0.46V42.66 C0,42.4,0.21,42.19,0.47,42.19L0.47,42.19L0.47,42.19z M8.23,49.97h95.07c0.52,0,0.94,0.45,0.94,0.94v64.08 c0,0.49-0.45,0.94-0.94,0.94H7.77c-0.49,0-0.94-0.42-0.94-0.94l0-63.63c0-1.03,0.84-1.86,1.86-1.86L8.23,49.97L8.23,49.97z M78.34,29.87c2.89,0,5.26-1.87,5.26-4.13V15.11l-0.03-0.41H73.11l-0.03,0.41v10.16c0,2.27,2.36,4.13,5.25,4.13L78.34,29.87 L78.34,29.87z M29.29,29.87c2.89,0,5.26-1.87,5.26-4.13V15.11l-0.03-0.41H24.07l-0.03,0.41v10.16c0,2.27,2.36,4.13,5.25,4.13 L29.29,29.87L29.29,29.87z"/></g></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

49
templates/svgs/plane-icon.svg Executable file
View File

@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 24.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
version="1.1"
id="Layer_1"
x="0px"
y="0px"
viewBox="0 0 122.88 122.88"
style="enable-background:new 0 0 122.88 122.88;"
xml:space="preserve"
sodipodi:docname="plane-icon.svg"
inkscape:version="1.3.2 (091e20e, 2023-11-25, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs1" /><sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="true"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="3.3813477"
inkscape:cx="29.574007"
inkscape:cy="93.601731"
inkscape:window-width="1920"
inkscape:window-height="1009"
inkscape:window-x="1042"
inkscape:window-y="342"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1" />
<style
type="text/css"
id="style1">
.st0{fill-rule:evenodd;clip-rule:evenodd;}
</style>
<g
id="g1">
<path
class="st0"
d="m 2.5211474,60.747063 c 2.289718,-2.278382 5.820644,-3.21354 10.4340836,-3.598938 L 8.4608114,37.192442 c -0.436407,-1.105185 0.05101,-1.558595 1.054177,-1.666279 l 4.8004716,0.37973 c 0.759461,0.181364 1.382899,0.555426 1.773965,1.241208 L 28.626196,54.784728 54.81059,53.741887 45.317331,4.5412947 c -0.306052,-1.178864 0.124687,-1.734291 1.462245,-1.541592 l 7.611611,0.85581 27.504947,49.0078933 23.384586,-0.782131 c 7.07319,0.510085 12.22505,2.726124 14.35608,6.251382 1.1732,1.943993 1.25821,2.958497 0.27772,4.90249 -1.93267,3.802971 -7.23756,6.206042 -14.6338,6.744465 l -23.384586,-0.782131 -27.504947,49.007889 -7.611611,0.85581 c -1.331891,0.18704 -1.762629,-0.36838 -1.462245,-1.54159 L 54.799255,68.319 28.620528,67.270491 16.083757,84.908118 c -0.385398,0.680119 -1.003168,1.059849 -1.773964,1.241209 l -4.8004726,0.37973 c -0.997501,-0.10202 -1.490583,-0.56109 -1.054177,-1.66628 L 12.949564,64.907095 C 8.3191204,64.516029 4.7881944,63.580872 2.4928094,61.285486 2.2887754,61.070117 2.3171134,60.951097 2.5211474,60.747063 Z"
id="path1"
style="stroke-width:0.801522" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB