CAD CAM EDM DRO - Yahoo Group Archive

Re: [CAD_CAM_EDM_DRO] CNC scripting stuff....

Posted by Paul Amaranth
on 2005-05-18 11:12:08 UTC
On Wed, May 18, 2005 at 11:03:51AM -0500, Jon Elson wrote:
> Right! TK/TCL are meant for creating GUIs, and are a bit rough, but
> handle a
> lot of the complicated details of packing many windows, buttons,
> sliders, etc.
> onto a screen. But as a programming language, it leaves a GREAT deal to be
> desired. Debugging is nearly impossible, too!
>
> Jon
>

Nah, you're thinking more of Tk which came after Tcl, although it does
make graphical programming pretty simple. Tcl itself is small, very
embeddable, extensible and has trivial syntax. You can write
extensions in Tcl or C and that OO stuff is available if you want it.
As with most tools, proper application is the key to an easy job.

Debugging insn't that big a deal either and there are debugging environments
available as well.

Tcl itself was never meant to be a general purpose programming language
(although you can abuse it that way). It's a scripting language, which
is why it would be useful for the application we were originally
talking about. Given a number of extensions that would generate
appropriate Gcode, it would be trivial to write short scripts that
would produce Gcode to fabricate parts. Now, would you write those
extensions in Tcl? You could, but I'd probably use C myself.

As a thought experiment let's say you had a pocket extension that took
length, width, depth, and X and Y coords of the center and you wanted
to created gcode for a 4 x 4 array of them, the Tcl script might look
something like this:

set gcode []
for [set row 1] [$row < 5] [incr row] {
for [set col 1] [$col < 5] [incr col] {
set X [calculate X coordinate based on row and column]
set Y [calculate Y coordinate based on row and column]
lappend gcode [pocket $length $width $depth $X $Y]
}}
puts $gcode

The key to making this useful is defining the correct extensions with the
right parameters, determining which are optional and what the default
values would be. Then you just write short Tcl scripts to produce the
gcode for whatever without having to worry about a lot of syntactical
gobbledygook.

If you wanted to be fancy, you could keep the gcode in an internal data
structure and optimize it when it was retrieved rather than returning
a list of gcode on each call as shown above.

Paul

--
Paul Amaranth, GCIH | Rochester MI, USA
Aurora Group, Inc. | Security, Systems & Software
paul@... | Unix & Windows

Discussion Thread

Mark 2005-05-17 04:24:08 UTC CNC scripting stuff.... Alex Holden 2005-05-17 05:46:45 UTC Re: [CAD_CAM_EDM_DRO] CNC scripting stuff.... R Rogers 2005-05-17 06:00:26 UTC Re: [CAD_CAM_EDM_DRO] CNC scripting stuff.... Alex Holden 2005-05-17 07:46:58 UTC Re: [CAD_CAM_EDM_DRO] CNC scripting stuff.... Codesuidae 2005-05-17 08:11:30 UTC Re: [CAD_CAM_EDM_DRO] CNC scripting stuff.... Ted Gregorius 2005-05-17 08:42:25 UTC Re: Re: [CAD_CAM_EDM_DRO] CNC scripting stuff.... Codesuidae 2005-05-17 09:21:02 UTC Re: [CAD_CAM_EDM_DRO] CNC scripting stuff.... lcdpublishing 2005-05-17 09:59:55 UTC Re: CNC scripting stuff.... Alex Holden 2005-05-17 10:25:48 UTC Re: [CAD_CAM_EDM_DRO] Re: CNC scripting stuff.... Alan Marconett 2005-05-17 11:00:43 UTC Re: [CAD_CAM_EDM_DRO] CNC scripting stuff.... lcdpublishing 2005-05-17 11:09:14 UTC Re: CNC scripting stuff.... Codesuidae 2005-05-17 11:44:39 UTC Re: [CAD_CAM_EDM_DRO] CNC scripting stuff.... D Cranston 2005-05-17 12:12:46 UTC RE: [CAD_CAM_EDM_DRO] Re: CNC scripting stuff.... Alan Marconett 2005-05-17 12:45:48 UTC RE: [CAD_CAM_EDM_DRO] CNC scripting stuff.... Codesuidae 2005-05-17 13:12:20 UTC Re: [CAD_CAM_EDM_DRO] Re: CNC scripting stuff.... Alex Holden 2005-05-17 13:13:32 UTC Re: [CAD_CAM_EDM_DRO] Re: CNC scripting stuff.... Alex Holden 2005-05-17 13:25:07 UTC Re: [CAD_CAM_EDM_DRO] CNC scripting stuff.... Drew Rogge 2005-05-17 13:30:10 UTC Re: [CAD_CAM_EDM_DRO] Re: CNC scripting stuff.... lcdpublishing 2005-05-17 13:35:02 UTC Re: CNC scripting stuff.... Codesuidae 2005-05-17 13:55:32 UTC Re: [CAD_CAM_EDM_DRO] Re: CNC scripting stuff.... Drew Rogge 2005-05-17 14:03:25 UTC Re: [CAD_CAM_EDM_DRO] Re: CNC scripting stuff.... Codesuidae 2005-05-17 14:07:15 UTC Re: [CAD_CAM_EDM_DRO] CNC scripting stuff.... lcdpublishing 2005-05-17 14:29:53 UTC Re: CNC scripting stuff.... bobmcknight@c... 2005-05-17 15:09:55 UTC Re: [CAD_CAM_EDM_DRO] Re: CNC scripting stuff.... Brian 2005-05-17 15:28:10 UTC Re: [CAD_CAM_EDM_DRO] Re: CNC scripting stuff.... Alan Marconett 2005-05-17 16:24:37 UTC RE: [CAD_CAM_EDM_DRO] CNC scripting stuff.... Paul Amaranth 2005-05-17 17:01:11 UTC Re: [CAD_CAM_EDM_DRO] CNC scripting stuff.... Alex Holden 2005-05-17 23:31:30 UTC Re: [CAD_CAM_EDM_DRO] CNC scripting stuff.... Alex Holden 2005-05-17 23:39:28 UTC Re: [CAD_CAM_EDM_DRO] CNC scripting stuff.... Fred Smith 2005-05-18 05:16:40 UTC Re: CNC scripting stuff.... Drew Rogge 2005-05-18 07:10:58 UTC Re: [CAD_CAM_EDM_DRO] Re: CNC scripting stuff.... Alan Marconett 2005-05-18 09:03:17 UTC RE: [CAD_CAM_EDM_DRO] Re: CNC scripting stuff.... Jon Elson 2005-05-18 09:09:25 UTC Re: [CAD_CAM_EDM_DRO] CNC scripting stuff.... Bruce Pigeon 2005-05-18 09:13:36 UTC Re: [CAD_CAM_EDM_DRO] Re: CNC scripting stuff.... Paul Amaranth 2005-05-18 11:12:08 UTC Re: [CAD_CAM_EDM_DRO] CNC scripting stuff.... Codesuidae 2005-05-18 12:27:07 UTC Re: [CAD_CAM_EDM_DRO] CNC scripting stuff.... bank haam 2005-05-19 06:54:28 UTC Re: [CAD_CAM_EDM_DRO] CNC scripting stuff.... Codesuidae 2005-05-19 07:10:49 UTC Re: [CAD_CAM_EDM_DRO] CNC scripting stuff.... bank haam 2005-05-19 08:14:25 UTC Re: [CAD_CAM_EDM_DRO] CNC scripting stuff.... bank haam 2005-05-19 08:14:31 UTC Re: [CAD_CAM_EDM_DRO] CNC scripting stuff....