Syntax
- setbackPerEdge(distance ) { selector operator operations | ... }
- setbackPerEdge(distance, uvSet) { selector operator operations | ... }
Parameters
- distance—floatAn expression that specifies the setback distance. It is evaluated per face edge.
- uvSet, selector, operator,
operationsAll other parameters are the same as for the setback operation.
Description
The setbackPerEdge operation is similar to the setback operation. The only difference is that the setback distance is evaluated several times and individually for each face edge. Shared edges are considered separately for each face. Therefore, a different distance can be set for each edge.
At the time distance is evaluated the current shape equals to one of the respective face edge components. More precisely, the current geometry, pivot and scope equals to the face edge component of the comp operation (with the compSelector set to fe). Furthermore, comp attributes can be accessed.
Related
Examples
Setback vs. setbackPerEdge
This simple example illustrates the difference between setback and setbackPerEdge. While for setback the distance is evaluated once and assigned the same for all edges, setbackPerEdge re-evaluates the distance for each edge.
|
Using comp shape attributes
The comp.index attribute is used to extract the distance from an ordered float array. Note that indexing is done in face-edge order (first edges are highlighted in orange). 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). Also note that dist is a function that is evaluated several times. If dist was an attr or const it would only be evaluated once at rule start with comp.index being -1.
The same result can be achieved by:
|
Using comp shape geometry
Setbacks are applied relative to edge lengths.
| |
Also context and occlusion queries can be used to specify distances.
| |
In this example edge attributes are sampled and used to set distances.
|
setbackPerEdge as setback
This example illustrates the fact that setbackPerEdge internally evaluates the distance for each edge, constructs an array and passes it to setback. Although only one edge is selected by the front selector the debug function is evaluated 4 times, once for each edge.
|