[ For background, see this thread on @topologic ]
Molior is a tool developed to create usable 3D models from building designs generated by Homemaker, but it is designed to work independently of Homemaker and can be used to generate IFC models from simple text definitions.
Molior uses as input an undocumented (until now) intermediate file format with a YAML structure called .molior
. It outputs 3D DXF, Collada or IFC data. Molior is a perl module that depends on two other non-standard perl modules: File::IFC and File::DXF.
molior-ifc.pl
is a command-line tool, it accepts one or more .molior
files as input and outputs a single .ifc
file as output. It requires some style information, default profiles, windows and doors that are found in a folder called share
in the Molior sources. You will need to set the path to this folder in your environment before running the tool:
$ export SHARE_DIR=~/src/molior/share
$ molior-ifc.pl interior_wall.molior interior_wall.ifc
Here is a really simple .molior
file that defines a single segment interior wall with a door in it:
---
type: molior-wall
guid: abcdefghijklmnopqrstuvwxyz
level: 0
name: interior
closed: 0
elevation: 3.0
height: 3.0
ceiling: 0.2
floor: 0.02
inner: 0.08
outer: 0.08
path:
-
- 30.8
- 17.8
-
- 25.457
- 15.935
openings:
-
- along: 0.45
name: kitchen inside door
size: 0
I hope most of this is obvious:
-
---
just indicates that the following data is a YAML stream.molior-ifc.pl
will accept multiple files as input, or they can be concatenated into a single file separated by---
. -
type: molior-wall
just says that this isn't a ceiling. -
guid
is a string that identifies which building (of potentially several) this element belongs-to. -
level
is the building storey this element belongs-to, ground floor is 0, the floor above ground is 1. -
name: interior
this is used to tag this wall as.INTERIOR.
in the IFC file. -
closed: 0
indicates that this wall doesn't form a loop (this example only has one segment, so setting this to 1 may cause undefined problems). -
elevation
is the absolute level of the bottom of the wall (this is the implicit level of the storey, metres). -
height
is the floor to floor height of the wall (metres). -
ceiling
andfloor
indicate the space at the top and bottom of the wall that is obscured by structure, where we can't put windows and doors (metres) -
inner
andouter
are the offsets from the centreline for the two faces, this is an interior wall so the values are the same (metres). -
path
is a list of X and Y coordinates that define 2D position of the wall (at least two entries, metres). -
openings
is a list of wall segments, each segment contains a list of needed windows and doors. Molior picks the door from a database of doors, it will shuffle it around and even switch to a smaller door if it doesn't fit; so thename
field is the class of door we want (from the database),size
is which door in the class we prefer, 0 is the first, andalong
is where we want it (metre distance from start of the segment). Notice that I haven't implemented left and right swings etc.. yet. You don't need to know exactly where you want the door, setalong
to 0.0 or 20.0 and the door will be shuffled to the start or end of the segment (with the amount of clearance defined in the style database).
This is what the IFC output looks like in blenderbim: