Sum of curve lengths

When I add the lengths of several curves, the sum is smaller than the line length between the start and end points.

I am confused

sum of lines

A25 = Line_A10#_A15a+Line_A15b_A30a+Line_A30b_A12#+Line_A6#_A14a+Line_A14b_A4# = 438,451 mm

sum of curves

A21 = Spl_A10#_A15a+Spl_A15b_A30a+Spl_A15b_A30a+Spl_A6#_A14a+Spl_A14b_A4# = 427,733

DOB Rock Bleistift.sm2d (26,3 KB) Olivia EU 44.smis (3,9 KB)

1 „Gefällt mir“

Line_A30b_A12# does not = Spl_A15b_A30a

You added Spl_A15b_A30a twice.

BTW… may I make a suggestion… put spaces around your operators. The math parser disregards white space and It makes easier to read

4 „Gefällt mir“

Thanks. I am really getting old. Sorry for the stupid question.

1 „Gefällt mir“

No problem. It can get difficult to see the various variables in a formula as they get bigger and without the spaces to seperate each variable. That’s what I had to do to figure it out. :slight_smile:

2 „Gefällt mir“

OOhh, I’m going to have to remember that the whitespace is an option.

:unicorn:

2 „Gefällt mir“

Yeah… the math parser used is made for parsing c++ style expressions so it doesn’t care about whitespace. I’m just so use to using whitespace now in code where appropriate to help the readability - espceicaly since these eyes are growing old. :nerd_face:

3 „Gefällt mir“

I think some people leave out whitespaces around operators to make the formula shorter, so it fits on one line. And sometimes the formula is halfway hidden because the field is not tall enough for the font.

Is there any way to set the formula field height to be 2 lines?

2 „Gefällt mir“

Yes… click the blue expansion arrow. :wink:

image

image

BTW… the expansion arrow was an RT thing… not mine.

Or Just clicking in a lineedit of the Property editor will auto expand when the widget gets focus. Eventually I want to make all the tool dialog lineedits auto expand as well.

3 „Gefällt mir“

Uh without clicking the expansion arrow?

2 „Gefällt mir“

I’ll love you forever if you do this :grin:

Yes. Check out how the Text Edits work in the Property Editor. Instead of all the dynamic code RT put in every tool dialog to expand / shrink the TextEdit boxes, I subclassed the QPlainTextEdit box to expand with focus in, and shrink on focus out. The functionality then resides in the ExpandingTextEdit widget, not dynamic code in every dialog. Basically a few lines VS hundreds.

void ExpandingTextEdit::focusInEvent(QFocusEvent *e)
{
    QPlainTextEdit::focusInEvent(e);
    setFixedHeight(64);
}

void ExpandingTextEdit::focusOutEvent(QFocusEvent *e)
{
    QPlainTextEdit::focusOutEvent(e);
    setFixedHeight(28);
}

I just haven’t updated all the tool dialogs to use promoted ExpandingTextEdit’s yet. BTW… I haven’t tried it yet, but I think I could add setting the width wider, so mutiple rows might end up being a moot point.

3 „Gefällt mir“

Yes!!! :clap:

1 „Gefällt mir“

This will just be a question if expanding the width could make the textedit box go past the frame of the dialog box - without needing the dialog itself to expand.

1 „Gefällt mir“

I’ll check my patterns to confirm that the tool dialogs are ok, that there are no problems displaying a single line formula. Sometimes in the recent past the formula field was not tall enough for a single line formula, such that I could only see the top half of the characters. In these situations I had to click the blue arrow to read the length or angle formula. I’ll check to make sure this isn’t happening anymore.

2 „Gefällt mir“