Skip to content

Polygon.fromVertices chooses wrong orientation for ideal edges #19

Closed
@smh0109

Description

@smh0109

I'm working a lot with ideal triangles right now and it bugs me, that for an edge with an ideal start- and endpoint the wrong orientation of the line is choosen.
This should demonstrate the problem well enough:

import drawSvg as draw
from hyperbolic.poincare.shapes import *

d = draw.Drawing(2.1, 2.1, origin='center')
d.setRenderSize(500)
d.append(draw.Circle(0, 0, 1, fill='silver'))

p1=Point.fromEuclid(-0.104, 0.069)
p2=Point.fromEuclid(-0.182, 0.212)
p3=Point.fromEuclid(-0.622, -0.316)


PList=[p1,p2,p3]
PList=[Ideal(p.theta) for p in PList]

poly=Polygon.fromVertices(PList)

d.draw(poly,stroke='black', stroke_width=0.01, fill='green')
d.draw(Polygon.fromEdges(poly.edges),stroke='red', stroke_width=0.01, fill='white', fill_opacity=0.5)

d

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions