Graphics, Figures & Tables ⇒ Rendering a 3D Triangulation
Rendering a 3D Triangulation
I have got two files one containing vertices (one per line) and another containing the three coordinates of the triangle in form of indexes, as they appear in the first file (one triangle per line).
Is there a way to render a three dimensional surface from that?
How can I access coordinates from file 1 by index? By the way, the number of vertices and triangles is known.
Any hints would be great.
Thanks.
Is there a way to render a three dimensional surface from that?
How can I access coordinates from file 1 by index? By the way, the number of vertices and triangles is known.
Any hints would be great.
Thanks.
NEW: TikZ book now 40% off at Amazon.com for a short time.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Rendering a 3D Triangulation
For an adequate problem description and in order to avoid guesses and random shots please prepare a proper minimal example that contains all necessary but only relevant information in form of code.
Thorsten
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Rendering a 3D Triangulation
Someting like this:
I guess something is going wrong, when reading the faces.data. Don't know if I can read the file like this.
Code: Select all
\begin{minipage}{\textwidth}
\begin{tikzpicture}
\begin{axis}[view/h=120, width=\linewidth]
\addplot3[
opacity=0.5,
patch,
patch type=triangle,%polygon,
patch table ={faces.data}
]
table[header=false, x index=0, y index=1, z index=2] {vert.data};
\end{tikzpicture}
\end{minipage}
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Rendering a 3D Triangulation
This is not yet a
minimal working example. Some code, but not something we could work with. Please follow the link, to learn how and why.
Stefan

Stefan
LaTeX.org admin
Rendering a 3D Triangulation
I want to render a 3d shape by triangles.
I have got two things:
1) a list of vertices
2) a list of triangles, defined by 3 numbers, which represent the linenumber in the vertices list
On http://tex.stackexchange.com/questions/ ... nce-in-the one can find an example.
I need to load both, the vertices list and the triangle list from file.
Thats what my code intends to do.
I have got two things:
1) a list of vertices
2) a list of triangles, defined by 3 numbers, which represent the linenumber in the vertices list
On http://tex.stackexchange.com/questions/ ... nce-in-the one can find an example.
I need to load both, the vertices list and the triangle list from file.
Thats what my code intends to do.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Rendering a 3D Triangulation
Please let us know which part of the instructions for preparing a proper minimal example you did not understand. Perhaps some further advice is necessary here. At the moment there is no useful information to work with.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Rendering a 3D Triangulation
Ok. Managed to do it.
Used about 1000 vertices and 3000 faces.
Used about 1000 vertices and 3000 faces.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Rendering a 3D Triangulation
And we would like to know how exactly you did that. Hence a complete solution would be very kind in order not to make this thread useless for others who may come here by search engines.tomtom wrote:Ok. Managed to do it.
Used about 1000 vertices and 3000 faces.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Rendering a 3D Triangulation
I support this. The forum is also a knowledge base with many solutions already to find. So it would be great if you would finally post your solution, also if you found it yourself. You know, if we found solutions we also post it to help.
Stefan
Stefan
LaTeX.org admin