Sg 2.9
Path
Packages RSS
About
News
Gallery
Scripts
Tutorials
Download
Reference
Forum
Users
License
Twitter

Extends PathItem

The Path item represents a path in an Illustrator document.

Constructors

    Parameters:
  • segments: Array of Segment — optional

Creates a Path Item with two anchor points forming a line.

Sample code:

var path = new Path.Line(new Point(20, 20, new Point(100, 100));
    Returns:
  • Path — the newly created path

Creates a Path Item with two anchor points forming a line.

Sample code:

var path = new Path.Line(20, 20, 100, 100);
    Returns:
  • Path — the newly created path

Creates a rectangular shaped Path Item.

Sample code:

var rectangle = new Rectangle(new Point(100, 100), new Size(100, 100));
var path = new Path.Rectangle(rectangle);
    Returns:
  • Path — the newly created path

Creates a rectangular shaped Path Item.

Sample code:

var path = new Path.Rectangle(100, 100, 10, 10);

Creates a rectangle shaped Path Item.

Sample code:

var path = new Path.Rectangle(new Point(100, 100), new Size(10, 10));
    Returns:
  • Path — the newly created path

Creates a rectangle shaped Path Item from the passed points. These do not necessarily need to be the top left and bottom right corners, the constructor figures out how to fit a rectangle between them.

Sample code:

var path = new Path.Rectangle(new Point(100, 100), new Point(200, 300));
    Returns:
  • Path — the newly created path

Creates a rectangular Path Item with rounded corners.

Sample code:

var rectangle = new Rectangle(new Point(100, 100), new Size(100, 100));
var path = new Path.RoundRectangle(rectangle, new Size(30, 30));
    Returns:
  • Path — the newly created path

Creates a rectangular Path Item with rounded corners.

Sample code:

var path = new Path.RoundRectangle(new Point(100, 100),
 new Size(100, 100), new Size(30, 30));
    Returns:
  • Path — the newly created path

Creates a rectangular Path Item with rounded corners.

Sample code:

var path = new Path.RoundRectangle(50, 50, 100, 100, 30, 30);
    Returns:
  • Path — the newly created path

Creates a regular polygon shaped Path Item.

Sample code:

// Create a triangle shaped path
var triangle = new Path.RegularPolygon(new Point(100, 100), 3, 50);
// Create a decahedron shaped path
var decahedron = new Path.RegularPolygon(new Point(200, 100), 10, 50);
    Returns:
  • Path — the newly created path

Creates a star shaped Path Item.

The largest of radius1 and radius2 will be the outer radius of the star. The smallest of radius1 and radius2 will be the inner radius.

Sample code:

var center = new Point(100, 100);
var points = 6;
var innerRadius = 20;
var outerRadius = 50;
var path = new Path.Star(center, points, innerRadius, outerRadius);
    Returns:
  • Path — the newly created path

Creates a spiral shaped Path Item.

Sample code:

var firstArcCenter = new Point(100, 100);
var start = new Point(50, 50);
var decayPercent = 90;
var numQuarterTurns = 25;
var path = new Path.Spiral(firstArcCenter, start, decayPercent,
 numQuarterTurns, true);
    Returns:
  • Path — the newly created path

Creates an oval shaped Path Item.

Sample code:

var rectangle = new Rectangle(new Point(100, 100), new Size(150, 100));
var path = new Path.Oval(rectangle);
    Returns:
  • Path — the newly created path

Creates an oval shaped Path Item.

Sample code:

var rectangle = new Rectangle(100, 100, 150, 100);
var path = new Path.Oval(rectangle);
    Returns:
  • Path — the newly created path

Creates a circle shaped Path Item.

Sample code:

var path = new Path.Circle(new Point(100, 100), 50);
    Returns:
  • Path — the newly created path

Creates a circle shaped Path Item.

Sample code:

var path = new Path.Circle(100, 100, 50);
    Returns:
  • Path — the newly created path

Creates a circular arc shaped Path Item.

Sample code:

var path = new Path.Arc(new Point(0, 0), new Point(100, 100),
 new Point(200, 150));
    Returns:
  • Path — the newly created path

Properties

The segments contained within the path.

The curves contained within the path. Read-only.

Read-only.

Read-only.

Read-only.

Read-only.

Specifies whether the path is closed. If it is closed, Illustrator connects the first and last segments.

    Returns:
  • Boolean

Specifies whether the path is used as a guide.

    Returns:
  • Boolean

The length of the perimeter of the path. Read-only.

    Returns:
  • Number

The area of the path in square points. Self-intersecting paths can contain sub-areas that cancel each other out. Read-only.

    Returns:
  • Number

Tablet Data

    Returns:
  • Array of Array of Number
    Returns:
  • Array of Array of Number
    Returns:
  • Array of Array of Number
    Returns:
  • Array of Array of Number
    Returns:
  • Array of Array of Number

Functions

Adds one segment to the end of the segment list of this path.

    Parameters:
  • segment: Segment — the segment or point to be added.
    Returns:
  • Segment — the added segment. This is not necessarily the same object, e.g. if the segment to be added already belongs to another path.

Inserts a segment at a given index in the list of this path's segments.

    Parameters:
  • index: Number — the index at which to insert the segment.
  • segment: Segment — the segment or point to be inserted.
    Returns:
  • Segment — the added segment. This is not necessarily the same object, e.g. if the segment to be added already belongs to another path.
    Parameters:
  • index: Number
    Parameters:
  • fromIndex: Number
  • toIndex: Number
    Returns:
  • Array of Segment, read-only

Removes the path item from the document.

    Returns:
  • Boolean

Reverses the segments of the path.

Approximates the path by converting the points in the path to curves. It only uses the segment.point property of each segment and ignores the segment.handleIn and segment.handleOut properties.

    Parameters:
  • tolerance: Number — a smaller tolerance gives a more exact fit and more segments, a larger tolerance gives a less exact fit and fewer segments. — optional, default: 2.5
  • threshold: Number — optional, default: 1
  • cornerRadius: Number — if, at any point in the fitted curve, the radius of an inscribed circle that has the same tangent and curvature is less than the cornerRadius, a corner point is generated there; otherwise the path is smooth at that point. — optional, default: 1
  • scale: Number — the scale factor by which the points and other input units (such as the corner radius) are multiplied. — optional, default: 1

Converts the curves in the path to points.

    Parameters:
  • maxPointDistance: Number — the maximum distance between the generated points — optional, default: 1000
  • flatness: Number — a value which controls the exactness of the algorithm — optional, default: 0.1

Reduces the amount of segments in the path.

    Parameters:
  • flatness: Number — a value which controls the exactness of the algorithm — optional, default: 0.1
    Parameters:
  • offset: Number
    Parameters:
  • index: Number
  • parameter: Number — optional
    Parameters:
  • path: Path
    Returns:
  • Boolean

Smooth bezier curves without changing the amount of segments or their points, by only smoothing and adjusting their handle points, for both open ended and closed paths.

    Parameters:
  • point: Point
  • precision: Number — optional
    Parameters:
  • offset: Number

Returns the point of the path at the given offset.

    Parameters:
  • offset: Number

Returns the tangential vector to the path at the given offset as a vector point.

    Parameters:
  • offset: Number

Returns the normal vector to the path at the given offset as a vector point.

    Parameters:
  • offset: Number
    Returns:
  • Boolean

Inheritance


AltStyle によって変換されたページ (->オリジナル) /