Command: polyclip

Syntax

{<entity> = } polyclip <elist>

or

{<entity> = } polyclip <elist> {
    <pcommand>
    ...
}

Description

Create one or more polygon graphic entities from the result of 2-D boolean polygon operations.

Parameters

Switches

Notes

This command creates one or more graphic entities of type polygon. Any input or mask polygons with coincident or crossover edges will produce undefined (probably incorrect) results.

The boolean operation should be considered as: <result> = <elist> <op> <mask>

Any holes resulting from the boolean operation will be created as unnamed child holes.

Polygons which reduce to a line for one reason or another are ignored.

All polygons created by a polyclip command (including holes and islands) become the new contents of the "these" group, replacing anything which was in the "these" group.

During vertex definition in the mask polygon language block (if included), a point phrase beginning with @ will indicate an invisible edge.

The system numeric found records the number of polygons created by the polyclip command. Holes and islands are excluded from the count.

Examples

Create the union of two squares.

polygon { gc, e:100, n:100, w:100, r }
polyclip this { (50,50), e:100, n:100, w:100, r }

Create the difference of two squares.

entity f1 = polygon { gc, e:100, n:100, w:100, r }
entity f2 = polygon { (20,20), e:30, n:30, w:30, r }
entity f3 = polyclip f1, -mask=f2, -els=green, -dif

See Also

Commands:

entity, gstructure, polygon, point, prism, zone

System Colors:

def_color (color), def_fragment (numeric), def_rank (numeric), these (group)

Structures:

entity (polygon)