Skip to content

Commit

Permalink
Fix desurvey offset length for final segment of hole.
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandhill committed Jan 5, 2024
1 parent 53abc05 commit be9c1c3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions DrillManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ def desurveyHole(self):
holeStraight = True

# We only replicate survey to the beginning and end if the hole is not straight
if not holeStraight:
if holeStraight == False:
# Sort the surveys array by depth
surveys.sort(key = lambda x: x.depth)

Expand Down Expand Up @@ -903,7 +903,7 @@ def desurveyHole(self):

#Build drill trace every desurveyLength to EOH
xs = []
if not holeStraight:
if holeStraight == False:
sz = int(collar.depth / self.desurveyLength) + 1
depth = 0.0
for d in range(0, sz):
Expand All @@ -924,15 +924,15 @@ def desurveyHole(self):
# We start by adding the collar coordinates
pointList.append(QgsPoint(collar.east, collar.north, collar.elev))
# It's easier with a straight hole
if not holeStraight:
if holeStraight == False:
# We're going to keep iterating through the survey list looking for the bracketing surveys.
# We therefore record the start point of the iteration as it will only go up. Saves time.
idx0 = 0
# We already added the location at point0 (the collar) so start from 1
for i in range(1, len(xs)):
q = Quaternion()
# Find the lowest survey equal or less than xs
for j in range(idx0, len(surveys)):
for j in range(idx0, len(surveys) - 1):
# Is there a survey exactly at this point?
if surveys[j].depth == xs[i]:
# Update the iteration start point
Expand All @@ -950,7 +950,7 @@ def desurveyHole(self):
break

# Calculate the deviation of this segment of the hole
offset = q.rotate(np.array([0.0, 1.0, 0.0])) * self.desurveyLength
offset = q.rotate(np.array([0.0, 1.0, 0.0])) * (xs[i] - xs[i - 1])
# Calculate the new point by adding the offset to the old point
p0 = pointList[i-1]
pointList.append(QgsPoint(p0.x() + offset[0], p0.y() + offset[1], p0.z() + offset[2]))
Expand Down

0 comments on commit be9c1c3

Please sign in to comment.