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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user