Hatch Multiple Percentages?

Hatch Multiple Percentages?

Anonymous
Not applicable
774 Views
4 Replies
Message 1 of 5

Hatch Multiple Percentages?

Anonymous
Not applicable

I have been working on a large-scale complex radial paving pattern. There are multiple variations of colored pavers in the design, I was wondering if there was an easy way to hatch different parts of this plan to distinguish the different colored pavers.

 

For Instance, if one zone has 50% of one color paver and 50% of another, is there an easy way to select all the individual pavers within that zone and use 50% of one hatch and 50% of another. There would only ever be 2 different colors in any single zone of paver, however the percentages in different zones will be different

 

Not sure if there is an easy way to do this, but any suggestions on how I could potentially do this quicker than manually selecting the percentages would be appreciated.

0 Likes
775 Views
4 Replies
Replies (4)
Message 2 of 5

Kent1Cooper
Consultant
Consultant

That sounds very difficult, if it's possible at all, but it might depend on the nature of what defines the pavers and the zones.  Are the pavers in a Hatch pattern within each zone?  Are they Blocks?  Or closed Polylines?  Something else?  Are the zones defined by closed-perimeter objects such as Polylines and/or Splines and/or Circles?  A small sample drawing would go a long way.

Kent Cooper, AIA
0 Likes
Message 3 of 5

Anonymous
Not applicable

Hi Kent,

 

I attached a quick mock-up of what the paving texture might look like, Each individual paver is a closed polyline and they are in a radial grid of hand-tight joints ( so there is space between each paver, but not much) and there are also closed polylines surrounding the individual zones, this attached image should display the general concept although it is not nearly as complex as the actual plan.

 

The different zones would have different % of the different colors.

 

One of my first thoughts was to simply layout one of the rows with the correct percentages then simply copy them to different rows and adjust a couple to add the variation I aim to achieve, however this might be difficult on a larger radial scale. 

 

I wasn't sure if there was a way to select the different pavers and specify a certain hatch for so many and a different hatch for a different amount without using a LISP.

 

Thank you

 

ExampleZones.PNG

john.vellek has embedded your image(s) for clarity

0 Likes
Message 4 of 5

Kent1Cooper
Consultant
Consultant

This is not  the solution, but it's a start on a concept:

(setvar 'dimzin (boole 2 (getvar 'dimzin) 8)); keep trailing zeros [for random integer]
(setvar 'hpname "SOLID")
(setq
  pct (getint "\nPercentage to be hatched in color 1: ")
  ss (ssget "_:L" '((0 . "LWPOLYLINE"))))
(repeat (setq n (sslength ss))
  (setq 
    rn (atoi (substr (rtos (rem (getvar 'cdate) 1) 2 16) (- 16 (rem n 3)) 2))
      ;; "random" integer from 0 to 99
  ); setq
  (command
    "_.hatch" "" (ssname ss (setq n (1- n))) ""
    "_.chprop" "_last" "" "_color" (if (< rn pct) 1 2) ""
  ); command
); repeat

 

Because you will apparently need some randomness in distribution of the colors, it generates a "random" integer from 0 to 99 with each Polyline it Hatches, and if that comes out below the percentage called for, it makes the Hatch in that one color 1, or if above, color 2.  [Use your own colors, or it could put them on different Layers instead, or use different patterns, or some other possibilities.]  But that just "weights" the color distribution in the general direction of that percentage breakdown, which should [on average] get sort of close to the ratio asked for, expecially with large numbers of them, but  it's still possible that in a given run, too many of them -- even all  of them in theory -- could turn out the same color, because each is dealt with independent of the results on others so far.

 

[There are other random-number-generating approaches out there, some of which may give more truly random results than this one, but the same issue would apply.]

 

The next step, I think, is to figure out a way to weight the color given to each one based on the trend,  i.e. keep track of how many have been made color 1, calculate the percentage of the total number of Polylines, or maybe the total number dealt with so far, and adjust one of the numbers being compared accordingly, so that as it approaches the end, it gets more and more likely to give things the color that hasn't been used often enough yet.  I'll have to consider how that might be done.  I think that once that's worked out, the same approach could be adjusted easily to work with more than just 2 colors, if you ever need that.

 

But bear in mind that even with that worked out, and if you get exactly the percentage distribution you want in quantity  of each color, you could still get a pattern  of distribution that you don't like.  An example:  my wife made a quilt for one of our sons and his bride as a wedding present, using a large number of different fabrics in what she wanted to be a random distribution.  Our other son, the mathematician, came up with a randomization algorithm, but it resulted in various areas where too many pieces of the same or too-similar fabric ended up too close to each other, and they had to "fix" it to look better.  You don't, in reality, want "true" randomness in something with a non-quantifiable visual requirement.  I can't imagine a way to avoid that kind of problem with an AutoLisp routine, so however that develops, you're probably still going to need to look it over and "fix" things afterwards, at least sometimes.

Kent Cooper, AIA
Message 5 of 5

Anonymous
Not applicable

Hi Kent,

I think this would work well, I would of course have to touch up some things after the fact but something along the lines of what you explained would save lots of time. I'll give something like that a try and see how it works if need be, I ended up manually creating a smaller swatch of about 500 pavers in each zone then using a polar array along the radius of each zone, and adjusted the spacing so that it fit within the individual pavers. I then took the overall perimeter boundary and trimmed the exploded array then was able to hatch the pavers within the array with the one hatch and the rest of the boundary with the solid hatch. I then took the linework from the larger boundary ( not the one created from the array) and brought that infront of the hatch. Its not perfect and its repetitive but for the sake of time this should work well enough. Not sure if you have any suggestions on other ways to go about this, but if I need to go back and be more accurate with each paver I'll go off the thorough response you gave prior.

Thanks

0 Likes