Skip to content

Commit 980a1bc

Browse files
committed
Prioritised file output order.
1 parent 1bc0042 commit 980a1bc

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

xcsg/xcsg_main.cpp

+9-7
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,12 @@ bool xcsg_main::run_xsolid(cf_xmlNode& node,const std::string& xcsg_file)
170170

171171
amf_file amf;
172172
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;
175173
if(m_cmd.count("amf")>0) cout << "Created AMF file : " << amf.write(triangulate.carve_polyset(),xcsg_file) << endl;
176174
if(m_cmd.count("obj")>0) cout << "Created OBJ file : " << exporter.write_obj(xcsg_file) << endl;
177175
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;
178179

179180
}
180181
else {
@@ -201,11 +202,6 @@ bool xcsg_main::run_xshape2d(cf_xmlNode& node,const std::string& xcsg_file)
201202
size_t nmani = polyset->size();
202203
cout << "...result model contains " << nmani << ((nmani==1)? " lump.": " lumps.") << endl;
203204

204-
205-
if(m_cmd.count("dxf")>0) {
206-
dxf_file dxf;
207-
cout << "Created OpenSCAD file: " << dxf.write(polyset,xcsg_file) << endl;
208-
}
209205
if(m_cmd.count("csg")>0) {
210206
openscad_csg openscad(xcsg_file);
211207
size_t imani = 0;
@@ -215,6 +211,12 @@ bool xcsg_main::run_xshape2d(cf_xmlNode& node,const std::string& xcsg_file)
215211
}
216212
cout << "Created OpenSCAD file: " << openscad.path() << endl;
217213
}
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+
}
218220
}
219221
else {
220222
throw logic_error("xcsg tree contains no data. ");

0 commit comments

Comments
 (0)