Compare commits

..

No commits in common. "0b5dd38b580d03e4b99f07f061c8dc7bdc6eecae" and "ee00eec0005a3694f6ff08eaa24075a643dbaeed" have entirely different histories.

7 changed files with 2 additions and 105 deletions

5
.gitignore vendored
View File

@ -5,8 +5,3 @@ libbubulles.a
tbb
gmon.out
dummy-file
tools/covid-19.obj
tools/read_obj
tools/xyz

View File

@ -12,15 +12,12 @@ CC = gcc
OPT = -Wall -g -DDEBUG_LEVEL=0 -DMUST_ABORT
libbubulles.a: bubulles.o importobj.o
libbubulles.a: bubulles.o
ar r $@ $?
bubulles.o: bubulles.c bubulles.h Makefile
$(CC) $(OPT) -c $<
importobj.o: importobj.c bubulles.h Makefile
$(CC) $(OPT) -c $<
# ------------------------------------------------
# --- build some tests and tools

View File

@ -4,7 +4,7 @@
/* --------------------------------------------------------------------- */
#define LIBBB_VERSION 53
#define LIBBB_VERSION 52
#define SZ_BUBULLE_TEXT 51 /* arbitrary value */

View File

View File

@ -1,61 +0,0 @@
/*
LIBBUBULLES
some functions for importing bubulles from dot-OBJ files.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "bubulles.h"
extern int verbosity;
/* --------------------------------------------------------------------- */
#define LINE_SZ 666
int try_to_read_an_OBJ_file(char *fname, int notused)
{
FILE *fpin;
char line[LINE_SZ+1], *cptr;
float x, y, z;
int foo;
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( '%s' %d )\n", __func__, fname, notused);
#endif
if (NULL==(fpin=fopen(fname, "r"))) {
perror(fname);
exit(1);
}
while(cptr=fgets(line, LINE_SZ, fpin)) {
if (verbosity>1) fputs(line, stderr);
cptr = strtok(line, " ");
if (strcmp(cptr, "v")) continue;
cptr = strtok(NULL, " ");
foo = sscanf(cptr, "%f", &x);
cptr = strtok(NULL, " ");
foo = sscanf(cptr, "%f", &y);
cptr = strtok(NULL, " ");
foo = sscanf(cptr, "%f", &z);
fprintf(stdout, "%16g %16g %16g\n", x, y, z);
}
fclose(fpin);
return -7800;
}
/* --------------------------------------------------------------------- */

View File

@ -1,5 +0,0 @@
BBFUNCS = ../libbubulles.a
read_obj: read_obj.c Makefile ${BBFUNCS}
gcc -Wall -DDEBUG_LEVEL=1 $< ${BBFUNCS} -o $@

View File

@ -1,29 +0,0 @@
/*
tentatives de lecture des OBJ
*/
#include <stdio.h>
#include <stdlib.h>
#include "../bubulles.h"
int try_to_read_an_OBJ_file(char *fname, int notused);
int verbosity;
int main(int argc, char *argv[])
{
int foo;
if (2 != argc) {
bubulles_version(1);
exit(0);
}
verbosity = 0;
foo = try_to_read_an_OBJ_file(argv[1], 0);
return 0;
}