Reporter
Selector
Controller
Projection
Re-present (abstract or transform) information from a model.
Models can be complex. Finding and using the relevant parts of a
model can be tedious and error-prone. Further, "parts" of a
model may only be implied---computation may be needed to
construct them from primary model data. Use this pattern when
you need to use some aspect of a model in another process or
another part of the model.
Models can be arbitrarily complex and therefore hard to
understand. Further, they can imply far more information than
they directly express. Such information is typically uncovered
through functions\index{function} applied to the model. Using a
Reporter allows you to present only
the information you need to another part of the model. This
makes your model structure more clear and helps you communicate
with other people who may use your model.
Reporters may abstract (simplify) or
transform (re-present). They report a design or its parts from a
different point of view. In analogy to a relational database,
the Reporter pattern is akin to a
view table extracted from a database.
Data from a Reporter must be
conceived, extracted and envisioned. Deciding what to report
can be non-trivial, for example, when reporting planarity in
facade elements, the most appropriate report may, or may not,
be the minimal vertex movement that restores
planarity. Extracting the data may involve a substantial
algorithm\index{algorithm}, for example, a convex hull\index{convex hull} of a set of
points. Envisioning that data so that it makes sense to the
person receiving it has been the subject of entire books
\cite{Tufte1986}, \cite{Tufte1990},
\cite{Tufte1997} -- it is likely that a simple, textual
list will not best. Of course, if the purpose of the
Reporter is to provide data to
another program, a textual or numeric list might be exactly
right.
You can use the Reporter
pattern in many different ways.
- Displaying properties of an object. For example, the
coordinates of a collection of points might be displayed
numerically in a table, or their minima and maxima might be
instanced as two points.
- Defining an element in a different way. For example, a
point defined in one coordinate system can be reported in
another.
- Conditionally selecting parts from your model. In this
use, a Reporter is very similar to
a Selector. For example,
a roof surface comprising polygons might be reported by the
degree of non-planarity in each.
- Creating new objects from the reported objects. In this case
of indirection, a property of an object is used to define
another object. For example, a Reporter on line
segments might comprise new segments coincident with the
orginals' central third. Another Reporter
example produces a
*dual* polygon mesh (the
mesh generated by replacing centroids with vertices, and
edges between vertices with edges between centroids).
- Sampling a model and then reporting this
simplified version somewhere else and with different
conditions to create a more complex model.
- Copying. Generally, copying is reporting the model as many
times as needed in different places, therefore features such
as copy, mirror, clone and rotate are all kinds of
reporting.

The Reporter pattern typically
combines with other patterns to make a complete task.
This pattern feeds information to downstream objects or directly
to the designer. In many ways, it is a normal part of parametric
modeling in that models are defined in terms of other
models. The difference is that a
Reporter is often not a part of the
design, but rather a view on the design or an intermediary in
the model construction process.
In some sense, the Reporter pattern
is an anti-Controller pattern. In a
Controller, information flows from the control to the target --
typically from a simple model to a complex one. In a Reporter
information flows the other way -- it typically is an
abstraction of a larger model.
Subtended Angle
Envision information from the model as text.
In a circle\index{circle}, any inscribed angle subtended by a chord of a
given length is constant. A good demonstration is to
justapose as text multiple angles\index{angle} subtended by a common
chord. This model comprises a circle and two pairs of lines
that represent two angles and share a common subtending
chord. Showing both of those angles together demonstrates
this simple geometric theorem. Text is perhaps the most
simple Reporter. Sometimes it is
actually effective.
Click to download RepoSubtendedAngle.gct
Array Depth
Extract properties of a collection of points organized as an array.
Collections of objects such as points\index{point} imply many properties,
some pertaining the points themselves and some to their
organization in a collection. Examples include the extrema
coordinates of the points, the longest path in the
collection (the array depth) and the number of elements in
the collection. In this example, the
Reporter pattern extracts such
data from the model. In this sample, a function iterates over
each element in a collection, accumulating the desired
measures as it proceeds.
Click to download RepoArrayDepth.gct
Fabrication
Transform design data for fabrication.
Slicing a solid with planes gives a set of closed curves. A
common fabrication technique is to use such curves to cut
*stations* out of a sheet material and use the
stations as internal formwork that is covered with other
sheet or strip material. The curves\index{curve} forming the stations can
be reported in variety of ways, in both 2D and 3D and
through mediating transformations\index{transformation}. In this sample, one
report is a scaled 3D version and
the other is a 2D layout suitable
(to a first approximation) as a cutting plan from sheet
material.
\begin{bodyNote}
\pbOneCol
{\input{\GCFigsPath/Patterns/ReporterFabricationExplain0.tex}}
\end{bodyNote}
Click to
download RepoFabrication.gct
Mirror
Mirror a curve\index{curve} through an axis.
Define a curve based on a point collection, and a line to
use as a mirror. In 3D the line would be a plane. Now
project poles to the axis (perpendicular to the line) and
then create points on the other side of the axis at the same
distance as between the original points and their
projections. Finally create a curve from the new poles on
the other side of the axis, this curve is a mirror of the
first curve. In general, it will be an
*enantiomorph*, that is, identical except for
handedness.
Click to download
RepoMirror.gct
Out of Plane
Report the out-of-plane polygons of a surface both by color and text.
Create a surface\index{surface} with curvature\index{surface!curvature} and then subdivide the
surface with polygons or create an array of polygons on the
surface. When the surface has curvature, some of the
polygons may be non-planar. The degree of non-planarity
depends on the local curvature of the surface. Using a
function that iterates over the collection, extract the
polygons that exceed a threshold out-of-plane
measure. Visualize the resulting polygons\index{polygon} both
*in-situ* with colour and in a tabular report.
\begin{bodyNote}
\pbOneCol
{\input{\GCFigsPath/Patterns/ReporterOutofPlaneExplain0.tex}}
\end{bodyNote}
Click to download RepoOutOfPlane.gct
Snapper
Report a triangle snapped onto a grid.
Parametric "sketches" (yes, a parametric model can be
sketch-like!) are continuous. They may be abstracted into a
discrete system, such as a grid. This
Reporter maintains the original
model and ability to smoothly interact with it and reports
the model as it would appear were it snapped onto a
specified grid. The reporting occurs in two steps. First,
report the position of the original triangle in a new
coordinate system. Second, select and report the nearest
point on the grid to each triangle\index{triangle} vertex. Construct the
reported triangle on these abstracted points\index{point}.
Click to download RepoSnapper.gct
Triangle
Rotate and scale a triangle\index{triangle}.
This sample separates the shape of an object from the space
in which it is embedded, giving independent control of each.
It reports a triangle developed in one coordinate system (the baseCS) in
another system (the reporterCS) and provides rotation\index{frame!rotation} and scaling\index{frame!scaling} controls
for that new coordinate system.
Ironically, this Reporter uses a
Reporter internally. In order to
compute the rotation of the reporterCS system, a
point is defined in the baseCS system at the
origin of the reporterCS system, but one unit
along the $x$-axis of the
baseCS system. Reporting this point in the
reporterCS system provides the arguments needed
for the function Atan2 to correctly compute the
rotation angle.
Click to download RepoTriangle.gct