Indeterminate Matching
This tutorial is intended to give you the skills necessary to:
Understand indeterminate matching in Shape Machine and how it works under different transformation modes.
Recognize how parameters like
scale
,angle
,max
, anddegree
affect matching and rule application.
You can download the tutorial file here: Tutorial 2.3dm
.
Part 1: Anatomy of a Replacement Rule
A replacement rule is the fundamental mechanism for transforming designs in Shape Machine. Understanding the formal components of a rule helps inform effective application.
Components of a Replacement Rule
\(u\) (LHS): The shape or pattern to find in the design.
\(v\) (RHS): The shape or pattern to replace \(u\) with in the design.
\(w\) (Design): The design to search for \(u\) in.
\(f\) (Transformation): The geometric mapping that aligns \(u\) with a part of \(w\).
The application of a rule involves finding a transformation \(f\) such that \(f(u)\) is embedded in \(w\) (\(f(u) ≤ w\)), and then replacing \(f(u)\) with \(f(v)\) to produce a new design \(w'\).
Formal Definition
Embed: Find a transformation \(f\) such that \(f(u) ≤ w\).
Fuse: Compute the new design \(w' = w - f(u) + f(v)\).
This means we remove the transformed LHS \(f(u)\) from the design \(w\) and add the transformed RHS \(f(v)\) to get the new design \(w'\).
Example
Rule: \(u \rightarrow v\), where \(u\) is a square and \(v\) is a square with a diagonal line.
Design: A grid of squares.
Application: - Find all instances of \(u\) in \(w\) using transformation \(f\). - For each instance, replace \(f(u)\) with \(f(v)\).
Key Points
The transformation \(f\) can include translations, rotations, scaling, and reflections, depending on the transformation mode (isometry, similarity, affinity).
The match is found when \(f(u)\) is a subshape of \(w\).
The replacement uses the same transformation \(f\) to map \(v\) into the design.
Part 2: Indeterminate Matching
Normally, the embedding process is a finite process. That is, for a given \(u\), \(w\), and type of transformation, the set of embedding transformations \(F = \{ f \; | \; f(u) \le w \}\) is finite. In some cases, this set \(F\) can be infinite. When this is the case, the query \(u\) is said to be indeterminate when searched for under that type of transformation.
In this section, we will explore indeterminate matching through several examples and learn
how parameters like max
and degree
influence the matching process.
Scale under Similarity/Affinity
When matching shapes under similarity or affinity, scaling becomes a factor. When the query (the shape you’re matching) has a single registration point, and no arcs to set a scale factor, the query is indeterminate under similarity and affinity.
What is a Registration Point?
Registration points are a concept used in Shape Machine to simplify the embedding process. Registration points exist at:
Intersections (both seen and projected)
All points
Centers of arcs
These are special, because they also contain information about the radius of the arc(s) centered at this registration point
Registration points are not a property of Shape according to the formalism, but they are a useful construct internally to make Shape Machine faster.
Warning
Under similarity, searching for circular arcs is always deterministic because their radii lock the scaling factor to specific values.
Shape Machine does not yet support searching for circular arcs under affinity.
Example
Matching the Letter ‘K’ in a Double Square
Setup: Draw the double square. Then, draw the letter ‘k’ next to it.
Task: Use Shape Machine to match the ‘K’s within the double square under similarity.
Observation: Shape Machine will prompt you asking for the scale parameter. This affects how the ‘K’ is matched within the square.
Key Point: The
scale
parameter sets the size of the scaling for the matching.
Exercises
Experiment with Scaling:
Try matching the ‘K’ at different scales.
Observe how the matching changes as you adjust the scale.
Question: How does changing the scale parameter affect the number of matches?
Exercise 1 solution
Solution: By changing the scale parameter, you can match the ‘K’ at different sizes within the square. If the scale is set too high or too low, the ‘K’ may not match correctly.
Angle for Concentric Points/Circles
When dealing with shapes that have rotational symmetries, such as concentric points or circles, the angle parameter comes into play. The angle determines how the shape is rotated in matching to the RHS / design.
Example
Making a Diameter on a Circle
Setup: Draw a circle.
Task: Create a rule that adds a diameter line across the circle.
Observation: The angle parameter dictates the rotation of the line on the RHS.
Observation: Using direct transformation mode prevents reflections during matching, whereas indirect transformation mode allows them.
Exercises
Exploring Angle Parameters:
Apply the rule with different angle parameters.
Observe how the diameter line rotates within the circle.
Question: How does the angle parameter affect the orientation of the diameter?
Exercise 1 solution
Solution: The angle parameter controls the orientation of the diameter line. By changing the angle, you can rotate the line around the circle’s center point.
Direct vs. Indirect Transformations:
Apply the rule using direct transformation
Then, apply it using indirect transformation
Question: What differences do you observe in the matches and transformations?
Exercise 2 solution
Solution: Direct transformations prevent reflections, while indirect transformations allow them. By using direct transformation mode, you prevent the line from being reflected across the circle’s center point, reducing the number of possible matches.
Single Line Case
In cases where the LHS of a rule is a single line, matching is indeterminate.
Parameters like max
and degree
can significantly affect the outcome.
Examples
Line Deletion Rule: LHS is a line; RHS is empty (under similarity).
Line Offsetting in Double Square: A rule that offsets all lines within the double square, affected differently when
degree=1
vs.degree=2
(under affinity).
Understanding Parameters
max
Parameter: Controls whether the design is maximized, i.e. the line be stretched as much as possible during matching.max=1
: Only the largest possible scale is considered.max=0
: Scale must be specified.
degree
Parameter: Controls whether scaling is applied along the line or uniformly.degree=1
: Stretch along the line.degree=2
: Scale uniformly.
Exercises
Line Deletion under Similarity:
Apply the line deletion rule with
max=0
andmax=1
.Question: How does changing
max
affect Shape Machine?
Exercise 1 solution
Solution: When
max=0
, Shape Machine prompts you to specify the scale. Whenmax=1
, the system automatically selects the largest possible scale.
Line Offsetting under Affinity:
Apply the offsetting rule with
degree=1
anddegree=2
.Question: How does changing
degree
influence the offsetting of lines?
Exercise 2 solution
Solution: When
degree=1
, the relative distance between lines is maintained. Whendegree=2
, the lines are scaled uniformly, which makes the offsetting more pronounced.
Summary Table of Parameters and Effects
Let’s summarize how different parameters affect the outcome of rule application:
Transformation |
Max = 0 |
Max = 1 |
Degree = 1 |
Degree = 2 |
---|---|---|---|---|
Similarity |
Scale set by user-specified |
Scale set to embed \(u\) as big as possible |
Uniform scale |
Uniform scale |
Affinity |
Scale set by user-specified |
Scale set to embed \(u\) as big as possible |
Stretch along direction of \(u\) |
Uniform scale |
Conclusion
In this tutorial, we explore indeterminate matching and rule sequences in Shape Machine.
By understanding how different transformation modes and parameters like scale
, angle
, max
,
and degree
affect matching and rule application, you can gain greater control over your designs in Shape Grammars.
Key Takeaways
Anatomy of a Replacement Rule: Knowing how \(u\), \(v\), \(w\), \(f(u)\), and \(f(v)\) interact is fundamental to the Shape Grammars formalism, and helps apply rules effectively.
Indeterminate Matching introduces flexibility in how shapes correspond under different geometric transformations.
Parameters like
max
anddegree
, as well as selection and transformation options, give you control over the matching and application process.
By experimenting with these concepts, you can harness the power of Shape Machine to generate creative and complex emergent designs.
Glossary
LHS (Left-Hand Side): The shape or pattern on the left side of a replacement rule, representing what to look for in the design.
RHS (Right-Hand Side): The shape or pattern on the right side of a replacement rule, representing what to replace the LHS with in the design.
Design (:math:`w`): The design to search for \(u\) in.
Rule (\(u \rightarrow v\)): A transformation rule where \(u\) is the LHS and \(v\) is the RHS.
Transformation (\(f\)): A geometric mapping that aligns the LHS \(u\) with a part of the design \(w\).
Embedding (\(f(u) ≤ w\)): The process of finding a transformation \(f\) such that the transformed LHS \(f(u)\) is a part of the design w.
Registration Point: See the note.
Isometry: A transformation that preserves distances and angles (rigid transformations).
Similarity: A transformation that preserves angles and proportions but may include scaling.
Affinity: A transformation that preserves parallelism of lines but may include shearing and non-uniform scaling.
Direct Transformation: A transformation that does not include reflections.
Indirect Transformation: A transformation that may include reflections.
Max Parameter (max
): Controls whether the transformation scales the shape to the maximum possible size during matching.
Degree Parameter (degree
): Controls the type of scaling applied during matching (uniform or directional).