Loading

Box-o-tron 1.0

by zignig, published

Box-o-tron 1.0 by zignig Mar 29, 2009

Featured Thing!

Description

Box-o-tron 1.0

Python box creator

Now with extra Awesome. boxotron now includes, command line interface and stored config files.

Does tab and slot and "Cupcake" style T joins Usage: boxotron.py [options]

Options: -h, --help show this help message and exit -l LENGTH, --length=LENGTH

                    Length of box in mm

-w WIDTH, --width=WIDTH

                    width of box in mm

-d DEPTH, --depth=DEPTH

                    depth of box in mm

-t THICKNESS, --thickness=THICKNESS

                    thickness of material in mm

-c CLEARANCE, --clearance=CLEARANCE

                    clearance between panels of material in mm

-i INSET, --inset=INSET

                    inset to middle of slot material in mm

-s SLOT_LENGTH, --slot_length=SLOT_LENGTH

                    length of slot in mm

-f FILENAME, --file_name=FILENAME

                    file_name

-j JOIN_EVERY, --join_every=JOIN_EVERY

                    join every x in mm

--type=TYPE box type = slot , bolt -b BOLT, --bolt_size=BOLT

                    bolt size in mm

--bolt_length=BOLT_LENGTH

                    bolt length in mm

--bolt_clearance=BOLT_TAB_CLEARANCE

                    clearance between bolt and tab , multiple of bolt size

--nut_multiplier=NUT_MULTIPLIER

                    nut size - multiple of bolt size

--nut_depth=NUT_DEPTH

                    nut depth - multiple of bolt size

(hint , specify a non-existent file name and it will make a default one of that name )

Recent Comments

view all
Unable to create a config file

./http://boxotron.py box.cfg

Options

using box.cfg

no such config , populating default

Traceback (most recent call last):

File "./http://boxotron.py", line 419, in <module>

if __name__ == '__main__' : main()

File "./http://boxotron.py", line 405, in main

conffile(option,args[0])

File "./http://boxotron.py", line 372, in conffile

c.add_section('default')

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/http://ConfigParser.py", line 253, in add_section

raise ValueError, 'Invalid section name: %s' % section

ValueError: Invalid section name: default</module>
This creates a a left and right box where the side lines are drawn the wrong direction ./http://boxotron.py -l 280 -w 230 -d 46 -t 3 --type=bolt -j 80 -s 30 --bolt_length=10 --nut_multiplier=2.5
It doesn't work for me . . . . Installed Python 2.6, 2.7 and 3.2, just comes up "C:Box-O-Tron
&
gt;python boxotron.py -h

File "http://boxotron.py", line 5

$ACADVER

^

SyntaxError: invalid syntax"

Any ideas? Its seriously ******* me off! :(

Makes

Liked By

view all

License

GNU - GPL
Box-o-tron 1.0 by zignig is licensed under the GNU - GPL license.

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag. Print Thing Tag

Instructions

-Run the script with command line switches or config file

  • Check and Edit the DXF file
  • Laser Cut
  • Make ( bolt or slot )
  • BOX !!
Unable to create a config file

./http://boxotron.py box.cfg

Options

using box.cfg

no such config , populating default

Traceback (most recent call last):

File "./http://boxotron.py", line 419, in <module>

if __name__ == '__main__' : main()

File "./http://boxotron.py", line 405, in main

conffile(option,args[0])

File "./http://boxotron.py", line 372, in conffile

c.add_section('default')

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/http://ConfigParser.py", line 253, in add_section

raise ValueError, 'Invalid section name: %s' % section

ValueError: Invalid section name: default</module>
This creates a a left and right box where the side lines are drawn the wrong direction ./http://boxotron.py -l 280 -w 230 -d 46 -t 3 --type=bolt -j 80 -s 30 --bolt_length=10 --nut_multiplier=2.5
It doesn't work for me . . . . Installed Python 2.6, 2.7 and 3.2, just comes up "C:Box-O-Tron
&
gt;python boxotron.py -h

File "http://boxotron.py", line 5

$ACADVER

^

SyntaxError: invalid syntax"

Any ideas? Its seriously ******* me off! :(
hey solar-b,

I didn't have any trouble importing into Corel X4 , so I'm not sure what's going on there.
Try importing into QCAD and then exporting again.
Had some problems importing a generated box into CorelDraw X4, so I thought I'd pop it into AutoCAD 2008. DXFimport complained about:

"Improper color number 0 for Layer on line 90.

Invalid or incomplete DXF import -- drawing discarded."

Grrr. I hate software that throws up its arms rather than try skipping the error.

I tweaked your Python script on line 412 to make the color 3, and at least ACAD is happier, but still not import into CorelDraw (no biggie, I can re-dump the ACAD).

What design software are you using to import you
r DXF into that it works?
What I did was just change the script to use a [box] stanza instead of [default] which seems to have some magical properties not relevant to just defining a box.
Er... ok, that's only the first step, it seems like ConfigParser has changed the way it handles DEFAULT. Or something.
I get an error on Ubuntu Maverick and Python 2.6. Here's the diff to fix it:

372d371

&
lt; c.add_section('default')

375c374
&
lt; c.set('default',i,vars(opt)[i])

---
&
gt; c.set('DEFAULT',i,vars(opt)[i])
Top