mozman / ezdxf

Python interface to DXF
https://ezdxf.mozman.at
MIT License
879 stars 184 forks source link

Problem creating white hatch #544

Closed MarceloSanchez-Aerial closed 2 years ago

MarceloSanchez-Aerial commented 2 years ago

Can not find a way to create a solid fill hatch of white color. In the tutorial https://ezdxf.readthedocs.io/en/stable/tutorials/hatch.html i have seen that color=2 is the white/black color. But it is always black no matter the background. I attach below the code to create two hatches in a "test" layout, one white and the other black, but both of them are black

hatch_bug.zip

mozman commented 2 years ago
  1. The argument color of the add_hatch() factory method defines the ACI (AutoCAD Color Index) of the HATCH, which you set to 0 and 0 means BYBLOCK and defaults to ACI 7 outside of a block. ACI 7 means black on light background and white on dark background. The color argument overrides the dxfattribs arguments.
  2. There is no ACI for "white" for the paper space, ACI 255 is white in model space but grey in paper space.
  3. Use a RGB color to get a specific color: hatch.rgb = (255, 255, 255), true color overrides ACI.

image

MarceloSanchez-Aerial commented 2 years ago

Thanks for the help, now the hatch appears white if I open it in zwcad 2021 but when open it with QCAD, the hatch still in white.

mozman commented 2 years ago

Do not use QCAD or LibreCAD to verify DXF rendering, they are not reliable.

MarceloSanchez-Aerial commented 2 years ago

But the problem is that the .dxf created is processed by a QCAD plugin, and I need the hatch in white color, do you know any option that will force qcad to display that hatch in white?

mozman commented 2 years ago

Verify the DXF with one of these reliable applications:

If the result is different from the QCAD rendering, report it to QCAD.