diff --git a/src/ACadSharp/Entities/LwPolyLine.cs b/src/ACadSharp/Entities/LwPolyLine.cs index 47bfcc6e..807cfd16 100644 --- a/src/ACadSharp/Entities/LwPolyLine.cs +++ b/src/ACadSharp/Entities/LwPolyLine.cs @@ -123,12 +123,27 @@ public override void ApplyTransform(Transform transform) this.getWorldMatrix(transform, this.Normal, newNormal, out Matrix3 transOW, out Matrix3 transWO); + var m = transform.Matrix; + double det = + m.M00 * m.M11 - + m.M01 * m.M10; + + bool mirrored = det < 0; + foreach (var vertex in this.Vertices) { - XYZ v = transOW * vertex.Location.Convert(); - v = transform.ApplyTransform(v); - v = transWO * v; - vertex.Location = v.Convert(); + // OCS → WCS + XYZ transformationVector = transOW * vertex.Location.Convert(); + transformationVector = transform.ApplyTransform(transformationVector); + + // WCS → new OCS + transformationVector = transWO * transformationVector; + vertex.Location = transformationVector.Convert(); + + if (mirrored && vertex.Bulge != 0.0) + { + vertex.Bulge = -vertex.Bulge; + } } this.Normal = newNormal;