SeamlyMe: Measurement variables that can be used in a formula

Hi everyone,

I am a complete newbie here on the forum, and I have only just begun using Seamly2D and SeamlyMe (although I have known about the Valentina project for quite a while), so please bear with me if the answer to my question should be obvious. After trying to understand the programs and the whole workflow, I was under the impression that I could choose whether I wanted to assign either constants or formulas to the values of the measurements in SeamlyMe. The constants work as expected, but I was surprised when I could not have something like (height_waist_side - height_hip) as a formula. The formula wizard does not show height_waist_side or height_hip as available either. My intention was to have a measurements file that I use as a template for every new person, where I use approximations calculated by formulas for some measurements, and I replace the formula by the actually measured value if and only if I have it for a particular person. This way I could use the measurement in my pattern pieces whether it has been measured or ‘only’ calculated. So why is there a limitation on which measurements I can use in a formula?

I am using SeamlyMe 0.6.0.1 built 2018-01-13 at 13:08:54.

Thank you, Elke

Hi Elke,

You can make a measurement table for every different person, load this table and use those measurements in formulas. It will not be visible if it is not loaded.

load individual

If you cannot find the measurement you need in the ‘known measurement’ of SeamlyMe, you can always make custom measurements. In formulas these will automatically have an @ symbol at the front.

2 Likes

Hi Elke,

welcome here :slight_smile: I understand you want to do formuals related to persons in the measurements-file; those formulas are not related to patterns? Formulas should work, I just tried it on my build (the same version on Ubuntu; I guess you have Windows or so?) and it works fine: Screenshot_2018-01-18_08-59-54

The read formula here only happened with printscreen, must be something with grafics. But it works. You

  • press the orange button - add individuel measurement
  • press the little f(x)-button over the right edge of the input-field “formula”
  • make sure that there is no value in the field “Formula” of the pop-up-window that appears
  • double-click on the desired measurement
  • write in your operator (±*/)
  • double-click the next measurement or write in a constant
  • click on ok. If there is any error in the formula, the word will become read and the ok will be lighter in color, the ok-button not working. Check the formula in this case.
1 Like

Hi AVI,

I just tried using a custom measurement, and it works perfectly! But why can’t I use the same formula that works in a custom measurement in a certain known measurements?

Screenshot from 2018-01-18 09-38-37

The waist_to_hip_f measurement does not accept the formula (height_waist_side - height_hip), whereas my @CustomMeasurement1 does. Is this some kind of bug, or am I for some reason not supposed to do what I am trying to do?

Thanks for your help!

It is not you :slight_smile: It is the kind of calculating Seamly does.

Put waist_to_hip_f under the other measurements. Seamly doesn’t know height_waist_side and height_hip at the time you want to calculate with those constants.

If you put waist_to_hip_f for example at place 8, it will work. You can use the arrow; mark waist_to_hip_f and take the green arrow to get it all the way down, the blue to get it step for step down.

Hi moniaqua,

the formula in the measurements file is meant to be generic, it simply says that the distance between the waist and the hip is the difference between the waist height and the hip height, which are measured and entered as constant numbers into the measurements file for that person. Only if I want everything to be extra precise the actual distance between the waist and the hip will be measured and the formula will be overwritten with the measured value, but only for that particular person.

As I just wrote in my reply to AVI, what I am trying to do works if I assign the formula to a custom measurement, but it does not if I try to assign it to a known measurement:

Screenshot from 2018-01-18 09-38-37

When I use the Function Wizard, the list of the available variables is empty or contains only very few entries when I want to assign the result to a known measurement, but all the measurement variables are available in the list when I want to assign the result to a custom measurement.

So I can achieve what I want, but only if I use custom measurements. This problem is solved, but I would still like to understand why I can’t assign formula results to known measurements.

My operating system is Ubuntu 16.04.3 LTS :slightly_smiling_face:.

Thank you!

Hi Elke, moniaqua already answered your question, the program needs the information before doing something. Your waist to hip f is at the top, so it will look into this first and not find the other measurements. Place it at the bottom and it will.

1 Like

I see! :smiley: This is an easy way to avoid circular dependencies, so it makes sense. The two of you are posting so fast that I can’t keep up
 Thank you so much! Am I supposed to update the documentation after such a ‘discovery’?

1 Like

Yes, Elke, I can calculate :wink: Still Seamly needs to know a constant before it can calculate with it. And if waist_to_hip_f is in the first place, Seamly doesn’t know the other constants, like @AVI also said. It is as easy as that.

Put your formula all way down and the wizard will know the other measurements, no matter if custom or known. It is the place where your custom measurement stands, not the fact that it is a custom measurement.

Btw, thank you for your question, I need to re-read the tutorials and see if I was clear enough on that topic. :slight_smile:

1 Like

Hi @Elke! thanks for this question, it’s a foundational question.

Everything in a a measurement’s formula should be defined above that formula.
Just like desktop math: If you know X but you don’t know Y, you can’t solve (X + Y), you must wait until X is known.

HTH!

1 Like

please read open issue Issue: Error when using measurement A23 waist_to_floor #118 which can be found at Issue: Error when using measurement A23 waist_to_floor · Issue #118 · FashionFreedom/Seamly2D · GitHub

While that is not precisely the same problem, there may be other issues with the base set of measurements in the Valentina code. If you find something that is truly incorrect, please document it.

1 Like

Thank you @moniaqua, @slspencer and @kmf !

I could not reply immediately because the forum software blocked me and shut me up on my first day :open_mouth: :cry: .

It would be possible to change the software so that it could evaluate expressions even if variables are defined further down or elsewhere as long as there are no unresolved or circular dependencies. Is it a conscious design decision to simplify the computation environment by enforcing a ‘procedural’, strictly top-down evaluation order, or is it just a known shortcoming of the current implementation?

1 Like

I think you meant until Y is known.

2 Likes

I can not answer your question but you sound like you could program, so you might want to have a look at the code :slight_smile: The source is available, I think on github :slight_smile:

Why would you want to use a formula for a “known” measurement? When you use a known measurement it’s already defined and assumed you’re using a measurement taken off the person. If you need to use measurements in formulas best to create a custom measurement. Given your ex:
 add a custom @waist_to_hip_f with a formula of (height_waist_side-height_hip).

I will add though, you are mixing two different type of measurements. The height_waist_side and height_hip are vertical distance measurements taken from the floor - OFF the body, where waist_to_hip_front is a measurement taken ON the body. In other words height_waist_side - height_hip does NOT equal waist_to_hip_front. Maybe on a really skinny person it would be close, but on someone with a corpulent body - no way., where waist_to_hip_front takes into account the curvature of the body.

Also in looking at the measurements in SeamlyMe/ TAPE I believe there is yet another issue with things being mislabeled in the program. The measurements in section A are VERTICAL measurements
 and the measurements in section H are DIRECT measurements the opposite of what they are currently labelled.

1 Like

There are constructions where you use either a formula, if you didn’t take the measurement out of whatever reason. Or you can take the actual measurement. So I can imagine that it is kind of useful to have a formula, even with the “known” measurements, if you have a lot of customers and don’t want to change every pattern regarding the name of the variable/constant.

Sorry about that! This feature prevents spam, but yes it seems a pity that on your first day that you couldn’t post as you desired. You’re not alone, our first day users are super enthusiastic!!!

Regarding the predecessor requirements for processing, think of this as a spreadsheet. We could code up a recursive algorithm to delay processing of any variable whose formula contains a zero value for a measurement. On the first pass the all measurements are processed, then each successive pass processes only the delayed measurements until there are no more delayed measurements.

Could you code this feature?

2 Likes

@moniaqua, I have already looked at the code, and I should be able to implement the change we are talking about. My question whether it was a conscious decision to make the software behave the way it does was about the software designers’ wishes. If the software is ‘meant’ to be as it is, I wouldn’t waste my time implementing a feature the designers don’t want. I would feel much more encouraged to do it if I knew that my modification would be welcome.

@Douglas, I agree with everything you wrote, and I see why you warn me against taking the difference of vertical measurements as a substitute for a real measurement of a curved, non-vertical part of the body. Before I decided to pursue the idea of using an approximation like that I did a quick estimation of the error, and if I assume the curvature to be small and the angle off vertical to be 10°, the error is something like two percent. If the height difference between hip and waist is 8", the error is close to 1/6". If I anticipate this error, I can reduce the residual error to much less. I know that the measurements are there for a reason, that they are designed not to be redundant, and that they are meant to be measured. Nevertheless I wanted to try it, and I found that I could not do it. That is what my original post was about.

@slspencer, on my first day here I felt it might appear rude that I suddenly stopped posting in the middle of a live conversation, but it seems no harm has been done :slight_smile: .
Regarding the software feature, I would choose an algorithm based on the requirements, such as

  • The order in which variables are defined must be irrelevant
  • An expression must be allowed to contain any number of variables as sub-expressions
  • Circular and unresolved dependencies must be detected and communicated to the user

I would suggest to have the software build a dependency graph for the variables, check for feasibility (no circular or unresolved dependencies), and then compute the variables in an order that satisfies the constraints from the dependency graph.

I have enough experience with C++, but I have not worked much with Qt before, and I certainly need to study the existing code to avoid reinventing the wheel. If my modification is welcome, I will start working on it.

Should I coordinate my work with the developers, or can I just create a branch and a pull request?

4 Likes

Whatever the decision is with the measurements, it sounds like we are really lucky that you came here :slight_smile:

2 Likes

We’re an open community, and we welcome contributions. I’m looking forward to what you want to do. You may consider creating a page on our wiki as a scratch pad for notes and documentation. It’s not for us to second guess you while you work, it’s for you to be able to put your thoughts online then when your code branch is merged we can finalize the wiki page with minimal update required.

Edit: So yes, please create a branch!

2 Likes