diff options
author | Don Bright <hugh.m.bright@gmail.com> | 2013-10-02 22:27:42 (GMT) |
---|---|---|
committer | Don Bright <hugh.m.bright@gmail.com> | 2013-10-02 22:27:42 (GMT) |
commit | 7804a398a3421e16617168f33bfd6583180ba3ea (patch) | |
tree | beb7a92246ec7481f0a2282178fcbc0562a3aa1f | |
parent | c78c0e88758fe4505a65abaa6cafc1ef36733e91 (diff) | |
parent | 94070f7b51e54f64d977be90339c77521705b444 (diff) |
Merge branch 'master' of github.com:openscad/openscad into issue480
Conflicts:
src/openscad.cc
-rw-r--r-- | openscad.appdata.xml | 16 | ||||
-rwxr-xr-x | scripts/installer-linux.sh | 3 | ||||
-rwxr-xr-x | scripts/release-common.sh | 2 | ||||
-rw-r--r-- | src/openscad.cc | 1 | ||||
-rw-r--r-- | src/svg.cc | 110 |
5 files changed, 76 insertions, 56 deletions
diff --git a/openscad.appdata.xml b/openscad.appdata.xml new file mode 100644 index 0000000..8334d37 --- /dev/null +++ b/openscad.appdata.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<application> + <id type="desktop">openscad.desktop</id> + <licence>CC0</licence> + <summary>The Programmers Solid 3D CAD Modeller</summary> + <description> + <p>OpenSCAD is a software for creating solid 3D CAD models. Unlike most free software for creating 3D models (such as Blender) it does not focus on the artistic aspects of 3D modelling but instead on the CAD aspects. Thus it might be the application you are looking for when you are planning to create 3D models of machine parts but pretty sure is not what you are looking for when you are more interested in creating computer-animated movies.</p> + <p>OpenSCAD is not an interactive modeller. Instead it is something like a 3D-compiler that reads in a script file that describes the object and renders the 3D model from this script file. This gives you (the designer) full control over the modelling process and enables you to easily change any step in the modelling process or make designs that are defined by configurable parameters.</p> + <p>OpenSCAD provides two main modelling techniques: First there is constructive solid geometry (aka CSG) and second there is extrusion of 2D outlines. As data exchange format format for this 2D outlines Autocad DXF files are used. In addition to 2D paths for extrusion it is also possible to read design parameters from DXF files. Besides DXF files OpenSCAD can read and create 3D models in the STL and OFF file formats.</p> + </description> + <screenshots> + <screenshot type="default" width="800" height="437">http://www.openscad.org/images/appdata-screenshot-1.png</screenshot> + <screenshot type="default" width="800" height="465">http://www.openscad.org/images/appdata-screenshot-2.png</screenshot> + </screenshots> + <url type="homepage">http://www.openscad.org/</url> +</application> diff --git a/scripts/installer-linux.sh b/scripts/installer-linux.sh index 8b3fc6d..c3b712b 100755 --- a/scripts/installer-linux.sh +++ b/scripts/installer-linux.sh @@ -42,4 +42,7 @@ cp -rv examples/. "$prefix"/share/openscad/examples/ echo "Copying libraries..." cp -rv libraries/. "$prefix"/share/openscad/libraries/ +echo "Copying support files..." +cp -rv share/. "$prefix"/share/ + echo "Installation finished. Have a nice day." diff --git a/scripts/release-common.sh b/scripts/release-common.sh index 8a1ed7c..e91c79f 100755 --- a/scripts/release-common.sh +++ b/scripts/release-common.sh @@ -332,6 +332,8 @@ case $OS in -e '/lib(icu.*|stdc.*|audio|CGAL|GLEW|opencsg|png|gmp|gmpxx|mpfr)\.so/ { p; d; };' \ -e 'd;' | xargs cp -vt openscad-$VERSION/lib/openscad/ strip openscad-$VERSION/lib/openscad/* + mkdir -p openscad-$VERSION/share/appdata + cp openscad.appdata.xml openscad-$VERSION/share/appdata cp scripts/installer-linux.sh openscad-$VERSION/install.sh chmod 755 -R openscad-$VERSION/ PACKAGEFILE=openscad-$VERSION.x86-$ARCH.tar.gz diff --git a/src/openscad.cc b/src/openscad.cc index 49ec31c..8d368a9 100644 --- a/src/openscad.cc +++ b/src/openscad.cc @@ -31,7 +31,6 @@ #include "value.h" #include "export.h" #include "builtin.h" -#include "nodedumper.h" #include "printutils.h" #include "handle_dep.h" #include "parsersettings.h" @@ -32,16 +32,16 @@ std::string svg_styleblock(std::string strokewidth) std::stringstream out; // halfedge: f1/f0 = face mark, b1/b0 = body or hole, m1/m0 = halfedge mark out << "\ - <style type='text/css'>\n\ - .halfedge_f0_b1_m0 { stroke: gold; stroke-width: __STROKEW__px } \n\ - .halfedge_f0_b1_m1 { stroke: gold; stroke-width: __STROKEW__px } \n\ - .halfedge_f0_b0_m0 { stroke: green; stroke-width: __STROKEW__px } \n\ - .halfedge_f0_b0_m1 { stroke: green; stroke-width: __STROKEW__px } \n\ - .halfedge_f1_b1_m0 { stroke: gold; stroke-width: __STROKEW__px } \n\ - .halfedge_f1_b1_m1 { stroke: gold; stroke-width: __STROKEW__px } \n\ - .halfedge_f1_b0_m0 { stroke: green; stroke-width: __STROKEW__px } \n\ - .halfedge_f1_b0_m1 { stroke: green; stroke-width: __STROKEW__px } \n\ - </style>"; + <style type='text/css'>\n\ + .halfedge_f0_b1_m0 { stroke: gold; stroke-width: __STROKEW__px } \n\ + .halfedge_f0_b1_m1 { stroke: gold; stroke-width: __STROKEW__px } \n\ + .halfedge_f0_b0_m0 { stroke: green; stroke-width: __STROKEW__px } \n\ + .halfedge_f0_b0_m1 { stroke: green; stroke-width: __STROKEW__px } \n\ + .halfedge_f1_b1_m0 { stroke: gold; stroke-width: __STROKEW__px } \n\ + .halfedge_f1_b1_m1 { stroke: gold; stroke-width: __STROKEW__px } \n\ + .halfedge_f1_b0_m0 { stroke: green; stroke-width: __STROKEW__px } \n\ + .halfedge_f1_b0_m1 { stroke: green; stroke-width: __STROKEW__px } \n\ + </style>"; std::string tmp = out.str(); boost::replace_all( tmp, "__STROKEW__", strokewidth ); return tmp; @@ -119,14 +119,14 @@ std::string dump_cgal_nef_polyhedron2_face_svg( style << "halfedge_f" << facemark << "_b" << body << "_m"; std::string styleclass = style.str(); - std::stringstream out; + std::stringstream out; CGAL_For_all(c1, c2) { if ( explorer.is_standard( explorer.target(c1) ) ) { -CGAL_Nef_polyhedron2::Explorer::Point source = explorer.point( explorer.source( c1 ) ); + CGAL_Nef_polyhedron2::Explorer::Point source = explorer.point( explorer.source( c1 ) ); CGAL_Point_2e target = explorer.point( explorer.target( c1 ) ); out << " <!-- Halfedge. Mark: " << c1->mark() << " -->\n"; std::string he_mark = boost::lexical_cast<std::string>(c1->mark()); - out << " <line" + out << " <line" << " x1='" << CGAL::to_double(source.x()) << "'" << " y1='" << CGAL::to_double(source.y()) << "'" << " x2='" << CGAL::to_double(target.x()) << "'" @@ -141,10 +141,10 @@ CGAL_Nef_polyhedron2::Explorer::Point source = explorer.point( explorer.source( std::string dump_svg( const CGAL_Nef_polyhedron2 &N ) { - std::stringstream out; - CGAL_Nef_polyhedron2::Explorer explorer = N.explorer(); + std::stringstream out; + CGAL_Nef_polyhedron2::Explorer explorer = N.explorer(); CGAL_Iso_rectangle_2e bbox = bounding_box( N ); - CGAL_Nef_polyhedron2::Explorer::Face_const_iterator i; + CGAL_Nef_polyhedron2::Explorer::Face_const_iterator i; std::string linewidth = "0.05"; @@ -152,23 +152,23 @@ std::string dump_svg( const CGAL_Nef_polyhedron2 &N ) out << svg_header() << "\n" << svg_styleblock( linewidth ) << "\n"; for ( i = explorer.faces_begin(); i!= explorer.faces_end(); ++i ) { - out << " <!-- face begin. mark: " << i->mark() << " -->\n"; - out << " <!-- body begin -->\n"; - CGAL_Nef_polyhedron2::Explorer::Halfedge_around_face_const_circulator c1 - = explorer.face_cycle( i ), c2 ( c1 ); - out << dump_cgal_nef_polyhedron2_face_svg( c1, c2, explorer, i->mark(), true ); - out << " <!-- body end -->\n"; + out << " <!-- face begin. mark: " << i->mark() << " -->\n"; + out << " <!-- body begin -->\n"; + CGAL_Nef_polyhedron2::Explorer::Halfedge_around_face_const_circulator c1 + = explorer.face_cycle( i ), c2 ( c1 ); + out << dump_cgal_nef_polyhedron2_face_svg( c1, c2, explorer, i->mark(), true ); + out << " <!-- body end -->\n"; - CGAL_Nef_polyhedron2::Explorer::Hole_const_iterator j; - for ( j = explorer.holes_begin( i ); j!= explorer.holes_end( i ); ++j ) { - out << " <!-- hole begin. mark: " << j->mark() << " -->\n"; - CGAL_Nef_polyhedron2::Explorer::Halfedge_around_face_const_circulator c3( j ), c4 ( c3 ); - out << dump_cgal_nef_polyhedron2_face_svg( c3, c4, explorer, "green", j->mark() ); - out << " <!-- hole end -->\n"; - } - out << " <!-- face end -->\n"; - } - out << "</svg>"; + CGAL_Nef_polyhedron2::Explorer::Hole_const_iterator j; + for ( j = explorer.holes_begin( i ); j!= explorer.holes_end( i ); ++j ) { + out << " <!-- hole begin. mark: " << j->mark() << " -->\n"; + CGAL_Nef_polyhedron2::Explorer::Halfedge_around_face_const_circulator c3( j ), c4 ( c3 ); + out << dump_cgal_nef_polyhedron2_face_svg( c3, c4, explorer, "green", j->mark() ); + out << " <!-- hole end -->\n"; + } + out << " <!-- face end -->\n"; + } + out << "</svg>"; std::string tmp = out.str(); boost::replace_all( tmp, "'", "\"" ); return tmp; @@ -212,14 +212,14 @@ public: CGAL_Point_3 target = c1->source()->target()->point(); CGAL_Point_2e tp1 = project_svg_3to2 ( source, bbox ); CGAL_Point_2e tp2 = project_svg_3to2 ( target, bbox ); - out << " <!-- " << CGAL::to_double(source.x()) << "," - << CGAL::to_double(source.y()) << "," - << CGAL::to_double(source.z()) << " -->\n"; + out << " <!-- " << CGAL::to_double(source.x()) << "," + << CGAL::to_double(source.y()) << "," + << CGAL::to_double(source.z()) << " -->\n"; out << " <line " - << "x1='" << CGAL::to_double(tp1.x()) << "' " - << "y1='" << CGAL::to_double(tp1.y()) << "' " - << "x2='" << CGAL::to_double(tp2.x()) << "' " - << "y2='" << CGAL::to_double(tp2.y()) << "' " + << "x1='" << CGAL::to_double(tp1.x()) << "' " + << "y1='" << CGAL::to_double(tp1.y()) << "' " + << "x2='" << CGAL::to_double(tp2.x()) << "' " + << "y2='" << CGAL::to_double(tp2.y()) << "' " << " stroke='" << color << "'"; if (!(*hfacet).mark()) out << " stroke-dasharray='4 4' />\n"; else out << " />\n"; @@ -234,31 +234,31 @@ public: std::string dump_svg( const CGAL_Nef_polyhedron3 &N ) { - std::stringstream out; + std::stringstream out; std::string linewidth = "0.05"; out << "<!--CGAL_Nef_polyhedron3 dump begin-->\n"; out << svg_header() << "\n" << svg_border() << "\n"; out << svg_styleblock( linewidth ) << "\n" << svg_axes() << "\n"; - CGAL_Nef_polyhedron3::Volume_const_iterator c; - CGAL_forall_volumes(c,N) { - out << " <!--Volume begin-->\n"; - out << " <!--Mark: " << (*c).mark() << "-->\n"; - CGAL_Nef_polyhedron3::Shell_entry_const_iterator it; - CGAL_forall_shells_of(it,c) { - out << " <!--Shell begin-->\n"; - NefPoly3_dumper_svg dumper_svg(N); - N.visit_shell_objects(CGAL_Nef_polyhedron3::SFace_const_handle(it), dumper_svg ); + CGAL_Nef_polyhedron3::Volume_const_iterator c; + CGAL_forall_volumes(c,N) { + out << " <!--Volume begin-->\n"; + out << " <!--Mark: " << (*c).mark() << "-->\n"; + CGAL_Nef_polyhedron3::Shell_entry_const_iterator it; + CGAL_forall_shells_of(it,c) { + out << " <!--Shell begin-->\n"; + NefPoly3_dumper_svg dumper_svg(N); + N.visit_shell_objects(CGAL_Nef_polyhedron3::SFace_const_handle(it), dumper_svg ); out << dumper_svg.out.str(); - out << " <!--Shell end-->\n"; - } - out << " <!--Volume end-->\n"; - } - out << "<!--CGAL_Nef_polyhedron3 dump end-->\n"; + out << " <!--Shell end-->\n"; + } + out << " <!--Volume end-->\n"; + } + out << "<!--CGAL_Nef_polyhedron3 dump end-->\n"; out << "</svg>"; std::string tmp = out.str(); boost::replace_all( tmp, "'", "\"" ); - return tmp; + return tmp; } } // namespace |