simon-git: polyhedra (master): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Thu Jul 11 07:06:11 BST 2019


TL;DR:
  17ba7f3 Factor out matrix algebra into polylib.py.

Repository:     https://git.tartarus.org/simon/polyhedra.git
On the web:     https://git.tartarus.org/?p=simon/polyhedra.git
Branch updated: master
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2019-07-11 07:06:11

commit 17ba7f36c675414924ce07aa520ed84d123c390d
web diff https://git.tartarus.org/?p=simon/polyhedra.git;a=commitdiff;h=17ba7f36c675414924ce07aa520ed84d123c390d;hp=238fddfa8fe3c70d93bcf73bfe696d2a8349cafa
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Jul 11 07:02:34 2019 +0100

    Factor out matrix algebra into polylib.py.
    
    This removes a lot of duplicated code - particularly endless copies of
    the function that is now Matrix.rotate_to_z().
    
    It also deconfuses the code quite a bit, because I wrote these tools
    at different times and each one expressed matrices in whatever format
    happened to be uppermost in my mind that week! So we had row-major and
    column-major, arrays of arrays and single flat arrays, you name it.
    Horrendous. Now all matrices are the Matrix class in polylib.
    
    nvertices.py in particular is simplified, because it had a function
    that was _more_ complicated than rotate_to_z, and I realised while I
    was converting it that there's no actual need for it to be anything
    other than an ordinary rotate_to_z. The aim is to project a particular
    edge vector to lie along a coordinate axis, so we should just _do_
    that, and not start off by putting it in a particular place so as to
    apply a final rotation.

 drawnet.py       |  86 +++--------------------
 misc/dihedral.py |  90 +++++-------------------
 nfaces.py        |  63 +++--------------
 nvertices.py     | 205 ++++++++++---------------------------------------------
 polylib.py       | 104 ++++++++++++++++++++++++++++
 povpoly.py       |  75 ++++++--------------
 transform.py     |  16 ++---
 zonohedron.py    |  14 +---
 8 files changed, 202 insertions(+), 451 deletions(-)



More information about the tartarus-commits mailing list