Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision |
metapost [2019/06/02 23:13] – [Symbol Sizing and Positioning] clarify symbol parameter indicator brucemutton | metapost [2019/06/03 01:04] – [Symbol Sizing and Positioning] explain align in scrap versus output brucemutton |
---|
Here it is inserted into an electric light symbol definition. The code is between the lines with % % %. It creates a green insertion point, a red origin point that represents the (0u, 0u) origin of the symbol, a light blue rectangle that represents the loci of the alignment options (left, top-left etc), and a grey unit symbol size. Note that this code requires that T:= ... rotated BEFORE aligned. If your symbol uses T:= ... aligned BEFORE rotated, then the code needs to be modified slightly. | Here it is inserted into an electric light symbol definition. The code is between the lines with % % %. It creates a green insertion point, a red origin point that represents the (0u, 0u) origin of the symbol, a light blue rectangle that represents the loci of the alignment options (left, top-left etc), and a grey unit symbol size. Note that this code requires that T:= ... rotated BEFORE aligned. If your symbol uses T:= ... aligned BEFORE rotated, then the code needs to be modified slightly. |
| |
After writing the code, I realised that this symbol was in fact larger than 0.7u in the y direction, therefore the U: variable is not tall enough, the symbol is not centered around around its (0u,0u) coordinates and it is just a bit (but probably acceptably) larger than u in size! | After writing the code, I realised that this symbol was in fact larger than 0.7u in the y direction, therefore the U: variable is not tall enough, the symbol is not centered around around its (0u,0u) coordinates (which might be OK if you want the space below the luminaire to be part of the 'symbol') and it is just a bit (but probably acceptably) larger than u in size! |
| |
<code> | <code> |
| |
| |
Here is an example with the above point symbol that has been redefined with three different U: settings, and inserted with ''-align top-right''. On the left, U:=(1.0u, 1.0u) [U/u=1.4], in the centre, U:=(0.7u, 0.7u) [U/u=1.0], on the right, U:=(0.5u, 0.5u) [U/u= 0.7]. Notice that the alignment, top-right, is relative to the local coordinate system in the scrap, not to the output page coordinate system. | Here is an example with the above point symbol that has been redefined with three different U: settings, and inserted with ''-align top-right''. On the left, U:=(1.0u, 1.0u) [U/u=1.4], in the centre, U:=(0.7u, 0.7u) [U/u=1.0], on the right, U:=(0.5u, 0.5u) [U/u= 0.7]. Note that the alignment, top-right, is relative to the local coordinate system in the scrap, not necessarily to the output page coordinate system. In these examples it does match the output page orientation, because the scrap has 'north up'. |
| |
{{:metapost:symbol0.7x0.7alignedtr-u1_7_5.png?400|}} | {{:metapost:symbol0.7x0.7alignedtr-u1_7_5.png?400|}} |
| |
I'm going to suggest that the best values for U: components are between [U/u=1.0] to [U/u=1.2] | I'm going to suggest that the best values for U: components are between [U/u=1.0] to [U/u=1.2] |
| |
| An here are some examples with a slightly improved U: variable, with the symbol aligned top-left and oriented 30 degrees, and the output rotated 15, 105, 195, 285 degrees. |
| |
| {{:metapost:symbolparameterindicatorsamples.png?400|}} |
| |
| And one last example, using ''point water'', with the above code added, that demonstrates how align is related to scrap coordinates rather than the output coordinates. |
| |
| {{:metapost:symbolscrapaligntooutputalignexplained.png?400|}} |
| |
Bruce | Bruce |