Skip to content

Commit

Permalink
fixed rotation of points
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex committed Mar 13, 2019
1 parent ea3b7f6 commit 5eb3056
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions gempy/plot/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -1719,8 +1719,9 @@ def get_fault_rotation_objects(geo_model, fault:str):
ctr = np.mean(fpts, axis=1)
x = fpts - ctr.reshape((-1, 1))
M = np.dot(x, x.T)
U = np.linalg.svd(M)[2]
rfpts = np.dot(fpts.T, U)
U = np.linalg.svd(M)
rfpts = np.dot(fpts.T, U[0])
rfpts = np.dot(rfpts, U[-1])
rctr = np.mean(rfpts, axis=0)

a, b = get_fault_ellipse_params(rfpts)
Expand Down Expand Up @@ -1751,7 +1752,8 @@ def cut_finite_fault_surfaces(geo_model, ver:dict, sim:dict):

for fault in finite_fault_surfaces:
U, fpoints_rot, fctr_rot, a, b = get_fault_rotation_objects(geo_model, "Fault 1")
rpoints = np.dot(ver[fault], U)
rpoints = np.dot(ver[fault], U[0])
rpoints = np.dot(rpoints, U[-1])
r = (rpoints[:, 0] - fctr_rot[0]) ** 2 / a ** 2 + (rpoints[:, 1] - fctr_rot[1]) ** 2 / b ** 2

finite_ver[fault] = finite_ver[fault][r < 1]
Expand Down

0 comments on commit 5eb3056

Please sign in to comment.