Jump to content

Bezier curves vs. segmented curves


spiderartist

Recommended Posts

Now we're into my own specific problem. I've never had/used Illustrator. I'm not involved with CNC processing as much any more, else I probably would have invested in the package.

 

I do have an old version of CorelDraw, however. And I did have direct access to a Pen/Knife plotter with CorelDraw support, which was better at reproducing curves compared to what it would accept from a DXF file.

 

Perhaps there is some intermediate step, CAD/Vector file - PostScript - NC/G-Code, that the DXF files miss out on, thus forfeiting all of the Spline geometry.

 

Or, based on this quote:

 

My machine works fine with curves created in vector illustration software, such as CorelDraw or Adobe Illustrator. Sometimes when I import a dxf file into either program, it works fine and sometimes it doesn't. . . . .

 

Nurbs Curves that only have features of Beziers - Splines with Degree + 1 Control Vertices (none of the higher Non-Uniform and/or Rational bits) can be processed correctly.

Edited by SEANT
Link to comment
Share on other sites

  • Replies 46
  • Created
  • Last Reply

Top Posters In This Topic

  • SEANT

    18

  • SLW210

    12

  • lrm

    7

  • spiderartist

    5

Top Posters In This Topic

Posted Images

SLW210, thank you for the file. The file contains a "new" spline but not an "old" spline. I've included an S in the attached file SSSSS.dwg (5 S's). I created it by converting a polyline to a spline. I estimated the location of the CVs needed then adjusted their location after giving the PEDIT S command. I used 9 CVs to get a close approximation to your original S.

 

Please convert this file to Illustrator then export as a dxf file.

 

Thank you,

 

Lee

SSSSS.dwg

Link to comment
Share on other sites

The SSSS.dxf and the S.dxf are interesting, and what I think are the crux of the problem.

 

The "S" in the straight Illustrator to DXF export results in combined Beziers. It actually shows as a Non-Uniform type of Nurbs, but an explode reduces it to the individual Bezier sections.

 

 

A typical AutoCAD Spline to Illustrator import to DXF export results in segmented poly (as demonstrated by the first "S" in SSSS.dwg/SSSS.dxf).

 

 

What would happen if the attached file is brought into Illustator? Does the Modified "S" (Red) still get reduced to a faceted Poly?

 

Edit: Looking at this now on my phone I see that the attachment didn't get included. I'll have to do that when I get back to the desk.

Edited by SEANT
Link to comment
Share on other sites

The SSSS.dxf and the S.dxf are interesting, and what I think are the crux of the problem.

 

The "S" in the straight Illustrator to DXF export results in combined Beziers. It actually shows as a Non-Uniform type of Nurbs, but an explode reduces it to the individual Bezier sections.

I agree. The original spline with many CVs (almost 50) is broken up with EXPLODE into a series of splines with 4 CVs each which could be cubic Bezier splines. Explode cannot be used on the resulting spline but PEDIT will convert it into a polyline with hundreds of vertices.

 

Here's what the translation of the AutoCAD file to Illustrator to DXF does with the four S's of the original file:

 

  • A "new" Spline (NURBS) becomes a polyline
     
  • Two arcs become 2 "new" splines
     
  • A 2d polyline is still a 2d polyline

 

It is interesting to note that arcs are converted to splines in this process and splines become polylines. The conversion from AutoCAD to Illustrator to DXF and back to AutoCAD has made the arc a more complex object. I would expect arcs to keep their identity or at the least simplified to a segmented polyline. I would think the conversion from arc to NURBS would make it more difficult for some post processors to handle.

 

What is the DXF format of a spline that has been created directly in Illustrator?

Link to comment
Share on other sites

I took your DWG and ran the 4 "S's" through the posting process for our machine. Interestingly, even the 1st S (I assigned them numbers from left to right) posted properly, even being splines. I haven't run them through the controller yet but the code seems correct. I'll post the actual G code for the 4 attempts. The last one, the outline polyline, I erased the right side of the form to give it a no-kerf cut to match the others.

 

1st S (from left to right):

G90

G0X12.8518Y-2.0555

(Set 1 torches at 0.0000 inches)

M00 (Program Stop)

M58

M70

G3X11.6853Y-1.2292I-15.2951J-20.3539

G3X10.4454Y-0.5476I-4.5769J-6.8570

G3X7.8858Y-0.0023I-2.6944J-6.3682

G3X5.2478Y-0.4091I-0.1871J-7.5431

G3X0.6096Y-4.6842I2.7091J-7.5928

G3X0.0014Y-7.6744I6.3663J-2.8520

G3X1.1029Y-11.5008I8.2011J0.2891

G3X2.3009Y-13.1100I7.0861J4.0250

G3X3.8282Y-14.3026I4.7913J4.5616

G3X5.5260Y-14.9738I3.6329J6.7062

G3X6.8834Y-15.2845I4.7934J17.8211

G2X8.9393Y-15.7040I-8.3032J-45.9475

G2X10.8742Y-16.3968I-1.8694J-8.2683

G2X12.3813Y-17.4890I-3.1332J-5.9093

G2X14.9067Y-22.6163I-5.9944J-6.1381

G2X13.1847Y-28.5227I-7.9488J-0.8867

G2X10.3310Y-30.7523I-6.4593J5.3261

G2X6.7983Y-31.6083I-3.7260J7.6602

G2X2.7225Y-30.5161I-0.1795J7.4820

G2X1.4181Y-29.4905I4.7046J7.3254

G2X0.2355Y-28.2918I18.7906J19.7209

M71

 

2nd:

G90

G0X12.8504Y-2.0348

(Set 1 torches at 0.0000 inches)

M00 (Program Stop)

M58

M70

G3X7.2225Y-15.2951I-5.1968J-5.6188

G2X0.2341Y-28.2710I-0.4255J-8.1407

M71

 

3rd:

G90

G0X13.1175Y-2.1946

(Set 1 torches at 0.0000 inches)

M00 (Program Stop)

M58

M70

G3X6.7488Y-15.3867I-5.3932J-5.5297

G2X0.5012Y-28.4308I0.5408J-8.2773

M71

 

 

4th (left half of the outline form)

G90

G0X0.3010Y-25.4389

(Set 1 torches at 0.0000 inches)

M00 (Program Stop)

M58

M70

G1X0.7075Y-25.6712

G1X1.1774Y-25.9775

G1X1.7371Y-26.2995

G1X2.2176Y-26.5424

G1X2.7350Y-26.7906

G1X3.3053Y-27.0282

G1X3.9336Y-27.2552

G1X4.4352Y-27.4136

G1X4.9896Y-27.5667

G1X5.5862Y-27.6829

G1X6.2145Y-27.7674

G1X6.8851Y-27.8149

G1X7.4342Y-27.8254

G1X8.0995Y-27.7990

G1X8.7384Y-27.7304

G1X9.3508Y-27.6142

G1X9.9369Y-27.4506

G1X9.9950Y-27.4347

G1X10.6127Y-27.2077

G1X11.1830Y-26.9279

G1X11.7057Y-26.5952

G1X12.0067Y-26.3576

G1X12.4607Y-25.9299

G1X12.8514Y-25.4389

G1X13.1841Y-24.9003

G1X13.3319Y-24.5994

G1X13.5431Y-24.0397

G1X13.6857Y-23.4378

G1X13.7702Y-22.7936

G1X13.7913Y-22.2392

G1X13.7490Y-21.5634

G1X13.6329Y-20.9351

G1X13.4375Y-20.3596

G1X13.1946Y-19.8844

G1X12.8462Y-19.3669

G1X12.4449Y-18.8865

G1X11.9908Y-18.4377

G1X11.6423Y-18.1473

G1X11.1460Y-17.7935

G1X10.6180Y-17.4556

G1X10.0583Y-17.1282

G1X9.4723Y-16.8220

G1X9.4247Y-16.7956

G1X8.8545Y-16.5210

G1X8.2843Y-16.2465

G1X7.7088Y-15.9666

G1X7.1280Y-15.6868

G1X6.9062Y-15.5812

G1X6.3254Y-15.3119

G1X5.7552Y-15.0268

G1X5.1902Y-14.7311

G1X4.6305Y-14.4302

G1X4.3665Y-14.2770

G1X3.8121Y-13.9391

G1X3.2894Y-13.5748

G1X2.7931Y-13.1788

G1X2.3285Y-12.7617

G1X2.1701Y-12.6086

G1X1.7371Y-12.1545

G1X1.3464Y-11.6635

G1X0.9926Y-11.1407

G1X0.6864Y-10.5758

G1X0.5966Y-10.3857

G1X0.3802Y-9.8471

G1X0.2112Y-9.2716

G1X0.0898Y-8.6539

G1X0.0211Y-7.9939

G1X0.0000Y-7.3444

G1X0.0264Y-6.6739

G1X0.1003Y-6.0297

G1X0.2218Y-5.4120

G1X0.3907Y-4.8259

G1X0.6125Y-4.2609

M71

G0X0.6178Y-4.2557

M70

G1X0.9082Y-3.6854

G1X1.2461Y-3.1574

G1X1.6368Y-2.6611

G1X2.0697Y-2.2017

G1X2.3549Y-1.9430

G1X2.8353Y-1.5787

G1X3.3581Y-1.2461

G1X3.9125Y-0.9504

G1X4.5091Y-0.6970

G1X5.0529Y-0.5016

G1X5.6337Y-0.3379

G1X6.2304Y-0.2006

G1X6.8534Y-0.1056

G1X7.4923Y-0.0370

G1X8.1576Y-0.0053

G1X8.4849Y0.0000

G1X9.1132Y-0.0211

G1X9.7468Y-0.0792

G1X10.3804Y-0.1848

G1X11.0193Y-0.3168

G1X11.6371Y-0.4699

G1X12.2126Y-0.6389

G1X12.8356Y-0.8765

G1X13.4164Y-1.1246

G1X13.7438Y-1.2830

G1X14.3826Y-1.6632

G1X14.6361Y-1.8533

M71

Link to comment
Share on other sites

I took your DWG and ran the 4 "S's" through the posting process for our machine. Interestingly, even the 1st S (I assigned them numbers from left to right) posted properly, even being splines. I haven't run them through the controller yet but the code seems correct. I'll post the actual G code for the 4 attempts. The last one, the outline polyline, I erased the right side of the form to give it a no-kerf cut to match the others.

 

1st S (from left to right):

G90

G0X12.8518Y-2.0555

(Set 1 torches at 0.0000 inches)

M00 (Program Stop)

M58

M70

G3X11.6853Y-1.2292I-15.2951J-20.3539

G3X10.4454Y-0.5476I-4.5769J-6.8570

G3X7.8858Y-0.0023I-2.6944J-6.3682

G3X5.2478Y-0.4091I-0.1871J-7.5431

G3X0.6096Y-4.6842I2.7091J-7.5928

G3X0.0014Y-7.6744I6.3663J-2.8520

G3X1.1029Y-11.5008I8.2011J0.2891

G3X2.3009Y-13.1100I7.0861J4.0250

G3X3.8282Y-14.3026I4.7913J4.5616

G3X5.5260Y-14.9738I3.6329J6.7062

G3X6.8834Y-15.2845I4.7934J17.8211

G2X8.9393Y-15.7040I-8.3032J-45.9475

G2X10.8742Y-16.3968I-1.8694J-8.2683

G2X12.3813Y-17.4890I-3.1332J-5.9093

G2X14.9067Y-22.6163I-5.9944J-6.1381

G2X13.1847Y-28.5227I-7.9488J-0.8867

G2X10.3310Y-30.7523I-6.4593J5.3261

G2X6.7983Y-31.6083I-3.7260J7.6602

G2X2.7225Y-30.5161I-0.1795J7.4820

G2X1.4181Y-29.4905I4.7046J7.3254

G2X0.2355Y-28.2918I18.7906J19.7209

M71

. . . .

 

So, based on post processing the DWG file, your Pipeline created Multiple arc from the input spline. Not a bad compromise. It sounds like a CAD jockey could send native AutoCAD splines, and your pipeline would create a reasonable facsimile.

 

I suppose, though, the customer may feel more comfortable generating their own Arc recreation - to be sure they new what they were dealing with.

Link to comment
Share on other sites

. . . .

 

What is the DXF format of a spline that has been created directly in Illustrator?

 

The resultant DXF file shows the same as if there were several Degree 3 Beziers (Splines with 4 CPs) joined together via AutoCAD's JOIN command.

 

Arcs changing to splines in the AutoCAD - Illustrator - DXF conversion is not a surprise. CorelDraw and, from what I hear, Illustrator do not have a pure Circle entity. They just combine 4 arc-like Beziers together. Those software packages do not support Rational splines either, so the circular elements are not 100% accurate.

Link to comment
Share on other sites

I'd be interested to know how Illustrator and/or a Post Processor would deal with the red "S" in the attached DXF (The file I was supposed to include with my post earlier this morning).

Ss_Mods.dxf

Link to comment
Share on other sites

Red S posted through like the others:

G90

G0X12.8518Y-2.0555

(Set 1 torches at 0.0000 inches)

M00 (Program Stop)

M58

M70

G3X11.6853Y-1.2292I-15.2952J-20.3539

G3X10.4454Y-0.5476I-4.5769J-6.8570

G3X7.8858Y-0.0023I-2.6944J-6.3682

G3X5.2478Y-0.4091I-0.1871J-7.5431

G3X0.6096Y-4.6842I2.7091J-7.5928

G3X0.0014Y-7.6744I6.3663J-2.8520

G3X1.1029Y-11.5008I8.2011J0.2891

G3X2.3009Y-13.1100I7.0861J4.0250

G3X3.8282Y-14.3026I4.7913J4.5616

G3X5.5260Y-14.9738I3.6329J6.7062

G3X6.8834Y-15.2845I4.7934J17.8211

G2X8.9393Y-15.7040I-8.3032J-45.9475

G2X10.8742Y-16.3968I-1.8694J-8.2683

G2X12.3813Y-17.4890I-3.1332J-5.9093

G2X14.9067Y-22.6163I-5.9944J-6.1381

G2X13.1847Y-28.5227I-7.9488J-0.8867

G2X10.3310Y-30.7523I-6.4593J5.3261

G2X6.7983Y-31.6083I-3.7260J7.6602

G2X2.7225Y-30.5161I-0.1795J7.4820

G2X1.4181Y-29.4905I4.7046J7.3254

G2X0.2355Y-28.2918I18.7907J19.7209

M71

 

I was expecting trouble with the splines but again had none. I find this interesting in itself as up until this version of the host software, I have been unable to work with splines at all. It still remains to be seen if the controller interprets things correctly; no reason it shouldn't as the code looks viable.

 

Edit to add: look comparable to the original, comparing G code

Link to comment
Share on other sites

So it does appear that your pipeline will convert splines to arcs automatically. That may be the best we can expect. And given that the above G-Code is similar to what you posted previously, there's not much sense in subdividing the original spline to the piecemeal Bezier replica. Looking at the G-Code, though, the arcs (at least the first couple) do not appear to meet their neighbors tangentially. Maybe not a problem.

Link to comment
Share on other sites

Yikes! That's some bizarre stuff. The "S" curve via Bezier sub-section seemed to hold up well.

 

Water jet. Damn. Wouldn't I love to have access to one of those.

Link to comment
Share on other sites

As soon as I dropped them in Illustrator. I had hoped the export back would help, but no. I have Illustrator CS2 which is older, so I have to save them down to 2000.

 

I'll see how Inkscape does later, time permitting.

 

I'm out of town til Tuesday for a long weekend after today, if time allows, I will do some more on this today.

Link to comment
Share on other sites

Yikes! That's some bizarre stuff. The "S" curve via Bezier sub-section seemed to hold up well.

 

Water jet. Damn. Wouldn't I love to have access to one of those.

 

I'm hopeful my interactions with the water jet will be minimal, so far the claims by the manufacturer are it works with lots of file types and has it's on stand alone CAD package, we will see.

 

https://www.omax.com/omax-machine/80x-series

 

https://www.omax.com/software

 

https://www.omax.com/software/file-support

Link to comment
Share on other sites

Here are the Inkscape results, I have a few more options with the latest Inkscape over the older Illustrator.

 

In order....

 

Options on Insert

Warning when inserting SSSSS.dxf

DXF save options

Inkscape DXF Insert.png

Inkscape SSSSS.png

Inkscape DXF Save.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...