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
A simple python script to generate an iCalendar file for the university classes.

iCal Generator This is a simple python script to generate an iCalendar file for the university classes. Installation Clone the repository git clone ht

Foad Rashidi 2 Sep 01, 2022
Writing Alfred copy/paste scripts in Python

Writing Alfred copy/paste scripts in Python This repository shows how to create Alfred scripts in Python. It assumes that you using pyenv for Python v

Will Fitzgerald 2 Oct 26, 2021
Pampy: The Pattern Matching for Python you always dreamed of.

Pampy: Pattern Matching for Python Pampy is pretty small (150 lines), reasonably fast, and often makes your code more readable and hence easier to rea

Claudio Santini 3.5k Jan 06, 2023
Create password - Generate Random Password with Passphrase

Generate Random Password with Passphrase This is a python code to generate stron

1 Jan 18, 2022
Abstraction of a Unit, includes convertions and basic operations.

Units Abstraction of a Unit, includes convertions and basic operations. ------ EXAMPLE : Free Fall (No air resistance) ------- from units_test import

1 Dec 23, 2021
ColorController is a Pythonic interface for managing colors by english-language name and various color values.

ColorController.py Table of Contents Encode color data in various formats. 1.1: Create a ColorController object using a familiar, english-language col

Tal Zaken 2 Feb 12, 2022
A simple tool to extract python code from a Jupyter notebook, and then run pylint on it for static analysis.

Jupyter Pylinter A simple tool to extract python code from a Jupyter notebook, and then run pylint on it for static analysis. If you find this tool us

Edmund Goodman 10 Oct 13, 2022
A utility that makes it easy to work with Python projects containing lots of packages, of which you only want to develop some.

Mixed development source packages on top of stable constraints using pip mxdev [mɪks dɛv] is a utility that makes it easy to work with Python projects

BlueDynamics Alliance 6 Jun 08, 2022
Dice Rolling Simulator using Python-random

Dice Rolling Simulator As the name of the program suggests, we will be imitating a rolling dice. This is one of the interesting python projects and wi

PyLaboratory 1 Feb 02, 2022
A simple example for calling C++ functions in Python by `ctypes`.

ctypes-example A simple example for calling C++ functions in Python by ctypes. Features call C++ function int bar(int* value, char* msg) with argumene

Yusu Pan 3 Nov 23, 2022
A (very dirty) experiment to remove layers from a Docker image.

Surgically remove layers from a Docker image (with a chainsaw)

Jérôme Petazzoni 9 Jun 08, 2022
A thing to simplify listening for PG notifications with asyncpg

asyncpg-listen This library simplifies usage of listen/notify with asyncpg: Handles loss of a connection Simplifies notifications processing from mult

ANNA 18 Dec 23, 2022
Early version for manipulate Geo localization data trough API REST.

Backend para obtener los datos (beta) Descripción El servidor está diseñado para recibir y almacenar datos enviados en forma de JSON por una aplicació

Víctor Omar Vento Hernández 1 Nov 14, 2021
Extract the download URL from OneDrive or SharePoint share link and push it to aria2

OneDriveShareLinkPushAria2 Extract the download URL from OneDrive or SharePoint share link and push it to aria2 从OneDrive或SharePoint共享链接提取下载URL并将其推送到a

高玩梁 262 Jan 08, 2023
Automatic generator of readmes for git repositories (Includes file' listing)

Readme Generator We are bored of write the same things once and once again. We trust in the comments made inside of our files, and we decided to autom

Natalia Vera Duran 6 Jul 20, 2021
A Random Password Generator made from Python

Things you need Python Step 1 Download the python file from Releases Step 2 Go to the directory where the python file is and run it Step 3 Type the le

Kavindu Nimsara 3 May 30, 2022
Simple script to export contacts from telegram into vCard file

Telegram Contacts Exporter Simple script to export contacts from telegram into vCard file Getting Started Prerequisites You must to put your Telegram

Pere Antoni 1 Oct 17, 2021
A python package for your Kali Linux distro that find the fastest mirror and configure your apt to use that mirror

Kali Mirror Finder Using Single Python File A python package for your Kali Linux distro that find the fastest mirror and configure your apt to use tha

MrSingh 6 Dec 12, 2022
Extract XML from the OS X dictionaries.

Extract XML from the OS X dictionaries.

Joshua Olson 13 Dec 11, 2022
A fast Python implementation of Ac Auto Mechine

A fast Python implementation of Ac Auto Mechine

Jin Zitian 1 Dec 07, 2021