Large rework of BEZIER_POLY

Add direct handling of quadratic beziers to save compute time and number
of points.  Update cubic interpolation to reduce number of points
generated for a given smoothness

Cache data on open and used cached data to avoid multiple re-calcs

Remove minimum line length and number of segments and replace with
standard max error level.  Allows us to specify the tolerance of bezier
interpolation
This commit is contained in:
Seth Hillbrand
2024-06-18 17:55:41 -07:00
parent 0d2c4c91fd
commit bcf6b620a8
31 changed files with 698 additions and 221 deletions
+2 -1
View File
@@ -267,6 +267,7 @@ bool PCB_SHAPE::Deserialize( const google::protobuf::Any &aContainer )
SetBezierC1( kiapi::common::UnpackVector2( msg.bezier().control1() ) );
SetBezierC2( kiapi::common::UnpackVector2( msg.bezier().control2() ) );
SetEnd( kiapi::common::UnpackVector2( msg.bezier().end() ) );
RebuildBezierToSegmentsPointsList( ARC_HIGH_DEF );
}
return true;
@@ -568,7 +569,7 @@ void PCB_SHAPE::Mirror( const VECTOR2I& aCentre, bool aMirrorAroundXAxis )
std::swap( m_start, m_end );
if( GetShape() == SHAPE_T::BEZIER )
RebuildBezierToSegmentsPointsList( GetWidth() );
RebuildBezierToSegmentsPointsList( ARC_HIGH_DEF );
break;