Compare commits
No commits in common. "7f8d98ca0a95e53158d6aa43d56d9de881b4b8c2" and "2d1841192d39fb2a8146fe7a9706b8da404b7efc" have entirely different histories.
7f8d98ca0a
...
2d1841192d
4 changed files with 0 additions and 184 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -1,5 +0,0 @@
|
|||
|
||||
*.png~
|
||||
*.deps
|
||||
*.stl
|
||||
*.generated.scad
|
||||
23
Makefile
23
Makefile
|
|
@ -1,23 +0,0 @@
|
|||
# TARGETS=$(shell sed '/^module [a-z0-9_-]*().*make..\?me.*$$/!d;s/module //;s/().*/.stl/' main.scad)
|
||||
|
||||
|
||||
|
||||
GENERATED_FILES = $(wildcard *.deps) \
|
||||
$(wildcard *.stl) \
|
||||
$(wildcard *.png) \
|
||||
$(wildcard *.generated.scad)
|
||||
|
||||
.phony: all clean
|
||||
|
||||
# all: ${TARGETS}
|
||||
|
||||
include $(wildcard *.deps)
|
||||
|
||||
%.stl: main.scad main.json Makefile
|
||||
flatpak run org.openscad.OpenSCAD --enable textmetrics -p main.json -P $(basename $@) -DFN=64 -D "MODELVER=\"$(shell git rev-parse --short=6 HEAD)\"" -m make -o $@ -d $@.deps $<
|
||||
|
||||
%.png:
|
||||
flatpak run org.openscad.OpenSCAD --enable textmetrics -p main.json -P $(basename $@) -DFN=32 --render --imgsize 1600,1200 -o $@ main.scad
|
||||
|
||||
clean:
|
||||
rm -rf ${GENERATED_FILES}
|
||||
19
main.json
19
main.json
|
|
@ -1,19 +0,0 @@
|
|||
{
|
||||
"fileFormatVersion": "1",
|
||||
"parameterSets": {
|
||||
"t4t": {
|
||||
"base_rounding_stamp": "4",
|
||||
"base_rounding_stencil": "2",
|
||||
"base_thickness_stamp": "1",
|
||||
"base_thickness_stencil": "0.40000000000000002",
|
||||
"border": "3",
|
||||
"font_index": "0",
|
||||
"font_manual": "LT Effervescent:style=Regular",
|
||||
"font_set": "4",
|
||||
"line": "t4t",
|
||||
"stamp_depth": "1.5",
|
||||
"textsize": "36",
|
||||
"variant": "stamp"
|
||||
}
|
||||
}
|
||||
}
|
||||
137
main.scad
137
main.scad
|
|
@ -1,137 +0,0 @@
|
|||
/* [Main design variables] */
|
||||
variant = "stamp"; // ["stamp", "stencil"]
|
||||
// Set the text size to match the width.
|
||||
textsize = 24; // [10:36]
|
||||
font_set = 4; // [0:"linux", 1:"windows", 2:"custom", 3:"stencil", 4:"manual"]
|
||||
font_manual = "Ubuntu:style=Bold";
|
||||
font_index = 0;
|
||||
line = "lorem ipsum";
|
||||
|
||||
/* [common technical vars] */
|
||||
border = 3;
|
||||
|
||||
/* [stamp technical vars] */
|
||||
base_thickness_stamp = 1;
|
||||
base_rounding_stamp = 4;
|
||||
stamp_depth = 1.5;
|
||||
|
||||
/* [stencil technical vars] */
|
||||
base_thickness_stencil = 0.4;
|
||||
base_rounding_stencil = 2;
|
||||
|
||||
/* [fonts] */
|
||||
|
||||
fonts_linux = [
|
||||
|
||||
];
|
||||
|
||||
fonts_windows = [
|
||||
|
||||
];
|
||||
|
||||
fonts_custom = [
|
||||
"Anonymous Pro Minus:style=Bold",
|
||||
"Anonymous Pro Minus",
|
||||
"Kings:style=Regular",
|
||||
"CAT FrankenDeutsch:style=Regular",
|
||||
"Bounded:style=Medium",
|
||||
"LT Effervescent:style=Regular"
|
||||
];
|
||||
|
||||
fonts_stencil = ["Depot:style=Regular",
|
||||
"Allerta Stencil:style=Regular",
|
||||
"Stardos Stencil:style=Regular",
|
||||
"Stardos Stencil:style=Bold",
|
||||
"Stencilia\\-A:style=Regular",
|
||||
"Stencilia\\-Bold:style=Regular"
|
||||
];
|
||||
|
||||
/* [hidden] */
|
||||
|
||||
fonts_manual = [font_manual];
|
||||
font_sets = [fonts_linux, fonts_windows, fonts_custom, fonts_stencil, fonts_manual];
|
||||
font = font_sets[font_set][font_index];
|
||||
|
||||
if (font == undef)
|
||||
{
|
||||
assert(false, "Font index out of range");
|
||||
}
|
||||
|
||||
|
||||
tm = textmetrics(line, size=textsize, font=font);
|
||||
|
||||
width = tm.size[0];
|
||||
height = tm.size[1];
|
||||
base_position = tm.position;
|
||||
|
||||
echo();
|
||||
echo(str("model size is x:", width, " y:", height));
|
||||
echo("");
|
||||
|
||||
// All variables are set, make main
|
||||
main();
|
||||
|
||||
|
||||
module main()
|
||||
{
|
||||
if (variant == "stamp")
|
||||
{
|
||||
scale([-1,1,1])
|
||||
stamp();
|
||||
translate([40,0,0])
|
||||
%stamp();
|
||||
}
|
||||
else if (variant == "stencil")
|
||||
{
|
||||
stencil();
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(false, "Invalid object variant");
|
||||
}
|
||||
}
|
||||
|
||||
module stamp_base(x, y, z, rounding)
|
||||
{
|
||||
hull()
|
||||
{
|
||||
for(i = [0+rounding,x-rounding])
|
||||
{
|
||||
for(j = [0+rounding,y-rounding])
|
||||
{
|
||||
translate([i,j,0])
|
||||
cylinder(h = z, r = rounding);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module stamp()
|
||||
{
|
||||
union()
|
||||
{
|
||||
translate(base_position)
|
||||
translate([-border,-border,0])
|
||||
stamp_base(x = width+2*border, y = height+2*border, z = base_thickness_stamp, rounding = base_rounding_stamp);
|
||||
|
||||
color("white")
|
||||
linear_extrude(height = base_thickness_stamp+stamp_depth)
|
||||
text(line, font = font, size=textsize);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
module stencil()
|
||||
{
|
||||
difference()
|
||||
{
|
||||
translate(base_position)
|
||||
translate([-border,-border,0])
|
||||
stamp_base(width+2*border, height+2*border, base_thickness_stencil, base_rounding_stamp);
|
||||
|
||||
linear_extrude(height = base_thickness_stencil+0.01)
|
||||
text(line, font = font, size=textsize);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue