PDA

View Full Version : problem exporting to DXF file



jpaugh78
12-05-2005, 11:28 AM
My father owns a CNC router, and he's trying to have it make him a sign. I drew out the letters in 2d using lightwave, but when i went to export it to DXF it told me that it wouldn't support polys with 4 or more points. I Tripled it, so that that there were only 3-point polys...then exported it. The problem is that his router will see all the inside polys (the ones not needed when its cutting the letters out) so i need to figure out how to make letters with only doing an outline of them. If i simply erase all the polys and trace around the outside edge it makes the letters to blocky and not curvy like they need to be.

So basically.....Is there any way to draw out letters using only 2 or 3 point polys....and only making an outline of them for the router to cut out? I am doubting its possible...but i thought i'd ask.

toonafish
12-05-2005, 12:31 PM
I dont know what a CNC router is but if it can read 2 point poly's you can create those from a polygon with more the 4 points like this.

-select the polygon
-hit 'b" for Bevel
-click once in the screen so you create a bevel with zero offset
-de-activate the bevel tool, hit 'm" for merge to merge all the points
-go to polygon mode and delete all the selected polygons

if all went well you're left with just an outline made from 2 point poly lines.

jpaugh78
12-05-2005, 01:16 PM
Well, i tried what you suggested and it worked, sorta. I exported it fine, but when he tries to load the file in AutoCAD it gives him an error saying its an incomplete DXF file. *sighs*

toonafish
12-05-2005, 01:34 PM
doesn't surprise me, not a lot of programs support 2 point poly's.

you could try to skip the merging part, then you're left with 4 point poly's.

Silkrooster
12-05-2005, 03:02 PM
The dxf file wouldn't import into autocad anyways. Autocad uses the cad version of dxf and lightwave uses the modeler version. If you open a dxf file from each program in a text editor, autocad uses splines and modeling programs like lightwave uses 3dfaces. Use D-Storms (http://www.dstorm.co.jp/english/plugin/object.htm) dxf export plugin for autocad.
Whether 2 point polys work in autocad, don't know as I don't have AC, but being splines is should.
Hope this helps,
Silk

LightHeaded
12-05-2005, 03:09 PM
You mentioned you have AutoCad. Why not then create the text in ACAD and use the 'Explode Text' routine to convert the text to 2-point lines or polylines or whatever the CNC cutter wants? SaveAs a .DXF file out of ACAD.

EDIT:
Otherwise, if you're most comfortable with LW for creating the text/sign, do the steps suggested by toona (above), then use Accutrans 3D to create the .DXF from .LWO. Acad will read that.

jpaugh78
12-05-2005, 05:48 PM
The reason we can't use AutoCAD is that when dad tried that, the router acted like there wasn't anything there. I thought i'd give it a try from Lightwave. I'll see if i can get something to export it into the correct type that AutoCAD will see, thanks for mentioning that, i didn't know.

Edit: He didn't know about the explode text thing....where is that at in autoCAD?

LightHeaded
12-05-2005, 07:57 PM
Well, Explode Text was a freebie 16KB autolisp program provided back with ACAD14 in the bonus menus. Your dad may have it (filename TXTEXP.lsp).

Also, check out AccuTrans 3D downloadable with a 30-day trial. I noticed it has text creation features and can save out a good .DXF

or if you want, I can take a crack at it.

jpaugh78
12-06-2005, 06:04 AM
Well, so far so good....i downloaded that Accutrans 3D program and used it to re-export the file. Dad was able to open it in autoCAD and was able to manipulate the data. He was in the middle of saving it with autoCAD when i got off the phone with him, hopefully it will work when he sends it to the router to cut out the letters. Thanks for the info Lightheaded. I'll check out the text explode thing later, but i'll have to be on his computer, because he's not that good at doing things like that.

LightHeaded
12-06-2005, 08:22 AM
good luck...let us know if it worked.

I'm also into metalwork. Your dad is cutting steel, right? Maybe he can help me with a small task creating a thin plate with four address numbers. I can do it with a plasma cutter, but too rough on the edges.


Another suggestion with Accutrans is to 'Join Polygons' first if you use it to create 2D text for .DXF output.

jpaugh78
12-06-2005, 08:49 AM
Actually, he's a carpenter. I'm doubting his would be very good at cutting steel, just wood. The one he got has the ability to do small carving, if he wanted to, but he mainly uses it to do complex cuts and drilling. He mainly does conference rooms, and displays for various companies. I'll let you know if he gets this worked out, he hasn't talked to me since this morning when i posted my earlier post.

LightHeaded
12-06-2005, 09:32 AM
ahhh, just noticed you mentioned CNC "router" in 1st post. That would be wood.

In the future, for text>dxf, your dad should get setup with 'explode text' in ACAD because it can turn any(?) font into simple polylines for the CNC...and he can edit as he likes without all the conversions.

jpaugh78
12-06-2005, 09:41 AM
But...but...but.....then i wouldn't get paid for helping him! Hehe, just kidding. The next chance i get i'll try to see if i can get that set up for him. If he has that file....how does it work? Is it just an add-on to autoCAD, or what?

LightHeaded
12-06-2005, 09:57 AM
1.You could use the autolisp>load tool to install txtexp.lsp (sim. to loading a plugin).
2.Execute the command:txtexp
3.Select the text...and BOOM! it is exploded and ready for exploitation using acad tools like any other simple object.

jpaugh78
12-06-2005, 10:11 AM
Okay, you may have to walk me through it since i don't have audoCAD on this system. He's using AutoCAD 2000 lite edition, i know that much. Are you saying he has to type these commands into the command prompt, or is the autolisp>load in the menu somewhere in autoCAD? Sorry for asking stupid questions, but its been a couple of years since i've used autoCAD. I'll just need to be able to tell him how to do the process over the phone, so i'll need to know what to do, hehe. Thanks for all your help so far.

MicroMouse
12-06-2005, 11:59 AM
jpaugh78: You are now successfully converting your LWO file to DXF with AccuTrans. If you have trouble creating a successful tool path from the DXF file, I suggest that you ask some questions in a CNC forum or newsgroup. I haven't done anything with CNC software and can not give any pointers.

The 2 point polys from the LWO fiile are converted to the LINE entity in the DXF file by AccuTrans. The CNC software may need the line segments organised into continuous line segments and saved as a POLYLINE entity for conversion to a tool path. When AccuTrans converts a BMP file to a 3D object and a special way of converting TrueType fonts the outlines can be saved as polylines to a DXF file.

Silkrooster: There is only one type of DXF file. AutoDesk created the DXF file format for AutoCAD. A DXF file can contain points, 2D or 3D drawing entities in any combination that the CAD technician decides to use. There are newer versions of DXF files that contain features that were not in the older versions just as there is newer versions of LightWave, Max, Maya, etc. files.

3D modelling programs generally only support a limited number of the DXF drawing entities. The 3DFACE entity is used for triangles and quads, the LINE entity is used for 2 point polys and the POINT entity is used for 1 point polys.

DXF files also support SOLID models but as supporting this requires an expensive license from Spatial Technologies for the solid modelling software kernel you have to pay a premium for any software that supports solid models.

LightHeaded
12-06-2005, 12:25 PM
Okay, you may have to walk me through it since i don't have audoCAD on this system. He's using AutoCAD 2000 lite edition, i know that much. Are you saying he has to type these commands into the command prompt, or is the autolisp>load in the menu somewhere in autoCAD?hmmm, I've never used the "Lite" editions, so I'm not sure it has the AutoLisp compiler included. Maybe not.

In standard ACAD,
yes...autolisp>load is in the menus under 'Tools' pulldown. Once the lisp routine is "loaded", then that command will be available at the command prompt. In this case, type in 'txtexp'.

jpaugh78
12-06-2005, 12:33 PM
Okay, i had him check, and Autolisp isn't under tools. So it must not be an option in the lite edition. Guess he'll need me after all, lol. Thanks for your help.

LightHeaded
12-06-2005, 12:39 PM
MicroMouse,

Could you provide insight on what you consider the best and worst paths for 3D model translations between LW and ACAD (or vice-versa).

By "best", I mean most efficient and accurate. I've come across .STL, .DXF, VRML, .3DS, .WMF, also noticed ACIS. Any opinions?

Thought I'd ask since you stopped by. It's a bit overwhelming.

MicroMouse
12-06-2005, 06:58 PM
DXF files are the best way to go back and forth from AutoCAD for efficiency and accuracy provided you use a program that does a good job of converting to and from DXF.

When the CAD drawing will be used for rendering in a program like LightWave, you should avoid building with solids unless the shape of the object is easier to make with solids. The reason is that when solids are converted to polygons the polygon count is usually much higher than needed. AutoCAD gives no control over how many polygons will be created for a solid. As you zoom in on the solid AutoCAD will render more polygons in the view window. When you export the solid to a 3DS file, the closer you are zoomed to the solid the more triangles there will be in the 3DS file. If you model with solids a good practice is to
1. export the solid to a 3DS file.
2. import the 3DS file back into AutoCAD and delete the original solid.

ACIS files are used to transfer the solids as solids between CAD programs. You need a more expensive program to convert the ACIS files to polygons due to licensing cost for the solid modeling kernel. Both PolyTrans and Deep Exploration have an optional, higher cost add-on module due to licensing cost.

DWG is a proprietary file format created by AutoDesk for AutoCAD. Technical information is not released for the file format. The people at Open Design Alliance have reversed engineered the DWG file format. If your customer will only supply DWG files and you do not have AutoCAD, click on the "alliance members" button at http://www.opendesign.com/
There are companies on this list that provide software for under USD 100.00 that convert DWG files to DXF files. If the DWG files contain solids you will have to go for one of the more expensive programs available on this list.

STL files are only supposed to contain one object / layer even though many programs write many layers to the STL file. Color is not saved to the file. STL files are used by software that prepares tool paths for CNC machining.

VRML files can be written many different ways with various options and might not be imported correctly. AccuTrans does not handle all possible variations in VRML files.

WMF files are not suitable.

If you use AccuTrans for converting from DXF files:
- drawings do not have to be exploded
- blocks are supported
- solids and external references are not supported.
- each DXF layer becomes a layer in AccuTrans
- if more than one drawing pen is used on the layer, the layer can be divided into multiple layers.
- points, 2D and 3D entities are supported including polylines with width and thickness.
- CAD programs do two sided rendering so many polygons have flipped surface normals which can be quickly flipped in AccuTrans.
- drawing can be scaled and positioned around / near the origin.

If you use AccuTrans to convert to DXF files:
- a LWO layer with multiple surfaces becomes multiple layers in AccuTrans and each layer is saved to the DXF file
- "layers" section must be written to the DXF file so that the layer names and colors will be available for AutoCAD
- 1 and 2 point polys can be saved to the DXF file
- drawing can be scaled back to the units of measurement used in AutoCAD.

LightHeaded
12-06-2005, 10:15 PM
:bowdown:
Many thanks for info and tips!
Gotta print and save.

I wouldn't have thought of saving ACAD as .3DS and then re-importing. I'll give that a shot.


Another issue can you help with...
Say (in ACAD) I extrude 8ft. high walls from a 2D flr plan composed of simple 2-pt lines (or polylines for that matter). As you know, the walls will have no top face because it's not a solid that's being extruded. Question is would Accutrans be able to provide that top face?

A simpler way to ask this is if I extrude a 2D square such that it creates a box, I would like for the top face of the box to be a closed face without the need to add the top face manually.

I have encountered two programs in the past that have this feature. In the software, after importing the .dxf, I would just check a box titled: "Save Extrusion Caps", so there was an option to have the caps or not. With the cap, the box will behave in the rendering software as a shell of a box rather than a true solid. However, this software is way obsolete by now. Is this something Accutrans can handle?

I can explain further if I'm unclear.

MicroMouse
12-07-2005, 01:11 PM
After the DXF file has been imported into AccuTrans, you can not mark any objects to have end caps made for extrusions. As the drawing entity is read from the DXF file, it is immediately converted into 3D polygons and added to all other polygons already converted for that layer.

If you model in AutoCAD using the REGION entity, export the drawing as a R12 DXF file and AccuTrans will automatically create polygons for the regions. If the regions are too complex in shape the triangulation function in AccuTrans may make a mistake. Later versions of DXF files can not be supported for regions because the region data has been encoded by AutoDesk.

Circles, arcs and bulges (the curved section) for polylines are a continuous drawn shape in a CAD program. A polygon modelling program has to approximate these shapes with short line segments. In AccuTrans you can control the number of line segments used for the arcs. Use the "File->Open With Options" menu command and click on "DXF Segments Per Arc" button to set the number of line segments.

When you put end caps on extrusions for curved surfaces in CAD, you must be careful how you do it when the CAD object will be converted to a polygon object. Consider putting a cap on a cylinder. Recall that curves are represented by line segments. If the start point for the curve for the cap is 5 degrees off the start point for the circle for the cylinder, the vertices for the line segments for the cap will not match up with the vertices for the line segments for the cylinder and your polygon object will have holes and leak light.

LightHeaded
12-07-2005, 06:23 PM
:cry:
I was hoping for better news (about the end caps).

So, if I'm understanding you, I can take advantage of REGION to "cap" tops, provided I save back to R12 dxf. That's not so bad a workaround.

Will you be developing Accutrans further? If so, I would like to make a feature request :D


Thanks again for the valuable advice. I think it will help me greatly :thumbsup:

MicroMouse
12-07-2005, 09:10 PM
Yes, just save REGION to a R12 DXF file.

AccuTrans is still being developed and you can make a feature request.

LightHeaded
12-07-2005, 09:44 PM
:D My feature request is for an option to "cap" extrusions automatically. So upon importation of dxf, when Accutrans encounters a closed shape composed of coplanar lines, curves, polylines, etc., it will cap the closed shape on bottom and top.

Further, a (coplanar) closed shape within a closed shape would be interpreted as a "hole".

Essentially, it would negate the need to create REGIONs or 3DFACEs in ACAD for extruded objects. Saves tons of time for folks modelling in ACAD. Unsure about other CAD sw.

Not sure I explained that well, but that's my request in a nutshell.

----------------------

BTW, I don't think there's mention of Accutrans support of regions in the help file:

Entities Supported for conversion to 3D objects

. LINE
. CIRCLE
. ARC - number of segments (lines) per arc used can be varied for different arc sizes.
. TRACE
. SOLID
. BLOCK
. ENDBLK
. INSERT - name, insertion point, scale factor, rotation angle, column and row spacing and counts for Blocks are supported.
. POLYLINE - all features supported.

. simple polyline
. polylines with different starting and ending widths for each segment of the polyline.
. polylines that have been closed in any direction.
. polylines that have been curve-fitted or spline-fitted.
. polylines with bulges.
. 3D POLYGON MESH - can be closed in any direction.
. 3D POLYGON FACE - recommended that faces be made as triangles. The current algorithm may not properly decode polygons with more than 3 edges.

. VERTEX - used with POLYLINE
. SEQEND
. 3DLINE
. 3DFACE

MicroMouse
12-08-2005, 02:08 PM
Yes, I forgot to mention regions on that page in the help manual. I only mentioned regions on the history page.

Your request, if done, would have to be a user selectable option as it would cause trouble for people who would not be expecting nor want the cap. I have a few companies that use the DLL version of AccuTrans just for the DXF import and this feature would cause them problems.

I will have to discuss this request with my friend who is the expert on modelling with AutoCAD. This feature is something I can never remembering him requesting.

LightHeaded
12-08-2005, 05:20 PM
:agree: ...a user selectable option would be PERFECT!, as there would be occasions when extrusion caps would be unwanted.
Thanks for considering this. For me (and others, I'd guess), it would make .dxf translation via Accutrans 10X more useful.

BTW, this is a screenshot of a (ancient) program I mentioned earlier that used a checkbox option to enable this feature. Problems with using it though...besides crashing on today's OSes, the old software doesn't save to useful formats like .lwo, .stl, .dxf.

MicroMouse
12-09-2005, 02:46 PM
After thinking about and discussing automatic extrusion of DXF entities for 3D objects, this feature will not be added to AccuTrans. Some problems would be solved with this feature while creating new problems. This feature needs to be part of a modeling program during construction of the 3D object with suitable changes made to the file format so that a conversion program knows which entities should be combined together.

A major change will be required to how the DXF entities are handled as they are read from the file because all the data has to be tracked back to its' original form because it has to be analyzed to determine it's shape, what plane it is in and how it relates to the other data. The computer has no idea what the 3D object looks like and all decisions are made mathematically.

Example: a series of lines stored as LINE entities are used to make some shape. The LINE entities are not necessarily stored consecutively in the DXF file. The list of lines has to be searched to determine which lines are connected together to make the shape. If three or more lines meet at the same vertex should more than one shape be constructed? After the lines making up a shape have been determined, a calculation is done to see if all the lines are coplanar. Then all the other data on the layer has to be compared to see if something else is coplanar.

Example: If a shape in the center of the drawing is coplanar with a shape that surrounds the whole drawing and other objects on the same layer intersect the plane that joins the two shapes? Should the shapes have an end cap or not?

Example: A vertical wall has a circular recess. An extruded circle is used for the recess. Only the recessed end of the circle should have an end cap but the automatic end capping would put an end cap at both ends and one will have to be removed in the modeling program.