فهرست منبع

- IfcLoader now evaluates all curve segments at both start and end. Leads to a lot of duplicates which get filtered out afterwards, but fixes the "cutting corners" phenomen that sometimes appeared in conjunction with trimmed curves

ulf 10 سال پیش
والد
کامیت
dbc7dc005d
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      code/IFCCurve.cpp

+ 2 - 2
code/IFCCurve.cpp

@@ -648,10 +648,10 @@ void Curve :: SampleDiscrete(TempMesh& out,IfcFloat a, IfcFloat b) const
 	ai_assert(InRange(a) && InRange(b));
 	ai_assert(InRange(a) && InRange(b));
 
 
 	const size_t cnt = std::max(static_cast<size_t>(0),EstimateSampleCount(a,b));
 	const size_t cnt = std::max(static_cast<size_t>(0),EstimateSampleCount(a,b));
-	out.verts.reserve( out.verts.size() + cnt );
+	out.verts.reserve( out.verts.size() + cnt + 1);
 
 
 	IfcFloat p = a, delta = (b-a)/cnt;
 	IfcFloat p = a, delta = (b-a)/cnt;
-	for(size_t i = 0; i < cnt; ++i, p += delta) {
+	for(size_t i = 0; i <= cnt; ++i, p += delta) {
 		out.verts.push_back(Eval(p));
 		out.verts.push_back(Eval(p));
 	}
 	}
 }
 }