Moving Objects While Grading

Question 1) Let’s say I draw a pocket on the block.

I want to both resize but “also move the pocket while grading.”

How can I do the move part?

Question 2) Moving A Single Control Points While Grading

Let’s say I draw a dart on the block.

While grading I want to move the tip of It.

How can I do It?

2 Likes

In order to know what to do, first you’ll have to know what you want to do, what the reasoning is for the particular decision. Once you can describe in formulaic form where you want the item placed, it’s just a matter of figuring out how to write that formula in mathematical form.

I see three basic options,

  1. you want the item (pocket/dart point) to always be a certain distance from one edge.
  2. you want the item to always be a certain percentage of the distance from one edge to another.
  3. you want the item to have a parabolic(?) relation to the edge(s).

Examples:

  1. The pocket is centered at 10cm from the centerline at armscye height.

  2. The pocket is centered at 1/3 the distance from the centerline to the base of the armscye. (I should have used CurrentLength/3 for simplicity.)

  3. The pocket is centered on the same line with a more complex formula. (2 examples)

I haven’t tested any of these options, but those are the basic forms your formulae might take. I hope this is helpful.

:unicorn:

2 Likes

If the current size is larger than the base size, shift it 0.25 towards the armhole; if the current size is smaller than the base size, shift it 0.25 towards the center front.

Does this formula work for this purpose?

if(CurrentSize > BaseSize, 0.25, if(CurrentSize < BaseSize, -0.25, 0))

1 Like

No. The math parser in the formulas uses a c++ style syntax.

Ternary Operators

muparser has built in support for the if then else operator. It uses lazy evaluation in order to make sure only the necessary branch of the expression is evaluated.

Operator Description Remarks
?: if then else operator C++ style syntax

So in Seamly an IF THEN ELSE formula looks like:

if a<b then c else d looks like ( a<b ? c : d)

So your formula would be expressed as:

CurrentSize > BaseSize ? 0.25 : (CurrentSize < BaseSize ? -0.25 : 0)

In this case the ELSE of the 1st IF is a nested IF THEN ELSE so we can return values of 0.25, -0.25, or 0.

For more info on functions, opertators, and constants you can refer to the MUParser which is what Seamly is using:

2 Likes