Skip to content

Commit cf1baa7

Browse files
authored
Merge pull request #2261 from mccode-dev/main
Sync
2 parents 03b9af8 + 59b5b01 commit cf1baa7

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

mcstas-comps/examples/Tests_union/Geometry_test/Geometry_test.instr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@
1919
* Use of all basic geometries, mesh(as a torus), sphere, cylinder, cone and box
2020
*
2121
* %Example: meshfile="torus.off" Detector: detector_scat_I=40.2053
22+
* %Example: meshfile="torus.STL" Detector: detector_scat_I=40.2053
2223
*
2324
* %Parameters
2425
*
2526
* %End
2627
*******************************************************************************/
2728

28-
DEFINE INSTRUMENT Geometry_test(string meshfile="torus.off")
29+
DEFINE INSTRUMENT Geometry_test(string meshfile="torus.STL")
2930

3031
DECLARE
3132
%{

mcstas-comps/union/Union_mesh.comp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,7 @@ void read_stl(char* filename,
222222
fclose(file);
223223

224224
} else {
225-
#ifndef _MSC_EXTENSIONS
226-
FILE *file = Open_File(filename, "r", NULL);
225+
FILE *file = Open_File(filename, "rb", NULL);
227226
// Read header
228227
char header[80];
229228
fread(header, sizeof(char), 80, file);
@@ -247,9 +246,6 @@ void read_stl(char* filename,
247246
}
248247

249248
fclose(file);
250-
#else
251-
fprintf(stderr,"Union_mesh ERROR:\n Binary STL is not yet supported when compiling with MSVC.\n Please convert file to e.g. ascii OFF via meshlab.\n.");
252-
#endif
253249
}
254250

255251
*n_verts = 3* *n_faces;

0 commit comments

Comments
 (0)