-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sample Code for Drawing Paths? #14
Comments
Thanks for showing interest in pyshiva, Ian. Currently, the documentation is fully up to date with the exception of strokes. @berit and I plan to add support for arbitrary vector paths over the next few weeks. Text support is also hopefully coming soon. Let me know if there are any other features you think we should prioritize. |
@itdaniher @berit @dianavermilya, I investigated arbitrary path support. The C implementation seems trivial to expose to Python, but deciding on a Python API that makes sense is very challenging because of the way that paths are defined in C. Here's an example of a smooth curve defining a pear and its stem in C:
Alternatively, a triangle:
One thing I could do within about an hour is to make a Polygon class for closed shapes that follow a sequence of points. While this might be useful, It doesn't scale to graphics with smooth curves. One option could be to make an empty Path class that has methods like Note: I'm in Austria, which means that I have a terrible internet connection and that it is 1:30 PM for me right now. |
There already is a polygon class in shivaVG On Sat, Dec 22, 2012 at 7:37 AM, Julian Ceipek [email protected]:
|
@dianavermilya, we can indeed use
However, that does not address the issue of bezier curves. I'm not going to do much implementation work until the desired API for arbitrary paths is confirmed. Thoughts? Is the Path class I proposed a good solution? Can you think of a better one, @itdaniher, @berit, or @dianavermilya? |
That does mesh well with my intended use case, doing high performance-ish audio / data visualization work. With fir_filter.py and pyShiva, I'm about halfway to some really really neat datastream hacking in Python. |
I'd love to hear how it goes, @itdaniher. I just started the implementation. Currently, it uses absolute coordinates, but relative coordinates will come soon. I only added support for straight lines for now, but more interesting paths will be possible over the next few days (maybe as soon as tomorrow!). Let me know what you think of |
Added support for quadratic curves in 0356243 and provided an example in Everything I have done so far is immutable (existing paths cannot yet be modified), but maybe it is already useful to some degree? I'll look into mutability soon. |
@itdaniher Making paths mutable is more challenging than I expected, both API-wise and from the C side of things. You can take a look at the How do you want to be able to modify paths? I was considering giving paths a list of PathElements that can be modified with the following API:
However, this feels ugly to me and seems to make modifications to paths more challenging than I would like. ShivaVG has the function Going to sleep now. Let me know what you think, @itdaniher, @berit, @dianavermilya. |
Is this project capable of drawing vector lines, bezziers or the like? If so, could some documentation for this functionality be added?
Thanks!
The text was updated successfully, but these errors were encountered: