#429 Hatch preview missing from the 2nd time on


When creating hatches, the first time the hatch dialog opens, the pattern preview works fine. From the second time on, the preview window shows only an empty drawing area, no patterns. After a restart the preview is again working only one time.
See LibreCAD Forum


  • LordOfBikes

    LordOfBikes - 2013-09-19
    • status: open --> open-fixed
    • assigned_to: LordOfBikes
  • LordOfBikes

    LordOfBikes - 2013-09-19

    fixed with commit b97372b

  • sven-de

    sven-de - 2013-09-21

    While everything is okay now with a new file (thank you very much for the fix) i still have the same problem with on old dxf-file.

    • There's no preview at all (not even the 1st time)
    • command line always says 'hatch created successfully' but especialy for circles there's no hatch at all, or only some corrupt lines far away outside the circle.

    Is it possible that my file is corrupted? How can I fix it?

  • LordOfBikes

    LordOfBikes - 2013-09-21

    Please can you post the old dxf file for investigation. Is it a drawing with hatches or is it a pattern dxf file?
    If the dxf is not public, please mail it to me (use LC forum function or see my sf.net profile for address).

    • sven-de

      sven-de - 2013-10-12

      Hey, sorry for the late reply.
      But attached you find the aforementioned file. I stripped most of it's layers and blocks, but the malicious behaviour remains:

      1. Unlike my first description the checkbox for hatch-preview apparently has no function now, the preview is always displayed but not updated if unchecked.
      2. The hatching of circles is still broken, but at least since your last update I get an 'Hatch Error: Undefined Error!'.

      One possible incluence could be my rather huge grid values. Because this is serving as GIS, I have coordinates in the 7-figure range (too large for int16_t). And those malicious hatches in the file at least have some influence from the grid, where they begin/end instead of the circle's circumference.

  • LordOfBikes

    LordOfBikes - 2013-10-12


    you're right with your assumption about coordinates. The drawing is somewhere about X543000/Y5356000. Moving the drawing to the origin results in correct hatches.
    Isn't it possible to use the coordinates reduced by factor 1000? When the drawing is moved to X534/Y5356 the hatches are still OK.

    The limit isn't 16 or 32 bit, calculations use floating point arithmetic. Floating point numbers has limits in significant digits, i.e. the bigger the number the more details are lost. To compensate this, tolerance values are used, which are defined for common use. With that extreme location in relation to the drawing size, the tolerance system is knocked out.

    I'm not sure if there is a general solution of making drawings from thousandth of millimeter up to several kilometer or drawing so far apart of the origin. This may be a matter of using another scale.

    I haven't looked in the sources now for this, working on another problem currently. Gimme some days and I will see if there is a solution.


    • sven-de

      sven-de - 2013-10-12

      That would surely be possible to divide by 1000, but I'd rather abstain from hatched circles than moving the decimal point every time I pass data in or out of the document. Those coordinates resemble the UTM-grid, which is my preferred grid for GIS applications, since every plain vanilla GPS-receiver supports it.

      This isn't critical for me anyway, I'm gonna work around this by approximating those circles with polygons which hatch just fine.

      But as this behaviour has BUG written all over it, I figured this might the right place to share that observation.

  • JamesR

    JamesR - 2014-07-02

    Hi I have the same problem, and have tried to hatch within a box in both windows 7 and linux with the same effect, the hatch shows up first time in the preview and from then on it is missing, just a bunch of dots. I tried clicking on the draft button, but that made no difference. On one occasion only I was able to solid fill and then view hatches after, but then they disappeared again. on no occasion have I been able to enter a hatch at any scale after the first attempt on either machine or in either operating language

  • LordOfBikes

    LordOfBikes - 2015-10-25
    • status: open-fixed --> closed-fixed

Log in to post a comment.