Desktop Cutting Plotter (*.dxf) compatibility with ROBO Master

Bug #255157 reported by Alvin Penner
2
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Undecided
Unassigned

Bug Description

    This is a proposal for a new format of .dxf output, which has been customized to be compatible with ROBO Master-Pro software. The new format is presented as an option, with the original format being the default. The original format uses a spline that has a knot vector (0,0,0,0,1,1,1,1), with 4 control points. It is faithful to the original Bezier spline, but it is not compatible with ROBO Master. ROBO Master software requires that the spline must have internal fit points in order to be editable, because it uses fit points, not control points, for editing. In addition, the ROBO Master software assumes that the curvature at the endpoints is zero.
    To meet these requirements, the spline has been promoted to have the knot vector (0,0,0,0,u1,u2,1,1,1,1), with 6 control points, which is consistent with the native ROBO Master spline. The calculation proceeds in three steps:
    - calculate 4 fit points using the values u = (0, 1/3, 2/3, 1) where u is the independent variable in the Bezier spline.
    - calculate the knot vector values (u1, u2, 1) by setting them to be proportional to the cumulative path length between these four points. This is consistent with normal AutoCAD .dxf output, as well as ROBO Master .gsd output. It is an implementation of what is called the chord length method in Piegl (page 364).
    - calculate constraints on the 6 control points by using the knot insertion equations of Piegl (page 143) to relate control points to fit points. This is not enough to specify the curve uniquely. The remainder of the specification comes from the fact that all (Open) ROBO Master splines have zero curvature at the endpoints. This is also consistent with an editing mode in AutoCAD in which the slopes at the endpoints are left unspecified. It has, however, the unfortunate consequence that the resulting spline is not compatible with the original Bezier spline. Typically this new spline will be "smoother" than the original curve, and there may be discontinuities in slope at the vertices. However, it is editable in ROBO Master, as intended.
    Mathematical information is from "The NURBS Book" by Les Piegl and Wayne Tiller (Springer, 1995). Many thanks to Aaron Spike and the Cuft project: the program gsd2txt.py was used routinely to provide information on the .gsd format and compare it to .dxf data.
    Any feedback would be greatly appreciated on whether this affects the actual cutting process, since that is the intent of this modification.

Tags: dxf exporting
Revision history for this message
Alvin Penner (apenner) wrote :
Revision history for this message
Aaron C Spike (acspike) wrote :

WOW!

I would very much appreciate if you could write out a more detailed explanation about the subsets of NURBs and how they relate. I think this information would be very helpful to whomever it is that decides to take the next stab at GSD files. If you have discovered any additional tidbits of the GSD format, please send me a patch with annotations for cuft.

How much inconsistent with the original beziers are these new NURBs? Can you attach some screenshots? Could we subdivide the beziers before turning them into NURBs to preserve the shape better? Is it possible to merge adjacent beziers into a single NURB?

Alvin, do you have commit rights to inkscape yet? How many patches have you submitted now?

Revision history for this message
Alvin Penner (apenner) wrote :

    - found out the hard way that this proposal will not run under the official release of Inkscape 0.46 stable. So here is a version custom-made for 0.46 stable. This has been hardcoded to run only the new style of spline, not the old. Before running it, best thing would be to rename the file C:\Program Files\Inkscape\share\extensions\dxf_outlines.py to be something else like dxf_outlines_old.py in case you want to go back to the original version. Then copy these two new files into this same directory. Once this is done, the cutting plotter dxf output should operate the same as before, but hopefully different when you load them into ROBO Master.
    - will post a few sample dxf files shortly, showing the difference between the two styles
    - don't have commit rights, I've submitted one successful patch so far, which was Bug 192923 . Submitted a few proposals for patches, Bug 186432 and Bug 179560 , but they were kind of specialized, designed to suit my own personal interests, and they are sort of in a state of limbo.

 will provide more info in a day or two
APP

Revision history for this message
Alvin Penner (apenner) wrote :

    attached are some demo files (.dxf) showing a comparison of the two types of spline. They were produced by typing a spline into Inkscape and outputting it as .dxf using both options, and then splicing the two .dxf files together to superimpose the images. In each case there will be two splines which will cross each other at two internal points (or more). One of the splines (ROBO) will have zero curvature at the endpoints. The agreement between the two splines is best for the case of a symmetric curve, presumably because the curvature at the endpoints is less in this case, for the original Bezier spline.
    if you load these into QCad, and try to edit them, the Bezier spline will display 4 control points, and the ROBO spline will show 6 control points. Of the 6 points, the first 3 and the last 3 will be collinear, which is a reflection of the property that the curvature is zero.
     if you load these into ROBO Master and try to edit them, then the Bezier spline will cause a crash, and the ROBO spline will display two internal fit points, which will apear at the crossover of the two curves, and will be editable with (hopefully) no unexpected consequences.

Revision history for this message
Alvin Penner (apenner) wrote :

- committed to svn 19670
- will check out the Windows nightly build in 2 days or so.

Alvin Penner (apenner)
Changed in inkscape:
status: New → Fix Committed
Alvin Penner (apenner)
Changed in inkscape:
status: Fix Committed → New
Revision history for this message
Alvin Penner (apenner) wrote :

    re-opening this in order to submit a proposal for an enhancement in the ROBO Master output, namely multisplines.
    In the original proposal, each Bezier spline was represented by a separate NURB, even if the Bezier splines were joined with smooth nodes. This led to discontinuities in the slope at each joint (within the ROBO option, not the original option). The new proposal will generate a multispline of indeterminate length as long as all the elements are splines with smooth nodes. The slope will be continuous at internal joints between splines and the multispline will not break apart upon editing in ROBO Master.
    Only the spline-to-spline joint is affected, joints between splines and lines are treated as separate objects, as before.
    Only the file dxf_outlines.py is affected, and it can be used as a direct replacement of the previous file.
    Any feedback would be welcome, particularly from ROBO users.

Revision history for this message
Alvin Penner (apenner) wrote :

    Attached is a demo file showing the difference in output. the original file is trial.svg. it consists of 12 Bezier splines joined by smooth nodes. From this, both the previous output and the new output were generated and spliced together. In the file trial.dxf, the original output is black, and the multispline is green. The original output had 11 cusps, where the slope was discontinuous. The green line will not break apart, if edited in ROBO Master.

Revision history for this message
Alvin Penner (apenner) wrote :

   the file dxf_outlines.py will not run under the 0.46 stable release from April 1, because of the presence of a new option button to enable the ROBO output.
   the attached file, dxf_outlines_46stable.py, should run, it has been hardcoded to run only the ROBO output, not the original version. Before installing it, make a backup copy of
C:\Program Files\Inkscape\share\extensions\dxf_outlines.py
and rename this file to be dxf_outlines.py

Revision history for this message
Alvin Penner (apenner) wrote :

committed to svn 19809

Changed in inkscape:
status: New → Fix Committed
Alvin Penner (apenner)
Changed in inkscape:
status: Fix Committed → Fix Released
su_v (suv-lp)
tags: added: dxf exporting
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.