Merge branch 'master' of github.com:openscad/openscad

master
Marius Kintel 2015-01-25 01:37:37 -05:00
commit 13a4e43de9
37 changed files with 3600 additions and 1449 deletions

22
.gitignore vendored
View File

@ -1,12 +1,13 @@
*.dmg
*~
*.tar*
*.new
Makefile
objects
.gdbinit
.qmake.stash
parser_yacc.h
*/#*#
**/#*#
testdata/scad/features/import_dxf-tests.scad
testdata/scad/features/import_stl-tests.scad
testdata/scad/misc/include-tests.scad
@ -20,6 +21,18 @@ testdata/scad/misc/use-tests.scad
/*.amf
/*.png
/*.csg
/*.nef3
/*.blend
/*.obj
/*.rcad
/*.xml
/*.dat
/*.gcode
/*.py
/*.svg
/*.h
/*.dump
/*.pl
/lexer_lex.cpp
/parser_yacc.cpp
/OpenSCAD.app
@ -27,11 +40,10 @@ testdata/scad/misc/use-tests.scad
/openscad
/locale/*/*/*.mo
/locale/POTFILES
/tests/openscad_nogui
/tests/diffpng
/tests/test_pretty_print.log.txt
/tests/*.png
/tmp
/nbproject
/mingw32
/mingw64
src/*.org
src/*.old
src/*.debug

View File

@ -88,24 +88,23 @@ libraries from aptitude. If you're using Mac, or an older Linux/BSD, there
are build scripts that download and compile the libraries from source.
Follow the instructions for the platform you're compiling on below.
* [Qt4 (4.4 - 5.3)](http://www.qt.nokia.com/)
* [QScintilla2 (2.7)](http://www.riverbankcomputing.co.uk/software/qscintilla/)
* [CGAL (3.6 - 4.4)](http://www.cgal.org/)
* [Qt4 (4.4 - 5.4)](http://www.qt.nokia.com/)
* [QScintilla2 (2.7 - 2.8)](http://www.riverbankcomputing.co.uk/software/qscintilla/)
* [CGAL (3.6 - 4.5)](http://www.cgal.org/)
* [GMP (5.x)](http://www.gmplib.org/)
* [MPFR (3.x)](http://www.mpfr.org/)
* [cmake (2.8, required by CGAL and the test framework)](http://www.cmake.org/)
* [boost (1.35 - 1.55)](http://www.boost.org/)
* [cmake (2.8 - 3.0, required by CGAL and the test framework)](http://www.cmake.org/)
* [boost (1.35 - 1.57)](http://www.boost.org/)
* [OpenCSG (1.3.2 ->)](http://www.opencsg.org/)
* [GLEW (1.5.4 ->)](http://glew.sourceforge.net/)
* [Eigen (3.x)](http://eigen.tuxfamily.org/)
* [glib2 (2.x)](https://developer.gnome.org/glib/)
* [fontconfig (2.10)](http://fontconfig.org/)
* [freetype2 (2.4)](http://freetype.org/)
* [harfbuzz (0.9.19)](http://harfbuzz.org/)
* [GCC C++ Compiler (4.2 ->)](http://gcc.gnu.org/)
* [Bison (2.4)](http://www.gnu.org/software/bison/)
* [Flex (2.5.35)](http://flex.sourceforge.net/)
* [pkg-config (0.26)](http://www.freedesktop.org/wiki/Software/pkg-config/)
* [fontconfig (2.10 -> )](http://fontconfig.org/)
* [freetype2 (2.4 -> )](http://freetype.org/)
* [harfbuzz (0.9.19 -> )](http://harfbuzz.org/)
* [Bison (2.4 -> )](http://www.gnu.org/software/bison/)
* [Flex (2.5.35 -> )](http://flex.sourceforge.net/)
* [pkg-config (0.26 -> )](http://www.freedesktop.org/wiki/Software/pkg-config/)
### Getting the source code
@ -123,29 +122,41 @@ To pull the MCAD library (http://reprap.org/wiki/MCAD), do the following:
### Building for Mac OS X
Prerequisites:
* XCode, including XCode command-line tools (install from XCode Preferences).
Prerequisites that can be installed through MacPorts/homebrew:
* [CMake](http://cmake.org/)
* [automake](http://www.gnu.org/software/automake/)
* [pkg-config](http://www.freedesktop.org/wiki/Software/pkg-config/)
* [libtool](https://www.gnu.org/software/libtool/)
* XCode, including XCode command-line tools.
Then after you've cloned this git repository, run the script that sets up the
environment variables.
Install Dependencies:
source setenv_mac-qt5.sh
Run the script that sets up the environment variables:
```source setenv_mac-qt5.sh```
Then run the script to compile all the prerequisite libraries above:
Then run the script to compile all the dependencies:
```./scripts/macosx-build-dependencies.sh```
./scripts/macosx-build-dependencies.sh
You can also install the prerequisites using
[MacPorts](http://www.macports.org). Unfortunately,
[brew](http://mxcl.github.com/homebrew/) doesn't yet support CGAL and
OpenCSG.
After building dependencies, follow the instructions in the *Compilation* section.
For the adventurous, it might be possible to build OpenSCAD using _MacPorts_ or _Homebrew_. The main challenge is that both these systems have partially broken libraries, but that tends to change from time to time.
1. **MacPorts** (assumes [MacPorts](http://macports.org) is already installed)
NB! MacPorts currently doesn't support Qt5 very well, so using Qt4
is the only working option at the moment. However, MacPorts' Qt4
has a broken ```moc``` command, causing OpenSCAD compilation to
break. This may be fixed in MacPorts by the time you read this.
```sudo port install opencsg qscintilla boost cgal pkgconfig eigen3 harfbuzz fontconfig```
1. **Homebrew** (assumes [Homebrew](http://brew.sh)) is already installed)
NB! Homebrew's ```qscintilla2``` component doesn't support Qt5, so using Qt4 is currently necessary.
However, Homebrew's Qt4 has a broken ```moc``` command, causing OpenSCAD compilation to
break. This may be fixed in Homebrew by the time you read this.
NB! Homebrew's ```harfbuzz``` package requires X11, so you may have to install an X11 server.
NB! Homebrew doesnt have an OpenCSG package
```brew install cgal qscintilla2 eigen harfbuzz```
After that, follow the Compilation instructions below.
### Building for Linux/BSD
@ -220,9 +231,9 @@ For a 64-bit Windows cross-build, replace 32 with 64 in the above instructions.
### Compilation
First, run 'qmake openscad.pro' from Qt4 to generate a Makefile. On some systems
you need to run 'qmake4', 'qmake-qt4' or something alike to run the qt4 version
of the tool.
First, run 'qmake openscad.pro' from Qt4 to generate a Makefile.
On some systems, depending on which version(s) of Qt you have installed, you may need to specify which version you want to use, e.g. by running 'qmake4', 'qmake-qt4' or something alike.
Then run make. Finally you might run 'make install' as root or simply copy the
'openscad' binary (OpenSCAD.app on Mac OS X) to the bin directory of your choice.

View File

@ -7,9 +7,9 @@
<item>
<title>OpenSCAD @VERSION@</title>
<pubDate>@VERSIONDATE@</pubDate>
<sparkle:releaseNotesLink>https://raw.github.com/openscad/openscad/master/RELEASE_NOTES</sparkle:releaseNotesLink>
<sparkle:releaseNotesLink>https://raw.github.com/openscad/openscad/master/releases/2014.QX.md</sparkle:releaseNotesLink>
<sparkle:minimumSystemVersion>10.7.0</sparkle:minimumSystemVersion>
<enclosure url="http://files.openscad.org/OpenSCAD-@VERSION@.dmg"
<enclosure url="http://files.openscad.org/snapshots/OpenSCAD-@VERSION@.dmg"
sparkle:version="@VERSIONDATE@"
sparkle:shortVersionString="@VERSION@"
sparkle:dsaSignature="@DSASIGNATURE@"

8
cgal/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
/*.stl
/*.scad
/*.polygon
polyhole-tessellator
polyhole-tessellator-libtess2
minkowski
decompose
export_nef

View File

@ -1,4 +1,4 @@
.TH OPENSCAD 1 "2014.03"
.TH OPENSCAD 1 "2015.02"
.\" Please adjust this date whenever revising the manpage.
.SH NAME
openscad \- script file based graphical CAD environment
@ -19,7 +19,7 @@ the OpenSCAD user manual at http://en.wikibooks.org/wiki/OpenSCAD_User_Manual.
.TP
\fB-o\fP \fIoutputfile\fP
Export the given file to \fIoutputfile\fP in STL, OFF, DXF, or PNG
Export the given file to \fIoutputfile\fP in STL, OFF, AMF, DXF, SVG, or PNG
format, depending on file extension of \fIoutputfile\fP. If this
option is given, the GUI will not be started.
@ -49,10 +49,10 @@ strings, care has to be taken that the shell does not consume quotation marks.
More than one \fB-D\fP option can be given.
.TP
.B \-\-render
If exporting an image, use a full CGAL render. (Default is an OpenCSG compile)
If exporting an image, render the model fully. (Default is preview)
.TP
.B \-\-preview[=throwntogether]
If exporting an image, use an OpenCSG previce (optionally in throwntogether mode for quicker rendering).
If exporting an image, use an OpenCSG preview (optionally in throwntogether mode for quicker rendering).
.TP
.B \-\-csglimit=limit
If exporting an image as an OpenCSG preview, stop rendering after encountering \fIlimit\fP elements to avoid runaway resource usage.
@ -69,6 +69,12 @@ The first three are for the Eye position, while the next three are for
the Center (or target) that the camera will look at. The 'up' vector is
not currently supported.
.TP
.B \-\-viewall
If exporting an image, adjust camera distance to fit the whole design in the frame
.TP
.B \-\-autocenter
If exporting an image, center the design in the frame
.TP
.B \-\-imgsize=width,height
If exporting an image, specify the pixel width and height
.TP
@ -76,6 +82,9 @@ If exporting an image, specify the pixel width and height
If exporting an image, specify whether to use orthographic or perspective
projection
.TP
.B \-\-colorscheme=[Cornfield|Sunset|Metallic|Starnight|BeforeDawn|Nature|DeepOcean]
If exporting an image, use the specified color scheme for the rendering.
.TP
.B \-v, \-\-version
Show version of program.
.TP

View File

@ -70,6 +70,8 @@ o Notify package managers
- OpenSUSE: Pavol Rusnak <prusnak@opensuse.org>
- MacPorts: Frank Schima <macports2000@gmail.com>
- Arch Linux: Kyle Keen <keenerd@gmail.com>
o Update dev version to release version in documentation
- https://en.wikibooks.org/wiki/OpenSCAD_User_Manual
Build and Upload Release Binaries
---------------------------------

View File

@ -19,8 +19,9 @@ macx: {
GETTEXT_LIBPATH = $$OPENSCAD_LIBRARIES_DIR/lib
}
}
GETTEXT_CXXFLAGS=-I$$GETTEXT_INCLUDEPATH
GETTEXT_LIBS=-L$$GETTEXT_LIBPATH -lintl -liconv
!isEmpty(GETTEXT_INCLUDEPATH): GETTEXT_CXXFLAGS = -I$$GETTEXT_INCLUDEPATH
!isEmpty(GETTEXT_LIBPATH): GETTEXT_LIBS = -L$$GETTEXT_LIBPATH
GETTEXT_LIBS += -lintl -liconv
}
QMAKE_CXXFLAGS += $$GETTEXT_CXXFLAGS

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

BIN
images/preview-32-white.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 732 B

BIN
images/preview-32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 705 B

BIN
images/render-32-white.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 775 B

BIN
images/render-32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 748 B

View File

@ -1,2 +1,2 @@
# available languages
fr ru de cs
fr ru de cs es

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1224
locale/es.po Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -30,7 +30,6 @@
<file>icons/prefsUpdate.png</file>
<file>icons/flattr.png</file>
<file>src/AboutDialog.html</file>
<file>images/Arrowhead-Right-32.png</file>
<file>images/export.png</file>
<file>images/axes.png</file>
<file>images/export-white.png</file>
@ -47,7 +46,6 @@
<file>images/left.png</file>
<file>images/blackUp.png</file>
<file>images/blackNew.png</file>
<file>images/blackRender.png</file>
<file>images/Rotation-32.png</file>
<file>images/Shape-Cube-32.png</file>
<file>images/Open-32.png</file>
@ -71,11 +69,13 @@
<file>images/orthogonal.png</file>
<file>images/cross.png</file>
<file>images/perspective1.png</file>
<file>images/Preview-32.png</file>
<file>images/preview-32.png</file>
<file>images/preview-32-white.png</file>
<file>images/render-32.png</file>
<file>images/render-32-white.png</file>
<file>images/animate.png</file>
<file>images/orthogonalwhite.png</file>
<file>images/perspective1white.png</file>
<file>images/Preview-32-white.png</file>
<file>images/crosswhite.png</file>
<file>icons/background.png</file>
<file>images/scalemarkers.png</file>

View File

@ -787,7 +787,7 @@ build_gettext 0.19.4
build_libffi 3.2.1
build_glib2 2.42.1
build_opencsg 1.4.0
build_freetype 2.5.4 --without-png
build_freetype 2.5.5 --without-png
build_ragel 6.9
build_harfbuzz 0.9.37 "--with-coretext=auto --with-glib=no"
export FREETYPE_CFLAGS="-I$DEPLOYDIR/include -I$DEPLOYDIR/include/freetype2"

View File

@ -23,7 +23,7 @@
</p>
<p>
Copyright (C) 2009-2014 <a href="https://github.com/kintel">Marius Kintel</a> &lt;marius@kintel.net&gt; and <a href="http://clifford.at">Clifford Wolf</a> &lt;clifford@clifford.at&gt;
Copyright (C) 2009-2015 <a href="https://github.com/kintel">Marius Kintel</a> &lt;marius@kintel.net&gt; and <a href="http://clifford.at">Clifford Wolf</a> &lt;clifford@clifford.at&gt;
</p>
<p>

View File

@ -366,14 +366,17 @@ void GeometryEvaluator::addToParent(const State &state,
*/
Response GeometryEvaluator::visit(State &state, const AbstractNode &node)
{
if (state.isPrefix() && isSmartCached(node)) return PruneTraversal;
if (state.isPrefix()) {
if (isSmartCached(node)) return PruneTraversal;
state.setPreferNef(true); // Improve quality of CSG by avoiding conversion loss
}
if (state.isPostfix()) {
shared_ptr<const class Geometry> geom;
if (!isSmartCached(node)) {
geom = applyToChildren(node, OPENSCAD_UNION).constptr();
}
else {
geom = smartCacheGet(node);
geom = smartCacheGet(node, state.preferNef());
}
addToParent(state, node, geom);
}
@ -400,7 +403,7 @@ Response GeometryEvaluator::visit(State &state, const OffsetNode &node)
}
}
else {
geom = smartCacheGet(node);
geom = smartCacheGet(node, false);
}
addToParent(state, node, geom);
}
@ -412,7 +415,10 @@ Response GeometryEvaluator::visit(State &state, const OffsetNode &node)
*/
Response GeometryEvaluator::visit(State &state, const RenderNode &node)
{
if (state.isPrefix() && isSmartCached(node)) return PruneTraversal;
if (state.isPrefix()) {
if (isSmartCached(node)) return PruneTraversal;
state.setPreferNef(true); // Improve quality of CSG by avoiding conversion loss
}
if (state.isPostfix()) {
shared_ptr<const class Geometry> geom;
if (!isSmartCached(node)) {
@ -437,7 +443,7 @@ Response GeometryEvaluator::visit(State &state, const RenderNode &node)
}
}
else {
geom = smartCacheGet(node);
geom = smartCacheGet(node, state.preferNef());
}
addToParent(state, node, geom);
}
@ -466,7 +472,7 @@ Response GeometryEvaluator::visit(State &state, const LeafNode &node)
}
geom.reset(geometry);
}
else geom = smartCacheGet(node);
else geom = smartCacheGet(node, state.preferNef());
addToParent(state, node, geom);
}
return PruneTraversal;
@ -501,14 +507,17 @@ Response GeometryEvaluator::visit(State &state, const TextNode &node)
*/
Response GeometryEvaluator::visit(State &state, const CsgNode &node)
{
if (state.isPrefix() && isSmartCached(node)) return PruneTraversal;
if (state.isPrefix()) {
if (isSmartCached(node)) return PruneTraversal;
state.setPreferNef(true); // Improve quality of CSG by avoiding conversion loss
}
if (state.isPostfix()) {
shared_ptr<const Geometry> geom;
if (!isSmartCached(node)) {
geom = applyToChildren(node, node.type).constptr();
}
else {
geom = smartCacheGet(node);
geom = smartCacheGet(node, state.preferNef());
}
addToParent(state, node, geom);
}
@ -583,7 +592,7 @@ Response GeometryEvaluator::visit(State &state, const TransformNode &node)
}
}
else {
geom = smartCacheGet(node);
geom = smartCacheGet(node, state.preferNef());
}
addToParent(state, node, geom);
}
@ -736,7 +745,7 @@ Response GeometryEvaluator::visit(State &state, const LinearExtrudeNode &node)
}
}
else {
geom = smartCacheGet(node);
geom = smartCacheGet(node, false);
}
addToParent(state, node, geom);
}
@ -844,7 +853,7 @@ Response GeometryEvaluator::visit(State &state, const RotateExtrudeNode &node)
}
}
else {
geom = smartCacheGet(node);
geom = smartCacheGet(node, false);
}
addToParent(state, node, geom);
}
@ -962,7 +971,7 @@ Response GeometryEvaluator::visit(State &state, const ProjectionNode &node)
}
}
else {
geom = smartCacheGet(node);
geom = smartCacheGet(node, false);
}
addToParent(state, node, geom);
}
@ -1038,7 +1047,7 @@ Response GeometryEvaluator::visit(State &state, const CgaladvNode &node)
}
}
else {
geom = smartCacheGet(node);
geom = smartCacheGet(node, state.preferNef());
}
addToParent(state, node, geom);
}
@ -1047,14 +1056,17 @@ Response GeometryEvaluator::visit(State &state, const CgaladvNode &node)
Response GeometryEvaluator::visit(State &state, const AbstractIntersectionNode &node)
{
if (state.isPrefix() && isSmartCached(node)) return PruneTraversal;
if (state.isPrefix()) {
if (isSmartCached(node)) return PruneTraversal;
state.setPreferNef(true); // Improve quality of CSG by avoiding conversion loss
}
if (state.isPostfix()) {
shared_ptr<const class Geometry> geom;
if (!isSmartCached(node)) {
geom = applyToChildren(node, OPENSCAD_INTERSECTION).constptr();
}
else {
geom = smartCacheGet(node);
geom = smartCacheGet(node, state.preferNef());
}
addToParent(state, node, geom);
}

View File

@ -54,7 +54,7 @@ private:
};
void smartCacheInsert(const AbstractNode &node, const shared_ptr<const Geometry> &geom);
shared_ptr<const Geometry> smartCacheGet(const AbstractNode &node, bool preferNef = false);
shared_ptr<const Geometry> smartCacheGet(const AbstractNode &node, bool preferNef);
bool isSmartCached(const AbstractNode &node);
std::vector<const class Polygon2d *> collectChildren2D(const AbstractNode &node);
Geometry::ChildList collectChildren3D(const AbstractNode &node);

View File

@ -25,9 +25,11 @@ static void stdFree(void* userData, void* ptr) {
This function should be robust wrt. malformed input.
It will only use existing vertices and is guaranteed use all
existing vertices, i.e. it will maintain connectivity if the input
polygon is part of a polygon mesh.
It will only use existing vertices and is guaranteed to maintain
connectivity if the input polygon is part of a polygon mesh.
One requirement: The input vertices must be distinct
(i.e. duplicated must resolve to the same index).
Returns true on error, false on success.
*/
@ -38,12 +40,39 @@ bool GeometryUtils::tessellatePolygonWithHoles(const IndexedPolygons &polygons,
// No polygon. FIXME: Will this ever happen or can we assert here?
if (polygons.faces.empty()) return false;
if (polygons.faces.size() == 1 && polygons.faces[0].size() == 3) {
// Remove consecutive equal vertices, as well as null ears
std::vector<IndexedFace> faces = polygons.faces;
BOOST_FOREACH(IndexedFace &face, faces) {
int i=0;
while (i < face.size()) {
if (face[i] == face[(i+1)%face.size()]) { // Two consecutively equal indices
face.erase(face.begin()+i);
}
else if (face[i] == face[(i+2)%face.size()]) { // Null ear
face.erase(face.begin() + (i+1)%face.size());
}
else {
i++;
}
}
}
// First polygon has < 3 points - no output
if (faces[0].size() < 3) return false;
// Remove collapsed holes
for (int i=1;i<faces.size();i++) {
if (faces[i].size() < 3) {
faces.erase(faces.begin() + i);
i--;
}
}
if (faces.size() == 1 && faces[0].size() == 3) {
// Input polygon has 3 points. shortcut tessellation.
triangles.push_back(IndexedTriangle(polygons.faces[0][0], polygons.faces[0][1], polygons.faces[0][2]));
triangles.push_back(IndexedTriangle(faces[0][0], faces[0][1], faces[0][2]));
return false;
}
const Vector3f *verts = &polygons.vertices.front();
TESSreal *normalvec = NULL;
TESSreal passednormal[3];
if (normal) {
@ -68,8 +97,7 @@ bool GeometryUtils::tessellatePolygonWithHoles(const IndexedPolygons &polygons,
// Since libtess2's indices is based on the running number of points added, we need to map back
// to our indices. allindices does the mapping.
std::vector<int> allindices;
BOOST_FOREACH(const IndexedFace &face, polygons.faces) {
const Vector3f *verts = &polygons.vertices.front();
BOOST_FOREACH(const IndexedFace &face, faces) {
contour.clear();
BOOST_FOREACH(int idx, face) {
const Vector3f &v = verts[idx];
@ -99,7 +127,7 @@ bool GeometryUtils::tessellatePolygonWithHoles(const IndexedPolygons &polygons,
FIXME: This currently only works for polygons without holes.
*/
if (polygons.faces.size() == 1) { // Only works for polygons without holes
if (faces.size() == 1) { // Only works for polygons without holes
/*
Algorithm:
@ -107,7 +135,6 @@ bool GeometryUtils::tessellatePolygonWithHoles(const IndexedPolygons &polygons,
B) Locate all unused vertices
C) For each unused vertex, create a triangle connecting it to the existing mesh
*/
const IndexedFace &face = polygons.faces.front();
int inputSize = allindices.size(); // inputSize is number of points added to libtess2
std::vector<int> vflags(inputSize); // Inits with 0's

View File

@ -245,7 +245,7 @@
<x>0</x>
<y>0</y>
<width>1397</width>
<height>33</height>
<height>22</height>
</rect>
</property>
<widget class="QMenu" name="menu_File">
@ -750,7 +750,7 @@
<action name="designActionPreview">
<property name="icon">
<iconset resource="../openscad.qrc">
<normaloff>:/images/Preview-32.png</normaloff>:/images/Preview-32.png</iconset>
<normaloff>:/images/preview-32.png</normaloff>:/images/preview-32.png</iconset>
</property>
<property name="text">
<string>&amp;Preview</string>
@ -762,7 +762,7 @@
<action name="designActionRender">
<property name="icon">
<iconset resource="../openscad.qrc">
<normaloff>:/images/blackRender.png</normaloff>:/images/blackRender.png</iconset>
<normaloff>:/images/render-32.png</normaloff>:/images/render-32.png</iconset>
</property>
<property name="text">
<string>&amp;Render</string>

View File

@ -128,7 +128,7 @@ QSet<MainWindow*> *MainWindow::getWindows()
unsigned int GuiLocker::gui_locked = 0;
static char copyrighttext[] =
"Copyright (C) 2009-2014 The OpenSCAD Developers\n"
"Copyright (C) 2009-2015 The OpenSCAD Developers\n"
"\n"
"This program is free software; you can redistribute it and/or modify "
"it under the terms of the GNU General Public License as published by "
@ -479,7 +479,7 @@ MainWindow::MainWindow(const QString &filename)
initActionIcon(fileActionSave, ":/images/Save-32.png", ":/images/Save-128.png");
initActionIcon(editActionZoomTextIn, ":/images/zoom-text-in.png", ":/images/zoom-text-in-white.png");
initActionIcon(editActionZoomTextOut, ":/images/zoom-text-out.png", ":/images/zoom-text-out-white.png");
initActionIcon(designActionRender, ":/images/blackRender.png", ":/images/Arrowhead-Right-32.png");
initActionIcon(designActionRender, ":/images/render-32.png", ":/images/render-32-white.png");
initActionIcon(viewActionShowAxes, ":/images/blackaxes.png", ":/images/axes.png");
initActionIcon(viewActionShowEdges, ":/images/Rotation-32.png", ":/images/grid.png");
initActionIcon(viewActionZoomIn, ":/images/zoomin.png", ":/images/Zoom-In-32.png");
@ -495,7 +495,7 @@ MainWindow::MainWindow(const QString &filename)
initActionIcon(viewActionShowCrosshairs, ":/images/cross.png", ":/images/crosswhite.png");
initActionIcon(viewActionPerspective, ":/images/perspective1.png", ":/images/perspective1white.png");
initActionIcon(viewActionOrthogonal, ":/images/orthogonal.png", ":/images/orthogonalwhite.png");
initActionIcon(designActionPreview, ":/images/Preview-32.png", ":/images/Preview-32-white.png");
initActionIcon(designActionPreview, ":/images/preview-32.png", ":/images/preview-32-white.png");
initActionIcon(viewActionAnimate, ":/images/animate.png", ":/images/animate.png");
initActionIcon(designActionExportSTL, ":/images/STL.png", ":/images/STL-white.png");
initActionIcon(designActionExportAMF, ":/images/AMF.png", ":/images/AMF-white.png");
@ -1823,14 +1823,18 @@ void MainWindow::actionRenderDone(shared_ptr<const Geometry> root_geom)
if (root_geom && !root_geom->isEmpty()) {
if (const CGAL_Nef_polyhedron *N = dynamic_cast<const CGAL_Nef_polyhedron *>(root_geom.get())) {
if (N->getDimension() == 3) {
bool simple = N->p3->is_simple();
PRINT(" Top level object is a 3D object:");
PRINTB(" Simple: %6s", (N->p3->is_simple() ? "yes" : "no"));
PRINTB(" Simple: %6s", (simple ? "yes" : "no"));
PRINTB(" Vertices: %6d", N->p3->number_of_vertices());
PRINTB(" Halfedges: %6d", N->p3->number_of_halfedges());
PRINTB(" Edges: %6d", N->p3->number_of_edges());
PRINTB(" Halffacets: %6d", N->p3->number_of_halffacets());
PRINTB(" Facets: %6d", N->p3->number_of_facets());
PRINTB(" Volumes: %6d", N->p3->number_of_volumes());
if (!simple) {
PRINT("WARNING: Object may not be a valid 2-manifold and may need repair!");
}
}
}
else if (const PolySet *ps = dynamic_cast<const PolySet *>(root_geom.get())) {

View File

@ -7,7 +7,7 @@ class State
{
public:
State(const class AbstractNode *parent)
: parentnode(parent), isprefix(false), ispostfix(false), numchildren(0) {
: parentnode(parent), isprefix(false), ispostfix(false), numchildren(0), prefernef(false) {
this->matrix_ = Transform3d::Identity();
this->color_.fill(-1.0f);
}
@ -19,6 +19,8 @@ public:
void setParent(const AbstractNode *parent) { this->parentnode = parent; }
void setMatrix(const Transform3d &m) { this->matrix_ = m; }
void setColor(const Color4f &c) { this->color_ = c; }
void setPreferNef(bool on) { this->prefernef = on; }
bool preferNef() const { return this->prefernef; }
bool isPrefix() const { return this->isprefix; }
bool isPostfix() const { return this->ispostfix; }
@ -33,6 +35,7 @@ private:
bool ispostfix;
unsigned int numchildren;
bool prefernef;
// Transformation matrix and color. FIXME: Generalize such state variables?
Transform3d matrix_;
Color4f color_;

View File

@ -0,0 +1,5 @@
translate([0,10,0]) difference() {
cube(10, center=true);
translate([6,5.5,0]) cube(11, center=true);
translate([6,-5.500000000088,0]) cube(11, center=true);
}

7
tests/.gitignore vendored
View File

@ -2,6 +2,7 @@
/*.a
/*-output
/*.scad
/*.png
out.*
/CMakeFiles
/CMakeCache.txt
@ -18,3 +19,9 @@ out.*
/sysinfo.txt
/CTestCustom.cmake
/openscad_nogui
/openscad_nogui
/diffpng
/test_pretty_print.log.txt
/csgtermtest
/echotest
/dumptest

View File

@ -1231,8 +1231,7 @@ list(APPEND BUGS_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/issue13.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/issue1105.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/issue1105b.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/issue1105c.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/issue1105d.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/issue1165.scad)
${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/issue1105d.scad)
list(APPEND EXPORT3D_TEST_FILES ${BUGS_FILES})
list(REMOVE_ITEM EXPORT3D_TEST_FILES
${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/issue899.scad

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB