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

matthiaswm
Junior Member
Posts: 24
Joined: Mon Apr 29, 2013 4:34 pm

Script attached: box joints

Post by 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 1265 times

User avatar
Clive
Moderator
Posts: 1329
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: Script attached: box joints

Post by Clive » Mon May 20, 2013 11:16 am

Hi Matthias

Nice work :wink:
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?
matthiaswm wrote:I used to spend a lot of time creating box joints
Tell me about it :roll: , after years of furniture making you start to see all manner of joints before your eyes :shock:
matthiaswm wrote:(I guess I have to make a video - it's hard to put into words).
Looking forward to it :wink:

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

matthiaswm
Junior Member
Posts: 24
Joined: Mon Apr 29, 2013 4:34 pm

Re: Script attached: box joints

Post by 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.

User avatar
Clive
Moderator
Posts: 1329
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: Script attached: box joints

Post by Clive » Mon May 20, 2013 3:30 pm

matthiaswm wrote:3mm birch, 4mm HDF, and 2-12mm Plexi are my standard materials. Box joints in 12mm Plexi look very neat!
Yes I am using the same range of materials with the addition of paper and card stock and real wood veneers.
matthiaswm wrote:but the laser cutter won't cut it
Just make them 2D only and not mitred/bevelled :wink:

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 4931
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Script attached: box joints

Post by 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)

matthiaswm
Junior Member
Posts: 24
Joined: Mon Apr 29, 2013 4:34 pm

Re: Script attached: box joints

Post by 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

User avatar
andrew
Site Admin
Posts: 9019
Joined: Fri Mar 30, 2007 6:07 am

Re: Script attached: box joints

Post by 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
Husky
Moderator/Drawing Help/Testing
Posts: 4931
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Script attached: box joints

Post by 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
Clive
Moderator
Posts: 1329
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: Script attached: box joints

Post by Clive » Wed May 22, 2013 3:12 pm

Hi Matthias
Your 'Box joint' script is an absolute blessing for me, I am finding it invaluable for medieval castle design, for typical curtain walls etc. it is just perfect :wink: .

Here is an example of a 'typical' castle curtain wall.
Wall curtain.png
Wall curtain.png (53.57 KiB) Viewed 38740 times

matthiaswm
Junior Member
Posts: 24
Joined: Mon Apr 29, 2013 4:34 pm

Re: Script attached: box joints

Post by matthiaswm » Wed May 22, 2013 3:41 pm

The source code is available, so you can easily add the arrow holes ;-) .

User avatar
Clive
Moderator
Posts: 1329
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: Script attached: box joints

Post by Clive » Wed May 22, 2013 3:54 pm

Matthias, if I could - I would, I'm afraid I don't know any coding at all but I would be willing to learn how to do some basic scripting in QCAD, all I need is some tuition. I have tried to figure out how to do some from the examples given on the main website - but for me I need a beginners guide to scripting in QCAD.

I am more that willing to learn and I just hope that Andrew or anyone willing to, could write up a basic introduction for starting to script in QCAD. I know I don't speak only for myself when I say that I would love to try and contribute to QCAD in this way.

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

User avatar
J-J
Moderator
Posts: 502
Joined: Tue Mar 24, 2009 9:48 pm

Re: Script attached: box joints

Post by 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
andrew
Site Admin
Posts: 9019
Joined: Fri Mar 30, 2007 6:07 am

Re: Script attached: box joints

Post by 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
Clive
Moderator
Posts: 1329
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: Script attached: box joints

Post by Clive » Thu May 23, 2013 11:36 am

Thank you Andrew for your words of encouragement here, getting the balance on where to spend the time in any commercial business is essential and I fully understand.

I look forward to any documentation/tutorials that you may be able to offer, for me I would think that a 'work - along' type of workbook would be good with examples and exercises that people can use, this type of workbook is the best and I would think that something like this could easily be added to accompany the existing 'QCAD book' as another book that people can purchase.

Yes I agree that actually doing and experimenting is the best way to learn anything and I guess that part is up to me/others to get 'stuck in' and give things a go :wink: and of course we have the 'Developers' forum to ask questions in.

Thanks again.

User avatar
andrew
Site Admin
Posts: 9019
Joined: Fri Mar 30, 2007 6:07 am

Re: Script attached: box joints

Post by 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/maste ... neBoxjoint

Thanks for this contribution!

Post Reply

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