File: main.c

package info (click to toggle)
pcb-rnd 3.0.6-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 29,624 kB
  • sloc: ansic: 197,571; yacc: 6,153; sh: 5,808; awk: 2,708; makefile: 2,139; lex: 1,107; python: 519; xml: 261; lisp: 169; tcl: 67; perl: 34; javascript: 6; ruby: 5
file content (34 lines) | stat: -rw-r--r-- 567 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "safe_fs.h"
#include "error.h"
#define STL_TESTER
#include "../stl_models.c"

stl_facet_t *stl_solid_load(rnd_hidlib_t *hl, const char *fn)
{
	FILE *f;
	stl_facet_t *res;

	f = rnd_fopen(hl, fn, "r");
	if (f == NULL)
		return NULL;

	res = stl_solid_fload(hl, f);

	fclose(f);

	return res;
}

int main()
{
	FILE *f;
	stl_facet_t *solid = stl_solid_load(NULL, "1206.stl");

	f = fopen("A.stl", "w");
	fprintf(f, "solid t1\n");
	stl_solid_print_facets(f, solid,    0, 0, M_PI/6,    12, 0, 0);
	fprintf(f, "endsolid\n");
	fclose(f);

	stl_solid_free(solid);
}