Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
metapost [2019/06/02 22:55] – [Symbol Sizing and Positioning] add u box to symbol parameter indicator code brucemutton | metapost [2019/06/02 23:42] – [Symbol Sizing and Positioning] add more examples brucemutton | ||
---|---|---|---|
Line 101: | Line 101: | ||
* Your symbols should generally be defined so that they fit within the size range -0.5u to +0.5u in both x and y axes, although you can use larger or smaller values in either dimension. | * Your symbols should generally be defined so that they fit within the size range -0.5u to +0.5u in both x and y axes, although you can use larger or smaller values in either dimension. | ||
- | This image is a symbol that has been defined with maximum x and y coordinates of 0.7u, both positive and negative. | + | This image is a symbol that has been defined with maximum x and y coordinates, supposedly, |
{{: | {{: | ||
Line 107: | Line 107: | ||
- | In addition, the symbol alignment option relies on the definition of a U: variable, otherwise your symbol will cause an error and stop Therion if a user sets an alignment option other than '' | + | The symbol alignment option relies on the definition of a U: variable, otherwise your symbol will cause an error and stop Therion if a user sets an alignment option other than '' |
* U: is a scaling factor for alignment parameters, such as right, top or top-right. | * U: is a scaling factor for alignment parameters, such as right, top or top-right. | ||
U: defines the size of the x horizontal (left-right) and y vertical (up-down) offset when a symbol is aligned, so the x and y components of U: should be set to be around the maximum absolute value of x and y symbol coordinates, | U: defines the size of the x horizontal (left-right) and y vertical (up-down) offset when a symbol is aligned, so the x and y components of U: should be set to be around the maximum absolute value of x and y symbol coordinates, | ||
Line 115: | Line 115: | ||
* If your symbol has its greatest dimension on a diagonal, then you should increase the U: components accordingly, | * If your symbol has its greatest dimension on a diagonal, then you should increase the U: components accordingly, | ||
- | As one 'use case' for aligning symbols is to enable them to be placed ‘near’ to another symbol, and be always positioned appropriately at a variety of output scales, I am going to suggest that U: components for user friendly point symbols should always be just a little greater than half the symbol dimension. | + | As one 'use case' for aligning symbols is to enable them to be placed ‘near’ to another symbol, and be always positioned appropriately at a variety of output scales, I am going to suggest that U: components for user friendly point symbols should always be just a little greater than half the symbol dimension. ie the light blue box should enclose the symbol. That way, an aligned symbol can always leave a pleasing small gap from its insertion point. |
- | When writing a new point symbol and testing that it aligns and rotates nicely, it can be a bit tricky to figure out where the origin, insertion point, and alignment loci are located. | + | When writing a new point symbol and testing that it aligns and rotates nicely, it can be a bit tricky to figure out where the origin, insertion point, and alignment loci are located. |
- | Here it is inserted into an electric light symbol. | + | Here it is inserted into an electric light symbol |
+ | |||
+ | 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 ' | ||
< | < | ||
Line 157: | Line 159: | ||
- | Here is an example with the above point symbol that has been redefined with three different U: settings, and inserted with '' | + | Here is an example with the above point symbol that has been redefined with three different U: settings, and inserted with '' |
{{: | {{: | ||
Line 164: | Line 166: | ||
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. | ||
+ | |||
+ | {{: | ||
+ | |||
Bruce | Bruce |