def method_3(self, polylineArea_0): point3dCollection = self.area.method_14_closed(4) polylineArea0 = PolylineArea(point3dCollection) num = MathHelper.calcDistance(self.ptBase, polylineArea_0[0].Position) num1 = self.trackRad point3d = MathHelper.distanceBearingPoint(self.ptBase, num1, num) matrix = Matrix3d.Displacement(self.ptE.GetVectorTo(point3d)) polylineArea = polylineArea0.TransformBy(matrix) polylineAreaList = [] polylineAreaList.append(polylineArea) # Region transformedCopy = region1.GetTransformedCopy(Matrix3d.Displacement(self.ptE.GetVectorTo(point3d))) as Region; for i in range(1, 72): point3d = MathHelper.distanceBearingPoint( self.ptBase, num1 + i * 0.0872664625997165, num) polylineArea = polylineArea0.TransformBy( Matrix3d.Displacement(self.ptE.GetVectorTo(point3d))) polylineAreaList.append(polylineArea) # Region transformedCopy1 = region1.GetTransformedCopy(Matrix3d.Displacement(self.ptE.GetVectorTo(point3d))) as Region; # try # { # transformedCopy.BooleanOperation(0, transformedCopy1); # } # finally # { # AcadHelper.smethod_24(transformedCopy1); # } # } # region = transformedCopy; # } # finally # { # AcadHelper.smethod_24(region1); # } return polylineAreaList
def vmethod_0(self, polylineArea_0, bool_0, bool_1): point3dArray = self.area.method_14_closed(4) polylineArea0 = PolylineArea(point3dArray) polylineAreaList = [] #self.area] point3dCollection = [] for i in range(4): matrix = Matrix3d.Displacement( self.ptBase.GetVectorTo(polylineArea_0[i].Position)) polylinAreaNew = polylineArea0.TransformBy(matrix) polylineAreaList.append(polylinAreaNew) point3dCollection = [] for point3d0 in self.bounds: point3d = point3d0.TransformBy(matrix) point3dCollection.append(point3d) point3dCollection.append(self.bounds[0].TransformBy(matrix)) polylineAreaList.append(polylinAreaNew) polylineAreaList.append(PolylineArea(point3dCollection)) # point3dCollection0 = MathHelper.smethod_190(point3dCollection) # polylinAreaNew = PolylineArea(point3dCollection0) # polylineAreaList.append(polylinAreaNew) # # break if bool_1: polylineAreaList.extend(self.method_3(polylineArea_0)) if bool_0: polylineAreaList.extend(self.method_2(polylineArea_0)) # polylineAreaList.append(polylineArea_0) # # return polylineAreaList pointList = QgisHelper.convexFull(polylineAreaList) # pointList = QgisHelper.UnionFromPolylineAreaList(polylineAreaList) polylineArea = PolylineArea() for point in pointList: polylineArea.Add(PolylineAreaPoint(point)) return [polylineArea]
def method_2(self, polylineArea_0): polyLineAreaList = [] # Region region; num = Unit.ConvertDegToRad(70) if ( self.orientation == OrientationType.Right) else Unit.ConvertDegToRad(-70) vector3d = Vector3d(0, 0, 1) matrix3d = Matrix3d.Rotation(num, vector3d, self.ptBase) matrix3d1 = Matrix3d.Mirroring( self.ptBase, MathHelper.distanceBearingPoint(self.ptBase, self.trackRad, 100), self.ptBase.smethod_167(2)) # DBObjectCollection dBObjectCollection = new DBObjectCollection(); # DBObjectCollection dBObjectCollection1 = new DBObjectCollection(); # try # { num1 = 0 origin = Point3D.get_Origin() point3d = polylineArea_0[0].Position.TransformBy(matrix3d) point3dCollection = self.spiral.method_14_closed(4) polyline1 = PolylineArea(point3dCollection) polyline2 = polyline1.TransformBy(matrix3d) polyline = polyline2.TransformBy( Matrix3d.Displacement(self.ptBase.GetVectorTo(point3d))) polyLineAreaList.append(polyline) # dBObjectCollection.Add(polyline); num1, origin = self.method_6(polyline, self.ptBase, num1, origin) point3d1 = polylineArea_0[1].Position.TransformBy(matrix3d) point3dCollection = self.spiral.method_14_closed(4) polyline1 = PolylineArea(point3dCollection) polyline2 = polyline1.TransformBy(matrix3d) polyline = polyline2.TransformBy( Matrix3d.Displacement(self.ptBase.GetVectorTo(point3d1))) # polyline = AcadHelper.smethod_136(self.spiral, true); # polyline.TransformBy(matrix3d); # polyline.TransformBy(Matrix3d.Displacement(self.ptBase.GetVectorTo(point3d1))); polyLineAreaList.append(polyline) # dBObjectCollection.Add(polyline); num1, origin = self.method_6(polyline, self.ptBase, num1, origin) point3d2 = polylineArea_0[3].Position.TransformBy(matrix3d) point3dCollection = self.spiral.method_14_closed(4) polyline1 = PolylineArea(point3dCollection) polyline2 = polyline1.TransformBy(matrix3d1) polyline3 = polyline2.TransformBy(matrix3d) polyline = polyline3.TransformBy( Matrix3d.Displacement(self.ptBase.GetVectorTo(point3d2))) # polyline = AcadHelper.smethod_136(self.spiral, true); # polyline.TransformBy(matrix3d1); # polyline.TransformBy(matrix3d); # polyline.TransformBy(Matrix3d.Displacement(self.ptBase.GetVectorTo(point3d2))); polyLineAreaList.append(polyline) # dBObjectCollection.Add(polyline); point3d3 = polylineArea_0[2].Position.TransformBy(matrix3d) point3dCollection = self.spiral.method_14_closed(4) polyline1 = PolylineArea(point3dCollection) polyline2 = polyline1.TransformBy(matrix3d1) polyline3 = polyline2.TransformBy(matrix3d) polyline = polyline3.TransformBy( Matrix3d.Displacement(self.ptBase.GetVectorTo(point3d3))) # polyline = AcadHelper.smethod_136(self.spiral, true); # polyline.TransformBy(matrix3d1); # polyline.TransformBy(matrix3d); # polyline.TransformBy(Matrix3d.Displacement(self.ptBase.GetVectorTo(point3d3))); polyLineAreaList.append(polyline) # dBObjectCollection.Add(polyline); # if (num1 > 0): # point3d4 = MathHelper.distanceBearingPoint(self.ptBase, self.trackRad + 3.14159265358979, num1); # polyline = PolylineArea() # polyline.Add(origin.smethod_176(), MathHelper.smethod_57((self.orientation == OrientationType.Left ? TurnDirection.Left : TurnDirection.Right), origin, point3d4, self.ptBase), 0, 0); # polyline.AddVertexAt(1, point3d4.smethod_176(), 0, 0, 0); # polyline.set_Closed(true); # dBObjectCollection.Add(polyline); # } point3dCollection = [] item = self.spiralBounds[0] point3d5 = item.TransformBy(matrix3d) point3dCollection.append( point3d5.TransformBy( Matrix3d.Displacement(self.ptBase.GetVectorTo(point3d)))) item1 = self.spiralBounds[1] point3d6 = item1.TransformBy(matrix3d) point3dCollection.append( point3d6.TransformBy( Matrix3d.Displacement(self.ptBase.GetVectorTo(point3d)))) item2 = self.spiralBounds[1] point3d7 = item2.TransformBy(matrix3d) point3dCollection.append( point3d7.TransformBy( Matrix3d.Displacement(self.ptBase.GetVectorTo(point3d1)))) item3 = self.spiralBounds[2] point3d8 = item3.TransformBy(matrix3d) point3dCollection.append( point3d8.TransformBy( Matrix3d.Displacement(self.ptBase.GetVectorTo(point3d1)))) item4 = self.spiralBounds[2] point3d9 = item4.TransformBy(matrix3d1).TransformBy(matrix3d) point3dCollection.append( point3d9.TransformBy( Matrix3d.Displacement(self.ptBase.GetVectorTo(point3d3)))) item5 = self.spiralBounds[1] point3d10 = item5.TransformBy(matrix3d1).TransformBy(matrix3d) point3dCollection.append( point3d10.TransformBy( Matrix3d.Displacement(self.ptBase.GetVectorTo(point3d3)))) item6 = self.spiralBounds[1] point3d11 = item6.TransformBy(matrix3d1).TransformBy(matrix3d) point3dCollection.append( point3d11.TransformBy( Matrix3d.Displacement(self.ptBase.GetVectorTo(point3d2)))) item7 = self.spiralBounds[0] point3d12 = item7.TransformBy(matrix3d1).TransformBy(matrix3d) point3dCollection.append( point3d12.TransformBy( Matrix3d.Displacement(self.ptBase.GetVectorTo(point3d2)))) point3dCollection = MathHelper.smethod_190(point3dCollection) polylineArea1 = PolylineArea(point3dCollection) polyLineAreaList.append(polyline) return polyLineAreaList