Skip to content

Commit

Permalink
update graph posts
Browse files Browse the repository at this point in the history
  • Loading branch information
mu-ramadan committed Mar 31, 2024
1 parent 6bebad7 commit 991a057
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 5 additions & 0 deletions graph_posts/GetRoomBounds.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"operationName": "GetRoomBounds",
"variables": { "modelId": "[MATTERPORT_MODEL_ID]" },
"query": "query GetRoomBounds($modelId: ID!) {\n model(id: $modelId) {\n floors {\n id\n layer {\n id\n __typename\n }\n edges(includeUsed: true) {\n id\n layer {\n id\n __typename\n }\n type\n vertices {\n id\n layer {\n id\n __typename\n }\n position {\n x\n y\n __typename\n }\n __typename\n }\n centerLineBias\n thickness\n openings {\n id\n width\n relativeCenter\n type\n height\n lowerElevation\n layer {\n id\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n rooms {\n id\n layer {\n id\n __typename\n }\n floor {\n id\n __typename\n }\n classifications {\n id\n confidence\n label\n __typename\n }\n boundary {\n edges {\n id\n __typename\n }\n __typename\n }\n holes {\n edges {\n id\n __typename\n }\n __typename\n }\n dimensionEstimates {\n area\n areaIndoor\n width\n depth\n height\n units\n __typename\n }\n label\n keywords\n __typename\n }\n __typename\n }\n}\n"
}
7 changes: 3 additions & 4 deletions matterport-dl.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def downloadAssets(base):
"vert_arrows","headset-quest-2","pinIconDefault","tagColor"]

assets = ["css/showcase.css", "css/unsupported_browser.css", "cursors/grab.png", "cursors/grabbing.png", "cursors/zoom-in.png",
"cursors/zoom-out.png", "locale/strings.json", "css/ws-blur.css", "css/core.css", "css/split.css","css/late.css"]
"cursors/zoom-out.png", "locale/strings.json", "css/ws-blur.css", "css/core.css", "css/split.css","css/late.css", "matterport-logo.svg"]

downloadFile("https://my.matterport.com/favicon.ico", "favicon.ico")
downloadFile(base + "js/showcase.js", "js/showcase.js")
Expand Down Expand Up @@ -252,14 +252,13 @@ def setAccessURLs(pageid):

def downloadInfo(pageid):
assets = [f"api/v1/jsonstore/model/highlights/{pageid}", f"api/v1/jsonstore/model/Labels/{pageid}", f"api/v1/jsonstore/model/mattertags/{pageid}", f"api/v1/jsonstore/model/measurements/{pageid}",
f"api/v1/player/models/{pageid}/thumb?width=1707&dpr=1.5&disable=upscale", f"api/v1/player/models/{pageid}/", f"api/v2/models/{pageid}/sweeps", "api/v2/users/current", f"api/player/models/{pageid}/files", f"api/v1/jsonstore/model/trims/{pageid}"]
f"api/v1/player/models/{pageid}/thumb?width=1707&dpr=1.5&disable=upscale", f"api/v1/player/models/{pageid}/", f"api/v2/models/{pageid}/sweeps", "api/v2/users/current", f"api/player/models/{pageid}/files", f"api/v1/jsonstore/model/trims/{pageid}", "api/v1/plugins?manifest=true"]
with concurrent.futures.ThreadPoolExecutor(max_workers=16) as executor:
for asset in assets:
local_file = asset
if local_file.endswith('/'):
local_file = local_file + "index.html"
executor.submit(
downloadFile, f"https://my.matterport.com/{asset}", local_file)
executor.submit(downloadFile, f"https://my.matterport.com/{asset}", local_file)
makeDirs("api/mp/models")
with open(f"api/mp/models/graph", "w", encoding="UTF-8") as f:
f.write('{"data": "empty"}')
Expand Down

0 comments on commit 991a057

Please sign in to comment.