diff --git a/Graphics/gl2ps.cpp b/Graphics/gl2ps.cpp index 40e9308010b2ca072733ab013b974277ca813007..f8e5090e4d29afdc0f922cc10fed74d3a1840359 100644 --- a/Graphics/gl2ps.cpp +++ b/Graphics/gl2ps.cpp @@ -1,4 +1,4 @@ -/* $Id: gl2ps.cpp,v 1.87 2004-11-22 07:36:25 geuzaine Exp $ */ +/* $Id: gl2ps.cpp,v 1.88 2004-11-22 07:46:32 geuzaine Exp $ */ /* * GL2PS, an OpenGL to PostScript Printing Library * Copyright (C) 1999-2004 Christophe Geuzaine <geuz@geuz.org> @@ -1279,7 +1279,7 @@ static void gl2psTraverseBspTree(GL2PSbsptree *tree, GL2PSxyz eye, GLfloat epsil static void gl2psSetPrecisionAndApplyOffsets() { GL2PSprimitive *prim; - GLfloat minZ, maxZ; + GLfloat minZ, maxZ, simple; GLfloat factor, units, area, dZ, dZdX, dZdY, maxdZ; int i, j, offset = 0; @@ -1305,6 +1305,9 @@ static void gl2psSetPrecisionAndApplyOffsets() /* set precision */ gl2ps->epsilon = (maxZ - minZ) / 5000.0F; + simple = (maxZ - minZ) / 500.0F; + if(GL2PS_ZERO(gl2ps->epsilon)) gl2ps->epsilon = 0.0002F; + if(GL2PS_ZERO(simple)) simple = 0.002F; /* apply offsets */ if(gl2ps->options & GL2PS_SIMPLE_LINE_OFFSET){ @@ -1312,12 +1315,12 @@ static void gl2psSetPrecisionAndApplyOffsets() prim = *(GL2PSprimitive**)gl2psListPointer(gl2ps->primitives, i); if(prim->type == GL2PS_LINE){ if(gl2ps->sort == GL2PS_SIMPLE_SORT){ - prim->verts[0].xyz[2] -= (maxZ - minZ) / 25.0F; - prim->verts[1].xyz[2] -= (maxZ - minZ) / 25.0F; + prim->verts[0].xyz[2] -= simple * 20.0F; + prim->verts[1].xyz[2] -= simple * 20.0F; } else{ - prim->verts[0].xyz[2] -= (maxZ - minZ) / 500.0F; - prim->verts[1].xyz[2] -= (maxZ - minZ) / 500.0F; + prim->verts[0].xyz[2] -= simple; + prim->verts[1].xyz[2] -= simple; } } }