2016-04-21 169 views
0

我從一個3D程序調用meshlab它看起來像這樣導出的JSON文件:轉換從JSON座標轉換成SVG

"version" : "0.1.0", 

    "comment" : "Generated by MeshLab JSON Exporter", 

    "id"  : 1, 
    "name" : "mesh", 

    "vertices" : 
    [ 
    { 
     "name"  : "position_buffer", 
     "size"  : 3, 
     "type"  : "float32", 
     "normalized" : false, 
     "values"  : 
     [ 
     10.3699, 12.1765, -10.4026, 10.2183, 12.2671, -10.6368, 10.4694, 12.5508, -10.6256, 8.86401, 12.667, -11.1871, 8.92628, 12.4419, -11.0507, 8.78183, 12.459, -11.0468, 10.4707, 14.5984, -11.6066, 10.609, 14.3137, -11.4362, 10.4292, 14.2369, -11.5423, 8.21309, 12.9991, -11.2778, 
     8.335, 12.6943, -11.1197, 7.90955, 12.6514, -10.9905, 8.12493, 13.419, -11.473, 7.60838, 13.2001, -11.2427, 8.67802, 13.055, -11.3789, 8.602, 12.7194, -11.1796, 10.2127, 12.4886, -10.8037, 10.3542, 14.5035, -11.6542, 10.1942, 14.4931, -11.7254, 10.2228, 14.7139, -11.7583, 
     10.0646, 13.1853, -11.4635, 9.83183, 13.1732, -11.606, 9.92727, 13.5153, -11.724, 9.50445, 14.5415, -11.9295, 9.38199, 14.7579, -12.0099, 9.64501, 14.8129, -11.9789, 9.64232, 13.0623, -11.5911, 9.60978, 13.2303, -11.6906, 10.6325, 14.813, -11.5264, 10.7926, 15.183, -11.4228, 
     10.9659,....... 

我想這些都是座標,但是我倒是用這些並創建一個svg文件,我怎麼這樣做?或者只是將一個meshlab文件轉換爲svg,這可能嗎?

+0

如果它們是2D座標,則可以使用適當的viewBox和具有值作爲路徑的「d」屬性的「path」元素創建SVG。只需在第一個值之前插入「M」即可。但是,除非您打算製作一系列重疊的三角形,否則數據似乎不是多段線數據。 –

回答

0

我用inkskape最後將obj文件導出到svg。