Skip to main content

A Delaunay triangulator for terrains

Project description

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")

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.7.8-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl (404.1 kB view hashes)

Uploaded PyPy manylinux: glibc 2.5+ x86-64

startinpy-0.7.8-cp310-none-win_amd64.whl (321.6 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

startinpy-0.7.8-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl (403.6 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.5+ x86-64

startinpy-0.7.8-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (701.1 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.7.8-cp39-none-win_amd64.whl (324.5 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

startinpy-0.7.8-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (406.2 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.5+ x86-64

startinpy-0.7.8-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (706.2 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.7.8-cp38-none-win_amd64.whl (322.1 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

startinpy-0.7.8-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (403.8 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.5+ x86-64

startinpy-0.7.8-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (701.5 kB view hashes)

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

startinpy-0.7.8-cp37-none-win_amd64.whl (321.9 kB view hashes)

Uploaded CPython 3.7 Windows x86-64

startinpy-0.7.8-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (403.8 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.5+ x86-64

startinpy-0.7.8-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (701.5 kB view hashes)

Uploaded CPython 3.7m 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