Alvin Penner wrote:
Attached is a summary of what I have seen so far (from a purely software point of view) with respect to the use of Inkscape .dxf files in desktop cutting :
Excellent summary! Everyone please read this twice. :-)
- the 'Desktop Cutting' export option supports two basic types of object :
lines and cubic Bezier splines.
- it may sometimes be necessary to use the menu option 'Path | Object to
Path', to convert rectangles, or ellipses, or text, before exporting to .dxf.
I think some motivated hacker should investigate adding an option for output extensions so that they can optionally convert objects and text to paths. This will solve all these problems in one place for all sorts of output extensions.
- the exported .dxf file complies with the Autodesk dxf spec to the extent
that it can be viewed using Autodesk software such as Volo View Express 2.01 and DWG TrueView R17 (2008).
- the exported .dxf file can be both edited and viewed using QCad from
RibbonSoft.
Again, if someone is aware of software that will not open our simple DXFs please file a bug report on launchpad with all relevant example files and error messages.
- the desktop cutting software program Winplot V6.8 from Summa has been
tested on .dxf files. It will load .dxf files, but it does not render the spline correctly : a cubic Bezier spline consisting of four points will be rendered as a combination of a circular arc based on the first three points, and a straight-line segment based on the last two points. The developers at Winplot have been made aware of this issue, but it is not likely that it will be addressed, see https://bugs.launchpad.net/inkscape/+bug/192923/comments/36 . Luckily, in this case there is a workaround, namely use 'Postscript via Cairo' export, which can be read properly by Winplot, see https://bugs.launchpad.net/inkscape/+bug/168411/comments/17 .
I do not believe DXF supports any sort of bezier curve, at least not the mathematical model we are familiar with in Inkscape and most other design oriented software. DXF supports NURB splines. Yes, the curves created by our beloved cubic beziers are a subset of the curves that can be represented by NURBs but many many more curves are possible in the NURB world. Most importantly the on disk representation and the model of interaction are different. (Someone with math-fu please correct me if I've misspoke.)
Anyway for software that cannot interpret DXF SPLINE directives properly we should offer an approximate polyline output. There is python code around to do this polyline approximation (flatten.py), but it could be improved.
- the desktop cutting software program ROBO Master-Pro Version 4.3 from
Graphtec has been tested on .dxf files. It can read .dxf files, and as far as I can tell, it is also rendering them correctly on the screen. However, any attempt to edit a spline that originated from a .dxf file will immediately lead to a software crash. Also, even if this file is saved as a native .GSD format file, and then reloaded as a .GSD file, it will still crash when attempting to edit the spline : which suggests that this is not specifically a .dxf issue, but a more general problem. Also, the ROBO Master software supports the creation and editing of a spline starting from scratch, but the mathematical form of the spline they generate does not appear to be compatible with the cubic Bezier spline that Inkscape uses. I am attaching a .GSD file with both types of spline present. The cubic Bezier spline is not editable (you'll be sorry if you try), but the native ROBO spline is editable. However, no matter how hard I try, I cannot make the two curves superimpose on each other, and I believe they are mathematically incompatible. I have emailed ROBO Master concerning this issue, and will await their response.
- I should not speculate, but I suspect that this mathematical
incompatibility may be the source of some of the mechanical stuttering that has been reported. In any event, it would be a relatively simple matter to produce a reasonable approximation of one spline curve to another, based on matching slopes and curvatures at vertices, but before this is done we need a mathematical description of the shape of the curve that ROBO Master uses.
As I said above, DXF and GSD use NURB splines; SVG uses polycurves comprised of line segments, quadratic beziers, cubic beziers and elliptical arcs. Some conversion is necessary. I believe conversion from SVG paths to NURB splines can maintain the curve perfectly but from what I can understand some approximation may be necessary coming back to SVG from NURB.
The method of conversion I'm currently using in the DXF export is this. Everything in svg is a line or a cubic bezier (cubic beziers can represent all quadratic beziers and elliptical arcs are approximated by a few cubic beziers). SVG cubic beziers are converted to a NURB representation by the method described at the bottom of NURB Curves: A Guide for the Uninitiated By Philip J. Schneider: http://devworld.apple.com/dev/techsupport/develop/issue25/schneider.html
I have a hunch about the issue with DXF->RoboMaster->GSD. The splines in our DXF are a subset of NURBs that prefectly represent cubic beziers. In GSD files and DXF files it is possible to represent any and all NURB curves. The RoboMaster drawing code can draw any NURB but the editing code only understands the subset of NURB curves that their editing interface can create.
That is actually one of the places I got stuck with my GSD exploration. I don't understand NURB curves well enough to have a real solid handle on the NURB representation inside of the GSD file. I can see it. And it makes some sense to me, but not enough to so anything about it. I would like to find a person with sufficient understanding of NURB math to:
1) examine the storage of NURBs in GSD files and explain it so that mortals can implement reading and writing it. 2) examine the editing interface in RoboMaster and postulate what special properties are possessed by the subset of NURBs it will create and edit 3) Provide a method of approximating our cubic bezier NURB subsets with RoboMaster NURB subsets. 4) Provide a method for round tripping NURBs to and from SVG
I think 2Geom can probably provide much help in this area but I haven't found any one interested in working with it yet.
The second issue where I got stuck with my exploration of GSD files is that I don't really know how to program an object model for reading and writing GSD files or any other sort of files. I assume there isn't much magic involved and this is just my inexperience and lack of time showing. I'd love to have some pointers and some help.
Aaron Spike