please tell me, is it possible somehow using a python or from a sharpe to list the numbers of neighboring lines with a network edge in the tree lists, and similarly, by analogy with the Brep Topology node?
a similar question is considered for bodies in this topic
could find using for example a plug-in mesh + it is possible to see neighboring faces
I might be misunderstanding the problem, but if you’re trying to compute node valences for a network of connecting lines, you can get their end-points and count their occurrence. Like so:
Not sure I understand either, but if you just want to recreate the brep topology for a mesh:
DataTree<int> edgeFaceAdjacency = new DataTree<int>();
for (int e = 0; e < mesh.TopologyEdges.Count; e++)
{
edgeFaceAdjacency.AddRange(
mesh.TopologyEdges.GetConnectedFaces(e),
new GH_Path(e));
}
DataTree<int> faceFaceAdjacency = new DataTree<int>();
for (int f = 0; f < mesh.Faces.Count; f++)
{
faceFaceAdjacency.AddRange(
mesh.Faces.AdjacentFaces(f),
new GH_Path(f));
}
DataTree<int> faceEdgeAdjacency = new DataTree<int>();
for (int e = 0; e < mesh.TopologyEdges.Count; e++)
{
var connectedFaces = mesh.TopologyEdges.GetConnectedFaces(e);
foreach (int f in connectedFaces)
{
faceEdgeAdjacency.Add(e, new GH_Path(f));
}
}
Or just use the API methods mentioned above Probably the last part is a bit a workaround and the API method keeps the sorting consistent.
Given the opportunity and using Methods exposed in the R SDK this is how to do (C#) the 7 (out of the 9) mesh connectivity trees (3 classes of collections [V,E,F] meaning 9 possible combos). For the rest 2 you’ll need a couple of lines more.
As a challenge try to get the 9 Connectivity Trees (3 classes: TopoVertices[V], TopoEdges[E] and Faces[F] … thus 9 possible combos: VV, VE, VF, EV, EE, EF, FV, FE, FF).