<｜begin▁of▁sentence｜>### Instruction:
Imagine you are crafting a detailed visual model of a dental brace structure, which is represented as a mesh network of brackets and wires, similar to a triangular lattice. Your task is to design a digital representation of this framework, akin to a graph where the brackets are nodes with specific positions in a space corresponding to a grid of 3 rows and 4 columns, and the wires are the edges connecting them. You need a JSON object that meticulously outlines the nodes and edges of this non-repeating triangular pattern, complete with distinct labels for each component. How would you go about mapping this dental brace analogue, ensuring that all structural connections resemble the intended pattern? Please take into account that this model is not meant to loop over itself; in other words, it is not periodic.
### Response:
import networkx as nx

# Define the dimensions of the lattice
def create_triangular_lattice(m, n):
    # Generate the triangular lattice graph with m rows and n columns
    T = nx.triangular_lattice_graph(m, n, with_positions=True)

    # Extract node positions
    pos = nx.get_node_attributes(T, 'pos')

    # Generate JSON-compatible output
    graph_nodes = [{'id': node_id, 'label': f'{node_id}'} for node_id in T.nodes()]
    graph_edges = [{'source': edge[0], 'target': edge[1], 'label': f'{edge[0]}-{edge[1]}'} for edge in T.edges()]

    graph_info = {
        'graph_nodes': graph_nodes,
        'graph_edges': graph_edges
    }
    return graph_info

# Example usage
triangular_lattice = create_triangular_lattice(3, 4)

# Print out the JSON
def print_json(json_object):
    import json
    print(json.dumps(json_object, indent=2))

print_json(triangular_lattice)
<|EOT|>
