Rambler
Active Member
(Firstly, a paragraph of background info)
Last October the North London Group meeting featured a presentation on Laser Cutting and 3D printing by Tim and Terry of the Princes Risborough club. As a result I’ve downloaded the recommended software, Fusion360, to see how I get on with 3D modelling, and joined a maker space that has a laser cutter. Playing around with the “home” version of Fusion360 I was impressed by its capabilities - much easier to use than TurboCAD, and not restricted like OnShape. One particularly interesting aspect was the use of Dimensions to parameterise drawings, i.e. if you change a value in the dimensions table then the drawing gets re-drawn using that dimension. However, this can be a bit tricky as (a classic problem) the tool will only change things according to what you’ve told it, which may not be necessarily everything you want. And working out what the tool needs to know in order that all the things change in the way that you want isn’t always straightforward. As it happens, in 3D modelling I’m at a very early stage and can get by without being able to parameterise designs.
The ability to change designs by modifying parameters, as found in Fusion360, set me thinking about its application to artwork for etching (in brass or nickel silver). So I checked out whether any of the CAD packages that I use for 2D drawing (Autosketch, TurboCAD, QCAD) had a parameterisation scheme, but drew a blank. However, I discovered that QCAD has a scripting interface. This is a different concept but I think it can deliver something like the same capability.
This scripting interface is revealed via the menu : Misc/Developer/Script Shell.
So I started with some experiments, one of the early ones being this :
function draw_box(bottom_left_x, bottom_left_y, width, height) {
addLine(bottom_left_x, bottom_left_y, bottom_left_x, bottom_left_y + height)
addLine(bottom_left_x, bottom_left_y + height, bottom_left_x + width, bottom_left_y + height)
addLine(bottom_left_x + width, bottom_left_y + height, bottom_left_x + width, bottom_left_y)
addLine(bottom_left_x + width, bottom_left_y, bottom_left_x, bottom_left_y)
}
function three_boxes(centre_x, floor_y) {
// draws three boxes width 5 at centres : C - 8, C, C + 8
draw_box(centre_x -10.5, floor_y +10, 5, 10)
draw_box(centre_x - 2.5, floor_y + 11,5,9)
draw_box(centre_x + 5.5, floor_y + 10,5,10)
}
three_boxes(20,20)
three_boxes(50, 20)
three_boxes(80,20)
three_boxes(115,20)
If you have QCAD and want to try this, just cut and paste this text into the script command line.
This produces the design shown below
Last October the North London Group meeting featured a presentation on Laser Cutting and 3D printing by Tim and Terry of the Princes Risborough club. As a result I’ve downloaded the recommended software, Fusion360, to see how I get on with 3D modelling, and joined a maker space that has a laser cutter. Playing around with the “home” version of Fusion360 I was impressed by its capabilities - much easier to use than TurboCAD, and not restricted like OnShape. One particularly interesting aspect was the use of Dimensions to parameterise drawings, i.e. if you change a value in the dimensions table then the drawing gets re-drawn using that dimension. However, this can be a bit tricky as (a classic problem) the tool will only change things according to what you’ve told it, which may not be necessarily everything you want. And working out what the tool needs to know in order that all the things change in the way that you want isn’t always straightforward. As it happens, in 3D modelling I’m at a very early stage and can get by without being able to parameterise designs.
The ability to change designs by modifying parameters, as found in Fusion360, set me thinking about its application to artwork for etching (in brass or nickel silver). So I checked out whether any of the CAD packages that I use for 2D drawing (Autosketch, TurboCAD, QCAD) had a parameterisation scheme, but drew a blank. However, I discovered that QCAD has a scripting interface. This is a different concept but I think it can deliver something like the same capability.
This scripting interface is revealed via the menu : Misc/Developer/Script Shell.
So I started with some experiments, one of the early ones being this :
function draw_box(bottom_left_x, bottom_left_y, width, height) {
addLine(bottom_left_x, bottom_left_y, bottom_left_x, bottom_left_y + height)
addLine(bottom_left_x, bottom_left_y + height, bottom_left_x + width, bottom_left_y + height)
addLine(bottom_left_x + width, bottom_left_y + height, bottom_left_x + width, bottom_left_y)
addLine(bottom_left_x + width, bottom_left_y, bottom_left_x, bottom_left_y)
}
function three_boxes(centre_x, floor_y) {
// draws three boxes width 5 at centres : C - 8, C, C + 8
draw_box(centre_x -10.5, floor_y +10, 5, 10)
draw_box(centre_x - 2.5, floor_y + 11,5,9)
draw_box(centre_x + 5.5, floor_y + 10,5,10)
}
three_boxes(20,20)
three_boxes(50, 20)
three_boxes(80,20)
three_boxes(115,20)
If you have QCAD and want to try this, just cut and paste this text into the script command line.
This produces the design shown below
Last edited: