Do we need trigonometric functions?

Hi,

Do you use functions cos, sin and etc.? And how?

See issue https://bitbucket.org/valentinateam/valentina/issues/632.

I donā€™t, mostly because I donā€™t know how to :blush: but I was just wondering how Iā€™m going to make a full circle skirt on a dress, using the length of the bodice at waist divided by pi to get the diameter of the skirt waist and how Iā€™m going to draw that in 4 panels.

@Grace, here is a post about creating a circle skirt. Click on ā€œCircle Skirt patternā€ to go to the post. http://forum.valentina-project.org/t/circle-skirt-pattern/972?u=slpencer

1 Like

Thank you very, very much, @slpencer :grin:

1 Like

@Stinde, what do you think about these functions?

Personally I use the trigonometric functions to calculate distances. However the need has decreased, because of the new Valentina operations.

I know that the standard a-functions return radians, so Iā€™m just multiplying the result by 180/3,14 to get degrees. These functions are standard one, so I donā€™t see a need to change them.

If there is a real need to have functions in degrees, I would like to have the ability to have custom functions similar to increment values in Table of Variables. There could be ā€˜standard functionsā€™ included. I would put all my dart calculation functions in to that table. By rewriting complex functions over and over again creates difficult to find mistakes.

1 Like

As always good idea. But can you provide an example of such calculation? I want to look what formula do you have and how do you see a custom function in this case.

This is very typical calculation for the dart width

min(2;(max(0;((Line_A17_A42+Line_A42_A13-2*Line_A15_A43+Line_A11_A1)-(#WaistGirth/2+#WaistGirth_ease))/2)))

1 Like

Okay. But how do you see a custom function? What will be inside? I mean which part of formula?

The pseudo code could be something like this

DartWidth = (CurrentWidth, WantendWidth, MaxDartWidth) The function will return value between 0 ā€¦ MaxDartWidth

For this purpose (custom function) better to use some script engine. I see two options right now: lua and javascript.

I agree. The scripting would be even better and it opens also new ways to control the pattern.

For example I have a need to script the pattern configuration. In my patterns I have many configurable values. With a script it would be easy to ask and configure the values.

I use them a lot to design tents and similar stuff. There are lots of triangles. Some sort of scripting engine would be awesome.

This is not the first time we start discussion about scripting language inside Valentina. Right now some sort of scripting do for us QMuParser library (our fork of muParser library). It bring almost all we need:

  • Formula should be one line equation with result.
  • Parse expression for tokens that help when we translate formulas.

I donā€™t think that there is need for more advanced scripting language in such cases. But also it would be nice to have #317 and #318.

There are problems that stopping me to switching to more advanced solution:

  • How to disable features we donā€™t need? As i said it is a bad idea to allow user write what he want.
  • Formula translation feature. We will lose it because donā€™t have access to tokens anymore.
  • I donā€™t like idea to have several parsers for different tasks. One evaluate formula and another parse and help translate.

But this is all quite achievable.

hi Grace, ive tried to use the arc tool with radius derived from the waistline as circumference. for the outer hem , i used the simple curve tool in clockwise direction. the arc is counterclockwise direction and cannot be traced by the detail. ive also tried the simple curve tool for the waistline but it became tedious to plot the pleats points in each segment. using the arc tool looks better for me, though the pleats point should come ahead of the cut arc point to be able to appear in the detail. hope this helps.

@kuya_jos Can you create a new thread and post images of how you are trying to work with pleats?

1 Like

Hi Susan, thanks for reading. i will try.

1 Like

Thanks, @slpencer, I read this last night and decided to leave it till morning to try and figure out :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.