Marthee commited on
Commit
3d2cd4d
·
verified ·
1 Parent(s): 450cff3

Upload 4 files

Browse files
Files changed (4) hide show
  1. Code_2_7.py +2 -2
  2. app.py +0 -0
  3. deploying_3_3.py +2 -2
  4. dxf__omar3_2.py +23 -23
Code_2_7.py CHANGED
@@ -1239,8 +1239,8 @@ def get_hatched_areas(datadoc,filename,FinalRatio,rotationangle,SearchArray,Coll
1239
 
1240
  if length > 0:
1241
  # rgbconverted = tuple(rgb_color)
1242
- print("rgb_color = ",type(rgb_color))
1243
- print("CollectedColors = ",type(CollectedColors))
1244
  # colored_fix = [tuple(map(int, c)) for c in coloredarray]
1245
 
1246
  if ( len(coloredarray) > 0 and ( rgb_color in coloredarray)):
 
1239
 
1240
  if length > 0:
1241
  # rgbconverted = tuple(rgb_color)
1242
+ # print("rgb_color = ",type(rgb_color))
1243
+ # print("CollectedColors = ",type(CollectedColors))
1244
  # colored_fix = [tuple(map(int, c)) for c in coloredarray]
1245
 
1246
  if ( len(coloredarray) > 0 and ( rgb_color in coloredarray)):
app.py CHANGED
The diff for this file is too large to render. See raw diff
 
deploying_3_3.py CHANGED
@@ -1216,7 +1216,7 @@ def get_hatched_areas(datadoc,filename,FinalRatio,rotationangle,SearchArray):
1216
  width = maxx - minx
1217
  height = maxy - miny
1218
 
1219
- if (poly.area > 0.9 and (height > 0.7 and width > 0.7)):
1220
  area1 = round(poly.area, 3)
1221
  perimeter = round(poly.length, 3)
1222
  normalized_vertices = normalize_vertices(vertices)
@@ -1292,7 +1292,7 @@ def get_hatched_areas(datadoc,filename,FinalRatio,rotationangle,SearchArray):
1292
  width = maxx - minx
1293
  height = maxy - miny
1294
 
1295
- if (poly.area > 0.1 and (height > 0.1 and width > 0.1)):
1296
  area1 = round(poly.area, 3)
1297
  perimeter = round(poly.length, 3)
1298
  normalized_vertices = normalize_vertices(vert)
 
1216
  width = maxx - minx
1217
  height = maxy - miny
1218
 
1219
+ if (poly.area > 1 and (height > 0.7 and width > 0.7)):
1220
  area1 = round(poly.area, 3)
1221
  perimeter = round(poly.length, 3)
1222
  normalized_vertices = normalize_vertices(vertices)
 
1292
  width = maxx - minx
1293
  height = maxy - miny
1294
 
1295
+ if (poly.area > 1 and (height > 0.7 and width > 0.7)):
1296
  area1 = round(poly.area, 3)
1297
  perimeter = round(poly.length, 3)
1298
  normalized_vertices = normalize_vertices(vert)
dxf__omar3_2.py CHANGED
@@ -1224,7 +1224,7 @@ def get_hatched_areas(datadoc,filename,FinalRatio,rotationangle,SearchArray):
1224
  width = maxx - minx
1225
  height = maxy - miny
1226
 
1227
- if (poly.area > 0.9 and (height > 0.7 and width > 0.7)):
1228
  area1 = round(poly.area, 3)
1229
  perimeter = round(poly.length, 3)
1230
  normalized_vertices = normalize_vertices(vertices)
@@ -1300,7 +1300,7 @@ def get_hatched_areas(datadoc,filename,FinalRatio,rotationangle,SearchArray):
1300
  width = maxx - minx
1301
  height = maxy - miny
1302
 
1303
- if (poly.area > 0.1 and (height > 0.1 and width > 0.1)):
1304
  area1 = round(poly.area, 3)
1305
  perimeter = round(poly.length, 3)
1306
  normalized_vertices = normalize_vertices(vert)
@@ -2562,31 +2562,31 @@ def mainFunctionDrawImgPdf(datadoc,dxfpath, dxfratio,SearchArray,CorrectionRatio
2562
  [(p.x, p.y) for p in points_Of_drawing_Canvas],
2563
  dtype=np.float32
2564
  )
2565
- # print("Segments = ",segments)
2566
- # print("segments[0] = ",segments[0])
2567
- if(segments):
2568
- for x, y in segments[0]:
2569
- # Check if the point is outside the polygon
2570
- result = cv2.pointPolygonTest(Boundingpolygon, (float(x), float(y)), False)
2571
- if result < 0: # < 0 means point is outside
2572
- discard = True
2573
- break
2574
- else:
2575
- for x, y in segments[0]:
2576
- if not (bxmin <= x <= bxmax and bymin <= y <= bymax):
2577
  discard = True
2578
  break
 
 
 
 
 
2579
  # draw each allowed open segment (no segment will contain an edge intersection->intersection)
2580
  if not discard:
2581
- for seg in segments:
2582
- if len(seg) < 2:
2583
- continue
2584
- annot12 = page2.add_polyline_annot(points=seg)
2585
- annot12.set_border(width=0.8)
2586
- annot12.set_colors(stroke=(float(NewColors[0])/255.0, float(NewColors[1])/255.0, float(NewColors[2])/255.0))
2587
- annot12.set_info(content=f'Perimeter={polygon[2]} m', subject='Perimeter Measurement', title="ADR Team")
2588
- annot12.set_opacity(0.7)
2589
- annot12.update()
 
2590
 
2591
  i += 1
2592
  alpha = 0.8 # Transparency factor.
 
1224
  width = maxx - minx
1225
  height = maxy - miny
1226
 
1227
+ if (poly.area > 1 and (height > 0.7 and width > 0.7)):
1228
  area1 = round(poly.area, 3)
1229
  perimeter = round(poly.length, 3)
1230
  normalized_vertices = normalize_vertices(vertices)
 
1300
  width = maxx - minx
1301
  height = maxy - miny
1302
 
1303
+ if (poly.area > 1 and (height > 0.7 and width > 0.7)):
1304
  area1 = round(poly.area, 3)
1305
  perimeter = round(poly.length, 3)
1306
  normalized_vertices = normalize_vertices(vert)
 
2562
  [(p.x, p.y) for p in points_Of_drawing_Canvas],
2563
  dtype=np.float32
2564
  )
2565
+
2566
+ if(segments):
2567
+ for x, y in segments[0]:
2568
+ # Check if the point is outside the polygon
2569
+ result = cv2.pointPolygonTest(Boundingpolygon, (float(x), float(y)), False)
2570
+ if result < 0: # < 0 means point is outside
 
 
 
 
 
 
2571
  discard = True
2572
  break
2573
+ else:
2574
+ for x, y in segments[0]:
2575
+ if not (bxmin <= x <= bxmax and bymin <= y <= bymax):
2576
+ discard = True
2577
+ break
2578
  # draw each allowed open segment (no segment will contain an edge intersection->intersection)
2579
  if not discard:
2580
+ if(segments):
2581
+ for seg in segments:
2582
+ if len(seg) < 2:
2583
+ continue
2584
+ annot12 = page2.add_polyline_annot(points=seg)
2585
+ annot12.set_border(width=0.8)
2586
+ annot12.set_colors(stroke=(float(NewColors[0])/255.0, float(NewColors[1])/255.0, float(NewColors[2])/255.0))
2587
+ annot12.set_info(content=f'Perimeter={polygon[2]} m', subject='Perimeter Measurement', title="ADR Team")
2588
+ annot12.set_opacity(0.7)
2589
+ annot12.update()
2590
 
2591
  i += 1
2592
  alpha = 0.8 # Transparency factor.