diff --git a/file.cpp b/file.cpp index 12de674..9fe96c9 100644 --- a/file.cpp +++ b/file.cpp @@ -315,6 +315,10 @@ bool SolveSpace::LoadFromFile(char *filename) { while(fgets(line, sizeof(line), fh)) { char *s = strchr(line, '\n'); if(s) *s = '\0'; + // We should never get files with \r characters in them, but mailers + // will sometimes mangle attachments. + s = strchr(line, '\r'); + if(s) *s = '\0'; if(*line == '\0') continue; @@ -364,6 +368,10 @@ bool SolveSpace::LoadEntitiesFromFile(char *file, EntityList *le, SMesh *m) { while(fgets(line, sizeof(line), fh)) { char *s = strchr(line, '\n'); if(s) *s = '\0'; + // We should never get files with \r characters in them, but mailers + // will sometimes mangle attachments. + s = strchr(line, '\r'); + if(s) *s = '\0'; if(*line == '\0') continue; diff --git a/srf/surface.h b/srf/surface.h new file mode 100644 index 0000000..80ed468 --- /dev/null +++ b/srf/surface.h @@ -0,0 +1,52 @@ + +#ifndef __SURFACE_H +#define __SURFACE_H + +class hSCurve; +class hSSurface; + +class hSCurve { +public: + DWORD v; +}; + +class SCurve { +public: + hSCurve h; + + SList pts; + hSSurface srfA; + hSSurface srfB; +}; + +class STrimBy { +public: + hSCurve curve; + Vector start; + Vector finish; + Vector out; // a vector pointing out of the contour +}; + +class hSSurface { +public: + DWORD v; +}; + +class SSurface { +public: + hSSurface h; + + Vector ctrl[4][4]; + double weight[4]; + + SList trim; +}; + +class SShell { +public: + IdList allCurves; + IdList surface; +}; + +#endif +