From ff63e15d10dd868fdd82077e5dacbf18fa4b5896 Mon Sep 17 00:00:00 2001 From: Chris Hodapp Date: Sun, 1 Dec 2019 01:40:39 +0100 Subject: [PATCH] Finally made 'branching' example basically work. --- README.md | 11 +---------- examples.py | 10 +++++----- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 9797179..885bfef 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,13 @@ # To-do items, wanted features, bugs: ## Cool -- Examples of branching. This will probably need recursion via functions - (or an explicit stack some other way). If I simply - split a boundary into sub-boundaries per the rules I already - have in my notes, then this still lets me split any way I want - to without having to worry about joining N boundaries instead - of 2, doesn't it? - - Note that for this to work right, either gen2mesh has to be - called separately on every straight portion, or I have to - make a version of gen2mesh that can handle something more - like trees of boundaries, not just flat lists. - More complicated: Examples of *merging*. I'm not sure on the theory behind this. ## Annoying/boring - https://en.wikipedia.org/wiki/Polygon_triangulation - do this to fix my wave example! + - http://www.polygontriangulation.com/2018/07/triangulation-algorithm.html - I really need to standardize some of the behavior of fundamental operations (with regard to things like sizes they generate). This is behavior that, if it changes, will change a lot of things that I'm diff --git a/examples.py b/examples.py index 094e9d3..463747f 100755 --- a/examples.py +++ b/examples.py @@ -155,14 +155,14 @@ def ram_horn_branch(): # yes, I can do this in a one-liner # yes, it should be normalized, but I reused from something else if i == 0: - dx, dy = 0.25, 0.25 + dx, dy = 1, 1 elif i == 1: - dx, dy = -0.25, 0.25 + dx, dy = -1, 1 elif i == 2: - dx, dy = -0.25, -0.25 + dx, dy = -1, -1 elif i == 3: - dx, dy = 0.25, -0.25 - return meshutil.Transform().rotate([-dy,dx,0], -numpy.pi/4) + dx, dy = 1, -1 + return meshutil.Transform().rotate([-dy,dx,0], -numpy.pi/6) # this has to begin with cage_sub, prior to xf_sub(i) being # composed in, because only this lines up with where the last # frame finished