Meshing on a Manifold¶
In [1]:
import numpy as np
import os
import pandas as pd
import gstlearn as gl
import gstlearn.document as gdoc
import plotly.graph_objects as go
import gstlearn.plot3D as gop
import IPython
In [2]:
filetri = gdoc.loadData("Meshings", "cow_mesh.txt")
filepts = gdoc.loadData("Meshings", "cow_points.txt")
In [3]:
csv = gl.CSVformat(False, 0, ' ', '.')
In [4]:
triangles = pd.read_csv(filetri,header=None,sep=" ").values
points = pd.read_csv(filepts,header=None,sep=" ").values
In [5]:
cow = gop.Scatter(points[:,0],points[:,1],points[:,2],mode='markers',m_size=0.3)
cow['x'].tolist()
cow['y'].tolist()
cow['z'].tolist()
Out[5]:
[-0.0832331, 0.881192, 0.122726, 0.828702, 0.443969, 0.425693, -0.00655663, 0.858547, 0.46681, 0.166423, -0.185668, -0.0759521, 0.663157, 0.421981, 0.180766, 0.17897, 0.664126, 0.649153, 0.951731, 0.901606, 0.303098, 0.0875537, -0.141343, -0.0697762, 0.700393, 0.873657, 0.864938, 0.680112, 0.672286, 0.205838, 0.273861, 0.435279, 0.488052, -0.0179554, -0.238574, -0.0428095, -0.375494, -0.517721, -0.437134, -0.437696, -0.579853, -0.641468, -0.0650069, 0.872426, 0.116597, -0.0628489, 0.714233, 0.12474, 0.705429, 0.877017, -0.369897, -0.148279, -0.137191, -0.321196, -0.233457, -0.150855, -0.213075, -0.196407, -0.563016, -0.665066, -0.241591, -0.305384, -0.450564, -0.616155, -0.449072, -0.307668, 0.0615192, -0.0677048, 0.139538, 0.0388631, 0.0586613, -0.0597107, -0.189369, 0.726548, 0.415511, 0.312719, 0.49566, 0.891691, 0.971379, 0.711025, 0.891171, -0.232094, -0.313374, -0.282029, -0.256021, -0.222054, -0.211465, -0.334104, -0.351846, -0.294366, -0.288229, -0.28348, -0.244881, -0.196152, -0.233186, 0.243094, 0.58188, 0.417533, 0.208739, 0.606421, 0.94527, 0.968533, 0.975253, 0.987177, 0.995507, 1.02473, 1.0112, 1.04807, 1.02642, -0.0832331, 0.881192, 0.122726, 0.828702, 0.443969, 0.425693, -0.00655663, 0.858547, 0.46681, 0.166423, -0.185668, -0.0759521, 0.663157, 0.421981, 0.180766, 0.17897, 0.664126, 0.649153, 0.951731, 0.901606, 0.303098, 0.0875537, -0.141343, -0.0697762, 0.700393, 0.873657, 0.864938, 0.680112, 0.672286, 0.205838, 0.273861, 0.435279, 0.488052, -0.0179554, -0.238574, -0.0428095, -0.375494, -0.517721, -0.437134, -0.437696, -0.579853, -0.641468, -0.0650069, 0.872426, 0.116597, -0.0628489, 0.714233, 0.12474, 0.705429, 0.877017, -0.369897, -0.148279, -0.137191, -0.321196, -0.233457, -0.150855, -0.213075, -0.232094, -0.313374, -0.282029, -0.256021, -0.222054, -0.211465, -0.334104, -0.351846, -0.294366, -0.288229, -0.28348, -0.244881, -0.196152, -0.233186, 0.243094, 0.58188, 0.417533, 0.94527, 0.968533, 0.975253, 1.02473, 1.0112, 0.42339, 0.300839, 0.214165, 0.305622, 0.304857, 0.538527, 0.619945, 0.538732, 0.536591, -0.117452, -0.145022, -0.146058, -0.0778193, -0.133147, -0.049691, -0.181103, -0.0759725, -0.128413, 0.870674, 0.922518, 0.935739, 0.922409, 0.919674, 0.046235, 0.176197, 0.0306159, 0.0359591, 0.311653, 0.430338, 0.308248, 0.438729, 0.188168, 0.324829, 0.315412, 0.0908221, 0.0609153, 0.778577, 0.657949, 0.773747, 0.775339, 0.863571, 0.668828, 0.774019, 0.774308, 0.560904, 0.551664, 0.556564, 0.544579, 0.110217, 0.20555, 0.293418, 0.189589, 0.204008, 0.366223, 0.39384, 0.478658, 0.382954, 0.770725, 0.689709, 0.796578, 0.854887, 0.78245, 0.593509, 0.574769, 0.584394, 0.239516, 0.454173, 0.344192, 0.675079, 0.848168, 0.77107, -0.0300482, 0.0639197, 0.0118342, 0.566851, 0.142973, -0.170355, -0.114007, 0.0162651, -0.0722104, -0.301318, -0.203773, -0.0269037, -0.153862, -0.362924, -0.502892, -0.502727, -0.423508, -0.630217, -0.601302, -0.446528, -0.563292, 0.0309463, 0.147407, 0.0245746, -0.0918856, 0.0266899, 0.898863, 0.796995, 0.68654, 0.788408, 0.793448, 0.89062, 0.678753, 0.78431, 0.795932, 0.691599, 0.896274, 0.796447, 0.647127, 0.930804, 0.150832, -0.0885122, 0.0297109, -0.0767316, -0.124285, 0.141914, 0.188527, 0.0342915, 0.0317575, -0.416318, -0.257283, -0.0907886, -0.276654, -0.109989, -0.185683, -0.168661, -0.145207, -0.141546, -0.341185, -0.283895, -0.278418, -0.288914, -0.177367, -0.230461, 0.223298, 0.309872, 0.127906, 0.216664, 0.602086, 0.708099, 0.493766, 0.599773, 0.810651, 0.886255, 0.806775, -0.00187701, -0.0665397, 0.0879789, 0.0126968, 0.810009, 0.714357, 0.891624, 0.804765, 0.401284, 0.399618, 0.0716557, 0.0284499, 0.0605597, 0.0515977, 0.0340513, 0.0360884, -0.507325, -0.444831, -0.484754, -0.556974, -0.502061, -0.623842, -0.661549, -0.620153, 0.943676, 0.966789, 0.941915, -0.138523, -0.197022, -0.142323, -0.225378, -0.217551, -0.214493, -0.264918, -0.285229, -0.238883, -0.369301, -0.445501, -0.359834, -0.539369, -0.611191, -0.534091, -0.661348, -0.657355, -0.0978848, 0.0118372, -0.0276065, -0.415496, -0.451998, -0.287909, -0.304334, -0.253016, -0.236591, -0.26973, -0.323732, -0.337706, -0.300184, -0.258627, -0.305321, -0.220186, -0.21903, -0.190531, -0.215131, -0.208712, -0.339255, -0.28966, -0.324328, -0.327105, -0.248502, -0.248877, -0.249204, -0.207433, -0.257453, -0.22883, -0.238497, -0.332259, -0.304714, -0.180043, -0.181175, -0.199395, -0.129116, -0.158189, -0.304368, -0.386065, -0.378707, -0.373587, -0.246303, -0.247459, -0.365196, -0.329392, -0.251136, -0.297102, -0.285836, -0.320358, -0.222912, -0.247801, -0.224154, 0.612794, 0.517662, 0.419816, 0.527871, 0.666605, 0.60015, 0.655449, 0.210992, 0.218582, 0.12884, 0.15006, 0.313909, 0.307624, 0.519852, 0.416032, 0.518132, 0.307563, 0.310407, 0.950827, 0.976341, 0.957881, 0.965091, 0.961976, 0.917853, 0.930645, 0.926767, 0.907717, 0.980957, 0.946137, 0.940397, 0.989219, 0.98554, 0.979468, 1.00541, 1.01945, 0.994894, 0.997263, 1.02513, 1.04059, 1.01839, 1.02001, 1.00911, 1.00299, 1.04431, 1.03686, 0.305622, 0.214165, 0.300839, 0.42339, 0.304857, 0.538732, 0.619945, 0.538527, 0.536591, -0.0778193, -0.146058, -0.145022, -0.117452, -0.133147, -0.0759725, -0.181103, -0.049691, -0.128413, 0.922409, 0.935739, 0.922518, 0.870674, 0.919674, 0.0306159, 0.176197, 0.046235, 0.0359591, 0.430338, 0.311653, 0.308248, 0.324829, 0.188168, 0.438729, 0.315412, 0.0908221, 0.0609153, 0.773747, 0.657949, 0.778577, 0.775339, 0.774019, 0.668828, 0.863571, 0.774308, 0.551664, 0.560904, 0.556564, 0.544579, 0.189589, 0.293418, 0.20555, 0.110217, 0.204008, 0.478658, 0.39384, 0.366223, 0.382954, 0.854887, 0.796578, 0.689709, 0.770725, 0.78245, 0.574769, 0.593509, 0.584394, 0.454173, 0.239516, 0.344192, 0.848168, 0.675079, 0.77107, 0.0639197, -0.0300482, 0.0118342, 0.566851, 0.142973, 0.0162651, -0.114007, -0.170355, -0.0722104, -0.0269037, -0.203773, -0.301318, -0.153862, -0.502727, -0.502892, -0.362924, -0.423508, -0.446528, -0.601302, -0.630217, -0.563292, -0.0918856, 0.0245746, 0.147407, 0.0309463, 0.0266899, 0.788408, 0.68654, 0.796995, 0.898863, 0.793448, 0.678753, 0.89062, 0.78431, 0.896274, 0.691599, 0.795932, 0.796447, 0.647127, 0.930804, -0.0885122, 0.150832, 0.0297109, -0.0767316, -0.124285, 0.141914, 0.188527, 0.0342915, 0.0317575, -0.0907886, -0.257283, -0.416318, -0.276654, -0.145207, -0.168661, -0.185683, -0.109989, -0.141546, -0.283895, -0.341185, -0.278418, -0.177367, -0.288914, -0.230461, 0.127906, 0.309872, 0.216664, 0.493766, 0.708099, 0.599773, 0.886255, 0.806775, 0.0879789, -0.0665397, 0.0126968, 0.891624, 0.714357, 0.804765, 0.399618, 0.0284499, 0.0605597, 0.0340513, 0.0360884, -0.556974, -0.484754, -0.444831, -0.502061, -0.661549, -0.620153, 0.966789, 0.941915, -0.197022, -0.142323, -0.217551, -0.214493, -0.285229, -0.238883, -0.445501, -0.359834, -0.611191, -0.534091, -0.657355, -0.0978848, -0.0276065, -0.415496, -0.451998, -0.236591, -0.253016, -0.304334, -0.287909, -0.26973, -0.258627, -0.300184, -0.337706, -0.323732, -0.305321, -0.215131, -0.190531, -0.21903, -0.220186, -0.208712, -0.324328, -0.28966, -0.339255, -0.327105, -0.248877, -0.248502, -0.249204, -0.257453, -0.207433, -0.22883, -0.332259, -0.238497, -0.304714, -0.180043, -0.181175, -0.199395, -0.158189, -0.386065, -0.304368, -0.373587, -0.247459, -0.365196, -0.251136, -0.329392, -0.297102, -0.285836, -0.320358, -0.222912, -0.247801, -0.224154, 0.419816, 0.517662, 0.612794, 0.527871, 0.60015, 0.655449, 0.218582, 0.210992, 0.15006, 0.313909, 0.307624, 0.416032, 0.518132, 0.310407, 0.957881, 0.976341, 0.950827, 0.965091, 0.917853, 0.961976, 0.930645, 0.926767, 0.907717, 0.980957, 0.940397, 0.989219, 0.979468, 0.994894, 1.01945, 1.00541, 0.997263, 1.04059, 1.01839, 1.02001, 1.00299, 1.03686, 0.424303, 0.363044, 0.305485, 0.366232, 0.364448, 0.361842, 0.302332, 0.422701, 0.362137, 0.202318, 0.252658, 0.239358, 0.245486, 0.244783, 0.208415, 0.250199, 0.483083, 0.536815, 0.482067, 0.482265, 0.624003, 0.584476, 0.592146, 0.586435, 0.595789, 0.53835, 0.631406, 0.591118, 0.480871, 0.481825, -0.11045, -0.12322, -0.11242, -0.0802831, -0.110308, -0.113872, -0.142628, -0.10631, -0.121531, -0.170002, -0.142015, -0.170045, -0.160037, -0.0746981, -0.112945, -0.114171, -0.0317095, -0.0928838, -0.106821, -0.0438498, -0.0724007, -0.141507, -0.0619102, -0.106124, -0.188613, -0.157469, -0.168768, -0.105989, -0.165362, -0.137241, 0.875405, 0.900577, 0.919903, 0.909752, 0.904292, 0.897882, 0.920604, 0.867139, 0.898482, 0.945024, 0.93026, 0.93974, 0.935335, 0.920339, 0.922781, 0.924128, -0.0267162, 0.032671, -0.0337268, -0.0306343, -0.015664, 0.0406057, -0.0217878, 0.178025, 0.105277, 0.112764, 0.108528, 0.102343, 0.175939, 0.103665, 0.306674, 0.370431, 0.427814, 0.36828, 0.243679, 0.243084, 0.247084, 0.309953, 0.245143, 0.432936, 0.374406, 0.372527, 0.440867, 0.377674, 0.319025, 0.384517, 0.380331, 0.313214, 0.437038, 0.375911, 0.183762, 0.252169, 0.24911, 0.265179, 0.195141, 0.257209, 0.0389716, 0.0731655, 0.00235778, 0.0175237, 0.123634, 0.147082, 0.133083, 0.0524717, 0.117331, -0.00816016, 0.835552, 0.77666, 0.82767, 0.831349, 0.654176, 0.717453, 0.716014, 0.715872, 0.720092, 0.774295, 0.661246, 0.718796, 0.822794, 0.824743, 0.86163, 0.821642, 0.774453, 0.818942, 0.82069, 0.773912, 0.864211, 0.822052, 0.666645, 0.72292, 0.72153, 0.724795, 0.670701, 0.724072, 0.502911, 0.55865, 0.498352, 0.500374, 0.613383, 0.617509, 0.615492, 0.608144, 0.554338, 0.610995, 0.494204, 0.496433, 0.488079, 0.541229, 0.485189, 0.548235, 0.491251, 0.600763, 0.604646, 0.596759, 0.118078, 0.157829, 0.200112, 0.151405, 0.158942, 0.151795, 0.204606, 0.0997486, 0.153286, 0.298974, 0.249012, 0.255682, 0.252836, 0.230557, 0.285394, 0.242242, 0.415447, 0.375362, 0.429644, 0.472953, 0.423, 0.337805, 0.319056, 0.32963, 0.348704, 0.389084, 0.344018, 0.48375, 0.439843, 0.435289, 0.805621, 0.775527, 0.821548, 0.841201, 0.811853, 0.684497, 0.738197, 0.728207, 0.732548, 0.750387, 0.789706, 0.695193, 0.744396, 0.865373, 0.837992, 0.830304, 0.530777, 0.579487, 0.520397, 0.525634, 0.539805, 0.589175, 0.535582, 0.637907, 0.647569, 0.642915, 0.628487, 0.632959, 0.333602, 0.398635, 0.448549, 0.390867, 0.221415, 0.291075, 0.277027, 0.355449, 0.257783, 0.305644, 0.460405, 0.407077, 0.673608, 0.725054, 0.772679, 0.724898, 0.769829, 0.67711, 0.725933, 0.838346, 0.812257, 0.807253, 0.854481, 0.816142, -0.0848536, -0.00953204, -0.0351077, -0.0616182, 0.0609139, 0.0258931, 0.0448664, 0.0981021, 0.0353559, 0.0768666, ...]
In [6]:
fig = go.Figure(data = [cow])
fig = fig.update_scenes(xaxis_visible=False, yaxis_visible=False, zaxis_visible=False )
fig = fig.show()