Menu

#10 Inverse Function Question

1.0
closed
nobody
None
2016-06-20
2016-06-07
Anonymous
No

Hi Timo,

we use JavaScript Clipper for our painting app PaintSupreme which is right now in early alpha at www.paintsupreme.com.

The whole selection tool is based on Clipper. Now a question.

If I have a project like 640x480 with a selection path which is inside that space but can also be partially outside the canvas, how would I compute the inverse path of the selection path relative to the 640x480 canvas ?

Thanks for any help and thanks alot for JavaScript Clipper. It helps us a lot with PaintSupreme.

Markus

Related

Tickets: #10

Discussion

  • Timo Kähkönen

    Timo Kähkönen - 2016-06-07

    Hi, Markus!

    Hard to say without any example image. Could you make an image about the situation?

     
    • Ernesto Civello

      Ernesto Civello - 2016-06-07

      Hi Markus, accordin to me you can reverse your path (via ReversePath
      command) and call AddPath with the path of your canvas.

      So, if your path is A and your rectangle (640,480) is B, you have to compute

      addPath(reverse(A),B)

      Bye bye.

      Il giorno mar 7 giu 2016 alle ore 15:21 Timo timo23414@users.sf.net ha
      scritto:

      Hi, Markus!

      Hard to say without any example image. Could you make an image about the
      situation?


      Status: open
      Milestone: 1.0
      Created: Tue Jun 07, 2016 08:50 AM UTC by Anonymous
      Last Updated: Tue Jun 07, 2016 08:50 AM UTC
      Owner: nobody

      Hi Timo,

      we use JavaScript Clipper for our painting app PaintSupreme which is right
      now in early alpha at www.paintsupreme.com.

      The whole selection tool is based on Clipper. Now a question.

      If I have a project like 640x480 with a selection path which is inside
      that space but can also be partially outside the canvas, how would I
      compute the inverse path of the selection path relative to the 640x480
      canvas ?

      Thanks for any help and thanks alot for JavaScript Clipper. It helps us a
      lot with PaintSupreme.

      Markus

      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/jsclipper/tickets/10/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Tickets: #10

  • Markus Moenig

    Markus Moenig - 2016-06-07

    Hi Timo,

    attached is an image of a selection in the canvas. The inverse would be that everything INSIDE the canvas would be in the opposite state.

    Ernesto, thanks for the tip, will try it out!

    Best,

    Markus

     
  • Timo Kähkönen

    Timo Kähkönen - 2016-06-07

    It is the DIFFERENCE operation so that the SUBJECT is the canvas path (eg 640x480) and the CLIP is the selection path (or UNION of selection paths).

    You can experiment these in:
    http://jsclipper.sourceforge.net/6.1.3.2/main_demo.html

    SUBJECT: M415,283.89 L85,283.89 L85,66.09 L415,66.09Z

    CLIP: M74.5,115.5 L111,111 L108,7 L385,6 L380,83 L480,95 L479,156 L191,143 L184,341 L127,339 L118,148 L12,146 L11.5,113.5Z

    You can add these paths pressing Polygons - Custom and pasting those into Subj and Clip fields and press Save as New. Then press DIFFERENCE in the Clip type (operation) -field.

     
  • Timo Kähkönen

    Timo Kähkönen - 2016-06-07

    Or if you need also those outside-areas, use XOR.

     
  • Markus Moenig

    Markus Moenig - 2016-06-08

    Thanks a lot for your (fast) help! Yes, the difference operator works just great for this. Great support!

     
  • Timo Kähkönen

    Timo Kähkönen - 2016-06-20
    • status: open --> closed
     

Log in to post a comment.