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

  • SEARCH
  • Home
  • 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 6814225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:39:50+00:00 2026-05-26T20:39:50+00:00

As the title states. Is this possible? Edit: When i say doughnut I mean

  • 0

As the title states. Is this possible?

Edit: When i say doughnut I mean a top, 2D view

Is the only option to draw a segment of a circle, then draw a segment of a smaller circle with the same origin and smaller radius over the top, with the colour of the background? That would be crap if so 🙁

  • 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-26T20:39:51+00:00Added an answer on May 26, 2026 at 8:39 pm

    You do it by making a single path with two arcs.

    You draw one circle clockwise, then draw a second circle going counter-clockwise. I won’t go into the detail of it, but the way paths are constructed knows to take this as a reason to un-fill that part of the path. For more detail of what its doing you can this wiki article.

    The same would work if you were drawing a “framed” rectangle. You draw a box one way (clockwise), then draw the inner box the other way (counter-clockwise) to get the effect.

    Here’s the code for a doughnut:

    var can = document.getElementById('canvas1');
    var ctx = can.getContext('2d');
    
    // Pay attention to my last argument!
    //ctx.arc(x,y,radius,startAngle,endAngle, anticlockwise);  
    
    ctx.beginPath()
    ctx.arc(100,100,100,0,Math.PI*2, false); // outer (filled)
    ctx.arc(100,100,55,0,Math.PI*2, true); // inner (unfills it)
    ctx.fill();
    

    Example:

    http://jsfiddle.net/Hnw6a/

    Drawing only a “segment” of it can be done by making the path smaller (you might need to use beziers instead of arc), or by using a clipping region. It really depends on how exactly you want a “segment”

    Here’s one example: http://jsfiddle.net/Hnw6a/8/

    // half doughnut
    ctx.beginPath()
    ctx.arc(100,100,100,0,Math.PI, false); // outer (filled)
    ctx.arc(100,100,55,Math.PI,Math.PI*2, true); // outer (unfills it)
    ctx.fill();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As per the title, is this possible? By tri-state, I mean the parent node
The title of the question pretty much states the problem. Is it possible?
As the title states, I'm wondering if it's possible to selectively choose tables that
As the title states... Is it possible to purchase Visual Studio 2010 Premium Edition
Say, for example, I was wanting to edit the title for the highlighted state,
As the title states, I would like to declare an indexer object this[int index]
Just as the title states, is it at all possible to place the ellipsis
(I hope this is a valid question) As I stated in my title, I'm
I have this sql query: SELECT S.SEARCH, S.STATUS, C.TITLE AS CategoryName, E.SEARCH_ENGINES AS Engine,
As the title states, how expensive are Python dictionaries to handle? Creation, insertion, updating,

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.