Custom Hatch Pattern

sneenanKFX38
Contributor
Contributor

Custom Hatch Pattern

sneenanKFX38
Contributor
Contributor

Hi everyone! I am trying to create a custom glass hatch pattern and I was relatively certain I had it but I'm having difficulties. This is my first attempt so I figured I would try something simple but I can't seem to get things to line up properly. My code is

 

*Glass Hatch, glass hatch pattern
60, 0,0, 1.9077,2.5981, 2,-1.9077
60, 0.0434,0.5082, 1.9077,3.3043, 1.1845,-1.9077
60, 0.3077,0.1000, 1.9077,3.3043, 1.1845,-1.9077

sneenanKFX38_0-1703616060961.png

 

I'm trying to get the pattern above and I've gotten it to start well from the origin but then it becomes nonsensical lines. Any tips or thoughts are greatly appreciated!

 

 

0 Likes
Reply
Accepted solutions (1)
3,074 Views
3 Replies
Replies (3)

TheCADnoob
Mentor
Mentor

I couldnt quite figure out what you had going on. The below definition works but I'm not sure it is exactly how you want it. 

 

*Glass Hatch, glass hatch pattern
60,0,0,2.5,4.3301, 2,-3
60,.0434,.5082, 2.5, 4.3301,1.1845,-3.8155
60,.3077,.1, 2.5, 4.3301,1.1845,-3.8155
60,0,2,2.5,4.3301, 2,-3
60,.0434,2.5082, 2.5, 4.3301,1.1845,-3.8155
60,.3077,2.1, 2.5, 4.3301,1.1845,-3.8155
60,2.5,2,2.5,4.3301, 2,-3
60,2.5434,2.5082, 2.5, 4.3301,1.1845,-3.8155
60,2.8077,2.1, 2.5, 4.3301,1.1845,-3.8155

 

The first digit is the angle

The next two are the origin XY of your first line

The next two are the offset origin XY of the second line. This is where the next line will begin

The last two are the lengths of on and off. Its like pen down pen up commands. In the first line it will draw a line for 2, then it will skip over and not draw the next 3 units of length. 

 

TheCADnoob_0-1703640420413.png

TheCADnoob_1-1703641652495.png

 

CADnoob

EESignature

richard_387
Advocate
Advocate
Accepted solution

When starting out, it is difficult to see what is required for the hatch pattern definition and there are several individual rules that only apply to hatching. Perhaps my diagram of the various quantities might help.

 

Definition diagram.PNG

In the line definition, the first quantity is the angle of the line, and then the next two are the line's start coordinate (measured in World coordinate system). The next two quantities (I call the "sideways repeat", d and e) are measured along and perpendicular to the line. As each of your three lines repeat at the same amount, these quantities would be the same for each of the three lines.

The final two quantities (I call "in-line repeat", f and g) are also measured along the line. Whatever the length of the dash line, the overall length of the dash plus the space (f + g) will always be the same for this type of symmetrical hatch.

Finally, for a standalone file, the file name does not allow spaces. So you can save this file as Glass-AA (give it a unique name because there may be other glass hatch files around!)

*Glass-AA, glass hatch pattern
60, 0,0, 1.875,1.0825317847, 2,-3
60, 0.0434,0.5082, 1.875,1.0825317847, 1.1845,-3.8155
60, 0.3077,0.1000, 1.875,1.0825317847, 1.1845,-3.8155
*

 

And a picture of how the hatch looks

 

glass-aa hatch.PNG

Kent1Cooper
Consultant
Consultant

Just as a point of graphic effect, I would aim for something a little less regimented-looking, without the "units" in perfectly horizontal and vertical rows and columns, for example like this:

Kent1Cooper_0-1703695802854.png

which is defined this way:
60, 0,0, 1.2,1.5, 2,-2.5
60, 0.04,0.5, 1.2,1.5, 1.2,-3.3
60, 0.3,0.1, 1.2,1.5, 1.2,-3.3

[And I couldn't imagine a reason for all those decimal places, for something like this.  Also, trailing zeroes do absolutely nothing for you in Hatch pattern definitions.]

 

EDIT:

Or even something closer to random-ish-looking:

Kent1Cooper_1-1703707699502.png

which takes two sets at different starting positions:

60, 0,0, 2.4,3, 2,-2.5
60, .04,.5, 2.4,3, 1.2,-3.3
60, .3,.1, 2.4,3, 1.2,-3.3
60, -.2,2.5, 2.4,3, 2,-2.5
60, -.16,3, 2.4,3, 1.2,-3.3
60, .1,2.6, 2.4,3, 1.2,-3.3

 

[And I remembered that leading zeroes before decimal points are also not necessary.]

Kent Cooper, AIA