Giter VIP home page Giter VIP logo

startinpy's Introduction

GitHub license PyPI version

startinpy

Python bindings for startin, a Delaunay triangulator for the modelling of terrains.

Installation

pip

To install the latest release: pip install startinpy

Development

  1. install Rust (v1.39+)
  2. install maturin
  3. maturin develop
  4. move to another folder, and import startinpy shouldn't return any error

Documentation

Simple documentation of the API is available in the folder /docs/

Examples

import startinpy

pts = []
pts.append([0.0, 0.0, 11.11])
pts.append([1.0, 0.0, 22.22])
pts.append([1.0, 1.0, 33.33])
pts.append([0.0, 1.0, 44])
pts.append([0.5, 0.49, 44])
pts.append([0.45, 0.69, 44])
pts.append([0.65, 0.49, 44])
pts.append([0.75, 0.29, 44])
pts.append([1.5, 1.49, 44])
pts.append([0.6, 0.2, 44])
pts.append([0.45, 0.4, 44])
pts.append([0.1, 0.8, 44])

t = startinpy.DT()
t.insert(pts)

#-- remove vertex #4
t.remove(4)

print("# vertices:", t.number_of_vertices())
print("# triangles:", t.number_of_triangles())

print("CH: ", t.convex_hull())

itrs = t.incident_triangles_to_vertex(4);
print(itrs)

print(t.is_triangle([4, 12, 6]) )
print(t.is_triangle([5, 12, 6]) )

print("--- /Vertices ---")
for each in t.all_vertices():
    print(each)
print("--- Vertices/ ---")

alltr = t.all_triangles()
print(alltr[3])

It can read LAS/LAZ and output OBJ files too:

import startinpy

t = startinpy.DT()
t.read_las("/home/elvis/myfile.laz")

print("# vertices:", t.number_of_vertices())
print("# triangles:", t.number_of_triangles())

t.write_obj("/home/elvis/output.obj")

startinpy's People

Contributors

hugoledoux 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.