I'm writing a small package that builds on graph-tool, but not on its graphics capabilities (also because I have to represent other things rather than the graph itself). Still I could use some of the functions "under the hood" for my purposes. I have a question about gt.draw.get_hierarchy_control_points(): the function returns the Bézier spline control points for edges in a given graph, but I'm having difficulties in understanding how this information is encoded. For a single edge in graph, I have dozens of values as control points (half dozens + 2), hence I suspect all splines going from node A to the root of a hierarchy and back to node B are encoded there, and control points should be taken 6 by 6 (3x2 by 3x2 coordinates?). How (x,y) for control points are encoded then: (x, x, x, y, y, y) or (x, y, x, y, x, y)? What are the 2 additiona values I have for each vector? Also, are values absolute or relative to one node in particular (A, B or root...)?
Sure the documentation states that there should be 6 points, but in my case
the length of the map is variable, so I think that either the documentation
is outdated, or the format of the map is not correct. Sometimes I have a
length of 40 for the vector, sometimes 50 or so.
Am 30.11.20 um 18:38 schrieb AntoineR:
> Hi Tiago,
> Sure the documentation states that there should be 6 points, but in my case
> the length of the map is variable, so I think that either the documentation
> is outdated, or the format of the map is not correct. Sometimes I have a
> length of 40 for the vector, sometimes 50 or so.
The documentation clearly states that it's 6 values *per spline
segment*, of which there can be an arbitrary amount.
Yes, this is because of a boundary condition: The last point does not
need to be specified, just as the first one. If it's given, it's
ignored. The function get_hierarchy_control_points generates the final
point because it's slightly easier in the code.
Ok, but then I should be able to find the edge's target position in the
points generated by the the function get_hierarchy_control_points right? If
it is not the last two components of the vector (boundary condition?) it
should at the position [-4:-3]?
If I understand correctly what you said, from the function
get_hierarchy_control_points I should get n*(6 components) I got n*(6
components)+2. The last two are not used because there are boundary
conditions (I do not get this but I need to read the paper you are citing,
and I cannot access it right now because I cannot reach sci hub...). The 6
components are from the 3 points, 2 intermediates, 1 finale. The finale is
the target right? So for get_hierarchy_control_points each [6n+4:6n+5]
coordinates are coordinates of a target in the hierarchical graph. But the
very last coordinates is the edge's target, isn't it?