Update DXFLoader.cpp

Changed order of operations for insert positioning and scaling. Need to position the inserts before scaling it, otherwise the position ends up up being position*scale
pull/5436/head^2
seanth 2024-01-17 07:38:48 -06:00 committed by Kim Kulling
parent 727001b0ca
commit 240fa97fed
1 changed files with 4 additions and 0 deletions

View File

@ -372,6 +372,10 @@ void DXFImporter::ExpandBlockReferences(DXF::Block& bl,const DXF::BlockMap& bloc
// XXX order // XXX order
aiMatrix4x4 trafo, tmp; aiMatrix4x4 trafo, tmp;
aiMatrix4x4::Translation(-bl_src.base,trafo); aiMatrix4x4::Translation(-bl_src.base,trafo);
//Need to translate position before scaling the insert
//otherwise the position ends up being the position*scaling
//STH 2024.01.17
trafo *= aiMatrix4x4::Translation(insert.pos,tmp);
trafo *= aiMatrix4x4::Scaling(insert.scale,tmp); trafo *= aiMatrix4x4::Scaling(insert.scale,tmp);
//trafo *= aiMatrix4x4::Translation(insert.pos,tmp); //trafo *= aiMatrix4x4::Translation(insert.pos,tmp);