Problems with exports to AI and DXF

Next
 From:  obscure (PLEONARD23)
5914.1 
I have a large set of curves, all on the same plane that I have been trying to export to either an AI or DXF file in such a way that I can use it to have the parts laser-cut. However, when I do the AI export I can't find anything that will open it (I don't have illustrator), and when I export the file to a DXF (with all the different options tries) I find that when I open this file parts of my drawing are moved around in a weird way. It's not a global issue, as it only SEEMS to be happening on certain parts, but I can't see any rhyme or reason to it. Can someone help me out here?


Paul

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
5914.2 In reply to 5914.1 
Hi Paul, can you also attach the DXF file that has pieces moved around so I can take a look at the DXF too?

What program are you reading the DXF file into? Certain programs are not able to read some kinds of data from DXF files.

Since you already have your curves all arranged in a plane already, when you export you probably want to set "Export type = 3D curves" which means it will write the curves just as they are rather than doing any kind of planar projection on them.

But anyway if you also attach the DXF file that has stuff moved around in it, that would sort of help to see what problem you're running into since it's hard for me to understand what you're describing just by "moved around in a weird way"...

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
5914.3 In reply to 5914.1 
Also for opening up AI files you might try Mayura draw (very inexpensive): http://www.mayura.com/ or Creature House Expression (it's old but free): http://download.microsoft.com/download/a/5/d/a5d625a5-2e3d-4e9c-8608-6de48d7b569f/CreatureHouseExpression3_3.exe

Also an old version of Adobe Illustrator is available for free here: http://www.adobe.com/downloads/cs2_downloads/

Any of those should work for opening up AI files saved out from MoI.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  obscure (PLEONARD23)
5914.4 In reply to 5914.2 
Thanks Michael, I had intended to attach one of the DXF files. This one I've exported using the 3d curves as splines, if you compare the two side by side with the MOI model you should see the difference immediately. I've tried using LibreCad and Inkscape to view the DXF files, with the same results. I also tried the export with polylines with the same results. I've shared both of them.

Paul

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  moujiik
5914.5 In reply to 5914.1 
Try the rebuild command on the two bigger plates

Moujiik

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
5914.6 In reply to 5914.4 
Hi Paul, I tested reading your DXF files into MoI, Rhino, and ViaCAD and they seemed to come in fine in all of these.

It may be possible that both LibreCAD and Inkscape are not able to figure out what unit system the DXF file is supposed to be in - there is "sort of" a setting in DXF files for units but it's fairly obscure and so some programs don't know what units the coordinates in the file are supposed to be in. There may be some option in those programs that you can set to tell them that your DXF file is in millimeter units.

Does an incorrect unit system being used explain the weird results that you're seeing?

Maybe you'll need to include a screenshot of the weird results as well since I cannot get any bad results over here with those same files...

If it looks like you're getting squashed shapes in places where there should be circular arcs, then that means that the program does not support reading full spline information from the DXF file, it's ignoring one piece of the spline information called "weights" that can be set on splines that are arc or ellipse segments.

If that's what you're seeing you can set the option in MoI for "Write curves as: Cubic splines", which will rebuild any curve that has weights in it with a non-weighted curve for the export, and that should avoid the type of spline data that those programs are not handling properly. When weighted splines are read in but with the weights ignored it can kind of mutate the shape. If that is the problem then you may want to report it as a bug in both of those programs, if they read in spline entities they should be reading in all the data including the weights, they shouldn't just be ignoring the weight values or else you get weird results like you have seen.

If the "weight values just being ignored" is the problem then you should also have seen ok looking shapes with either the "Write curves as: cubic splines" or the "Write curves as polylines" options set at export time from MoI though, and from your original description it sounded like you were also seeing problems with these options set though is that correct or do those options make ok looking results for those programs?

- Michael

EDITED: 25 May 2013 by MICHAEL GIBSON

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  obscure (PLEONARD23)
5914.7 In reply to 5914.6 
Ok, I'm attaching a PNG with the export of what LibreCAD and Inkscape seem to come up with. I guess this is more in reference than anything else, since I downloaded a trial of CorelDraw which is what the laser cutter software uses to actually do the cuts and it looks fine there. In addition I opened up the DXF with a free viewer on my iPad and it looks fine there too. I tried FreeCAD and it had the same positioning problems as inkscape and LibreCAD but also had the additional problem of looking like someone drew the picture with a crayon. Go figure.

I would understand if things were squished or distorted, but the issue is a weird thing where it just moves circles around to where they shouldn't be.
Image Attachments:
Size: 16.6 KB, Downloaded: 45 times, Dimensions: 1024x600px
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
5914.8 In reply to 5914.7 
Hi Paul, well that is pretty weird, it looks like multiple bugs in their importer. It looks like it's probably got the "weights are ignored" problem that I mentioned earlier, that's why the arc corners in some of your larger outline shapes are somewhat squished. The circles don't get squished like those other longer curve corners because the circles are written as special "Circle" entity types rather that as general spline entities.

That's really weird that some circles are just misplaced - the way circles are handled in DXF is kind of a little complex, you have to pay attention to making a coordinate system based around the z axis of the circle. My guess is that maybe some circles happen to have their z axis pointing downwards and there is a bug in those programs where they don't deal with generating the proper coordinate system for those circles with the downward pointing extrusion axis.

I wouldn't be very surprised if all 3 of those programs (LibreCAD, Inkscape and FreeCAD) were all using one same open source CAD library that has these bugs in it.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
5914.9 In reply to 5914.7 
I just did a quick debug test, and it does appear that the circles that are not placed properly are ones where the "extrusion direction" of the circle which defines its local coordinate system happens to be pointing in the downward z direction rather than the upward z direction as the rest of them.

So if you want to send in any bug reports for those programs, you could include that information - the "Object coordinate system" (OCS) is not being handled correctly in those programs for circles with a downward pointing extrusion direction vector.

I could probably adjust this in MoI so that it would automatically flip the extrusion vector in cases like this so that it would always be pointing towards the world z axis direction and that would then avoid running into that particular bug in these importers, I'll put that on my list.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
5914.10 In reply to 5914.9 
The ones that have "downward pointing" normals were probably created by mirroring other ones, when mirrored the kind of natural local z axis for a circle gets flipped around, that's probably why some happen to be pointing downwards. It's not supposed to make any difference, but these programs that are having problems most likely have a bug in their implementation of the DXF "arbitrary axis algorithm" where they're not generating the coordinate system for downward pointing extrusion vectors properly. The arbitrary axis algorithm needs special case handling when the extrusion direction is colinear in any way with the world z axis, and they're probably only handling the special case when it's in the same direction as world z.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  obscure (PLEONARD23)
5914.11 
Wow, that's a really bizarre and specific kind of problem. I will have to make sure that I keep an eye on that going forward, because I didn't know about that. Fortunately it appears that Corel Draw is smart enough to know how to open the file, so I am saved. However, I will probably try flipping around the parts that are wandering off just to see if I can make a difference.

Thanks again for all the help, I appreciate it!

Paul
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
5914.12 In reply to 5914.11 
Hi Paul,

> However, I will probably try flipping around the parts that are wandering
> off just to see if I can make a difference.

If you copy one of the other circles that is not wandering around in place of the wandering ones it should then work ok with those buggy importers.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Michael Gibson
5914.13 In reply to 5914.11 
I've updated MoI's DXF exporter for the next v3 beta release so that for circle and arc entities it will avoid writing an extrusion vector of straight downwards in z and instead flip those to upwards z instead. That should avoid running into the wandering circle bug in those importers with the next v3 beta.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All