浏览代码

- Configure STEP reader to use double precision, small changes to the Ifc code to tolerate this (Ifc itself still working with single precision).

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1136 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
aramis_acg 13 年之前
父节点
当前提交
38e6d90e40
共有 3 个文件被更改,包括 7 次插入5 次删除
  1. 4 2
      code/IFCCurve.cpp
  2. 1 1
      code/IFCGeometry.cpp
  3. 2 2
      code/STEPFile.h

+ 4 - 2
code/IFCCurve.cpp

@@ -120,7 +120,8 @@ public:
 	// --------------------------------------------------
 	IfcVector3 Eval(IfcFloat u) const {
 		u = -conv.angle_scale * u;
-		return location + entity.Radius*(static_cast<IfcFloat>(::cos(u))*p[0] + static_cast<IfcFloat>(::sin(u))*p[1]);
+		return location + static_cast<IfcFloat>(entity.Radius)*(static_cast<IfcFloat>(::cos(u))*p[0] + 
+			static_cast<IfcFloat>(::sin(u))*p[1]);
 	}
 
 private:
@@ -148,7 +149,8 @@ public:
 	// --------------------------------------------------
 	IfcVector3 Eval(IfcFloat u) const {
 		u = -conv.angle_scale * u;
-		return location + entity.SemiAxis1*static_cast<IfcFloat>(::cos(u))*p[0] + entity.SemiAxis2*static_cast<IfcFloat>(::sin(u))*p[1];
+		return location + static_cast<IfcFloat>(entity.SemiAxis1)*static_cast<IfcFloat>(::cos(u))*p[0] +
+			static_cast<IfcFloat>(entity.SemiAxis2)*static_cast<IfcFloat>(::sin(u))*p[1];
 	}
 
 private:

+ 1 - 1
code/IFCGeometry.cpp

@@ -1457,7 +1457,7 @@ void ProcessSweptAreaSolid(const IfcSweptAreaSolid& swept, TempMesh& meshout, Co
 
 			IfcVector3 dir;
 			ConvertDirection(dir,solid->ExtrudedDirection);
-			conv.collect_openings->push_back(TempOpening(solid, IfcMatrix3(m) * (dir*solid->Depth),meshtmp));
+			conv.collect_openings->push_back(TempOpening(solid, IfcMatrix3(m) * (dir*static_cast<IfcFloat>(solid->Depth)),meshtmp));
 			return;
 		}
 

+ 2 - 2
code/STEPFile.h

@@ -281,8 +281,8 @@ namespace STEP {
 		};
 
 		typedef PrimitiveDataType<int64_t>			INTEGER; 
-		typedef PrimitiveDataType<float>			REAL; 
-		typedef PrimitiveDataType<float>			NUMBER; 
+		typedef PrimitiveDataType<double>			REAL; 
+		typedef PrimitiveDataType<double>			NUMBER; 
 		typedef PrimitiveDataType<std::string>		STRING;