@@ -170,11 +170,12 @@ bool xcsg_main::run_xsolid(cf_xmlNode& node,const std::string& xcsg_file)
170
170
171
171
amf_file amf;
172
172
if (m_cmd.count (" csg" )>0 ) cout << " Created OpenSCAD file: " << exporter.write_csg (xcsg_file) << endl;
173
- if (m_cmd.count (" stl" )>0 ) cout << " Created STL file : " << exporter.write_stl (xcsg_file,true ) << endl;
174
- else if (m_cmd.count (" astl" )>0 ) cout << " Created STL file : " << exporter.write_stl (xcsg_file,false ) << endl;
175
173
if (m_cmd.count (" amf" )>0 ) cout << " Created AMF file : " << amf.write (triangulate.carve_polyset (),xcsg_file) << endl;
176
174
if (m_cmd.count (" obj" )>0 ) cout << " Created OBJ file : " << exporter.write_obj (xcsg_file) << endl;
177
175
if (m_cmd.count (" off" )>0 ) cout << " Created OFF file(s) : " << exporter.write_off (xcsg_file) << endl;
176
+ // write STL last so it is the most recent updated format
177
+ if (m_cmd.count (" stl" )>0 ) cout << " Created STL file : " << exporter.write_stl (xcsg_file,true ) << endl;
178
+ else if (m_cmd.count (" astl" )>0 ) cout << " Created STL file : " << exporter.write_stl (xcsg_file,false ) << endl;
178
179
179
180
}
180
181
else {
@@ -201,11 +202,6 @@ bool xcsg_main::run_xshape2d(cf_xmlNode& node,const std::string& xcsg_file)
201
202
size_t nmani = polyset->size ();
202
203
cout << " ...result model contains " << nmani << ((nmani==1 )? " lump." : " lumps." ) << endl;
203
204
204
-
205
- if (m_cmd.count (" dxf" )>0 ) {
206
- dxf_file dxf;
207
- cout << " Created OpenSCAD file: " << dxf.write (polyset,xcsg_file) << endl;
208
- }
209
205
if (m_cmd.count (" csg" )>0 ) {
210
206
openscad_csg openscad (xcsg_file);
211
207
size_t imani = 0 ;
@@ -215,6 +211,12 @@ bool xcsg_main::run_xshape2d(cf_xmlNode& node,const std::string& xcsg_file)
215
211
}
216
212
cout << " Created OpenSCAD file: " << openscad.path () << endl;
217
213
}
214
+
215
+ // write DXF last so it is the most recent updated format
216
+ if (m_cmd.count (" dxf" )>0 ) {
217
+ dxf_file dxf;
218
+ cout << " Created DXF file: " << dxf.write (polyset,xcsg_file) << endl;
219
+ }
218
220
}
219
221
else {
220
222
throw logic_error (" xcsg tree contains no data. " );
0 commit comments