Hide menu
Loading...
Searching...
No Matches
Hatch

Represents an area filled with a pattern.

The hatch pattern can be composed of solid, dashed, or dash-dotted lines. The pattern can be mirrored or combined with its mirror image to create a double hatch. It follows the scheme used by AutoCAD to represent the set of ANSI-standard hatch patterns.

Extends

Constructors

Constructor

new Hatch(): Hatch

Returns

Hatch

Inherited from

Element.constructor

Properties

angle

angle: number = 0

Angle of the hatch.


definitionLines

readonly definitionLines: HatchDefinitionLine[] = []

Definition lines of the hatch.


pattern

pattern: PatternType = PatternType.SOLID

Hatch pattern.


scale

scale: number = 1

Scale of the hatch.


style

style: StyleType = StyleType.STANDARD

Style of the hatch pattern.

Accessors

id

Get Signature

get id(): bigint

Returns the unique identifier of the object.

Returns

bigint

Inherited from

Element.id


numberOfContours

Get Signature

get numberOfContours(): number

Returns the number of hatch contours.

Returns

number


numberOfDefinitionLines

Get Signature

get numberOfDefinitionLines(): number

Returns the number of definition lines.

Deprecated

Use Hatch.definitionLines and definitionLines.length instead.

Returns

number


uuid

Get Signature

get uuid(): `${string}-${string}-${string}-${string}-${string}` | null

UUID of the drawing element.

The value is null if no UUID is assigned.

Returns

`${string}-${string}-${string}-${string}-${string}` | null

Set Signature

set uuid(uuid): void

Sets the UUID of the drawing element.

Parameters

uuid

`${string}-${string}-${string}-${string}-${string}` | null

UUID to assign to the drawing element.

Returns

void

Inherited from

Element.uuid

Methods

accept()

accept(visitor): void

Accepts an element visitor.

Parameters

visitor

ElementVisitor

Element visitor to accept.

Returns

void

Overrides

Element.accept


addContour()

addContour(contour, type?): boolean

Adds the hatch contour.

The contour must be closed. Otherwise it is not added and the method returns false.

Parameters

contour

PiecewiseContour

Contour to add.

type?

ContourType = ContourType.OUTER

Type of contour.

Returns

boolean


addDefinitionLine()

addDefinitionLine(definitionLine): void

Adds the definition line to the hatch.

Parameters

definitionLine

HatchDefinitionLine

Definition line to add.

Returns

void

Deprecated

Use Hatch.definitionLines and definitionLines.push(definitionLine) instead.


contour()

contour(index): PiecewiseContour

Returns the contour.

Throws a RangeError if index is not in the range [0, numberOfContours - 1].

Parameters

index

number

Contour index.

Returns

PiecewiseContour


definitionLine()

definitionLine(index): HatchDefinitionLine

Returns the definition line.

Throws a RangeError if index is not in the range [0, numberOfDefinitionLines - 1].

Parameters

index

number

Definition line index.

Returns

HatchDefinitionLine

Deprecated

Use Hatch.definitionLines and definitionLines[index] instead.


typeOfContour()

typeOfContour(index): ContourType

Returns the type of hatch contour.

Throws a RangeError if index is not in the range [0, numberOfContours - 1].

Parameters

index

number

Contour index.

Returns

ContourType