{"id":949,"date":"2026-09-09T23:12:10","date_gmt":"2026-09-09T22:12:10","guid":{"rendered":"https:\/\/pythoncvc.net\/?p=949"},"modified":"2026-09-09T23:24:18","modified_gmt":"2026-09-09T22:24:18","slug":"python-materialsdb-0-2-from-a-materials-library-to-a-materials-workflow","status":"publish","type":"post","link":"https:\/\/pythoncvc.net\/?p=949","title":{"rendered":"python-materialsdb 0.2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">It has been five years since my <a href=\"https:\/\/pythoncvc.net\/?p=909\">last article on this library<\/a>.\nBack then it was an alpha: a thin wrapper to convert materialsdb.org data\ninto an IFC project library. Since then the library grew into a complete\nmaterials workflow: an indexed catalogue, a web GUI to browse and compose\nconstructions, and a two-way integration with Bonsai (the BlenderBIM\nadd-on) \u2014 shipped as a Blender extension you can install and update like any\nother.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"whats-new-\">What&rsquo;s new ?<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"an-indexed-catalogue\">An indexed catalogue<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The library keeps a local sqlite index of everything cached from\nmaterialsdb.org producers (more than 2 000 materials). Filtering by company,\ncategory, \u03bb range, thickness or usage is instant, and parsing got 3.9-4.7x\nfaster along the way:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">from materialsdb import query\n\nquery.refresh()                                # update the index from cached xml\nrows = query.search(\"isolant\", sort=\"lambda\")  # filtered, sorted summaries\nmaterial = query.get_material(rows[0].id)      # full material dataclass\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"a-web-application-materialsdb-gui\">A web application: materialsdb-gui<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A dependency-free (stdlib) local web application, started with <code>materialsdb-gui<\/code>.\nThe picker lets you browse every cached material, sort and facet-filter by\ncompany\/category\/conductivity, pick whole materials or specific manufacturer\nthicknesses, and either export a standalone <code>.ifc<\/code> library or append into the\nIFC file open in your session.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pythoncvc.net\/wp-content\/uploads\/2026\/09\/IMAGE_PICKER_TABLE.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"484\" src=\"https:\/\/pythoncvc.net\/wp-content\/uploads\/2026\/09\/IMAGE_PICKER_TABLE-1024x484.png\" alt=\"\" class=\"wp-image-950\" srcset=\"https:\/\/pythoncvc.net\/wp-content\/uploads\/2026\/09\/IMAGE_PICKER_TABLE-1024x484.png 1024w, https:\/\/pythoncvc.net\/wp-content\/uploads\/2026\/09\/IMAGE_PICKER_TABLE-300x142.png 300w, https:\/\/pythoncvc.net\/wp-content\/uploads\/2026\/09\/IMAGE_PICKER_TABLE-768x363.png 768w, https:\/\/pythoncvc.net\/wp-content\/uploads\/2026\/09\/IMAGE_PICKER_TABLE-1536x726.png 1536w, https:\/\/pythoncvc.net\/wp-content\/uploads\/2026\/09\/IMAGE_PICKER_TABLE-620x293.png 620w, https:\/\/pythoncvc.net\/wp-content\/uploads\/2026\/09\/IMAGE_PICKER_TABLE.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"a-construction-maker\">A construction maker<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Compose thermal constructions layer by layer, with live U-value computation\n(ISO 6946 \/ SIA 180 surface-resistance presets), a scaled stack preview, saved\nconstructions in your cache directory, and export as\n<code>IfcMaterialLayerSet<\/code>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pythoncvc.net\/wp-content\/uploads\/2026\/09\/IMAGE_CONSTRUCTION_COMPOSER.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"484\" src=\"https:\/\/pythoncvc.net\/wp-content\/uploads\/2026\/09\/IMAGE_CONSTRUCTION_COMPOSER-1024x484.png\" alt=\"\" class=\"wp-image-951\" srcset=\"https:\/\/pythoncvc.net\/wp-content\/uploads\/2026\/09\/IMAGE_CONSTRUCTION_COMPOSER-1024x484.png 1024w, https:\/\/pythoncvc.net\/wp-content\/uploads\/2026\/09\/IMAGE_CONSTRUCTION_COMPOSER-300x142.png 300w, https:\/\/pythoncvc.net\/wp-content\/uploads\/2026\/09\/IMAGE_CONSTRUCTION_COMPOSER-768x363.png 768w, https:\/\/pythoncvc.net\/wp-content\/uploads\/2026\/09\/IMAGE_CONSTRUCTION_COMPOSER-1536x726.png 1536w, https:\/\/pythoncvc.net\/wp-content\/uploads\/2026\/09\/IMAGE_CONSTRUCTION_COMPOSER-620x293.png 620w, https:\/\/pythoncvc.net\/wp-content\/uploads\/2026\/09\/IMAGE_CONSTRUCTION_COMPOSER.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"and-now-straight-into-bonsai\">And now: straight into Bonsai<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The part I wanted the most. <code>python-materialsdb<\/code> now ships a\n<strong>Blender extension<\/strong>, installable and updatable from inside Blender through\nan extension repository:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><em>Preferences \u25b8 Get Extensions \u25b8 \u2304 \u25b8 Add Remote Repository<\/em> \u2014 add <a href=\"https:\/\/cyrilwaechter.github.io\/python-materialsdb\/index.json\">https:\/\/cyrilwaechter.github.io\/python-materialsdb\/index.json<\/a>, then install <em>materialsdb listener<\/em>.<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">Once installed, the panel in the 3D-view sidebar can start the GUI server for\nyou, open the picker in your browser, and receive whatever you send:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pythoncvc.net\/wp-content\/uploads\/2026\/09\/IMAGE_BLENDER_PANEL.png\"><img loading=\"lazy\" decoding=\"async\" width=\"275\" height=\"253\" src=\"https:\/\/pythoncvc.net\/wp-content\/uploads\/2026\/09\/IMAGE_BLENDER_PANEL.png\" alt=\"\" class=\"wp-image-952\"\/><\/a><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Materials<\/strong>: pick them in the browser, one click sends them into the<br>open IFC model \u2014 with their materialsdb identity property set (so Lesosai<br>or any materialsdb-aware software can retrieve the full data later),<br>per-layer property sets and surface colours. Undoable, of course.<\/li>\n\n\n\n<li><strong>Constructions<\/strong>: the construction maker pushes a construction as an<br><code>IfcWallType<\/code> \/ <code>IfcSlabType<\/code> \/ <code>IfcRoofType<\/code> (per its design usage) with<br>its <code>IfcMaterialLayerSet<\/code>, visible in the outliner.<\/li>\n\n\n\n<li><strong>Round-trip<\/strong>: select a wall in your model (or its type), send it back to<br>the composer, adjust thicknesses \u2014 even layers whose material is not a<br>materialsdb object are kept as \u00ab\u00a0model material\u00a0\u00bb placeholders \u2014 and push it<br>back into the <em>same<\/em> layer set. Ctrl+Z rewinds it with a titled undo step.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Everything talks over a small localhost HTTP API, so FreeCAD, Revit or\nwhatever-you-use listeners can reuse the exact same channel later.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"installing\">Installing<\/h1>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">pip install python-materialsdb\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For the Bonsai integration: add the extension repository URL in Blender, set\nyour Python interpreter in the add-on preferences (it needs\n<code>pip install python-materialsdb<\/code>), and you are set. Detailled instructions in\nthe <a href=\"https:\/\/github.com\/CyrilWaechter\/python-materialsdb\">README<\/a>.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"whats-next-\">What&rsquo;s next ?<\/h1>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Local\/project materials file<\/strong>: promote the \u00ab\u00a0model material\u00a0\u00bb placeholders<br>into a project-specific materialsdb file, so foreign materials can live<br>across projects and still compute U-values.<\/li>\n\n\n\n<li>Listeners beyond Bonsai (FreeCAD, Revit) \u2014 the protocol is already<br>host-agnostic.<\/li>\n\n\n\n<li>More of the materialsdb data mapped into IFC property sets.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It has been five years since my last article on this library. Back then it was an alpha: a thin wrapper to convert materialsdb.org data into an IFC project library. Since then the library grew into a complete materials workflow: an indexed catalogue, a web GUI to browse and compose constructions, and a two-way integration [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"categories":[19],"tags":[291,290,295,289,297],"class_list":["post-949","post","type-post","status-publish","format-standard","hentry","category-non-classe-en","tag-bonsai","tag-building-energy-modeling-bem","tag-ifcprojectlibrary","tag-materials","tag-opendata"],"_links":{"self":[{"href":"https:\/\/pythoncvc.net\/index.php?rest_route=\/wp\/v2\/posts\/949","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pythoncvc.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pythoncvc.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pythoncvc.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pythoncvc.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=949"}],"version-history":[{"count":3,"href":"https:\/\/pythoncvc.net\/index.php?rest_route=\/wp\/v2\/posts\/949\/revisions"}],"predecessor-version":[{"id":955,"href":"https:\/\/pythoncvc.net\/index.php?rest_route=\/wp\/v2\/posts\/949\/revisions\/955"}],"wp:attachment":[{"href":"https:\/\/pythoncvc.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=949"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pythoncvc.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=949"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pythoncvc.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=949"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}