Python script for Custom Hatching

Is there a way to define your own custom hatch pattern? In the help file and in other threads about the subject I can find information about importing hatch patterns, but I am after drawing up my own pattern, in particular a symbolic woodgrain pattern for 2D drawings (i.e. not surface rendering).

Max.

In theory you could write those by hand in any text editor.
This gets rather complex / tedious fast though.

@SamPage wrote an hatch maker plugin for Rhino for Windows which works really well.
I don’t know how much work that would be for him to rewrite that in python so you could run it on Mac as well… :wink:

I’m not ignoring this, just very busy :slight_smile:

1 Like

I have developed a python script for this, a bit crude, but sufficient for my purposes. The way it works:

  • draw a number of curves to serve as hatching pattern.
  • when spacing between patterns is required, draw a boundary object around the pattern curves.
  • run the script, you will be asked to select the pattern curves and the boundary object (if not required, select the pattern curves again).
  • the script asks to select the curves that bound the area to be hatched.
  • an area is defined in the same way as the CurveBoolean command, select only one area at the time.
  • the script creates the hatching in the defined area.


The script: Special Hatch.py (2.7 KB)

Max.
(edit: script updated, cosmetics only)

3 Likes