diff --git a/pcbnew/dialogs/dialog_pad_basicshapes_properties.cpp b/pcbnew/dialogs/dialog_pad_basicshapes_properties.cpp index bfd228aa27..b431efd406 100644 --- a/pcbnew/dialogs/dialog_pad_basicshapes_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_basicshapes_properties.cpp @@ -381,7 +381,7 @@ bool DIALOG_PAD_PRIMITIVE_POLY_PROPS::doValidate( bool aRemoveRedundantCorners ) if( valid && polyline.SelfIntersecting() ) { - m_warningText->SetLabel( _( "Self-intersecting polygons are not allowed" ) ); + m_warningText->SetLabel( _( "Polygon can not be self-intersecting" ) ); valid = false; } diff --git a/pcbnew/tools/pcb_point_editor.cpp b/pcbnew/tools/pcb_point_editor.cpp index 8af462d0fa..6a1e431f32 100644 --- a/pcbnew/tools/pcb_point_editor.cpp +++ b/pcbnew/tools/pcb_point_editor.cpp @@ -624,29 +624,6 @@ int PCB_POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent ) getViewControls()->SetAutoPan( false ); setAltConstraint( false ); - if( item->IsType( { PCB_ZONE_T, PCB_FP_ZONE_T } ) ) - { - SHAPE_POLY_SET* outline = static_cast(item)->Outline(); - - outline->Simplify( SHAPE_POLY_SET::PM_FAST ); - - for( int ii = outline->OutlineCount(); ii > 1; --ii ) - outline->DeletePolygon( ii - 1 ); - - updateItem(); - } - else if( item->IsType( { PCB_SHAPE_LOCATE_POLY_T } ) ) - { - SHAPE_POLY_SET& outline = static_cast( item )->GetPolyShape(); - - outline.Simplify( SHAPE_POLY_SET::PM_FAST ); - - for( int ii = outline.OutlineCount(); ii > 1; --ii ) - outline.DeletePolygon( ii - 1 ); - - updateItem(); - } - commit.Push( _( "Drag a corner" ) ); inDrag = false; frame()->UndoRedoBlock( false ); @@ -1692,7 +1669,7 @@ bool PCB_POINT_EDITOR::validatePolygon( SHAPE_POLY_SET& aPoly ) const { m_statusPopup.reset( new STATUS_TEXT_POPUP( getEditFrame() ) ); m_statusPopup->SetTextColor( wxColour( 255, 0, 0 ) ); - m_statusPopup->SetText( _( "Self-intersecting polygons are not allowed" ) ); + m_statusPopup->SetText( _( "Self-intersecting polygons are not allowed." ) ); } if( valid ) @@ -2428,17 +2405,6 @@ int PCB_POINT_EDITOR::removeCorner( const TOOL_EVENT& aEvent ) setEditedPoint( nullptr ); - // Do not allow self-intersecting polygons - polygon->Simplify( SHAPE_POLY_SET::PM_FAST ); - - if( polygon->OutlineCount() > 1 ) - { - for( int ii = polygon->OutlineCount(); ii > 1; --ii ) - polygon->DeletePolygon( ii ); - - updateItem(); - } - commit.Push( _( "Remove a zone/polygon corner" ) ); // Refresh zone hatching diff --git a/pcbnew/tools/zone_create_helper.cpp b/pcbnew/tools/zone_create_helper.cpp index c935322088..e49aca463f 100644 --- a/pcbnew/tools/zone_create_helper.cpp +++ b/pcbnew/tools/zone_create_helper.cpp @@ -355,15 +355,9 @@ void ZONE_CREATE_HELPER::OnComplete( const POLYGON_GEOM_MANAGER& aMgr ) } outline->Outline( 0 ).SetClosed( true ); + outline->RemoveNullSegments(); outline->Simplify( SHAPE_POLY_SET::PM_FAST ); - // Do not allow self-intersecting polygons - if( outline->OutlineCount() > 1 ) - { - for( int ii = outline->OutlineCount(); ii > 1; --ii ) - outline->DeletePolygon( ii ); - } - // hand the zone over to the committer commitZone( std::move( m_zone ) ); m_zone = nullptr;