mbugert / laserscad Goto Github PK
View Code? Open in Web Editor NEWA library for efficient lasercutting with OpenSCAD.
License: GNU Lesser General Public License v3.0
A library for efficient lasercutting with OpenSCAD.
License: GNU Lesser General Public License v3.0
I installed v0.3.0 on OS X.
I created an .scad file, including a call to lengrave, that by itself seems to work as expected in OpenSCAD itself.
I then cd’ed to the dist/ directory and found the following instructions in the laserscad README.md, which
appear to be in error:
Under “Lasercutting template”
the instructions say to “Open a shell and run:”
cd laserscad/dist
make engrave model=path/to/your/model.scad
Then under “Engravings”, it tells you to invoke the very same commands.
From other clues, it would appear that the first command should be
make cut model=path/to/your/model.scad
But when I run that, I get
$ make cut model=/Users/beesley/perso/shop/3D/openscad/projects/pads/pads.scad
Getting object bounding boxes...
Traceback (most recent call last):
File "util/extract_bounding_boxes.py", line 86, in
extract(*sys.argv[1:])
File "util/extract_bounding_boxes.py", line 26, in extract
with open(src, 'r') as file:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/beesley/perso/shop/3D/openscad/projects/pads/_laserscad_temp/pads.echo'
make: *** [/Users/beesley/perso/shop/3D/openscad/projects/pads/_laserscad_temp/pads_bb.csv] Error 1
In the directory where my pads.scad is located, I see that a directory _laserscad_temp/ was created, but
it’s empty.
I continue to look into this, but I’m currently stuck.
Any suggestions?
Support for engraving lparts. Either to identify parts after they're lasered or just because it looks fancy.
Proper packing algorithm with multiple quality settings.
I've spent a couple days trying to debug OpenSCAD's import behavior, when it turned out to be a problem with laserscad.
Laserscad prints the following failure message if any warnings come out of OpenSCAD in from laserscad.scad
:
Error: OpenSCAD cannot find 'laserscad.scad'. Put 'laserscad.scad' in the OpenSCAD libraries folder or in the same folder as your model.
That statement is incorrect. In my case, the warnings were
WARNING: Ignoring unknown variable 'lkerf', in file laserscad.scad, line 150.
WARNING: Ignoring unknown variable 'lmargin', in file laserscad.scad, line 151.
WARNING: Ignoring unknown variable 'lidentify', in file laserscad.scad, line 152.
As a workaround, defining all three variables in my design silences the warnings.
laserscad.scad
and add a utility module which complains if the version does not matchThis would allow intersections and differences between lparts.
I'm still having problems running laserscad on OS X. Here's the background:
On OS X v 10.13.6
Using laserscad v0.3.2
$ which openscad
returns /usr/local/bin/openscad
which is an executable bash script that looks like this:
#!/bin/bash
/Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD $*
When I cd to the new v0.3.2 laserscad/dist and
invoke
$ make cut model=/Users/beesley/perso/shop/3D/openscad/projects/pads/pads.scad
it creates directory _laserscad_temp/ in pads/, puts file pads.echo in it, and then finds an error,
returning
$ make cut model=/Users/beesley/perso/shop/3D/openscad/projects/pads/pads.scad
Getting object bounding boxes...
OpenSCAD reports:
WARNING: Ignoring unknown variable 'lidentify'.
WARNING: Ignoring unknown variable 'lmargin'.
WARNING: Ignoring unknown variable 'lkerf'.
Error: Duplicate lpart id's: pad
make: *** [/Users/beesley/perso/shop/3D/openscad/projects/pads/_laserscad_temp/pads_bb.csv] Error 1
and exits. There's no further output.
The pads.scad file looks like this:
// pads.scad
// Kenneth R. Beesley
/*
Design pads (basically just circles) for saxophone keys to be cut
out of material by a laser cutter
The "material" will be a sandwich of neoprene rubber sheet (1/16"
to 1/8" thick) with a card backing already glued on. The laser
cutter will need to cut through the rubber and the card backing.
The thickness of the material will vary. Needs to be specified
for the laser-cutter, I assume?
*/
include <laserscad.scad>
// width of cut left by the laser cutter (see details of the machine)
kerf = 0.5;
thickness = 3; // affects only the development preview in OpenSCAD
// $fn value controls the roundness of the circles
$fn = 200;
font_color = "black";
font_size = 1.5;
module pad(diam) {
lpart("pad", [diam, diam]) {
// text to be engraved
lengrave(thickness, true){
color(font_color)
text(font="DejaVu Sans", size=font_size, str(diam),
halign="center", valign="center");
}
// engrave the text onto a basic cylinder
cylinder(h=thickness, d=diam + kerf);
}
}
module pad_with_hole(odiam, idiam) {
lpart("pad_with_hole", [odiam, odiam]) {
// text to be engraved
lengrave(thickness, true){
color(font_color)
translate([0, 2, 0])
text(font="DejaVu Sans", size=font_size, str(odiam), halign="center",
valign="center");
}
// engrave the text onto a cylinder with a hole in the middle
difference() {
cylinder(h=thickness, d=odiam + kerf);
translate([0, 0, -1])
cylinder(h=thickness + 2, d=idiam - kerf);
}
}
}
union() {
translate([-24, 0, 0])
pad(8.5);
translate([-13, 0, 0])
pad(10);
pad(13);
translate([16, 0, 0])
pad_with_hole(15, 2);
}
********* end of pads.scad ********
So that's where I'm stuck.
What do I need to do to get this working?
Thanks,
Ken
Add more of them.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.