Add option to easily change units of a design between imperial & metric

Hi,

I downloaded a couple of designs/patterns from one of the threads here, but they are in imperial & there doesn’t seem to be any way to just click a button to change the units to metric.

I did look through all the settings but it seems the units are locked in when creating a new design.

So I had a look at the underlying XML of the .val/.sm2d file and saw the unit was specified there, however simply changing this from “inch” to “cm” just causes a whole mess once the file is reopened as it seem that the point coordinates (“mx”, “my”, “x”, “y”) and/or spline lengths also need to be converted.

I see that SeamlyMe can easily change between imperial & metric, so I would’ve thought the code to do so would’ve also been included in the main Seamly2D program as well.

Thanks.

2 Likes

Welcome to Seamly!

Hmm, so if the use of inches or metric were merely a front-end overlay, independent of the XML. It does seem possible. I vaguely think I remember @Douglas discussing something of the sort as an idea a while ago. I assume the implementation would almost necessarily involve untangling the mess keeping multisize from being used with inches, so it might be a Promethean undertaking.

Personally, as someone who favors dynamic measurement systems, I just make sure that I know which units the pattern I’m using uses. A 10cm measurement in an inch file could be rendered as (10/2.54), but very few formulas should involve measurements not in the measurements file anyway. (I’ve actually been experimenting recently with putting Seam Allowance in the measurements file.)

:unicorn:

2 Likes

Right… because the unit specifed in the pattern file is set as the units used (as displayed in the lower right in the status bar) will dictate how to handle the data… which gets converted to pixels.

X and y are only the coordinates of a base point. Insignificant if you changed units, as only the placement of the base point of blocks - and subsequent tools - will change.

Mx and my determine the length and angle of the leader line of the point names… ie the where the point name is located from the point. Again, insignificant to the actual drafting of the pattern - other than how far the point names are located from the points.

The element tags that are going to matter are the “length” ones.

That being said… I no longer use the word “easily” when referring to add or making changes to the applications. Often changing one thing in the app will have ripple effects throughout the app. :slight_smile:

So let’s discuss some options of what we could do…

Currently Seamly2D will set the units to that set in the pattern file… which for the most part makes sense. There are senarios where you may not want to change the units used - such as fixing a pattern for another user that uses different units than what you have set in your prefs. So, we could add another preference… let’s call it “Convert pattern units”, where if this is set it will always convert the pattern units to those set in the prefs any time a pattern is loaded.

Another option could be to add a menu item File → “Open with converted units…” - which would convert to the user’s pref if need be. I would kinda of prefer this approach. Easier to implement… and is clear to the user what they want to do.

The probem with the multisize is that RT hardcoded much of the multisize to use cm… which includes all the height & size comboboxes in the status bar:

status

and the heights & sizes in the Pattern Preferences:

multi

So yeah… it’s a big undertaking to refactor dynamically changing the ui for multisize in inches. Not to mention how do we decide how to convert from one Size format to another? What size is a 48 in cm → inches - where 48/2.54 = 18.89"… is it a size 19? Where generally there are no odd sizes in inches. Which gets even more confusing if we take it a step further and look at what size is a 48 in cm if we use a XS, Sm, Med, Large, XL, XXL inches size table?

@Grace and I have tossed multisize ideas around, where we think there needs to be different Size formats (which is going beyond the scope of this topic) … I just don’t know how well being able to convert from one multisize table to another would work.

3 Likes

Hi,

Many thanks for the info, that does clarify things a fair bit for me.

So if I understand correctly, if I wanted to manually convert these patterns over to metric then I only need to go through all of the “length” element tags, and can completely ignore the various x & y coordinates; yes?

Thanks.

2 Likes

Yes, you can ignore the x & y coordinates.

There may be objects that use a ‘measurement + 5cm’, so just keep an eye open for them. You will also need to check through any Variables in the Variables Table for any centrimeters that need to be converted, as well.

I normally save the xml often and open it in Seamly2D to check that all is well as I go.

2 Likes

Yes. Those and the mx, my… you can always adjust those in the app once the pattern is opened with different units. The x, y coordinates can be set with the Base Point tool or you can just drag the base point to where you want it - the rest of the block will follow.

base

@grndkntrl

Which are located in the increments tag.

3 Likes

Okay that’s great, thank you both very much!

2 Likes