MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _proj_transform_vec_clip

Function _proj_transform_vec_clip

lib/mpl_toolkits/mplot3d/proj3d.py:189–206  ·  view source on GitHub ↗
(vec, M, focal_length)

Source from the content-addressed store, hash-verified

187
188
189def _proj_transform_vec_clip(vec, M, focal_length):
190 vecw = np.dot(M, vec.data)
191 txs, tys, tzs = vecw[0:3] / vecw[3]
192 if np.isinf(focal_length): # don't clip orthographic projection
193 tis = np.ones(txs.shape, dtype=bool)
194 else:
195 tis = (-1 <= txs) & (txs <= 1) & (-1 <= tys) & (tys <= 1) & (tzs <= 0)
196 if np.ma.isMA(vec[0]):
197 tis = tis & ~vec[0].mask
198 if np.ma.isMA(vec[1]):
199 tis = tis & ~vec[1].mask
200 if np.ma.isMA(vec[2]):
201 tis = tis & ~vec[2].mask
202
203 txs = np.ma.masked_array(txs, ~tis)
204 tys = np.ma.masked_array(tys, ~tis)
205 tzs = np.ma.masked_array(tzs, ~tis)
206 return txs, tys, tzs, tis
207
208
209def inv_transform(xs, ys, zs, invM):

Callers 2

proj_transform_clipFunction · 0.85

Calls 1

dotMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…