Skip to content

Free rotation code and example#5

Open
miq75 wants to merge 2 commits intohnhaefliger:masterfrom
miq75:pyFold3D
Open

Free rotation code and example#5
miq75 wants to merge 2 commits intohnhaefliger:masterfrom
miq75:pyFold3D

Conversation

@miq75
Copy link
Copy Markdown

@miq75 miq75 commented Jan 25, 2021

Hello,
I need to draw origami folding methods in strict python, so I use your basecode and add some little more features.

My current changes

  • Minor corrections in cubeExample faces and animation;
  • Minor optimisation in Engine.render;
  • Adds in graphics/vertex.py:
    Vertex.free_rotate() based on quaternions methods to avoid numpy use.
  • Adds in graphics/engine.py:
    Engine.free_rotate() and Engine.part_free_rotate()
    Engine.__next_fold(), Engine.__prev_fold() and Engine.__fold_animate()
    Fold animation consts definition and N and P key bindings in Engine.init()
  • Add of foldExample.py

Take it if you think they're cool ;)

By the way, do you think that

  • more than 3 vertices polygons can be used (implies many changes of variable names and faces vertices management) ?
  • there is a way to have a better 3D render method that perfectly manages almost paralleles faces (avgZ method sometime fails, showing small faces above bigger ones) ?

Thanks.

miq75 added 2 commits January 25, 2021 18:19
Reduce verbosity of code with more pythonic code and minor optimisations

Vertices replace points, polygons replace triangles in code and pyramid replace cube in examples
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant