Replies: 4 comments 6 replies
-
The line pattern rendering issue seems to be solved. This was rendered with the Pillow backend which is really fast: |
Beta Was this translation helpful? Give feedback.
-
@mbway The Matplotlib backend:
overall ~41 seconds Pillow Backend (uses
overall ~4 seconds PySide6 backend without PNG export:
|
Beta Was this translation helpful? Give feedback.
-
@mbway The linetype rendering by the frontend is not much slower than by the backend. I could simplify the backends by removing linetype rendering support from them entirely. But this would change the rendering results for current users (@chibai), because I assume most users do not change the linetype rendering method. Any opinions or suggestions? UPDATE: added a Cython implementation of the LinetypeRenderer() class, which gives a performance improvement of about factor 9.5 |
Beta Was this translation helpful? Give feedback.
-
I added a new module
ezdxf.render.hatching
which brings proper hatch-pattern support.The branch
draw-hatch-pattern
adds this feature to theFrontend
class of thedrawing
add-on.The example DXF file
hatch_pattern_iso.dxf
in the PyQt CAD viewer:The line pattern render algorithm has still some quirks (floating point issues), like some missing lines here:
The hatching itself is a simple inside/outside counting algorithm and works for ordinary hatches, but has also some bugs when intersecting collinear edges or corner vertices and so on... :
The CPython implementation is already fast enough and can be speed-up by using Cython, but the backends have more data to handle because every hatch pattern creates many line entities and
matplotlib
starts to struggle at larger DXF files.The current hatch pattern support can be removed from the existing backends, everything is done in the frontend and uses only the
draw_line()
method of the backend. I don't want to support two drawing methods for hatch pattern like for linetypes (see below). The last ressort for big DXF files is to ignore hatches at all or just draw solid fillings (HatchPolicy).IMPORTANT: The solid hatch drawing has not changed and is still done by the backend!
The same is planned for the linetype support for lines and paths. The backend can use a faster internal linetype rendering if the LinePolicy is
APPROXIMATE
, forACCURATE
the frontend will pass only solid line segments to the backend, this simplifies the backend and adds linetype support to all backends automatically and existing backends should also work without changes.Beta Was this translation helpful? Give feedback.
All reactions