TurboCAD: Brush Style Patterns

TurboCAD, as does all CAD software, has a hatching tool that fills polygons with a brush style pattern – either with a vector hatch or bitmap pattern. Such fills are commonly used to denote a specific property or material, such as glass, wood, etc. A common question often asked by many TurboCAD users – is it possible to use custom hatch patterns in TurboCAD? The answer is yes – you can use custom patterns! This how-to guide explains how to use custom hatch and bitmap patterns in legacy versions of TurboCAD from v3 to v9 including LE. Examples include converted AutoCAD hatch patterns and custom bitmap patterns.

  • Facebook
  • Google
  • Twitter
  • Pinterest
Photo of Mount Rainier taken from Offut Lake during winter.

Getting Started

Using custom brush patterns in TurboCAD requires editing the TurboCAD configuration file, which has an ini extension. Before editing the ini file, it is a good idea to first make a backup of your existing file. Some modifications to the ini file, when made incorrectly, might cause TurboCAD to become unstable. A backup will make it easy to restore TurboCAD to a working state, by fixing any problems that might be caused by a corrupted ini file. Although TurboCAD will create a default ini file if one doesn’t exist, this method isn’t necessarily the best way to replace a corrupted ini file. If forced to use this method, you might lose your custom TurboCAD settings. So, always make a backup!

The TurboCAD ini file is located in the TurboCAD program folder. Because the ini file is used by TurboCAD to store information when it is running, make sure to exit TurboCAD before you edit the ini file. You’ll need to locate the ini file before following the instructions in this quick guide. Depending on your version of TurboCAD, the file will be named using this notation: tcwXX.ini, where XX is the version number of TurboCAD. For example, the configuration file is named tcw30.ini in TurboCAD v3, and named tcw80.ini in TurboCAD v8.

After loading the TurboCAD ini file into your favorite text editor and scrolling down, you’ll come across the [BrushStyle_Table] heading. It is under this heading that you’ll find the definitions for all of TurboCAD’s brush style patterns. (Except for the Solid brush – which is hard-coded into TurboCAD.) Note the different parameters listed in TurboCAD’s brush style table. Using a given custom hatch or bitmap pattern in TurboCAD requires specifying a corresponding set of parameters under the [BrushStyle_Table] heading.

There are three types of TurboCAD brush style patterns under the [BrushStyle_Table] heading:

  • TurboCAD vector-based hatch patterns
  • Windows vector-based hatch patterns
  • Windows bitmap patterns (bmp file)

Specific parameters are used to identify a brush style pattern as one of the above types. All patterns will have three things in common: (1) a style name to identify the pattern, then (2) either a T or a W to denote it as a TurboCAD or Windows pattern, and (3) either H or B to indicate whether the pattern is a hatch or a bitmap. For the three types of brush style patterns that are possible in TurboCAD:

  • T,H – TurboCAD vector-based hatch pattern
  • W,H – Windows vector-based hatch pattern
  • W,B – Windows bitmap pattern (bmp file)

Important – if you decide to make changes to the TurboCAD ini file, save the file in ascii format! (Not as a Word doc file or in some other non-ascii format!)

Hatch Pattern Syntax

TurboCAD Vector Hatch Patterns

TurboCAD’s hatch patterns are for the most part identical to vector-based hatch patterns used by other CAD packages and drawing programs. The main differences are in the parameters required to create these patterns, and how those parameters affect the pattern that is created. By specifying the correct parameters, you can create many different vector-based hatch patterns. The required parameters, and a brief explanation of each, are listed below:

<style_name> = T,H, <angle>, <x0>, <y0>, <dx>, <dy>, <number_of_dashes_values>, <dash_values>

    • style_name – name by which the hatch pattern will be identified (no spaces)
    • angle – angle of the line
    • x0 – x coordinate of the line’s starting point along the x axis
    • y0 – y coordinate of the line’s starting point along the y axis
    • dx – distance along x axis before line repeats
    • dy – distance along y axis before line repeats

  • number_of_dash_values – number of dash values listed for TurboCAD to use as dash parameters
  • dash_values – corresponding dash parameter values

To define a TurboCAD hatch pattern, start with a unique, descriptive style_name. (Don’t use any spaces in the name!) Then, T,H must be used to indicate that you are defining a TurboCAD hatch pattern. The next parameters might be a bit tricky to understand. A hatch pattern is a vector-based entity, think of it as a single repeating line, or several repeating lines, within a given area. The spacings and different line styles of the pattern are controlled by dashes in the repeating line(s). By using these parameters, you can manipulate the appearance of the repeating line(s) to create a desired hatch pattern. The parameters are described in more detail below:

  • Angle – the angle at which the line will be drawn, relative to TurboCAD’s zero angle.
  • x0 and y0 – x0 and y0 are the origin of the repeating line. The origin of the repeating line is defined relative to the origin of the drawing, which is where 0,0 lies. This is good to remember, because some hatch patterns might look marginally different when the origin is modified, or when the pattern is used in a drawing where the origin is different from a typical default setting of 0,0.
  • dx and dy – dx and dy define the distance from the line’s origin, where the line will start repeating.
  • number_of_dash_values and dash_values – these parameters are used to specify whether there are breaks or dashes in the line. This is controlled by the number_of_dash_values parameter, and the corresponding dash_values. You must supply at least two dash_values to have one break in the repeating line. Hence, for each different dash you’ll have two dash values. One of the values must be positive and one must be negative. The positive value represents the size of the dash, and the negative represents the space of the break between dashes. So, for one dash in your repeating line, your number_of_dash_values must equal 2, and then your dash values would be something like dash_value1 = 1 and dash_value2 = -1. Or, in short: number_of_dash_values = 2, dash_value1 = 1, dash_value2 = -1. Note – for a solid line, set number_of_dash_values equal to 0.

The only difference between AutoCAD and TurboCAD hatch patterns, is that Turbocad requires a style_name, the T and H parameters, and the number_of_dash_values parameter. For example, listed below is the legacy AutoCAD “parquet” hatch pattern from acad.pat used to represent flooring by the same name:

*AR-PARQ1, 2x12 Parquet flooring: pattern of 12x12
90, 0,0, 12,12, 12,-12
90, 2,0, 12,12, 12,-12
90, 4,0, 12,12, 12,-12
90, 6,0, 12,12, 12,-12
90, 8,0, 12,12, 12,-12
90, 10,0, 12,12, 12,-12
90, 12,0, 12,12, 12,-12
0, 0,12, 12,-12, 12,-12
0, 0,14, 12,-12, 12,-12
0, 0,16, 12,-12, 12,-12
0, 0,18, 12,-12, 12,-12
0, 0,20, 12,-12, 12,-12
0, 0,22, 12,-12, 12,-12
0, 0,24, 12,-12, 12,-12

In TurboCAD, this hatch pattern would be defined as:

#Comment: 2x12 Parquet flooring - pattern of 12x12
PARQ1=T,H, 90, 0,0, 12,12, 2,12,-12
PARQ1=T,H, 90, 2,0, 12,12, 2,12,-12
PARQ1=T,H, 90, 4,0, 12,12, 2,12,-12
PARQ1=T,H, 90, 6,0, 12,12, 2,12,-12
PARQ1=T,H, 90, 8,0, 12,12, 2,12,-12
PARQ1=T,H, 90, 10,0, 12,12, 2,12,-12
PARQ1=T,H, 90, 12,0, 12,12, 2,12,-12
PARQ1=T,H, 0, 0,12, 12,-12, 2,12,-12
PARQ1=T,H, 0, 0,14, 12,-12, 2,12,-12
PARQ1=T,H, 0, 0,16, 12,-12, 2,12,-12
PARQ1=T,H, 0, 0,18, 12,-12, 2,12,-12
PARQ1=T,H, 0, 0,20, 12,-12, 2,12,-12
PARQ1=T,H, 0, 0,22, 12,-12, 2,12,-12
PARQ1=T,H, 0, 0,24, 12,-12, 2,12,-12

Windows Vector Hatch Patterns

Windows hatch patterns are pre-defined in the Windows Wingdi.h file (i.e., pre-defined GDI styles). In TurboCAD, these patterns consist of a style_name (no spaces) to identify that pattern, then W,H to indicate that the pattern is a Windows vector-based hatch, and finally the style_index which GDI uses to identify the pattern:

<style_name> = W,H, <style_index>

Listed below are three examples from Wingdi.h – the middle digit is the style_index:

#define HS_BDIAGONAL 1 /* ///// */
#define HS_CROSS 2 /* +++++ */
#define HS_DIAGCROSS 3 /* xxxxx */

And here are the corresponding parameters to define those hatch patterns (plus two others), from tcw80.ini:

WH_BDIAGONAL=W,H,1
WH_CROSS=W,H,2
WH_DIAGCROSS=W,H,3
WH_FDIAGONAL=W,H,4
WH_HORIZONTAL=W,H,5
WH_VERTICAL=W,H,6

Bitmap Hatch Patterns

Even though there are parameters listed in the TurboCAD ini file under the [BrushStyle_Table] heading for Windows bitmap patterns, they are commented out and disabled by default in TurboCAD. This is because it is difficult to predict whether these bitmap patterns reside on every computer that TurboCAD is installed on. To enable these patterns, you may delete the hash “#” mark with a text editor. However, to use these (or other) bitmap patterns, you must ensure that the path points to the correct folder, and that the listed bitmaps actually exist.

As with vector-based hatch patterns, bitmap patterns start with a unique, descriptive style_name (no spaces) to identify the pattern. You must use W,B to identify it as a Windows bitmap pattern. Currently Windows bmp is the only file type supported; however, this does not restrict you to the default bmp files listed under the [BrushStyle_Table] heading. The last parameter to specify a bitmap pattern is the bitmap_file_pathname, which includes the bmp filename:

<style_name> = W,B, <bitmap_file_pathname>

The default bitmap files in tcw80.ini are listed below:

WB_1=W,B,arcade.bmp
WB_2=W,B,argyle.bmp
WB_3=W,B,castle.bmp
WB_4=W,B,honey.bmp
WB_5=W,B,redbrick.bmp
WB_6=W,B,rivets.bmp
WB_7=W,B,squares.bmp
WB_8=W,B,thatch.bmp
WB_9=W,B,zigzag.bmp

You may have to experiment to create a desired bitmap pattern – one possible restriction you might encounter will be the physical size of the bitmap that you are using to fill-in, or tile, a given area. Another restriction might be the scale of any detail in an individual bitmap tile; say you specify a bitmap tile that is largely black with a small white dot in the center, when tiled as a brush style pattern, all you’ll likely see is black.

Final Considerations

Whenever you create a new drawing file, TurboCAD stores a copy of the [BrushStyle_Table] in the newly created file. This is true for new drawing files that are created using the TurboCAD factory default settings, and for new drawing files based on templates. For this and other reasons, when adding custom patterns to the TurboCAD brush style table, you should follow these guidelines:

  • Do not change, rename, or delete the default hatch patterns. One reason is because the default properties of some tools and styles in TurboCAD are based on the default hatch patterns. And you may discover other reasons why messing with the default hatch patterns isn’t a good idea.
  • Do not specify a style name that is in use by any of the default patterns, or by any other existing pattern. Using a non-unique style name will result in a hybrid pattern; that is, a combination of your custom pattern and some existing pattern. This includes any patterns that might be stored in a given tcw file.
  • Consider settling on a final, consistent version of the brush style table before using any custom patterns in your work. Frequently saving different brush style tables in the TurboCAD ini file will result in inclusion of different brush style tables in new drawing files that you might create during this time. These inconsistencies could cause problems later.
  • There may be a practical limit on the number of patterns you can define in the brush style table. Too many patterns might make TurboCAD slow, unworkable, or perhaps unstable. (If anyone finds out, please tell me, I’d like to know.)
  • Your custom brush style table will not be automatically carried over when you upgrade TurboCAD. After upgrading, you’ll have to manually copy your [BrushStyle_Table] settings to the new ini file.

Good luck using your custom patterns in TurboCAD! If you encounter any inaccuracies in this quick guide, please send email.

The contents of this page are copyrighted.

Document history:

  • Version 1.0, August 17, 2003.
  • Version 1.1, December 25, 2008. Edited this tutorial for clarity and updated the writeup to indicate that it applies to legacy versions of TurboCAD from v3 to v9 including LE.

TurboCAD.com