I have been stewing on an idea lately and want to look into getting started. I want to be able to enter some parameters and have a program spit out a DXF file consisting of a procedurally generated design ready for the laser. I am thinking it will be a python script using dxfwrite · PyPI. Does anyone have a better suggestion on how to tackle this?
The research I’ve done came up with the point that most Inkscape plugins are python so I figured if I go this route, it could be used as, or converted into, a plugin. I’d have to look into what is required to make it work with inkscape, but if I can essentially use Inkscape as he GUI, then that would be a bonus.
Yeah, I think @Jarrett is on to something. Having a format that can easily be displayed is in my opinion very powerful tool. Like Jarrett said, this will allow you to quickly iterate over your script, or even playing around with parameters. Plus, Python is an easy yet powerful enough programming language to get things going quickly.
Your two options are really these:
Develop a plugin
Pro: Visual interface with immediate visual feedback
Con: New programming challenge
Bonus: There’s a gear plugin for Inkscape that might be a good starting point
Standalone
Pro: Easier to develop
Con: Need for external program to display
Hey this is cool! I’ve been researching how to create SVG files programatically for a sewing pattern generator that I’m doing. I like the DXF generator as an option as well.
I came across this post which indicates that dxfwrite is no longer in active development. The developer Manfred Moitzi is now working on ezdxf.
“If you want to create later DXF versions just use my ezdxf package (ezdxf · PyPI). dxfwrite is in maintenance mode - not further developement planned, while ezdxf is in active (but slow) development and ezdxf is also MIT licensed.”
Thanks for the info, @Majicj. I’ll look into that instead. Sewing patterns sound cool. is the idea that you could design the pattern once, then scale it to your proportions? With a DXF you could even use that to cut the fabric too, either on a cutter or on The LAZER!!! bwahahahahah laser-cut fabric for all your sewing needs!
There are software packages available for pattern making however these are not cheap. And they “sell each pattern group”. I found one open source pattern generating platform called Valentina. I don’t really like the approach they have taken. I guess I’ve been spoiled by Fusion 360 or other online SaaS applications.
Anyways I am starting off small just to learn about pattern making and trying to recreate a basic pattern for pants using SVG/DXF as the output format. This python library looks like a good place to start.
[quote] With a DXF you could even use that to cut the fabric too, either on a cutter or on The LAZER!!! bwahahahahah laser-cut fabric for all your sewing needs!
[/quote]
Woah! I saw you mention that you picked up the book, but I had no clue that your plans were so nefarious epic! Once I get into it, I may have to pick your brain a bit. Which route are you going? Stand-alone python or plug-in?
I started off doing a pattern sketch in Fusion 360 and was liking the parametric functionality but I soon came to realize that Fusion 360 is not meant for 2D work. You can save your F360 sketch as a DXF file but you cannot add text notes or labels to points in a sketch which is essential to making a pattern for sewing.
I’m really starting simple here. Just stand alone and no user gui.
Start with reading a text file with body measurements and then generate a dxf pattern file.
Pretty much every “flat” pattern block created follows a set of instructions to create it.
For example a set of steps to create a 2 piece trouser block is shown below. This uses recorded body measurements
There is a LOT more stuff than this to deal with when making patterns (Seam allowances, alterations based on posture, body shape etc, material ease etc.) but gotta start somewhere.