Compare commits

...

5 Commits

Author SHA1 Message Date
jean-pierre charras 2758acfd42 Fix compatibility with some old V4 schematic files.
From master branch, commit #bfe59581
2021-12-01 13:45:05 +01:00
jean-pierre charras 54c3031d74 Zone fill: When using the fillet outline option, in some cases the shape is strange.
Due to some bug in Fillet() incorrect zone outline happens in (rare) polygon shapes.
So clip it with the initial polygon (aSmoothedPoly must be contained in m_Poly)
Fixes #9692
https://gitlab.com/kicad/code/kicad/issues/9692
2021-11-19 13:55:05 +01:00
Christoph Moench-Tegeder 9a9c7856b3 Adapt OCE 3D plugin to OpenCascade 7.6.0 (for KiCad 5.1)
In line with
https://dev.opencascade.org/doc/overview/html/occt__upgrade.html#upgrade_occt760_poly
the Poly_Triangulation does not provide direct access to the internal
arrays anymore - use the accessor functions instead.
To keep changes minimal, switch only builds with a new (7.6+)
OpenCascade to the new API and keep everything else the same.

Related: !1013
2021-11-17 23:41:56 +01:00
Wayne Stambaugh 401b2fb524 Fix broken search stack behavior.
The overload of wxFilePath::FindValidPath() broke the normal behavior
when the file searched for existed in the current working directory.
This was causing the initial library table file to be copied from the
current working directory instead of from the list of search paths.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9599

(cherry picked from commit f4b97eca63)
2021-11-13 08:43:25 -05:00
Wayne Stambaugh 0a0a2da680 Begin version 5.1.13 development. 2021-11-04 17:24:40 -04:00
5 changed files with 25 additions and 15 deletions
+1 -1
View File
@@ -35,4 +35,4 @@
# be set after each version tag is added to the git repo. This will
# give developers a reasonable idea where which branch was used to build
# KiCad.
set( KICAD_VERSION "5.1.12" )
set( KICAD_VERSION "5.1.12-unknown" )
+6 -2
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2016 CERN
* Copyright (C) 2016-2019 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* @author Wayne Stambaugh <stambaughw@gmail.com>
*
@@ -1112,9 +1112,13 @@ SCH_BITMAP* SCH_LEGACY_PLUGIN::loadBitmap( FILE_LINE_READER& aReader )
// Read PNG data, stored in hexadecimal,
// each byte = 2 hexadecimal digits and a space between 2 bytes
// and put it in memory stream buffer
// Note:
// Some old files created by the V4 schematic versions have a extra
// "$EndBitmap" at the end of the hexadecimal data. (Probably due to
// a bug). So discard it
int len = strlen( line );
for( ; len > 0 && !isspace( *line ); len -= 3, line += 3 )
for( ; len > 0 && !isspace( *line ) && '$' != *line; len -= 3, line += 3 )
{
int value = 0;
+1 -12
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014 CERN
* Copyright (C) 1992-2014 KiCad Developers, see CHANGELOG.TXT for contributors.
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
* This program is free software; you can redistribute it and/or
@@ -70,17 +70,6 @@ public:
wxString FilenameWithRelativePathInSearchList(
const wxString& aFullFilename, const wxString& aBaseDir );
wxString FindValidPath( const wxString& aFileName ) const
{
#if 1 // might not be needed
if( wxFileName::FileExists( aFileName ) )
return aFileName;
else
#endif
return wxPathList::FindValidPath( aFileName );
}
/**
* Function AddPaths
* insert or append path(s)
+5
View File
@@ -1307,6 +1307,11 @@ bool ZONE_CONTAINER::BuildSmoothedPoly( SHAPE_POLY_SET& aSmoothedPoly ) const
aSmoothedPoly = m_Poly->Fillet( m_cornerRadius, ARC_HIGH_DEF );
else
aSmoothedPoly = m_Poly->Fillet( m_cornerRadius, ARC_LOW_DEF );
// In some cases the resulting polygon is strange... due to some bug in Fillet()
// that happens in (rare) polygon shapes. So clip it with the
// initial polygon (in all cases aSmoothedPoly must be contained by m_Poly)
aSmoothedPoly.BooleanIntersection( *m_Poly, SHAPE_POLY_SET::PM_FAST );
break;
default:
+12
View File
@@ -71,6 +71,8 @@
#include <TDF_LabelSequence.hxx>
#include <TDF_ChildIterator.hxx>
#include <Standard_Version.hxx>
#include "plugins/3dapi/ifsg_all.h"
// log mask for wxLogTrace
@@ -865,8 +867,10 @@ bool processFace( const TopoDS_Face& face, DATA& data, SGNODE* parent,
else
S3D::AddSGNodeRef( vshape.GetRawPtr(), ocolor );
#if OCC_VERSION_HEX < 0x070600
const TColgp_Array1OfPnt& arrPolyNodes = triangulation->Nodes();
const Poly_Array1OfTriangle& arrTriangles = triangulation->Triangles();
#endif
std::vector< SGPOINT > vertices;
std::vector< int > indices;
@@ -875,14 +879,22 @@ bool processFace( const TopoDS_Face& face, DATA& data, SGNODE* parent,
for(int i = 1; i <= triangulation->NbNodes(); i++)
{
#if OCC_VERSION_HEX < 0x070600
gp_XYZ v( arrPolyNodes(i).Coord() );
#else
gp_XYZ v( triangulation->Node(i).Coord() );
#endif
vertices.push_back( SGPOINT( v.X(), v.Y(), v.Z() ) );
}
for(int i = 1; i <= triangulation->NbTriangles(); i++)
{
int a, b, c;
#if OCC_VERSION_HEX < 0x070600
arrTriangles( i ).Get( a, b, c );
#else
triangulation->Triangle(i).Get(a, b, c);
#endif
a--;
if( reverse )