From 6fb47faebd973fe83f7d6483d4e7bfbb926577f9 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Mon, 19 Feb 2018 13:40:58 -0800 Subject: [PATCH] Workaround for IGES import bug in OCE-0.18 This changes the IGES import parameter precision to be file-defined instead of hard-coded in KiCad. OCE-0.18 does not handle faces with a set of points whose approximation creates a single point. By allowing the file to set the precision level, we leave it to the generating program to create a file with non-degenerate faces. Fixes: lp:1738872 * https://bugs.launchpad.net/kicad/+bug/1738872 --- plugins/3d/oce/loadmodel.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/plugins/3d/oce/loadmodel.cpp b/plugins/3d/oce/loadmodel.cpp index 9d581f3630..0250382a1b 100644 --- a/plugins/3d/oce/loadmodel.cpp +++ b/plugins/3d/oce/loadmodel.cpp @@ -80,6 +80,7 @@ // precision for mesh creation; 0.07 should be good enough for ECAD viewing #define USER_PREC (0.14) + // angular deflection for meshing // 10 deg (36 faces per circle) = 0.17453293 // 20 deg (18 faces per circle) = 0.34906585 @@ -399,12 +400,8 @@ bool readIGES( Handle(TDocStd_Document)& m_doc, const char* fname ) if( stat != IFSelect_RetDone ) return false; - // Enable user-defined shape precision - if( !Interface_Static::SetIVal( "read.precision.mode", 1 ) ) - return false; - - // Set the shape conversion precision to USER_PREC (default 0.0001 has too many triangles) - if( !Interface_Static::SetRVal( "read.precision.val", USER_PREC ) ) + // Enable file-defined shape precision + if( !Interface_Static::SetIVal( "read.precision.mode", 0 ) ) return false; // set other translation options