-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Duplicate lpart id's #17
Comments
Hi Ken, the library requires each lpart to have a unique name so that it can identify them during the arrangement process later on. You define an lpart named A quick fix would be to include the diameter in the lpart names, i.e. by writing If you need multiple pads of the same diameter, this will fail for the same reason as before of course. You could then do the following:
|
On 12Sep2020, at 02:05, Michael Bugert ***@***.***> wrote:
the library requires each lpart to have a unique name so that it can identify them during the arrangement process later on. You define an lpart named pad and instantiate it three times, therefore it returns Error: Duplicate lpart id's: pad.
Many thanks. I thought that every lpart _type_ needed a unique name. You’re telling me that each lpart _instance_
needs a unique name.
I’ll get back on it.
Many thanks,
Ken
*******************************
Kenneth R. Beesley, D.Phil.
PO Box 540475
North Salt Lake UT 84054
USA
|
Yeah, I agree that it's not particularly obvious from the readme. I'll update that.
👍👍 |
Hello Michael,
Thanks for the updates and messages.
When I run your code sample (from the message below) or my own code,
with the modifications that you describe, I get the following ValueError
message:
beesley$ make cut model=/Users/beesley/perso/shop/3D/openscad/projects/pads/pads-bugert.scad
Getting object bounding boxes...
OpenSCAD reports:
WARNING: Ignoring unknown function 'is_undef'.
WARNING: Ignoring unknown variable 'lkerf'.
WARNING: Ignoring unknown variable 'lmargin'.
WARNING: Ignoring unknown variable 'lidentify'.
Optimizing object placement...
Traceback (most recent call last):
File "util/column_packing.py", line 61, in <module>
pack(*sys.argv[1:])
File "util/column_packing.py", line 32, in pack
objects = [(name, float(x), float(y)) for name, x, y in list(reader)]
File "util/column_packing.py", line 32, in <listcomp>
objects = [(name, float(x), float(y)) for name, x, y in list(reader)]
ValueError: could not convert string to float: 'undef'
make: *** [/Users/beesley/perso/shop/3D/openscad/projects/pads/_laserscad_temp/pads-bugert_pos.csv] Error 1
What’s going on here?
Thanks,
Ken
On 12Sep2020, at 02:05, Michael Bugert ***@***.***> wrote:
Hi Ken,
the library requires each lpart to have a unique name so that it can identify them during the arrangement process later on. You define an lpart named pad and instantiate it three times, therefore it returns Error: Duplicate lpart id's: pad.
A quick fix would be to include the diameter in the lpart names, i.e. by writing lpart(str("pad", diam), [diam, diam]) and lpart(str("pad_with_hole", odiam, idiam), [odiam, odiam]).
If you need multiple pads of the same diameter, this will fail for the same reason as before of course. You could then do the following:
include <laserscad.scad>
kerf = 0.5;
thickness = 3;
$fn = 200;
font_color = "black";
font_size = 1.5;
module pad(diam, id="") {
lpart(str("pad", diam, id), [diam, diam]) {
lengrave(thickness, true){
color(font_color)
text(font="DejaVu Sans", size=font_size, str(diam),
halign="center", valign="center");
}
cylinder(h=thickness, d=diam + kerf);
}
}
for (x=[1:4], y=[1:4]) {
translate([x*10,y*10,0])
pad(8, id=str(x,y));
}
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#17 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAPIKMORXLIETGLMKP36TYLSFMTWDANCNFSM4QXVL6WQ>.
*******************************
Kenneth R. Beesley, D.Phil.
PO Box 540475
North Salt Lake UT 84054
USA
|
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
*/
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");
}
}
union() {
translate([-24, 0, 0])
pad(8.5);
}
********* end of pads.scad ********
So that's where I'm stuck.
What do I need to do to get this working?
Thanks,
Ken
The text was updated successfully, but these errors were encountered: