KiCad PCB EDA Suite
Loading...
Searching...
No Matches
ITEM_REALIGNER_BASE Class Referenceabstract

This is a general class that takes two lists of points, and finds the best fit translation and rotation to align them. More...

#include <item_realignment.h>

Inheritance diagram for ITEM_REALIGNER_BASE:
ORTHO_ITEM_REALIGNER

Classes

struct  TRANSFORM
 

Public Member Functions

virtual std::optional< TRANSFORMGetTransform (const std::vector< VECTOR2I > &aPtsA, const std::vector< VECTOR2I > &aPtsB) const =0
 Compute the best fit transform to align the two sets of points.
 

Detailed Description

This is a general class that takes two lists of points, and finds the best fit translation and rotation to align them.

For example, this can be used to compensate for a library component being moved and/or rotated.

There are two parts to this process:

  • Identify matching points in the "old" and "new" states
  • Compute a transform that best aligns the two sets of points

This interface is the interface only for the second part - identifying matching points is a domain-specific problem that the caller will need to handle.

Definition at line 43 of file item_realignment.h.

Member Function Documentation

◆ GetTransform()

virtual std::optional< TRANSFORM > ITEM_REALIGNER_BASE::GetTransform ( const std::vector< VECTOR2I > & aPtsA,
const std::vector< VECTOR2I > & aPtsB ) const
pure virtual

Compute the best fit transform to align the two sets of points.

The point lists have to be the same length.

Parameters
aPtsAThe "old" points
aPtsBThe "new" points
Returns
The transform to apply to the NEW points to best align them to the old points. Rotations are to be applied around the origin.

Implemented in ORTHO_ITEM_REALIGNER.


The documentation for this class was generated from the following file: