Introduction.

A hatch entity is a rather complex and intricate object to write to a DXF file, nevertheless, we'll have to try.
First a header and common values for the hatch is written to file, then follows the hatch boundary data and the hatch pattern data.

  1. dxf_hatch_write_lowlevel ():
    write hatch header and common values.

    Now follows the hatch boundary path data and the hatch pattern data:

  2. dxf_hatch_write_boundaries_lowlevel ():
    write boundary data which consists of one or more of either:

    1. dxf_hatch_write_boundary_path_edges_lowlevel ():
      write the edges of one or more boundary paths, edges consisting of either:

      1. dxf_hatch_write_boundary_path_edge_line_lowlevel ():
        write a line entity.

      2. dxf_hatch_write_boundary_path_edge_arc_lowlevel ():
        write an arc entity.

      3. dxf_hatch_write_boundary_path_edge_ellipse_lowlevel ():
        write an ellipse entity.

      4. dxf_hatch_write_boundary_path_edge_spline_lowlevel ():
        write a spline entity.

      The edge entities making a boundary path should form a closed loop, for else the hatch pattern will "escape" from this area through the "gaps" in the boundary path.

      In case a very dense hatch pattern is chosen, it may take very long for AutoCAD (or any other CAD application using the DXF file) to load the hatch entity, for it will try to apply the hatch pattern to it's entire universe ;-(

      It is for this reason that applying a very dense hatch pattern is considered a Bad Thing (TM); better use the SOLID hatch pattern to obtain a similar result.

    2. dxf_hatch_write_boundary_path_polyline_lowlevel ():
      write a polyline entity and vertices.

      1. dxf_hatch_write_boundary_polyline_vertex_lowlevel ():
        write a series of vertices (minimum should be 3).

      The polyline making a boundary path should form a closed loop, for else the hatch pattern will "escape" from this area through the "gaps" in the boundary path.

      In case a very dense hatch pattern is chosen, it may take very long for AutoCAD (or any other CAD application using the DXF file) to load the hatch entity, for it will try to apply the hatch pattern to it's entire universe ;-(

      It is for this reason that applying a very dense hatch pattern is considered a Bad Thing (TM); better use the SOLID hatch pattern to obtain a similar result.

  3. dxf_hatch_write_hatch_pattern_data_lowlevel ():
    write one or more pattern definition lines which are either continous or dashed.

    1. dxf_hatch_write_pattern_def_line_dashes_lowlevel ();