# Drawing a pipeline

**URL:** <https://forum.kirupa.com/t/drawing-a-pipeline/304958>\
**Category:** Uncategorized\
**Created:** [February 17, 2010, 7:15am UTC](https://forum.kirupa.com/t/drawing-a-pipeline/304958 "2010-02-17T07:15:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![silve69](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@silve69](https://forum.kirupa.com/u/silve69)\
**Post date:** [February 17, 2010, 7:15am UTC](https://forum.kirupa.com/t/drawing-a-pipeline/304958/1 "2010-02-17T07:15:02Z")

</div>

Hello friends,

I’m trying to draw a pipeline network for a demo game and I have problems deawing the pipeline pieces (like rectangles) with info loaded from XML file.  
The received data include for each pipeline piece the follow: id, status, xStart, yStart, xEnd and yEnd.  
I need to calculate the 4 coordinates for draw the rectangle.  
With vertical and horizontal rectangles I don’t have problem, but with inclinated rectangles I have problems for calculate the coordinates and obtain a symmetrical rectangle.  
See the follow image:

![](http://www.hrtester.com/screen.jpg)

Some suggestion???  
Bests!
