Spaces:
Running
Running
beta1.1
Browse files
app.py
CHANGED
|
@@ -280,11 +280,12 @@ async def generate_model(request: GenerateRequest):
|
|
| 280 |
|
| 281 |
# 3. Flatten coordinates for PyPRT InitialShape
|
| 282 |
# Frontend ENU convention: x = east, y = north
|
| 283 |
-
# PyPRT/CGA convention: X = east, Y = height (up), Z =
|
| 284 |
-
#
|
|
|
|
| 285 |
flattened_coords = []
|
| 286 |
for p in coords:
|
| 287 |
-
flattened_coords.extend([p[0], 0, p[1]])
|
| 288 |
|
| 289 |
|
| 290 |
indices = list(range(len(coords)))
|
|
@@ -713,9 +714,10 @@ async def get_model_report(request: GenerateRequest):
|
|
| 713 |
if coords[0] == coords[-1]:
|
| 714 |
coords = coords[:-1]
|
| 715 |
|
|
|
|
| 716 |
flattened_coords = []
|
| 717 |
for p in coords:
|
| 718 |
-
flattened_coords.extend([p[0], 0, p[1]])
|
| 719 |
|
| 720 |
indices = list(range(len(coords)))
|
| 721 |
face_counts = [len(coords)]
|
|
|
|
| 280 |
|
| 281 |
# 3. Flatten coordinates for PyPRT InitialShape
|
| 282 |
# Frontend ENU convention: x = east, y = north
|
| 283 |
+
# PyPRT/CGA convention: X = east, Y = height (up), Z = south (depth, negated)
|
| 284 |
+
# CGA Z increases southward, but ENU Y increases northward — negate to align.
|
| 285 |
+
# Mapping: [enu_x, 0, -enu_y] → [CGA_X, CGA_Y=0, CGA_Z]
|
| 286 |
flattened_coords = []
|
| 287 |
for p in coords:
|
| 288 |
+
flattened_coords.extend([p[0], 0, -p[1]])
|
| 289 |
|
| 290 |
|
| 291 |
indices = list(range(len(coords)))
|
|
|
|
| 714 |
if coords[0] == coords[-1]:
|
| 715 |
coords = coords[:-1]
|
| 716 |
|
| 717 |
+
# Same CGA Z-axis negation as /generate: ENU Y = north, CGA Z = south
|
| 718 |
flattened_coords = []
|
| 719 |
for p in coords:
|
| 720 |
+
flattened_coords.extend([p[0], 0, -p[1]])
|
| 721 |
|
| 722 |
indices = list(range(len(coords)))
|
| 723 |
face_counts = [len(coords)]
|