Esempio n. 1
0
 def get_Object(self):
     point3dArray = [self.Start[0], self.Start[1], self.Start[2], self.Finish[2]]
     polyline = PolylineArea(point3dArray)
     polyline.SetBulgeAt(0, MathHelper.smethod_60(self.Start[0], self.Middle[0], self.Finish[0]))
     polyline.SetBulgeAt(1, MathHelper.smethod_60(self.Start[1], self.Middle[1], self.Finish[1]))
     polyline.SetBulgeAt(2, MathHelper.smethod_60(self.Start[2], self.Middle[2], self.Finish[2]))
     return QgsGeometry.fromPolyline(polyline.method_14())
    def getIntersectPolylineArea(self, angle, angleUnits_0):
        point3dArray = [
            self.Start[0], self.Start[1], self.Start[2], self.Finish[2]
        ]
        polyline = PolylineArea(point3dArray)
        polyline.SetBulgeAt(
            0,
            MathHelper.smethod_60(self.Start[0], self.Middle[0],
                                  self.Finish[0]))
        polyline.SetBulgeAt(
            1,
            MathHelper.smethod_60(self.Start[1], self.Middle[1],
                                  self.Finish[1]))
        polyline.SetBulgeAt(
            2,
            MathHelper.smethod_60(self.Start[2], self.Middle[2],
                                  self.Finish[2]))

        intersectPt = self.method_0(angle, angleUnits_0)
        if intersectPt == None:
            return None, None
        polylineArea = None
        if round(self.Radius[0]) == round(
                MathHelper.calcDistance(self.Center[0], intersectPt)):
            point3dArray = [self.Start[0], intersectPt]
            polylineArea = PolylineArea(point3dArray)
            polylineArea.SetBulgeAt(
                0,
                MathHelper.smethod_60(self.Start[0], self.Middle[0],
                                      self.Finish[0]))
        elif round(self.Radius[1]) == round(
                MathHelper.calcDistance(self.Center[1], intersectPt)):
            point3dArray = [self.Start[0], self.Start[1], intersectPt]
            polylineArea = PolylineArea(point3dArray)
            polylineArea.SetBulgeAt(
                0,
                MathHelper.smethod_60(self.Start[0], self.Middle[0],
                                      self.Finish[0]))
            polylineArea.SetBulgeAt(
                1,
                MathHelper.smethod_60(self.Start[1], self.Middle[1],
                                      self.Finish[1]))
        else:
            point3dArray = [
                self.Start[0], self.Start[1], self.Start[2], intersectPt
            ]
            polylineArea = PolylineArea(point3dArray)
            polylineArea.SetBulgeAt(
                0,
                MathHelper.smethod_60(self.Start[0], self.Middle[0],
                                      self.Finish[0]))
            polylineArea.SetBulgeAt(
                1,
                MathHelper.smethod_60(self.Start[1], self.Middle[1],
                                      self.Finish[1]))
            polylineArea.SetBulgeAt(
                2,
                MathHelper.smethod_60(self.Start[2], self.Middle[2],
                                      self.Finish[2]))
        return intersectPt, polylineArea