- 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

pull/502/head
ulf 2015-03-16 11:35:07 +01:00
parent ad9d178f0a
commit dbc7dc005d
1 changed files with 2 additions and 2 deletions

View File

@ -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));
}
}