Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Best way divide a circle

0 views
Skip to first unread message

Emma Beane

unread,
Nov 5, 2008, 3:20:46 PM11/5/08
to
In have a white circle on a black background which I need to divide into 8 equal pie selections to post pictures into...whats the best way to do this please? Thanks so much
Emma

Jim_J...@adobeforums.com

unread,
Nov 5, 2008, 3:44:25 PM11/5/08
to
It is easy to chop anything vertically and horizontally. Once you do that, rotate all the art 45 degrees and chop again.

I'd do this in a page layout application though so I can't imagine which of the 20 ways to do this in Photoshop would be most ideal.

J_Ma...@adobeforums.com

unread,
Nov 5, 2008, 3:58:59 PM11/5/08
to
If the placement of the circle is not critical, and you can make a new one on a blank (transparent) layer, make one, and skip to step 2.

1) Double-click the background layer (white circle on black background) and name it layer 0. Then double click to the right of the name (layer 0). Up should pop the blending dialog. Pull the black "blend if" slider at the bottom of the dialog under "this layer" to somewhere near the middle of the slider bar (you should see the black bg vanish). Now with the alt key pressed, break the black slider apart the two sections apart. Where they end up is not critical, just make them separate. Hit ok. Then, use the key command ctrl-j to dupe the layer. Then hit ctrl-e to merge it down. You should now have your white circle (with a black fringe) over transparent checkerboard.

2) Make sure View menu... snap is checked. Now draw guides that bound the circle (top bottom left right) and put two intersecting in the center of the circle. These guides should "snap" into place.

3) With the polygon lasso tool, you should now be able to draw triangles that are precisely 1/8 of the circle. Draw one triangle, then with ctrl-alt-shift held down, click on the layer icon in the layers palette (you should see an x in a box next to your cursor as you hover over the icon). This should clip your selection. Now just open the pic you like, select all copy and go back to your new circle doc and edit... paste into. Repeat for all 8 pie pieces.

4) Make a new layer, move it underneath your circle layer and fill it with black.

<http://www.pixentral.com/show.php?picture=1tHMruqWn2okMPQyxftxgFTc3tgpM0>

<http://www.pixentral.com/show.php?picture=1qUbgUBPqoSQEOLcZIbU945yIXmSL>

Phosąfour dots

unread,
Nov 5, 2008, 4:33:21 PM11/5/08
to
The tricky part is making a dead-accurate 360/x pie wedge. I'd do it in illustrator.

But I'd want to do it with a vector shape, however I get there, and use the shape as a mask.

After that, then, and by copying and rotating I'd create a separate layer + mask for each image. That way each image could be moved and resized independently from the others, retaining the pie-shaped outline.

Similar to this mask-layer example I showed somebody last year, only with vector masks instead of letters.

(Click image for full size version)
<http://www.pixentral.com/show.php?picture=1L0he0TcEqWbfITy3Q2HQI18YgdGZ>

Emma Beane

unread,
Nov 6, 2008, 3:21:05 PM11/6/08
to
Thank-you so much, it did the trick wonderfully
Emma

George...@adobeforums.com

unread,
Nov 6, 2008, 8:29:45 PM11/6/08
to
Sorry for the broken record, but I can't resist once again advocating Filter Factory (FF) for tasks such as this.

To divide a circle into 8 equal pie sections, select the circle and put it on a separate layer via CTRL-J. With that layer highlighted invoke FF and enter the following in the R G and B boxes:

R: d%128==0?0:255

G: 255

B: 255

FF splits the circle into 1024 angles. d is the angle

The R code says "If the angle divided by 128 leaves zero remainder, set R =0, else set R=255.

Thus, where d is a multiple of 128, the color is cyan (blue and green). Elsewhere it is white.

What could be cleaner?

Phosąfour dots

unread,
Nov 6, 2008, 9:14:39 PM11/6/08
to
Despite Filter Factory's agility (or the even more versatile Filter Foundry <http://www.telegraphics.com.au/svn/filterfoundry/trunk/dist/README.html>) I'd still want to do it with vector masks.

But that's just me, and my famous pickiness.

:)

George...@adobeforums.com

unread,
Nov 7, 2008, 12:24:28 AM11/7/08
to
Phos

Correct me if I'm not following you. I think you are referring to what you do with the eight pie sections after they have been formed, and using them as masks is one way to go. How you delineate them is one thing, and how you make masks of them and deploy the masks is another. Using FF to form the pie sections to begin with and then selecting each piece of pie, in turn, as a mask seems as good a way to go as any.

George

Phosąfour dots

unread,
Nov 7, 2008, 12:37:25 AM11/7/08
to
I'm saying I'd create the pie wedges as vector objects, and keep and use them as vectors so they'd re-render as cleanly as possible if I decided I wanted to move, rotate or resize them. Once you've created a pixel-based selection or mask, you're kind of limited in what you can do with them and still maintain original quality.

I've learned the hard way too many times about trying to tweak pixel-based objects and not having them meet the quality standards I enjoy, so I do what I can to use vectors wherever possible.

George...@adobeforums.com

unread,
Nov 7, 2008, 1:38:25 AM11/7/08
to
Can you create a vectorized circular section in PS?

Phosąfour dots

unread,
Nov 7, 2008, 3:24:24 AM11/7/08
to
Sure, George, but it's kind of a PITA if you're used to working with Illustrator's vector tools and functions.

(For me, anyway)

George...@adobeforums.com

unread,
Nov 7, 2008, 12:09:49 PM11/7/08
to
Ok, Phos, you rascal. I should have asked "How?" not "Can you?"

Gernot_...@adobeforums.com

unread,
Nov 7, 2008, 12:19:52 PM11/7/08
to
Creating a template for N circle segments
is fairly simple. Edit the code below, for
instance by N=8, and save as EPS.
Open by PhS, AI or ID. Don't worry about
the small file size ...

Best regards --Gernot Hoffmann

%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 800 800
%%Creator: Gernot Hoffmann
%%Title: N Circle Segment
%%CreationDate: November 07/2008

/mm {2.834646 mul} def
/x 150 mm def
/s 100 mm def
x x translate
s s scale % 1 --> 100mm

0.25 mm s div setlinewidth
0 0 1 setrgbcolor

0 0 1 0 360 arc
stroke

1 0 0 setrgbcolor

/N 7 def % N segments
/da 360 N div def
/an 0 def
1 1 N
{pop
0 0 moveto
an cos an sin lineto
/an an da add def
} for
stroke

showpage

Phosąfour dots

unread,
Nov 7, 2008, 1:01:01 PM11/7/08
to
Gernot...

When editing that code, do we replace ALL instances of 'N' with the integer of our choosing?

Gernot_...@adobeforums.com

unread,
Nov 7, 2008, 1:16:05 PM11/7/08
to
Here it's simply a sequential signal flow.
N is is defined once by e.g
/N 8 def

As long as it is not re-defined, N is 8.

I can imagine many applications, where such
a simple EPS is useful, for instance for grids.

Best regards --Gernot Hoffmann

Phosąfour dots

unread,
Nov 7, 2008, 1:52:02 PM11/7/08
to
I agree, Gernot, it can be useful, but for most of us wrapping it all in a nice GUI is what we want, and serves better for convenience.

My brain can learn and understand code, but my guts don't like it much!

: )

Gernot_...@adobeforums.com

unread,
Nov 7, 2008, 2:30:19 PM11/7/08
to
Phos,

put it on the wishlist. AI doesn't know something simple
like a circle segment, though it's a basic PostScript
geometry element.
<http://www.adobeforums.com/webx/.59b6577c/29>

Sometimes I'm thinking that plain PostScript is more
powerful than the AI GUI (in limits, of course),
and not to talk about the idiotic blowing up of
simple PostScript graphics by AI (5kB PS --> 100kB AI).

Best regards --Gernot Hoffmann

Phosąfour dots

unread,
Nov 7, 2008, 2:42:30 PM11/7/08
to

"...AI doesn't know something simple like a circle segment..."

That's one of the reasons I really enjoy HotDoor's CadTool plugin. I don't use it all the time, but when I need it, I need it. I really ought to dig in and learn Canvas better, but the different usage conventions between Canvas and AI always bog me down.

"Sometimes I'm thinking that plain PostScript is more powerful than the

AI GUI..."

Again, I'm sure you're right, but wrapping the code in a click-friendly GUI is FAR more attractive to 99.8% of AI users...even the hard-core, long-time users. And it's quicker to use, as well.

"...and not to talk about the idiotic blowing up of simple PostScript


graphics by AI (5kB PS --> 100kB AI)."

And so we siiiiiiggggghhhh, and live with it. Short of finding another mythical vector application that has all the capability and none of the bloat, what else can we do?

George...@adobeforums.com

unread,
Nov 7, 2008, 10:28:20 PM11/7/08
to
Gernot,

My word processor doesn't have EPS as a save option. Photoshop DOES. So I enter your code as text in a PS file and save it using EPS format. When I open the saved EPS file I get an image of the rasterized text. Great! I was expecting to get an eight-segmented circle. Clearly I need more explicit help.

George

J_Ma...@adobeforums.com

unread,
Nov 7, 2008, 10:46:45 PM11/7/08
to
Save as text with a .ps/.eps extension. Notepad should.

<http://en.wikipedia.org/wiki/List_of_text_editors>

Phosąfour dots

unread,
Nov 7, 2008, 11:19:38 PM11/7/08
to
I copied Gernot's script, pasted it into a new BBEdit document, made no changes, saved as "GerneotPie.eps" and dragged the document from my desktop onto the PS CS2 icon in the dock.

I was asked to make a choices for rasterizing; I accepted the default values— 11.111 inches for both width & height, at 72 ppi. RGB, antialiased, constrained proportions.

I added a Layer beneath the generated image and filled it with white.

Voilà!

<http://www.pixentral.com/show.php?picture=1I1EDYuszkaKZdeTV0xbYzu5Ilxos>

Phosąfour dots

unread,
Nov 7, 2008, 11:23:40 PM11/7/08
to
Sooo, OK, that's cool and all, but it still doesn't easily address the original question. Sure, we could make a selection of the interior of one of the wedges耀ay with the Tragic Wand, for example傭ut it's still going to have to start out as a raster-based image, unless the wedge is traced with the Pen Tool. That, then puts us back to square one, where we might as well start out creating the vector shape manually.

George...@adobeforums.com

unread,
Nov 8, 2008, 12:14:33 AM11/8/08
to
I used Wordpad. Although it doesn't list EPS as a specific format, just adding .eps to the doc name was sufficient. It opened in PS as a segmented circle. Thanks. Saving as EPS in PS doesn't save as a text file.

So then, back to you Phos---just like a TV sportscaster---Phos is going to tell us how he manages to create the vector piece of pie in PS, however arduous.

BTW, working with a rasterized shape created by Gernot's code isn't all that bad because you just change parameters for the size you want rather than suffering degradation from trying to go one-size-fits-all.

Phosąfour dots

unread,
Nov 8, 2008, 12:45:16 AM11/8/08
to
Just for fun, about 76KB:

<http://home.comcast.net/~phosphor-digital/bbs/8vectorwedgemasks.psd.zip>

Siiiggghhh...explaining how I did this is a daunting task, because I've just done it twice, with some different steps each time. It's really not difficult, or super time consuming. It's just fiddly.

Both times, no matter how careful I was with anchor point placement, it seems I always end up with wedges that are just slightly under 45°. This leaves a bit of white space between adjacent wedges. I suppose that could be adjusted for, but it would take some experimentation.

That's why I like the precision of Illustrator for this type of work.

J_Ma...@adobeforums.com

unread,
Nov 8, 2008, 1:01:49 AM11/8/08
to
For precision, but nasty too...draw a line tool radius vertically. Duplicate and rotate by x degrees. Make sure the rotate proxy is set to the bottom right. Then, draw a guide that snaps to the bottom right corner of the rotated line (horiz. guide). Now draw a guide vertical against the right side of the original line. Now you have your center origin and the right side of the rotated line is your right side of the pie piece, with the vert guide being the left side. Kill the extraneous points and complete the triangle. Now, using the circle shape tool in intersect mode, draw a circle from the origin (click-drag-shift-alt to have it originate from the origin). Now you have a pie piece. You can select the triangle only and rotate with the lower-left proxy on a duplicated shape for pie two.

I'm thinking the third way will be extra pretty.

I get white space too, anti-aliasing in the vector render? The horizontal paths are dead on, but still make white space.

Phosąfour dots

unread,
Nov 8, 2008, 1:19:31 AM11/8/08
to
On the other hand, creating the wedges in AI, and pasting them into PS is much more accurate. And easier. And quicker.

<http://home.comcast.net/~phosphor-digital/bbs/8AIvectorwedges.psd.zip>

Phosąfour dots

unread,
Nov 10, 2008, 11:08:23 AM11/10/08
to
I don't usually do this, but I'm floating this thread because it addresses a couple things that don't get a whole lot of attention. There might be some whose contributions would be most welcome, but who may never see it if the thread dumps off the front page of the index.

George...@adobeforums.com

unread,
Nov 10, 2008, 5:47:31 PM11/10/08
to
Phos

Wow! Although you haven't revealed HOW, you have sure enough cooked up a most interesting pie. I have not worked with shape layers or vector masks, so this is adventureland for me. Your product should serve well in exploring them. There's much more there than meets the eye. Thanks for the road map.

George

Phosąfour dots

unread,
Nov 10, 2008, 7:25:56 PM11/10/08
to
It's not that I want to keep it a secret, George, it's just that in order to write it up I have to go through it a bunch of times, make sure I've discovered the easiest, most translateable way to do it, then write it out without missing any details or steps.

There's a little thing I did with the Command + Option + Shift + T (CTRL + ALT + Shft + T) "Copy and repeat transform" function that was putting each new rotated wedge on a new layer...I did it once, but I can't figure out how I did it again. I can still do it, but for some reason there's another cumbersome little step that I don't think I had to do before.

Let me play for a little while. I'll re-float the thread again when I have something new to add.

Phosąfour dots

unread,
Nov 11, 2008, 4:47:02 PM11/11/08
to
Dang, and grrr...

"Spent several hours yesterday and last night into the wee hours setting up a Photoshop tutorial in prep for screen motion cap recording..." <http://www.adobeforums.com/webx?14@@.1de5f905.3c063549/945>

0 new messages