I have a notebook that generates a hexagonal grid graph and its vertex connectivity, coordinates, and numbers as an input for an FEA program in matlab. I simply want to add members to this shape (or any other shapes) after the graph has been generated. Here is an example of my chain of hexagons.
Now, after the graph has been generated using this code:
HexagonalGridGraph2[{wide1_Integer?Positive, wide2_Integer?Positive,
wide3_Integer?Positive}, opts : OptionsPattern[Graph]] :=
Module[{cells, edges, vertices}, cells =
Flatten[
Table[CirclePoints[{Sqrt[3] (1 j + k - 2) + Sqrt[3] (1 j + l - 2),
3 k - 2 - 3 l}, {2, \[Pi]/2}, 6]*5/2, {j, wide1}, {k,
wide2}, {l, wide3}], 2];
edges = Union[Sort /@ Flatten[Partition[#, 2, 1, 1] & /@ cells, 1]];
vertices = Union[Flatten[edges, 1]];
IndexGraph[
Graph[UndirectedEdge @@@ edges, opts,
VertexCoordinates -> Thread[vertices -> vertices]]]
]
hc = HexagonalGridGraph2[{6, 1, 1}, VertexLabels -> "Index",
EdgeLabels -> "Index"]
I want to add in a little element on either side of this like so:
Ideally I would have the amount of unit shapes in a row and then add a vertex between nodes 25 and 26 as well as 2 and 5 with an edge proceeding outward from those nodes at a specified length.
Thank you!