Git Product home page Git Product logo

Comments (3)

brettfo avatar brettfo commented on July 18, 2024

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.

vnazar1985 avatar vnazar1985 commented on July 18, 2024

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.

brettfo avatar brettfo commented on July 18, 2024

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)

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.