I'm looking for an extension allowing to do clipped graphics in Tk:
defining arbitrary regions as drawing masks like the ClipRgn in old
MacOs.
I'm also interested in the special case of polygons: both the clipper
and the drawn shape are just polygons. So a purely computational
polygon intersection tool is also welcome.
Thanks for all suggestions, and insight to help the choice.
Bets regards,
-Alex
> I'm also interested in the special case of polygons: both the clipper
> and the drawn shape are just polygons. So a purely computational
> polygon intersection tool is also welcome.
> C
> Thanks for all suggestions, and insight to help the choice.
>
see
http://wiki.tcl.tk/PolygonClipping
http://wiki.tcl.tk/PolygonIntersection
http://wiki.tcl.tk/CategoryPolygon
Bruce
At the C level. On my planet tcl scripts and extensions do not
intersect :-)
> > I'm also interested in the special case of polygons: both the clipper
> > and the drawn shape are just polygons. So a purely computational
> > polygon intersection tool is also welcome.
> seehttp://wiki.tcl.tk/PolygonClippinghttp://wiki.tcl.tk/PolygonIntersectionhttp://wiki.tcl.tk/CategoryPolygon
Thanks; but I'd really prefer C implementations there, because the
idea is to illustrate 3D rendering techniques to children,
in cases where clipping is superior to other techniques. I did a C+asm
version on the Mac years ago (using the ClipRgn() machinery),
but I tend to think Tcl's slighly better than 68k opcodes as an
educational tool...
-Alex
Tk itself doesn't do it, mostly due to the difficulty of expressing a
clipping region at the Tcl level (cleanly and efficiently). Once the
representation problem is solved, adding it to the canvas's items is
easy since (I think) all the underlying window systems support the
necessary basic clipping operations.
So, a good thing for someone to learn Tk's internals with. :-)
Donal.
Why not emulate how tkzinc handles them?
> Thanks; but I'd really prefer C implementations there, because the
> idea is to illustrate 3D rendering techniques to children,
> in cases where clipping is superior to other techniques. I did a C+asm
> version on the Mac years ago (using the ClipRgn() machinery),
> but I tend to think Tcl's slighly better than 68k opcodes as an
> educational tool...
Three ideas/questions:
does TKZink provide clipping?
what about scripted Open-GL ( as in Tk3D/Tcl3D )
What about the SVG support announced recently
http://wiki.tcl.tk/2893
>
> -Alex
uwe
>
Why not write up how it handles them or at least provide a pointer to
some documentation? :-)
Donal.
It's only in Tcl, but http://wiki.tcl.tk/playing%203d has 3D rendering
and clipping (the windows and door of the house), and may be fun for
children, especially around Easter time :^)
Tkzinc: http://www.tkzinc.org/tkzinc/pmwiki.php?n=Main.Documentation
But I am not sure that the inner workings are documented there too.
Regards,
Arjen
OK, so clipping is done by reference to some existing item. That'd
actually be not that hard to add, though it would require a revision
to the existing item types so that they can report themselves as clip
masks (easy for some items, hard for others). Luckily, the Tk_ItemType
structure is revisable so there are no serious back-compat issues.
It's just A Simple Matter Of Programming (and so I can't take it on).
Donal.
> I'm also interested in the special case of polygons: both the clipper
> and the drawn shape are just polygons. So a purely computational
> polygon intersection tool is also welcome.
> C
> Thanks for all suggestions, and insight to help the choice.
>
see
Tk itself doesn't do it, mostly due to the difficulty of expressing a
clipping region at the Tcl level (cleanly and efficiently). Once the