How to set a slope of x.x %
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
-
- Posts: 34
- Joined: Sat Feb 23, 2019 11:18 pm
How to set a slope of x.x %
Hi,
I'm using de the Draft Slope tool to build pipe:
https://www.freecadweb.org/wiki/Draft_Slope
However, I didn't find how to set a slope between two round values in % : I mean 0.5% or 2.3% for example.
It's quite strange because it seem possible if you read the wiki page precited.
Any idea to help me?
I'm using de the Draft Slope tool to build pipe:
https://www.freecadweb.org/wiki/Draft_Slope
However, I didn't find how to set a slope between two round values in % : I mean 0.5% or 2.3% for example.
It's quite strange because it seem possible if you read the wiki page precited.
Any idea to help me?
Re: How to set a slope of x.x %
What is a slope of 5% in degrees? What about 2.3%? What do these numbers indicate?t.lemaitre wrote: ↑Sat Oct 19, 2019 11:08 pm ...
However, I didn't find how to set a slope between two round values in % : I mean 0.5% or 2.3% for example.
...
Is 100% equal to 90 degrees? Measuring a slope in percentage may be a convention used in some fields, but it isn't very precise. It should be measured in degrees, or as the tangent of the angle of aperture.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Re: How to set a slope of x.x %
No, it's 45°. The percentage is in a rectangular triangle with one side horizontal and one side vertical the ratio of the length of the vertical line divided by the length of the horizontal line. So it is in fact the tangent function.
It is e.g. used for waste water pipes and it is very very precise. Tell a channel digger to place the tubes at an angle of 0.572939° and he will call you an idiot. Tell him he should have a drop of 1cm per meter is easy to implement.
Measuring a slope in percentage may be a convention used in some fields, but it isn't very precise.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
-
- Posts: 34
- Joined: Sat Feb 23, 2019 11:18 pm
Re: How to set a slope of x.x %
Ok, now everybody speaks about the same thing : tangent is equal to percent of slope.
So, are you able to set a slope between two round values in % : I mean 0.5% or 2.3% for example?
If yes, I'd like to know how.
So, are you able to set a slope between two round values in % : I mean 0.5% or 2.3% for example?
If yes, I'd like to know how.
Re: How to set a slope of x.x %
Okay, so it has a definition. I wonder why OP doesn't use it then.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Re: How to set a slope of x.x %
You can't set values with 1/1000 precision as the input control is a QDoubleSpinBox that has a decimal precision of 2 (it's the default value in Qt).t.lemaitre wrote: ↑Sun Oct 20, 2019 12:10 pm Ok, now everybody speaks about the same thing : tangent is equal to percent of slope.
So, are you able to set a slope between two round values in % : I mean 0.5% or 2.3% for example?
If yes, I'd like to know how.
As a workaround you can :
1. Hack a file
Go to this file @ this line and add a new line with same indentation with :
Code: Select all
self.spinbox.setDecimals(XXX)
This hack will create a permanent change but will (IMO) be overwritten when a new version is available.
2. Hack the GUI
Click on the Draft/SetSlope function to display the slope input field in the Task panel, then enter following in the Python Console :
Code: Select all
from PySide import QtCore, QtGui
QtCore.QTimer.singleShot(2500, lambda:QtGui.QApplication.focusObject().setDecimals(XXX))
After validating the 2nd line, you get 2.5 seconds to set the cursor on the slope input field. When delay expires, the precision is changed.
This hack is a single shot one.
I almost never use Draft, so I won't discuss if it's right or wrong that this input field is limited to 2 decimals, if it should be aligned with application decimals, ...
EDIT : if you want same precision as application, use following as 'XXX' value :
Code: Select all
App.ParamGet("User parameter:BaseApp/Preferences/Units").GetInt("Decimals")
-
- Posts: 34
- Joined: Sat Feb 23, 2019 11:18 pm
Re: How to set a slope of x.x %
I tried it and it works! ThanksopenBrain wrote: ↑Sun Oct 20, 2019 5:19 pm 2. Hack the GUI
Click on the Draft/SetSlope function to display the slope input field in the Task panel, then enter following in the Python Console :Where 'XXX' is the decimal precision.Code: Select all
from PySide import QtCore, QtGui QtCore.QTimer.singleShot(2500, lambda:QtGui.QApplication.focusObject().setDecimals(XXX))
After validating the 2nd line, you get 2.5 seconds to set the cursor on the slope input field. When delay expires, the precision is changed.