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-doted lines. The pattern can be mirrored or composed with its mirror image to create 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[] = []

Collection of definition lines.


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 object id.

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 definitionLines.length instead.

Returns

number


uuid

Get Signature

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

Returns uuid of the drawing element. null if the drawing element has no assigned uuid (by default).

Returns

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

Set Signature

set uuid(uuid): void

Sets uuid of the drawing element.

Parameters

uuid

Uuid of the drawing element.

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

Returns

void

Inherited from

Element.uuid

Methods

accept()

accept(visitor): void

Accepts a drawing element visitor.

Parameters

visitor

ElementVisitor

Accepted drawing element visitor.

Returns

void

Overrides

Element.accept


addContour()

addContour(contour, type): boolean

Adds the hatch contour.

Parameters

contour

PiecewiseContour

Added contour.

type

ContourType = ContourType.OUTER

Type of contour.

Returns

boolean


addDefinitionLine()

addDefinitionLine(definitionLine): void

Adds the definition line to the hatch.

Parameters

definitionLine

HatchDefinitionLine

Added definition line.

Returns

void

Deprecated

Use definitionLines.push(`definitionLine`) instead.


contour()

contour(index): PiecewiseContour

Returns the contour.

Throws exception if index is not in range [0, numberOfContours()-1].

Parameters

index

number

Contour index.

Returns

PiecewiseContour

Warning

index must be in the range [0, numberOfContours()-1].


definitionLine()

definitionLine(index): HatchDefinitionLine

Returns the definition line.

Throws exception if index is not in range [0, numberOfDefinitionLines()-1].

Parameters

index

number

Definition line index.

Returns

HatchDefinitionLine

Warning

index must be in the range [0, numberOfDefinitionLines()-1].

Deprecated

Use definitionLines[`index`] instead.


typeOfContour()

typeOfContour(index): ContourType

Returns the type of hatch contour.

Throws exception if index is not in range [0, numberOfContours()-1].

Parameters

index

number

Contour index.

Returns

ContourType

Warning

index must be in the range [0, numberOfContours()-1].