Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

How to map vertex points from the surface of a straight pipe onto 2D plane.

The 3D surface points of the straight pipe can be found here: data

Working code:

file = "http://pastebin.com/H9y9SqYy";
dat = Import[file, "Table"];
Graphics3D[Point@dat, Boxed -> False]

enter image description here

One can imagine as a simple straight cut (anywhere) on the circumference of the pipe. I want to get something like this:

enter image description here

share|improve this question
2  
Please be more specific about what you need as output. The input is clear. What does "unwrapping" mean? There are an infinite number of functions to map 3D vectors into 2D vectors. What sort of function are you looking for precisely? –  Szabolcs Jun 10 at 21:52
    
@Szabolcs I can imagine as a simple straight cut (anywhere) on the circumference of the cylinder. not sure about function. –  Being Human Jun 10 at 22:03
    
Is this a question specifically about cylinders or about any arbitrary surface? –  Szabolcs Jun 10 at 22:06
1  
@Szabolcs yes cylinder but it can be curved pipe, not necessarily straight pipe. –  Being Human Jun 10 at 22:07
1  
A "curved pipe" is not mathematically a cylinder and changes the problem completely. Can you post "curved pipe" sample data? –  Szabolcs Jun 10 at 22:10

1 Answer 1

up vote 3 down vote accepted

Quick solution is to assume, basing on the plot, that the cylinder main axis is parallel to one of cartesian axes:

Graphics3D[Point@dat, Boxed -> False, Axes -> True, BoxRatios -> 1, 
                      AxesLabel -> {"x", "y", "z"}, BaseStyle -> {18, Bold}]

enter image description here

then:

data2 = CoordinateTransform["Cartesian" -> "Cylindrical", 
                          {#, #3, #2} & @@@ dat][[;; , {2, 3}]];

Graphics[Point@data2, AspectRatio -> 1, FrameLabel -> {"ϕ", "z"}, Frame -> True, 
          BaseStyle -> {18, Bold}] 

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.