7  3D model with annotations

7.1 3D model with annotations - https://wikibase.wbworkshop.tibwiki.io/wiki/Item:Q469

This page shows a 3D model .obj file using the obj2html Python library found at https://z-uo.medium.com/visualize-3d-model-in-jupyter-notebook-e5a9deca20c6. This converts a .obj file to HTML and then displays the HTML.

This is currently using a 9.9 MB test model object because the dining room 3D model is 148.6 MB and is currently not working with this script.

Code
from obj2html import obj2html
from IPython.display import display, HTML

obj2html('model.obj', 'model.html')
#obj2html('Tafelstube_Final_4_JL_US.obj', 'model.html')

display(HTML('model.html'))

The below code performs a SPARQL query to get the annotations for a specific target entity, in this case Q446 ‘Weikersheim, Dining room CAD model’ (https://wikibase.wbworkshop.tibwiki.io/wiki/Item:Q446).

The below code produces a QR code for this page.

Code
from PIL import Image
import qrcode

# Link for website
input_data = "https://nfdi4culture.github.io/cp4c/model_with_annotations.html"

#Creating an instance of qrcode
qr = qrcode.QRCode(
        version=1,
        box_size=10,
        border=5)
qr.add_data(input_data)
qr.make(fit=True)
img = qr.make_image(fill='black', back_color='white')

display(img)