The Mechanics may be a bit strange. The selection is based on a "starting point" (from now: "sp") and an "end point" ("ep"). So only a continuous sequence can be selected. I don't know if I'll alter it in the future to be able to select multiple sequences. For some features like delete and move it would be useful, but a CNC code is a sequence after all. For example: how/where would I copy/paste multiple sequences? Anyway, the "sp" can be selected with left click, the "ep" with shift+left click. The selection remains, until another point is clicked or esc is pressed. (so no "deselection" on every clicks, it's just like in most CAD software).
Some features behave differently if only the "sp" or only the "ep" or both/neither of them are selected. Most of the time the place of the effect varies. Before "starting point", after "end point", between them, or after the last point.
(the different effects will be listed like this: only the "sp", only the "ep", both, neither of them)
- basic constrains: when moving stuff and pressing 'shift', the movement will be constrained in a vertical/horizontal line depending on the mouse position.
- adding a point: before "sp", after "ep", after "sp", after last point. Snapping to grid (0.01 mm step) can be toggled. The adding feature has the basic constrains and
- tangential constrain: collinear with first segment after "sp", collinear with last segment before "ep", collinear with first segment before "sp", collinear with last segment. And
- cross constrain: the point will be placed at the intersection of the two lines that are the neighbours of the segment where the point is inserted
- reverse direction of selected sequence
- reduce point count on selected sequence
- set feed rates: only "sp" selected: simply inserts a F... command at that point, both selected: inserts a F.. command at "sp", clears all other F... commands from the sequence, inserts a F.... with the appropriate value after "ep" (the last feed rate change before "ep")
- remove close points: removes all points that are too close to each other (in the sequence, not in absolute coordinates)
- round all points: al points are rounded (floor/ceil/to closest) to a certain value (this will be used to test the interference between the precision of the machine and the CNC file's values)
- Clipboarding features: paste before "sp", after "ep", replace selection, paste after last point
- Copy with base point/paste at mouse position
- can start from an empty project: add points with the add command
- Some eye candy features:
- the direction of the sequence is displayed when selected: a small arrow. This arrow implies the line for the tangential constrain too
- the segment where the new point will be inserted is highlighted
- a little ruler with the measure is displayed
- legend with feedrates (my favourite)
These are pretty much everything I needed. There's a main issue though: it's very slow. So much string parsing/reparsing/seeking all the time. Sometimes the application needs to parse 20000 points, that can be 25000 lines of code. Just a regular CNC program. But I don't think that's too much. But it takes about 4-5 seconds just to parse the whole text. Not to mention other operations: parsing+manipulating+reparsing etc etc. I need to do something about this, because it's more than annoying unfortunately. The problem is that the lines in the text vary in length (a line is between two '\n' characters). Maybe I will drop the original idea to just store the whole file in a one dimension array. I think I have to use 2 dimensions, flags pointers and other shit to avoid parsing if possible.
But at least I can work with it. Except for the speed issue it's very good and fast to work with. I could make a program in 15 minutes with it, before that it took a whole day in stressed attention. Just to put together the final program from the pieces. Of course the time to draw the lines with CAD isn't affected. Making a CAD software would be too great job (well, not that great just a lot of time). But I can even make simple programs from starch without the need to make the stuff in some vector editor first.
Anyway, [size="4"]Here it ising