Hi Adrian,
On Fri, 21 Oct 2016, Roger Kaufman wrote:
> However, when I did this I stumbled into a canonical form which is
> planar.
>
> canonical -M q tmp.off | canonical -M m -e 30 > tmp_canonical.off
>
That is a good result, and with -l 20 converges to the limits of
precision.
You can go to -l 20? I was able to use -l 18 in Ubuntu. In Cygwin I
could get better precision under the Win64 build so that shows it has
some benefit. Even so I could only go to -l 17 before minimum difference
was achieved.
When it doesn't halt when minimum difference no longer changes is
probably a good reason to halt the program! This is at least one thing I
can experiment with. I am thinking if the difference is PRECISELY equal
two iterations in a row it probably is not going to improve.
On 10/25/2016 3:08 AM, Adrian Rossiter wrote:
> Hi Roger
>
> On Mon, 24 Oct 2016, Roger Kaufman wrote:
>> On 10/22/2016 2:37 PM, Roger Kaufman wrote:
>>> It appears another way to do it might be to see if any face becomes
>>> non-convex. If that happens a canonical model cannot be found. For
>>> the subject polyhedron above it happens with both algorithms. For -M
>>> m it happens right away.
>>
>> Do we already have a function to test for non-convexity of a face?
>
> No, I don't think a complete test is needed for canonical.
>
> Regarding your last post, referencing this thread
>
>
http://stackoverflow.com/questions/471962/how-do-determine-if-a-polygon-is-complex-convex-nonconvex
>
> The answer by Jason S sounds good. It is equivalent to the answer
> before, which has a comment on the need to check intersecting edges
> too (otherwise a pentagram will be convex!). However, I don't think it
> is necessary to test for intersections in canonical. It seems unlikely
> that the canonical algorithm would convert a single wound polygon into
> a multiple wound polygon without passing through a "dimpled" vertex
> form. I am not sure how it might happen regardless unless the model
> started with multiple wound faces.
Ah yes, and I probably have even done intersection testing before. I
probably won't add this (see below).
>
>
>> Requirements for being a convex polyhedron:
>>
>> 1) Closed
>> 2) Genus 0
>> 3) No non-convex faces
>
> If you dimple a vertex of an icosahedron, the polyhedron is not convex
> but would pass this test.
>
Oh you are right, it can happen this way. I suppose all outside angles
between faces need to be measured for outer angle > 180 (time consuming).
Another way might be to take the convex hull and measure if volumes are
equal.
From George Hart's page, the theorem for canonical are
http://www.georgehart.com/virtual-polyhedra/canonical.html
"An interesting theorem states that there exists a "canonical form" of
any given convex polyhedron."
Then: "... and the edges of the canonical polyhedron and its dual cross
at right angles."
I was looking in this direction because in the case of the example when
the face becomes non-convex then the corresponding reciprocal cannot be
convex and so canonicalization cannot occur. After this it might as well
give up.
However, I think the divergence test is catching most conditions and I
think it is sufficient, except for when equality is occurring as stated
above. The divergence test is set at 10 but a lower number like 2 might
exit faster. It is something I can look at.
One thing that might be better to change is status reporting iteration
count. Right now it is set at 50. I think this is way to low and should
probably more likely be 1000 or higher, maybe even 10,000. The reason it
reports by default is that some models take a while to calculate and it
shows the program is not otherwise stuck. But I've noticed the program
speed seems to improve a bit when it doesn't have to output to screen as
much. The final number is reported regardless. Any thoughts on this?
Roger