[admesh] 12/17: Merge.

Anton Gladky gladk at moszumanska.debian.org
Fri May 9 21:40:59 UTC 2014


This is an automated email from the git hooks/post-receive script.

gladk pushed a commit to branch master
in repository admesh.

commit 1273ea6a2a96b6710f37075e85ab9166c0355b2d
Author: Anton Gladky <gladk at debian.org>
Date:   Fri May 9 22:47:00 2014 +0200

    Merge.
---
 AUTHORS        |  3 ---
 CMakeLists.txt | 19 --------------
 ChangeLog.old  | 53 ++++++++++++-------------------------
 INSTALL        | 22 +---------------
 README.md      | 39 ---------------------------
 admesh-doc.txt |  6 ++---
 admesh.1       | 27 -------------------
 src/admesh.c   | 83 +---------------------------------------------------------
 src/connect.c  |  4 ---
 src/normals.c  | 38 +--------------------------
 src/stl_io.c   | 15 +----------
 src/stlinit.c  | 77 -----------------------------------------------------
 src/util.c     | 16 +++--------
 version.h      |  1 -
 14 files changed, 27 insertions(+), 376 deletions(-)

diff --git a/AUTHORS b/AUTHORS
deleted file mode 100644
index 8d3101f..0000000
--- a/AUTHORS
+++ /dev/null
@@ -1,3 +0,0 @@
-Anthony Martin <amartin at engr.csulb.edu>, the full source code; 1995, 1996
-Andy Doucette <andy at printathing.com>, bug-fixes; 2013
-Anton Gladky <gladk at debian.org>, switch to cmake; 2013
diff --git a/CMakeLists.txt b/CMakeLists.txt
deleted file mode 100644
index 64f7b62..0000000
--- a/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-PROJECT(admesh C)
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
-
-INCLUDE(GNUInstallDirs)
-#===========================================================
-IF(NOT(CMAKE_C_FLAGS))
-  SET(CMAKE_BUILD_TYPE Release)
-  SET(CMAKE_C_FLAGS  "-Wall -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2")
-ENDIF (NOT(CMAKE_C_FLAGS))
-#===========================================================
-FIND_LIBRARY(M_LIB m)
-#===========================================================
-ADD_EXECUTABLE(admesh admesh.c connect.c stl_io.c stlinit.c util.c normals.c shared.c)
-TARGET_LINK_LIBRARIES(admesh ${M_LIB})
-INSTALL(TARGETS admesh DESTINATION ${CMAKE_INSTALL_BINDIR})
-#===========================================================
-INSTALL(FILES ADMESH.DOC block.stl DESTINATION ${CMAKE_INSTALL_DOCDIR})
-INSTALL(FILES admesh.1 DESTINATION ${CMAKE_INSTALL_MANDIR})
-#===========================================================
diff --git a/ChangeLog.old b/ChangeLog.old
index 6988290..31c0969 100644
--- a/ChangeLog.old
+++ b/ChangeLog.old
@@ -1,61 +1,42 @@
 Tue Aug  1 03:25:46 PDT 1995  Anthony Martin <amartin at engr.csulb.edu>
 
         *  Fix it so that big endian systems write a little endian file
-           Also, write null characters after the label in stl_write_binary
+	Also, write null characters after the label in stl_write_binary
 
 Tue Aug  1 03:25:46 PDT 1995  Anthony Martin <amartin at engr.csulb.edu>
 
         *  Change stl_fill_holes so that duplicate facets are not likely
-           to be generated.  Should improve quality of filled holes.
+	to be generated.  Should improve quality of filled holes.
 
 Wed Aug  2 16:56:03 PDT 1995  Anthony Martin <amartin at engr.csulb.edu>
 
-        *  Add support for generating shared vertices
-        *  Move fclose(stl->fp) to stl_open()
+	*  Add support for generating shared vertices
+	*  Move fclose(stl->fp) to stl_open()
 
 Tue Oct 31 13:56:25 PST 1995  Anthony Martin <amartin at engr.csulb.edu>
 
-        *  Don't use area any more to see whether or not the normal should
-           be calculated.  Just go ahead and calculate the normal, and let the
-           code in stl_normalize vector() take care of the case of a normal 
-           with zero area.
-        *  Changes call to stl_check_normal_vector() in stl_add_facet() so
-           that it doesn't check the normal vector after it adds it.  Just
-           caused accounting error for normals fixed.
+	*  Don't use area any more to see whether or not the normal should
+	be calculated.  Just go ahead and calculate the normal, and let the
+	code in stl_normalize vector() take care of the case of a normal 
+	with zero area.
+	*  Changes call to stl_check_normal_vector() in stl_add_facet() so
+	that it doesn't check the normal vector after it adds it.  Just
+	caused accounting error for normals fixed.
 
 Wed Nov  1 08:39:17 PST 1995  Anthony Martin <amartin at engr.csulb.edu>
         *  Initialize normal vector to 0,0,0 when a new facet is added.
 
 Sat Jan 20 23:43:01 PST 1996  Anthony Martin <amartin at engr.csulb.edu>
         *  stlinit.c  Initialize pointers to NULL.  Check whether they have
-           been allocated before free()ing them.  Duh.
-
+	been allocated before free()ing them.  Duh.
+	
 Thu Jan 25 16:02:57 PST 1996 Anthony Martin <amartin at engr.csulb.edu>
         *  shared.c Add   fclose(fp); to stl_write_off().
-        *  stl_io.c Add dxf write capability
-        *  shared.c Add vrml write capability
+	*  stl_io.c Add dxf write capability
+	*  shared.c Add vrml write capability
 
 Fri Jul 26 11:31:50 PDT 1996 Anthony Martin <amartin at engr.csulb.edu>
-        *  Update normals after rotation
-        *  Add code to calculate the volume of the part
-
-Wed, 03 Jul 2013 16:57:55 +0200 Anton Gladky <gladk at debian.org>
-      Andy Doucette (2):
-            Fix merge-command.
-            Fix translate-command.
-
-      Anton Gladky (11):
-            Add cmake-support.
-            Remove Makefile and configure-files.
-            Remove embedded getopt-files.
-            Install block.stl.
-            Update doc-files.
-            Fix compilation warnings.
-            Add version.h.
-            Close file properly. Import patch from Debian.
-            Set version 0.96
-            Generate and install manpage. Used help2man.
-            Update version number in README and Doc
-
+	*  Update normals after rotation
+	*  Add code to calculate the volume of the part
 
 
diff --git a/INSTALL b/INSTALL
index 04aef59..f0a50c3 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,25 +1,6 @@
-To install ADMesh, you will need a system with a c compiler and cmake.
+To install ADMesh, you will need a system with a c compiler.
 Do the following:
 
-<<<<<<< HEAD
-1. Get the file admesh-XXX.tar.gz
-2. Extract the archive.  i.e. type something like the following:
-      tar -zxvf admesh-XXX.tar.gz
-   The source files will be extracted into a directory
-3. Create build directory:
-      mkdir build
-      cd build
-4. Type the following:
-      cmake -DCMAKE_INSTALL_PREFIX=/INSTALL_PATH/FOR/ADMESH ./../ADMESH_SRC_DIR
-      make
-      make install
-
-That should do it.  You should have an executable file called admesh in:  
-  /INSTALL_PATH/FOR/ADMESH/bin/admesh
-
-To regenerate manpage for admesh, use help2man tool:
-help2man admessh --name="a program for processing triangulated solid meshes" > admesh.1
-=======
 1.  Get the file admesh-x.xx.tar.gz
 2.  Extract the archive.  i.e. type something like the following:
          tar -zxvf admesh-x.xx.tar.gz
@@ -31,4 +12,3 @@ help2man admessh --name="a program for processing triangulated solid meshes" > a
 	 su -c 'make install'
 
 That should do it. Standard options for configure script and make are provided.
->>>>>>> upstream/0.97.3_git_3518914
diff --git a/README.md b/README.md
index bf2f3ba..f6c92a2 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,3 @@
-<<<<<<< HEAD:README
-                     ADMesh version 0.96
-                    ********************
-=======
 About this release and repository:
 ----------------------------------
 
@@ -20,7 +16,6 @@ https://github.com/admesh/admesh/releases/download/v0.97.3/admesh-0.97.3.tar.gz
 
 About ADMesh:
 -------------
->>>>>>> upstream/0.97.3_git_3518914:README.md
 
 ADMesh is a program for processing triangulated solid meshes. Currently,
 ADMesh only reads the STL file format that is used for rapid prototyping
@@ -53,18 +48,11 @@ Features:
 
 ADMesh outputs the following statistics after processing:
 
-<<<<<<< HEAD:README
-================= Results produced by ADMesh version 0.96 =================
-Input file         : sphere.stl
-File type          : Binary STL file
-Header             : Processed by ADMesh version 0.96
-=======
 ````
 ================= Results produced by ADMesh version 0.97.3 =================
 Input file         : sphere.stl
 File type          : Binary STL file
 Header             : Processed by ADMesh version 0.97.3
->>>>>>> upstream/0.97.3_git_3518914:README.md
 ============== Size ==============
 Min X = -1.334557, Max X = 1.370952
 Min Y = -1.377953, Max Y = 1.377230
@@ -114,32 +102,6 @@ up to about 200,000 facets.  Files larger than this can be processed, but
 the system begins to slow down significantly due to swapping.  A system with
 more memory will be able to process greater numbers of facets more easily.
 Following are some indications of process times:
-<<<<<<< HEAD:README
-40,000  facets: 10 seconds
-80,000  facets: 20 seconds
-160,000 facets: 50 seconds
-320,000 facets: 13 minutes (heavy swapping occurred)
-
-There are a few features that are "missing" from ADMesh but that might be
-added in the future.  These include:
- * Display capability
- * Slicing
- * Splitting a file into smaller files
-
-ADMesh is free but Copyrighted software.  It is distributed under the terms
-of the GNU General Public License (GPL).  It is NOT in the public domain and
-its source code cannot be used in commercial software.  Details of the GPL
-are in the file COPYING that comes with the ADMesh software package.
-
-ADMesh can be obtained on Launchpad from:
-  https://launchpad.net/admesh
-or from GitHub:
-  https://github.com/gladk/admesh
-
-Send questions, comments, suggestions, etc. to me at the following address.
-<amartin at engr.csulb.edu>
-Anthony D. Martin
-=======
 
  * 40,000  facets: 10 seconds
  * 80,000  facets: 20 seconds
@@ -151,4 +113,3 @@ Note that those times were calculated around 1996.
 ADMesh is free but copyrighted software.  It is distributed under the terms
 of the GNU General Public License (GPL). Details of the GPL are in the file
 COPYING that comes with the ADMesh software package.
->>>>>>> upstream/0.97.3_git_3518914:README.md
diff --git a/admesh-doc.txt b/admesh-doc.txt
index 3ba7be3..044a443 100644
--- a/admesh-doc.txt
+++ b/admesh-doc.txt
@@ -347,10 +347,10 @@ ADMesh Output
 After ADMesh has processed a mesh, it prints out a page of information about
 that mesh.  The output looks like the following:
 
-================= Results produced by ADMesh version 0.96 =================
+================= Results produced by ADMesh version 0.95 =================
 Input file         : sphere.stl
 File type          : Binary STL file
-Header             : Processed by ADMesh version 0.96
+Header             : Processed by ADMesh version 0.95
 ============== Size ==============
 Min X = -1.334557, Max X = 1.370952
 Min Y = -1.377953, Max Y = 1.377230
@@ -384,7 +384,7 @@ File type          : Binary STL file
    file and ASCII STL file.  ADMesh automatically detect the type of input
    file.
 
-Header             : Processed by ADMesh version 0.96
+Header             : Processed by ADMesh version 0.95
    The first 80 characters of the STL file.  The first 80 bytes of a binary
    STL file or the first line of an ASCII STL file can contain some text.
    Usually, the CAD system that has created that file, or the last program
diff --git a/admesh.1 b/admesh.1
index 81867c6..9832d33 100644
--- a/admesh.1
+++ b/admesh.1
@@ -1,21 +1,10 @@
-<<<<<<< HEAD
-.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.43.3.
-.TH ADMESH "1" "July 2013" "ADMesh - version 0.96" "User Commands"
-.SH NAME
-ADMesh \- a program for processing triangulated solid meshes
-=======
 .TH ADMESH "1" 21/10/2013 "User Commands"
 .SH NAME
 ADMesh - a program for processing triangulated solid meshes
->>>>>>> upstream/0.97.3_git_3518914
 .SH SYNOPSIS
 .B admesh
 [\fIOPTION\fR]... \fIfile\fR
 .SH DESCRIPTION
-<<<<<<< HEAD
-ADMesh version 0.96
-Copyright \(co 1995, 1996  Anthony D. Martin
-=======
 ADMesh is a program for processing triangulated solid meshes. Currently, ADMesh only reads the STL file format that is used for rapid prototyping applications, although it can write STL, VRML, OFF, and DXF files.
 
 By default, ADMesh performs all of the mesh checking and repairing options
@@ -47,7 +36,6 @@ would first do an exact check because it is required, and then the
 unconnected facets would be removed.  The results would be printed and no
 other checks would be done.
 .SH OPTIONS
->>>>>>> upstream/0.97.3_git_3518914
 .TP
 \fB\-\-x\-rotate\fR=\fIangle\fR
 Rotate CCW about x\-axis by angle degrees
@@ -133,20 +121,6 @@ The functions are executed in the same order as the options shown here.
 So check here to find what happens if, for example, \fB\-\-translate\fR and \fB\-\-merge\fR
 options are specified together.  The order of the options specified on the
 command line is not important.
-<<<<<<< HEAD
-.SH "SEE ALSO"
-The full documentation for
-.B ADMesh
-is maintained as a Texinfo manual.  If the
-.B info
-and
-.B ADMesh
-programs are properly installed at your site, the command
-.IP
-.B info ADMesh
-.PP
-should give you access to the complete manual.
-=======
 .SH EXAMPLES
 To perform all checks except for nearby, the following command line would be
 used:
@@ -197,4 +171,3 @@ GNU General Public License for more details.
 You should have received a copy of the GNU General Public License along
 with this program; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
->>>>>>> upstream/0.97.3_git_3518914
diff --git a/src/admesh.c b/src/admesh.c
index 414acdb..59e51d8 100644
--- a/src/admesh.c
+++ b/src/admesh.c
@@ -26,20 +26,12 @@
 
 
 #include "stl.h"
-<<<<<<< HEAD:admesh.c
-#include "version.h"
-
-static void usage(int status, char *program_name);
-
-int main(int argc, char **argv)
-=======
 #include "config.h"
 
 static void usage(int status, char *program_name);
 
 int
 main(int argc, char **argv)
->>>>>>> upstream/0.97.3_git_3518914:src/admesh.c
 {
   stl_file stl_in;
   int      i;
@@ -252,13 +244,8 @@ main(int argc, char **argv)
     }
   if(version_flag)
     {
-<<<<<<< HEAD:admesh.c
-      printf("ADMesh - version %g\n",VERSION);
-      exit(0);
-=======
       printf("ADMesh - version " VERSION "\n");
       return 0;
->>>>>>> upstream/0.97.3_git_3518914:src/admesh.c
     }
   
   if(optind == argc)
@@ -273,13 +260,9 @@ main(int argc, char **argv)
     }
 
   printf("\
-<<<<<<< HEAD:admesh.c
-ADMesh version %g, Copyright (C) 1995, 1996 Anthony D. Martin\n\
-=======
 ADMesh version " VERSION ", Copyright (C) 1995, 1996 Anthony D. Martin\n\
->>>>>>> upstream/0.97.3_git_3518914:src/admesh.c
 ADMesh comes with NO WARRANTY.  This is free software, and you are welcome to\n\
-redistribute it under certain conditions.  See the file COPYING for details.\n",VERSION);
+redistribute it under certain conditions.  See the file COPYING for details.\n");
 
   
   printf("Opening %s\n", input_file);
@@ -329,11 +312,7 @@ redistribute it under certain conditions.  See the file COPYING for details.\n",
   if(merge_flag)
     {
       printf("Merging %s with %s\n", input_file, merge_name);
-<<<<<<< HEAD:admesh.c
-      //Open the file and add the contents to stl_in:
-=======
       /* Open the file and add the contents to stl_in: */
->>>>>>> upstream/0.97.3_git_3518914:src/admesh.c
       stl_open_merge(&stl_in, merge_name);
     }
   
@@ -460,13 +439,7 @@ All facets connected.  No further nearby check necessary.\n");
   if(write_dxf_flag)
     {
       printf("Writing DXF file %s\n", dxf_name);
-<<<<<<< HEAD:admesh.c
-      char *tmp_msg = NULL;
-      sprintf(tmp_msg,"Created by ADMesh version %g",VERSION);
-      stl_write_dxf(&stl_in, dxf_name, tmp_msg);
-=======
       stl_write_dxf(&stl_in, dxf_name, "Created by ADMesh version " VERSION);
->>>>>>> upstream/0.97.3_git_3518914:src/admesh.c
     }
 
   if(write_vrml_flag)
@@ -478,29 +451,15 @@ All facets connected.  No further nearby check necessary.\n");
   if(write_ascii_stl_flag)
     {
       printf("Writing ascii file %s\n", ascii_name);
-<<<<<<< HEAD:admesh.c
-
-      char *tmp_msg = NULL;
-      sprintf(tmp_msg,"Processed by ADMesh version %g",VERSION);
-      stl_write_ascii(&stl_in, ascii_name, tmp_msg);
-=======
       stl_write_ascii(&stl_in, ascii_name, 
 		      "Processed by ADMesh version " VERSION);
->>>>>>> upstream/0.97.3_git_3518914:src/admesh.c
     }
   
   if(write_binary_stl_flag)
     {
       printf("Writing binary file %s\n", binary_name);
-<<<<<<< HEAD:admesh.c
-      
-      char *tmp_msg = NULL;
-      sprintf(tmp_msg,"Processed by ADMesh version %g",VERSION);
-      stl_write_binary(&stl_in, binary_name, tmp_msg);
-=======
       stl_write_binary(&stl_in, binary_name,
 		       "Processed by ADMesh version " VERSION);
->>>>>>> upstream/0.97.3_git_3518914:src/admesh.c
     }
   
   if(exact_flag)
@@ -522,45 +481,6 @@ usage(int status, char *program_name)
     }
   else
     {
-<<<<<<< HEAD:admesh.c
-      printf("\n\
-ADMesh version %g\n\
-Copyright (C) 1995, 1996  Anthony D. Martin\n\
-Usage: %s [OPTION]... file\n", VERSION, program_name);
-      printf("\n\
-     --x-rotate=angle     Rotate CCW about x-axis by angle degrees\n\
-     --y-rotate=angle     Rotate CCW about y-axis by angle degrees\n\
-     --z-rotate=angle     Rotate CCW about z-axis by angle degrees\n\
-     --xy-mirror          Mirror about the xy plane\n\
-     --yz-mirror          Mirror about the yz plane\n\
-     --xz-mirror          Mirror about the xz plane\n\
-     --scale=factor       Scale the file by factor (multiply by factor)\n\
-     --translate=x,y,z    Translate the file to x, y, and z\n\
-     --merge=name         Merge file called name with input file\n\
- -e, --exact              Only check for perfectly matched edges\n\
- -n, --nearby             Find and connect nearby facets. Correct bad facets\n\
- -t, --tolerance=tol      Initial tolerance to use for nearby check = tol\n\
- -i, --iterations=i       Number of iterations for nearby check = i\n\
- -m, --increment=inc      Amount to increment tolerance after iteration=inc\n\
- -u, --remove-unconnected Remove facets that have 0 neighbors\n\
- -f, --fill-holes         Add facets to fill holes\n\
- -d, --normal-directions  Check and fix direction of normals(ie cw, ccw)\n\
-     --reverse-all        Reverse the directions of all facets and normals\n\
- -v, --normal-values      Check and fix normal values\n\
- -c, --no-check           Don't do any check on input file\n\
- -b, --write-binary-stl=name   Output a binary STL file called name\n\
- -a, --write-ascii-stl=name    Output an ascii STL file called name\n\
-     --write-off=name     Output a Geomview OFF format file called name\n\
-     --write-dxf=name     Output a DXF format file called name\n\
-     --write-vrml=name    Output a VRML format file called name\n\
-     --help               Display this help and exit\n\
-     --version            Output version information and exit\n\
-\n\
-The functions are executed in the same order as the options shown here.\n\
-So check here to find what happens if, for example, --translate and --merge\n\
-options are specified together.  The order of the options specified on the\n\
-command line is not important.\n");
-=======
       printf("\n");
       printf("ADMesh version " VERSION "\n");
       printf("Copyright (C) 1995, 1996  Anthony D. Martin\n");
@@ -598,6 +518,5 @@ command line is not important.\n");
       printf("So check here to find what happens if, for example, --translate and --merge\n");
       printf("options are specified together.  The order of the options specified on the\n");
       printf("command line is not important.\n");
->>>>>>> upstream/0.97.3_git_3518914:src/admesh.c
     }
 }  
diff --git a/src/connect.c b/src/connect.c
index e094be4..118ae7d 100644
--- a/src/connect.c
+++ b/src/connect.c
@@ -84,11 +84,7 @@ stl_check_facets_exact(stl_file *stl)
     {
       facet = stl->facet_start[i];
 
-<<<<<<< HEAD:connect.c
-      //If any two of the three vertices are found to be exactally the same, call them degenerate and remove the facet.
-=======
       /* If any two of the three vertices are found to be exactally the same, call them degenerate and remove the facet. */
->>>>>>> upstream/0.97.3_git_3518914:src/connect.c
       if(   !memcmp(&facet.vertex[0], &facet.vertex[1], 
 		    sizeof(stl_vertex))
 	 || !memcmp(&facet.vertex[1], &facet.vertex[2], 
diff --git a/src/normals.c b/src/normals.c
index 51fc022..795c2c4 100644
--- a/src/normals.c
+++ b/src/normals.c
@@ -120,16 +120,8 @@ stl_fix_normal_directions(stl_file *stl)
   norm_sw = (char*)calloc(stl->stats.number_of_facets, sizeof(char));
   if(norm_sw == NULL) perror("stl_fix_normal_directions");
   
+
   facet_num = 0;
-<<<<<<< HEAD:normals.c
-  //If normal vector is not within tolerance and backwards:
-  //Arbitrarily starts at face 0.  If this one is wrong, we're screwed.  Thankfully, the chances
-  // of it being wrong randomly are low if most of the triangles are right:
-  if(stl_check_normal_vector(stl, 0, 0) == 2)
-    stl_reverse_facet(stl, 0);
-     
-  //Say that we've fixed this facet:
-=======
   /* If normal vector is not within tolerance and backwards:
      Arbitrarily starts at face 0.  If this one is wrong, we're screwed.  Thankfully, the chances
      of it being wrong randomly are low if most of the triangles are right: */
@@ -137,47 +129,29 @@ stl_fix_normal_directions(stl_file *stl)
     stl_reverse_facet(stl, 0);
      
   /* Say that we've fixed this facet: */
->>>>>>> upstream/0.97.3_git_3518914:src/normals.c
   norm_sw[facet_num] = 1;
   checked++;
 
   for(;;)
     {
-<<<<<<< HEAD:normals.c
-      /* Add neighbors_to_list. */
-      //Add unconnected neighbors to the list:a
-=======
       /* Add neighbors_to_list.
          Add unconnected neighbors to the list:a  */
->>>>>>> upstream/0.97.3_git_3518914:src/normals.c
       for(j = 0; j < 3; j++)
 	{
 	  /* Reverse the neighboring facets if necessary. */
 	  if(stl->neighbors_start[facet_num].which_vertex_not[j] > 2)
 	    {
-<<<<<<< HEAD:normals.c
-        // If the facet has a neighbor that is -1, it means that edge isn't shared by another
-        // facet.
-=======
 	    /* If the facet has a neighbor that is -1, it means that edge isn't shared by another facet */
->>>>>>> upstream/0.97.3_git_3518914:src/normals.c
 	      if(stl->neighbors_start[facet_num].neighbor[j] != -1)
 		{
 		  stl_reverse_facet
 		    (stl, stl->neighbors_start[facet_num].neighbor[j]);
 		}
 	    }
-<<<<<<< HEAD:normals.c
-    //If this edge of the facet is connected:
-	  if(stl->neighbors_start[facet_num].neighbor[j] != -1)
-	    {
-        //If we haven't fixed this facet yet, add it to the list:
-=======
     /* If this edge of the facet is connected: */
 	  if(stl->neighbors_start[facet_num].neighbor[j] != -1)
 	    {
         /* If we haven't fixed this facet yet, add it to the list: */
->>>>>>> upstream/0.97.3_git_3518914:src/normals.c
 	      if(norm_sw[stl->neighbors_start[facet_num].neighbor[j]] != 1)
 		{
 		  /* Add node to beginning of list. */
@@ -202,20 +176,10 @@ stl_fix_normal_directions(stl_file *stl)
 	  head->next = head->next->next;
 	  free(temp);
 	}
-<<<<<<< HEAD:normals.c
-      else  //if we ran out of facets to fix:
-	{
-	  /* All of the facets in this part have been fixed. */
-	  stl->stats.number_of_parts += 1;
-	  /* There are (checked-checked_before) facets */
-	  /* in part stl->stats.number_of_parts */
-	  checked_before = checked;
-=======
       else  /* if we ran out of facets to fix: */
 	{
 	  /* All of the facets in this part have been fixed. */
 	  stl->stats.number_of_parts += 1;
->>>>>>> upstream/0.97.3_git_3518914:src/normals.c
 	  if(checked >= stl->stats.number_of_facets)
 	    {
 	      /* All of the facets have been checked.  Bail out. */
diff --git a/src/stl_io.c b/src/stl_io.c
index 4e8cb88..366f6b6 100644
--- a/src/stl_io.c
+++ b/src/stl_io.c
@@ -23,11 +23,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include "stl.h"
-<<<<<<< HEAD:stl_io.c
-#include "version.h"
-=======
 #include "config.h"
->>>>>>> upstream/0.97.3_git_3518914:src/stl_io.c
 
 #if !defined(SEEK_SET)
 #define SEEK_SET 0
@@ -65,11 +61,7 @@ stl_stats_out(stl_file *stl, FILE *file, char *input_file)
   #define VERSION "unknown"
   #endif
   fprintf(file, "\n\
-<<<<<<< HEAD:stl_io.c
-================= Results produced by ADMesh version %g ================\n",VERSION);
-=======
 ================= Results produced by ADMesh version " VERSION " ================\n");
->>>>>>> upstream/0.97.3_git_3518914:src/stl_io.c
   fprintf(file, "\
 Input file         : %s\n", input_file);
   if(stl->stats.type == binary)
@@ -148,15 +140,10 @@ stl_write_ascii(stl_file *stl, const char *file, const char *label)
   fp = fopen(file, "w");
   if(fp == NULL)
     {
-<<<<<<< HEAD:stl_io.c
-      error_msg = 
-      malloc(81 + strlen(file)); /* Allow 80 chars+file size for message */
-=======
       error_msg = (char*)
 	malloc(81 + strlen(file)); /* Allow 80 chars+file size for message */
->>>>>>> upstream/0.97.3_git_3518914:src/stl_io.c
       sprintf(error_msg, "stl_write_ascii: Couldn't open %s for writing",
-      file);
+	      file);
       perror(error_msg);
       free(error_msg);
       exit(1);
diff --git a/src/stlinit.c b/src/stlinit.c
index a0d2e2b..630c263 100644
--- a/src/stlinit.c
+++ b/src/stlinit.c
@@ -94,15 +94,11 @@ stl_count_facets(stl_file *stl, char *file)
   
   /* Check for binary or ASCII file */
   fseek(stl->fp, HEADER_SIZE, SEEK_SET);
-<<<<<<< HEAD:stlinit.c
-  size_t retSize = fread(chtest, sizeof(chtest), 1, stl->fp);
-=======
   if (!fread(chtest, sizeof(chtest), 1, stl->fp))
   {
     perror("The input is an empty file");
     exit(1);
   }
->>>>>>> upstream/0.97.3_git_3518914:src/stlinit.c
   stl->stats.type = ascii;
   for(s = 0; s < sizeof(chtest); s++)
     {
@@ -131,20 +127,11 @@ stl_count_facets(stl_file *stl, char *file)
       num_facets = (file_size - HEADER_SIZE) / SIZEOF_STL_FACET;
 
       /* Read the header */
-<<<<<<< HEAD:stlinit.c
-      retSize = fread(stl->stats.header, LABEL_SIZE, 1, stl->fp);
-      
-      if (retSize>79) {
-        stl->stats.header[80] = '\0';
-      }
-      
-=======
       if (fread(stl->stats.header, LABEL_SIZE, 1, stl->fp) > 79)
       {
         stl->stats.header[80] = '\0';
       }
 
->>>>>>> upstream/0.97.3_git_3518914:src/stlinit.c
       /* Read the int following the header.  This should contain # of facets */
       if((!fread(&header_num_facets, sizeof(int), 1, stl->fp)) || (num_facets != header_num_facets))
 	{
@@ -198,50 +185,10 @@ stl_allocate(stl_file *stl)
   if(stl->facet_start == NULL) perror("stl_initialize");
 }
 
-//This function reads file_to_merge and ADDs the contents of the file to the 
-// already loaded and filled stl.
 void
 stl_open_merge(stl_file *stl, char *file_to_merge)
 {
   int num_facets_so_far;
-<<<<<<< HEAD:stlinit.c
-  
-  //Record how many facets we have so far from the first file.  We will start putting
-  //facets in the next position.  Since we're 0-indexed, it'l be the same position.
-  num_facets_so_far = stl->stats.number_of_facets;
-  
-  //Record the file type we started with:
-  stl_type origStlType=stl->stats.type;
-  //Record the file pointer too:
-  FILE *origFp=stl->fp;
-  
-  //Create an stl_file structure for the file to merge:
-  stl_file stl_to_merge;  
-  
-  //Initialize the sturucture with zero stats, header info and sizes:
-  stl_initialize(&stl_to_merge, file_to_merge);
-  
-  //Copy what we need to into stl so that we can read the file_to_merge directly into it
-  //using stl_read:  Save the rest of the valuable info:
-  stl->stats.type=stl_to_merge.stats.type;
-  stl->fp=stl_to_merge.fp;
-  
-  //Add the number of facets we already have in stl with what we we found in stl_to_merge but 
-  //haven't read yet.
-  stl->stats.number_of_facets=num_facets_so_far+stl_to_merge.stats.number_of_facets;
-  
-  //Allocate enough room for stl->stats.number_of_facets facets and neighbors:
-  stl_reallocate(stl);
-  
-  //Read the file to merge directly into stl, adding it to what we have already.
-  // Start at num_facets_so_far, the index to the first unused facet.  Also say
-  // that this isn't our first time so we should augment stats like min and max 
-  //instead of erasing them.
-  stl_read(stl, num_facets_so_far, 0);
-  
-  //Restore the stl information we overwrote (for stl_read) so that it still accurately
-  // reflects the subject part:
-=======
   stl_type origStlType;
   FILE *origFp;
   stl_file stl_to_merge;  
@@ -279,7 +226,6 @@ stl_open_merge(stl_file *stl, char *file_to_merge)
   
   /* Restore the stl information we overwrote (for stl_read) so that it still accurately
      reflects the subject part: */
->>>>>>> upstream/0.97.3_git_3518914:src/stlinit.c
   stl->stats.type=origStlType;
   stl->fp=origFp;
 }
@@ -300,18 +246,11 @@ stl_reallocate(stl_file *stl)
   if(stl->facet_start == NULL) perror("stl_initialize");
 }
 
-<<<<<<< HEAD:stlinit.c
-//Reads the contents of the file pointed to by stl->fp into the stl structure,
-//starting at facet first_facet.  The second argument says if it's our first
-// time running this for the stl and therefore we should reset our max and min stats.
-static void
-=======
 
 /* Reads the contents of the file pointed to by stl->fp into the stl structure,
    starting at facet first_facet.  The second argument says if it's our first
    time running this for the stl and therefore we should reset our max and min stats. */
 void
->>>>>>> upstream/0.97.3_git_3518914:src/stlinit.c
 stl_read(stl_file *stl, int first_facet, int first)
 {
   stl_facet facet;
@@ -344,21 +283,6 @@ stl_read(stl_file *stl, int first_facet, int first)
 	}
       else
 	/* Read a single facet from an ASCII .STL file */
-<<<<<<< HEAD:stlinit.c
-  {
-    size_t retSize = fscanf(stl->fp, "%*s %*s %f %f %f\n", 
-      &facet.normal.x, &facet.normal.y, &facet.normal.z);
-    retSize = fscanf(stl->fp, "%*s %*s");
-    retSize = fscanf(stl->fp, "%*s %f %f %f\n", &facet.vertex[0].x,
-      &facet.vertex[0].y,  &facet.vertex[0].z);
-    retSize = fscanf(stl->fp, "%*s %f %f %f\n", &facet.vertex[1].x,
-      &facet.vertex[1].y,  &facet.vertex[1].z);
-    retSize = fscanf(stl->fp, "%*s %f %f %f\n", &facet.vertex[2].x,
-      &facet.vertex[2].y,  &facet.vertex[2].z);
-    retSize = fscanf(stl->fp, "%*s");
-    retSize = fscanf(stl->fp, "%*s");
-  }
-=======
 	{
       	  if((fscanf(stl->fp, "%*s %*s %f %f %f\n", &facet.normal.x, &facet.normal.y, &facet.normal.z) + \
 	     fscanf(stl->fp, "%*s %*s") + \
@@ -372,7 +296,6 @@ stl_read(stl_file *stl, int first_facet, int first)
 	    exit(1);
 	  }
 	}
->>>>>>> upstream/0.97.3_git_3518914:src/stlinit.c
       /* Write the facet into memory. */
       stl->facet_start[i] = facet;
       
diff --git a/src/util.c b/src/util.c
index 7af66a4..6b4e766 100644
--- a/src/util.c
+++ b/src/util.c
@@ -78,7 +78,6 @@ stl_verify_neighbors(stl_file *stl)
     }
 }
 
-//Translates the stl by x,y,z, from wherever it is currently:
 void
 stl_translate(stl_file *stl, float x, float y, float z)
 {
@@ -89,19 +88,11 @@ stl_translate(stl_file *stl, float x, float y, float z)
     {
       for(j = 0; j < 3; j++)
 	{
-	  stl->facet_start[i].vertex[j].x += x;
-	  stl->facet_start[i].vertex[j].y += y;
-	  stl->facet_start[i].vertex[j].z += z;
+	  stl->facet_start[i].vertex[j].x -= (stl->stats.min.x - x);
+	  stl->facet_start[i].vertex[j].y -= (stl->stats.min.y - y);
+	  stl->facet_start[i].vertex[j].z -= (stl->stats.min.z - z);
 	}
     }
-<<<<<<< HEAD:util.c
-  stl->stats.max.x += x;
-  stl->stats.max.y += y;
-  stl->stats.max.z += z;
-  stl->stats.min.x += x;
-  stl->stats.min.y += y;
-  stl->stats.min.z += z;
-=======
   stl->stats.max.x -= (stl->stats.min.x - x);
   stl->stats.max.y -= (stl->stats.min.y - y);
   stl->stats.max.z -= (stl->stats.min.z - z);
@@ -110,7 +101,6 @@ stl_translate(stl_file *stl, float x, float y, float z)
   stl->stats.min.z = z;
   
   stl_invalidate_shared_vertices(stl);
->>>>>>> upstream/0.97.3_git_3518914:src/util.c
 }
 
 /* Translates the stl by x,y,z, relatively from wherever it is currently */
diff --git a/version.h b/version.h
deleted file mode 100644
index 1d6f865..0000000
--- a/version.h
+++ /dev/null
@@ -1 +0,0 @@
-#define VERSION 0.96

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/admesh.git



More information about the debian-science-commits mailing list