Hi Stéphane
This looks very interesting, you also have a beautiful website-Patrick
Stéphane ANCELOT wrote:
Hi,
I have already done the same kind of thing but from dxf to svg. have a look at http://sancelot.wordpress.com/2007/07/13/enhanced-dxf2svg/
you will find my code : // create curves points from spline definition void spline::compute_path() { int step = 25; double t,t2,t3; double Cm1,C0,C1,C2;
ctrl_pts r,Pm1,p0,p1,p2; computed_path.clear(); for (int i=0;i< control_points.size() - 3;i++) { Pm1 = control_points[i]; p0 = control_points[i+1]; p1 = control_points[i+2]; p2 = control_points[i+3]; for (int s=0;s<=step;s++) { t = double(s) / (double) step; t2 = t * t; t3 = t2 * t; Cm1 = -1.0/6.0 * t3 + 0.5 * t2 - 0.5 * t + 1.0/6.0; C0 = .5 * t3 - t2 +2.0/3.0; C1 = -.5*t3+.5*t2+.5*t+1.0/6.0; C2 = 1.0/6.0*t3; r.x = Cm1*Pm1.x+C0*p0.x + C1*p1.x+C2*p2.x; r.y = Cm1*Pm1.y+C0*p0.y + C1*p1.y+C2*p2.y; r.z = 0; computed_path.push_back(r); } } } Best Regards S.Ancelot
Aaron Spike a écrit :
Jim Ford wrote:
Are the dxf files created by Inkscape's export non standard or otherwise 'funny'? Does anyone know of a 'workaround' for this problem, please?
The DXF files exported by Inkscape export curves as standard DXF SPLINEs. Some software is not able to handle such NURB curves. An option would be to decompose the curves into polylines, though this would make the output noticeably slower and less exact. Please recognise that the DXF output from Inkscape is not expected to be generally useful DXF output. It was developed to suit the needs of a very specific community of users and is labeled as such.
Aaron Spike
This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user