Circle export to EPS

This forum is for general discussion about Aspire
Post Reply
keith20mm
Posts: 22
Joined: Fri Sep 11, 2009 2:01 pm

Circle export to EPS

Post by keith20mm »

A circle exported to EPS creates four Bezier "curveto" commands, instead of the expected single "arc" command.

Is there some means to get a single arc command instead of four curveto commands?

Example, in inches units:

Create a 1" circle at center (0,0), select it, then export the selected vector to .EPS file.

File contents:

0.000000 36.000000 moveto
-19.882251 36.000000 -36.000000 19.882251 -36.000000 0.000000 curveto
-36.000000 -19.882251 -19.882251 -36.000000 0.000000 -36.000000 curveto
19.882251 -36.000000 36.000000 -19.882251 36.000000 0.000000 curveto
36.000000 19.882251 19.882251 36.000000 0.000000 36.000000 curveto
stroke


(36.0000 is one half of 72 points per inch)

So there are four curveto commands.

Meanwhile, opening an .EPS with the following:

0.0 0.0 36.0 0. 360. arc
stroke


Produces a circle with the a single arc command... which, inexplicably, becomes exported as four Bezier curves.

How to export a circle as a single arc EPS command?

User avatar
mtylerfl
Vectric Archimage
Posts: 5865
Joined: Thu Jan 29, 2009 3:54 am
Model of CNC Machine: -CarveWright CNC -ShopBot Buddy PRSAlpha
Location: Brunswick, GA

Re: Circle export to EPS

Post by mtylerfl »

keith20mm wrote:A circle exported to EPS creates four Bezier "curveto" commands, instead of the expected single "arc" command...
As far as I can tell, the EPS format will always convert arcs to Beziers
Michael Tyler

facebook.com/carvebuddy

-CarveWright CNC
-ShopBot Buddy PRSAlpha CNC

User avatar
Adrian
Vectric Archimage
Posts: 14541
Joined: Thu Nov 23, 2006 2:19 pm
Model of CNC Machine: ShopBot PRS Alpha 96x48
Location: Surrey, UK

Re: Circle export to EPS

Post by Adrian »

If you want to preserve arcs you would have to export as DXF.

4DThinker
Vectric Wizard
Posts: 1701
Joined: Sun Sep 23, 2012 12:14 pm
Model of CNC Machine: CNC Shark Pro, Probotix Meteor 25" x 50"

Re: Circle export to EPS

Post by 4DThinker »

Circles done in Aspire are composed of 4 arc sections, probably as having 4 nodes make it easier to connect/snap to and break up into useful corner rounds or half rounds when making profiles of a part. You can simplify them a little by using the arc command to make two half circles using the same end points then joining them together. The resulting circle will have only two nodes, 180 degrees apart. That should EPS export as just 2 curves. Not a whole lot of help, but could reduce a file composed of nothing but circles by 50%.

User avatar
TReischl
Vectric Wizard
Posts: 4575
Joined: Thu Jan 18, 2007 6:04 pm
Model of CNC Machine: 8020 48X36X7 RP 2022 UCCNC Screenset
Location: Leland NC

Re: Circle export to EPS

Post by TReischl »

keith20mm wrote:A circle exported to EPS creates four Bezier "curveto" commands, instead of the expected single "arc" command.
.
.
.
.

Produces a circle with the a single arc command... which, inexplicably, becomes exported as four Bezier curves.

How to export a circle as a single arc EPS command?
You do not state WHY this would be important to you? Do you have a reason other than you think it should be a single arc?

Way back there were two types of machines, those that cut full circles with a single command and those that had to have it broken into arcs that did not span more than 90 degrees. I doubt that is why Vectric chose to use 4 arcs, those machines are extremely far and few between these days.

The other reason I can think of to want a single arc is that it "saves" file space. Way back machine memory was very limited and every byte counted. Not so much anymore unless you are running a relic. These days, software like Mach3 is not limited to any great extent by file sizes, it just feeds the machine as it goes. I think my biggest file size to date has been about 64 Mb.

One other thing to consider is that virtually all machines use a buffer, so producing 4 arcs does not affect cutting, the machine does not hesitate as it goes around a circle with four arcs unless you have the exact stop (in position) function activated.

So, why do you need a single arc for circles?

I have been running this software for over ten years now and have not had the need to force a circle to a single command.

One thing you mentioned is that you are "exporting" the drawing. This would imply that you are using another piece of software in some manner to manipulate that circle. Consider that Vectric produces their software as a CAD/CAM package. The intent is to be able to draw and toolpath without the need for exterior software. That said, I typically use Corel for all my designing because that is what I have used for years and years. Interestingly enough Corel also exports circles with four nodes. So it is not unusual for this to occur. Vectric is obviously not the only one doing it. My guess is that Corel is not going to change.

The more I think about this, the more it makes sense to NOT create a true circle entity. By using four bezier arcs the circle can be stretched into an oval. A true circle entity would not be able to do that since there would be no handles to manipulate it other than radius, and I am not sure that is possible in EPS format.
Last edited by TReischl on Mon Jul 31, 2017 2:14 pm, edited 1 time in total.
"If you see a good fight, get in it." Dr. Vernon Johns

User avatar
TReischl
Vectric Wizard
Posts: 4575
Joined: Thu Jan 18, 2007 6:04 pm
Model of CNC Machine: 8020 48X36X7 RP 2022 UCCNC Screenset
Location: Leland NC

Re: Circle export to EPS

Post by TReischl »

Adrian wrote:If you want to preserve arcs you would have to export as DXF.
Hello Adrian, exporting a circle drawn in Aspire as a DXF creates a Polyline in the dxf file that is not a single arc. From my quick look it appears to be four vertices (individual arcs).

This is sort of weird to me because I have never had the need to export something I drew in Aspire into another drawing program where it might become important. But that is just me!

I am curious to hear WHY this important!!!
"If you see a good fight, get in it." Dr. Vernon Johns

User avatar
Adrian
Vectric Archimage
Posts: 14541
Joined: Thu Nov 23, 2006 2:19 pm
Model of CNC Machine: ShopBot PRS Alpha 96x48
Location: Surrey, UK

Re: Circle export to EPS

Post by Adrian »

Yeh, I remembered not long after posting that Aspire converts DXF "circles" into arcs when importing which is why I use DXF when transferring between incompatible versions. :oops:

keith20mm
Posts: 22
Joined: Fri Sep 11, 2009 2:01 pm

Re: Circle export to EPS

Post by keith20mm »

So, why do you need a single arc for circles?

I have been running this software for over ten years now and have not had the need to force a circle to a single command.

One thing you mentioned is that you are "exporting" the drawing. This would imply that you are using another piece of software in some manner to manipulate that circle. Consider that Vectric produces their software as a CAD/CAM package. The intent is to be able to draw and toolpath without the need for exterior software. That said, I typically use Corel for all my designing because that is what I have used for years and years. Interestingly enough Corel also exports circles with four nodes. So it is not unusual for this to occur. Vectric is obviously not the only one doing it. My guess is that Corel is not going to change.

The more I think about this, the more it makes sense to NOT create a true circle entity. By using four bezier arcs the circle can be stretched into an oval. A true circle entity would not be able to do that since there would be no handles to manipulate it other than radius, and I am not sure that is possible in EPS format.
I have need of generating vectors from various mathematical calculations, external to Aspire, and then loading them into Aspire to create tool paths.

Upon export from Aspire, I'd like to see the exported file contain the vectors I imported, not some close approximation to the vectors.. but the same vectors.

A 360 degree arc (a circle), which becomes a 4-segment Bezier will NEVER match the original circle, as the Bezier is a cubic function, and can NEVER ever fit a circle. It can hit the circle at a few points on the circumference but elsewhere will always be in error.

Better than importing a programatically generated vector file would be that Aspire provide or expose a COM-type automation interface, or document as such, if it is already provided. By that manner, the import/export need would not be needed, as Aspire could be controlled externally, via capabilities that simply are not provided in the interface. LUA script (a gadget) would be an internal corollary to an external COM- automation, however I see no easy way to interface a database (CTree+) which is built into my own generating software.

The simple EPS circle, generated by "arc" contains three parameters: X, Y, Radius (the other two parameters are begin angle, 0, and end angle, 360)

The close approximation to Bezier requires a moveto, then four curveto commands, where two of the parameters (x,y) pairs are locations of the Bezier control points.

If you look at a "circle" created by four Bezier vectors, you'll find that the calculation to locate the "radius" of the "close circle" really isn't one number.. it is a function which produces an infinity of "radii", hence, there is no real circle with the provided implementation.

The best one may do is to calculate a bounding box that contains the four Bezier curves, however, there is no guarantee that the given Bezier curves are aligned on the x- or y- axis. They could be aligned on any angle, and the calculation for the bounding box produces a bounding box with width/height that differs from the expected "circle" diameter.

A simple "arc" of 360 degrees or 0..2PI or true circle is neded for my purpose.

PaulRowntree
Vectric Wizard
Posts: 1687
Joined: Sun Oct 24, 2010 7:28 pm
Model of CNC Machine: homebuilt 4'x2' (Mach3+G540)
Location: Guelph, Ontario
Contact:

Re: Circle export to EPS

Post by PaulRowntree »

I don't know if this will help...
The 2D CSV gadget lets you create an ASCII file with high or low-level vector descriptions, and creates the internal Vectric equivalents when loaded. One one-line command is to draw circles, and they are created as 2 180 degree arcs if memory serves. There are several other 2D shapes possible (rectangle, trig functions, pie shapes, NACA profiles, etc) as well as polylines. If you want, you can add your own shapes in the LUA code.
Attachments
TreeSoft CSV.pdf
(1.39 MiB) Downloaded 151 times
Paul Rowntree
WarpDriver, StandingWave, Topo and gadgets available at PaulRowntree.weebly.com

User avatar
TReischl
Vectric Wizard
Posts: 4575
Joined: Thu Jan 18, 2007 6:04 pm
Model of CNC Machine: 8020 48X36X7 RP 2022 UCCNC Screenset
Location: Leland NC

Re: Circle export to EPS

Post by TReischl »

Other than "I would like to see" you have not stated a reason why this would be beneficial to other users.

Keep in mind that the concept behind Aspire is to create models and toolpaths, not feed other software programs.

From what you have told us, this does not seem to be some really important feature needed by most users. I could be wrong. . . .
"If you see a good fight, get in it." Dr. Vernon Johns

Post Reply