Index: src/librt/primitives/bot/bot.c
===================================================================
--- src/librt/primitives/bot/bot.c	(Revision 53976)
+++ src/librt/primitives/bot/bot.c	(Arbeitskopie)
@@ -5087,7 +5087,98 @@
     bu_free(headRblp, "rt_bot_list_free: headRblp");
 }
 
+void
+rt_bot_surf_area(fastf_t *area, const struct rt_db_internal *ip)
+{   
+    // only supports surface and solid mode
+    // if function fails, -1 will be written to area
+    struct rt_bot_internal *bot_ip =
+	(struct rt_bot_internal *)ip->idb_ptr;
+    char buf[256];
+    size_t j;
+    int a;
+    fastf_t whole_bot_vertices[bot_ip->num_faces][3][3]; // [face][corner][x,y,z]
+    fastf_t whole_bot_lenghts[bot_ip->num_faces][3]; // [face][a,b,c]
+    fastf_t whole_bot_surfaces[bot_ip->num_faces];
+    fastf_t whole_bot_overall_area;
 
+    
+    //transfering data
+    
+    for (a = 0; a < bot_ip->num_faces; a++) {
+        point_t pt[3];
+        
+        
+        for (j = 0; j < 3; j++) {
+            size_t ptnum;
+            ptnum = bot_ip->faces[a*3+j];
+            
+            VSCALE(pt[j], &bot_ip->vertices[ptnum*3], 1);
+            whole_bot_vertices[a][j][0] = INTCLAMP(pt[j][X]);
+            whole_bot_vertices[a][j][1] = INTCLAMP(pt[j][Y]);
+            whole_bot_vertices[a][j][2] = INTCLAMP(pt[j][Z]);
+        }
+
+    }
+    
+    //calculating length of each side
+    
+    for (a = 0; a < bot_ip->num_faces; a++) {
+        
+        // side a
+        whole_bot_lenghts[a][0] = sqrt(
+            (whole_bot_vertices[a][0][0] - whole_bot_vertices[a][1][0]) * (whole_bot_vertices[a][0][0] - whole_bot_vertices[a][1][0]) +
+            (whole_bot_vertices[a][0][1] - whole_bot_vertices[a][1][1]) * (whole_bot_vertices[a][0][1] - whole_bot_vertices[a][1][1]) +
+            (whole_bot_vertices[a][0][2] - whole_bot_vertices[a][1][2]) * (whole_bot_vertices[a][0][2] - whole_bot_vertices[a][1][2])        
+        );
+        
+        //side b
+        whole_bot_lenghts[a][1] = sqrt(
+            (whole_bot_vertices[a][1][0] - whole_bot_vertices[a][2][0]) * (whole_bot_vertices[a][1][0] - whole_bot_vertices[a][2][0]) +
+            (whole_bot_vertices[a][1][1] - whole_bot_vertices[a][2][1]) * (whole_bot_vertices[a][1][1] - whole_bot_vertices[a][2][1]) +
+            (whole_bot_vertices[a][1][2] - whole_bot_vertices[a][2][2]) * (whole_bot_vertices[a][1][2] - whole_bot_vertices[a][2][2])
+        );
+        
+        //side c
+        whole_bot_lenghts[a][2] = sqrt(
+            (whole_bot_vertices[a][0][0] - whole_bot_vertices[a][2][0]) * (whole_bot_vertices[a][0][0] - whole_bot_vertices[a][2][0]) +
+            (whole_bot_vertices[a][0][1] - whole_bot_vertices[a][2][1]) * (whole_bot_vertices[a][0][1] - whole_bot_vertices[a][2][1]) +
+            (whole_bot_vertices[a][0][2] - whole_bot_vertices[a][2][2]) * (whole_bot_vertices[a][0][2] - whole_bot_vertices[a][2][2])
+        );
+    }
+    
+    //calculate surface-area per face
+    for (a = 0; a < bot_ip->num_faces; a++) {
+        fastf_t s;
+        
+        s = (whole_bot_lenghts[a][0] + whole_bot_lenghts[a][1] + whole_bot_lenghts[a][2])/2;
+        whole_bot_surfaces[a] = sqrt(
+            s * 
+            (s - whole_bot_lenghts[a][0]) * 
+            (s - whole_bot_lenghts[a][1]) * 
+            (s - whole_bot_lenghts[a][2])
+        );
+    }
+    whole_bot_overall_area = 0;
+   for (a = 0; a < bot_ip->num_faces; a++) {
+       whole_bot_overall_area = whole_bot_surfaces[a] + whole_bot_overall_area;
+   } 
+   
+   //if not solid, double surface area
+    
+   switch (bot_ip->mode) {
+	case RT_BOT_SURFACE:
+            whole_bot_overall_area = whole_bot_overall_area*2;
+            break;
+       case RT_BOT_SOLID:
+            break;
+        default:
+            whole_bot_overall_area = -1;
+    }
+   *area = whole_bot_overall_area;
+   return;
+}
+
 /** @} */
 /*
  * Local Variables:
Index: src/librt/primitives/table.c
===================================================================
--- src/librt/primitives/table.c	(Revision 53976)
+++ src/librt/primitives/table.c	(Arbeitskopie)
@@ -1419,7 +1419,7 @@
 	rt_bot_params,
 	rt_bot_bbox,
 	NULL,
-	NULL,
+	rt_bot_surf_area,
 	rt_bot_centroid,
     },
 
