コード例 #1
0
ファイル: GeoentPolyline.py プロジェクト: aricci10/Desminado
    def bulge2arc(self, Ps, Pe, bulge):
        """
        bulge2arc()
        """
        c = (1 / bulge - bulge) / 2

        #Berechnung des Mittelpunkts (Formel von Mickes!)
        #Calculation of the center (Micke's formula)
        O = Point(x=(Ps.x + Pe.x - (Pe.y - Ps.y) * c) / 2, \
                  y=(Ps.y + Pe.y + (Pe.x - Ps.x) * c) / 2)

        #Radius = Distance between the centre and Ps
        r = O.distance(Ps)
        #Kontrolle ob beide gleich sind (passt ...)
        #Check if they are equal (fits ...)
        #r=O.distance(Pe)

        #Unterscheidung f�r den �ffnungswinkel.
        #Distinction for the opening angle. ???
        if bulge > 0:
            return ArcGeo(Ps=Ps, Pe=Pe, O=O, r=r)
        else:
            arc = ArcGeo(Ps=Pe, Pe=Ps, O=O, r=r)
            arc.reverse()
            return arc
コード例 #2
0
    def bulge2arc(self, Pa, Pe, bulge):
        """
        bulge2arc()
        """
        c = (1 / bulge - bulge) / 2

        #Calculate the centre point (Micke's formula!)
        O = Point(x=(Pa.x + Pe.x - (Pe.y - Pa.y) * c) / 2, \
                  y=(Pa.y + Pe.y + (Pe.x - Pa.x) * c) / 2)

        #Radius = Distance between the centre and Pa
        r = O.distance(Pa)

        #Check if they are equal (fits ...)
        #r=O.distance(Pe)

        #Unterscheidung für den Öffnungswinkel.
        #Distinction for the opening angle. ???
        if bulge > 0:
            return ArcGeo(Pa=Pa, Pe=Pe, O=O, r=r)
        else:
            arc = ArcGeo(Pa=Pe, Pe=Pa, O=O, r=r)
            arc.reverse()
            return arc
コード例 #3
0
    def bulge2arc(self, Ps, Pe, bulge):
        """
        bulge2arc()
        """
        c = (1 / bulge - bulge) / 2

        #Calculate the centre point (Micke's formula!)
        O = Point(x=(Ps.x + Pe.x - (Pe.y - Ps.y) * c) / 2, \
                  y=(Ps.y + Pe.y + (Pe.x - Ps.x) * c) / 2)

        #Radius = Distance between the centre and Ps
        r = O.distance(Ps)

        #Check if they are equal (fits ...)
        #r=O.distance(Pe)

        #Unterscheidung f�r den �ffnungswinkel.
        #Distinction for the opening angle. ???
        if bulge > 0:
            return ArcGeo(Ps=Ps, Pe=Pe, O=O, r=r)
        else:
            arc = ArcGeo(Ps=Pe, Pe=Ps, O=O, r=r)
            arc.reverse()
            return arc