Macro Language Reference > Macros > Graphic > tgblend
  
tgblend
Description
Blends line color (unless either color is none), fill colour (unless either color is none) and line width. The basic blend is between two shapes. When more than one shape is selected each pair is blended in turn.
Syntax
tgblend ( steps:n? ( mode:n? ( first and last step:n? ) ) ) delay:b?
tgblend
[no parameter]
Blends each selected object with the next selected object in two steps, i.e. one intermediate object is created. If there were two objects to start with, there will now be three: the original two plus one new one. If the macro is now repeated, there will be 5 objects. The next repeat will give 9 objects, etc. In the illustration below, tgblend without a parameter is shown. The small squares on each object indicate the position of each object's starting handle and were not blended:
steps
A number, one greater than the number of steps required from one selected object to the next selected object. If steps is 10 then 9 intermediate objects are created. If a value for steps is not specified the default value of 2 wil be applied, resulting in one blended object.
mode
Ø|0
Matches points from both lines starting at the beginning of each line and working towards the end point. The start and end points of one line will blend towards the respective start and end points of the next line. In the illustration below the action of tgblend 10,0 is shown. The small squares on the start objects indicate the position of each object's starting handle and were not blended:
1
Similar to 0 but the start point of the one line will match the end point of the next line and vice versa. In the illustration below the action of tgblend 10,1 is shown. The small squares on the start objects indicate the position of each object's starting handle, and were not blended:
mode (cont...)
2
Each point on the line with most points will blend towards the nearest point on the other line. The nearest point is calculated by scaling the bounding boxes of each line to be the same and then placing the lines on top of each other. A value of 2 is good for blending closed regular shapes such as circles, squares and hexagons. In the illustration below the action of tgblend 10,2 is shown. The small squares on the start objects indicate the position of each object's starting handle, and were not blended:
+10
Blends threaded lines as individual parts.
first and last step
These two parameters give the first and last step numbers of the blend. Without them, all steps are performed.
Example: The macro below will blend the selected shapes with 50 steps, but will only result in steps 20 to 30 being displayed.
tgblend 50,1,20,30
delay
x0
Creates objects normally. Each object is shown on the screen as it is created and then the screen is redrawn with each newly created object selected.
x1
No object is created, giving a way of testing a blend on-screen. A screen redraw or a subsequent tgblend macro will remove the blends.
x2
Draws each object on-screen and then removes it, giving the effect of animation. A value of x2 is the fastest. Higher values (x3 and above) will slow down the animation.
Example: The macro shown below blends two objects on-screen and then removes the blends. The macro is repeated to make the 'animation' even more effective:
20 tgblend 50,1,x2