design_create_pattern
Create custom repeating patterns from drawing commands and store them in the sketch for use by a patterns:custom layer via its patternId.
Instructions
Create a custom repeating pattern from drawing commands. The pattern is stored in the sketch and can be used by a patterns:custom layer via its patternId. Commands: line, circle, rect, arc, path, polygon. Max 200 commands, 10KB limit. Coordinates are in unit-cell space (0 to width/height).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Human-readable name for the pattern. | |
| width | Yes | Unit cell width (local coordinates). | |
| height | Yes | Unit cell height (local coordinates). | |
| addLayer | No | Also add a patterns:custom layer using this pattern (default: true). | |
| commands | Yes | Drawing commands array. Examples: {"type":"line","x1":0,"y1":0,"x2":20,"y2":20,"lineWidth":1}, {"type":"circle","cx":10,"cy":10,"r":5,"fill":true}, {"type":"rect","x":0,"y":0,"width":10,"height":10,"fill":true}, {"type":"arc","cx":10,"cy":10,"r":8,"startAngle":0,"endAngle":3.14}, {"type":"path","points":[{"x":0,"y":0},{"x":10,"y":5},{"x":0,"y":10}],"closed":true,"fill":true}, {"type":"polygon","points":[{"x":0,"y":0},{"x":10,"y":0},{"x":5,"y":10}],"fill":true} |