summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/polyset.cc6
-rw-r--r--src/polyset.h15
2 files changed, 12 insertions, 9 deletions
diff --git a/src/polyset.cc b/src/polyset.cc
index 3b3be34..e601585 100644
--- a/src/polyset.cc
+++ b/src/polyset.cc
@@ -157,7 +157,8 @@ void PolySet::render_surface(csgmode_e csgmode, const Transform3d &m, GLint *sha
}
#endif /* ENABLE_OPENCSG */
if (this->is2d) {
- double zbase = 1; // Render 2D objects 1mm thick
+ // Render 2D objects 1mm thick, but differences slightly larger
+ double zbase = 1 + (csgmode & CSGMODE_DIFFERENCE_FLAG) * 0.1;
glBegin(GL_TRIANGLES);
for (double z = -zbase/2; z < zbase; z += zbase)
{
@@ -248,7 +249,8 @@ void PolySet::render_edges(csgmode_e csgmode) const
{
glDisable(GL_LIGHTING);
if (this->is2d) {
- double zbase = 1; // Render 2D objects 1mm thick
+ // Render 2D objects 1mm thick, but differences slightly larger
+ double zbase = 1 + (csgmode & CSGMODE_DIFFERENCE_FLAG) * 0.1;
for (double z = -zbase/2; z < zbase; z += zbase)
{
for (size_t i = 0; i < borders.size(); i++) {
diff --git a/src/polyset.h b/src/polyset.h
index 4ca57bf..6626f79 100644
--- a/src/polyset.h
+++ b/src/polyset.h
@@ -29,14 +29,15 @@ public:
BoundingBox getBoundingBox() const;
+#define CSGMODE_DIFFERENCE_FLAG 0x10
enum csgmode_e {
- CSGMODE_NONE,
- CSGMODE_NORMAL = 1,
- CSGMODE_DIFFERENCE = 2,
- CSGMODE_BACKGROUND = 11,
- CSGMODE_BACKGROUND_DIFFERENCE = 12,
- CSGMODE_HIGHLIGHT = 21,
- CSGMODE_HIGHLIGHT_DIFFERENCE = 22
+ CSGMODE_NONE = 0x00,
+ CSGMODE_NORMAL = 0x01,
+ CSGMODE_DIFFERENCE = CSGMODE_NORMAL | CSGMODE_DIFFERENCE_FLAG,
+ CSGMODE_BACKGROUND = 0x02,
+ CSGMODE_BACKGROUND_DIFFERENCE = CSGMODE_BACKGROUND | CSGMODE_DIFFERENCE_FLAG,
+ CSGMODE_HIGHLIGHT = 0x03,
+ CSGMODE_HIGHLIGHT_DIFFERENCE = CSGMODE_HIGHLIGHT | CSGMODE_DIFFERENCE_FLAG
};
void render_surface(csgmode_e csgmode, const Transform3d &m, GLint *shaderinfo = NULL) const;
contact: Jan Huwald // Impressum