Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,30 @@ and this project adheres to
- Add infrastructure `collisions` boolean drawing parameter, enabled by
default. When enabled, RacksDB highlights equipment colliding with other
equipment with red frames in infrastructure diagrams.
- Generate 3D representations of infrastructures in glTF 2.0 JSON (`gltf`)
and binary (`glb`) formats, with racks and equipment in their datacenter
rooms on raised floors with perforated tiles in cold aisles. Nodes of the
scene are named after database objects with metadata in their extras
(#164).
- cli: Support `gltf` and `glb` formats in `draw infrastructure` command (#164).
- web: Support `gltf` and `glb` formats in infrastructures draw endpoint
(#164).
- ui: Add 2D/3D toggle in infrastructure details page, with an interactive 3D
viewer of infrastructures based on three.js, with a turntable mode with the
camera orbiting automatically around the racks (#164).
- pkgs:
- Install floor textures of 3D representations with the Python package.
- Add dependency on three.js in web UI.
- docs:
- Mention support of Fedora 44.
- Document `equipment` attribute of `RacksDBRack` objects in Python library
API reference.
- Add page about 3D representations of infrastructures with glTF scenes
conventions and nodes metadata.
- Mention `gltf` and `glb` formats in `racksdb` manpage.
- Mention 3D view of infrastructures in web UI page.
- Mention 3D representations of infrastructures in diagrams section of
overview page.

### Fixed
- lib:
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ RacksDB provides multiple interfaces with its
<p>

RacksDB can generate graphical representations of your datacenter rooms and your
infrastructures with their racks and equipment, including axonometric views for
3D representations:
infrastructures with their racks and equipment, including axonometric views and
[3D representations](https://docs.rackslab.io/racksdb/usage/3d.html):

<p align="center">
<img
Expand All @@ -86,6 +86,9 @@ infrastructures with their racks and equipment, including axonometric views for
These graphical representations can be generated in various formats (PNG, SVG,
PDF) and can be customized with many
[drawing parameters](https://docs.rackslab.io/racksdb/usage/drawparams.html).
The 3D representations of infrastructures are generated in standard glTF 2.0
format. They can be explored interactively in the web UI or imported in any 3D
software.

For more details, read the
[full description](https://docs.rackslab.io/racksdb/overview/overview.html)
Expand Down
1 change: 1 addition & 0 deletions assets/screenshots/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ shadowed:
- racks.png
- infrastructures.png
- infrastructure.png
- 3d_fullscreen.png
- infrastructure_filters.png
Binary file added assets/screenshots/raw/3d_fullscreen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/screenshots/raw/infrastructure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/screenshots/shadowed/3d_fullscreen.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/screenshots/shadowed/infrastructure.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/modules/overview/images/racksdb_diagrams.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions docs/modules/overview/images/racksdb_diagrams.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion docs/modules/overview/pages/overview.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,24 @@ synchronized with database content.
== Diagrams

RacksDB can be used to generate diagrams of your datacenter rooms and the racks
with all their equipments, including _axonometric views_ for 3D representations.
with all their equipments, including _axonometric views_, and
xref:usage:3d.adoc[3D representations] of your infrastructures.

image::overview:racksdb_diagrams.png[RacksDB Diagrams,xref=image$racksdb_diagrams.svg]

These diagrams can be generated in various formats (PNG, SVG, PDF) and be
customized with many xref:usage:drawparams.adoc[drawing parameters].

The 3D representations of infrastructures are generated in standard glTF 2.0
format, with your racks and equipment in their datacenter rooms. They can be
explored interactively in the xref:usage:ui.adoc[Web UI] or imported in any
3D software.

[sidebar]
--
.More links
* xref:usage:racksdb.adoc#draw[`racksdb` CLI drawing feature]
* xref:usage:drawparams.adoc[Drawing parameters howto and reference
documentation]
* xref:usage:3d.adoc[3D representations of infrastructures]
--
38 changes: 30 additions & 8 deletions docs/modules/usage/attachments/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,8 @@ paths:
description: successful operation
/v0.7.0/draw/<entity>/<name>.<format>:
get:
description: Draw an entity
description: Draw an entity. Infrastructures can also be represented in 3D with
glTF 2.0 formats (gltf and glb).
parameters:
- description: Type of entity to draw
in: path
Expand All @@ -1160,7 +1161,8 @@ paths:
required: true
schema:
type: string
- description: Format of the generated image
- description: Format of the generated image. Formats gltf and glb are supported
for infrastructures only.
in: path
name: format
required: true
Expand All @@ -1170,6 +1172,8 @@ paths:
- png
- svg
- pdf
- gltf
- glb
type: string
- description: Control if entities are represented perfectly aligned on pixels
with concession on relative dimensions correctess. This parameter has no
Expand Down Expand Up @@ -1485,6 +1489,13 @@ paths:
image/svg+xml:
schema:
type: string
model/gltf+json:
schema:
type: string
model/gltf-binary:
schema:
format: binary
type: string
multipart/form-data:
schema:
format: binary
Expand All @@ -1496,8 +1507,8 @@ paths:
schema:
$ref: '#/components/schemas/Error'
description: Unsupported entity, unable to load drawing parameters, unsupported
image format, unsupported coordinates format or unable to load requested
entity in database.
image format, unsupported coordinates format, coordinates requested with
3D format or unable to load requested entity in database.
'415':
content:
application/json:
Expand All @@ -1511,7 +1522,8 @@ paths:
$ref: '#/components/schemas/Error'
description: Unable to load drawing parameters schema.
post:
description: Draw an entity
description: Draw an entity. Infrastructures can also be represented in 3D with
glTF 2.0 formats (gltf and glb).
parameters:
- description: Type of entity to draw
in: path
Expand All @@ -1528,7 +1540,8 @@ paths:
required: true
schema:
type: string
- description: Format of the generated image
- description: Format of the generated image. Formats gltf and glb are supported
for infrastructures only.
in: path
name: format
required: true
Expand All @@ -1538,6 +1551,8 @@ paths:
- png
- svg
- pdf
- gltf
- glb
type: string
- allowEmptyValue: true
description: Dump equipments and racks coordinates in diagrams. When this
Expand Down Expand Up @@ -1579,6 +1594,13 @@ paths:
image/svg+xml:
schema:
type: string
model/gltf+json:
schema:
type: string
model/gltf-binary:
schema:
format: binary
type: string
multipart/form-data:
schema:
format: binary
Expand All @@ -1590,8 +1612,8 @@ paths:
schema:
$ref: '#/components/schemas/Error'
description: Unsupported entity, unable to load drawing parameters, unsupported
image format, unsupported coordinates format or unable to load requested
entity in database.
image format, unsupported coordinates format, coordinates requested with
3D format or unable to load requested entity in database.
'415':
content:
application/json:
Expand Down
1 change: 1 addition & 0 deletions docs/modules/usage/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
** xref:racksdb.adoc[`racksdb`]
** xref:racksdb-web.adoc[`racksdb-web`]
* xref:drawparams.adoc[]
* xref:3d.adoc[]
* xref:lib.adoc[]
* xref:rest.adoc[]
* xref:ui.adoc[]
Expand Down
149 changes: 149 additions & 0 deletions docs/modules/usage/pages/3d.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
= 3D Representations

RacksDB can generate 3D representations of infrastructures in
https://www.khronos.org/gltf/[glTF 2.0] format, the standard format for 3D
scenes supported by most 3D software (_ex:_ Blender) and web 3D libraries
(_ex:_ three.js, Babylon.js). These representations contain all the rooms and
racks used by the infrastructure, with its equipment at their positions in the
racks.

image::shadowed/3d_fullscreen.webp[3D Representation of Infrastructure,800]

== Formats

Two variants of glTF format are supported:

`glb`::
Binary format, in a single file with all the data. This is the most compact
variant, it is recommended in most cases. Its media type is
`model/gltf-binary`.

`gltf`::
JSON format, with all binary data (geometry, textures) embedded in base64
encoded URI. Its media type is `model/gltf+json`.

These formats are supported for infrastructures only. Coordinates cannot be
requested with these formats.

== Usage

With xref:racksdb.adoc#draw[`racksdb` CLI], select the format with `--format`
option. For example:

[source,console]
----
$ racksdb draw infrastructure --name=mercury --format=glb
----

This command generates file `mercury.glb` in current directory.

With xref:rest.adoc[REST API], use the format as extension of the requested
resource. For example:

[source,console,subs=attributes]
----
$ curl -X POST http://localhost:5000/{api-version}/draw/infrastructure/mercury.glb \
--output mercury.glb
----

The xref:ui.adoc#_infrastructure_details[web UI] also displays these 3D
representations in an interactive viewer.

== Drawing Parameters

The following xref:drawparams.adoc[drawing parameters] are honored in 3D
representations:

* `infrastructure.equipment_tags`
* `infrastructure.ghost_unselected`, ghosted equipment are semi-transparent
* `infrastructure.discard_empty_racks`
* `infrastructure.other_racks`, racks not used by the infrastructure are
represented with closed doors
* `infrastructure.collisions`, edges of colliding equipment are red
* `rack.u_height`
* `rack.pane_width`
* `colors.equipments`, with `background`, `border` and `ghost` colors
* `colors.racks`, with `frame` color

Other drawing parameters are specific to images and they are ignored.

== Scene

The scene uses meters as unit, with Y axis pointing up. In rooms, the X axis
follows room width and the Z axis follows room depth, so that a scene viewed
from above matches room maps. Racks doors face +Z in racks local coordinates.

The rooms have raised floors with 600mm tiles. Every other tile in front of
racks doors is perforated, to represent cold aisles. When the infrastructure is
spread over multiple rooms, the rooms are placed side by side along the X axis,
separated by 2 meters.

Equipment depth is not defined in database. Equipment are represented as deep
as their rack, minus 10cm at the rear.

The glTF scene graph follows the structure of the database. Every glTF node
representing a database object (room, row, rack or equipment) is named after
this object and has metadata in its `extras` property, with the `category` key
giving the type of object. For equipment, this key contains the category of
equipment in RacksDB (`node`, `storage`, `network` or `misc`).

[cols="1,2,1,4"]
|===
|Object|Category|Parent|Extras

|Room
|`room`
|_scene_
|`datacenter`: name of datacenter +
`size`: room width, height (always 0) and depth in meters

|Row
|`row`
|Room
|`reversed`: boolean, true if racks doors face the top of room maps

|Rack
|`rack`
|Row
|`type`: rack type +
`tags`: list of rack tags +
`infrastructure`: boolean, false if the rack is represented only because of
`other_racks` drawing parameter +
`size`: rack width, height and depth in meters

|Equipment
|`node`, `storage`, `network` or `misc`
|Rack
|`type`: equipment type +
`tags`: list of equipment tags +
`rack`: name of rack +
`slot`: object with `height` and `width` keys, the position of equipment in
rack +
`selected`: boolean, false for ghosted equipment +
`colliding`: boolean, true if equipment collides with other equipment +
`size`: equipment width, height and depth in meters
|===

The geometry of database objects is attached to unnamed child glTF nodes, which
have a `part` key in their `extras` instead of `category`. For example, this is
an excerpt of the scene graph of `mercury` infrastructure, with the `extras` of
the glTF nodes:

----
noisy {"category": "room", …}
├── (unnamed) {"part": "floor"}
├── R1 {"category": "row", …}
│ └── R1-A01 {"category": "rack", …}
│ ├── (unnamed) {"part": "left"}
│ ├── …
│ └── mecn0001 {"category": "node", …}
│ ├── (unnamed) {"part": "body"}
│ └── (unnamed) {"part": "edges"}
└── …
----

NOTE: Some glTF loaders modify the names of glTF nodes. For example, three.js
removes characters `[]./:` and replaces whitespaces with underscores, so
equipment `sw1.example.org` is named `sw1exampleorg`. Original names can be
retrieved with `parser.associations` and `parser.json` properties of the loaded
glTF object.
5 changes: 3 additions & 2 deletions docs/modules/usage/pages/drawparams.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

RacksDB offers the possibity to generate graphical representations of datacenter
room and infrastructures with their racks and equipments in various images
formats. The images are generated with various default drawing parameters that
user are able to customize for their requirements.
formats, and xref:3d.adoc[3D representations] of infrastructures. The images
are generated with various default drawing parameters that user are able to
customize for their requirements.

The xref:#usage[first section] of this page describes how to specify drawing
parameters with both RacksDB xref:racksdb.adoc[CLI] and
Expand Down
Loading
Loading