Global

Global

Type Definitions

Area

Area object.

{left: number, top: number, right: number, bottom: number}

NameTypeDescription
leftnumber

Left coordinate

topnumber

Top coordinate

rightnumber

Right coordinate

bottomnumber

Bottom coordinate

BBox

Bounding box object.

{x: number, y: number, width: number, height: number}

NameTypeDescription
xnumber

X coordinate

ynumber

Y coordinate

widthnumber

Width of bounding box

heightnumber

Height of bounding box

Intersect

Intersect object.

{pts: Point[], ts1: number[], ts2: number[]}

NameTypeDescription
ptsPoint[]

An array of intersected points, or an empty array if no intersections.

tsArray.<number[]>

Two arrays (0 === first segment, 1 === second segment) of T values for the intersected points.

PathList

Path segment list. Contains an array of objects in the following format:

{type: string, x: number, y: number, x1: number, y1: number, x2: number, y2: number}

NameTypeAttributesDescription
typestring

Valid svg path command limited to M, L, C, Q, Z

xnumber

X coordinate

ynumber

Y coordinate

x1numberoptional

X control point for quadratic and bezier curve

y1numberoptional

Y control point for quadratic and bezier curve

x2numberoptional

Second X control point for bezier curve

y2numberoptional

Second Y control point for bezier curve

lengthnumber

The number of items in the path segment list

Point

Point object.

{x: number, y: number}

NameTypeDescription
xnumber

X coordinate

ynumber

Y coordinate

Methods

.globalize(x, y, [target]) Returns: Object

Globalize a point in current shape's coordinate system to a target's coordinate system. Target could be either Vecta.Page or Vecta.Shape. If not given, defaults to Vecta.activePage

NameTypeAttributesDefaultDescription
xnumber|string

Coordinate point of x

ynumber|string

Coordinate point of y

targetVecta.Page|Vecta.ShapeoptionalVecta.activePage

Target could be either Vecta.Page or Vecta.Shape. If not supplied, will default to Vecta.activePage.

Returns:

Converted target coordinates in {x: number|string, y: number|string}.

.localize(x, y, [source]) Returns: Object

Localize a point in a source's coordinate system to current shape's coordinate system. Source could be either Vecta.Page or Vecta.Shape. If not given, defaults to Vecta.activePage

NameTypeAttributesDefaultDescription
xnumber|string

Coordinate point of x

ynumber|string

Coordinate point of y

sourceVecta.Page|Vecta.ShapeoptionalVecta.activePage

Source could be either Vecta.Page or Vecta.Shape. If not supplied, will default to Vecta.activePage.

Returns:

Converted source coordinates in {x: number|string, y: number|string}.