A collection of utility functions to prototype geometry processing research in python

Overview

gpytoolbox

This repo is a work in progress and contains general utility functions I have needed to code while trying to work on geometry process research in python. Most of them will be one-to-one correspondences with gptoolbox functions that I have used in my previous Matlab life and for which I have found no equivalence in existing libraries. Feel free to contribute by submitting a pull request!

Comments
  • Adding sample_mesh.py function

    Adding sample_mesh.py function

    Adding a function to sample a mesh. Future possible additions:

    • tet meshes (currently only polyline and triangle mesh)
    • blue noise (currently only uniform / white noise)

    We might want to consider deprecating random_points_on_polyline. For now, I have just updated that function to use sample_mesh.

    sample_mesh is also a nice example of how I think we should handle random number generation in the library in the future.

    opened by odedstein 2
  • Adding colormap functionality

    Adding colormap functionality

    Adding a function "colormap" that works like MATLAB's colormap, and then also "apply_colormap" to apply the colormap to a scalar function. I was not sure what exact interpolation behavior to choose for "apply_colormap", but MATLAB does piecewise constant, so I went with piecewise constant.

    opened by odedstein 1
  • Adding simple obj reader and writer

    Adding simple obj reader and writer

    So far for triangle meshes only.

    I have some confusion with the types that npe generates and the ones used in the Python library by convention. When should our functions return int32, and when should it be int64?

    opened by odedstein 1
  • Added new utility functions and updated doublearea formula

    Added new utility functions and updated doublearea formula

    Added the following utility functions:

    • halfedges
    • halfedge_lengths_squared
    • halfedge_lengths
    • edges
    • boundary_edges
    • boundary_loops

    Updated the doublearea function to use Kahan's formula.

    Added two new meshes as well as mesh credits to the unit test directory.

    opened by odedstein 1
  • fixing pip build error

    fixing pip build error

    It seems like the PyPi wheel for gpytoolbox in MacOs fails intermitently (it didn't use to fail, but pushing a trivial commit made it fail one hour after succeeding). It fails at installing numpy!

    opened by sgsellan 0
  • `signed_distance_polygon` returns nans if first polyline point is repeated

    `signed_distance_polygon` returns nans if first polyline point is repeated

    Sometimes, you'll see that a polyline is given with the last point being equal to the first to denote that it's closed. Currently, signed_distance_polygon does not support this and instead returns nan since it finds an edge with zero length. It'd be nice if the function just ignored zero-length edges instead of giving nans.

    enhancement 
    opened by sgsellan 0
  • png2poly rotates shape

    png2poly rotates shape

    Here's a png:

    octopus

    Running

    from gpytoolbox import png2poly
    poly = png2poly("octopus.png")[0]
    import matplotlib.pyplot as plt
    plt.plot(poly[:,0],poly[:,1])
    plt.show()
    

    for some reason produces a rotated polyline, as if the x and y coordinates were flipped:

    Screen Shot 2022-09-04 at 2 34 33 PM bug 
    opened by sgsellan 0
  • Better error messager for read/write mesh

    Better error messager for read/write mesh

    Instead of erroring with the C++ error code, the python code now interprets each C++ error code and provides an exception with a useful error message.

    opened by odedstein 0
  • Fixed dof solve

    Fixed dof solve

    Introduced function for solving a linear system with fixed degrees of freedom (the linear system is ignored on the fixed rows). This function attempts to behave similar to how gptoolbox's min_quad_with_fixed would behave on a non-symmetric matrix. In my opinion our min_quad_with_fixed is not the correct place for this functionality, since this is not a quadratic optimization problem with a symmetric matrix.

    This function is useful, for example, for finite difference Dirichlet boundary value problems.

    opened by odedstein 0
  • Bindings compilation times

    Bindings compilation times

    This separates all the bindings so that compilation can make use of parallelization. Also, changes some magic words in the numpyeigen calls so that it compiles faster.

    opened by sgsellan 0
  • Adding subdivision capability

    Adding subdivision capability

    This pull request adds a subdivide function that can be used to subdivide polylines and triangle meshes. Supports normal upsampling for polylines and triangle meshes, and loop subdivision for triangle meshes.

    Things to add to this in the future:

    • Spline subdivision for polylines
    • Upsampling for quad meshes
    • Catmull-Clark for quads and mixed quad/tri
    • Upsampling for tet meshes
    opened by odedstein 0
  • GMPlib certificate expiration

    GMPlib certificate expiration

    The SSL certificate in gmplib.org, from which libigl (and therefore us) downloads gmp, has expired, which causes curl (called to download gmp during our build) to fail. I merged #41 , a hotfix that changes our version of libigl to my PR branch sgsellan/libigl, but I am opening this issue so we have a reminder to revert this in the future when the libigl folks have converged on a solution.

    opened by sgsellan 0
  • remesh_botsch does not work for non-closed meshes

    remesh_botsch does not work for non-closed meshes

    I tried to remesh a non-closed/ watertight mesh with the remesh_botsch algorithm. Compared to a closed mesh (with almost the same size) it takes a lot longer (>100 times) and returns an error by exiting my python console.

    • Is your implementation not useable for non-closed meshes? The original paper has options for the boundary.
    enhancement 
    opened by EmJay276 11
Releases(v0.0.3)
Owner
Silvia Sellán
PhD student at University of Toronto Computer Science department.
Silvia Sellán
Similar looking domain detection using python fuzzywuzzy

Major cause of phishing and BEC incident is similar looking domain, if you detect it early, you can prevent incidents early, python fuzzywuzzy module let you do that

2 Nov 07, 2021
Small Python script to parse endlessh's output and print some neat statistics

endlessh_parser endlessh_parser is a small Python script that parses endlessh's output and prints some neat statistics about it Usage Install all the

ManicRobot 1 Oct 18, 2021
Check username

Checker-Oukee Check username It checks the available usernames and creates a new account for them Doesn't need proxies Create a file with usernames an

4 Jun 05, 2022
.bvh to .mcfunction file converter.

bvh-to-mcf .bvh file to .mcfunction converter

Hanmin Kim 28 Nov 21, 2022
A way to write regex with objects instead of strings.

Py Idiomatic Regex (AKA iregex) Documentation Available Here An easier way to write regex in Python using OOP instead of strings. Makes the code much

Ryan Peach 18 Nov 15, 2021
A small python library that helps you to generate localization strings for your mobile projects.

LocalizationUtiltiy A small python library that helps you to generate localization strings for your mobile projects. This small script aims to help yo

1 Nov 12, 2021
Networkx with neo4j back-end

Dump networkx graph into nodes/relations TSV from neo4jnx.tsv import graph_to_tsv g = pklload('indranet_dir_graph.pkl') graph_to_tsv(g, 'docker/nodes.

Benjamin M. Gyori 1 Oct 27, 2021
This two python programs can convert km to miles and miles to km

km-to-miles These two little python programs can convert kilometers to miles and miles to kilometers Needed Python3 or a online python compiler with t

Chandula Janith 3 Jan 30, 2022
EVE-NG tools, A Utility to make operations with EVE-NG more friendly.

EVE-NG tools, A Utility to make operations with EVE-NG more friendly. Also it support different snapshot operations with same style as Libvirt/KVM

Bassem Aly 8 Jan 05, 2023
Attempts to crack the compression puzzle.

The Compression Puzzle One lovely Friday we were faced with this nice yet intriguing programming puzzle. One shall write a program that compresses str

Oto Brglez 14 Dec 29, 2022
Brainfuck rollup scaling experiment for fun

Optimistic Brainfuck Ever wanted to run Brainfuck on ethereum? Don't ask, now you can! And at a fraction of the cost, thanks to optimistic rollup tech

Diederik Loerakker 48 Dec 28, 2022
A simple python implementation of Decision Tree.

DecisionTree A simple python implementation of Decision Tree, using Gini index. Usage: import DecisionTree node = DecisionTree.trainDecisionTree(lab

1 Nov 12, 2021
Give you a better view of your Docker registry disk usage.

registry-du Give you a better view of your Docker registry disk usage. This small tool will analysis your Docker registry(vanilla or Harbor both work)

Nova Kwok 16 Jan 07, 2023
The git for the Python Story Utility Package library.

SUP The git for the Python Story Utility Package library. Installation: Install SUP by simply running pip install psup in your terminal. Check out our

Enoki 6 Nov 27, 2022
Implicit hierarchical a posteriori error estimates in FEniCSx

FEniCSx Error Estimation (FEniCSx-EE) Description FEniCSx-EE is an open source library showing how various error estimation strategies can be implemen

Jack S. Hale 1 Dec 08, 2021
Python program to do with percentages and chances, random generation.

Chances and Percentages Python program to do with percentages and chances, random generation. What is this? This small program will generate a list wi

n0 3 Jul 15, 2021
A tool to create the basics of a project

Project-Scheduler Instalação Para instalar o Project Maker, você necessita está em um ambiente de desenvolvimento Linux ou wsl com alguma distro debia

2 Dec 17, 2021
Fraud Multiplication Table Detection in python

Fraud-Multiplication-Table-Detection-in-python In this program, I have detected fraud multiplication table using python without class. Here, I have co

Sachin Vinayak Dabhade 4 Sep 24, 2021
A script to check for common mistakes in LaTeX source files of scientific papers.

LaTeX Paper Linter This script checks for common mistakes in LaTeX source files of scientific papers. Usage python3 paperlint.py file.tex [-i/x inc

Michael Schwarz 12 Nov 16, 2022
RapidFuzz is a fast string matching library for Python and C++

RapidFuzz is a fast string matching library for Python and C++, which is using the string similarity calculations from FuzzyWuzzy

Max Bachmann 1.7k Jan 04, 2023