Menu

GLFileDXF not working?

Help
2017-01-24
2017-01-24
  • Morten Berg

    Morten Berg - 2017-01-24

    Hello,
    I've been trying to get the DXF import with GLFileDXF to work, but I keep getting errors in the TStream buffer/reader.
    I've tried various files in both my own implementation and the GLSViewer demo without success. Has anyone been able to succesfully use the DXF import, and if so - are there any local changes to the class I need to make?
    I'm using Delphi 10.1 Berlin with the newest GLScene version.
    Thanks in advance,
    Fukku

     
  • Pavel Vassiliev

    Pavel Vassiliev - 2017-01-24

    Hi Morten,
    Something wrong with the unit to import dxf ffiles, but try to use LoadFromFile instead and if you'll have a success you may view the model in AdvDemo\GLSceneViewer, where there is GLFileDXF in uses claus.
    PW

     
  • Pavel Vassiliev

    Pavel Vassiliev - 2017-01-25

    More of DXF,

    There was another old project to import DXF into GLScene. See attachment updated for RAD 10.1. Try it and if bug fixed it could be added to GLScene.
    PW

     
  • Morten Berg

    Morten Berg - 2017-01-30

    Hi Pavel, thanks for the reply and suggestions.
    I've been trying with both GLFileDXF and the old project, but I'm running into problems with both.
    For GLFileDXF I've changed the FBuffer from type String to TBytes, and made corrections in the reader function to support it. With this change I've had success with importing a simple cube, but anything more complex fails.
    For the old project, which I would love to have work due to the export features as well, I'm running into issues with initializations. In unit GLDXFVectorFile, procedure TGLDXFFile.ReNewDXF I am getting access violations on the call to FDirectOpenGL.OnRender. I cannot seem to locate the issue, and was hoping you could help.

    Fukku

    EDIT: So I got past the OnRender issue by replacing
    "FDirectOpenGL.OnRender(Self, rci);"
    with
    "FDirectOpenGL.OnRender := FGLDXFRenderer.Render;"
    However, I do not know if this works as the stream reader isn't working for me.
    I'm currently working on updating the reader, but it's a quite troublesome.

     

    Last edit: Morten Berg 2017-01-30
  • Pavel Vassiliev

    Pavel Vassiliev - 2017-02-01

    Morten,
    I've added the GLSceneDXF demo in branches https://sourceforge.net/p/glscene/code/HEAD/tree/branches/Examples/
    so you could compare it with your old version and correct. Let me know if it works for other then cube.dxf models. ps. and it would be nice if you'll translate interface to english.
    PW

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.