name diff fix
This commit is contained in:
43
Lab 1/ReadSTL.cpp
Normal file
43
Lab 1/ReadSTL.cpp
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
#include <fstream>
|
||||||
|
#include <sstream>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
class ReadSTL {
|
||||||
|
private:
|
||||||
|
int numFacet;
|
||||||
|
double Xmin;
|
||||||
|
double Xmax;
|
||||||
|
double Ymin;
|
||||||
|
double Ymax;
|
||||||
|
double Zmin;
|
||||||
|
double Zmax;
|
||||||
|
public:
|
||||||
|
ReadSTL(string filename) {
|
||||||
|
ifstream inputfile(filename, ifstream::in);
|
||||||
|
string line;
|
||||||
|
string solidName;
|
||||||
|
// Solid header line
|
||||||
|
getline(inputfile, line);
|
||||||
|
istringstream inputstream(line);
|
||||||
|
// Iterate stream past "solid"
|
||||||
|
|
||||||
|
// Retrieve name of solid
|
||||||
|
inputstream >> solidName;
|
||||||
|
// Process entire solid, looping through each facet
|
||||||
|
getline(inputfile, line);
|
||||||
|
while(1) {
|
||||||
|
// Iterate stream past "facet"
|
||||||
|
// Process entire facet,
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
int main(int argc, char** argv) {
|
||||||
|
ReadSTL RF(argv[1]);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
12306
Lab 1/STLFiles/brianascii.stl
Normal file
12306
Lab 1/STLFiles/brianascii.stl
Normal file
File diff suppressed because it is too large
Load Diff
26
Lab 1/STLFiles/shape.stl
Normal file
26
Lab 1/STLFiles/shape.stl
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
solid Shape
|
||||||
|
facet normal 0.00441668 -0.0110034 -0.99993
|
||||||
|
outer loop
|
||||||
|
vertex 3.44187 5.90737 22.4502
|
||||||
|
vertex 3.45978 5.88253 22.4505
|
||||||
|
vertex 3.20279 5.6495 22.4519
|
||||||
|
endloop
|
||||||
|
endfacet
|
||||||
|
|
||||||
|
facet normal -0.840637 -0.386028 -0.379884
|
||||||
|
outer loop
|
||||||
|
vertex 0.546978 18.4458 9.70707
|
||||||
|
vertex 0.231294 19.1332 9.70707
|
||||||
|
vertex 0.517646 19.2217 8.98353
|
||||||
|
endloop
|
||||||
|
endfacet
|
||||||
|
|
||||||
|
facet normal -0.840637 -0.386028 -0.379884
|
||||||
|
outer loop
|
||||||
|
vertex 0.546978 18.4458 9.70707
|
||||||
|
vertex 0.231294 19.1332 9.70707
|
||||||
|
vertex 0.517646 19.2217 8.98353
|
||||||
|
endloop
|
||||||
|
endfacet
|
||||||
|
|
||||||
|
endsolid Shape
|
||||||
23
makefile
Normal file
23
makefile
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
#makefile comment
|
||||||
|
|
||||||
|
CC = g++
|
||||||
|
CFLAGS = -C
|
||||||
|
LFLAGS =
|
||||||
|
SOURCES = math.cpp main.cpp
|
||||||
|
OBJECTS = $(SOURCES:.cpp=.o)
|
||||||
|
EXECUTABLE = making_ex1
|
||||||
|
|
||||||
|
all: $(EXECUTABLE) $(SOURCES)
|
||||||
|
|
||||||
|
$(EXECUTABLE): $(OBJECTS)
|
||||||
|
$(CC) $(LFLAGS) -o $(EXECUTABLE) $(OBJECTS)
|
||||||
|
|
||||||
|
%.o:%.cpp
|
||||||
|
$(CC) $(CFLAGS) $<
|
||||||
|
|
||||||
|
-include
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f *.o
|
||||||
|
rm -f $(EXECUTABLE)
|
||||||
|
rm -f *.d
|
||||||
Reference in New Issue
Block a user