Page 1 of 2
divide vector object
Posted: Sat Jul 23, 2011 11:13 am
by capndreamer
Hi All,
Newbie here. I am just starting out with AS8. I wanted to know if there is a way to divide a single vector object into multiple parts? Example: Split a circle into 12 equal pie shaped parts. I can't find any info in the manual.
Thank you!
Posted: Sat Jul 23, 2011 7:11 pm
by Rudiger
You could try using the new Break Apart Shapes menu script (under Layer Effects). It's mainly designed for distributing shapes across multiple layers, but you can also restrict it to a single layer. Here are the steps you would go through to split a circle into 12 equal pie shaped parts:
1. Draw circle without fill or stroke enabled
2. Go to Scripts -> Draw -> Split Curve...
Set Point count to 2 and hit OK.
3. Use the Add Point with Auto-weld enabled to draw the pie shaped segments. To find the center point you could copy and paste the circle and scale it down until it is just a dot. You will also probably have to set the curvature of the center point to "Peak" using the Curvature tool.
4. Use the Paint Bucket tool to quickly go around and fill each segment with the fill and stroke colors you want.
5. Select the circle and go to Scripts -> Draw -> Split Curve... again.
Set Point count to 2 and hit OK.
6. Select all of the points and go to Scripts -> Layer Effects -> RT: Break Apart Shapes. Select "Put all shapes in one layer" and check "Create separate geometry for each shape".
7. This will create the separated shapes on their own layer. If they look right, you can delete the selected points on the current layer and copy and paste them from the new layer, then delete the new layer.
And that's it. You should now be able to move the segments separately from each other.
Posted: Sat Jul 23, 2011 7:20 pm
by GCharb
An easy way to create a center point would be to creat the circle, connect the top and bottom point to make a line, select the top and bottom points then use the split curve with 1 as value, creates a point right at the center.
Posted: Sat Jul 23, 2011 7:44 pm
by GCharb
Followed rudiger instructions and came up with this.
File here, asp 8.
http://www.mediafire.com/?dsxiw28v8xg8wv5
Posted: Sat Jul 23, 2011 9:02 pm
by Rudiger
That looks cool, but how do we know the shapes are actually separate? Care to do a short Physics animation, where something crashes into it or something?
Posted: Sat Jul 23, 2011 10:19 pm
by funksmaname
lol

Posted: Sat Jul 23, 2011 10:59 pm
by Rudiger
Hehe, nice!
Posted: Sun Jul 24, 2011 2:09 am
by capndreamer
Thank you all! This works great!

Posted: Sun Jul 24, 2011 7:03 am
by GCharb
funksmaname wrote:lol

ROFL, will try one of mine.
Also made it somewhat simpler last night.
Draw circle.
Connect middle points.
Select middle points then apply split curve with 1 as point count to create center point.
Select circle without center point.
Apply split curve with 8 as point count.
Create the parts of the pie.
Select all the parts one by one with the select tool while holding ALT(lasso tool)
Pasted all parts in another layer.
Used Create Shape tool to fill them.
Worked perfect, was a fun little project

Posted: Sun Jul 24, 2011 8:03 am
by GCharb
Posted: Sun Jul 24, 2011 8:28 pm
by Rudiger
GCharb wrote:funksmaname wrote:lol

ROFL, will try one of mine.
Also made it somewhat simpler last night.
Draw circle.
Connect middle points.
Select middle points then apply split curve with 1 as point count to create center point.
Select circle without center point.
Apply split curve with 8 as point count.
Create the parts of the pie.
Select all the parts one by one with the select tool while holding ALT(lasso tool)
Pasted all parts in another layer.
Used Create Shape tool to fill them.
Worked perfect, was a fun little project

I take it by "simpler", you meant "script-free". Surely there would have been more steps involved in manually copying and pasting each shape to the new layer than just running a menu script once only.
Cool animation, though. I think I might have to do my own now

.
Posted: Sun Jul 24, 2011 8:54 pm
by GCharb
Well, not script free, since the split curve script was used.
By simpler, I meant easier to understand for a noobie with little or no script knowledge.
Have not played much with the physics engine, I even complained about it being a new feature but I must admit it was fun!
Thanks for the animation, and yes you should make your own, just for the fun of it!

Posted: Sun Jul 24, 2011 9:33 pm
by funksmaname
Gilles, your animation is vastly superior to mine lol
The physics is 'fun' but it ONLY works on things set up in frame 0. if the floor moves after frame 0 for example, everything will just land on the invisble floor... which is a shame...
Posted: Sun Jul 24, 2011 9:49 pm
by GCharb
funksmaname wrote:Gilles, your animation is vastly superior to mine lol
Thanks, took 10 minutes really.
funksmaname wrote:
The physics is 'fun' but it ONLY works on things set up in frame 0. if the floor moves after frame 0 for example, everything will just land on the invisble floor... which is a shame...
I see, that's too bad. Still, there could be fun stuff to be made with it, like the motor function, one could do all sort of sprocket contraption, have the camera pan through tons of gears then at the end, an Easter egg comes out of a tube, silly stuff Wallace and Gromit style!
Posted: Sun Jul 24, 2011 10:50 pm
by InfoCentral
GCharb wrote:Thanks, took 10 minutes really.
There you go another quick tutorial in the works for the blog!