Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

creating hatch patterns

8 REPLIES 8
Reply
Message 1 of 9
kdepfyffer
667 Views, 8 Replies

creating hatch patterns

I'm trying to create a hatch pattern and don't really know how to handle this one. I can create simple ones but since these lines don't really line up I don't know how to handle it.
attached is a pic - if you can give me some pointers or help me out please let me know.
8 REPLIES 8
Message 2 of 9
Anonymous
in reply to: kdepfyffer

That's not going to be a short one, but it's certainly possible. The trick is that the segments at
different angles all repeat at different cycle lengths. E.g. the horizontal part at the middle of
each "curve" repeats one curve over, so its on-off cycle total will be simply the distance between
sets of "curves." But the adjacent segment at a slight angle repeats in some "curve" farther off
and up or down some; and that relationship varies with each segment.

I would do this by drawing a field of portions of regular polygons in the relationship you want,
exploding one set in the middle of things, and extending the Line segments to find out where they at
least come close to meeting the same point on another pattern somewhere. "Close enough" is going to
be a factor in determing how you tweak their angles to get something that repeats properly. Then I
would break the Lines with no gap, at the intersections with adjacent segments. If you draw all of
that with a logical pattern-generation origin point at 0,0 [such as the nominal center-point of the
"curves"], you can read the start point coordinates, angles and on-off lengths directly from the
resulting Lines.

The attached might get you started. It makes 1-unit-diameter "circles" in the form of 24-gons
[which are not quite regular, because of the nature of hatch pattern definitions, but are very
close], in a triangular grid with 1 unit spacing between. A portion of that [not all of its
segments] could get you going on your outermost "curve." [I don't remember off-hand whether some of
those lines of code define a portion on the bottom of some circles and the top of others -- if so,
there would be further adjustments to make than just limiting the number of lines of code used.]
And since your pattern of patterns looks square/diamond-shaped rather than triangular, the angles
[and therefore the on-off cycles] will need to be different to get the segments to fall in the right
places on the repeats. But you can at least see how it goes together, if you analyze it in relation
to Help's descriptions.

You would then need to repeat the definition of the one "curve" six more times, changing the
starting locations and on-off cycling for each. But if you keep them all based on a 24-gon
approximation, the total of the on and off for each angle involved would at least be the same for
each "curve." You could also simplify the smaller ones into fewer segments, but that might depend
on the scale you expect to use it at, and how much visible segmentation you can stand.

You might also experiment with a different number of segments in the curves. Your diagram looks
like 24-gons would be right, but it involves half-length segments at the ends of at least the longer
curves. Given a 90-degree sweep for each curve, 20-gons, or 28-gons, or 24-gons with a *vertex* at
the middle rather than a segment mid-point, would end with complete segments. The first case would
only require five lines of code to define a curve, and the last one six lines, rather than the seven
lines needed for what's in your diagram or for the 28-gon variety.

--
Kent Cooper


kdepfyffer wrote...
I'm trying to create a hatch pattern and don't really know how to handle this one. I can create
simple ones but since these lines don't really line up I don't know how to handle it.
attached is a pic - if you can give me some pointers or help me out please let me know.
Message 3 of 9
Anonymous
in reply to: kdepfyffer

Just wondering whether you've made any progress with this. If you post some information on the
sizes and dimensional relationships and so on [or a drawing in 2004 format or earlier], I may be
able to play with it over a lunch hour or two [unless, of course, you'd prefer the learning
experience of figuring it out, which I would certainly applaud].
--
Kent Cooper


kdepfyffer wrote...
I'm trying to create a hatch pattern....
Message 4 of 9
kdepfyffer
in reply to: kdepfyffer

well I gave it a few shots but the one I had to create before that wasn't even perfect so I think this one is just out of my league. I tried doing a few lines at a time and just couldn't get things lined up right, maybe I'm missing something. Here's a dwg with the hatch pattern.
Message 5 of 9
Anonymous
in reply to: kdepfyffer

Look the attached drawing over in relation to my first reply. Pay attention particularly to the
Layer names.

I regularized some things that were a little irregular about your elements, scaled it for a more
logical size so a User will know what to expect from the Scale in using it, rounded some things off
slightly, and positioned it for a more logical origin point. Grid is on, at one unit.

Since the 15-ish and 30-ish degree on-off cycles have to skip a few rows, the lines of code that
define them would need to be repeated a couple of times, with the only differences being the
starting points.

The angles, coordinates and lengths of the Lines in the drawing should directly supply all the
values needed to define the middle and one side of the outermost "curves." There would also need to
be more to do the other side of it [not dealt with here for clarity], with mirrored angles and start
points, and some of the offsets' signs reversed.

I think it would take 15 code lines to do the entire outer one. Then you would have the same thing
again for each of the "curves" involved, in which the angles and the sum of the on and off portions
would be the same as for the outer one, but the starting points and the proportions of on to off
would vary.

Looks like 105 lines of code to complete the whole pattern. That could be reduced a little if you
don't have all seven segments in each of the seven curves.

See what you can make of it....
--
Kent Cooper


kdepfyffer wrote...
well I gave it a few shots but the one I had to create before that wasn't even perfect so I think
this one is just out of my league. I tried doing a few lines at a time and just couldn't get things
lined up right, maybe I'm missing something. Here's a dwg with the hatch pattern.
Message 6 of 9
Anonymous
in reply to: kdepfyffer

A little further along....

Here's the definition of the *outermost curve* part of the pattern. [I even tested it, and it
works!]

Also attached is an updated drawing, which corrects the angles of the offset lines for one of the
segments, which were incorrect, and has the on and off portions for all the other curve segments.

The other sets of lines of codes will be identical to what's in there now, as to their angles,
offsets, and the sums of their on and off portions. They will need different starting points and
different on and off lengths for each segment. Those can be read right from the lines in the
drawing. It's a bit tedious, but see if you can make out what's happening, and perhaps take it from
here.

--
Kent Cooper
Message 7 of 9
kdepfyffer
in reply to: kdepfyffer

Thanks Kent, I'll see what I can do with it. I appreciate the help, I think I can figure it out with what you have given me.
Message 8 of 9
Anonymous
in reply to: kdepfyffer

My pleasure -- I enjoy working out things like that, and have made many custom hatch patterns for
our use here. Just write back if you hit any snags.
--
Kent Cooper


kdepfyffer wrote...
Thanks Kent, I'll see what I can do with it. I appreciate the help, I think I can figure it out with
what you have given me.
Message 9 of 9
Kent1Cooper
in reply to: Anonymous


*Kent Cooper wrote:
....

Here's the definition of the *outermost curve* part of the pattern.

....

The other sets of lines of codes will be identical to what's in there now, as to their angles,
offsets, and the sums of their on and off portions. They will need different starting points and
different on and off lengths for each segment. Those can be read right from the lines in the
drawing. It's a bit tedious, but see if you can make out what's happening, and perhaps take it from
here.
....


Getting back to an old thread....  I ran across the partially-developed pattern definition and the drawing to work on it from, which had slipped from my consciousness.  I decided to finish it up, in case kdepfyffer didn't, and/or it's of any use to anyone else.  Here's Ripples.pat, in a .zip file because this stupid forum won't allow me to attach it as a .pat file.

Kent Cooper, AIA

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost