You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Schmidt Denkt Mit <in...@denktmit.de> on 2013/10/15 12:50:29 UTC
Convert stroke to boollean unioned path
Hi Batik users,
Inkscape has a method to convert strokes into its enclosing paths as can be
read on http://inkscape.org/doc/advanced/tutorial-advanced.html and easily
tried within the software.
It even more combines intersecting paths in some boolean union style. E.g.
just enter a text with a stroke of huge width, and then convert and you will
see that the resulting outline path is an offset line around the text.
Do you know how to accomplish a similar procedure in Batik?
Kind regards,
Marius
--
View this message in context: http://batik.2283329.n4.nabble.com/Convert-stroke-to-boollean-unioned-path-tp4655692.html
Sent from the Batik - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: Convert stroke to boollean unioned path
Posted by Marius Schmidt <ma...@denktmit.de>.
Hi Craig,
thanks a lot for your help, your advise seems to work for me so far. I
have some artifacts, but I get rid of them if I union the original image
area with the stroked image area, which gets me to the outline I wanted.
Kind regards,
Marius
Am 15.10.2013 13:04, schrieb Craig S. Kaplan:
> Marius,
>
> I don't think there's a way to do this directly in Batik, but Batik is written in Java and Java offers some support for tracing paths. If you can extract a java.awt.geom.Path2D from Batik (and I think there's a way to do this, though the Batik source base might still use the older GeneralPath class), then you can define a java.awt.Stroke object (for example, a BasicStroke) and invoke its createStrokedShape method passing in the Path2D as an argument. That Stroked Shape is the enclosing path that you're looking for. If you need to compute booleans on Shapes, you can use the java.awt.geom.Area class. I can't speak to how reliable and robust their code is, but I've used it a couple of times in the past without a problem.
>
> Hope that helps.
>
>> Inkscape has a method to convert strokes into its enclosing paths as can be
>> read on http://inkscape.org/doc/advanced/tutorial-advanced.html and easily
>> tried within the software.
>>
>> It even more combines intersecting paths in some boolean union style. E.g.
>> just enter a text with a stroke of huge width, and then convert and you will
>> see that the resulting outline path is an offset line around the text.
>>
>> Do you know how to accomplish a similar procedure in Batik?
>>
>> Kind regards,
>>
>> Marius
>>
>>
>>
>> --
>> View this message in context: http://batik.2283329.n4.nabble.com/Convert-stroke-to-boollean-unioned-path-tp4655692.html
>> Sent from the Batik - Users mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
>> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>>
>
> --
> Craig S. Kaplan
> University of Waterloo
> http://www.cgl.uwaterloo.ca/~csk/
> "If civilization is to survive, it must live on the interest,
> not the capital, of nature." -- Ronald Wright
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Define a solid color and a path name, that also occurs in PDF after
Transcoding
Posted by Marius Schmidt <ma...@denktmit.de>.
Dear Batik users,
I am trying to create PDF from SVG files, that are able to be processed
by an automatized printing and cutting plotter. I am trying to get this
done for the CADLink software driven plotters, but the process should be
similar for other vendors. I need to tell CADLink, which of the paths is
the cutting path.
A possible way to achieve this, is to define a named solid color, e.g.
"CutContour" and somehow tell the intended cutting path to use this
named color. The information has to be stored in PDF file somehow.
CADLink would be configured to search for pathed stroked with a defined
color named "CutContour" and voila, knows the cutting path.
Unfortunately, I found NO clue of an entry point of how to tell Batik
and PDFTranscoder to embed such an named color and reference it from the
path :-(.
Any hints? Kind regards,
Marius
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: Convert stroke to boollean unioned path
Posted by "Craig S. Kaplan" <cs...@uwaterloo.ca>.
Marius,
I don't think there's a way to do this directly in Batik, but Batik is written in Java and Java offers some support for tracing paths. If you can extract a java.awt.geom.Path2D from Batik (and I think there's a way to do this, though the Batik source base might still use the older GeneralPath class), then you can define a java.awt.Stroke object (for example, a BasicStroke) and invoke its createStrokedShape method passing in the Path2D as an argument. That Stroked Shape is the enclosing path that you're looking for. If you need to compute booleans on Shapes, you can use the java.awt.geom.Area class. I can't speak to how reliable and robust their code is, but I've used it a couple of times in the past without a problem.
Hope that helps.
> Inkscape has a method to convert strokes into its enclosing paths as can be
> read on http://inkscape.org/doc/advanced/tutorial-advanced.html and easily
> tried within the software.
>
> It even more combines intersecting paths in some boolean union style. E.g.
> just enter a text with a stroke of huge width, and then convert and you will
> see that the resulting outline path is an offset line around the text.
>
> Do you know how to accomplish a similar procedure in Batik?
>
> Kind regards,
>
> Marius
>
>
>
> --
> View this message in context: http://batik.2283329.n4.nabble.com/Convert-stroke-to-boollean-unioned-path-tp4655692.html
> Sent from the Batik - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>
--
Craig S. Kaplan
University of Waterloo
http://www.cgl.uwaterloo.ca/~csk/
"If civilization is to survive, it must live on the interest,
not the capital, of nature." -- Ronald Wright
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org