javascript documentation

Discussions around the CAM Add-On of QCAD version 3

Moderator: andrew

javascript documentation

Postby toolsnglue » Sun Oct 13, 2013 6:15 pm

Is there any place where the javascript api can be downloaded as a PDF formatted file?

I'm considering moving from IMService's VectorCAD/CAM which is a Windows program to QCAD for my Mac. One of the issues preventing me from moving are the lack of some of the functions that make generating G-Code easier.

I'd like to see how difficult it would be to write some functions that would create a tool-path from a selected object. For example, if I wanted to cut a 1 inch square from a piece of sheet using a 0.125 inch end mill, I'd have to draw a line on each edge of the square offset by 0.0625 (radius of end mill to be used) Then, I'd want to connect each of those lines by an arc of radius 0.0625 whose center is the corner of the 1 inch square. That object, consisting of four lines and four arcs is the tool path which I'd want to convert to G-Code.

Has anyone working using QCAD written scripts that provide that functionality? Also, If that square was to be cut from 0.25 inch thick material using my Sherline mill, I'd probably want to make several shallow cuts around the object, and then complete it with a finishing cut the complete 0.25 inch. Again, this might be accomplished with a script that could be customized to each object. Has anyone written any scripts to provide that functionality?

Thanks for your comments,
Toolznglue
aka Jerry Jankura
toolsnglue
Registered Member
 
Posts: 2
Joined: Tue Mar 09, 2010 5:10 am

Re: javascript documentation

Postby andrew » Mon Oct 14, 2013 12:14 pm

toolsnglue wrote:Is there any place where the javascript api can be downloaded as a PDF formatted file?


No, the API documentation is only available online at:
http://qcad.org/doc/qcad/latest/developer/

toolsnglue wrote:I'd like to see how difficult it would be to write some functions that would create a tool-path from a selected object. For example, if I wanted to cut a 1 inch square from a piece of sheet using a 0.125 inch end mill, I'd have to draw a line on each edge of the square offset by 0.0625 (radius of end mill to be used) Then, I'd want to connect each of those lines by an arc of radius 0.0625 whose center is the corner of the 1 inch square. That object, consisting of four lines and four arcs is the tool path which I'd want to convert to G-Code.


QCAD Professional and QCAD/CAM offer a tool and API that creates equidistant polylines with optional arcs at corners:
http://www.qcad.org/doc/qcad/latest/ref ... nt_en.html

QCAD/CAM does not calculate tool radius compensation at this point though it would be possible to create a CAM configuration for QCAD/CAM that does that.
Most controllers support automatic tool compensation through G codes (G41, G42, G40).

toolsnglue wrote:Has anyone working using QCAD written scripts that provide that functionality? Also, If that square was to be cut from 0.25 inch thick material using my Sherline mill, I'd probably want to make several shallow cuts around the object, and then complete it with a finishing cut the complete 0.25 inch. Again, this might be accomplished with a script that could be customized to each object. Has anyone written any scripts to provide that functionality?


QCAD/CAM has no built in feature for that. Again, it would be possible to implement such behavior in a CAM configuration file based on user input, layer naming convention or custom properties assigned to entities.
User avatar
andrew
Site Admin
 
Posts: 2568
Joined: Fri Mar 30, 2007 6:07 am

Re: javascript documentation

Postby toolsnglue » Mon Oct 14, 2013 8:42 pm

The problem with the poly line tool is that it works only with poly lines, and not with an object that was constructed using a number of lines and curves.
toolsnglue
Registered Member
 
Posts: 2
Joined: Tue Mar 09, 2010 5:10 am

Re: javascript documentation

Postby andrew » Tue Oct 15, 2013 9:39 am

If your contour consists of unambiguously connected lines and arcs, you can easily convert them to a polyline using Draw - Polyline - Create from Segments.
Polylines are typically more convenient for CAM processing, but they can also be exploded into lines and arcs again: Modify - Explode

If your contour does not consist of unambiguously connected lines and arcs (e.g. three lines connect to the same point), further processing will be tricky or even impossible without additional user input.
User avatar
andrew
Site Admin
 
Posts: 2568
Joined: Fri Mar 30, 2007 6:07 am


Return to QCAD 3 CAM Add-On

Who is online

Users browsing this forum: No registered users and 2 guests