mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-02-19 10:09:39 +00:00
commit
9474aa3a83
8 changed files with 531 additions and 533 deletions
36
joiners.scad
36
joiners.scad
|
@ -83,33 +83,34 @@ module half_joiner(h=20, w=10, l=10, a=30, screwsize=undef, guides=true, anchor=
|
|||
dmnd_width = dmnd_height*tan(a);
|
||||
guide_size = w/3;
|
||||
guide_width = 2*(dmnd_height/2-guide_size)*tan(a);
|
||||
a2 = atan2(guide_width/2,h/3);
|
||||
|
||||
render(convexity=12)
|
||||
attachable(anchor,spin,orient, size=[w, 2*l, h]) {
|
||||
difference() {
|
||||
union() {
|
||||
// Make base.
|
||||
difference() {
|
||||
// Solid backing base.
|
||||
fwd(l/2) cube(size=[w, l, h], center=true);
|
||||
// Base cube
|
||||
fwd(l) cube([w, l+guide_width/2, h], anchor=FRONT);
|
||||
|
||||
// Clear diamond for tab
|
||||
xcopies(2*w*2/3) {
|
||||
half_joiner_clear(h=h+0.01, w=w, clearance=$slop*2, a=a);
|
||||
// Bevel top and bottom
|
||||
yrot_copies(n=2)
|
||||
down(h/2)
|
||||
xrot(-a2)
|
||||
down(0.1)
|
||||
cube([w+1, guide_width+1, h+1], anchor=FWD+BOT);
|
||||
|
||||
// Clear sides
|
||||
xcopies(2*w*2/3-$slop*2) {
|
||||
cube([w, guide_width, h/3], center=true);
|
||||
fwd(guide_width/2)
|
||||
yrot_copies(n=2)
|
||||
down(h/6)
|
||||
xrot(a2)
|
||||
cube([w, guide_width, h/2], anchor=FWD+TOP);
|
||||
}
|
||||
}
|
||||
|
||||
difference() {
|
||||
// Make tab
|
||||
scale([w/3-$slop*2, dmnd_width/2, dmnd_height/2]) xrot(45)
|
||||
cube(size=[1,sqrt(2),sqrt(2)], center=true);
|
||||
|
||||
// Blunt point of tab.
|
||||
back(guide_width/2+2)
|
||||
cube(size=[w*0.99,4,guide_size*2], center=true);
|
||||
}
|
||||
|
||||
|
||||
// Guide ridges.
|
||||
if (guides == true) {
|
||||
xcopies(w/3-$slop*2) {
|
||||
|
@ -136,7 +137,6 @@ module half_joiner(h=20, w=10, l=10, a=30, screwsize=undef, guides=true, anchor=
|
|||
}
|
||||
|
||||
|
||||
|
||||
// Module: half_joiner2()
|
||||
// Usage:
|
||||
// half_joiner2(h, w, l, [a], [screwsize], [guides])
|
||||
|
|
|
@ -15,7 +15,7 @@ done
|
|||
if [[ "$FILES" != "" ]]; then
|
||||
PREVIEW_LIBS="$FILES"
|
||||
else
|
||||
PREVIEW_LIBS="Shapes2d Shapes3d Transforms Distributors Mutators Paths FractalTree"
|
||||
PREVIEW_LIBS="Shapes2d Shapes3d Transforms Distributors Mutators Attachments Paths FractalTree"
|
||||
fi
|
||||
|
||||
dir="$(basename $PWD)"
|
||||
|
|
|
@ -14,7 +14,7 @@ imgmgr = ImageManager()
|
|||
|
||||
|
||||
def img_started(req):
|
||||
print(" {}... ".format(os.path.basename(req.src_file)), end='')
|
||||
print(" {}... ".format(os.path.basename(req.image_file)), end='')
|
||||
sys.stdout.flush()
|
||||
|
||||
|
||||
|
@ -52,7 +52,7 @@ def processFile(infile, outfile=None, imgroot=""):
|
|||
|
||||
outdata = []
|
||||
with open(infile, "r") as f:
|
||||
script = []
|
||||
script = ["include <BOSL2/std.scad>"]
|
||||
extyp = ""
|
||||
in_script = False
|
||||
imgnum = 0
|
||||
|
@ -67,26 +67,24 @@ def processFile(infile, outfile=None, imgroot=""):
|
|||
extyp = line.split("-")[1]
|
||||
else:
|
||||
extyp = ""
|
||||
line = "```openscad"
|
||||
script = []
|
||||
show_script = "ImgOnly" not in extyp
|
||||
script = ["include <BOSL2/std.scad>"]
|
||||
imgnum = imgnum + 1
|
||||
if show_script:
|
||||
outdata.append(line)
|
||||
elif in_script:
|
||||
if show_script:
|
||||
outdata.append(line)
|
||||
if line == "```":
|
||||
in_script = False
|
||||
imgfile = "{}_{}.png".format(fileroot, imgnum)
|
||||
imgfile = os.path.join(imgroot, "{}_{}.png".format(fileroot, imgnum))
|
||||
imgmgr.new_request(
|
||||
fileroot+".md", linenum,
|
||||
imgfile, script, extyp,
|
||||
starting_cb=img_started,
|
||||
completion_cb=img_completed
|
||||
)
|
||||
outdata.append("".format(imgnum, imgroot + imgfile))
|
||||
script = []
|
||||
if show_script:
|
||||
outdata.append("```openscad")
|
||||
outdata.extend(script)
|
||||
outdata.append("```")
|
||||
outdata.append("".format(imgnum, imgfile))
|
||||
show_script = True
|
||||
extyp = ""
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue