Changeset 355

Show
Ignore:
Timestamp:
11/04/02 13:57:16 (6 years ago)
Author:
sholloway
Message:

*** empty log message ***

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/RBRapier/RBRapier/Formats/Wavefront/Loader.py

    r345 r355  
    7474            } 
    7575 
    76         LineNumber =
    77         for Line in WavefrontOBJFile: 
     76        Line, LineNumber = '',
     77        for PartialLine in WavefrontOBJFile: 
    7878            LineNumber += 1 
    79             Line = Line.strip() 
     79            Line += PartialLine.strip() 
    8080            if not Line or Line[0] == '#':  
     81                Line = '' 
    8182                continue # Comment -- move on 
     83            if Line[-1] == '\\': 
     84                Line = Line[:-1] 
     85                continue # line continuation -- get the rest of it 
    8286            Line = Line.split() 
    8387            Command, Args = Line[0], Line[1:] 
     
    8690            except KeyError: 
    8791                if self.RaiseMissingElements: 
    88                     raise KeyError, "Unknown Wavefront command %r (%s<%d>)" % (' '.join(Line), WavefrontOBJFile.name, LineNumber) 
     92                    raise NotImplemented, "Unknown Wavefront command %r (%s<%d>)" % (' '.join(Line), WavefrontOBJFile.name, LineNumber) 
    8993                elif self.WarnMissingElements: 
    9094                    print "%s<%d>: Wavefront command not supported: %r" % (WavefrontOBJFile.name, LineNumber, ' '.join(Line)) 
    9195            else: 
    9296                ex(Args) 
     97            Line = '' 
    9398 
    9499    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
  • trunk/RBRapier/RBRapier/Tools/Geometry/Analysis/TriangleStripifier.py

    r345 r355  
    241241 
    242242        for face in FaceList[1:]: 
    243             try: 
    244                 # Build the strip by repeatedly finding the missing index 
    245                 result.append(face.OtherVertex(*result[-2:])) 
    246             except KeyError: 
    247                 idx = FaceList.index(face) 
    248                 print 
    249                 print 
    250                 print "Face -2", idx-2, FaceList[idx-2]  
    251                 print "Face -1", idx-1, FaceList[idx-1]  
    252                 print "Error face:", idx, face 
    253                 print "Face 1", idx+1, FaceList[idx+1]  
    254                 print 
    255                 print "StartIdx", FaceList.index(self.StartFace) 
    256                 print "Total", len(FaceList) 
    257                 print 
    258  
    259                 raise 
    260  
    261         return result 
    262              
     243            # Build the strip by repeatedly finding the missing index 
     244            result.append(face.OtherVertex(*result[-2:])) 
     245 
     246        return result 
    263247 
    264248#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~