Skip to content

Commit 56ec473

Browse files
committed
dxf export: fix output of closed 3d polylines (fixes #20242)
1 parent 4b55dbe commit 56ec473

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/core/dxf/qgsdxfexport.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -3478,9 +3478,6 @@ void QgsDxfExport::writePolyline( const QgsPointSequence &line, const QString &l
34783478
return;
34793479
}
34803480

3481-
bool polygon = line[0] == line[ line.size() - 1 ];
3482-
if ( polygon )
3483-
--n;
34843481
if ( n < 2 )
34853482
{
34863483
QgsDebugMsg( QStringLiteral( "writePolyline: line too short layer=%1 lineStyleName=%2" ).arg( layer, lineStyleName ) );
@@ -3489,6 +3486,10 @@ void QgsDxfExport::writePolyline( const QgsPointSequence &line, const QString &l
34893486

34903487
if ( mForce2d || !line.at( 0 ).is3D() )
34913488
{
3489+
bool polygon = line[0] == line[ line.size() - 1 ];
3490+
if ( polygon )
3491+
--n;
3492+
34923493
writeGroup( 0, QStringLiteral( "LWPOLYLINE" ) );
34933494
writeHandle();
34943495
writeGroup( 8, layer );

0 commit comments

Comments
 (0)