Giter Site home page Giter Site logo

richardscottoz / gocad_ts-surface-reader Goto Github PK

View Code? Open in Web Editor NEW
9.0 1.0 1.0 23 KB

Script to retrieve the vertices and faces from a GOCAD TS file for use in python processing

Python 21.46% Jupyter Notebook 78.54%
3d-models geoscience open-data geology python surfaces gocad

gocad_ts-surface-reader's Introduction

GOCAD_TS-Surface-Reader

Script to retrieve the vertices and faces from a GOCAD TS file for use in python processing

Overview

A GOCAD TS file contains 3-D information - what we are interested in is the vertices and faces. The vertices contain the X, Y, Z locations and the faces how these triangles relate to each other.

Data Format

There is a header that the check metadata function takes some information from. Information (perhaps) on the Coordinate Reference System, the RGB colors in 0-1 RGB, the Z reference direction and others.

The data part of the files contains VRTX or PRTX lines that have the point information and TRGL lines that have the face information. These have ascending integer IDs.

Also there can be ATOM lines which reference a previous point's VRTX - apparently to have a topologically distinct reference that shares the same location data - which doesn't matter if all you want is X, Y, Z, but needs handling.

Information

http://paulbourke.net/dataformats/gocad/gocad.pdf

Basics

Pass the TS file path to the read function.

image

Notes

There may be other formatting varieties for TS files I am unfamiliar with, it was just written to handle this particular case. Logic should be easily extensible.

Others

geoh5py - The free Geoscience Analyst viewer can import TS files and export to geoh5 format from which you can use https://github.com/MiraGeoscience/geoh5py and lazy load data.

Just found this: - https://www.opengeosys.org/docs/tools/fileio/gocadtsurfacereader/

Visualisation

PyVista - https://github.com/pyvista/pyvista

Thanks

This is all basically because of the idea from https://github.com/domfournier

https://programtalk.com/vs2/python/12012/simpeg/SimPEG/Utils/io_utils.py/

The GemGIS package uses the above: https://github.com/cgre-aachen/gemgis

Sample data source thanks to SARIG https://sarigbasis.pir.sa.gov.au/WebtopEw/ws/samref/sarig1/cat0/Record?w=catno%3D2036881+OR+catno%3D2036883+OR+catno%3D2036887&sid=c2ca73f5685c43249e6c1ab5ec7dc2e5&set=1&m=3

gocad_ts-surface-reader's People

Contributors

richardscottoz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.