setback operation

Syntax

setback(distance) { selector operator operations | selector operator operations ... }

setback(distance, uvSet) { selector operator operations | selector operator operations ... }


setback(distances) { selector operator operations | selector operator operations ... }

setback(distances, uvSet) { selector operator operations | selector operator operations ...}

Parameters

Description

The setback operation selects a number of edges and sets them back by a given distance. This is somewhat similar to the polygon offset operation, with the difference that only a subset of the edges can be chosen for the setback.
A common setback distance can be specified for all edges. Alternatively, a separate distance for each face edge can be specified by passing an array of setback distances instead of a single setback distance to the operation. The array must be in face-edge order, i.e. the first element is the distance of the first edge of the first face, the second element is the distance of the second edge of the first face, and so on. Shared edges are considered separately for each face. If the array does not contain enough elements no setback is performed on the respective missing face edges. If the array contains more elements than the number of total face edges the respective setback distances are ignored. Such an array could be constructed using the comp function with the component selector set to fe (face edges). The setbackPerEdge operation provides a more convenient way to set individual setback distances without having to construct an array manually.

Component tags

All setback operations automatically apply semantic component tags to the resulting edge components:

Shape

"setback.front"Blue: original selected edges.
"setback.back"Green: new setback edges.
"setback.side"Yellow: side edges.
autotag-setback-shape
setback(4) { front : Shape }

Remainder

"setback.back"Green: new setback edges.
"setback.side"Yellow: side edges.
"setback.remainder"Purple: original edges.
autotag-setback-remainder
setback(4) { front : NIL 
           | remainder : Remainder }
For more information on working with component tags, refer to:

Related

Examples

Setback on Street Front


setback_street.front
LotInner --> Lot

Lot --> setback(5) { street.front = Garden   |
                     remainder    : Building }
    	
Garden --> color("#00ff00")

Building --> offset(-3, inside)
             extrude(world.up, rand(5, 15))
	

Individual distances


setback_array_1
// (9)[1,6,1,6,1,6,1,6,1]
const dists = comp(fe) { all : case comp.index%2 == 0 : 1
                               else                   : 6 }

Lot --> setback(dists) { all       = Garden   |
                         remainder : Building }
	
An array of alternating distances is created using the comp function on a shape with 2 faces. Note that the distances in the array are applied in face-edge order. The first edge of each face is highlighted. The first distance is applied on the first edge of the first face (left) and the 5th distance is applied on the first edge of the second face (right).


setback_array_2
// (9)[4,0,2,0.5,5,0.5,2,2,0]
const dists = comp(fe) { inside = 0   |
                         front  :
                           case comp.index == 0 : 4
                           else                 : 5 |
                         back   = 2   |
                         side   = 0.5 }

Lot --> setback(dists) { all       = Garden   |
                         remainder : Building }
    
In this example the comp function is used with different selectors and operators.


setback_array_3
Left --> shapeL(5, 5) { shape     = Garden  |
                        remainder : Building }

// (4)[5,5,0,0]
const dists = comp(fe) { front = 5 | right = 5  }

Right --> setback(dists) { all       = Garden   |
                           remainder : Building }
    
Left: A left-handed L shape using the shapeL operation. Right: A right-handed L shape shape using setback.

Also see the setbackPerEdge operation for more examples.

Copyright ©2008-2024 Esri R&D Center Zurich. All rights reserved.