Best way to accomplish "edge striping," but with a tile/bitmap fill?

I'm making a parchment style map, and I'd like to shade the areas around the coastline with a pen-and-ink hatching fill. So far I haven't been able to figure out a tool or command to do this in CC3+, but would love advice or insights on what might work.

The look I'm going for is essentially what you'd get if you took the polygon region that edge striping creates, but just filled it with a tileable bitmap texture (in this case, a hatching pattern) rather than radiating out a filter ray orthogonal to the coastline.

Things I've tried that DON'T work include:

-- Edge striping. This marks off the right polygonal area surrounding the land mass, but I can't simulate a texture fill using the striping filters.

-- Draw / Offset. Not the intended use case, obviously, but thought I'd see what happens trying to "trace around" an existing closed polygon entity rather than an open line/curve. No dice.

-- Scaling out the polygon on a lower sheet. If I could get the right shape polygon on a different sheet, I'd just tile it in behind the landmass. And this would work great for a simple geometry, but my landmasses aren't simple, so the capes/bays/etc. don't line up between the original and scaled versions.

Currently my best solution is to move over to GIMP, select my landmasses one by one, convert each selection to Border, then fill the resulting border selection with a hatching pattern and put that on a drawing layer behind my original landmasses. That's certainly better than hand-tracing every coastline, but I was hoping to find something a little more automated (a la edge striping) and ideally within CC3+. Any thoughts?

Best Answer

  • MonsenMonsen 🖼️ 44 images Mapmaker Administrator
    Accepted Answer

    Ouch, that looked worse than I would have expected.

    Try using TRACED on it instead (Just type the command on the command line).

    A positive offset makes it larger than the original. You can experiment a bit with the smoothing distance, but since the outline of this effect probably should be more smooth than the actual coastline, a value of 1-10 may be appropriate, depending on your map scale.

    LoopysueWizardOfFrobozz

Answers

  • When I add hatching to a dungeon map, I trace around the outside of the dungeon. I suspect the same would work here. Create a new sheet and then select then trace the hatch around the map (tile, or whatever pattern your want.) Then you can always use the blend command from the sheet to blend it in with the water if you want.

  • MonsenMonsen 🖼️ 44 images Mapmaker Administrator

    What seems to be the problem with Draw -> Offset? Set the Mode to offset copy, and it should make a nice, slightly larger version of your landmass that you can just change the fill of.

    For tight spots, it may leave some extra nodes here and there that causes some apparent spikes, but these should be easy to remove with a few applications of Delete Node.


  • Yeah, I was hoping that's what I'd end up with!

    But I guess my coastline has too many "fiddly bits," in the words of Slartibartfast. When I use Draw -> Offset, I get a crazy tangle of spikes and inversions all over the place (images attached)


  • LoopysueLoopysue 🖼️ 23 images Mapmaker ProFantasy
    edited February 10

    Hi WizardOfFrobozz :)

    The result you got is very typical of using Offset on a very complicated polygon. If you imagine each node projected the set distance away from it's origin at a perfectly perpendicular angle to the line of the original, you should quickly see how a large offset will case most, if not all of them to fly off and cross over each other on the way. That's what causes the triangular shapes.

    A suggested cure for this is to copy your landmass onto a new temporary sheet, hide all other sheets, use the SIMPLIFY command to grossly simplify the coastline of the temporary land shape, and then use that as the base of your offset. Once done, you can then moved the offset shape to it's proper sheet.

    You might still find there are issues with a few crossed over nodes, but it should be a whole lot easier to use the node editing tools to put them right.

    ---

    SIMPLIFY is a keyboard command you type and hit enter or space bar. The command line will offer a default value, which expresses the minimum space the command will leave between adjacent nodes on the polygon you simplify. You can adjust this by typing a different number and hitting enter. You can also use CTRL+Z to undo the operation and adjust the number again if you wish.


    EDIT: actually, I think Monsen's suggestion is better ;)

    WizardOfFrobozz
  • jslaytonjslayton Surveyor Moderator, ProFantasy

    If you're wanting to get something similar to edge striping, but using geometry (which you can later fill if you'd like) rather than sheet effects, look into the CONTOURSM command. It does the same sort of thing as TRACED that Monsen mentioned, but will allow you to generate multiple outlines at the same time. You did want automated!

    LoopysueWizardOfFrobozz
  • Hi LoopySue,

    Yeah, I realize why those artifacts appear, and to be fair I got the sense from the documentation that the tool was originally developed more for the use case of open line segments, e.g., for railroad tracks, so it's kind of a nice bonus that it works as well as it does on arbitrary polygons. (It was a fun exercise as I drifted off to sleep last night to noodle on an algorithm for determining the ray along which to extrude/map each point on the perimeter of a simple polygon that would give a more "natural" result. Unsurprisingly, I didn't come up with any elegant way to handle the pathological cases of very "jagged" non-convex polys before I passed out.)

    Thanks for the pointer to SIMPLIFY. No matter how I end up handling the sea shading/hatching, it'll be interesting to try an optimization pass on my map geometry, running SIMPLIFY at various intervals to see how much apparent fidelity is lost.

    Loopysue
  • Thanks, Monsen, I think that's going to solve my problem!

    Unfortunately, I couldn't get the TRACED command to generate any output at all when using a positive offset distance, even with an enormous Work Image Resolution. I even tested a few sample polygons with just a handful of vertices and got the same result. Reading the patch note blog post for Update 22, it sounds like this is (kind of?) a known issue - if there's any debug output I could capture and send along in hopes of fixing this issue, I'd love to help.

    But in the meantime I can still get things working by just scaling up the polys first, and then using a negative offset distance on those copies to get the right geometry relative to the original landmass.

    BTW, just want to say thanks for *all* the helpful responses on this thread - I'm going to go check out COUNTERSM command too, I can see how that will come in handy for other features.

    Loopysue
  • jslaytonjslayton Surveyor Moderator, ProFantasy

    :Quote: It was a fun exercise as I drifted off to sleep last night to noodle on an algorithm for determining the ray along which to extrude/map each point on the perimeter of a simple polygon that would give a more "natural" result. Unsurprisingly, I didn't come up with any elegant way to handle the pathological cases of very "jagged" non-convex polys before I passed out.

    The algorithm for OFFSET is to copy the entity, then move each node outward by the specified distance along the average of the adjacent two line segments. The only way to get more of a "natural" result would be to do an interpolation along the path instead of doing the direct polygon (that is, change the path type to an interpolating spline). Even then, you'll get all manner of uglies like spikes with sufficient detail and numeric precision problems as the angle between samples approaches multiples of 90 degrees. However, you'll also get the same number of nodes out as you put in!

    CONTOURSM (and the rest of its brothers and cousins like TRACED) take a completely different route: convert the entity set to a raster, take a distance field of the raw raster, then vectorize the level sets of that distance field as required. No singularities, but there are always some rasterization issues with certain combinations of raster resolution and entity resolution (triangle slivers, for example, may be over or under represented in the rasterized intermediary). You'll almost always get a different number of nodes out of this algorithm than you put in and the original data points are unlikely to be exactly represented in the new data.

    CONTOURSM and friends are intended to address common issues that OFFSET can't do like waterlines around fractalized coastlines and simple CSG unions of entities.

Sign In or Register to comment.