• D4_432178
  • 420.4KB
  • rar
  • 0
  • VIP专享
  • 0
  • 2022-05-25 12:08
delphi 数据转dxf源码,可以将数据转换为dxf格式,用于数据交换,这是delphi源码程序。
  • DXF_3_0工具
  • DXF_write.PAS
  • Tracking_Form.PAS
  • Tracking_Form.dfm
  • DXF_Utils.PAS
  • MAIN_FORM.dfm
  • DXF_DEMO.res
  • Project1.res
  • DXF_Structs.pas
////////////////////////////////////////////////////////////////// // // // DXF Read/Write/Display // // �John Biddiscombe // // Rutherford Appleton Laboratory, UK // // j.biddiscombe@rl.ac.uk // // DXF code release 3.0 - July 1997 // // // ////////////////////////////////////////////////////////////////// Please read all of this if you intend to use the code. Intro ===== Release version 3.0 of DXF code. See version history at end of this document for synopsis of features. This is not a 'complete' DXF reader package, but it handles most entities that are commonly found. With this release I've added the Polygon mesh and Polyface mesh varieties of POLYLINE, so a great many of the 3D model DXF files found on the internet can now be loaded and at least viewed in 2D. In addition, I've implemented the Arbitrary Axis Algorithm and associated 3D transformations which allows general purpose 3D datasets to be loaded and viewed in 2D. In addition to both the above points, BLOCKs are now supported, but the fact that they (and other objects) can be inserted in arbitrary positions and with 3D rotations added, has complicated the drawing routines somewhat. In previous versions I wrote "There is a lot of structure inside the DXF file that doesn't interest me, so I've simply read the codes that I need". - This is still true, but the number of codes that I've not read is considerably smaller, and it's mainly the STYLE,VIEW and other more bizarre table and header $VALUE entries that I've left out. To emphasize this point, here's a quote from the AutoCad specs... "Writing a program that communicates with AutoCAD by means of the DXF mechanism appears more difficult than it actually is. The DXF format makes it easy to ignore information you don't need, while reading the information you do need." There is still plenty of room for expansion ! Supported Entities ================== The entities we can handle with this code are POINT LINE INSERT (with ATTRIB(s) + BLOCK) ATTDEF (in BLOCKS section) TEXT CIRCLE ARC POLYLINE (normal 2D & 3D variety) POLYLINE (Polygon mesh variety) POLYLINE (Polyface mesh variety) 3DFACE (renamed to FACE3D in the code) SOLID + support for Arbitrary axis alignment of 2D objects in 3-space Compiling and Running ===================== You must install the Zoomer.pas unit to the component palette if you wish to edit the demo form. Double click to centre the window on the clicked point, you can then zoom in/out on a specific object if desired. Drag a rectangle to zoom in on a custom region (the aspect ratio of 1:1 will be preserved, so the rescaling will use the largest side of the box). The buttons at the base of the viewing region are Zoom out, Zoom in, return to last view, return to original view. I've included some DXF files downloaded from various sources, these should give you an idea of the sort of things this code can read ok. Why write this code =================== This code is a subset of a much larger set of routines that I have written...the reason being... I work in research, doing Radio Propagation modelling. I'm given DXF files of terrain, trees, building outlines and heights, which I need to convert into 3D scenes to test my Raytracing code, which predicts field strengths and area coverage. I needed to be able to read DXF files, and manipulate the entities. I convert polylines and lines representing wall and roof features into a 3D facet model of buildings etc. and then simulate placing transmitters and receivers in various places in the database. The data I'm given isn't supplied as facets because it's cheaper for the digitizers (who use stereo photos from aircraft flyovers) to simply draw the building outlines and put a z-coord in. For this reason, my data is essentially a flat map view, and so I have not bothered with a 3D view. Once I've processed the data, I have a 3D viewer I've written in C++ (using OpenGL) that I use to fly around the model and place transmitters and receivers. I wrote the renderer as a completely seperate package to the DXF reader, and so I wanted to keep the DXF stuff simple. I've added BLOCKs primarily because the newest data I've been supplied with, uses BLOCKs to represent Trees and some other simple features. Creating the datasets is much easier when BLOCKs are used rather than drawing every object again and again. Disclaimer ========== I accept no responsibility for anything to do with this code. It may have bugs and errors, and it's up to you to find them. If you need to know about DXF files, try a Web/Archie search for r13dxf.zip, which contains the specs for the latest(?) DXF format. I've tried to add exception handling wherever it seems appropriate without making the code too unreadable, but there are a few places that an error could cause problems, however I think it's pretty stable and shouldn't be a cause for concern. I've read loads of DXF files with this code, and it handles most fairly well, but please keep sending me examples and comments if you find a bug. Thanks ====== Thanks to John F. Herbster for the original basic DXF reader class that got me started, and thanks also to Ian L. Kaplan who has written some C++ DXF code that I found, I used a few of his groupcode definitions to make my code more readable. Thanks to Dani Andres Izquierdo, for improving my Zoom_box and adding the drag rectangle and previous view. Also for improving the scrollbar action, though I must confess it behaves a little strangely sometimes (I'll look into it when I get time). Plea ==== Please don't ask me for help. I do not have a copy of AutoCad, and I've only ever played with it to see how things look. All the knowledge I've gained about DXF files has been from the Internet. Also, I've added lots of functions and entities to the code which I don't actually need or use, simply for fun and for the sake of delving into the DXF format, so there may be many nuances of DXF files which I simply haven't encountered or had trouble with. It's not my problem, is all I can really say! I hope this code helps someone. I'd appreciate an email if you find this code useful. If you can add extra functionality, please let me have a copy of anything nice, especially if I can include it in a further release. Some notes for people who modify the code ========================================= Layers ====== I don't know how AutoCAD handles layers, but for my purposes I need to distinguish between points, lines, polylines etc. So I have opted for a series of entity lists, where all the entities in a list are all of the same type. This may not be the most efficient method of storing data but it simplifies my object filtering and building reconstruction from corner vertices greatly. When the user selects a bunch of entity lists, I use an object I've loosely called a selection object. It's really just a list with a few functions to make my life easier. Most of the functions I need to do the 3D database creation are not included in this code, so it may give the impression of being a little over engineered, you may want to strip out some of the extra complication I've put in. BLOCKs (+ Arbitrary Axis Transformations + plotting issues) ====== Adding BLOCKs has changed a lot of things. Previously the code was intended for 2D datasets like my digital map data, but whilst testing the BLOCK features I found some 3D DXF files that used BLOCKs, and in the interest of 'doing the job right', I felt I had to make the code handle the Arbitrary axis st
    • Delphi 报关
      Delphi 报关 Delphi 报关 Delphi 报关
    • Delphi 记事本
    • delphi 皮肤
      delphi 皮肤控件使用的 delphi 皮肤控件使用的 delphi 皮肤控件使用的
    • delphi mqtt
      delphi mqtt客户端。支持delphi7,有心跳处理,包括发布和订阅。连接emq测试过。
    • delphi 5.0
      delphi 5.0delphi 5.0delphi 5.0delphi 5.0
    • delphi10.2.3
      delphi10.2.3(keygen) delphi10.2.3(keygen) delphi10.2.3(keygen)
    • delphi AESDemo
      delphi AESDemo delphi AESDemo delphi AESDemo delphi AESDemo delphi AESDemo delphi AESDemodelphi AESDemo delphi AESDemodelphi AESDemodelphi AESDemo
    • 介绍DELPHI
    • Delphi Fetion
      Delphi编写的给Fetion发送短信的程序,这个是Delphi7 +Indy9版本。
    • delphi hint
      delphi hint 在Delphi中每个组件几乎都具有Hint属性,但是他们只是在鼠标移动到该组件的时候才显示Hint内容。幸运的是,Delphi为我们提供了一个THintWindow组件,这样就不需要我们手工封装一个组件了。为了实现我们...