Represents a single DXF entity. Entities can include points, lines, circles, arcs, text, or polylines.

interface DxfEntity {
    blockName?: string;
    blocks?: Record<string, DxfBlock>;
    center?: DxfPoint;
    closed?: boolean;
    color?: number;
    endAngle?: number;
    height?: number;
    isFromSpecialBlock?: boolean;
    layer?: string;
    name?: string;
    position?: DxfPoint;
    radius?: number;
    rotation?: number;
    scale?: DxfScale;
    shape?: boolean;
    startAngle?: number;
    text?: string;
    type: string;
    vertices?: DxfPoint[];
}

Properties

blockName?: string

Name of the block this entity references (if any).

blocks?: Record<string, DxfBlock>

Optional dictionary of nested blocks referenced by this entity.

center?: DxfPoint

The geometric center point (for circles or arcs).

closed?: boolean

Whether the polyline is closed (end connects to start).

color?: number

Color index or code for the entity.

endAngle?: number

The end angle of an arc (in degrees).

height?: number

Height of text (for TEXT or MTEXT entities).

isFromSpecialBlock?: boolean

Flag indicating whether this entity originated from a special block reference.

layer?: string

The layer on which this entity resides.

name?: string

Optional name (for block references or named entities).

position?: DxfPoint

Position of the entity (for TEXT, INSERT, etc.).

radius?: number

The radius (for circles and arcs).

rotation?: number

Rotation angle of the entity (in degrees).

scale?: DxfScale

Optional scale factors applied to the entity or block reference.

shape?: boolean

Whether the shape entity represents a closed loop (for polylines).

startAngle?: number

The start angle of an arc (in degrees).

text?: string

The text string value (for TEXT or MTEXT entities).

type: string

Type of the DXF entity (e.g., LINE, CIRCLE, TEXT).

vertices?: DxfPoint[]

List of vertex coordinates defining geometry for polylines or shapes.