From dbc7dc005d83dc6ed144b819382198b6828a6c5f Mon Sep 17 00:00:00 2001 From: ulf Date: Mon, 16 Mar 2015 11:35:07 +0100 Subject: [PATCH] - 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 --- code/IFCCurve.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/IFCCurve.cpp b/code/IFCCurve.cpp index ffe52dfd2..e696bed9a 100644 --- a/code/IFCCurve.cpp +++ b/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(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)); } }