Slice Layer
[Slices][Desktop Automation]
Properties
Property | Read/write | Type | Description |
---|---|---|---|
contourcount | read | number | returns the number of contours of a slice layer |
contourlength | read | number | returns the contour length of a slice layer |
hatchcount | read | number | returns the number of hatches of a slice layer |
hatchlength | read | number | returns the hatch length of a slice layer |
maxx | read | number | maximum X of a slice layer |
maxy | read | number | maximum Y of a slice layer |
minx | read | number | minimum X of a slice layer |
miny | read | number | minimum Y of a slice layer |
Methods
Name | Syntax | Description |
---|---|---|
addpoint | slicelayer:addpoint(x:Number, y:Number) | Adds the first, next, or last point in a polyline forming an open or closed contour. Overall clock-handedness determines whether a closed polyline forms an inner or outer contour: Clockwise draw forms an inner, anti-clockwise draw forms an outer contour. Avoid self-intersections (eg. figure-of-eight) as they may lead to unexpected results. |
begincontour | slicelayer:begincontour() | Begins a new contour. Must precede the first slicelayer:addpoint() call per individual contour. Mandatory per new polyline. |
endcontour | slicelayer:endcontour() | Closes the contour from the last-added point to the first one after the last begincontour() call by adding another point with the coordinates of the first point of the current contour. Optional; omit for creating open-ended polylines (open contours). |
extractcontour | newslicelayer = slicelayer:extractcontour(n:Number) | Copies the n -th contour of a Slicelayer object into a new Slicelayer object¹ |
move | slicelayer:move(x:Number, y:Number) | Translates all points (and the contours they form) in this slice layer |
getpointcount | slicelayer:getpointcount(n:number) | Returns the count of points in the n -th contour created in this slice layer¹ |
getpointx | slicelayer:getpointx(m:Number, n:Number) | Get X coordinate of n -th point of m -th contour¹ |
getpointy | slicelayer:getpointy(m:Number, n:Number) | Get Y coordinate of n -th point of m -th contour¹ |
sort | slicelayer:sort(x:Number, y:Number) |
¹ Contour and point indices start at 0.