I think I'm going to concentrate on getting all of this into SourceForge next.
[ add comment ] ( 3 views ) | [ 0 trackbacks ] | permalink
I am absolutely amazed that the KnitML group on Ravelry has grown from just me to 51 members in 4 days! It's so nice to meet all of you, and I look forward to discussing and sharing code and ideas with everyone.
Ravelry users: you've read what's below already.
Hopefully by the this time you've had a chance to see how I've marked up a basic sock pattern. So I want to know where we should go from here. I was originally planning on getting the engine and a basic renderer complete for trying to figure out where to go next, but I've realized that this is really an artificial line in the sand. You're all here, and some of you are very excited about getting involved.
I think it would be great if we each started writing programs and transformations that interested us the most (in whatever language we are most comfortable with). Everything developed would rally around the spec, allowing us to iteratively refine it as we go. We won't really know if there are issues with it until we dive in.
I've shared my ideas already. I want to hear yours. Don't worry if something has already been said. Say it again if it interests you. We'll collect common ideas together later. For now, just brainstorm!
[ add comment ] ( 6 views ) | [ 0 trackbacks ] | permalink
Okay, it's clear I need to explain this a bit further. Here is what you will ultimately find when you unzip the Java project.
.classpath and .project are Eclipse artifacts. You can essentially ignore these, except that you will need to make sure that every JAR in there is on your classpath (including JUnit4, which I realize I didn't provide. Sorry about that.) The main branch of code is in src/main/java, and the tests are in src/test/java.
The XML and XSDs for the basic sock pattern can be found under the src/main/java area, in the com.knitml.driver package. The XML can be syntactically validated the XSDs. The schema is in two parts. header-types.xsd provides the definitions for elements not in the <directions> element, and pattern.xsd provides everything under <directions>. (Ignore test-pattern.xml for now.)
Here is how the system works. The XML is first parsed into a DOM structure using DOM4J. Then the visitor pattern is applied to each of the nodes of the XML document to sequentially walk through the XML file. This performs semantic validation and also provides feedback to the client (potentially a renderer) along the way.
The class com.knitml.driver.Driver starts this process, beginning at the <directions> element. It currently fails when you try to knit to one before the gap on the heel turn. I am aware of this as I haven't written a handler for it yet.
I am working on a class diagram for how the Driver interacts with the KnittingContext, KnittingEngine, and Needles. I will provide that when it is ready.
One of the things we need to figure out is the transformation process from KnitML into a pattern in English. I was just initially planning on using a renderer from Java (at least as a first pass). As an alternative, XSLT has been brought up as an option. I personally find XSLT rather unwieldy, but are there any experts out there that might be able to design an approach to doing this? Keep in mind we need to be able to transform using various options (charts vs. directions, metric vs. english, language), and I don't know how well suited XSLT is for this.
Update: The KnittingEngine class diagram

[ add comment ] ( 2 views ) | [ 0 trackbacks ] | permalink
Now that I'm up on Ravelry, there have been a few inquiries after the source code. Being that Subversion isn't ready to go yet, I am furnishing a ZIP file with Java code and library dependencies. It's about 7 megabytes.
The project requires Java 5. Eclipse 3.3 is also recommended, as that is what I use and what the project format is in. Java is Java, however, and any old editor will do. Obviously I don't have a bug tracking system or anything like that yet, so if there's something you notice, please send me a note.
Anyways, enough of this bantering. Here is the code!
[ add comment ] ( 3 views ) | [ 0 trackbacks ] | permalink
I made it to Ravelry! My handle is fiddlinfool. If you're on Ravelry, please join the KnitML group.
[ add comment ] ( 2 views ) | [ 0 trackbacks ] | permalink

Archives



