MCPcopy Create free account
hub / github.com/Runsong123/AdaFit / plot_plane_normal

Function plot_plane_normal

utils/visualization.py:143–158  ·  view source on GitHub ↗
(beta, points, color='r', ax=None, display=False, mode='all', export=False, img_name='default_img_name')

Source from the content-addressed store, hash-verified

141 return ax
142
143def plot_plane_normal(beta, points, color='r', ax=None, display=False, mode='all', export=False, img_name='default_img_name'):
144 normal = beta[0:2].tolist()
145 normal.append(-1.0)
146 normal = normal / np.sqrt(np.sum(np.square(normal)))
147 normals = np.expand_dims(normal, 0).repeat(len(points[0]), axis=0).T
148 if mode == 'all':
149 ax.quiver(points[0,:], points[1, :], points[2, :], -normals[0, :], -normals[1, :], -normals[2, :], length=0.2,
150 normalize=True, color=color)
151 else:
152 ax.quiver(points[0,0], points[1, 0], points[2, 0], -normals[0, 0], -normals[1, 0], -normals[2, 0], length=0.2,
153 normalize=True, color=color)
154
155 if display:
156 plt.show()
157 if export:
158 plt.savefig(img_name)
159
160
161def plot_normals(normals, points, color='r', ax=None, display=False, mode='all', export=False, img_name='default_img_name'):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected