PVC Pipe and Fittings Library: Difference between revisions

From Open Source Ecology
Jump to navigation Jump to search
(add first test pipe to the PVC Part Library)
 
(add macro for pipe creation to pvc pipe part library)
Line 18: Line 18:
=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.fcmacro]]
</gallery>
</gallery>
=Macros=
To create Pipes 40 and 80 Schedule PVC pipes [[File:pvc-pipe-nps-sch40-1d8.fcstd]]
= How to create a pipe macro =
Steps to create GUI:
The original instruction are taken from [[https://wiki.qt.io/QtCreator_and_PySide|https://wiki.qt.io/QtCreator_and_PySide]] but I (Ruslan) have problems to with them.
# 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
# Insert content of def setupUi(self, Dialog) and retranslateUi from pipe-dialog.py (How can I insert here a block of python code?)
into your macro file. Note, the intention used in macro files created by FreeCAD
and the intention created by pyside-uic are different. You must adjust them.

Revision as of 16:56, 2 December 2017

Introduction

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 the other into positive direction of the z-axis. The default pipe length is 1ft. Rationale: This is the same way FreeCAD places a new cylinder. We mimic the FreeCAD behavior for UI consistancy.


Notations

  • O.D. - outer diameter.
  • Average I.D. - average inner diameter (why average?). This dimensions determine 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

Macros

To create Pipes 40 and 80 Schedule PVC pipes File:Pvc-pipe-nps-sch40-1d8.fcstd

How to create a pipe macro

Steps to create GUI: The original instruction are taken from [[2]] but I (Ruslan) have problems to with them.

  1. Create with QT Designer a Dialog based on QDialog class. Save the name for example add-nps-pvc-pipe-dialog.ui
  2. Convert add-nps-pvc-pipe-dialog.ui to python code running
    pyside-uic add-nps-pvc-pipe-dialog.ui -o pipe-dialog.py
  3. Insert content of def setupUi(self, Dialog) and retranslateUi from pipe-dialog.py (How can I insert here a block of python code?)

into your macro file. Note, the intention used in macro files created by FreeCAD and the intention created by pyside-uic are different. You must adjust them.