Git Product home page Git Product logo

vst-converter's Introduction

VST-converter

Converter for 3d mesh "VST" (ViSTa) files into modern 3d mesh files.

2 versions available:

  • VST-converter.html: raw javascript; developed stopped at "patch" level and continued on VST-converter-kaitai.html
  • VST-converter-kaitai.html: based on VST parsing library created with kaitai-struct; please use this one; requires VST.js in same folder; this file was automatically created by kaitai-struct using my VST.ksy file. Such file can also be used to automatically create a VST library for other languages (java, c, c++. Perl, PHP, Python...)
  • others: other tools found around on forum or repositories
    • VST2OBJ: converts to Wavefront .obj format; DOS executable
    • VST2X3D: converts to X3D format; DOS execxutable; source code available

NASA used for Spirit and Opportunity rovers (MER - Mars Exploration Rovers) some peculiar file formats to store 3d reconstructions of terrain:

VST format

immagine

  • A .vst file contains multiple "Levels Of Depth" (LODs), i.e. multiple "3d files", each one with different resolution.
  • The higher the index of the LOD in the file, the higher is its resolution (= number of triangles)
  • Each LOD can contain 1 ore more "patches".
  • Each patch can contain a number of "arrays"
  • An array can be interpreted as a "group of faces" (triangles strip) or a "point cloud", depending on a patch flag at offset 0x04 in patch header (0 = face, 1 = point cloud)

In case the array represents a triangle strip, its values must be read stright or in reverse depending on position of triplet in the array:

image

All of this means that each .VST file can be converted to a number of 3d files (one per each LOD) with different resolutions.

Archive of .vst files for MER Spirit: https://pds-imaging.jpl.nasa.gov/data/mer/spirit/mer2mw_0xxx/data/


There were 4 cameras onboard:

  • 1 Pancam
  • 1 Navcam
  • 2 Hazcams (front and rear)

image

Products/images are grouped by "site", i.e. reference points fixed along rover course; at each site 1 ore more "observations" may be associated.


PLY format for reference

ply                         magic string
format ascii 1.0            ascii/binary, format version number 
comment made by anonymous   a comment starts by "comment" keyword 
element vertex VVVV         number of vertex in the file 
property float32 x          ok 
property float32 y          ok  
property float32 z          ok  
element face FFFF           number of faces in the file 
property list uint8 int32 vertex_index     each face is a list of int32 pointers to vertex; how many pointers is 
                                           given by an uint8 value before the values
end_header                  delimits the end of the header 
0 0 0                       start of vertex list 
0 0 1
0 1 1
0 1 0
1 0 0
1 0 1
1 1 1
1 1 0
3 0 1 2                   start of face list; in VST format all faces are triangles.
3 7 6 5 
3 0 4 5 
3 1 5 6 
3 2 6 7 
3 3 7 4 

Files repositories

Naming convention

Visible images

Mesh/3d (.ht, .vst, .pfb)

Query to list all available XYZ products for a specified site:

query

Split:

Once you get the count of results, use this query to get all of them in CSV format:

query (please use needed number of rows/result)

https://pds-imaging.jpl.nasa.gov/solr/pds_archives/search? identifier=*xyl* pds.FILTER_NAME=*l* pds.INSTRUMENT_HOST_ID=MERA/MER2/Spirit pds.atlas_instrument_name=pancam pds.ROVER_MOTION_COUNTER_SITE=137 wt=csv rows=1000 fl=FILE_NAME fl=FILTER_NAME fl=SEQUENCE_ID fl=INSTRUMENT_HOST_ID

Mosaics

Textures (FFL) for VST files:

Navcam

Hazcam

API for Queries:

Query 1

To look for available images for texturing,you can use this query, which can be split in:

  • https://pds-imaging.jpl.nasa.gov/solr/pds_archives/search? * - base address*
  • mission=mars*exploration*rover - mission
  • product_type="mer" - processed images
  • pds.ROVER_INSTRUMENT_ELEVATION=[-90 to 5] - elevation of pancam (interval)
  • pds.ROVER_MOTION_COUNTER_SITE=137 - Site 137 (final position)
  • pds.FILTER_NAME=*L7* - Filters are L2, L3, L4, L5, l6, L7; combine L2 + L5 + L7 to create colore texture
  • pds.eye=left - left camera

Query 2

A more advanced query allows listing only the filenames corresponding to specified parameter, and allows combining multiple values for filter by "OR" operator:

https://pds-imaging.jpl.nasa.gov/solr/pds_archives/search?pds.FILTER_NAME=*l2*&pds.FILTER_NAME=\*l7\*&&spacecraft_name=spirit&atlas_instrument_name=pancam&mission=mars*exploration*rover&pds.ROVER_MOTION_COUNTER_SITE=137&wt=json&fl=FILE_NAME&rows=1000

Split:

  • https://pds-imaging.jpl.nasa.gov/solr/pds_archives/search?
  • pds.FILTER_NAME=*l2*
  • pds.FILTER_NAME=*l7* - Repeating same parameter with different values results in "OR"
  • spacecraft_name=spirit
  • atlas_instrument_name=pancam
  • mission=mars*exploration*rover
  • pds.ROVER_MOTION_COUNTER_SITE=137
  • wt=json - output format: default=json; available: xml, csv, ..?
  • fl=FILE_NAME - fields in output
  • rows=1000 - output size

Folders

All links refer to navcam images for sol 1869 and site 137, the last site before Spirit got trapped in the "sand trap" of Troy, where its mission ended.

Focusing on specific product: 2n292280938xxxxxxxxxx

Explanation of generic 2N292280938...B100P0703L0M1 name:

  • 2 = MER2
  • N = NAVCAM
  • 292280938 = Sol 1869
  • ... = Product type (XYZ, VIL, FFL,...)
  • B1 = Site 137
  • 00 = Position 0
  • P = Navcam/Pancam observation
  • 0703 = Observation n.0703
  • L = Left camera
  • 0 = no filter
  • M = Creator of the file
  • 1 = version of the file

Available 3d products:

Visual representation of XYZ product; not technically useful because it mixes X, Y and Z data, but useful for a visual overview:

image (Download it from notebook)

Visible image:

image

vst-converter's People

Contributors

jumpjack avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

sgi-demos

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.