Skip to content

Server Architecture

Paul Poinet edited this page Feb 5, 2020 · 31 revisions

diagram

  • Rhomberg DGN file to 3D Repo then to BHoM

  • 3D Repo currently does not support object definitions directly, instead, it stores meshes with metadata

  • Web sockets for event updates

  • But direct requests for actual data retrieval

Implementation of User Story 1.2

  • Dashboard to determine the cost
  • Track Changes between model Revisions
  • Record 3D & Data changes in models

Power BI API Diagram

Custom Dashboard

Visualising your data comes in handy in making decisions or for monitoring the progress of your model. Visualise your project’s data through interactive dashboards using Power BI. Dashboard

3D Model

Tunnel - Rev02

Detect and visualise model changes in a 3D environment. Model comparison is based solely on geometry and object IDs are not taken into account. Geometrical model changes are visualised as following:

  • Green for anything Added
  • Red for anything Deleted

3D Diff (in 3D repo)

3D Diff

Model Data

3D Model contains metadata at an object level. Any custom and default data is exported from the authoring tool. You can access this data via a web browser or using APIs.

Element Data

3D Repo API

3D Repo’s API allows access and interaction with the wealth of data stored on 3D Repo’s servers. In fact, the API is utilised by 3D Repo’s online interface, meaning that all of the functionalities seen there can also be accessed via the API. You can query any of your models for their metadata and filter through various revisions, should there be any. In this particular case, we will perform GET Request for the 'Get all metadata' and 'Get all metadata by revision'. Response to our API call will be a serialised JSON.

API Call Metadata All Get Metadata of a Specific revision

Power BI Query

In order to establish a live link between 3D Repo's database and Power BI, you will need to create a new Query. In this case, you will get data from Web and for the URL link, you can use a href link (URL) as written in the API Docs. In order to highlight the difference (Delta) between revisions, we will need to perform the following GET Requests:

  • api1.www.3drepo.io/api/teamspace/model/revision/master/head/meta/all.json?key=APIKey
  • api1.www.3drepo.io/api/teamspace/model/revision/rev/meta/all.json?key=APIKey

To perform a client-side diffing, you can append 'Get all metadata by revision' query (revision 01) to the 'Get all metadata' table (the latest model revision/revision 02. When merging the results of both API queries into a single table (All Metadata), ensure that you add a custom field 'Revision' with the relevant value attributed to each row. This way you will be able to distinguish revisions.

Web API Request Query Table

Calculated Value (client-side diffing)

Create a new quick measure in your Power BI Fields to highlight the change between revisions. In this example, we will calculate the Volume Difference of each element by querying 'Element:Volume' parameter value.

Volume Difference = 
VAR __BASELINE_VALUE =
	CALCULATE(
		SUM('All Metadata'[Element:Volume]),
		'All Metadata'[Revision] IN { "Rev01" }
	)
VAR __MEASURE_VALUE = SUM('All Metadata'[Element:Volume])
RETURN
	IF(NOT ISBLANK(__MEASURE_VALUE), __MEASURE_VALUE - __BASELINE_VALUE)

3D Diff (in Speckle)

Revision_A:

MeshPartial

Revision_B:

MeshAll

Diffing between Revision_A and Revision_B:

MeshDiff

The diffing response (between Revision_A and Revision_B) as specified in the REST API has been implemented here. Calling http://{server.com}/api/streams/{streamId}/delta/{streamId} produces the following response:

{
	"success": true,
	"revision_datetime": "2/4/2020, 4:15:41 PM",
	"autor": {
		"name": "Paul",
		"surname": "Poinet",
		"_id": "5dfa34188b094663fcd94381",
		"email": "[email protected]",
		"company": "UCL"
	},
	"delta": {
		"created": [530 items],
		"deleted": [],
		"common": [3401 items]
	},
	"revision_A": {
		"id": "Zt0Jg36lp",
		"updatedAt": "2/4/2020, 3:08:00 PM",
		"sender": "Grasshopper"
	},
	"revision_B": {
		"id": "F9UVibS-C",
		"updatedAt": "2/4/2020, 3:08:00 PM",
		"sender": "Grasshopper"
	}
}

SpeckleViz

SpeckleViz has been implemented to help users getting a better understanding of the data flow of a specific Speckle Project across users, streams and documents. More information can be found here.

SpeckleViz-Interface2