Hatch maker plug-in for 64bit

Quite a while ago I made a hatch pattern maker for V4 / V5 32 bit, but never updated it for 64 bit. After getting a little nudge to update it, I finally did, and I’ll put the result here:

makeHatch.rhp (84 KB)

It is still the same ol’ kludgey thing as the 32 bit version (so no real updates), but it works. The major drawback to it right now is that it only makes a *.pat file, so you have to make a pattern, save it out, open Rhino Options -> Annotation -> Hatch and Import the *.pat file you just made.

As for documentation for use, the plug-in adds one command: makeHatch. The quick rundown for the options would be: X and Y padding is how much room to add between repeating the curves selected. Currently you can only have non-negative values (so no overlapping). DecimationTolerance is how roughly curves are broken into line segments. The plug-in tries to come up with something reasonable based on the bounding box size and the file tolerance; tighter tolerance = longer definitions. MaxBboxGap is the number of bounding boxes a curve can be hidden before being drawn again (because all hatch lines are infinite); higher numbers = longer definitions. Preview sizes are pretty straight forward.

I hope you find some use in it. I have wanted to update it to make it function better (tile offsets for making running bond patterns easier, more friendly UI, etc), but time never seems to be on my side :wink:

Sam

10 Likes

This just saved my day!
Thanks for sharing Sam!

This is awesome, Sam.

Thank you very much, Sam!
If you find the time, maybe you want to compile it for Rhino 6 WIP, too?
Cheers!
Eugen

Certainly, it could use a little love as well. As far as I understand however, in the WIP SDK’s current state, anything using it would have to be updated every new Rhino WIP release, so I think it prudent to wait until the SDK is locked before updating it for v6. Someone please yell at me if this isn’t the case.

Sam

Hey @SamPage,

Any chance you could update the Hatch Maker for V6 now? It sure would be appreciated:)

Thank you in advance.

Cosmas

Hi Cosmas,

I should have tacked in on to this thread as well, but the V6 version can be found here: Hatch maker plug-in for v6

Hope all is well,
Sam

1 Like

Thank you, @SamPage . I’ve been playing with it and was able to successfully make it work with straight lines, but when I tried to create a pattern of circles, it turned it in to squares. I wonder if you could look at it and tell me what I’m doing wrong?HatchMaker test.3dm (967.7 KB)

Thank you.

Well, I will say there does appear to be a bug in there in that the hatch is not really matching the preview when the hatch is further away from the origin. I’ll try and take a look at that when I can. However even with the bug, you can get the circles to look better.

So to understand what the plug-in is doing, you have to know that hatches are continuous straight lines, which are drawn at some angle X for a some distance Y, then the pen lifted for some distance Z, then the pen is put down again and drawn again at distance Y, and lifted again at distance Z, repeated to infinity.

In order to do this, the first thing the plug-in does is take any curves and converts them to line segments, similar to the Convert command. The DecimationTolerance controls this, so lower numbers will yield a more accurate pattern. It then tries to figure out how much to fudge the angle of the resulting line segments so they line up with other segments in the pattern. MaxBboxGap controls how much you are willing to let the line segments rotate out of position (this is probably a misnaming on my part, it actually controls how many bounding boxes in length a line can be pen up for, but for the user it probably makes more sense to think about how much can each line segment rotate). Higher numbers here will yield a more accurate pattern.

With your circles, a DecimationTolerance of 0.01 and a MaxBboxGap of 20 seems to get a pretty good pattern. I also just selected one circle to make the pattern, and picked the Xpadding and Ypadding using the distance between circles, which makes the definition a bit lighter. The file attached will hopefully clarify what I did.

Let me know if that helps,
Sam

HatchMaker test_SP.3dm (980.3 KB)

Awesome! The circle pattern worked, @SamPage . That’s great. You say that that with decimation tolerance, "lower numbers yield a more accurate pattern. If that’s the case, why not go even lower? Is there a downside?

Hi @SamPage,

First of all, thank you, this is a great and very useful tool.
I played with it a bit and one thing I can’t figure out is no matter how “high” settings I use, the curves or polylines, are converted into a series of ‘disconnected’ little segments, so the continuity is lost.
This is seen only if we zoom in a lot, so for printing and visually it is not a problem, but becomes an issue when exploding the hatch back into curves.

Would there be any way for the conversion algorythm to keep the curves segmented, but connected ?

–jarek

Yes, I think that is something that can and should be cleaned up, as well as doing a better job of modifying the angle of those segments more elegantly so they don’t degrade so much when further from the origin.

Sam

1 Like

Hi all + @SamPage - Any movement on this for RH7?

4 Likes