Command of the Week - Shaded Polygons (Week 49)
Monsen
Administrator 🖼️ 81 images Cartographer
Index
- List (Basic)
- Symbols Along (Intermediate)
- Fractalise (Intermediate)
- Edit Text (Basic)
- Link with Map/File (Intermediate)
- Offset (Intermediate)
- Measuring Tools (Basic)
- Change like draw tool (Basic)
- Modifiers (Intermediate)
- File Paths (Intermediate)
- Complex Shapes [Combine Path] (Intermediate)
- Complex Shapes [Multipoly] (Intermediate)
- Break (Intermediate)
- Map Notes (Basic)
- Coordinates (Intermediate)
- Macros (Advanced)
- Search Files for Text (Basic)
- Text Justification (Basic)
- Mirrored Polygons (Intermediate)
- Managing Drawing Tools (Intermediate)
- Named Views (Basic)
- Symbol Lookup Sheets (Intermediate)
- Symbol Catalog Settings (Advanced)
- Symbol Catalog Filters (Advanced)
- Symbol Control Points (Advanced)
- Define Symbol (Intermediate)
- Curves (Basic)
- Selections (Intermediate)
- Sort Symbols in Map (Basic)
- Extract Properties (Basic)
- Convert File (Basic)
- Get Extents (Advanced)
- Quick Move (Basic)
- Menu Editing (Advanced)
- Trace (Basic)
- Array Copy (Intermediate)
- Explode (Basic)
- Clipboard Copy (Basic)
- Rename & Reorder (Intermediate)
- Drawtools Edit (Basic)
- Trims (Basic)
- Symbol Attributes (Intermediate)
- Fill Style Selection Mask (Basic)
- Browse Files (Basic)
- Node Editing (Intermediate)
- Automatic Sheet Selection (Basic)
- Scale (Basic)
- Text along a Curve (Basic)
- Shaded Polygons (Intermediate)
- Fill with Symbols (Intermediate)
- Global Sun (Basic)
- Symbols in Area (Intermediate)
This series is called the command of the week, but it could also explain a feature. The explanations will tend to explain the technical parts of the command, and is intended to highlight the basics (and complexities) of the command, and information about how to use it, but won't be a detailed tutorial. It is up to you to use it creatively in your maps.
Week 49 - Shaded Polygons
You may have noticed that even if you rotate an entity, it's fill is not rotated, but it always oriented on screen the same way as the orientation of the source image file. Except for the roofs of drawn houses in CD3 and Per3 drawings. These two products uses a special kind of entity, a shaded polygon to accomplish this. A shaded polygon actually does a whole bunch of different things, but for normal use, there are two features that we are particularly interested in, and that is the ability to rotate a fill, and the ability to apply light and shading to entities based on the direction they are facing in relation to the global sun.[Image_9853]
Where to find it?
Toolbar: Right Click [Image_9852] -> Shaded Polygon, Shaded Polygon (Angle By Edge), Change Shade Angle, Change Shade PitchCommand Line: SHADEPOLY, SHADEPOLY2, SHADEANGLE, SHADEPITCH, EDITSHADING
How to use it?
To use any of these commands, you first need to start by drawing yourself a nice polygon, preferably at an angle to properly observe the effects. For my example here, I have drawn two polygons right next to each other with the intention of drawing the roof of a house seen from above, like in a CD3 map. The first drawing doesn't look much as a roof at all, it looks very flat, and the roof tiles are angled very wrong. If your roof tiles look like that, you're going to need to have a serious talk with whoever built it.Now, to turn this abomination into a proper roof, we can use the Shaded Polygon command on it. When it comes to roofs, using the Angle by Edge variant is the easiest, since you don't normally need the extra control the regular version gives you. Simply start the command, and then click on the side of the roof poly that represents the lower edge of the roof. You should see that the fill orients itself so that the bottom of the fill points toward the side of the polygon you chose (Marked with red circles in my example), and it gets lighted or shaded depending on if it is facing the sun or not.
Pitch
By default, the Shaded Polygon (Angle By Edge) uses a roof Pitch of 45 degrees. If you wish to use a different value, simply type it in on the command line before clicking on the polygon edges. You can also change the pitch of the roof later with the Change Shade Pitch command, or through the more advanced EDITSHADING command.Angle
Shaded Polygon (Angle By Edge) automatically sets the shade angle based on the edge you clicked on, this greatly simplifies the task of getting this value correct. If you used the regular Shaded Polygon command, you would have needed to provide the angle yourself instead. The angle can later be changed by using the Change Shade Angle command, or through the EDITSHADING dialog.Note that the appropriate shading angle for a roof is the angle perpendicular to the angle of the lower edge, in the direction from the lower edge to the upper edge. While not hard to calculate, simply using the Angle by Edge version instead saves you from both knowing and calculating this, the only requirement is that when using Angle by Edge, you MUST click on edge that represents the lower end of the slope, while the regular Shaded Polygon work no matter where on the entity you select it.
Rotated fill without shading
There are also times when you just want to rotate the fill, but you don't want shading. For example, you wish to rotate the floorboard fill of your floor to match the actual direction of the house, the way any sane carpenter would do it.When you use Shaded Polygon (any version) on your floor, you'll notice that the shading causes it to change color no matter what pitch you use, but you really want to use the original non-shaded version of the fill. To do this, simply use Shaded Polygon on it first, getting the correct alignment. Then, run the EDITSHADING command, select your new shaded polygon, Do It, and the 'Roof shaded Polygon' dialog should show. A lot of the options in this dialog are needed for Perspective entities, but there is a couple of interesting options in here. First, we can see Angle and Pitch up at the top. These can be changed through other commands too, but this is also a nice place to change them. Then we have the "Shade Only Copy" and "Don't Rotate Fillstyle" options. If you want rotated fill styles without shading (like for our floor), then check the "Shade Only Copy" checkbox. To get the opposite result, shading only, but do not align the fillstyle, enable the "Don't Rotate Fillstyle" option.
[Image_9854]
Notes
Shaded Polygon works like most other commands, i.e. it lets you select multiple entities in one go, and then hit 'Do It' to run the command on all of them. When doing this, make sure that all entities selected should indeed have the same shading options. For example, in the roof in the top example, the left and right halves of the roof needs completely opposite settings for the shade angle, so you cannot do both with one command. Keep this in mind when doing your selections for this commands. The Angle By Edge version on the other hand only does one polygon at a time, but the command stays active so you can click on the entities one by one, but each is processed individually.Also note that the Change Shade Angle, Change Shade Pitch and EDITSHADING only works on polygosn that have already been turned into a shaded polygon by either the use of Shaded Polygon or Shaded Polygon (Angle By Edge).
Comments
cosine(θ)
where θ is the roof's pitch before it is rotated and shaded. (I think the "Shear" options in the dialog could be used for this on non-Per3 maps, although I don't know how.) While not important for thatched roofs, those using wooden board, tile or shingle bitmaps could be made more "realistic" through this method.Joe might now if this is actually possible through that dialog though (That dialog is really more intended as a developer tool though, and not an end-user thing, but some of the options in there are just too useful to ignore)