Syntax
- modify(component) { selector operator operations | ... }
- modify(component, scopeAlignment) { selector operator operations | ... }
Parameters
- component, scopeAlignment, selector, operator, operationsThese parameters are the same as for the comp operation.
Description
The modify operation edits selected parts of the current geometry. Like the comp operation, it divides a shape into topological components (defined by component, selector, operator) that results in new shapes that are modified according to the specified operations.
Unlike the comp operation, the modify operation always performs shape recomposition implicitly (see Shape Recomposition), i.e., recombining the edited components with the remaining geometry. For face components, the following two lines are therefore equivalent:
- modify(f) { ... }
- inline(recompose) comp(f) { ... | all: X. }
In contrast to an inlined comp operation, modify automatically restores the untouched geometry, removing the need for the "| all: X." clause. It also enables modifying edge and vertex components while returning to the full geometry after the operation.
Note:
The modify operation only changes the current shape's geometry and does not add successor shapes to the shape tree.
Comp shape attributes
Each generated shape has a number of comp shape attributes set. For more information see comp attribute.
Related
Examples
Modified Roof Ridge
The ridge of the roof is moved 2 meters to the side. | ![]() |
Tapered Mass
The top of a extruded mass is rescaled to create slanted facades. | ![]() |
Corrugated Facade
The input shape is first divided into the house and front footprint, tagged, and recombined using inline(recompose). The connecting edge is then modified and split into repeated outsets. Each outset is built by subdividing the edge, tagging reference parts, and transforming the center segment. Shape recomposition automatically merges the modified edges with the footprints, producing the corrugated pattern. | ![]() |
The extrude operation automatically propagates the previously appied edge tags to the corresponding facades. The tags are used to color the facades. The cleanupGeometry operation is used to merge adjacent coplanar wall polygons. | ![]() |
Hyperbolic Grid
The example first splits the input shape into a 10x10 grid using inline(recompose) Then, each vertex is moved to create a hyperbolic surface. Finally, we set scope.ty back to its original value to ensure the new shape is fully above the input shape. The rule uses the Max_Height attribute to control the height of the hyperbolic surface (preventing the quadratic function to explode on large input shapes). The noAlign parameter ensures that all vertex scopes share the same coordinate system. It keeps the original pivot, so each vertex's scope remains relative to that reference, allowing its position to be read directly from the scope translation. | ![]() |
Hyperbolic Roof
The Paraboloid rule can be used directly to modify the top of an extruded mass. | ![]() |
Chaikin's Corner Cutting Algorithm
![]() | |
This example implements Chaikin's corner cutting algorithm to smooth the polygon boundary. Each iteration splits every edge into three parts and collapses the last segment. By collapsing the end of each edge, the start of the following edge is also collapsed, gradually cutting the corners and producing an even smoothing effect. The cleanupGeometry operation merges the vertices of the collapsed edge. | ![]() |







