Sewing Splines
This is a small tutorial that would allow to join by its edges the Region Layers or the Outline Layers, or any other layer based on a BLine object (example: Plant Layer and Curve Gradient Layer).
Problem Definition
It is no always possible link edges of the BLines due that the can be constructed right handed or left handed (clockwise or counter clockwise). Then the tangents are not appropriated to be linked each other.
If you're lucky you can link the tangents properly if the Regions are defined properly. In the example the region construction is shown by the red arrow direction. You can see the the green tangent ducks are in the same side of the vertex (the orange ducks). Same happen to the red ducks. It is not so obvious when the tangents are not parallel.
Select the vertex ducks and make right click and select the context menu "Link"
Then repeat the same procedure with the tangents (only one needed if both tangents are merged themselves)
Now watch this situation. The Regions are constructed with the same clockwise direction. This results that the shared edge becomes not compatible to be linked properly. The tangents are opposite each other (its green or red ducks are not at the same side of the vertex duck.
Repeat the same steps than previously. Fist link the vertex ducks and then link the tangents ducks. No matter what tangent duck you link together (same color or different color). It always gives the same result.
Solution
To solve this problem there is a smart solution. As well as the tangents are just opposite one from the other the solution comes from converting the tangent to a scaled one. The scale should be exactly -1. This allow link opposite tangents together due you are going to link one of the tangents together but one of them is going to be displayed reversed.
For example let's make the right Region the one that we are going to modify its tangent. Here are the steps you should perform before you do the link of tangents. You can do it later but should repeat the linking operations.
- Select the vertex from the vertices list at Parameter Dialog. It will be marked with a red bracket around.
- Open the Vertex definition and search for the tangent you want to modify. If they are merged you can do it with any of them.
- Right click and select Convert->Scale
- Open the converted tangent and see that there are two new parameters: Link and Scale.
- Make right click over the Link parameter and Export it giving a proper name (for example t4 if it is the vertex number 4)
- Go to the Child list and Select the Value node you just have exported.
- Now go to the other layer and search the tangent you want to link to.
- Select it and make right click and select the Connect option.
- Now you have obtained the same result than previously :(. The Regions are looped at that point. Here comes the trick.
- Go to the converted and exported tangent and search the Scale parameter you have obtained from the Scale conversion. Make it equal to -1. Volia! the tangents match each other!
Notice that the other vertex ducks show how they are opposite.
Drawbacks
The converted tangent loose the ability of being manipulated by tangents ducks as usual. It is due to the fact that the tangent is not a Radial Composited which is the type of conversion that Synfig knows how manage internally with ducks interface.
You should modify the tangent of the vertex of that Region using the ducks of the other Region layer or by the numerical input of the x,y values.
Sewing more than two Blines
Sewing more than two Blines is mainly the same problem than described because locally you are going to stitch only two tangents each time. If you need to sew more than one vertex at the same place just repeat the steps making the proper change of tangent sign for the appropriated.