Axe geeks (writing code)

Joined
Jun 1, 2017
Messages
241
Any other axe geeks out there writing code about axes and usage? Here's a start- in r

# Wood Waste from chopping

# Formula for wood waste from chopping (pi*R^2*R)/(pi*R^2*H)

library("ggplot2")

Lmin<- 3 #this is the minimum log length plotted in inches
Lmax<- 30 #this is the maximum log length plotted in inches
Rmin<- 1 #this is the minimum radius plotted in inches
Rmax<- 24 #this is the minimum radius plotted in inches

#Length <- rep(c(rep(6:40,24)),)
#Radius <- rep(c(rep(1:24,35)),)
Length <- rep(c(rep(Lmin:Lmax,Rmax)),)
Radius <- rep(c(rep(Rmin:Rmax,Lmax-Lmin)),)
Radius<-sort(Radius)
wood.waste<-as.data.frame(cbind(Radius, Length))
wood.waste$Percent.Waste<-(((pi*wood.waste$Radius^2*wood.waste$Radius)/(pi*wood.waste$Radius^2*wood.waste$Length))*100)
wood.waste$Radius<-as.factor(wood.waste$Radius)
wood.waste <- wood.waste[ which(wood.waste$Percent.Waste <100.1), ]
ggplot(wood.waste, aes(x=Length, y=Percent.Waste, color=Radius)) +
scale_y_continuous(name="Wood Waste (percent)",breaks=seq(0,100,10))+
scale_x_continuous(name="Log Length (inches)",breaks=seq(0,Lmax,5))+
labs(color = "Log Radius (inches)")+
geom_segment(aes(x = Lmin, y = 50, xend = Lmax, yend = 50), size = .5, colour = "black")+
annotate("text", x = 20, y = 15, label = "Sweet spot", size = 2.3, colour = "black")+
geom_line(aes(linetype=Radius)+
geom_point())
 
Here is the result
q5jZOdb.jpg
for those who want to follow along. There are some options to tweak if desired, and not all of it maps onto reality, but it sure is fun!
 
I started writing this as well, but ran into too many variables. If I remember correctly, the variability of the thickness of the center line about 2 centimeters in made this one hard. I'm not even sure the code works/is finished, but it was fun to think about!

#Calculate how far back to file with desired bevel and width of bit

library("ggplot2")

pb <- rep(c(rep(10:40,11)),)
bit.width <- rep(c(rep(5:15,31)),)
bit.width <-sort(bit.width)
bevel<-as.data.frame(cbind(pb, bit.width))
bevel$opp.pb <- (180-bevel$pb)/2 #this is value for the other two angles based on the primary bevel
bevel$side.length = bevel$bit.width*sin(bevel$opp.pb*0.0174532925)/sin(bevel$pb*0.0174532925) #length from edge to cheek
bevel$opp.pb<-as.factor(bevel$opp.pb)
bevel$bit.width<-as.factor(bevel$bit.width)

ggplot(bevel, aes(y=pb, x=side.length, color=bit.width)) +
scale_y_continuous(name="Primary Bevel (degrees)",breaks=seq(0,40,10))+
scale_x_continuous(name="Depth of Bevel (mm)",breaks=seq(0,100,5))+
labs(color = "Axe Bit Width (mm)")+
geom_segment(aes(x = 6, y = 22, xend = 85, yend = 22), size = .5, colour = "black")+
annotate("text", x = 20, y = 15, label = "Sweet spot", size = 2.3, colour = "black")+
geom_line(aes(linetype=bit.width)+
geom_point())
 
Back
Top