Comments (3)
What viewers are you using and how was the DXF file created? The DXF snippet you posted appears correct, but with one caveat; look down to lines 155-160:
210
0.0
220
0.0
230
-1.0
Those codes represent the circle's normal vector which means the circle isn't "facing" the screen, it's "facing" away. The normal vector (called "extrusion" by the DXF spec) is usually (0,0,1)
, but here it's (0,0,-1)
.
from dxf.
Thank you for your reply. How this file was generated I do not know, it is a custom file, researching its origin is difficult.
But yes, I understood your answer, and came to the same conclusion when I was trying to solve this yesterday.
So this vector really tells about the inversion of the plane. But this does not indicate the direction of reversal. It can be due to X, due to Y or other conditions. I solved it for myself by Mirroring the X coordinate, but this is not a valid solution, it just seemed better to me. I meant changing the sign of the X coordinates, that is, turning around the Y axis.
So I agree that the library reads this data correctly, and it even reads that vector.
But how to correctly process it remains to be discovered, although it is possible outside the library.
In any case, such a vector is not unambiguous, which creates problems due to the absence of rules.
Perhaps you have information on the sequence of use of this vector?
Thank you.
from dxf.
Your behavior of mirroring the X coordinate is correct. DXF files use Autodesks's Arbitrary Axis Algorithm which states how to compute the axes, and in this instance, the first clause is relevant (written differently for clarity:
if (abs(normal.X) < 1/64 && abs(normal.Y) < 1/64))
{
xAxis = (0, 1, 0) X normal; // the result of this is that the object's x axis is now (-1, 0, 0), which is the mirroring you did
}
from dxf.
Related Issues (20)
- 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
- DxfEllipse - thickness missing HOT 6
- Support for MLeader HOT 2
- how to read dxf file content text? HOT 1
- DxfHatch exception 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.