diff options
Diffstat (limited to 'source/blender/blenkernel/intern/exotic.c')
-rw-r--r-- | source/blender/blenkernel/intern/exotic.c | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/source/blender/blenkernel/intern/exotic.c b/source/blender/blenkernel/intern/exotic.c index 772a589f520..91c5a633ff6 100644 --- a/source/blender/blenkernel/intern/exotic.c +++ b/source/blender/blenkernel/intern/exotic.c @@ -129,19 +129,19 @@ static int is_stl(char *str) #define READSTLVERT { \ if (fread(mvert->co, sizeof(float), 3, fpSTL) != 3) { \ - char error_msg[255]; \ - MEM_freeN(vertdata); \ - MEM_freeN(facedata); \ - fclose(fpSTL); \ - sprintf(error_msg, "Problems reading face %d!", i); \ - return; \ + char error_msg[255]; \ + MEM_freeN(vertdata); \ + MEM_freeN(facedata); \ + fclose(fpSTL); \ + sprintf(error_msg, "Problems reading face %d!", i); \ + return; \ } \ else { \ - if (ENDIAN_ORDER==B_ENDIAN) { \ - SWITCH_INT(mvert->co[0]); \ - SWITCH_INT(mvert->co[1]); \ - SWITCH_INT(mvert->co[2]); \ - } \ + if (ENDIAN_ORDER==B_ENDIAN) { \ + SWITCH_INT(mvert->co[0]); \ + SWITCH_INT(mvert->co[1]); \ + SWITCH_INT(mvert->co[2]); \ + } \ } \ } @@ -267,9 +267,9 @@ static void read_stl_mesh_binary(Scene *scene, char *str) me->totvert = totvert; me->totface = totface; me->mvert = CustomData_add_layer(&me->vdata, CD_MVERT, CD_ASSIGN, - vertdata, totvert); + vertdata, totvert); me->mface = CustomData_add_layer(&me->fdata, CD_MFACE, CD_ASSIGN, - facedata, totface); + facedata, totface); mesh_add_normals_flags(me); make_edges(me, 0); @@ -410,9 +410,9 @@ static void read_stl_mesh_ascii(Scene *scene, char *str) me->totface = totface; me->totvert = totvert; me->mvert = CustomData_add_layer(&me->vdata, CD_MVERT, CD_CALLOC, - NULL, totvert); + NULL, totvert); me->mface = CustomData_add_layer(&me->fdata, CD_MFACE, CD_CALLOC, - NULL, totface); + NULL, totface); /* Copy vert coords and create topology */ mvert = me->mvert; @@ -862,7 +862,7 @@ static void read_inventor(Scene *scene, char *str, struct ListBase *listb) /* count the nr of lines */ tot= 0; index= iv->data[0]; - lll = iv->datalen[0]-1; + lll = iv->datalen[0]-1; for(a=0; a<lll; a++) { if(index[0]!= -1 && index[1]!= -1) tot++; index++; @@ -1009,7 +1009,7 @@ static void read_inventor(Scene *scene, char *str, struct ListBase *listb) } /* indices */ - lll = index[0] - 2; + lll = index[0] - 2; for(b=0; b<lll; b++) { idata[0]= first; idata[1]= first+1; @@ -1045,7 +1045,7 @@ static void read_inventor(Scene *scene, char *str, struct ListBase *listb) /* count triangles */ face= 0; index= iv->data[0]; - lll = iv->datalen[0]-2; + lll = iv->datalen[0]-2; for(a=0; a<lll; a++) { if(index[0]!= -1 && index[1]!= -1 && index[2]!= -1) face++; index++; @@ -1123,7 +1123,7 @@ static void read_inventor(Scene *scene, char *str, struct ListBase *listb) /* count triangles */ face= 0; index= iv->data[0]; - lll=iv->datalen[0]-2; + lll=iv->datalen[0]-2; for(a=0; a<lll; a++) { if(index[0]!= -1 && index[1]!= -1 && index[2]!= -1) face++; index++; @@ -1155,7 +1155,7 @@ static void read_inventor(Scene *scene, char *str, struct ListBase *listb) index= iv->data[0]; idata= dl->index; - lll=iv->datalen[0]-2; + lll=iv->datalen[0]-2; for(a=lll; a>0; a--) { if(index[0]!= -1 && index[1]!= -1 && index[2]!= -1) { @@ -1476,9 +1476,9 @@ static void displist_to_mesh(Scene *scene, DispList *dlfirst) me->totvert= totvert; me->totface= totface; me->mvert= CustomData_add_layer(&me->vdata, CD_MVERT, CD_CALLOC, - NULL, me->totvert); + NULL, me->totvert); me->mface= CustomData_add_layer(&me->fdata, CD_MFACE, CD_CALLOC, - NULL, me->totface); + NULL, me->totface); maxvertidx= totvert-1; mvert= me->mvert; @@ -1956,8 +1956,8 @@ void write_stl(Scene *scene, char *str) fseek(fpSTL, 80, SEEK_SET); if (ENDIAN_ORDER==B_ENDIAN) { - SWITCH_INT(numfacets); - } + SWITCH_INT(numfacets); + } fwrite(&numfacets, 4*sizeof(char), 1, fpSTL); fclose(fpSTL); @@ -2574,13 +2574,13 @@ void write_dxf(struct Scene *scene, char *str) /* The header part of the DXF */ write_group(0, "SECTION"); - write_group(2, "HEADER"); + write_group(2, "HEADER"); write_group(0, "ENDSEC"); /* The blocks part of the DXF */ write_group(0, "SECTION"); - write_group(2, "BLOCKS"); + write_group(2, "BLOCKS"); /* only write meshes we're using in this scene */ @@ -2604,7 +2604,7 @@ void write_dxf(struct Scene *scene, char *str) /* The entities part of the DXF */ write_group(0, "SECTION"); - write_group(2, "ENTITIES"); + write_group(2, "ENTITIES"); /* Write all the mesh objects */ base= scene->base.first; @@ -3056,7 +3056,7 @@ static void dxf_read_line(Scene *scene, int noob) { hasbumped=1; } - /* 2D Polyline state vars */ + /* 2D Polyline state vars */ static Object *p2dhold=NULL; static Mesh *p2dmhold=NULL; static char oldplay[32]; @@ -3131,35 +3131,35 @@ static void dxf_read_ellipse(Scene *scene, int noob) read_group(id, val); while(id!=0) { if (id==8) { - BLI_strncpy(layname, val, sizeof(layname)); + BLI_strncpy(layname, val, sizeof(layname)); } else if (id==10) { - center[0]= (float) atof(val); + center[0]= (float) atof(val); } else if (id==20) { - center[1]= (float) atof(val); + center[1]= (float) atof(val); } else if (id==30) { - center[2]= (float) atof(val); + center[2]= (float) atof(val); } else if (id==11) { - axis_endpoint[0]= (float) atof(val); + axis_endpoint[0]= (float) atof(val); } else if (id==21) { - axis_endpoint[1]= (float) atof(val); + axis_endpoint[1]= (float) atof(val); } else if (id==31) { - axis_endpoint[2]= (float) atof(val); + axis_endpoint[2]= (float) atof(val); } else if (id==40) { - axis_ratio = (float) atof(val); + axis_ratio = (float) atof(val); } else if (id==41) { printf("dxf: start = %f", atof(val) * 180/M_PI); - start_angle = -atof(val) + M_PI_2; + start_angle = -atof(val) + M_PI_2; } else if (id==42) { printf("dxf: end = %f", atof(val) * 180/M_PI); end_angle = -atof(val) + M_PI_2; } else if (id==62) { - int colorid= atoi(val); - CLAMP(colorid, 1, 255); - dxf_col_to_rgb(colorid, &color[0], &color[1], &color[2]); + int colorid= atoi(val); + CLAMP(colorid, 1, 255); + dxf_col_to_rgb(colorid, &color[0], &color[1], &color[2]); } else if (id==67) { - vspace= atoi(val); + vspace= atoi(val); } else if (id==100) { - isArc = 1; + isArc = 1; } else if (id==210) { extrusion[0] = atof(val); } else if (id==220) { @@ -3290,28 +3290,28 @@ static void dxf_read_arc(Scene *scene, int noob) read_group(id, val); while(id!=0) { if (id==8) { - BLI_strncpy(layname, val, sizeof(layname)); + BLI_strncpy(layname, val, sizeof(layname)); } else if (id==10) { - center[0]= (float) atof(val); + center[0]= (float) atof(val); } else if (id==20) { - center[1]= (float) atof(val); + center[1]= (float) atof(val); } else if (id==30) { - center[2]= (float) atof(val); + center[2]= (float) atof(val); } else if (id==40) { - dia = (float) atof(val); + dia = (float) atof(val); } else if (id==62) { - int colorid= atoi(val); + int colorid= atoi(val); - CLAMP(colorid, 1, 255); - dxf_col_to_rgb(colorid, &color[0], &color[1], &color[2]); + CLAMP(colorid, 1, 255); + dxf_col_to_rgb(colorid, &color[0], &color[1], &color[2]); } else if (id==67) { - vspace= atoi(val); + vspace= atoi(val); } else if (id==100) { - isArc = 1; + isArc = 1; } else if (id==50) { - start_angle = (90 - atoi(val)) * M_PI/180.0; + start_angle = (90 - atoi(val)) * M_PI/180.0; } else if (id==51) { - end_angle = (90 - atoi(val)) * M_PI/180.0; + end_angle = (90 - atoi(val)) * M_PI/180.0; } else if (id==210) { extrusion[0] = atof(val); } else if (id==220) { |