Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 826633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:26:44+00:00 2026-05-15T03:26:44+00:00

If I have a QuadCurve like this ( + = node): + + \

  • 0

If I have a QuadCurve like this (+ = node):

+         +
 \      ./
   +--⁻⁻

And I fill it in Java 2D the result is something like this: (x = colored)

+xxxxxxxxx+
 \xxxxxx./
   +--⁻⁻

But I want to color the other side:

+         +
x\      ./x
xxx +--⁻⁻xx
xxxxxxxxxxx

This succeeds by drawing a rectangle around the curve in the color I want to color the other side and then fill the curve with the background color.

But this isn’t good enough to fill a convex rounded (based on QuadCurves) polygon. In case of some coordinates for the rectangles (as explained in the trick I used) overlap other pieces of the polygon. Here are two images (the green area is my polygon):

alt text http://img204.imageshack.us/img204/7823/convexpolygon.png alt text http://img708.imageshack.us/img708/3669/convexpolygon2.png

So, the question is simple: “How can I color a shape build of curves?”
But to the answer will not be simple I think…

Any advice would be VERY VERY appreciated.
Thanks in advance.

Maybe I’m going to make a bounty for this question if I don’t get an answer

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T03:26:45+00:00Added an answer on May 15, 2026 at 3:26 am

    Pick a point known to be inside the Polygon.

    Know the “boundary color” (in this case, black).

    recurrsiveFill(Pixel p, Color fill, Color bound) {
        p.setColor(fill);
        if(p.left.color  != bound && p.left.color != fill) 
            recurrsiveFill(p.left , fill, bound);
        if(p.right.color != bound && p.right.color != fill) 
            recurrsiveFill(p.right, fill, bound);
        if(p.up.color    != boun d&& p.up.color    != fill) 
            recurrsiveFill(p.up,    fill, bound);
        if(p.down.color  != bound && p.down.color  != fill) 
            recurrsiveFill(p.down,  fill, bound);
    }
    

    You can adapt this as necessary to suit your specific needs.

    This works for any fill for a completely bounded shape. You’ll also want to incorporate special conditions (edges of the picture, for example).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 523k
  • Answers 523k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you only need to preserve the structure and contents… May 16, 2026 at 9:45 pm
  • Editorial Team
    Editorial Team added an answer I have decided to take a different approach to this… May 16, 2026 at 9:45 pm
  • Editorial Team
    Editorial Team added an answer Identical results are impossible. The output depends not only on… May 16, 2026 at 9:45 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Have you seen library for flexible working with terminal(Unix like)? I want to implement
have such zend query: $select = $this->_table ->select() ->where('title LIKE ?', '%'.$searchWord.'%') ->where('description LIKE
I have this ASP.NET/SQLServer2005 website running on a production server (Win2003, QuadCore, 4GB). The
I have a quadcore processor and I would really like to take advantage of
I have a movieclip wich has a simple movement of a simple shape. This
Have a look at the menus on this page: http://www.pieterdedecker.be/labs/vspwpg/?page_id=96 They look okay in
have a table that dynamically generates text boxes in run time. I want to
I've been reading about Python's multiprocessing module . I still don't think I have
I have a SQL database that has the following table: Table: PhoneRecords -------------- ID(identity
I have a program that starts up and creates an in-memory data model and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.