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 Like

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 Likes

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

1 Like

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 Likes

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

:unicorn:

2 Likes

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 Likes

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 Likes

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 Likes

Uh without clicking the expansion arrow?

2 Likes

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 Likes

Yes!!! :clap:

1 Like

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 Like

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 Likes