Note : This guide requires the Rhino 9 WIP. This is a work in progress meaning that it is meant for testing and should not be used for project critical production work. The Rhino 9 WIP is available to anyone that owns Rhino 8.
This guide covers new Rhino hatch components to both create, edit and save hatch patterns.
Basic Hatch Pattern Use
The simplest of definitions to use Hatches in Grasshopper and visualize the results in Rhino. We will build on this definition thru the rest of this guide as it allows us to monitor all the changes we are making.
- Model Hatch - A component that creates an instance of the Hatch Pattern that includes the Boundary shape and other properties that relate to the instance of the hatch on the screen.
- Model Hatch Pattern - This is the Pattern Definition which contains all the optional and required properties. This is the most important component when working with Hatch patterns to edit, create or save.
- Rectangle - This is a simple boundary geometry to hatch into. Depending on the size of the hatch this shape may need to be larger or smaller to see the complete pattern.
Anatomy of the Hatch Pattern
The best place to see what makes up a Hatch pattern is to take a look at the Hatch Pattern files (*.PAT). They are standard text files. In Rhino 9, we use the more modern version 3.0 of the PAT files that include a little extra optional metadata.
;%UNITS=INCH
;%VERSION=3.0
*Grid, This is the simple Grid Pattern
;%TYPE=DRAFTING
0,0,0,0,0.25
90,0,0,0,0.25
- Units - This is the units of the pattern. Its value is either
INCH
orMM
. It is optional. - Version - Current version 3.0 is the only version supported. This tag is optional.
- Title and Description - Following the
*
is the Title of the pattern then a comma followed by the description. - Type (Scaling Style in Grasshopper) - Can be
DRAFTING
orMODEL
. Drafting hatches are meant to be scaled with the plotted scale of a drawing. Normally, these are used for common drafting conventions representing different materials (e.g., standard patterns for steel, concrete or aluminum). Model types are set to a fixed scale in a model and represent that actual material or finish (e.g., an actual tile pattern or a brick pattern). - Hatch Lines Definition - All following lines describe the actual line work that makes up the pattern. See the Defining Hatch Lines section for details.
The Grasshopper Model Hatch Pattern component can be expanded to show all data in a hatch pattern. Zoom into the component to expand the Description, Units inputs and output:
Detailed documentation of the PAT file can be found at the PattyCake Hatch Editor Guides
Defining Hatch Lines
There tends to be two ways hatch patterns are laid out. Each layout takes a different strategy and within Grasshopper there is a separate component for each of those.
First is the hatch line based patterns. These are patterns that can be defined by lines set at certain angles, offset and dashes. These Patterns use the Model Hatch Line component to create the Hatch Lines output for a pattern. They may look like this:
The second method of creating a pattern is done by lines within a rectangular tile that can be repeated. These patterns can do very complex shapes. To create these use the Lines Pattern component. Patterns here might look like this:
Model Hatch Line Patterns
The Model Hatch line component creates a line within the hatch that extends to infinity.
Inputs to the Model Hatch line include:
- Start - an XYZ point or plane start of the line
- Direction - a Vector direction of the line
- Shift - How the dash pattern slides along the line from one offset to another.
- Offset - Spacing between lines
- Segments - A list of values representing the dashed pattern along the line. Positive values are solid distances. Negative values represent the gap in the line.
As the example shows how inputs can control a Pattern:
As an example the pattern above is made up of two lines (A and B). (A) lines are the solids and (B) lines are dashed. The Grasshopper definition would look like:
Some notes to the pattern above:
- The Origin point of Line A is 0,0,0. The Origin point of line B is an offset from that so the lines start in different places.
- The Direction is the same for both line, a 45 degree vector.
- The Offset is the same for both lines as they are both offset by one.
- Line B is a dashed line so its Segment list is 0.5 solid line, then 0.5 of a dashed line.
- To complete the pattern the Hatch Lines are connected into the Model Hatch pattern component.
Line Pattern Component
This component takes a rectangle with lines within it and creates a hatch pattern by tiling the shapes over and over.
The definition for this pattern is below:
Some notes on the Components:
- The Original Curve is drawn in Rhino to tile. Only line segments can be used in hatches.
- Use a Rectangle to specify the tile size.
- Finish the pattern by inputting into a Model hatch pattern Component with the Pattern name.
Exporting hatch Patterns
Exporting hatch patterns can be done by using the Export Hatch pattern component.
Note: overwrite set to True
is quite important if the hatch needs to be exported more then once.
By default, the Export button is shown. Zoom in to expose the Export input if writing of the PAT file is programmatically triggered.
Importing Hatch Patterns
There are a number of ways to find existing hatch patterns to work with.
Importing a pattern file from a directory by using the Query Directory component to find the files. Input those files into the Import Hatch Pattern Component. This component will import the pattern into Grasshopper, not Rhino by default.
An existing Pattern can be selected within the current active Rhino document using the Model Hatch pattern Component:
Also, the Query Hatch Pattern component can be used to find specific patterns in the active Rhino document. In this case any pattern that ends in Dash
: