Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An issue in the __virtual_entities__ interface that causes some problems in other entities rendering #783

Closed
IvanKachaikinCendas opened this issue Nov 28, 2022 · 2 comments

Comments

@IvanKachaikinCendas
Copy link

Hi @mozman! First of all, thanks once again for your amazing package that makes my life easier every day 🤩

I think however that I found some issue in the plan that you may find below. What happens specifically: in the file hatches_orig.dxf (available in the archive below) you may find a single block reference with a few hatches inside it. If you view it using ezdxf view you will see the following image:

ezdxf-view-orig

Whereas in AutoCAD it looks like that:

autocad-view-no-ezdxf

After that, if you explode the block reference using ezdxf (the plan that I get: hatches_exploded_ezdxf.dxf is also available in the archive attached), you will get the following images:

  • ezdxf view
    ezdxf-view-orig
  • AutoCAD
    autocad-view-ezdxf

So it starts looking the same, moreover the most interesting thing: if you explode the block reference in AutoCAD (the file that I get: hatches_exploded_autocad.dxf is also available in the archive attached), it also looks the same in both ezdxf view and AutoCAD, and it looks just as the original file view in AutoCAD:

  • ezdxf view
    ezdxf-view-autocad-exploded
  • AutoCAD
    autocad-view-no-ezdxf

As ezdxf is completely able to render the hatch pattern in the provided DXFs, I suppose that this issue happens somewhere inside the __virtual_entities__ protocol that is called on both block reference explosion and on the Frontend.draw_entities.

Please let me know what do you think about this issue, do not hesitate to ask for any additional info and thanks for taking it into account.

The archive with files:
hatches_github_issue.zip

@mozman
Copy link
Owner

mozman commented Dec 4, 2022

The transformation of the block reference was not applied to the pattern filling, this is fixed now, but the fix works only for uniform scaling as expected, because ezdxf does not support non-uniform scaling of patterns. The current implementation takes the scaling factor from the x-axis: scaling factor = length of the transformed x-axis unit-vector.

image

@IvanKachaikinCendas
Copy link
Author

@mozman Ok got it, thanks a lot for the fix and for this clarification!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants