Skip to content

Commit

Permalink
dxf export: fix output of closed 3d polylines (fixes #20242)
Browse files Browse the repository at this point in the history
(cherry picked from commit 56ec473)
  • Loading branch information
jef-n committed Feb 21, 2019
1 parent 23c01de commit db82317
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/core/dxf/qgsdxfexport.cpp
Expand Up @@ -3477,9 +3477,6 @@ void QgsDxfExport::writePolyline( const QgsPointSequence &line, const QString &l
return;
}

bool polygon = line[0] == line[ line.size() - 1 ];
if ( polygon )
--n;
if ( n < 2 )
{
QgsDebugMsg( QStringLiteral( "writePolyline: line too short layer=%1 lineStyleName=%2" ).arg( layer, lineStyleName ) );
Expand All @@ -3488,6 +3485,10 @@ void QgsDxfExport::writePolyline( const QgsPointSequence &line, const QString &l

if ( mForce2d || !line.at( 0 ).is3D() )
{
bool polygon = line[0] == line[ line.size() - 1 ];
if ( polygon )
--n;

writeGroup( 0, QStringLiteral( "LWPOLYLINE" ) );
writeHandle();
writeGroup( 8, layer );
Expand Down

0 comments on commit db82317

Please sign in to comment.