Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
Chris Jones  
#1 Posted : Wednesday, June 15, 2016 4:58:12 AM(UTC)
Chris Jones

Rank: Advanced Member

Groups: Member
Joined: 6/9/2016(UTC)
Posts: 34

Thanks: 22 times
In our application, we need to render paths that we are making in Illustrator. We can do this in WPF by exporting to XAML or SVG and extracting the path data which is in a format detailed in the link below:
https://msdn.microsoft.com/en-us/library/cc189041(v=vs.95).aspx

Before i implement a custom parser that takes this format string and returns a GraphicsMill Path object, i just wanted to check there isn't already a function to do this or at least to do part of the work?

I realise Path is serializable but the format isn't the same and it uses magic values for the commands.

Thanks

Edited by user Wednesday, June 15, 2016 5:09:15 AM(UTC)  | Reason: Not specified

Fedor  
#2 Posted : Wednesday, June 15, 2016 6:26:51 AM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,558

Thanks: 5 times
Was thanked: 62 time(s) in 61 post(s)
Hi Chris,

Originally Posted by: Chris Jones Go to Quoted Post
Before i implement a custom parser that takes this format string and returns a GraphicsMill Path object, i just wanted to check there isn't already a function to do this or at least to do part of the work?


Unfortunately, we don't support to import paths from SVG or XAML.

Even though, could you provide us with a sample file/data?
Best regards,
Fedor Skvortsov
thanks 1 user thanked Fedor for this useful post.
Chris Jones on 6/17/2016(UTC)
Chris Jones  
#3 Posted : Wednesday, June 15, 2016 6:40:03 AM(UTC)
Chris Jones

Rank: Advanced Member

Groups: Member
Joined: 6/9/2016(UTC)
Posts: 34

Thanks: 22 times
Thanks for your reply, that is what i assumed would be the case. The path data format is quite useful as it can be extracted from files exported from illustrator.

An example path data which should draw a cog (image attached of us rendering it with WPF):

F1 M 37.6289,-0.000976563L 49.6289,-0.000976563L 52.8506,10.8311C 55.3838,11.5439 57.7979,12.542 60.0557,13.79L 70.0654,8.37012L 78.5518,16.8545L 73.1934,26.749C 74.4844,29.0117 75.5234,31.4365 76.2725,33.9863L 87.251,37.252L 87.251,49.252L 76.4746,52.457C 75.7588,55.1113 74.7295,57.6377 73.4297,59.9932L 78.8838,70.0645L 70.3994,78.5518L 60.4404,73.1582C 58.0811,74.5029 55.5439,75.5732 52.875,76.3252L 49.624,87.2549L 37.624,87.2549L 34.373,76.3232C 31.7061,75.5713 29.1729,74.501 26.8145,73.1572L 16.8574,78.5488L 8.37207,70.0635L 13.8262,59.9912C 12.5264,57.6357 11.498,55.1113 10.7822,52.458L 0,49.251L 0,37.251L 10.9854,33.9834C 11.7334,31.4365 12.7715,29.0137 14.0615,26.7529L 8.70313,16.8564L 17.1885,8.37012L 27.1982,13.791C 29.4561,12.542 31.8721,11.543 34.4072,10.8311L 37.6289,-0.000976563 Z M 43.9824,59.5264C 52.9834,59.5264 60.2803,52.2275 60.2803,43.2275C 60.2803,34.2266 52.9834,26.9277 43.9824,26.9277C 34.9824,26.9277 27.6826,34.2266 27.6826,43.2275C 27.6826,52.2275 34.9824,59.5264 43.9824,59.5264 Z

The link i gave describes the format which does appear to line up with the methods on the Path class such as moveTo, LineTo etc. I'm not yet sure whether there will be feature parity though which is a possible concern.

Edited by user Wednesday, June 15, 2016 6:41:32 AM(UTC)  | Reason: Not specified

Chris Jones attached the following image(s):
CogIcon.PNG
Eugene Kosmin  
#4 Posted : Wednesday, June 15, 2016 7:19:45 PM(UTC)
Eugene Kosmin

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 9/19/2006(UTC)
Posts: 446

Was thanked: 24 time(s) in 24 post(s)
Hi Chris,

Can you export your AI file to PSD format? In this case, you could get Graphics Mill path without additional manipulations as a clipping path or via PsdShapeFrame’s VectorMask property.

Or you can try to obtain System.Drawing.Drawing2D.GraphicsPath somehow, which is also convertible to GM path.

Best regards,
Eugene Kosmin.
Aurigma Development Team
thanks 1 user thanked Eugene Kosmin for this useful post.
Chris Jones on 6/17/2016(UTC)
Chris Jones  
#5 Posted : Friday, June 17, 2016 3:53:48 AM(UTC)
Chris Jones

Rank: Advanced Member

Groups: Member
Joined: 6/9/2016(UTC)
Posts: 34

Thanks: 22 times
We could use photoshop files but i want to avoid using that in this area (we are using it for a different part of the application). I've implemented a simple parser class for the XAML/SVG path data format that generates a Path object which seems to work well so far.

Thanks
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.