Extension with examples, how to script?

General discussions about Inkscape.
Ailurus
Posts: 115
Joined: Fri Oct 22, 2010 9:53 am
Location: The Netherlands
Contact:

Extension with examples, how to script?

Postby Ailurus » Wed Oct 27, 2010 6:05 am

I'm not sure whether this is the right place to post this. Maybe I should ask it at the inkscape development mailinglist?

However, I would like to know how to "add" examples to an Extension. What do I mean by this?
Say, there is an enum-field called "Examples" with several items in it:

Code: Select all

<param name="Examples" type="enum" _gui-text="Examples:">
   <item value="Koch_Snowflake">Koch Snowflake</item>
   <item value="Pythagoras_Tree">Pythagoras Tree</item>
</param>


I would like that, when I click on the option "Koch Snowflake" in the list, the other fields (angle, step, etc.) get updated with appropriate values (i.e. angle=60, ...). Is this possible with XML (or the Relax NG schema language)? I think it would be very helpful for people who are new to an extension :)

Target:
Image
Last edited by Ailurus on Thu Oct 28, 2010 12:26 am, edited 2 times in total.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Extension with examples, how to script?

Postby brynn » Wed Oct 27, 2010 8:58 am

There may be folks here who understand about coding and writing extensions, I don't know for sure. I'm not one of them though, lol! But here's all the mailing lists, in case you're interested in joining http://inkscape.org/mailing_lists.php?lang=en

Ailurus
Posts: 115
Joined: Fri Oct 22, 2010 9:53 am
Location: The Netherlands
Contact:

Re: Extension with examples, how to script?

Postby Ailurus » Tue Nov 02, 2010 8:24 pm

Hmm, I posted this to the mailing list (inkscape-devel) almost a week ago, but thus far I've got no reply. I really hope it is possible to add examples to an extension, because IMHO it would help people to get familiar with it.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Extension with examples, how to script?

Postby brynn » Wed Nov 03, 2010 3:52 am

Oh dear, I think I may have been a bit off the mark with my reply. When I saw the code you posted, I thought you wanted to actually modify the extension yourself. If your comments to them were simply to suggest changes to the existing extension, they were probably mostly ignored.

It's my understanding that proprietary software is developed according to users' requests, because after all, that's how they sell it, by making a product that satisfies their potential customers. But open source is a different process entirely. Because Inkscape is an Open Source project, the development team is largely....if not entirely composed of people who have particular interests, and choose to spend their time developing that particular interest. I suspect (although I'm not well informed about this) if you were actually modifying the existing, or writing a new extension, and asked for help, I wonder if that might get more attention?

I don't belong to any Inkscape mailing lists, so I don't know why you haven't received any replies. Maybe because they don't know you? Or maybe someone intends to look at it later. I'm really not sure. But you can still proceed on your own. I wonder if you submitted a finished product or even finished prototype, that might get someone's attention. Then they could test it at least. Or maybe with a little research, you can find out who authored that extension, and contact them? Here a forum member interviewed the Inkscape team. Maybe you could learn more about it: viewtopic.php?f=21&t=5925&p=25589#p25589

Ummmm.....I''m not so knowledgeable about this, but I do know that people create extensions for Inkscape, and make them available for download, all on their own. I think if they are deemed worthy, they may be added to Inkscape. Just as an example, someone has been developing a different extension, and asking for input from the forum. You might contact them for info about the process??? I mean, since they're a forum member, they might not mind you contacting them, via PM? Here's their topic: viewtopic.php?f=11&t=5943

And if you're serious about it, here's the Inkscape Wiki page about development, especially I would suggest looking at the developer manual and tutorials:
viewtopic.php?f=11&t=5943

But if you just want to suggest the changes to that extension, the proper place is Launchpad, the Inkscape bug tracker (https://launchpad.net/inkscape). You can submit your suggestions as a new feature or wish list "bug". I'm sorry if I sent you down the wrong path :oops: :(

Ailurus
Posts: 115
Joined: Fri Oct 22, 2010 9:53 am
Location: The Netherlands
Contact:

Re: Extension with examples, how to script?

Postby Ailurus » Tue Nov 09, 2010 1:16 am

Hi Brynn,

Thanks for your comprehensive reply, I really appreciate it :). My original idea was to add something to the L-System extension, the Factor parameter. When I finished it, I thought it would be useful if there would be some examples - in the first place for the user who isn't familiar with the extension - but also for myself, because when "switching" from a Pythagoras Tree to a Koch Snowflake, you need to update all fields manually - and I can't remember all values :D.

Then I thought, wouldn't it be useful to add examples to most of the (existing) extensions? Some extensions aren't really self-explanatory, so I think it would be most helpful to include some examples that the users can use right away. I hoped that the developers would agree with me on this point, but I think they are to busy with releasing version 0.48.1.

I hope I can find some time this week or weekend, to delve into the developing process of the extensions (for instance, I don't understand how the lines are being drawn - something with self.turtle...). I would like to completely rewrite the L-System extension, because the way I implemented the Factor parameter is, well, quite ugly :D. The original author seems to be "Aaron Spike", this is the only name I found in the lindenmayer.py file. The year 2005 is mentioned, I thought the earlier versions of Inkscape included a Fractal extension?

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Extension with examples, how to script?

Postby brynn » Tue Nov 09, 2010 10:49 am

I thought the earlier versions of Inkscape included a Fractal extension?

There's one called Fractalize (Extensions menu > Modify Path), which I thought might convert objects or paths to something resembling a fractal image. But it does not do that at all. I love fractals, and had done some experimenting with the L-System extension in the past. But I couldn't figure out the "code" (meaning that I don't know what F, A, B, C.... means) and trial and error was too frustrating. The only way I was able to reply to your other message, was because you provided the "formula". Once I had that, I actually learned a little more about that extension. But still, I have no idea how to come up with formulas on my own.

So I think examples would be great for that extension! Another one would be Spirograph, and there probably are several others where examples would be helpful. But I don't think all extensions need examples. In most cases, the Live Preview promotes trial and error, and that is sufficient. But definitely examples would be nice on certain ones.


Return to “General Discussions”