项目作者: BeardedBeaver

项目描述 :
Library for D programming language that provides tools to work with surfaces (2D grids)
高级语言: D
项目地址: git://github.com/BeardedBeaver/dsurf.git
创建时间: 2019-12-05T17:58:29Z
项目社区:https://github.com/BeardedBeaver/dsurf

开源协议:MIT License

下载


dsurf

Library for D programming language that provides tools to work with surfaces (2D grids)

D D

Simple library for D to deal with surfaces (2D grids). Regular cartesian-cell 2D grids currently are supported.

Information

Documentation is available here

Author: Dmitriy Linev

License: MIT

Features

  • Import 2D grids from popular formats
  • Perform arithmetic calculations with 2D grids
  • Export to popular formats to be able to open it in special software (like Golden Software Surfer or Schlumberger Petrel)

Supported import formats

  • CPS-3 ASCII
  • ZMap+
  • IRAP Classic ASCII (aka ROXAR text)

Supported export formats

  • CPS-3 ASCII
  • ZMap+
  • IRAP Classic ASCII (aka ROXAR text)

Example

  1. auto surface = new CartesianSurface;
  2. surface.loadFromFile("./data/surface.cps");
  3. // perform some serious calculation
  4. foreach(i; 0 .. surface.nx) {
  5. foreach(j; 0 .. surface.ny) {
  6. surface.z[i][j] = someSeriousCalculation();
  7. }
  8. }
  9. // inverse Z axis polarity for export
  10. surface *= -1;
  11. surface.saveToFile("./data/calculated.cps", "cps");

Package content

Directory Contents
./source Source code.
./test Unittest data.

Installation

dsurf is available in dub. If you’re using dub run dub add dsurf in your project folder and dub will add dependency and fetch the latest version.