15 std::vector<Point2d> vpts1{
22 std::vector<Point2d> vpts2{
35 poly2.translate(120,80);
36 poly1.translate(20,30);
37 poly2.rotate( Rotate::CCW,
Point2d(150, 150) );
40 for(
int i=0; i<nbim; i++ )
48 auto res = poly1.intersects(poly2);
49 auto ptInt = res.get();
50 for(
const auto&
pt: ptInt )
54 auto ppts = closest.getPoints();
58 im.drawText(
"MinDist=" + std::to_string( closest.getMinDist() ),
Point2d(20,20) );
60 poly1.translate( 10, 7 );
61 poly2.translate( -7, -7 );
63 auto c2 = poly2.centroid();
64 poly2 =
Homogr().addTranslation( -c2.getX(), -c2.getY() ).addRotation(10.*
M_PI/180.).addTranslation( c2.getX(), c2.getY() ) * poly2;
66 std::ostringstream oss;
67 oss <<
"showcase14_" << std::setfill(
'0') << std::setw(2) << i <<
".svg";
68 im.write( oss.str() );
Homogr_< HOMOG2D_INUMTYPE > Homogr
Default homography (3x3 matrix) type, uses double as numerical type.
Definition: homog2d.hpp:12382
void draw(Data &data)
Definition: precision_test_opencv.cpp:184
Segment_< HOMOG2D_INUMTYPE > Segment
Default segment type.
Definition: homog2d.hpp:12388
#define M_PI
Definition: homog2d.hpp:235
void draw(img::Image< img::SvgImage > &im, img::DrawParams dp=img::DrawParams()) const
SVG draw function.
Definition: homog2d.hpp:4414
Draw parameters, independent of back-end library.
Definition: homog2d.hpp:514
Point2d_< HOMOG2D_INUMTYPE > Point2d
Default point type, uses double as numerical type.
Definition: homog2d.hpp:12379
priv::ClosestPoints< PLT1, FPT1, PLT2, FPT2 > getClosestPoints(const base::PolylineBase< PLT1, FPT1 > &poly1, const base::PolylineBase< PLT2, FPT2 > &poly2)
Computes the closest points between two polylines (types can be different)
Definition: homog2d.hpp:10591
img::Image< img::SvgImage > im(300, 400)
DrawParams & setPointStyle(PtStyle ps)
Definition: homog2d.hpp:585
Opaque data structure, will hold the image type, depending on back-end library. This type is the one ...
Definition: homog2d.hpp:712
FRect_< HOMOG2D_INUMTYPE > getBB(const T &t)
Return Bounding Box of primitive or container holding primitives (free function)
Definition: homog2d.hpp:10312
DrawParams & setColor(uint8_t r, uint8_t g, uint8_t b)
Definition: homog2d.hpp:605
Polyline, will be instanciated either as OPolyline_ (open polyline) or CPolyline_.
Definition: homog2d.hpp:364
Point2d pt
Definition: homog2d_test.cpp:4034