Mon, 06/19/2023 - 13:31
Forums:
I have this function:
shape = read_step_file(input_path)
t = TopologyExplorer(shape)
edges = []
for edge_idx, edge in enumerate(t.edges()):
d = {'edge': edge,
'edge_index': edge_idx,
'vertices_coordinates': []}
vertices = t.vertices_from_edge(edge)
for i, vertice in enumerate(vertices):
c = vertice.DumpJsonToString()
c = '{' + c + '}'
data = json.loads(c)
point = data["TShape"]["Pnt"]['gp_Pnt']
d['vertices_coordinates'].append(point)
edges.append(d)
return edges
But this code doesn't give me the global coordinates, only the local ones.
I draw the edges and the shape, and they don't match.
The result is in the attachment.
How to get the global?
Attachments:
Mon, 06/19/2023 - 13:33
The result I want is this:
Wed, 07/05/2023 - 16:35
Hi Jorge,
I'm not sure about local and global, but this is how i get vertex coordinates of an edge: