diff --git a/src/export.cpp b/src/export.cpp index 40e1113..46ab076 100644 --- a/src/export.cpp +++ b/src/export.cpp @@ -575,7 +575,8 @@ void SolveSpaceUI::ExportMeshTo(const std::string &filename) { ExportMeshAsStlTo(f, m); } else if(FilenameHasExtension(filename, ".obj")) { ExportMeshAsObjTo(f, m); - } else if(FilenameHasExtension(filename, ".js")) { + } else if(FilenameHasExtension(filename, ".js") || + FilenameHasExtension(filename, ".html")) { SEdgeList *e = &(SK.GetGroup(SS.GW.activeGroup)->displayEdges); ExportMeshAsThreeJsTo(f, filename, m, e); } else { @@ -658,15 +659,14 @@ void SolveSpaceUI::ExportMeshAsObjTo(FILE *f, SMesh *sm) { //----------------------------------------------------------------------------- // Export the mesh as a JavaScript script, which is compatible with Three.js. //----------------------------------------------------------------------------- -void SolveSpaceUI::ExportMeshAsThreeJsTo(FILE *f, const std::string &filename, SMesh *sm, - SEdgeList *sel) +void SolveSpaceUI::ExportMeshAsThreeJsTo(FILE *f, const std::string &filename, + SMesh *sm, SEdgeList *sel) { SPointList spl = {}; STriangle *tr; SEdge *e; Vector bndl, bndh; - const char html[] = - "/* Autogenerated Three.js viewer for Solvespace Model (copy into another document):\n" + const char htmlbegin[] = "\n" "\n" "
\n" @@ -674,7 +674,9 @@ void SolveSpaceUI::ExportMeshAsThreeJsTo(FILE *f, const std::string &filename, S "