Skip to content

Commit

Permalink
Adjust for kerf after computing notch width.
Browse files Browse the repository at this point in the history
 - hopefully fixes issue #3
   #6
  • Loading branch information
kigster committed Jan 1, 2018
1 parent aafe2f6 commit e75e332
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/laser-cutter/notching/edge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def initialize(outside, inside, options = {})
self.notch_width = options[:notch_width]
self.adjust_corners = options[:adjust_corners]

adjust_for_kerf!
calculate_notch_width!
adjust_for_kerf!
end

def adjust_for_kerf!
Expand Down Expand Up @@ -68,11 +68,11 @@ def first_notch_out?
private

def calculate_notch_width!
length = kerf? ? self.inside.length - kerf : self.inside.length
count = (length / notch_width).to_f.ceil + 1
count = ((self.inside.length) / notch_width).to_f.ceil + 1
count = (count / 2 * 2) + 1 # make count always an odd number
count = [MINIMUM_NOTCHES_PER_SIDE, count].max
self.notch_width = 1.0 * length / count

self.notch_width = 1.0 * (self.inside.length) / count
self.notch_count = count
end

Expand Down

0 comments on commit e75e332

Please sign in to comment.