PVC Pipe and Fittings Library: Difference between revisions
No edit summary |
(add a macro for elbows.) |
||
Line 12: | Line 12: | ||
Useful links: [https://www.aetnaplastics.com/site_media/media/attachments/aetna_product_aetnaproduct/204/PVC%20Sch%2040%20Fittings%20Dimensions.pdf] | Useful links: [https://www.aetnaplastics.com/site_media/media/attachments/aetna_product_aetnaproduct/204/PVC%20Sch%2040%20Fittings%20Dimensions.pdf] | ||
== Simple general elbows == | |||
This is an intermediate solution. Here I do not follow particular NPT-Standards. Later I will translate the NPT-Parameters in these general dimensions. | |||
To create general elbow with 6 Parameters: | |||
* alpha - angle of the elbow. | |||
* R1 - inner radius of the bending part. | |||
* R2 - inner radius of the elbow. | |||
* R3 - outer radius of the elbow parts. | |||
* L1 - length of one part part of the elbow. | |||
* L2 - length of the another part of the elbow. | |||
For unknown reason I cannot join all parts of the elbow in FreeCAD. | |||
==90° - Degree.== | ==90° - Degree.== | ||
Described by 3 dimensions: | |||
size, G,H,M, I added | size, G,H,M, I added an auxiliary dimension ''size2'' for radius of the bent part (Does it correspond to the inner radius of the NPS pipe-dimensions?) | ||
=Notations= | |||
* O.D. - outer diameter. | * O.D. - outer diameter. | ||
* Average I.D. - average inner diameter (why average?). This dimension determines the size of the pipe. | * Average I.D. - average inner diameter (why average?). This dimension determines the size of the pipe. | ||
Line 24: | Line 37: | ||
* Schedule - determines (indirectly) the thickness of the wall. | * Schedule - determines (indirectly) the thickness of the wall. | ||
=Notes= | |||
"O.D." = "Average I.D."+2"Min. Wall" | "O.D." = "Average I.D."+2"Min. Wall" | ||
=Gallery= | =Gallery= | ||
<gallery perrow=6> | <gallery perrow=6> | ||
File:pvc-pipe-nps-sch40-1d8.png |'''SCH40 1/8" PVC pipe''' - size:5kb - FreeCAD -[[File:pvc-pipe-nps-sch40-1d8.fcstd]] | File:pvc-pipe-nps-sch40-1d8.png |'''SCH40 1/8" PVC pipe''' - size:5kb - FreeCAD -[[File:pvc-pipe-nps-sch40-1d8.fcstd]], | ||
File:pvc-elbow-test-60deg.png |'''Elbow test file''' - size:5kb - FreeCAD -[[File:pvc-elbow-test-60deg.fcstd]] | |||
</gallery> | </gallery> | ||
=Macros= | =Macros= | ||
== Pipes == | |||
To create Pipes 40 and 80 Schedule PVC pipes [[File:pvc-pipe-nps.fcmacro]] | To create Pipes 40 and 80 Schedule PVC pipes [[File:pvc-pipe-nps.fcmacro]] | ||
[[File:pvc-pipe-nps-macro-screenshot.png]] | |||
== Ellbows == | |||
Run [[File:add-ellbow.fcmacro]] with adjusted parameters: alpha, r1, r2, r3, len1, and len2. | |||
= How to create a pipe macro = | = How to create a pipe macro = |
Revision as of 17:53, 3 December 2017
Pipes
The dimensions of the PVC pipes can be found here PVC_Pipe. Wikipedia on Nominal Pipe Size (NPS) [1],
We will use following guide line for position of a pipe: put one end (base) of the pipe onto the x-y plane. The center of the base has coordinate (0,0,0). The other end is points to the positive direction of the z-axis.
Rationale: This is the same way FreeCAD places a new cylinder. We mimic the FreeCAD behavior for UI consistancy.
The default pipe length is 1ft. This is an arbitrary choice. When I use a macro, it will store the last length used by the user.
Ellbows
Useful links: [2]
Simple general elbows
This is an intermediate solution. Here I do not follow particular NPT-Standards. Later I will translate the NPT-Parameters in these general dimensions.
To create general elbow with 6 Parameters:
- alpha - angle of the elbow.
- R1 - inner radius of the bending part.
- R2 - inner radius of the elbow.
- R3 - outer radius of the elbow parts.
- L1 - length of one part part of the elbow.
- L2 - length of the another part of the elbow.
For unknown reason I cannot join all parts of the elbow in FreeCAD.
90° - Degree.
Described by 3 dimensions: size, G,H,M, I added an auxiliary dimension size2 for radius of the bent part (Does it correspond to the inner radius of the NPS pipe-dimensions?)
Notations
- O.D. - outer diameter.
- Average I.D. - average inner diameter (why average?). This dimension determines the size of the pipe.
- Min. Wall - thickness of the pipe wall.
- Schedule - determines (indirectly) the thickness of the wall.
Notes
"O.D." = "Average I.D."+2"Min. Wall"
Gallery
SCH40 1/8" PVC pipe - size:5kb - FreeCAD -File:Pvc-pipe-nps-sch40-1d8.fcstd,
- Pvc-elbow-test-60deg.png
Elbow test file - size:5kb - FreeCAD -File:Pvc-elbow-test-60deg.fcstd
Macros
Pipes
To create Pipes 40 and 80 Schedule PVC pipes File:Pvc-pipe-nps.fcmacro
Ellbows
Run File:Add-ellbow.fcmacro with adjusted parameters: alpha, r1, r2, r3, len1, and len2.
How to create a pipe macro
Steps to create GUI: The original instruction are taken from [[3]] but I (Ruslan) have problems with them. I adjusted them to FreeCAD.
- Create with QT Designer a Dialog based on QDialog class. Save the name for example add-nps-pvc-pipe-dialog.ui
- Convert add-nps-pvc-pipe-dialog.ui to python code running
- pyside-uic add-nps-pvc-pipe-dialog.ui -o pipe-dialog.py
- or call
- pyside-uic --indent=0 add-nps-pvc-pipe-dialog.ui -o pipe-dialog.py
- to use tabs as indention.
- If you use the FreeCAD macro editor, pay attention that the indention of pyside-uic and of the editor are the same.
- Insert content of the methods setupUi(self, Dialog) and retranslateUi(self, Dialog) from pipe-dialog.py (How can I insert here a block of python code?) into your macro file.