How to plot 3D cylinder shapes in Mathematica?

Click For Summary

Discussion Overview

The discussion revolves around how to plot 3D cylinder shapes in Mathematica using external data that specifies the start and end points of the cylinders. Participants explore methods for formatting the data and adjusting parameters such as cylinder radius.

Discussion Character

  • Technical explanation, Homework-related

Main Points Raised

  • One participant seeks assistance in plotting cylinders in Mathematica, specifically using data from a file that contains start and end points.
  • Another participant clarifies the need for more information about the software being used and questions the meaning of "plotting lines as cylinders."
  • A participant expresses uncertainty about formatting the external data and how to implement the command in Mathematica to create multiple cylinders.
  • One participant shares a code snippet attempting to use the `Graphics3D[Cylinder[list]]` command but notes difficulty in changing the cylinder radius.
  • A later reply references the help documentation for the `Cylinder` function, suggesting a specific syntax for defining a cylinder with a given radius and endpoints, while also mentioning that the conversion from raw data depends on the version of Mathematica and the format of the text file.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best approach to format the data or implement the cylinder plotting. Multiple viewpoints and methods are presented without resolution.

Contextual Notes

Limitations include the lack of clarity on the specific format of the external data file and the version of Mathematica being used, which may affect the implementation of the proposed solutions.

button_ger
Messages
10
Reaction score
0
hey

How can i do that? Can anyone of you help me?greets
button

MATHEMATICA
 
Last edited:
Physics news on Phys.org
You're posting in the Software section, so I assume you want to do it using a computer program, but you didn't tell us which one.

Also, how do you mean: plotting lines as cylinders? You mean you want to draw a cylinder of radius r along a line?
 
Sry. The data-file contains start and end-point of the cylinders (lines). I want to create a huge number of cylinders with external data.
How can I do that?
I don't know how to format the external data and how I have to do the command in mathematica.
 
I tired to do with
list = Partition[Import["Sites/IWS/testFile.txt", "Table"], 2]
Graphics3D[Cylinder
  • ]

    but in that way I am not able to change the cylinder-radius. How can I add this parameter in my list?
 
From the help,
Code:
Cylinder[{{Subscript[x, 1],Subscript[y, 1],Subscript[z, \
1]},{Subscript[x, 2],Subscript[y, 2],Subscript[z, 2]}},r]
represents a cylinder of radius r around the line from (Subscript[x, \
1],Subscript[y, 1],Subscript[z, 1]) to (Subscript[x, 2],Subscript[y, \
2],Subscript[z, 2]).

So you could simply use that command.

How you would convert to that from your raw data depends on the version of Mathematica (I suspect you are using 6.0+) and the precise format of the text file.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K