Table of Contents

Class DxfPolyFaceMesh

Namespace
GeometryHelper.Dxf
Assembly
GeometryHelper.dll

A polyface mesh of a DXF file (a POLYLINE of flag 64 of its group 70), as AutoCAD's PolyFaceMesh: its points (DxfPolyFaceMeshVertex) and its faces (DxfFaceRecord), each a VERTEX record, then its SEQEND.

public sealed class DxfPolyFaceMesh : DxfEntity, IEnumerable<DxfVertex>, IEnumerable
Inheritance
DxfPolyFaceMesh
Implements
Inherited Members
Extension Methods

Remarks

The mesh is walked as AutoCAD walks one, foreach (DxfVertex vertex in mesh): its points, then its faces, in the order of the file. GetGeometry() gives the body DxfReader reads of it: the box of 8 points and 6 faces is a GeoSolid3 of 6 faces.

A point or a face set is written in its own record; one appended is a record put in, every other keeping its handle, and the count of points or faces (group 71 or 72) raised with it.

Constructors

DxfPolyFaceMesh()

Initializes a mesh of no points and no faces, as AutoCAD's new PolyFaceMesh(), on layer 0 in no file.

Properties

NumFaces

Gets how many faces the mesh has (group 72), as AutoCAD's NumFaces.

NumVertices

Gets how many points the mesh has (group 71), as AutoCAD's NumVertices.

Methods

AppendFaceRecord(DxfFaceRecord)

Appends a face made in code after the last, as AutoCAD's AppendFaceRecord; group 72 counts it.

AppendVertex(DxfPolyFaceMeshVertex)

Appends a point made in code after the last point, before the faces, as AutoCAD's AppendVertex; group 71 counts it.

Explode()

Gets the faces the mesh breaks into, as AutoCAD's Explode, as ezdxf's virtual_entities gives them: a 3DFACE for each face, in the order of the file, its corners the points its numbers name, the edge from a corner whose number is below nought hidden. A face of three corners ends on its third, as AutoCAD writes one, and the edge from its third back to its first, the 3DFACE's fourth, is hidden with its third. Each has the mesh's look: a layer or a colour its face record writes of its own is not taken, as AutoCAD 2021's Explode gives the faces of a PFACE on INPUT_PFACE_LAYER whose records stand on FACE_OWN_LAYER, one of them red, that layer and BYLAYER. The pyramid of a square base and four sides gives five faces, the base of four corners and four triangles. Its corners are its numbers up to the first of nought, as the reader takes them: a face of fewer than three corners so, (1, 2, 0, 4) among them, or one naming a point the mesh has not, is left out, as the reader leaves it out of the mesh's body.

GetEnumerator()

Gets an enumerator over the points and faces in the order of the file, as AutoCAD's GetEnumerator: each the same object while its record is there.