~eliasnaur/gio

3 2

drawing an outline w/ op/clip.Path

Sebastien Binet
Details
Message ID
<XViqe60kp4nuCw30FvdlJ71F9yAUghKGW8v4alRW2_n4-J9IrQR7BpbuUj_VsvNPTbZUMWfMYdxpA_U1ETLIgcz9q2Vu31nbjI35li9218Y=@sbinet.org>
DKIM signature
missing
Download raw message
hi there,

I am trying to draw a set of connected lines w/ op/clip.Path, with and w/o filling the inner area:

https://github.com/gonum/plot/blob/master/plotter/testdata/filledLine_golden.png

ISTM it isn't possible with the current API to:
- only draw the connected lines (with Path.Move, Path.Line, Path.Line) w/o filling the inner area and w/o providing an End op. But I were to provide an End op, then I'd need to back track the whole path (otherwise op/paint will try to fill the outlined area with some color)
- draw the connected lines with some line width (I guess that to do such a thing, one would need to draw rectangles of the expected line width)

did I miss something?

-s
Details
Message ID
<C3IGW49KDXD0.1HM0SCX3K3ONN@themachine>
In-Reply-To
<XViqe60kp4nuCw30FvdlJ71F9yAUghKGW8v4alRW2_n4-J9IrQR7BpbuUj_VsvNPTbZUMWfMYdxpA_U1ETLIgcz9q2Vu31nbjI35li9218Y=@sbinet.org> (view parent)
DKIM signature
pass
Download raw message
On Tue Jun 16, 2020 at 10:06, Sebastien Binet wrote:
> hi there,
>
> I am trying to draw a set of connected lines w/ op/clip.Path, with and w/o filling the inner area:
>
> https://github.com/gonum/plot/blob/master/plotter/testdata/filledLine_golden.png
>
> ISTM it isn't possible with the current API to:
> - only draw the connected lines (with Path.Move, Path.Line, Path.Line) w/o filling the inner area and w/o providing an End op. But I were to provide an End op, then I'd need to back track the whole path (otherwise op/paint will try to fill the outlined area with some color)
> - draw the connected lines with some line width (I guess that to do such a thing, one would need to draw rectangles of the expected line width)
>
> did I miss something?
>

You didn't. There are only filled paths in Gio for now.

To draw a line you either use rectangles, or you trace the outline of your
lines with clip.Path commands.

-- elias
Sebastien Binet
Details
Message ID
<XqVMp3yWuL2nIHhXpoa8d2vIC1Dan1VxOme0zEagSRz5Uz6_RcEbod2vZSQLinKDxxv92Bv1zX0O2dO47YNVsV05rZy3t3h1zXZ7kxiwhAo=@sbinet.org>
In-Reply-To
<C3IGW49KDXD0.1HM0SCX3K3ONN@themachine> (view parent)
DKIM signature
missing
Download raw message




‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Tuesday, June 16, 2020 12:50 PM, Elias Naur <mail@eliasnaur.com> wrote:

> On Tue Jun 16, 2020 at 10:06, Sebastien Binet wrote:
>
> > hi there,
> > I am trying to draw a set of connected lines w/ op/clip.Path, with and w/o filling the inner area:
> > https://github.com/gonum/plot/blob/master/plotter/testdata/filledLine_golden.png
> > ISTM it isn't possible with the current API to:
> >
> > -   only draw the connected lines (with Path.Move, Path.Line, Path.Line) w/o filling the inner area and w/o providing an End op. But I were to provide an End op, then I'd need to back track the whole path (otherwise op/paint will try to fill the outlined area with some color)
> > -   draw the connected lines with some line width (I guess that to do such a thing, one would need to draw rectangles of the expected line width)
> >
> > did I miss something?
>
> You didn't. There are only filled paths in Gio for now.
>
> To draw a line you either use rectangles, or you trace the outline of your
> lines with clip.Path commands.

thanks.
ok, then one would need to (probably) provide a way to reverse any path (so it can close "on itself").
or provide 2 flavors of clip.Path (filled and outline)

hum... ok, that's probably a lot more effort than what I envisionned initially :)

so, for the moment, I'll probably just draw to an image.Image and paint that directly with op/paint.
It won't be as fast as using op/clip but it will probably do for now.

thanks again.

-s
Details
Message ID
<C3ILA6ODHV7C.2M2U83Q8DR3RJ@themachine>
In-Reply-To
<XqVMp3yWuL2nIHhXpoa8d2vIC1Dan1VxOme0zEagSRz5Uz6_RcEbod2vZSQLinKDxxv92Bv1zX0O2dO47YNVsV05rZy3t3h1zXZ7kxiwhAo=@sbinet.org> (view parent)
DKIM signature
pass
Download raw message
On Tue Jun 16, 2020 at 11:15, Sebastien Binet wrote:
> On Tuesday, June 16, 2020 12:50 PM, Elias Naur <mail@eliasnaur.com> wrote:
>
> > On Tue Jun 16, 2020 at 10:06, Sebastien Binet wrote:
> >
> > > hi there,
> > > I am trying to draw a set of connected lines w/ op/clip.Path, with and w/o filling the inner area:
> > > https://github.com/gonum/plot/blob/master/plotter/testdata/filledLine_golden.png
> > > ISTM it isn't possible with the current API to:
> > >
> > > -   only draw the connected lines (with Path.Move, Path.Line, Path.Line) w/o filling the inner area and w/o providing an End op. But I were to provide an End op, then I'd need to back track the whole path (otherwise op/paint will try to fill the outlined area with some color)
> > > -   draw the connected lines with some line width (I guess that to do such a thing, one would need to draw rectangles of the expected line width)
> > >
> > > did I miss something?
> >
> > You didn't. There are only filled paths in Gio for now.
> >
> > To draw a line you either use rectangles, or you trace the outline of your
> > lines with clip.Path commands.
>
> thanks.
> ok, then one would need to (probably) provide a way to reverse any path (so it can close "on itself").
> or provide 2 flavors of clip.Path (filled and outline)
>

Yes, support for strokes are on the roadmap.
Export thread (mbox)