Jelajahi Sumber

v.extrude: cosmetics, process area separately

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@44629 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 14 tahun lalu
induk
melakukan
7fccff5206
1 mengubah file dengan 8 tambahan dan 4 penghapusan
  1. 8 4
      vector/v.extrude/main.c

+ 8 - 4
vector/v.extrude/main.c

@@ -12,7 +12,7 @@
  * PURPOSE:    "Extrudes" flat polygons and lines to 3D with defined height
  * PURPOSE:    "Extrudes" flat polygons and lines to 3D with defined height
  *              Useful for creating buildings for displaying with NVIZ
  *              Useful for creating buildings for displaying with NVIZ
  *
  *
- * COPYRIGHT:  (C) 2005-2009 by the GRASS Development Team
+ * COPYRIGHT:  (C) 2005-2010 by the GRASS Development Team
  *
  *
  *             This program is free software under the GNU General
  *             This program is free software under the GNU General
  *             Public License (>=v2). Read the file COPYING that comes
  *             Public License (>=v2). Read the file COPYING that comes
@@ -131,9 +131,12 @@ int main(int argc, char *argv[])
 
 
     trace = (t_flag->answer) ? 1 : 0;
     trace = (t_flag->answer) ? 1 : 0;
     area = (only_type & GV_AREA) ? 1 : 0;
     area = (only_type & GV_AREA) ? 1 : 0;
-    if (area && (only_type & GV_BOUNDARY)) {
-	/* do not wrire wall twice -> disable boundary type */
-	only_type &= ~GV_BOUNDARY;
+    if (area) {
+	if (only_type & GV_BOUNDARY) {
+	    /* do not wrire wall twice -> disable boundary type */
+	    only_type &= ~GV_BOUNDARY;
+	}
+	only_type &= ~GV_AREA;
     }
     }
 
 
     centroid = 0;
     centroid = 0;
@@ -489,6 +492,7 @@ static int extrude(struct Map_info *In, struct Map_info *Out,
 	    nlines++;
 	    nlines++;
 
 
 	    if (type == GV_AREA) {
 	    if (type == GV_AREA) {
+		/* roof */
 		Vect_append_point(Points_roof, Points->x[k], Points->y[k],
 		Vect_append_point(Points_roof, Points->x[k], Points->y[k],
 				  Points->z[k] + objheight + voffset_curr);
 				  Points->z[k] + objheight + voffset_curr);
 	    }
 	    }