Script attached: box joints

This forum is for 'Work-in-Progress' QCAD user developed script Add Ons and Plug-ins.

Please use this forum to request/submit your script Add-Ons & Plug-in idea's.

Moderators: andrew, Husky, J-J

Script attached: box joints

Postby matthiaswm » Sun May 19, 2013 6:48 pm

I build a lot of funny things with plywood on my laser cutter. I used to spend a lot of time creating box joints (you know, the finger-slot-finger-slot thingies that are somewhat difficult to glue, but hold great thanks to the huge surface). Not any longer thanks to the QCAD script I wrote (isn't scriptable software great?).

This script adds a Box Joint icon in the Draw/Line menu and the tool box. The shortcut is L,J. The tool works with two clicks, one where you start the box joint, and the second one where it ends (just try it, you'll see). Box joints are the same forward and backward, and for the slots. So if you do select points with the same distance for both ends of a workpiece, the pieces will mesh just fine.

Just as a hint: when joining two sides at a 90 deg angle, just create the box joint from corner to corner. If you plan a top or bottom plate as well, the box joint should start and end at the corner plus the thickness of the top and bottom (I guess I have to make a video - it's hard to put into words).

The License is LGPL 3. Andrew, feel free to put the script on your page if you like it or make it part of QCAD. Although, an even better implementation probably would be an interactive block for the library?!

Enjoy,

- Matthias

[Edit from andrew: please note that this script might be outdated. The latest version is available in all newer QCAD installations under Misc > Draw]
Attachments
boxjoint_v1.tgz
archive starts at "scripts/.."
(5.46 KiB) Downloaded 351 times
matthiaswm
Junior Member
 
Posts: 23
Joined: Mon Apr 29, 2013 4:34 pm

Re: Script attached: box joints

Postby matthiaswm » Mon May 20, 2013 1:47 pm

clive wrote:
matthiaswm wrote:I build a lot of funny things with plywood on my laser cutter.

Out of interest, what thickness are you running through the cutter?


3mm birch, 4mm HDF, and 2-12mm Plexi are my standard materials. Box joints in 12mm Plexi look very neat!

clive wrote:All you need to do now is write a script for creating dovetail joints 8)


Well, no big deal really, but the laser cutter won't cut it (no pun intended). I am considering a puzzle plugin though.
matthiaswm
Junior Member
 
Posts: 23
Joined: Mon Apr 29, 2013 4:34 pm

Re: Script attached: box joints

Postby Husky » Mon May 20, 2013 8:37 pm

matthiaswm wrote:(I guess I have to make a video - it's hard to put into words)

Yes please ..... I'm also curios to see that!!! 8)
User avatar
Husky
Moderator/Drawing Help/Testing
 
Posts: 1144
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Script attached: box joints

Postby matthiaswm » Mon May 20, 2013 11:20 pm

Allright. Here is the video. Not sure if it explains it better, but you can see me struggling to talk and make a drawer at the same time:

http://youtu.be/MAqGHF9IvU0

- Matthias
matthiaswm
Junior Member
 
Posts: 23
Joined: Mon Apr 29, 2013 4:34 pm

Re: Script attached: box joints

Postby andrew » Mon May 20, 2013 11:34 pm

I can see how this is a huge time saver. This is an excellent example for using scripts. It also makes me feel that QCAD 3 scripting might be on the right track :) Thanks for sharing!
User avatar
andrew
Site Admin
 
Posts: 4015
Joined: Fri Mar 30, 2007 6:07 am

Re: Script attached: box joints

Postby Husky » Tue May 21, 2013 9:40 pm

andrew wrote:I can see how this is a huge time saver.

I absolutely agree: Nice script!!!

clive wrote:All you need to do now is write a script for creating dovetail joints 8)

Yep - that is also something what I'm looking for ... and I'm sure - there are many more like us out there!!! :wink:

matthiaswm wrote:Well, no big deal really, but the laser cutter won't cut it.

Right - but there are more tools out there without a laser .... 8)


Thanks matthiaswm for sharing that - and please reconsider a "Dovetail joint script" .... 8)
User avatar
Husky
Moderator/Drawing Help/Testing
 
Posts: 1144
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Script attached: box joints

Postby matthiaswm » Wed May 22, 2013 3:41 pm

The source code is available, so you can easily add the arrow holes ;-) .
matthiaswm
Junior Member
 
Posts: 23
Joined: Mon Apr 29, 2013 4:34 pm

Re: Script attached: box joints

Postby J-J » Wed May 22, 2013 9:26 pm

Hi Guys
Matthias I tried your box joint script this morning and I'm quite impressed by the design assistance it brings...Clive, I support your comment on script learning, I tried to look into he documentation but gave up. A step by step progression is required when one is an absolute beginner!
User avatar
J-J
Moderator
 
Posts: 313
Joined: Tue Mar 24, 2009 9:48 pm

Re: Script attached: box joints

Postby andrew » Thu May 23, 2013 10:18 am

clive wrote:@Andrew, what do you think - any chance of this?


It's always a tough call how much time to invest on documentation and how much on bug fixing and implementing new features. I generally enjoy writing technical documentation, but I also know how much work it is.

I am planning to provide more documentation and tutorials for script development one way or anther.

Programming basics will always be a prerequisite. I personally believe that programming is something one can only learn by experimenting, reading code, modifying code, writing code. There is no school or book that will teach you how to program. Trying to extend QCAD with your own tools or add-ons is actually a great way of learning how to program :) You can't really screw up anything, you don't need a compiler or IDE, QCAD and a plain text editor is everything that is needed. ECMAScript (JavaScript) is also one of the most popular languages used today which means there are plenty of resources available online for generic JavaScript problems. E.g. google for "javascript convert string to number" or "javascript append to array", etc.

If I would know nothing about QCAD script development, I would first have a look at the script source code of a simple, existing script (e.g. the tool that draws points in scripts/Draw/Point/Point1P/Point1P.js). Then I would try to change its behavior, for example draw two points beside each other instead of one. Then I would try to copy that new script into a new, independent script and rename it. Step by step taking one tiny step at a time, after each step checking if it is working as expected.
User avatar
andrew
Site Admin
 
Posts: 4015
Joined: Fri Mar 30, 2007 6:07 am

Re: Script attached: box joints

Postby andrew » Fri Jul 12, 2013 2:11 pm

Matthias: I've included this script in the latest QCAD release (3.1.5) under menu Misc - Drawing.

On github, it is checked in under:
https://github.com/qcad/qcad/tree/master/scripts/Examples/DrawExamples/LineBoxjoint

Thanks for this contribution!
User avatar
andrew
Site Admin
 
Posts: 4015
Joined: Fri Mar 30, 2007 6:07 am

Re: Script attached: box joints

Postby matthiaswm » Sat Jul 13, 2013 10:47 pm

Cool! Thanks. I am happy that I was able to contribute something useful :-)
matthiaswm
Junior Member
 
Posts: 23
Joined: Mon Apr 29, 2013 4:34 pm

Re: Script attached: box joints

Postby caigner » Mon Jul 15, 2013 8:30 am

It's great to see good scripts being incorporated into a new version of QCAD. It's now under menu Misc - Drawing.
But I would also like a button in the left-side line drawing menu bar. (it was there, when I installed the script by hand)

Can I do that on my own?
User avatar
caigner
Active Member
 
Posts: 42
Joined: Wed Jan 30, 2013 5:24 pm

Re: Script attached: box joints

Postby andrew » Mon Jul 15, 2013 9:28 am

You'd have to change the contents of the script to add it to the lines tool bar menu.

It's open for discussion where such tools should be in the QCAD menu / tool bar hierarchy.

My reasoning for not putting it together with the line tools was that the existing line tools are completely generic - they are not specific to any particular industry or solving a particular problem.

The box joint tool is specific to creating box joints which are typically used in woodworking or similar industries (correct me if I'm wrong).

In the future, many more such custom-tailored scripts are likely to be added to QCAD and the question arises how and where to fit them into the user interface. At the moment I put this tool under Misc to make it available without nailing down the user interface yet.

I can think of these options:

- Industry specific tool buttons in the CAD tool bar at the left (e.g. architecture, mechanical engineering, wood working, textile industry, ...).
Pros: makes room for very industry specific tools such as a cog wheel generator, or architecture wall tools.
Cons: overlaps, tools that are not 100% generic but not very specific either such as the box joint tool.

- Make the tool more generic. For the box joint tool it would mainly mean to rename it. We'd have to come up with a name for the tool that does not imply usage for a specific industry. Something similar like 'zig zag line' or 'meander' but then not quite - ideas anyone?
Pros: avoids overlaps, no new user interface concepts needed
Cons: this will not work for all tools (think of a tool that generates a cogwheel or a staircase.

- Based on user preferences. A user would have to spend some time to arrange these additional tools in his/her own preferred way.
Pros: makes everyone happy
Cons: users have to invest time, every QCAD installation will look different from every other one, users might loose their own configuration on major updates of QCAD

What's your take on this problem?
User avatar
andrew
Site Admin
 
Posts: 4015
Joined: Fri Mar 30, 2007 6:07 am

Re: Script attached: box joints

Postby Husky » Mon Jul 15, 2013 8:56 pm

andrew wrote:It's open for discussion where such tools should be in the QCAD menu / tool bar hierarchy.

I would prefer a separated menu/Toolbar, maybe called "C-Tools" (Customized Tools) with the possibility of sub-menus like Architecture, walls, Electronic, G-Tools, Misc etc.

andrew wrote:The box joint tool is specific to creating box joints which are typically used in woodworking or similar industries (correct me if I'm wrong).

This is one of the oldest Pattern ever - don't worry to much for what it can be used ;-)
(Architecture, Woodworking, Art, stitching, crochet, stained glass, paintings, quilting etc. etc. etc....)
"Zig zag line" sounds just good to me 8)

andrew wrote:In the future, many more such custom-tailored scripts are likely to be added to QCAD and the question arises how and where to fit them into the user interface. At the moment I put this tool under Misc to make it available without nailing down the user interface yet.

I can think of these options:

- Industry specific tool buttons in the CAD tool bar at the left (e.g. architecture, mechanical engineering, wood working, textile industry, ...).
Pros: makes room for very industry specific tools such as a cog wheel generator, or architecture wall tools.
Cons: overlaps, tools that are not 100% generic but not very specific either such as the box joint tool.

- Make the tool more generic. For the box joint tool it would mainly mean to rename it. We'd have to come up with a name for the tool that does not imply usage for a specific industry. Something similar like 'zig zag line' or 'meander' but then not quite - ideas anyone?
Pros: avoids overlaps, no new user interface concepts needed
Cons: this will not work for all tools (think of a tool that generates a cogwheel or a staircase.

Referring cons: Solution? C-Tools / Sub-menu: G-Tools (Generator tools) ;-)

andrew wrote:- Based on user preferences. A user would have to spend some time to arrange these additional tools in his/her own preferred way.
Pros: makes everyone happy
Cons: users have to invest time, every QCAD installation will look different from every other one, users might loose their own configuration on major updates of QCAD

Referring cons - that doesn't works in the long run!
I see one option to avoid this problem. Provide to the user the possibility to choose by himself the "C-Tool Sources" like the Library Browser what means he can decide the path to his own tools. This path should be outside of any QCAD installation what means he will not loose his own configuration on any QCAD update.
Of course - this has all to be saved in the CAD3.ini what can't be difficult because it would work on the same way like the paths for the Library Browser or to the templates. :wink:
User avatar
Husky
Moderator/Drawing Help/Testing
 
Posts: 1144
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Script attached: box joints

Postby caigner » Tue Jul 16, 2013 7:50 pm

From my perspective I can say: I would like to be able to build my own toolbars. I want all the tools which I need for the project to be just one (or two) mouse click away.
So it would be nice to be able to arrange the buttons as I see fit. And save these arrangements for later use.

In this way I could create toolbars specific to my projects which would greatly enhance workflow. What do you think about that? Could that be done?
User avatar
caigner
Active Member
 
Posts: 42
Joined: Wed Jan 30, 2013 5:24 pm

Next

Return to QCAD 3 ' Script Add-On & Plug-in challenge ' - Work in Progress

Who is online

Users browsing this forum: No registered users and 0 guests