Comments (2)
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:
- 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?
- 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.
- 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.
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)
- MText: Missing DXF group code: 90 HOT 6
- XData group code exception when casting to string HOT 1
- Position of DxfText is wrong when using HorizontalTextJustification = DxfHorizontalTextJustification.Center HOT 1
- Double Bug in MText rotation HOT 11
- Code 46 not readed from MTEXT HOT 9
- More indexes in code 1, 40 and 290 HOT 3
- How to create a zoom-extents ViewPort?
- Add Aligned Dimension with text above the dimension line and how to increase text size? HOT 1
- spline closed attribute error HOT 3
- How to specify a font for Text? HOT 2
- SPATIAL_FILTER code 40 issue HOT 1
- Ellipse uses wrong extents calculation HOT 1
- From Spline to Dxf HOT 2
- MTEXT AutoCAD 2018 Embedded Object (code 101) issue
- Opening file error "Not a valid DXF file header: `?0`" HOT 9
- How to calculate spline length? HOT 2
- How to get an edge/block's connected units (up & downstream) HOT 1
- How to explicitly set DXF color to black? HOT 1
- Unsupported code pair of dxf is swallowed HOT 2
- load the library from IronPython HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dxf.