comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: about DXF format
items: Re: about DXF format

about DXF format
type: item
description: Hi,everybody. Recently,i'm troubled in with loading DXF files into my program. When I loading some simple DXF files ,it can be displayed very well.I used IDLffDXF object,and I just checked whether the file has the IDL_DXF_POLYGON entity acoording the GetContents and GetEntity methods.Then load the vertex data and connectivities into new IDLgrPolygon objects.But once I load some complex DXF files,the trouble has coming:first,the position of some IDLgrPolygons are not precision.Second,we know,sometimes,it just need one IDLgrPolygon object to display a polygon which be composed by a lot of triangles.But when I loading some DXF files, the GetEntity method shows a very bad result.It produed many many IDLgrPolygons,so much as decomposed some polygon entitys.That makes my program became very slow ,and need to wait a long time for it .How could I promote my loading speed?Is there any better way to avoid making too many IDLgrPolygons through GetEntity method? I don't know whether I made my question clear,please parden me for my poor english^_*,I'll pracitse more. Thanks.
creator: airy.jiang
date: 2007-06-12T10:36:53-00:00

Re: about DXF format
type: item
description: > Second,we know,sometimes,it just need one IDLgrPolygon > object to display a polygon which be composed by a lot of > triangles. > But when I loading some DXF files, the GetEntity method > shows a very bad result.It produed many many IDLgrPolygons,so much as > decomposed some polygon entitys.That makes my program became very > slow ,and need to wait a long time for it . I could be wrong, I have never actually looked, but I thought that the entities are defined in the DXF file. So there isn't a problem with GetEntity. Your issue is that your DXF files are more complicated than you would like. > Is there any better way to avoid making too many > IDLgrPolygons through GetEntity method? Ideally you fix this at the source, whatever program you are exporting your DXF models from. Alternatively you could combine entities into a single IDLgrPolygon by concatenating the vertex arrays and applying the proper offsets to the polygon arrays. It's hard to say how much this would speed things up since it depends on where your bottleneck lies. If your program is burdened by the overly complex graphics hierarchy (too many IDLgrPolygon objects) this will help. But if you simply have too many polygons on your screen this will do little in terms of improving performance. What hardware and OS are you running IDL on? How many polygons are you trying to display? -Rick
creator: Rick Towler
date: 2007-06-12T23:24:28-00:00

Re: about DXF format
type: item
description: On Jun 12, 7:36 pm, airy.ji...@gmail.com wrote: > Hi,everybody. > Recently,i'm troubled in with loading DXF files into my program. > When I loading some simple DXF files ,it can be displayed very well.I > used IDLffDXF object,and I just checked whether the file has the > IDL_DXF_POLYGON entity acoording the GetContents and GetEntity > methods.Then load the vertex data and connectivities into new > IDLgrPolygon objects.But once I load some complex DXF files,the > trouble has coming:first,the position of some IDLgrPolygons are not > precision.Second,we know,sometimes,it just need one IDLgrPolygon > object to display a polygon which be composed by a lot of > triangles.But when I loading some DXF files, the GetEntity method > shows a very bad result.It produed many many IDLgrPolygons,so much as > decomposed some polygon entitys.That makes my program became very > slow ,and need to wait a long time for it .How could I promote my > loading speed?Is there any better way to avoid making too many > IDLgrPolygons through GetEntity method? > I don't know whether I made my question clear,please parden me for my > poor english^_*,I'll pracitse more. > Thanks. How about trying to load your DXF file in REVOLUTION IDL, to see whether the expert's program can handle your file? Download REVOLUTION IDL from : - http://www.ittvis.com/codebank/search.asp?FID=473 Cheers, Andrew
creator: Andrew Cool
date: 2007-06-12T23:45:18-00:00

Re: about DXF format
type: item
description: Rick,Maybe you are right. The DXF format is indeed complicated,I knew it and I have read some documents about that.The key is a DXF file is not only has "Entity" section,but also include many other sections,like "Table" section,"Object" section,"Class" setction and so on.The IDLffDXF object can get a lot information from one DXF file by the GetEntity method.Just like I've wrote,we can get the most basic vertex data and vertex connectivities,that is enough information to make a full polygon.But that's all we can do until now.The truth is,I use GetContent method get the entity type of the file,the result is [9,18,19,20],that represents the types of the entities which including in the file :IDL_DXF_POLYGON,IDL_DXF_INSERT,IDL_DXF_BLOCK,IDL_DXF_LAYER. The vertex data and connectivity can be found in the IDL_DXF_POLYGON ,and we can use them to make a polygon.But what the use of the other types of entity?IDL_DXF_INSERT,IDL_DXF_BLOCK,IDL_DXF_LAYER,Are they useless? I use 3DMAX and AutoCAD read the same DXF file,they all showed a exact result.My program which used IDLffDXF object has two errors. First,the shape of the polygon are all right,but the polygon are all composed of the triangles.The 3DMAX and AutoCAD shows that the right result is not only the triangles,many polygons are composed of the rectangles.And the number of polygons of the DXF file which made by my program are more than the number which made by the 3DMAX and AutoCAD. Second,the position of some parts of polygons are not precision.I think that's maybe some offset information contained in the DXF file,but I'm not very sure. My computer is good,that' not the problem.The number of polygons is nearly 10000,but infact the right result showed by the 3DMAX and AutoCAD tell us that's not actual number,it just needs 1000 or more less polygons to show that.Anyway,let me list my hardware: cpu:AMD 3600+ memory: 1G DDR2 667 Graphic Card: Unika 1650XT (600MHz/1200) HardDisk:Hitachi 160G SATA2 8M buffer memory
creator: airy.jiang
date: 2007-06-14T01:51:49-00:00

Re: about DXF format
type: item
description: On 6 13 , 7 45 , Andrew Cool <andrew.c...@dsto.defence.gov.au> wrote: > On Jun 12, 7:36 pm, airy.ji...@gmail.com wrote: > > > > > >> Hi,everybody. >> Recently,i'm troubled in with loading DXF files into my program. >> When I loading some simple DXF files ,it can be displayed very well.I >> used IDLffDXF object,and I just checked whether the file has the >> IDL_DXF_POLYGON entity acoording the GetContents and GetEntity >> methods.Then load the vertex data and connectivities into new >> IDLgrPolygon objects.But once I load some complex DXF files,the >> trouble has coming:first,the position of some IDLgrPolygons are not >> precision.Second,we know,sometimes,it just need one IDLgrPolygon >> object to display a polygon which be composed by a lot of >> triangles.But when I loading some DXF files, the GetEntity method >> shows a very bad result.It produed many many IDLgrPolygons,so much as >> decomposed some polygon entitys.That makes my program became very >> slow ,and need to wait a long time for it .How could I promote my >> loading speed?Is there any better way to avoid making too many >> IDLgrPolygons through GetEntity method? >> I don't know whether I made my question clear,please parden me for my >> poor english^_*,I'll pracitse more. >> Thanks. > > How about trying to load your DXF file in REVOLUTION IDL, to see > whether the > expert's program can handle your file? > > Download REVOLUTION IDL from : - > > http://www.ittvis.com/codebank/search.asp?FID=473 > > Cheers, > > Andrew- - > > - Thanks for your suggestion,Andrew Cool. I've used that program read that DXF file,the result is expert's program has made the same mistakes.And it made whole a file into one polygon,that's not the answer I want.The different entities should be detached.One entity correspond one polygon,that is the right result,and that relationship should be wrote in the DXF file.We have no need to do it by ourselves,we just need to read it from the file,that's all. Hope more people could join here …
creator: airy.jiang
date: 2007-06-14T02:07:53-00:00

Re: about DXF format
type: item
description: no more people would like to discuss this topic?what a pity!
creator: airy.jiang
date: 2007-06-17T02:20:52-00:00

Re: about DXF format
type: item
description: On Jun 16, 10:20 pm, airy.ji...@gmail.com wrote: > no more people would like to discuss this topic?what a pity! I have had nothing but trouble trying to export DXF files from AutoCAD and read them with IDLffDXF. Some (most) objects never appear and others are improperly positioned or rotated. My limited investigations led me to conclude that while DXF may be an open standard to exchange CAD models, it also allows for the inclusion of proprietary formatting and objects. True, IDL does not support all object types that may occur in DXF files, but this is not the primary problem. If you read the DXF file directly (it's ASCII) you'll note a lot of AutoCAD specific stuff in there that I gather tells AutoCAD more about how to position and orient objects in the model. It would be much more useful to me if IDL could read/write either IGES or STEP files as these are really designed to exchange model geometries. I currently export these types from AutoCAD and translate them to IDL-compatible DXF files using 3rd party software from TechnoSoft (AML).
creator: JMZawodny
date: 2007-06-18T12:23:25-00:00

Re: about DXF format
type: item
description: On Jun 18, 7:23 am, JMZawo...@gmail.com wrote: > On Jun 16, 10:20 pm, airy.ji...@gmail.com wrote: > >> no more people would like to discuss this topic?what a pity! > > I have had nothing but trouble trying to export DXF files from AutoCAD > and read them with IDLffDXF. Some (most) objects never appear and > others are improperly positioned or rotated. My limited investigations > led me to conclude that while DXF may be an open standard to exchange > CAD models, it also allows for the inclusion of proprietary formatting > and objects. True, IDL does not support all object types that may > occur in DXF files, but this is not the primary problem. If you read > the DXF file directly (it's ASCII) you'll note a lot of AutoCAD > specific stuff in there that I gather tells AutoCAD more about how to > position and orient objects in the model. It would be much more useful > to me if IDL could read/write either IGES or STEP files as these are > really designed to exchange model geometries. I currently export these > types from AutoCAD and translate them to IDL-compatible DXF files > using 3rd party software from TechnoSoft (AML). In my experience, it IS possible to parse a dxf file. You just have to read the docs that describe the format, then parse the file correctly. The trick is that some entities contain other entities and lines and they all have different local and global origins and scale factors. Yeah, it complicated, but I've written a parser to parse a few dxf files, and works (most of the time). Here's my very crude code. Just try >plot_dxf, "file.dxf" function resolve_inserts, innow, inserts, plines ;; plines nbdx = where( plines.blockname ne '', nbcnt ) if nbcnt gt 0 then begin nbplines = plines[nbdx] bdx = where( nbplines.blockname eq innow.blockref, bcnt ) for b=0l, bcnt-1 do begin pnow = plines[nbdx[bdx[b]]] *(pnow.vertices) = *(pnow.vertices) + rebin(innow.coord, 3,pnow.nvert,/sample) plines[nbdx[bdx[b]]] = pnow endfor endif ;; inserts nbdx = where( inserts.blo…
creator: Vince Hradil
date: 2007-06-18T14:55:57-00:00

Re: about DXF format
type: item
creator: Vince Hradil
date: 2007-06-18T15:14:19-00:00

Re: about DXF format
type: item
description: Thanks everyone to join here and give me so much help,specially thanks hradilv who showed a lot of useful sourece code,though I didn't read this code completely yet.I'll spend more time on it until when a nice result to be made.Later I'll came back here to continue discuss this topic.Thank you very much!
creator: airy.jiang
date: 2007-06-19T15:20:48-00:00

Re: about DXF format
type: item
description: Thanks for offering the code. Unfortunately it did not work and it was not because of the missing COLORS procedure. My DXF files are composed primarily of 3DBLOCKs. These appear to go unparsed in your routine. What I really need is something that will read the DXf files and output a set of mesh_objects, one for each layer. This what IDLffDXf should do, but does not. Thanks again for the effort. Joe On Jun 18, 10:55 am, hradilv <hrad...@yahoo.com> wrote: > On Jun 18, 7:23 am, JMZawo...@gmail.com wrote: > > > >> On Jun 16, 10:20 pm, airy.ji...@gmail.com wrote: > >>> no more people would like to discuss this topic?what a pity! > >> I have had nothing but trouble trying to export DXF files from AutoCAD >> and read them with IDLffDXF. Some (most) objects never appear and >> others are improperly positioned or rotated. My limited investigations >> led me to conclude that while DXF may be an open standard to exchange >> CAD models, it also allows for the inclusion of proprietary formatting >> and objects. True, IDL does not support all object types that may >> occur in DXF files, but this is not the primary problem. If you read >> the DXF file directly (it's ASCII) you'll note a lot of AutoCAD >> specific stuff in there that I gather tells AutoCAD more about how to >> position and orient objects in the model. It would be much more useful >> to me if IDL could read/write either IGES or STEP files as these are >> really designed to exchange model geometries. I currently export these >> types from AutoCAD and translate them to IDL-compatible DXF files >> using 3rd party software from TechnoSoft (AML). > > In my experience, it IS possible to parse a dxf file. You just have > to read the docs that describe the format, then parse the file > correctly. The trick is that some entities contain other entities and > lines and they all have different local and global origins and scale > factors. Yeah, it complicated, but I've written a parser to parse a > few dxf files, and works (mos…
creator: JMZawodny
date: 2007-06-21T13:51:34-00:00

Re: about DXF format
type: item
description: On Jun 21, 8:51 am, JMZawo...@gmail.com wrote: > Thanks for offering the code. Unfortunately it did not work and it was > not because of the missing COLORS procedure. My DXF files are composed > primarily of 3DBLOCKs. These appear to go unparsed in your routine. > What I really need is something that will read the DXf files and > output a set of mesh_objects, one for each layer. This what IDLffDXf > should do, but does not. > > Thanks again for the effort. > > Joe > > On Jun 18, 10:55 am, hradilv <hrad...@yahoo.com> wrote: > >> On Jun 18, 7:23 am, JMZawo...@gmail.com wrote: > >>> On Jun 16, 10:20 pm, airy.ji...@gmail.com wrote: > >>>> no more people would like to discuss this topic?what a pity! > >>> I have had nothing but trouble trying to export DXF files from AutoCAD >>> and read them with IDLffDXF. Some (most) objects never appear and >>> others are improperly positioned or rotated. My limited investigations >>> led me to conclude that while DXF may be an open standard to exchange >>> CAD models, it also allows for the inclusion of proprietary formatting >>> and objects. True, IDL does not support all object types that may >>> occur in DXF files, but this is not the primary problem. If you read >>> the DXF file directly (it's ASCII) you'll note a lot of AutoCAD >>> specific stuff in there that I gather tells AutoCAD more about how to >>> position and orient objects in the model. It would be much more useful >>> to me if IDL could read/write either IGES or STEP files as these are >>> really designed to exchange model geometries. I currently export these >>> types from AutoCAD and translate them to IDL-compatible DXF files >>> using 3rd party software from TechnoSoft (AML). > >> In my experience, it IS possible to parse a dxf file. You just have >> to read the docs that describe the format, then parse the file >> correctly. The trick is that some entities contain other entities and >> lines and they all have different local and global origins and scale >> factors.…
creator: Vince Hradil
date: 2007-06-21T14:50:32-00:00

Re: about DXF format
type: item
description: JMZawodny wrote: > Thanks for offering the code. Unfortunately it did not work and it was > not because of the missing COLORS procedure. My DXF files are composed > primarily of 3DBLOCKs. These appear to go unparsed in your routine. > What I really need is something that will read the DXf files and > output a set of mesh_objects, one for each layer. This what IDLffDXf > should do, but does not. What specifically is the problem with IDLffDXF? It is hard to offer advice or suggestions if you don't specify the problem. Is it similar to the OP's issue that some specific coordinate transformation information is lost? Or is it something else? -Rick
creator: Rick Towler
date: 2007-06-21T16:26:27-00:00

Re: about DXF format
type: item
description: On 6 22 , 12 26 , Rick Towler <rick.tow...@nomail.noaa.gov> wrote: > JMZawodny wrote: >> Thanks for offering the code. Unfortunately it did not work and it was >> not because of the missing COLORS procedure. My DXF files are composed >> primarily of 3DBLOCKs. These appear to go unparsed in your routine. >> What I really need is something that will read the DXf files and >> output a set of mesh_objects, one for each layer. This what IDLffDXf >> should do, but does not. > > What specifically is the problem with IDLffDXF? It is hard to offer > advice or suggestions if you don't specify the problem. Is it similar > to the OP's issue that some specific coordinate transformation > information is lost? Or is it something else? > > -Rick The IDLffDXF objects have a lot of subobjects,but I just know how to use IDL_DXF_POLYGON,IDL_DXF_POLYLINE,which I learned from the example code.But in fact,there are many other subobjects,like IDL_DXF_BLOCK,IDL_DXF_LAYER,IDL_DXF_INSERT,and so on.It won't be useless,but until now,I still don't know how to use them.
creator: airy.jiang
date: 2007-06-27T04:12:59-00:00

Re: about DXF format
type: item
description: On Jun 26, 11:12 pm, airy.ji...@gmail.com wrote: > On 6 22 , 12 26 , Rick Towler <rick.tow...@nomail.noaa.gov> wrote: > >> JMZawodny wrote: >>> Thanks for offering the code. Unfortunately it did not work and it was >>> not because of the missing COLORS procedure. My DXF files are composed >>> primarily of 3DBLOCKs. These appear to go unparsed in your routine. >>> What I really need is something that will read the DXf files and >>> output a set of mesh_objects, one for each layer. This what IDLffDXf >>> should do, but does not. > >> What specifically is the problem with IDLffDXF? It is hard to offer >> advice or suggestions if you don't specify the problem. Is it similar >> to the OP's issue that some specific coordinate transformation >> information is lost? Or is it something else? > >> -Rick > > The IDLffDXF objects have a lot of subobjects,but I just know how to > use IDL_DXF_POLYGON,IDL_DXF_POLYLINE,which I learned from the example > code.But in fact,there are many other subobjects,like > IDL_DXF_BLOCK,IDL_DXF_LAYER,IDL_DXF_INSERT,and so on.It won't be > useless,but until now,I still don't know how to use them. Did you see my post earlier: qoute: Anyway, maybe you can use mine as a start. Here's a link to the DXF format, if you haven't found it yet: http://tinyurl.com/232tsa I know this isn't "idl specific", but it does explain the dxf format quite well.
creator: Vince Hradil
date: 2007-06-27T13:39:02-00:00

Re: about DXF format
type: item
description: On Jun 21, 12:26 pm, Rick Towler <rick.tow...@nomail.noaa.gov> wrote: > JMZawodny wrote: >> Thanks for offering the code. Unfortunately it did not work and it was >> not because of the missing COLORS procedure. My DXF files are composed >> primarily of 3DBLOCKs. These appear to go unparsed in your routine. >> What I really need is something that will read the DXf files and >> output a set of mesh_objects, one for each layer. This what IDLffDXf >> should do, but does not. > > What specifically is the problem with IDLffDXF? It is hard to offer > advice or suggestions if you don't specify the problem. Is it similar > to the OP's issue that some specific coordinate transformation > information is lost? Or is it something else? > > -Rick After reading the dxf file into my object IDLffDXF->GetContents tells me that I have 3 blocks, 9 inserts, and 6 layers. The layers appear to have the correct names. The blocks appear to be generic/default AutoCAD 'things'. I have no idea what the Inserts are all about. They are all the same except for the .color field. There are no other Entities present and nothing that would represent my model (types 1-17). The dxf file is good in that AutoCAD generates the proper model from the file. So, I really cannot track down what is going wrong beyond what I've just told you.
creator: JMZawodny
date: 2007-06-28T17:58:10-00:00

Re: about DXF format
type: item
description: One more thing about the dxf file. The bulk of the file is comprised of several groups of lines like this ... 0 3DSOLID 5 63 330 1F 100 AcDbEntity 8 TELESCOPE 100 AcDbModelerGeometry 70 1 1 noi io n o 1 =0;& {n {m {rn {rn | 1 -:9@)+r3(;r>++-6= {rn {rn {rn {o {l {k | 1 3*2/ {j {rn {i {o | 1 -:961:2:1+ {rn o o o o oqomknolinhmfjimmgmi lo o o n o | 1 ):-+:'@+:2/3>+: {rn l o n g | 1 -:9@)+r3(;r>++-6= {rn {rn {rn {m {l {k | 1 ,7:33 {h {rn {rn {g {m | 1 -:9@)+r3(;r>++-6= {rn {rn {rn {i {l {k | 1 9><: {f {no {nn {i {rn {nm -:):-,:; ,6183: | 1 92:,7r3(;r>++-6= {rn {nl {rn {g | 1 9><: {nk {nj {ni {i {rn {nh -:):-,:; ,6183: | ... I have not had the time to dig into the DXF file format specifications to figure out exactly what these lines define, but I strongly suspect they are my missing model objects. Joe
creator: JMZawodny
date: 2007-06-28T18:37:31-00:00

Re: about DXF format
type: item
description: On Jun 28, 1:37 pm, JMZawo...@gmail.com wrote: > One more thing about the dxf file. The bulk of the file is comprised > of several groups of lines like this ... > > 0 > 3DSOLID > 5 > 63 > 330 > 1F > 100 > AcDbEntity > 8 > TELESCOPE > 100 > AcDbModelerGeometry > 70 > 1 > 1 > noi io n o > 1 > =0;& {n {m {rn {rn | > 1 > -:9@)+r3(;r>++-6= {rn {rn {rn {o {l {k | > 1 > 3*2/ {j {rn {i {o | > 1 > -:961:2:1+ {rn o o o o oqomknolinhmfjimmgmi lo o o n o | > 1 > ):-+:'@+:2/3>+: {rn l o n g | > 1 > -:9@)+r3(;r>++-6= {rn {rn {rn {m {l {k | > 1 > ,7:33 {h {rn {rn {g {m | > 1 > -:9@)+r3(;r>++-6= {rn {rn {rn {i {l {k | > 1 > 9><: {f {no {nn {i {rn {nm -:):-,:; ,6183: | > 1 > 92:,7r3(;r>++-6= {rn {nl {rn {g | > 1 > 9><: {nk {nj {ni {i {rn {nh -:):-,:; ,6183: | > > ... > > I have not had the time to dig into the DXF file format specifications > to figure out exactly what these lines define, but I strongly suspect > they are my missing model objects. > > Joe > From the specs: 3dsolid group codes Group codes Description 100 Subclass marker (AcDbModelerGeometry) 70 Modeler format version number (currently = 1) 1 Proprietary data (multiple lines < 255 characters each) 3 Additional lines of proprietary data (if previous group 1 string is greater than 255 characters) (optional) So I'm guessing these are "proprietary data" - maybe depending on the APP that wrote the DXF. Bummer...
creator: Vince Hradil
date: 2007-06-28T19:23:35-00:00

Re: about DXF format
type: item
description: On Jun 28, 3:23 pm, hradilv <hrad...@yahoo.com> wrote: > On Jun 28, 1:37 pm, JMZawo...@gmail.com wrote: > > > >> One more thing about the dxf file. The bulk of the file is comprised >> of several groups of lines like this ... > >> 0 >> 3DSOLID >> 5 >> 63 >> 330 >> 1F >> 100 >> AcDbEntity >> 8 >> TELESCOPE >> 100 >> AcDbModelerGeometry >> 70 >> 1 >> 1 >> noi io n o >> 1 > >> Joe >> From the specs: > > 3dsolid group codes > > Group codes Description > 100 > Subclass marker (AcDbModelerGeometry) > > 70 > Modeler format version number (currently = 1) > > 1 > Proprietary data (multiple lines < 255 characters each) > > 3 > Additional lines of proprietary data (if previous group 1 string is > greater than 255 characters) (optional) > > So I'm guessing these are "proprietary data" - maybe depending on the > APP that wrote the DXF. Bummer... Bingo! That was the thought behind my first post to this thread. The "standard" supports the use of proprietary data. Things like that generally make for useless standards. My only success in getting AutoCAD-generated models into IDL via IDLffDXF is to export the model from AutoCAD as an IGES or STEP file. Read it in with 3rd party software which can tesselate the model and export the points and connectivity arrays in a DXF. Hence my original request for IDL to support reading IGES or STEP files. I do appreciate everyone's ideas and input on this. Joe
creator: JMZawodny
date: 2007-06-29T12:30:53-00:00