I often need to figure out the board feet (a volume dimension used for lumber equaling 12"x12"x1"). I can do the math but when we have a lot of items it is tedious.
Is there a way to add volume calculator to the Volume command?
I figure I could also write a script to do the math but thought it would be more elegant combined with the other volume dimensions.
Hi,
That’s a good wish item it should be placed on the wishlist.
There is a way in both Vbscript and python.
It won’t show in the main volume command so you’ll have to add your script to an icon or command alias.
Beware of unit conversion, if you work in metric you’ll have to do a conversion. For a perfect script that works in all unit templates metric etc you’ll have to convert first and search through all rhino unit types. You can also create your own unit type using the custom unit type but I don’t know how it interacts with volume I’ve only used it for length.
This is an example I use to measure in cubits.
noecho
-RunScript (
Option Explicit
Call CubitDistance
Sub CubitDistance()
' Local constants
Const MM = 2 ' millimeter unit system
Const CB = 417 ' millimeter per cubit
' Local variables
Dim p0, p1, du, dm, p
' First point
p0 = Rhino.GetPoint("First point for cubit distance")
If IsNull(p0) Then Exit Sub
' Second point
p1 = Rhino.GetPoint("First point for cubit distance", p0)
If IsNull(p1) Then Exit Sub
' Compute distance in current units
du = Rhino.Distance(p0, p1)
' Print distance in current units
p = Rhino.UnitDistanceDisplayPrecision
Call Rhino.Print("Distance = " & FormatNumber(du, p, -1) & " " & Rhino.UnitSystemName(False, False))
' Convert distance to cubits
If Rhino.UnitSystem <> MM Then
dm = du * Rhino.UnitScale(MM)
Else
dm = du
End If
' Print distance in cubits
Call Rhino.Print("Distance = " & FormatNumber(dm / CB, p, -1) & " cubits")
End Sub
)
Be aware that “board feet” of planed wood is based on nominal thickness and width. Go to a lumberyard in the US and purchase a 1 inch x 12 inch pine board and it will be 3/4 inch thick and 11 1/4 inch wide. However the nominal 1 in x 12 inch dimensions will be used when calculating the number of “board feet” of the board.
For unplaned wood the actual dimensions, or at least the actual dimensions before drying, are usually used in calculating board feet.