How to solve the Delaunay triangulation problem?

Asked

Viewed 134 times

4

I have a problem involving Delaunay triangulation. I need to perform a triangulation of some circles. However, I need to remove some triangles that are invalid for me, because the triangulation is made by the centers of the circumferences and I need it to be made by the area, so that the lines do not pass inside the circles.

Just follow my code:

 # Triângulação dos pontos
 # m_cylinders é um vetor que contem os centros das minhas circunferências
 # m_raios é um vetor que contem os raios das circunferências 

tri = Delaunay(m_cylinders)

plt.triplot(m_cylinders[:,0], m_cylinders[:,1])
plt.plot(m_cylinders[:,0], m_cylinders[:,1], 'o')

np.set_printoptions(suppress=True)

vetor = tri.simplices
vetor_2 = m_cylinders[tri.simplices]

fig, ax = plt.subplots()
for cir, rai in zip(m_cylinders,m_raios):
ax.add_patch(plt.Circle((cir[0], cir[1]), rai,fill=False))

plt.plot([5,15,15,5,5],[0,0,4,4,0], linestyle='-', color='r',linewidth=1.0)
plt.triplot(m_cylinders[:,0], m_cylinders[:,1])
ax.set_aspect('equal', adjustable='datalim')
ax.plot()

plt.show()

Exit:

inserir a descrição da imagem aqui On the edges there are many circumferences in which the lines pass through the inside and that doesn’t work for me.

Does anyone have any suggestions on how to solve this problem?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.