submissions icon indicating copy to clipboard operation
submissions copied to clipboard

[Re] Curve-Fitting with Piecewise Parametric Cubics

Open danperazzo opened this issue 4 months ago • 32 comments

Original article: [Re] Curve-Fitting with Piecewise Parametric Cubics

PDF URL: https://github.com/danperazzo/plass_reproduction/blob/main/ReScience/article.pdf Metadata URL: https://github.com/danperazzo/plass_reproduction/blob/main/ReScience/metadata.yaml Code URL: https://github.com/danperazzo/plass_reproduction

Scientific domain: Computer Graphics Programming language: Python Suggested editor: Bruno Levy

danperazzo avatar Aug 12 '25 18:08 danperazzo

Thanks for the submission. I'll handle the editing process and assign reviewers soon.

rougier avatar Aug 19 '25 07:08 rougier

@BrunoLevy Could you review this submission?

rougier avatar Aug 19 '25 07:08 rougier

@HinTak Could you be interested in reviewing this replication of "Curve-Fitting with Piecewise Parametric Cubics"? (the review process is rather light since it is a replication). If you have questions, I'll be happy to answer.

rougier avatar Aug 19 '25 07:08 rougier

@danperazzo Don't hesitate to remind me if review is stalled.

rougier avatar Aug 19 '25 07:08 rougier

I'll do my best (I am already super late for several reviews)...

BrunoLevy avatar Aug 19 '25 07:08 BrunoLevy

@BrunoLevy Thanks you so much. The review for ReScience C is rather light because it is a replication (and the oroginal article is quite old)

rougier avatar Aug 19 '25 07:08 rougier

@rougier @BrunoLevy Any news about this submission? I'm one of the authors. Thanks.

lhf avatar Sep 11 '25 10:09 lhf

Not yet. @BrunoLevy any progress?

rougier avatar Sep 11 '25 10:09 rougier

@rossant Could make a review of this replication (review is ratherl light)?

rougier avatar Sep 11 '25 10:09 rougier

Sorry this has fallen through the cracks... I 'll have a look later today.

HinTak avatar Sep 11 '25 10:09 HinTak

@HinTak Thank you. @rossant Your review is not need anymore (yet)

rougier avatar Sep 11 '25 10:09 rougier

Thanks for some interesting reading. I am not sure how the review process works yet, so I'll just comment as I read the paper then the code as I go along.

My first comment (editorial) is "...meet at each knot have the same the tangent directions (not vectors!)." at top of page 2 should read "... have the same tangent[ial] directions..." . "...the same the..." sounds odd.

HinTak avatar Sep 11 '25 22:09 HinTak

I'll find the 83 paper and look at the code tomorrow.

Two interesting questions I like to ask would be: does it work well at recovering the original control points if the source contains cubic splines? Slight complication as the original itself might not be mathematically optimal (e.g. the convention of having control points at both the horizontal/vertical outer edge, for hinting purposes). The other question is, how well does it work against glyphs having a lot of straight edges and corners - e.g. a glyph from the Adobe Sans CJK fonts. That is a useful application but also controversial - the typical CJK typefaces have a minimum of ~3000 glyphs (and x10 is not uncommon), and font vendors don't take kindly to theft of copyright via curve fitting of bitmaps.

HinTak avatar Sep 11 '25 23:09 HinTak

@HinTak Thanks for your initial comments.

"...the same the..." is a typo; thanks for spotting this.

The method does not attempt to recover the original control points if the source contains cubic splines. It does not model design intentions and knows nothing about typography. On the other hand, it does recover about the same number of curves, which is somewhat surprising.

Figure 2d shows that the method recovers glyphs with straight edges and corners.

lhf avatar Sep 12 '25 10:09 lhf

@HinTak @rougier Any news about the review? Thanks.

lhf avatar Oct 04 '25 10:10 lhf

Argh, I shall get on with it soon. Sorry for the delay.

HinTak avatar Oct 04 '25 10:10 HinTak

@HinTak Thansk, the sooner, the better @BrunoLevy Any update on your review?

rougier avatar Oct 07 '25 07:10 rougier

I have given the code itself a try. Looks pretty cool. What I do I have to do in terms of review?

I would suggest one small change / improvement: I was checking what temp files it generates (with git status --ignored) and somewhat surprised to see outputs/S_bezier.txt. Then I checked that this is hardcoded in draw_single_image.py. I think I am confused by the S_ part specifically - when I am passing "C.txt" etc as input. I would suggest either derive the output name from the input e.g "basename-saved-bezier.txt", or, if that's too much work, just change it to a more generic "saved-bezier.txt" rather than "S_bezier.txt".

HinTak avatar Oct 07 '25 11:10 HinTak

You can find information for review at: https://rescience.github.io/edit/. The main criterion is whether authors manage to replicate the code (do they compare original vs new results) and then you can advise on the manuscript and code (as you already). Once satisfied with feedback/correction from authors, you can recommend for publication. This review can be only a few lines if you think the paper is already on good shape.

rougier avatar Oct 07 '25 11:10 rougier

I think I am generally quite happy for the paper to go forward, with just correcting that little typo/editorial change. As for the software, besides the little change I would suggest for the default output file name, I have a few more suggestions:

Going back to the paper, I see there is a regularization parameter Tau I can change. So I tried looking for it with -h. I think I see three issues there:

  1. There is a default value for epsilon, and it seems to be 2. It would be nice to state that like so --max-distance epsilon Epsilon value for the RDP algorithm (default 2)
  2. --disable_rdp does not take an argument?
  3. I think the regularization parameter Tau is what you called in -h : --tolerance Tolerance Tolerance for the dynamic programming algorithm . If that's the case, you probably should fix the help message to look a bit like --regularization-parameter Tau Tolerance for the dynamic programming algorithm.

Or maybe I am a bit confused by what the parameters are called in -h vs what's in the paper?

Lastly, more on the software - I see that you have non-English comments (and also non-ascii comments, for that reason). Those two are somewhat frown upon - on reaching the widest audience (English still being the main medium of global communication), and also potential problems of the code passing through processing that expect plain (ascii, 7-bit) text.

HinTak avatar Oct 07 '25 22:10 HinTak

I see it would probably be good to state the default for window_size and num_steps too. Sorry for nit-picking a bit : if there is a default value which is not obvious ( e.g. --scale 1, --initial-value 0), it would be nice to see it documented in the -h message.

I think that's all I have to say. Thanks for showing me an interesting piece of work.

HinTak avatar Oct 07 '25 22:10 HinTak

@HinTak Thank you very much for your comments. We'll make the changes in the text and in the code as suggested. We'll post a note here where it's done.

lhf avatar Oct 08 '25 10:10 lhf

@HinTak We have revised the paper. The revised version is available at https://github.com/danperazzo/plass_reproduction/blob/main/ReScience/article.pdf

Besides the typo you have found, we have fixed a few sentences to make the text clearer.

The original text is at https://github.com/danperazzo/plass_reproduction/blob/main/ReScience/submitted.pdf

Thanks for you comments.

lhf avatar Oct 08 '25 16:10 lhf

Hello everyone, I just refactored the code to address the concerns raised by @HinTak:

  1. Updated the descriptions of the argparse
  2. Changed the name of the tau_tolerance parameter
  3. Changed the name of the defaul output file to outputs/saved_bezier.txt, as requested
  4. Regarding --disable_rdp, transformed it into a store_true argument for the argparser

danperazzo avatar Oct 11 '25 17:10 danperazzo

@HinTak @BrunoLevy @rougier We have now revised the paper and the code to address your suggestions. We hope that it's all good now. Thank you for your suggestions and for handling our submission.

lhf avatar Oct 11 '25 17:10 lhf

@HinTak @BrunoLevy @rougier Any further suggestions or recommendations for our submission? Thanks.

lhf avatar Oct 16 '25 13:10 lhf

I haven't checked - I believe you have addressed the comments / suggestions if you say so.

HinTak avatar Oct 16 '25 20:10 HinTak

@HinTak Many thanks. Now waiting for @BrunoLevy review.

rougier avatar Oct 17 '25 12:10 rougier

@rougier @BrunoLevy Any further news about this submission? Thanks.

lhf avatar Nov 01 '25 11:11 lhf

@lhf I've sent email to @BrunoLevy. Let's wait a few more days and if no news, I'll do the review. Sorry for the delay.

rougier avatar Nov 02 '25 15:11 rougier