Git Product home page Git Product logo

Comments (2)

brettfo avatar brettfo commented on August 15, 2024

Thanks for the bug report! This is an interesting problem and I'd like to get your input on it.

The issue is that while reading extended data, a point is supposed to be specified by listing its X, Y, and Z values, but in this case we have just a Y and Z value listed. How should this be parsed? I can see the following possibilities:

  1. Default X to 0. Evidence in favor of this: elsewhere in DXF files it's not uncommon to only list X and Y values and have the Z value assumed to be 0, why shouldn't this same reasoning be applied here? Evidence against this: the three values prior to the faulting line explicitly list X, Y, and Z values, all as 0.0 and the Z value immediately following is also explicitly listed as 0.0; if omitting a value should default it to 0, why weren't the other 0 values omitted? Also, what if three Y values then a Z value are specified? Should that be read as 4 separate points, or do the last Y value and the Z value go together so that three points are the result? How can we tell the difference?
  2. Use the last-listed X value that we've seen. Evidence in favor of this: none, but it doesn't seem entirely unreasonable. Evidence against this: what if the last listed X value was from a completely different entity? What about using an X value from a different point-type (e.g., raw real triple, world point, model point, paperspace point, vector, etc.)? There's no real easy answer.
  3. Ignore the unexpected value. Evidence in favor of this: DXF readers regularly ignore code-pair values they don't understand which leads to better stability. In fact, when new fields are added to entities, Autodesk will assign previously unused code pairs for the explicit reason that older readers will simply pass over the unexpected value instead of misinterpreting them. Evidence against this: the values that were explicitly written by some other DXF library won't be preserved when read with this library. I'd rather not throw away any data if it can be preserved, but I don't know how to preserve it when it's incomplete and doesn't make sense.

What are your thoughts? Anything I missed? Personally I'm leaning towards option 3 and ignoring the unexpected value simply because I'd rather omit incomplete data than assume values that might be incorrect.

from dxf.

Happe79 avatar Happe79 commented on August 15, 2024

Hello brettfo,

Thank you again very much for the fast reply.

I also think option 3 is the best way to handle this. For testing I already disabled the exception and it seems working without any problems so far.

Greetings

Happe

from dxf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.