'Hatch' in AutoCAD for programming not an easy thing.
In the C-lang (unlike AutoLISP and VBA) function Hatch (AddHatch) does not work.
This is how it is written in the acax17enu.h (acax17enu.tlb):
hr = AddHatch (IAcadModelSpace * This, INT PatternType, BSTR PatternName, VARIANT_BOOL Associativity, VARIANT HatchObjectType, IAcadHatch * * pResult);
or through a macro:
IAcadModelSpace_AddHatch (This, PatternType, PatternName, Associativity, HatchObjectType, pResult);
Argument 'VARIANT HatchObjectType' not 'typedef enum acHatchObjectType'.
And if in AutoLISP or in VBA it's the optional argument (i.e., can be omitted), the C function without this argument does not work.
Nowhere except AddHatch function argument 'HatchObjectType' not found.
And so his "appearance" in the structure VARIANT unknown.
So, after many unsuccessful trials (and errors), after reading the forums on the theme of 'AutoCAD HATCH', had to use the function 'command' of AutoLISP.
This AutoLISP 'command' hatch successfully 3dFaces (according ACAD-Help it is impossible).
Also, the command-line, you can directly insert the various properties of the hatch.
In short: old AutoLISP rescued.
The attached archive example of creating a surface (Surface as TIN) from '3dFaces' on irregularly spaced points:
1 of the points existing in the current Drawing - button 'SURFACE',
2. the points X, Y, Z in the file 'points.txt' - Button 'Read File',
Same (1 and 2) can be performed using an external LISP program (DTM.lsp + DTM.dsl) Romanian programmer Nikolae Manda - button 'DTM LISP'.
These two files must be in the AutoCAD system folder, such as C:\Program Files\AutoCAD 20xx\Support\
The code that performs a triangulation:
vdefs.h
voron_main.c (main.c)
voronoi.c
geometry.c
heap.c
memory.c
edgelist.c
output.c
its author
Steve J. Fortune ( (c)1987-1992 years).
Despite the age of the code, it took quite a bit fixes for inclusion in the project.
There are other available sources, such as Clarkson-Delaunay -
Ken Clarkson (c) 1995
Almost everything that is in the public domain triangulate the so-called 'Convex Hull'.
For serious work requires the implementation of "Delaunay triangulation to the conditions," and like all serious in the public domain is not available.
It is for the overall development:
http://algolist.manual.ru/maths/geom/http://gts.sourceforge.net