Skip to main content

A Delaunay triangulator for terrains

Project description

PyPI docs GitHub license

startinpy

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

Installation

pip

To install the latest release: pip install startinpy

If you want to compile it yourself

  1. install latest Rust
  2. install maturin
  3. maturin build --release
  4. cd ./target/wheels/
  5. pip install [name-wheel].whl will install it to your local Python

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

https://startinpy.rtfd.io

Examples

import startinpy
import numpy as np

#-- generate 100 points randomly in the plane
rng = np.random.default_rng()
pts = rng.random((100, 3))
pts = pts * 100

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

#-- remove vertex #4
try:
    dt.remove(4)
except Exception as e:
    print(e)

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

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

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

print("--- /Points ---")
for each in dt.points:
    print(each)
print("--- Points/ ---")

alltr = dt.triangles
print(alltr[3])

zhat = dt.interpolate({"method": "TIN"}, [[55.2, 33.1]])
print("result: ", zhat[0])

It can read LAS/LAZ and output GeoJSON 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_geojson("/home/elvis/output.geojson")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

startinpy-0.10.2-cp312-none-win_amd64.whl (378.9 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

startinpy-0.10.2-cp312-cp312-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (860.5 kB view hashes)

Uploaded CPython 3.12 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

startinpy-0.10.2-cp311-none-win_amd64.whl (378.9 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

startinpy-0.10.2-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (860.4 kB view hashes)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

startinpy-0.10.2-cp310-none-win_amd64.whl (378.9 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

startinpy-0.10.2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (860.4 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

startinpy-0.10.2-cp39-none-win_amd64.whl (379.0 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

startinpy-0.10.2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (860.8 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

startinpy-0.10.2-cp38-none-win_amd64.whl (379.0 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

startinpy-0.10.2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (859.2 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page