DHART
|
Contains all methods for generating Visibility Graphs. More...
Static Public Member Functions | |
static Graph | GenerateAllToAll (EmbreeBVH bvh, IEnumerable< Vector3D > nodes, float height=1.7f, bool directed=true) |
Create a visibility graph from every node to every node in nodes. More... | |
static Graph | GenerateGroupToGroup (EmbreeBVH bvh, IEnumerable< Vector3D > group_a, IEnumerable< Vector3D > group_b, float height=1.7f) |
Generate a directed visibility graph from nodes in group_a to the nodes in group_b. More... | |
Contains all methods for generating Visibility Graphs.
|
static |
Create a visibility graph from every node to every node in nodes.
bvh | The BVH to intersect with. |
nodes | The nodes to use in the visibility graph. |
height | The height to offset each node from the ground. |
directed | if set to true generate a directed graph, otherwise generate an undirected graph. |
[2, 2.414214, 2.414214, 0]
|
static |
Generate a directed visibility graph from nodes in group_a
to the nodes in group_b.
bvh | The geometry to use for generating the visibility graph. |
group_a | The nodes to cast rays from. |
group_b | The nodes to cast rays to. |
height | The height to offset nodes from the ground. |
group_b
will be assigned ids in order. Nodes in group_a
will be assigned IDs before those in group_b
. All edges will be from nodes in group_a
to nodes in group_b
. Any nodes that clip into geometry when offset by height will not be considered for any edge connections and will always have no outgoing or incoming edges.group_a
also exist in group_b
and vice versa.height
will not be considered for any edge connections.1, 1.414214, 0, 0
Note how the nodes in group B have scores of 0. This is because edges are only calculated from group a to group B and by default AggredgateEdgeCosts only considers outgoing costs with it's default parameters. Since group to group graphs only store the edges for a node in one of the two nodes, you should use Graph.AggregateEdgeCosts(GraphEdgeAggregation.SUM, directed:false)
to get the accurate score for every node, since the edges of a visibility graph are bidirectional.
[1, 1.414214, 2.414214, 0]
As you can see here, node 3 has a score of 0 since it doesn't have a clear line of sight to either of the nodes in group a. Node 2 has a score equal to that of 0 and 1 combined since it has a clear line of sight to both of them.