Browse Source

- 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 năm trước cách đây
mục cha
commit
dbc7dc005d
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  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));
 
 	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;
-	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));
 	}
 }