Merge pull request from revarbat/revarbat_dev

Revarbat dev
This commit is contained in:
Revar Desmera 2021-04-18 20:17:57 -07:00 committed by GitHub
commit 9474aa3a83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 531 additions and 533 deletions

View file

@ -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])

View file

@ -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)"

View file

@ -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("![Figure {}]({})".format(imgnum, imgroot + imgfile))
script = []
if show_script:
outdata.append("```openscad")
outdata.extend(script)
outdata.append("```")
outdata.append("![Figure {}]({})".format(imgnum, imgfile))
show_script = True
extyp = ""
else: