Next Project: Steampunk Men’s Suit circa 1855

My stepson wants something to wear to DragonCon.  That’s a fairly tight delivery date. So last night I wrote the inkscape extension to create thejacket back pattern.  This weekend I’ll finish the front jacket pattern.  Then the muslin test, then the real fabric.  Maybe I’ll have time for the trousers.  Maybe not…

This picture and the old method to make this suite are from ‘Men’s Garments 1830-1900‘ by R. I. Davis

Posted in Design | Tagged | Comments Off on Next Project: Steampunk Men’s Suit circa 1855

Front Bodice Block done!

I rewrote the programs again, tweaking the curves and re-thinking the algorithm.

The latest files are posted at Current Code Files

Posted in Design, Inkscape, Python, SVG | Tagged , , , | Comments Off on Front Bodice Block done!

Finally, some rest for the wicked…everybody else will have to stay awake

The Back Bodice Block Pattern is done. Must remove reference lines, pretty it up and give it a nice bouncy shine. Commented code as I went along because I remember nothing from day to day. Three months ago I had never written any  object oriented code, and never used illustration software. Now I’ve hit this milestone – the Back Bodice pattern block.  I will try to post the files on the wiki tonight while catching up on Xena, maybe a re-viewing of ZardOz. All the guys are out of the house.  It’s just me and the sherbert (uh, sorbet?) between now and Sunday afternoon. I honor and revere my slack.  It’s the source of my super powers.

The link to the .inx and .py files can be found on my wiki page Current Code Files

Posted in Announcements, Inkscape, Python, SVG | Tagged | 4 Comments

Simultaneous solving of equations – who knew it would come to this?

Oh yeah.  I had a shoulder line with a slope.  Needed to make a  dart perpendicular to shoulder line at the midpoint. Aha!  Get slope of shoulder line, negate & invert to get perpendicular slope.  Use midpoint as center point of circle. Solve line and circle equations simultaneously.   My issues were that python doesn’t like ^ for exponents, likes ** instead.  Use as many parentheses as you can possibly stand, didn’t get the right results with  r / (1+m**2)**(1/2) .   This was changed to (r/((1+m**2)**(.5))) and it worked perfectly.  And did you notice my Quadratic Bezier Curve?

Posted in Design, Inkscape, Python, SVG | Tagged , , , | 2 Comments

SVG Quadratic Bezier Curves in Python? I pwned ‘em

I’ve been struggling with creating bezier curves in an Inkscape SVG drawing from within a custom Inkscape extension written in Python.  It turns out that it’s the formatting of the element call that was the problem.  Here’s what worked for me – This is a simple example. I’ve included only one control point between the two end points.  The first coord (x1,y1) in mypathattribs is the begin point and is designated by M to move the pen to that point, the last coord (x2,y2) is the end point and doesn’t require a designated label, and the control point in the middle (c1,c2) is designated by Q.
My wordpress template isn’t allowing me to have specific line indents, so if you cut and paste you’ll need to add indents for the lines within DrawQCurve.

def DrawQCurve(self,my_layer,x1,y1,x2,y2,c1,c2,mycolor):
mypathstyle   = {'stroke': mycolor,  'stroke-width': '15px',  'fill': 'none'}
mypathattribs = {'d': 'M '+str(x1)+', '+str(y1)+'  Q '+str(c1)+', '+str(c2)+'  '+str(x2)+', '+str(y2), 'style': simplestyle.formatStyle(mypathstyle)}
inkex.etree.SubElement(my_layer, inkex.addNS('path','svg'), mypathattribs)

Converting the numbers to string and storing them in variables and putting the variables in the mypathattribs didn’t work, although this method works with other SubElement calls.  Placing the style information after the path definition was required as well, again this is different than with other SubElement calls. For some reason, I had to specify that the stroke-width was in pixels.  I received error messages when ‘stroke-width’:’15’ was in mypathstyle, but didn’t for ‘stroke-width’:’15px’ .  And again, this is different than with other SubElement calls. And appending ‘in’ for inches in the coordinate strings didn’t work even though it works for other calls, so I multiplied by 90 (90px per inch is default in Inkscape) to convert inches to pixels- I left this out because it wasn’t necessary for the example.


Posted in Inkscape, Python, SVG | Comments Off on SVG Quadratic Bezier Curves in Python? I pwned ‘em


Couldn’t help it, ordered a few more books, found a couple at a thrift store:

Applied Geometry for Computer Graphics and CAD – (Springer Undergraduate Mathematics Series) by Duncan Marsh

Men’s Garments 1830-1900: A Guide to Pattern Cutting and Tailoring by R. I. Davis

Professional Patternmaking for Designers: Women’s Wear and Men’s Casual Wear by Helen Joseph Armstrong

Patternmaking for Fashion Design by Jack Handford

MILLINERY Book Hat Making 4 Books-in-1 25 Lessons 1928 by The Fashion Institute

Millinery Book Hat Making Make Hats Design 1925 by Jane Loewen

The New Encyclopedia of Modern Sewing, 1946 ed. Frances Blondin

Posted in Books | 1 Comment

SVG Primer current site

The previous great SVG learning site that I blogged about earlier was out of date in 2009.  The current version is at the W3 site.  It’s been there for some time. And it’s still the best I’ve found.

Here’s the current SVG Primer:

It appears that SVG is a bit like Erector sets.  It’s actually pretty simple, but with SVG/Python/Inkscape so many people have done so many complicated things with it, that it ain’t easy to peel back the layers to learn how to start building from scratch.

It’s hard to find source data that reveals the foundational information on building SVG in a way that doesn’t follow the  ‘example 1, example 2, that’s enough info you don’t need to know where the extra information in those examples came from or why they were necessary to make this work’ formula.

This blog is a journal about my experience in learning to program. And about my experience in creating open source fashion design software using Python, SVG and Inkscape.  Exciting for the world, eh?  I’m trying to document how through lots of work I can find tiny a bit of basic info here and a tiny bit elsewhere.  It’s slow. Very very slow.

Posted in Inkscape, Python, SVG | 1 Comment

Snuggles won!

Yeah, it’s official. I’ve created a template for patterns which is based on pixels.  The units for creating or editing an object within an extension can be changed to inches or centimeters by appending ‘in’, ‘cm’ or ‘px’ to the measurement specified in the create element call. This doesn’t change the base unit of the document, will just need a global var in first extension or put a database lookup in each extention to specify the client’s measurement choice.  This actually makes it easier to make changes per client. Metric is preferable because smaller units  results in greater accuracy — but it’s tough for me in the US to find sewing notions in centimeters so I’m fairly stuck with inches. But the program will allow for both so that clients can use the measurement they prefer.

Posted in Inkscape | 1 Comment

Bsplines give me migraines

Found a great site which seems very promising in explaining how to control the results of the path command. An SVG Primer for Today’s Browsers by David Daily.

Okay, it seems that this is from 2009.  It’s now available and up-to-date at the W3 site

Posted in SVG | Comments Off on Bsplines give me migraines

Vandals, or was it Visigoths

My main wiki page has been ravaged and sacked.

Posted in Uncategorized | Comments Off on Vandals, or was it Visigoths

Pixels v. Centimeters v. Inches v. Snuggles

Small annoyance:  I haven’t found a way to change Inkscape unit settings from within an extension.  Each extension must convert centimeters and inches to pixels so that any pattern design is modified consistently with either measurement system.

Posted in Inkscape | 1 Comment

Getting to know pySVG library

I found a newly developed library that I think will make creating objects in Inkscape a lot easier:   pySVG – .  Just found some  great documentation at /usr/share/pySVG/doc/html/genindex.html that provides an index of the api which link to further documentation.  This will help someone like me, a non-programmer, utilize this library.

BTW – the two books I ordered are *not* for beginners.  I can’t scan the pages and pick up info, these books have to be read.  They’re textbooks.  But I don’t see them being textbooks to teach young people how to program.

Posted in Python, SVG | Comments Off on Getting to know pySVG library

Waiting for Processing

Ordered two programming books today.

Processing: Creative Coding and Computational Art

Processing: A Programming Handbook for Visual Designers and Artists

It’s been easy to get to information regarding editing selected Inkscape objects from within an extension, but for some reason I can’t find class information, syntax, etc. regarding *creating* a line, polyline, or polygon object from within an extension. I’m aware of the absolute and relative command sets of moveto, lineto, etc in the svg spec, but don’t know how to do these using python calls.  Started looking into, and navigated to where these books were recommended for artists and graphics designers.  Don’t know if they’ll provide a tidy answer, but the books look promising. I’ve done my share of writing perl & python scripts to grep log files, creating bruteforce html to provide centralized access to MRTG and HPOpenView and other datacenter tools,  scripting black hat security tests, and posting easy-to-read big font wikis documenting software bugs so the programmers can’t continue to deny that their  beta device’s GUI is putting the wrong IP in the ARP packets thereby destroying the routing & switching information and data connections ( including disrupting secure connections to corporate email servers not to mention the VP’s connection to ebay and porn sites) in the nearest upstream AND downstream routers/layer-3-switches at regularly defined intervals, but I’m not a programmer, dammit. Not yet.  :]

Posted in Uncategorized | 2 Comments

Inkscape tutorial – pen of Sequins!

Holy cow! check this out.  It’s a tutorial at Very Simple Designs how to design a line of sequins.  How to turn it into an extension using pattern-along-path feature to easily create a  line or curve of sequins? This extension could be the foundation for many decorative aspects of design. Well done tutorial.

Posted in Uncategorized | Comments Off on Inkscape tutorial – pen of Sequins!

Prairie vole, museum curate, or video game fodder?

I’ve been thinking about some of the reasons which motivate my efforts in producing this product.

Some of it has to be the  joy of sharing. The ability to feel joy while sharing knowledge is probably a bit like a person’s ability to pair bond.  Either one’s genes are expressed to enable an outpouring of oxytocin and vasopressin , or they aren’t.  But whereas the majority of the world’s population carry genetic material for pair bonding, it seems like a minority have the genes for the joy of sharing. Hoarding knowledge? Not for me.  I feel like a cross between a tent-revival preacher and a prairie vole of sewing techniques.

At a more dry level which doesn’t necessarily involve sharing of bodily fluids, translating traditional design techniques into software provides documentation, preservation and accessibility to the old ways via a new media. Like a museum-on-demand along with a  fully functional take-home kit. Sparking new life into something that simply wasn’t moving, perhaps to die like a shark in stasis. But on the other hand, the life of this project in my head could turn out to be like a video game where my miscalculations have me wandering towards the dead end of a maze, naively believing that I can evade the never-ending hunger and persistence of Ms. Pac-man to eventually track me down.

Posted in Uncategorized | Comments Off on Prairie vole, museum curate, or video game fodder?