Con todos los temas anteriores relacionados con nubes de puntos y dibujo 3D hemos tenido la necesidad de realizar una fácil programación para la exportación a archivos 3D.
Para el caso de las nubes de puntos hay dos formatos que brillan por su sencillez: Uno de ellos es el tipo XYZ (o ASCII) y otro el PLY.
La diferencia entre el PLY y el XYZ es que el PLY dice al principio de cuantos puntos cuenta el conjunto.
Sin embargo el formato LAS, aun siendo binario, es extremadamente sencillo. Contiene una cabecera con toda la información posterior del archivo y, como los puntos son relativos a uno inicial colocado en la cabecera resulta muy fácil realizar traslaciones y homotecias.
We've needed to perform easy programming to export to 3D files because of the above topics related point clouds and 3D drawing
In the case of point clouds, there are two formats that shine for its simplicity: One is the XYZ (or ASCII) and another type PLY.
The PLY format versus XYZ gives us at the beginning how many points account the set.
However, the LAS format, although binary, is extremely simple. It contains a header with all subsequent information file, and the points are relative to the initial one placed at the head is very easy to make translations and dilations.
El cuerpo sólido. El formato OBJ
Después de los preceptivos análisis de las nubes de puntos tenemos información suficiente para exportar un modelo 3D. El formato más sencillo es el OBJ. Lo mejor es mostrar un ejemplo:
After the prescribed analysis of point clouds, we have enough to export a 3D model information. The simplest form is the OBJ. It is best to show an example:
v 1 0 0
v 0 1 0
v 0 0 1
f 1 2 3
Sencillo el archivo ¿no?. Pues, si lo guardamos como triangulo.obj y lo abrimos con un programa freeware como Wings, obtenemos:
Simple the file, Is not it?. Well, if we keep it as triangle.obj and we open it with a freeware program like Wings, we obtain:
Supongamos que queremos hacer una chimenea ancha típica de una central térmica:
We suppose we want to make a typical wide chimney of a power plant:
We suppose we want to make a typical wide chimney of a power plant:
La forma tradicional sería la de trabajar sobre cou un programa de diseño gráfico 3D. La "otra" forma, la no ortodoxa sería abrir una hoja de cálculo:
The traditional way would be to work on a program of 3D graphic design. The "other" form, unorthodox, it would open a spreadsheet:
Copiar y pegar en el block de notas (o GEdit o Writer), y guardarlo como archivo OBJ:
Éste es el archivo. Poderis probarlo:
Copy and paste into notepad (or GEdit or Writer), and save it as OBJ file:
This is the file. You can try:
v 1 0 0 v 0.9950041653 0.0998334166 0 v 0.9800665778 0.1986693308 0 v 0.9553364891 0.2955202067 0 v 0.921060994 0.3894183423 0 v 0.8775825619 0.4794255386 0 v 0.8253356149 0.5646424734 0 v 0.7648421873 0.6442176872 0 v 0.6967067093 0.7173560909 0 v 0.6216099683 0.7833269096 0 v 0.5403023059 0.8414709848 0 v 0.4535961214 0.8912073601 0 v 0.3623577545 0.932039086 0 v 0.2674988286 0.9635581854 0 v 0.1699671429 0.98544973 0 v 0.0707372017 0.9974949866 0 v -0.0291995223 0.999573603 0 v -0.1288444943 0.9916648105 0 v -0.2272020947 0.9738476309 0 v -0.3232895669 0.9463000877 0 v -0.4161468365 0.9092974268 0 v -0.5048461046 0.8632093666 0 v -0.5885011173 0.8084964038 0 v -0.6662760213 0.7457052122 0 v -0.7373937155 0.6754631806 0 v -0.8011436155 0.5984721441 0 v -0.8568887534 0.5155013718 0 v -0.904072142 0.4273798802 0 v -0.9422223407 0.3349881502 0 v -0.9709581651 0.2392493292 0 v -0.9899924966 0.1411200081 0 v -0.9991351503 0.0415806624 0 v -0.9982947758 -0.0583741434 0 v -0.9874797699 -0.1577456941 0 v -0.9667981926 -0.255541102 0 v -0.9364566873 -0.3507832277 0 v -0.8967584163 -0.4425204433 0 v -0.8481000317 -0.5298361409 0 v -0.7909677119 -0.6118578909 0 v -0.7259323042 -0.6877661592 0 v -0.6536436209 -0.7568024953 0 v -0.5748239465 -0.8182771111 0 v -0.4902608213 -0.8715757724 0 v -0.4007991721 -0.9161659367 0 v -0.30733287 -0.9516020739 0 v -0.2107957994 -0.9775301177 0 v -0.1121525269 -0.9936910036 0 v -0.0123886635 -0.9999232576 0 v 0.0874989834 -0.9961646088 0 v 0.1865123694 -0.9824526126 0 v 0.2836621855 -0.9589242747 0 v 0.3779777427 -0.9258146823 0 v 0.4685166713 -0.8834546557 0 v 0.5543743362 -0.8322674422 0 v 0.6346928759 -0.7727644876 0 v 0.7086697743 -0.7055403256 0 v 0.7755658785 -0.6312666379 0 v 0.8347127848 -0.5506855426 0 v 0.8855195169 -0.4646021794 0 v 0.9274784307 -0.3738766648 0 v 0.9601702867 -0.2794154982 0 v 0.9832684384 -0.1821625043 0 v 0.996542097 -0.0830894028 0 v 0.9998586364 0.0168139005 0 | v 0.1061058025 1.4962424799 3 v -0.0437992835 1.4993604046 3 v -0.1932667414 1.4874972157 3 v -0.340803142 1.4607714463 3 v -0.4849343503 1.4194501315 3 v -0.6242202548 1.3639461402 3 v -0.7572691569 1.29481405 3 v -0.8827516759 1.2127446057 3 v -0.9994140319 1.1185578183 3 v -1.1060905733 1.0131947708 3 v -1.2017154233 0.8977082162 3 v -1.2853331301 0.7732520577 3 v -1.356108213 0.6410698204 3 v -1.413333511 0.5024822252 3 v -1.4564372477 0.3588739938 3 v -1.4849887449 0.2116800121 3 v -1.4987027254 0.0623709936 3 v -1.4974421637 -0.0875612151 3 v -1.4812196549 -0.2366185412 3 v -1.4501972889 -0.383311653 3 v -1.4046850309 -0.5261748415 3 v -1.3451376245 -0.6637806649 3 v -1.2721500476 -0.7947542114 3 v -1.1864515679 -0.9177868364 3 v -1.0888984563 -1.0316492388 3 v -0.9804654313 -1.135203743 3 v -0.8622359198 -1.2274156666 3 v -0.735391232 -1.3073636586 3 v -0.6011987581 -1.3742489051 3 v -0.460999305 -1.4274031108 3 v -0.3161936991 -1.4662951765 3 v -0.1682287904 -1.4905365055 3 v -0.0185829952 -1.4998848863 3 v 0.1312484752 -1.4942469133 3 v 0.2797685541 -1.4736789189 3 v 0.4254932782 -1.438386412 3 v 0.5669666141 -1.3887220235 3 v 0.702775007 -1.3251819836 3 v 0.8315615043 -1.2484011633 3 v 0.9520393139 -1.1591467313 3 v 1.0630046614 -1.0583104884 3 v 1.1633488178 -0.9468999568 3 v 1.2520691773 -0.8260283139 3 v 1.3282792754 -0.6969032691 3 v 1.3912176461 -0.5608149972 3 v 1.44025543 -0.4191232473 3 v 1.4749026577 -0.2732437564 3 v 1.4948131455 -0.1246341042 3 v 1.4997879546 0.0252208507 3 v 1.4897773781 0.1748238073 3 v 1.4648814386 0.3226799821 3 v 1.4253488879 0.4673120453 3 v 1.3715747224 0.6072748809 3 v 1.3040962355 0.7411700267 3 v 1.2235876502 0.8676596466 3 v 1.1308533815 0.9854798981 3 v 1.0268199997 1.0934535602 3 v 0.9125269718 1.1905017958 3 v 0.7891162761 1.2756549309 3 v 0.6578209914 1.3480621437 3 v 0.5199529768 1.4069999652 3 v 0.3768897639 1.451879508 3 v 0.2300607931 1.4822523508 3 v 0.0809331308 1.4978150181 3 | f 1 2 65 f 2 65 66 f 2 3 66 f 3 66 67 f 3 4 67 f 4 67 68 f 4 5 68 f 5 68 69 f 5 6 69 f 6 69 70 f 6 7 70 f 7 70 71 f 7 8 71 f 8 71 72 f 8 9 72 f 9 72 73 f 9 10 73 f 10 73 74 f 10 11 74 f 11 74 75 f 11 12 75 f 12 75 76 f 12 13 76 f 13 76 77 f 13 14 77 f 14 77 78 f 14 15 78 f 15 78 79 f 15 16 79 f 16 79 80 f 16 17 80 f 17 80 81 f 17 18 81 f 18 81 82 f 18 19 82 f 19 82 83 f 19 20 83 f 20 83 84 f 20 21 84 f 21 84 85 f 21 22 85 f 22 85 86 f 22 23 86 f 23 86 87 f 23 24 87 f 24 87 88 f 24 25 88 f 25 88 89 f 25 26 89 f 26 89 90 f 26 27 90 f 27 90 91 f 27 28 91 f 28 91 92 f 28 29 92 f 29 92 93 f 29 30 93 f 30 93 94 f 30 31 94 f 31 94 95 f 31 32 95 f 32 95 96 f 32 33 96 f 33 96 97 | f 33 34 97 f 34 97 98 f 34 35 98 f 35 98 99 f 35 36 99 f 36 99 100 f 36 37 100 f 37 100 101 f 37 38 101 f 38 101 102 f 38 39 102 f 39 102 103 f 39 40 103 f 40 103 104 f 40 41 104 f 41 104 105 f 41 42 105 f 42 105 106 f 42 43 106 f 43 106 107 f 43 44 107 f 44 107 108 f 44 45 108 f 45 108 109 f 45 46 109 f 46 109 110 f 46 47 110 f 47 110 111 f 47 48 111 f 48 111 112 f 48 49 112 f 49 112 113 f 49 50 113 f 50 113 114 f 50 51 114 f 51 114 115 f 51 52 115 f 52 115 116 f 52 53 116 f 53 116 117 f 53 54 117 f 54 117 118 f 54 55 118 f 55 118 119 f 55 56 119 f 56 119 120 f 56 57 120 f 57 120 121 f 57 58 121 f 58 121 122 f 58 59 122 f 59 122 123 f 59 60 123 f 60 123 124 f 60 61 124 f 61 124 125 f 61 62 125 f 62 125 126 f 62 63 126 f 63 126 127 f 63 64 127 f 64 127 128 f 64 65 128 f 1 128 65 f 1 2 65 |
Puede parecer una locura pero en muchos casos salva de un aprieto en casos complicadas.
It may sound crazy but in many cases it saves a tight spot in complicated cases.
A new example with the tatispiral:
It is very easy make its 3d view:
No hay comentarios:
Publicar un comentario