<commit_before>// StlSolid.cpp
#include "stdafx.h"
#include "StlSolid.h"

#include "../tinyxml/tinyxml.h"

#include <fstream>

using namespace std;

CStlSolid::CStlSolid(const HeeksColor* col):color(*col), m_gl_list(0){
	m_title.assign(GetTypeString());
}

CStlSolid::CStlSolid(const wxChar* filepath, const HeeksColor* col):color(*col), m_gl_list(0){
	// read the stl file
	ifstream ifs(filepath, ios::binary);
	if(!ifs)return;

	char solid_string[6] = "aaaaa";
	ifs.read(solid_string, 5);
	if(ifs.eof())return;
	if(strcmp(solid_string, "solid"))
	{
		// try binary file read

		// read the header
		char header[81];
		header[80] = 0;
		memcpy(header, solid_string, 5);
		ifs.read(&header[5], 75);

		unsigned int num_facets = 0;
		ifs.read((char*)(&num_facets), 4);

		ofstream tof("trilist.txt");

		for(unsigned int i = 0; i<num_facets; i++)
		{
			CStlTri tri;
			ifs.read((char*)(tri.n), 12);
			ifs.read((char*)(tri.x[0]), 36);
			short attr;
			ifs.read((char*)(&attr), 2);
			m_list.push_back(tri);
			char str[1024];
			sprintf(str, "%d - %lf %lf %lf %lf %lf %lf %lf %lf %lf\n", i, tri.x[0][0], tri.x[0][1], tri.x[0][2], tri.x[1][0], tri.x[1][1], tri.x[1][2], tri.x[2][0], tri.x[2][1], tri.x[2][2]);
			tof<<str;
		}
	}
	else
	{
		// "solid" already found
		char str[1024] = "solid";
		ifs.getline(&str[5], 1024);
		char title[1024];
		if(sscanf(str, "solid %s", title) == 1)
			m_title.assign(Ctt(title));

		CStlTri t;
		char five_chars[6] = "aaaaa";

		int vertex = 0;

		while(!ifs.eof())
		{
			ifs.getline(str, 1024);
<commit_msg>oops, I had accidentally left in some code to write a log file<commit_after>// StlSolid.cpp
#include "stdafx.h"
#include "StlSolid.h"

#include "../tinyxml/tinyxml.h"

#include <fstream>

using namespace std;

CStlSolid::CStlSolid(const HeeksColor* col):color(*col), m_gl_list(0){
	m_title.assign(GetTypeString());
}

CStlSolid::CStlSolid(const wxChar* filepath, const HeeksColor* col):color(*col), m_gl_list(0){
	// read the stl file
	ifstream ifs(filepath, ios::binary);
	if(!ifs)return;

	char solid_string[6] = "aaaaa";
	ifs.read(solid_string, 5);
	if(ifs.eof())return;
	if(strcmp(solid_string, "solid"))
	{
		// try binary file read

		// read the header
		char header[81];
		header[80] = 0;
		memcpy(header, solid_string, 5);
		ifs.read(&header[5], 75);

		unsigned int num_facets = 0;
		ifs.read((char*)(&num_facets), 4);

		for(unsigned int i = 0; i<num_facets; i++)
		{
			CStlTri tri;
			ifs.read((char*)(tri.n), 12);
			ifs.read((char*)(tri.x[0]), 36);
			short attr;
			ifs.read((char*)(&attr), 2);
			m_list.push_back(tri);
		}
	}
	else
	{
		// "solid" already found
		char str[1024] = "solid";
		ifs.getline(&str[5], 1024);
		char title[1024];
		if(sscanf(str, "solid %s", title) == 1)
			m_title.assign(Ctt(title));

		CStlTri t;
		char five_chars[6] = "aaaaa";

		int vertex = 0;

		while(!ifs.eof())
		{
			ifs.getline(str, 1024);

{'fraction_non_alphanumeric': 0.20041465100207326, 'fraction_numerical': 0.036627505183137524, 'mean_word_length': 4.132978723404255, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7010804', 'n_tokens_mistral': 1402, 'n_tokens_neox': 1226, 'n_words': 254}