By repeatedly throwing a needle on a striped pattern: [1]. Obviously, you will need an infinite number of throws for an infinitely precise measurement of pi.
That would affect only a few borderline trials and would average out with subsequent throws. It would be much more worrisome that the length of a needle or the width of a stripe is not infinitely precise, that would consistently affect all the trials.
[1] https://en.wikipedia.org/wiki/Buffon%27s_needle_problem