我目前正在使用输入中的 X 点实现圆形可视化。
我不知道这是否是最好的方法(不要犹豫告诉我任何其他可能性),但要意识到这一点,我正在用这些不同的点创建一个路径,然后我使用“Flatten”功能来平滑曲线:
For Each Point As Point3D In ptsLocal
graphic_points(index).X = (panel.Width / 2) + (Point.z * facteur)
graphic_points(index).Y = (panel.Width / 2) - (Point.y * facteur)
Draw_ringPoint(graphic, Brushes.Gray, graphic_points(index).X, graphic_points(index).Y, 4, IdsPts(index))
index += 1
Next
graphic_points(index).X = graphic_points(0).X
graphic_points(index).Y = graphic_points(0).Y
Dim myPath As New GraphicsPath
'Dim translateMatrix As New Matrix
'translateMatrix.Translate(0, 10)
myPath.AddCurve(graphic_points)
'graphic.DrawPath(New Pen(Color.Cyan, 2), myPath)
myPath.Flatten()
graphic.DrawPath(New Pen(Color.BlueViolet, 2), myPath)
如您所见,我在末尾添加点“0”以关闭曲线,这是我的结果:
如您所见,结果很好,除了最后一点和第一点之间的连接。
我怎样才能平滑这种连接?或者还有其他解决方案可以实现这种可视化吗?
编辑 :
使用DrawClosedCurve方法后,结果看起来更好了,但是在最后一个连接上还是有问题,可以看到(With the last connection point):
并且没有最后一个连接点: