# Class PathFigure

GoJS® Diagramming Components
version 3.0.14
by Northwoods Software®

A PathFigure represents a section of a Geometry. It is a single connected series of two-dimensional geometric PathSegments.

The Geometry.figures property is a list of PathFigures.

PathFigures are drawn with the Shape.stroke and other stroke properties. Filled PathFigures are painted with the Shape.fill.

A PathFigure must not be modified once its containing Geometry has been assigned to a Shape.

#####
Index

### Constructors

constructor

### Accessors

isEvenOdd
isFilled
isShadowed
segments
startX
startY

### Methods

add
copy

## Constructors

### constructor

- new PathFigure(sx?: number, sy?: number, filled?: boolean, shadowed?: boolean, isEvenOdd?: boolean): PathFigure

- Constructs an empty figure. The optional arguments specify the starting point of the figure. You'll want to add a new instance of a PathFigure to the Geometry.figures list of a Geometry.

  #### Parameters

  - ##### `Optional` sx: number

    optional: the X coordinate of the start point (default is zero).

  - ##### `Optional` sy: number

    optional: the Y coordinate of the start point (default is zero).

  - ##### `Optional` filled: boolean

    optional: whether the figure is filled (default is true).

  - ##### `Optional` shadowed: boolean

    optional: whether the figure may be drawn with a shadow (default is true).

  - ##### `Optional` isEvenOdd: boolean

    optional: whether uses the even-odd rule (true) or nonzero winding number rule (the default, false).

  #### Returns PathFigure

## Accessors

### isEvenOdd
: boolean

- Gets or sets whether this PathFigure will render and hit-test with the even-odd fill rule or nonzero winding number fill rule (false). The default value is false, using the nonzero winding number rule.

  In Geometry Path Strings, this is set by using "F0" instead of "F" at the beginning of a figure.

  `since`

  2.3

### isFilled
: boolean

- Gets or sets whether this PathFigure is drawn filled. The default value is true.

### isShadowed
: boolean

- Gets or sets whether this PathFigure will render a shadow if one is defined. This is used for turning off shadows on specific subpaths. The default value is true.

### segments
: List<PathSegment>

- Gets or sets the List of PathSegments that define this PathFigure.

### startX
: number

- Gets or sets the starting point X coordinate of the PathFigure. The default value is zero.

### startY
: number

- Gets or sets the starting point Y coordinate of the PathFigure. The default value is zero.

## Methods

### add

- add(segment: PathSegment): PathFigure

- Add a PathSegment to the segments list.

  #### Parameters

  - ##### segment: PathSegment

    a newly allocated unshared PathSegment that will become owned by this PathFigure

  #### Returns PathFigure

### `Virtual` copy

- copy(): PathFigure

- Create a copy of this PathFigure, with the same values and segments.

  #### Returns PathFigure

Copyright © 1998-2024 by Northwoods Software Corporation.