ShapeContainerMixin.createPath

Creates a new path shape in this container

ShapeContainerMixin.createPath() method

Creates a new path shape in this container

Signature:

createPath(opts?: PathOptions): Path;

Parameters

Parameter

Type

Description

opts

PathOptions

(Optional) Optional configuration for the path

Returns:

Path

The newly created path

Example

// Create a path shape
const path = await layer.createPath({
  points: [
    { vertex: { x: 0, y: 0 }, inTan: { x: 0, y: 0 }, outTan: { x: 0, y: 0 } },
    { vertex: { x: 100, y: 100 }, inTan: { x: 0, y: 0 }, outTan: { x: 0, y: 0 } },
  ],
  closed: true,
});
Last updated: August 5, 2026 at 11:47 AMEdit this page