Skip to main content
Inspiring
Nov 2, 2016 8:14 PM UTC
Answered

Convert a Shape to a Path

Hi,

I have a shape (with no stroke) that I want to convert to a path.  When I go to Object > Shape > Expand Shape, it changes the layer to a path (as illustrated in the image below, the box in the top left of the options bar now says path instead of rectangle). When I save it as an SVG though and look at the SVG code it still shows as a rectangle <rect> element.

How do I convert it to a <path> ? I need the SVG code to be a path for a javascript animation.

Many thanks,

Paul.

paul knightCorrect answer
Inspiring
Nov 3, 2016 2:13 PM UTC

Hi Kris,  Adding an extra anchor point will just make the <rect> a <polygon> and moving an anchor point isn't an option

The only solution I seem to have found is to make the path a compound path via Object > Compound Path > Make.  This then gives me a proper path with the required data information SVG code.

Paul.

5 replies

Participant
Jul 31, 2018 5:36 PM UTC

I think I found something that works:

  1. Select shape.
  2. In the Pathfinder palette, click Unite (the first option).

On my few tests on a hexagon and a rectangle shape, it made it a path.

Translate
Inspiring
May 20, 2021 9:27 AM UTC

This is in my opinion the best answer. Renders an actual <path> object.

Translate
Inspiring
May 20, 2021 9:36 AM UTC

I take this back since it only renders as a path in illustrator, not in the SVG

Translate
paul knightAuthorCorrect answer
Inspiring
Nov 3, 2016 2:13 PM UTC

Hi Kris,  Adding an extra anchor point will just make the <rect> a <polygon> and moving an anchor point isn't an option

The only solution I seem to have found is to make the path a compound path via Object > Compound Path > Make.  This then gives me a proper path with the required data information SVG code.

Paul.

Translate
Kris Hunt
Legend
Nov 3, 2016 1:24 PM UTC

Maybe add an extra anchor point somewhere, or nudge one of the four corners a bit so it's no longer a true rectangle.

Translate