Jump to content


Photo

Splitting a closed path with an open path?


  • Please log in to reply
11 replies to this topic

#1 DaveH

DaveH

    FireworksNut

  • Members
  • PipPipPipPipPipPip
  • 343 posts
  • Location:San Francisco CA USA

Posted 11 June 2009 - 01:47 PM

I want to cut a closed path into two parts along an irregular path, so I can't easily use the knife tool. (I need to create a data graph of a series of stacked line charts with color fills beneath each line in the chart.) I want to draw a rectangle for the fill, then use the pen tool to create the line that shows the values changing over time, then cut the rectangle into two parts using the open path so that I can delete half (the top half) and keep the bottom half as the filled line graph.

When I draw an open path for the line and use the path panel to slice/crop/intersect, etc. with the rectangle (a closed path), FW automatically turns the open path into a closed path by my connecting the end points. Needless to say this does not produce the desired cut in the rectangle.

I know I can draw the line and close it myself so that I have two closed paths to intersect/crop, but it seems like I should be able to use an open path to cut a closed path into segments.

I've created the data graphics already using two closed paths, but is there any way to use an open path to "cut" a closed path into two parts? It would be like a "knife along marquee/path" action. If there is no built-in technique to intersect/crop/cut a closed path with an open path, maybe there's an extension?

Thanks!

Dave

#2 jdunning

jdunning

    Fireworks Ninja

  • Members
  • PipPipPipPipPip
  • 173 posts

Posted 12 June 2009 - 11:17 AM

I've created the data graphics already using two closed paths, but is there any way to use an open path to "cut" a closed path into two parts? It would be like a "knife along marquee/path" action.

It's possible that one of the commands in Aaron Beall's Path commands might work:
http://fireworks.abe...sions/commands/

#3 jdunning

jdunning

    Fireworks Ninja

  • Members
  • PipPipPipPipPip
  • 173 posts

Posted 12 June 2009 - 11:25 AM

Actually, Smart Punch may do what you want. Draw the rectangle, then draw the line on top of it. Give the line a 2px hard stroke (1px doesn't seem to work), then use Smart Punch to punch the line out of the rectangle. You'll be left with two sub paths in what was left of the rectangle (the top and bottom pieces). Then just subselect one the points on the contour you want to get rid of and use the Select Contour command in the Paths panel to select the rest of the points and delete them.

#4 zabberwan

zabberwan

    Fireworks Ninja

  • Members
  • PipPipPipPipPip
  • 129 posts

Posted 12 June 2009 - 03:03 PM

Thanks for that one John; had been looking for something like this!

:)

#5 Alan

Alan

    FireworksGuru

  • Root Admin
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1,507 posts
  • Location:San Francisco, California USA
  • Interests:Longboarding, art and video games

Posted 13 June 2009 - 05:58 PM

Yeah I think Smart punch would do what you want Dave. Would a command that could select the rectangle and decide how many rows you want the rectangle divided in help you?

#6 abeall

abeall

    FireworksNut

  • Administrators
  • PipPipPipPipPipPip
  • 523 posts

Posted 14 June 2009 - 08:02 PM

Dave,

I've wanted to be able to do this in FW as you describe as well. I definitely don't have a command that does this, though it is what I was getting at with Incision Paths (this is in the Path panel for CS4.) You still have to make a closed path, but it will basically split the path(s) below it based on their contour intersection.

John's Smart Punch will probably get you the closest workflow as long as you're okay with the added punch-out portion, which I guess if it's uniform should be same difference.

But no, there's no native way to do this in FW exactly as you describe, as intuitive as it would be. I've seen the same question posted a few times, people don't expect the path to be auto-closed and often times don't really understand that that is what's happening. Would be a cool feature if it worked with open paths as you describe IMO.

Cheers.

#7 DaveH

DaveH

    FireworksNut

  • Members
  • PipPipPipPipPipPip
  • 343 posts
  • Location:San Francisco CA USA

Posted 14 June 2009 - 09:06 PM

Y'all,

Thanks for the hints and techniques. I had already tried Incision Paths (thinking that it sounded like what I wanted to do), but as Aaron pointed out it still closed the open path before dividing everything up. This works - you just need to select all of the parts you want to keep and UNION them, which is easy if you had a simple path dividing the closed path, but it's a pain in the neck if you have an open path that moves around a lot (because you end up with lots of little pieces...)

I had not thought to try Smart Punch - it worked as described, but there is still the extra step of selecting all points on the "extra" contour and deleting it. Smart Punch seems to create a type of compound path that cannot be "ungrouped" - I guess this is why you need to use a 2px stroke, because a 1px stroke has only one side and cannot be split between the two halves of the underlying object.

There are techniques to get the desired effect, but they all require an extra step or three to get the final object.

I agree with Aaron that it seems like this is something the FW should just be able to do - I'm not sure I understand why closed paths are necessary for these actions to work - perhaps there is some underlying mathematical constraint? It's definitely not intuitive that an open path is automatically closed before the path action is applied - I can see why FW users would become confused and frustrated.

(FYI, the original statistical graphs were created in Illustrator and brought into FW, because it was easier to split the paths in Illustrator than in FW. Doh!)

Dave

PS - Alan, a useful command would be an addition to Smart Punch - after performing the smart punch action, separate all of the component objects into individually selected units. :)

#8 jdunning

jdunning

    Fireworks Ninja

  • Members
  • PipPipPipPipPip
  • 173 posts

Posted 15 June 2009 - 07:04 PM

Smart Punch seems to create a type of compound path that cannot be "ungrouped" - I guess this is why you need to use a 2px stroke, because a 1px stroke has only one side and cannot be split between the two halves of the underlying object.

Are there compound paths you can just ungroup? What Smart Punch creates is the same sort of path you get when you join two paths. I can't seem to ungroup those.

But you can do Modify > Combine Paths > Split, which is what I think you want. Then you can just select the shape you no longer want and delete it. That's easier than having to subselect points and contours.

PS - Alan, a useful command would be an addition to Smart Punch - after performing the smart punch action, separate all of the component objects into individually selected units. :)

Much of the time, though, that isn't really what you want, e.g., punching text into a rectangle. If you split apart the compound path, you'd lose all the holes.

All that said, I feel a command coming on...

#9 DaveH

DaveH

    FireworksNut

  • Members
  • PipPipPipPipPipPip
  • 343 posts
  • Location:San Francisco CA USA

Posted 15 June 2009 - 09:22 PM

Are there compound paths you can just ungroup? What Smart Punch creates is the same sort of path you get when you join two paths. I can't seem to ungroup those.

But you can do Modify > Combine Paths > Split, which is what I think you want. Then you can just select the shape you no longer want and delete it. That's easier than having to subselect points and contours.


No, there are not compound paths that you can just ungroup - I assumed that the end result of Smart Punch was a compound path because of the way it behaved. It never dawned on me to use a Split Path command, but that's exactly the action I was looking for.

Much of the time, though, that isn't really what you want, e.g., punching text into a rectangle. If you split apart the compound path, you'd lose all the holes.


You're exactly right - I had not thought about that possible undesirable outcome of automatically splitting the compound paths after Smart Punch. It probably is better to retain the compound paths and let people split them when and how they want (e.g., either split all of the paths or select a point and then use the select contour action to get rid of only what you want.)

Given all of this discussion, my only question now is why the open path needs to be 2px or greater - why doesn't 1px path work with Smart Punch? Is it some odd math thing? If someone is looking for exact pixel measurements in the final smart punched product, they would have to design in anticipation if the "cut" being 2px wide. Not a bad problem - just a curious one.

Thanks again for all of the help,

Dave

#10 jdunning

jdunning

    Fireworks Ninja

  • Members
  • PipPipPipPipPip
  • 173 posts

Posted 15 June 2009 - 10:27 PM

Given all of this discussion, my only question now is why the open path needs to be 2px or greater - why doesn't 1px path work with Smart Punch? Is it some odd math thing? If someone is looking for exact pixel measurements in the final smart punched product, they would have to design in anticipation if the "cut" being 2px wide. Not a bad problem - just a curious one.

When punching an open path into a path, Smart Punch turns the path into a bitmap, then turns the bitmap into a bitmap selection, then the selection into a closed path, and then punches that path into the other path. The 2px requirement stems from (I think) the bitmap to selection step. If the bitmap is too skinny, the selection doesn't really take, and the punching object sort of disappears. This approach works well for thick strokes, especially when punching into a bitmap, but isn't quite right for punching a skinny line.

Here's something more along the lines of what you're trying to do:
http://johndunning.c...Smart Knife.jsf

Select a closed path and an open path on top of it, then run the Smart Knife command. It will split the bottom path into two closed paths, along the edge of the open path. It should work with any closed path and any open path, as long as the ends of the open path extend beyond the bounds of the closed path. If they don't, YMMV. :) The command could be made a lot more robust, especially when knifing across multiple elements, but it does the basics.

#11 DaveH

DaveH

    FireworksNut

  • Members
  • PipPipPipPipPipPip
  • 343 posts
  • Location:San Francisco CA USA

Posted 16 June 2009 - 09:09 AM

Here's something more along the lines of what you're trying to do:
http://johndunning.c...Smart Knife.jsf


Great! I'll give this a try today - thanks!

I really need to learn how to code for stuff like this -I owe WAY too many beers to other people for their efforts. :)

Dave

#12 jdunning

jdunning

    Fireworks Ninja

  • Members
  • PipPipPipPipPip
  • 173 posts

Posted 17 June 2009 - 09:35 PM

Great! I'll give this a try today - thanks!

Here's a cleaned up version of Smart Knife that handles paths, text, auto shapes and bitmaps: http://johndunning.c...bout/SmartKnife