Compare commits

...

1779 Commits

Author SHA1 Message Date
Sigma Dimensions 8083a635a8 You can now import work schedules from csv 2023-03-28 04:04:48 +00:00
Dion Moult fab76bbcde Fixed bug where enumeration values in psets could be empty lists. 2023-03-27 23:08:47 +11:00
krande 7f78df595f minor clarification in comment 2023-03-27 13:35:24 +02:00
krande 03ff34f89f update ci-restart script with code that works and is testable locally 2023-03-27 13:35:24 +02:00
krande 8820a1dcc3 switch to a python implementation of the same procedure 2023-03-27 13:35:24 +02:00
krande 514975d123 add a workflow to catches and restarts failed conda builds due to 143 errors. And minor cleanup of unused variables in conda meta.yaml 2023-03-27 13:35:24 +02:00
Dion Moult c87911f00e IFC selector now uses "class" as a keyword to get the IFC class to disambiguate between "type" and "class". 2023-03-27 21:47:11 +11:00
Dion Moult 1e77562f0f Fix #2847. You can now join meshes and extrusions together. 2023-03-27 21:46:26 +11:00
Dion Moult b1843ce781 Fix IfcTester bug which did not consider null enumeration values 2023-03-27 17:36:06 +11:00
Dion Moult 02fb09ff7e Implement faux-mirroring. 2023-03-27 14:21:59 +11:00
Dion Moult bdb193f500 Minor fix 2023-03-27 13:38:14 +11:00
Dion Moult e9a3630595 Fix #2898. You can now copy materials from the materials tab. 2023-03-26 19:04:32 +11:00
Dion Moult fb3e4016ec See #2898. Fix bug where UI data was not refreshed when you switched active materials. 2023-03-26 18:07:10 +11:00
Trashman247 15a1aa5355 Move bl_descriptions
Moved bl_descriptions under bl_options when bl_options exists, copying the syntax of already existing operators with descriptions.
2023-03-26 17:46:33 +11:00
Trashman247 f1d6e95e51 Add tooltips to IFC Project Info and Clash Sets Panels 2023-03-26 17:46:33 +11:00
Dion Moult b9c99b35a5 Fix #2881. Support added for referencing nested relationships and material set items. 2023-03-25 22:07:18 +11:00
Dion Moult df0a503b89 Improve implementation of is_moved so that anywhere we check movement, types and projects are not considered 2023-03-24 21:59:09 +11:00
Dion Moult 346071185f Fix bug where appending a product from a library which had relationships to types caused a bunch of types to be pulled in unintentionally 2023-03-24 20:53:55 +11:00
Dion Moult f3f90e0ad5 Fix bug where mesh analysis during updating meshes as solids (i.e. extrusions) did not remove doubles, causing it to fail on sloppy meshes (and meshes are often sloppy) 2023-03-24 20:53:18 +11:00
Dion Moult 8aa2c1eea7 Fix critical bug where types would think they moved and cause long syncs at export time. 2023-03-24 20:52:20 +11:00
Dion Moult 57c32e55c2 Fix #2698. Bug where clash sets couldn't be visualised if you had one of the models open (i.e. not linked) in the active session. 2023-03-24 18:25:33 +11:00
Dion Moult de080a668f Fix #2901. Silly typo. 2023-03-24 17:48:27 +11:00
Dion Moult 00fc71dcbe Fix #2837. Shared subelements mistakenly caused the subelement append loop to break early. The solution is to traverse one level at a time. 2023-03-24 17:36:46 +11:00
Andrej730 808cb6ec14 Fixed outdated code issue 2023-03-24 11:00:08 +05:00
Andrej730 8899776106 Fixed #2900
1) Leaders text decorator wasn't changed after adding support for multiple literals
2) added drawing data update on toggling viewport annotations - so user would see correct values right away; also fixed similar thing on updating product
2023-03-24 11:00:08 +05:00
Andrej730 ae674b00c2 Fixed bugs after adding aggregated text annotations (#2899) 2023-03-24 10:09:23 +05:00
Dion Moult 73b6d23d4f Minor fix 2023-03-24 16:05:27 +11:00
Dion Moult 6d1cabe534 Fix #2887. Fix bug where you could create multiple opening objects. 2023-03-24 15:03:39 +11:00
Dion Moult ab34fda42c See #2887. Save mesh dialog now only shown when mesh is edited. 2023-03-24 14:33:13 +11:00
Dion Moult fab4133df6 Minor fix 2023-03-24 13:22:10 +11:00
Dion Moult 301e368a2c Minor fix 2023-03-23 22:09:31 +11:00
Dion Moult 0a22714fb8 See #2887. Experimental edit mode toggle override to ensure mesh changes stay in sync and so that you can edit meshes without openings applied. 2023-03-23 21:51:06 +11:00
Thomas Krijnen ef2cec7435 #2884 depends python3-pytest 2023-03-23 09:05:39 +01:00
Dion Moult b4f486e9aa Minor fix 2023-03-23 16:54:15 +11:00
Andrej730 297303063e Small changes in default names for saving ifc projects
1) changed first ifc saving handler from save_pre to save_post so that in the situation when you just created with .blend file and started ifc project on save dialog would suggest the same name for the .ifc file and for .blend file (previously it was always suggesting ".ifc" and you had to type it in manually).

2) suggested default ifc project named changed from `<blend_filename>.blend.ifc` to `<blend_filename>.ifc` for simplicity.

PS save_pre didn't really work anyway - by the time "save ifc dialog" file was invoked and appeared .blend file was already saved anyway.
2023-03-23 09:54:16 +05:00
Andrej730 df95bdb48e Fixing tests after 2003bfe4f 2023-03-23 09:53:02 +05:00
Dion Moult 95ac021623 Improve UI to indicate active representation. 2023-03-23 15:37:52 +11:00
Dion Moult 416efa4f14 See #2887. Fix bad UI design that could lead to objects created with the unintended context. 2023-03-23 10:44:57 +11:00
Ryan Schultz 2003bfe4fe Added_MODEL_VIEW_context
added...
context_type="Model", context_identifier="Annotation", target_view="MODEL_VIEW", parent=model
from: https://github.com/IfcOpenShell/IfcOpenShell/issues/2890
2023-03-23 08:00:39 +11:00
Andrej730 fc55a48c11 Automated adjustment of annotations scale if either camera orthographic scale or drawing scale changed 2023-03-22 15:56:55 +05:00
Andrej730 37a6be1e2b Ifc text viewport rotation for text with box alignment 2023-03-22 15:47:07 +05:00
Andrej730 e551bf531c Optimized ifc text viewport rotation algorithm 2023-03-22 14:37:48 +05:00
Andrej730 e173ea7f80 Ifc Text rotation in viewport preview 2023-03-22 14:05:03 +05:00
Andrej730 f8dc421f03 Fixed bug with multiline text in svg
Insertion position at <text> instead of <tspan> creates unnecessary x offsets between tspans
2023-03-22 11:04:43 +05:00
Andrej730 e2afb34e0d Fixed typo causing #2889 2023-03-22 10:09:38 +05:00
Andrej730 f7181aae8a Multiple literals in 1 Ifc Text + aggregated text annotations
Added option to store multiple literals inside 1 Ifc text object.

If multiple literals share the same `BoxAlignment` then only the first one will be displayed in viewport
to prevent visual clutter (although added small asterisk symbol to indicate that there are still multiple literals).

Added option for aggregated text annotations. Example - "door-tag" symbol.
If you create text, specify "door-tag" symbol in EPset_Annotation.Symbol
\and add two literals to it then they'll automatically will fit to that door-tag in the svg drawing
(https://i.imgur.com/OXaIlWe.png).

The way it works - you define symbol in symbols.svg (or in your own symbols svg file)
and then add the `<text>` fields where text from literals will fit right in.
The imporant note: `<text>` tag must have attribute `data-type="text-template"` for it to work.
For example: `<text text-anchor="middle" dominant-baseline="middle" data-type="text-template"></text>`
2023-03-21 17:37:28 +05:00
ArturTomczak 2a0fdd214c update the namespaces to current IDS schema 2023-03-21 20:37:37 +11:00
Dion Moult 45209be0ff You can now easily get a list of FMHEM classes and subtypes to list explicitly in IDS requirements 2023-03-21 17:15:59 +11:00
Dion Moult fcb3640bee IfcTester webapp can now render simple PartOf requirements 2023-03-21 17:13:34 +11:00
Dion Moult d503a4b50b Fix #2883. Regression in text in drawings. 2023-03-21 12:31:32 +11:00
Dion Moult 8bae2984e1 Fix #2886. Typo. 2023-03-21 09:11:30 +11:00
Andrej730 78499cc55d Fixed bugs related to "print all" (#2882) 2023-03-20 15:15:54 +05:00
Dion Moult b6aa5c57c0 Fix bug where copying types with parametric materials could lead to invalidly reused material set items. 2023-03-20 20:40:11 +11:00
Dion Moult d71e34f073 Fix bug where 2D types were not loaded as a fallback from the body representation. 2023-03-20 19:42:54 +11:00
Dion Moult a38d06d7e7 Remove dead code that manually synced drawing references. Now we have an automatic sync_references function instead. 2023-03-20 17:05:43 +11:00
Dion Moult 72b5cc8a44 Minor fix 2023-03-20 17:03:39 +11:00
Dion Moult c97e1079e8 See #2866. Fix issue where annotation should be able to use 3D coordinates (i.e. Model context type) for elevations and sections where it makes more sense. 2023-03-20 16:36:50 +11:00
Carlos Villagrasa 65caa7906d Merge remote-tracking branch 'upstream/v0.7.0' into pset_custom_units_test 2023-03-19 22:33:01 +01:00
Carlos Villagrasa d89a8520a9 Added a test for pset custom IfcUnits 2023-03-19 22:23:36 +01:00
Andres d68356c3a7 Rename class causing unregistering error 2023-03-20 08:21:11 +11:00
Andres cb0e8b6bf2 Add own sublogger for IfcSverchok 2023-03-20 08:21:11 +11:00
Andres b20b99669d Chore: add newline at end of file 2023-03-20 08:21:11 +11:00
Andres d41a277b71 Fix runtime error when unregistering add-on 2023-03-20 08:21:11 +11:00
Andres 33e6a0fdae Update logger to match Sverchok latest 2023-03-20 08:21:11 +11:00
Massimo Fabbro d911d8579d Add qto data file 2023-03-20 08:12:24 +11:00
Massimo Fabbro 05bdc962a3 Now it's possible to see the selected object related cost items and related quantities in qto n-panel 2023-03-20 08:12:24 +11:00
Sigma Dimensions 0e03a01f61 fixing previous commit #ff806dc 2023-03-19 14:11:32 +00:00
Sigma Dimensions ff806dc6e4 improve covering qto calculation 2023-03-19 13:30:35 +00:00
Thomas Krijnen 5fcfbac4a3 Update validate.py 2023-03-19 13:24:27 +01:00
Thomas Krijnen 00b18f67cf #2685 indeterminate upper bound formatting 2023-03-19 12:46:15 +01:00
Dion Moult 088354a96b Fix critical bug where copied representations would be inefficiently or incorrectly replicated. 2023-03-19 22:03:45 +11:00
Dion Moult cfd857233c Fix #2864. Fix bug where element containment was invalidly prioritised over voids and fills in relative placement. 2023-03-19 18:46:34 +11:00
Dion Moult 2816d7f522 Fix bug where deleting the drawing object could lead to orphaned relationships 2023-03-19 18:15:09 +11:00
Dion Moult 3da718a6d1 Fix bug where removing objects could leave orphaned annotation relationships 2023-03-19 15:17:26 +11:00
Dion Moult 558aff72a0 Psets and qtos are now only created when properties exist to prevent invalid IFCs. 2023-03-19 14:49:31 +11:00
Dion Moult bcc399b842 Empty psets are purged to discourage invalid psets with no properties 2023-03-19 13:13:15 +11:00
Andrej730 32e47d03d4 IFC text - box alignment in viewport 2023-03-18 11:56:29 +05:00
Carlos Villagrasa a669c194cf Merge pull request #2869 from cvillagrasa/api_material_fix
Api material fix
2023-03-17 17:04:22 +01:00
Carlos Villagrasa 91f4687eac Revert "Add more parameters to material.add_layer"
This reverts commit 9946117de1.
2023-03-17 17:02:35 +01:00
Andrej730 31f6baaf67 small refactor for Ifc.edit and tool.Ifc
1) replaced IfcStore.edited_objs.add with tool.Ifc.edit
2) updated interface in tool.py
3) removed unlink from tool.Ifc - it was declared there twice
2023-03-17 17:50:56 +05:00
Andrej730 a83c4b2896 Stair, roof, railing - auto updating representation when creating one or update it
So basically there should be no need to manually update representation after you created one of the objects from ifc modifiers.
2023-03-17 17:32:36 +05:00
Andrej730 c685425667 Fixed bugs with text annotations after
1) Bug when new text added without specifying it's font size in class appeared empty;
2) Bug when leader text appeared weirdly bold.
2023-03-17 17:02:42 +05:00
ay-ex 553334d50e add imports to snippet
added imports and syntax highlighting so it is easier to run for newcomers
2023-03-17 20:33:15 +11:00
Andrej730 0b7b0a29a9 Solved redundant spaces in multiline svg text annotations (#2833)
The issue occurs because of svg pretty formatting - indent spaces <text> tag treats as actual spaces. Because of that use some css magic to remove those spaces from <text> tag and assign class to it's children <tspan> tags.

Altough trying to solve this issue I've tried to disable svg pretty format and got empty svg as a result (only templates, styles, no annotations) for some reason.
2023-03-17 11:05:27 +05:00
Andrej730 ae7f834a0f draw_text_annotation refactor
Refactored a code a bit and replaced literal parsing with `text_obj.BIMTextProperties.text` since it's already done beforehand in `tool.Drawing.update_text_value()`.
2023-03-17 11:05:26 +05:00
Andrej730 fe0a98a44f black format 2023-03-16 16:08:58 +05:00
Andrej730 35e748089b Prevent pyrna_enum_to_py warnings on using BIM Tool hotkeys
Type of warning fixed:
WARN (bpy.rna): pyrna_enum_to_py: current value '0' matches no enum in 'BIMModelProperties', '', 'ifc_class'
2023-03-16 16:08:58 +05:00
Andrej730 ff2cda7d18 Small refactor + allowing to preview text in viewport while editing 2023-03-16 16:08:58 +05:00
Andrej730 0d473fa9ac Fixing BoxAlignment value in tests (similar to 9f7db386a) 2023-03-16 16:08:58 +05:00
Andrej730 d8eb765906 BIM Tool - hotkey for editing text annotation
Added hotkey in BIM Tool for editing active text annotation (It's binded on Shift + E).
2023-03-16 16:08:58 +05:00
Carlos Villagrasa fab7b590f7 Allow for custom IfcUnits when editing psets 2023-03-16 20:39:32 +11:00
Andrej730 c9f52d2f8e Option to print all svg drawings #2794
It's working either if you shift click the printing button or supply `print_all = True` argument to `bim.create_drawing operator`.
2023-03-16 11:35:31 +05:00
Andrej730 821993d289 Fixed accidentally removed line in ee1e40171 2023-03-16 10:11:26 +05:00
Andrej730 2d32bc609a Figured a new way to update viewport to preview changes in ifc text 2023-03-16 10:11:26 +05:00
Andrej730 296cec02e8 Removed outdated code from BIMTextProperties 2023-03-16 10:11:26 +05:00
Andrej730 b55ac88c9d Fixing tests after 9f7db386a
TestExportTextLiteralAttributes and TestImportTextAttributes was failing because now we're assuming that BoxAlignment will have 1 of values from the list below and not "BoxAlignment"

"top-left", "top-middle", "top-right", "middle-left", "center", "middle-right", "bottom-left", "bottom-middle", "bottom-right"
2023-03-15 19:43:17 +05:00
Andrej730 c6d3598c52 Fixing tests after e9fdc979d 2023-03-15 19:43:17 +05:00
Andrej730 c4d2b30017 black format 2023-03-15 19:43:17 +05:00
Andrej730 ee1e401719 Ifc Text - drop down menu to switch font size
Added drop down menu to Ifc Text section in object properties where you can change text's size and it will automatically change it in `EPset_Annotation.Classes`. You can also preview it in viewport and it will write in IFC only after you finish editing.

Still need to investigate `annotation.Annotator.resize_text(context.active_object)` in `refreshFontSize`.
2023-03-15 19:43:16 +05:00
Andrej730 3c2ef518e8 IfcText - box alignment interface instead of manually typing text position
realigning box widget
2023-03-15 19:43:16 +05:00
Andrej730 f3e327e088 Added classes description for EPset_Annotation 2023-03-15 19:43:16 +05:00
Andrej730 be1d4e06de IfcText - different text sizes in viewport 2023-03-15 19:43:16 +05:00
Dion Moult 32f5a77d07 New shape utilities for getting top / bottom elevations and bbox. 2023-03-15 18:51:31 +11:00
Dion Moult 9121a6b864 Revert "Fix #2418. Object materials are now found in the materials tab."
This reverts commit 7666463751.
2023-03-15 18:30:11 +11:00
Carlos Villagrasa 9946117de1 Add more parameters to material.add_layer 2023-03-15 08:27:46 +01:00
Carlos Villagrasa ee85055d45 Fix bug in which layer.Material was erased 2023-03-15 08:27:27 +01:00
Andrej730 cce0867f63 IfcText - spacing in multiline text now depends on text size #2833 2023-03-14 19:38:15 +05:00
Andrej730 021321eb65 IfcText - support multiline text in viewport preview 2023-03-14 19:38:15 +05:00
Andrej730 6bd1b84b2b IfcText to appear on top of object properties stack
1) Puts IFC Text only on top of ifc panels to make it easier to change it's text
2) I guess it could be a good practive to set `bl_order = 1` by default so it will be possible later to prioritize something since by default blender sets `bl_order = 0` and then even `bl_order = -1` wouldn't help.
3) May not work in previously created files
2023-03-14 19:38:15 +05:00
Massimo Fabbro f5281a0895 Delete unuseful function 2023-03-14 11:24:37 +11:00
Massimo Fabbro 08fdf6014d weight calculator improvement (see #2859) 2023-03-14 11:24:37 +11:00
Andrej730 94f06d9e18 Another fix for dissolve limit in hiped roof generator... 2023-03-13 17:05:08 +05:00
Andrej730 8405ee4926 Fixed bug dissolve limit in generate hipped roof (e69452883)
Now it will work fine in both edit and object mode
2023-03-13 11:28:36 +05:00
Massimo Fabbro 154c4295df Finish mapping mappable quantities with get_weight 2023-03-13 13:18:02 +11:00
Massimo Fabbro 93519c1c63 Now is possible to calculate an object gross weight 2023-03-13 13:18:02 +11:00
Dion Moult 1250a20e35 Fix #2858. Fix #2856. BlenderBIM Add-on drawings and IfcCSV now support the new quoted and escaped selector capabilities. 2023-03-13 11:09:56 +11:00
Thomas Krijnen 9ec54228f8 Update ci-py-only.yml 2023-03-12 12:01:12 +01:00
Dion Moult 3f94184ace Fix bug where IfcURIReference properties wouldn't display 2023-03-12 21:55:07 +11:00
Thomas Krijnen 88c06f5450 Try different way of invoking ccache 2023-03-12 11:46:25 +01:00
Thomas Krijnen e50045bbed Update ci.yml 2023-03-12 10:06:32 +01:00
Thomas Krijnen 41417a77b9 Update ci-py-only.yml 2023-03-12 10:06:29 +01:00
Thomas Krijnen a5774bd02a Update ci-py-only.yml 2023-03-12 09:40:30 +01:00
Thomas Krijnen c38f48ee62 Try to let pip not install outdated ifopsh 2023-03-12 09:04:33 +01:00
Dion Moult 30c850e37d Fix #2140. Voids and fills can now be added, removed, and edited for non-geometric aggregates. 2023-03-12 12:52:30 +11:00
Dion Moult b6fdbd979e Adding existing objects as openings no longer move to cursor which is more intuitive 2023-03-12 12:52:30 +11:00
Thomas Krijnen 7a8bcbee33 #2685 poly curve test cases 2023-03-11 20:44:59 +01:00
Thomas Krijnen 42d7c7d32c #2685 Recompile rule 2023-03-11 20:44:11 +01:00
Thomas Krijnen c71a5a4d65 #2685 Indexing of simple type aggregates; fix index codegen bug; sizeof of indeterminate; repeat over indeterminate 2023-03-11 20:43:00 +01:00
Andrej730 e69452883f Temporarily commented out dissolve_limited in generate_hipped_roof
Currently it causes an error if you run it in object mode and doesn't really work in edit mode either because you may have no vertices selected. Will fix soon.
2023-03-11 20:47:41 +05:00
Sigma Dimensions 8624888bfc You can now specify custom names for types instead of relying on the default "TYPEX" naming 2023-03-11 14:13:56 +01:00
Andrej730 fad5c7c921 Section annotation - custom markers / toggle displaying the markers
Now it's possible to set custom markers in section annotation.

To do so you need to add BBIM_Section pset to the annotation and then you can either toggle displaying some marker with ShowStartArrow/ShowEndArrow or you can write the id of some custom symbol in StartArrowSymbol/EndArrowSymbol (need to make sure the symbol is included in symbols.svg).

Other changes:

- removed vertex sorting in decoration.py so that start and end points will be the same thing both in svg and in viewport representation (previously the sorting was needed of the direction the arrow in shader wasn't inverted));

- fixed bug when in svg section arrow symbols wouldn't rotate if you move individual verts of the annotation, not the entire object (I guess this bug sneaked in after adapting elevation annotation)
2023-03-11 18:02:16 +05:00
Dion Moult 0dad93bf00 See #2140. You can now bulk unassign aggregates, and they are auto directly contained in any previous indirect containers. 2023-03-11 16:31:23 +11:00
Dion Moult c51aa910cb See #2140. You can now select multiple objects and bulk add them to a single aggregate, and customise the aggregate class. 2023-03-11 16:31:23 +11:00
Andrej730 6d486aeb4d Removed debug print 2023-03-11 10:30:24 +05:00
Dion Moult 7041a4a4a9 Fix #2850. Splitting walls now reassigns voids and fills to the appropriate split portion. 2023-03-11 15:08:26 +11:00
Andrej730 381570cd9e Decorators - a bit more consistent geometry parsing between edit/object modes 2023-03-10 19:26:08 +05:00
Andrej730 c9f93b2316 Section annotation option not to draw full line between the markers
Here's the example - https://i.imgur.com/db09OVF.png

To make it work need to add BBIM_Section property set to the annotation and set "HasConnectedSectionLine" to False (by default it's True).
Also added preview for this feature in viewport.
2023-03-10 19:26:08 +05:00
Dion Moult 3706ecc5f2 Fix #2689. Fully disable wall sketches until we come up with a proper UX for it. 2023-03-10 21:21:03 +11:00
Dion Moult 51ad51036e Generated spaces now remember height and origin represents recalculation point. 2023-03-10 19:48:49 +11:00
Dion Moult 3edbcb9ff8 Fix #2849. Brick.ttl is now bundled. 2023-03-10 17:49:11 +11:00
Dion Moult 3e3c1699da Fix #1047. You can now set offsets to the iterator via Python. 2023-03-10 15:49:45 +11:00
Dion Moult 7666463751 Fix #2418. Object materials are now found in the materials tab. 2023-03-10 15:37:21 +11:00
Dion Moult c532b90c92 Minor fix. 2023-03-10 08:50:25 +11:00
Andrej730 7677733850 small fix for tool.Drawing.get_drawing_metadata
Otherwise it always returned a list with 1 empty string like `[ "" ]` which resulted in messy class names in svg like "-87IfcAnnotation0LtaLiEpzAOxEqmIvCV27EFALLSLOPEANGLE".
2023-03-09 18:50:05 +05:00
Andrej730 972d701801 Fall annotations
Added fall annotation - they appear both in viewport and svg.

There are three types of annotations (SLOPE_ANGLE, SLOPE_FRACTION, SLOPE_PERCENT) you can switch them by changing annotation's ObjectType to one of those values.

By default it uses angle representation.
2023-03-09 18:50:05 +05:00
Dion Moult cdee5532b6 Fix #2838. Bug where invalid 3D entity was used for 2D coordinates. 2023-03-09 21:01:54 +11:00
Dion Moult 38019288de Fix #2839. Bug where undo system could store edits of IFC primitives. 2023-03-09 18:18:56 +11:00
Dion Moult 3e2ca328d2 Get side area lets you choose the side axis now in util.shape. 2023-03-09 17:48:42 +11:00
Dion Moult 93b44b43a5 You can now get all materials including materials in sets via the util module. 2023-03-09 17:48:10 +11:00
Dion Moult 4ebcf8133c Fix #2435. The selector now supports regex filtering. 2023-03-09 11:07:28 +11:00
kzfile 13f8b183cb fix IfcSpace default style 2023-03-08 20:58:49 +01:00
Andrej730 8e5154e65e Minor fix for 6d524b632
Added get_viewport_context to interface too
2023-03-08 19:53:22 +05:00
Andrej730 6d524b632c Small fix for warnings " 'bim.cad_tool' not found for space"
Small fix to allow setting cad_tool even if operators were called not from viewport and to avoid warnings like "Warning: Tool 'bim.cad_tool' not found for space 'PROPERTIES'"
2023-03-08 18:42:36 +05:00
Andrej730 4ad3d65628 UI fixes for railing and roof modifiers
Changes:
1) Added editing railing / roof path as hotkey to bim / cad tools.
2) Added profile decorator
3) Some switching modes and tools for convenience
4) Fixed nasty bug in tool.Blender.apply_bmesh - method wasn't updating current mesh if it was in edit mode.
2023-03-08 18:22:28 +05:00
Dion Moult 4282014bfa Fix #2843. You can now get the bounding box centroid of geometry. 2023-03-08 20:58:21 +11:00
Andrej730 daee666735 Ifc Roof modifier
Added Ifc Roof modifier (also added it to shift-a menu and type manager). It works similar way to railing modifier - you define roof profile and then roof is generated.

Currently it has only 1 type of roof - HIP_ROOF (it utilizes bim.generate_hipped_roof operator).
2023-03-07 18:05:49 +05:00
Andrej730 5a6ae57833 Added ifc operators to some model operators 2023-03-07 09:43:05 +05:00
Andrej730 da8e5dced1 Added test to check #2839 2023-03-06 18:36:29 +05:00
Andrej730 fb38c68c7d Black format after adding railing modifier 2023-03-06 16:01:17 +05:00
Andrej730 2dc3c9b027 Railing - added to type manager 2023-03-06 15:47:55 +05:00
Andrej730 b057312ebf Ifc Railing modifier
Added Ifc Railing modifier (similarly to stair, window, door modifiers...).
You can start working with it either creating some edge based path and adding this modifier or by creating Railing for Shift+A menu (it will create some simple path to start with).

In railing modifier you can switch two edit modes - editing main railing properties and editing path. Editing path will show only the railing path, you can edit it and save it. You cannot edit the railing pass if you're not in this mode.
2023-03-06 15:47:55 +05:00
Thomas Krijnen d1217e61c4 #2822 svg: begin group lazily when data is actually being appended 2023-03-06 09:16:27 +01:00
Thomas Krijnen b521b68fd8 svg: compiler warnings 2023-03-06 09:15:27 +01:00
Thomas Krijnen c9302cde7c svg: prevent garbage data on empty path 2023-03-06 09:14:40 +01:00
Dion Moult 823e3c76eb Fix #2699. Bools and numeric filters are now handled in the selection UI. 2023-03-06 18:10:51 +11:00
Dion Moult 30d6289942 New utility to quickly get the grid north or true north angles. 2023-03-06 17:47:22 +11:00
Dion Moult a43a3d1ecd Fix #2745. You can now quote and escape complex pset names in the selector. 2023-03-06 17:47:03 +11:00
Dion Moult 9e0c5e9244 Fix #2835. Bug where in certain scenarios the decorator would crash due to prematurely freed bmesh. 2023-03-06 15:06:12 +11:00
Dion Moult a8f1df8a50 Fix #2836. Bug where very small lines could accidentally be seen as closed loops due to paperspace rounding. 2023-03-06 12:07:28 +11:00
Dion Moult fba84ecd3c Fix bug where invalid svg embedding was done when building sheets. 2023-03-06 11:52:55 +11:00
Dion Moult 8cc4edf60f Titleblocks now contain north symbol with dynamic angles. 2023-03-06 11:52:39 +11:00
Dion Moult e6eb455d71 Bump 2023-03-04 23:04:05 +11:00
Thomas Krijnen b84782e07f #2810 catch bad positioning warning and empty result 2023-03-03 14:32:02 +01:00
Dion Moult 2e3e0bef12 Minor fix 2023-03-03 22:27:47 +11:00
Dion Moult 51ff2f05bf Fix #2823. Only update colours if you actually change them. 2023-03-03 22:22:47 +11:00
Andrej730 42110e7f63 Added IfcPropertySingleValue to EnablePsetEditing to fix bug
Noticed bug trying to edit "Data" in psets from ifc modifiers and fixed it.

Traceback:
Error: Python: Traceback (most recent call last):
  File "\blenderbim\bim\module\pset\operator.py", line 94, in execute
    self.load_from_pset_data(pset)
  File "\blenderbim\bim\module\pset\operator.py", line 206, in load_from_pset_data
    metadata.set_value(value)
UnboundLocalError: local variable 'value' referenced before assignment
2023-03-03 15:36:14 +05:00
Dion Moult f0733cb148 Minor hotfix 2023-03-03 20:53:10 +11:00
Dion Moult 7383f44f8f See #2645. Update tests to use overridden built-ins. 2023-03-03 18:22:47 +11:00
Dion Moult 311a80955d Fix #2828. Bug where existing "TOP" connections were not removed if you tried to extend to a new slab / roof. Allow generic "top" connections to any LAYER3 element. 2023-03-03 17:59:20 +11:00
Dion Moult 08561b11c3 Fix #2077. You can now edit profiles via their axis line. 2023-03-03 17:47:16 +11:00
Andrej730 47192cc834 Fixed typo in generate_pset_templates.py 2023-03-03 11:08:56 +05:00
Dion Moult 860a0bfc8e Fix #2828. Extending walls to roofs / slabs is now more intuitive as you select the target slab last. 2023-03-03 14:42:08 +11:00
Dion Moult 5677768e99 Fix #2818. Alignment functions now considers layer set usage offsets. 2023-03-03 11:55:49 +11:00
Andrej730 4c58ca28e5 Synchronizing batting viewport and svg dimensions
Also switched to even more simple pattern to indicate insulation because of the vertex limit
2023-03-02 19:00:23 +05:00
Dion Moult 588d6ccaaa Attempt 2. 2023-03-02 21:51:09 +11:00
Dion Moult 21f583800a Ensure Python 3.10 is used to fetch BlenderBIM Add-on dependencies 2023-03-02 21:43:22 +11:00
Andrej730 4ea08a087c Minor array refactor 2023-03-02 14:39:36 +05:00
Dion Moult e5885db187 Get batting thickness from decorator data 2023-03-02 19:02:00 +11:00
Andrej730 1fca38625f A last bit of cleaning up temp files after tests 2023-03-02 10:45:00 +05:00
Sigma Dimensions cf2ad43ed7 refactor pset operator 2023-03-01 15:37:19 +01:00
Andrej730 fb3023bb79 Moved blenderbim tests temporary files to separate directory
Moved temporary test files to separate directory and added it to gitignore

Still have test.exp.cache.dat spawning from `test_feature`...
2023-03-01 18:46:13 +05:00
Andrej730 52f18fea85 Viewport preview for batting annotation
Currently it's always set to the same thickness and doesn't update from pset value.

It's currently using zigzag pattern to indicate batting because some techincal limitation of the shader (Error: C6033: Hardware limitation reached, can only emit 256 vertices of this size)

Also added batting to the annotation tool panel.
2023-03-01 17:37:17 +05:00
Dion Moult d5ecb9b8ea See #2820. Fix issue where some hatches weren't merged when an object had multiple SVG paths. 2023-03-01 22:25:12 +11:00
Dion Moult 67d33001d5 See #2820. Ensure only closed polygons are merged in drawings. 2023-03-01 21:57:33 +11:00
Dion Moult 4f571fa2fc Attempt to fix pytest bundling. 2023-03-01 21:39:15 +11:00
Dion Moult c5bd902dc6 See #2820. See #2822. Fix to accommodate empty element groups in drawings. 2023-03-01 21:08:34 +11:00
Dion Moult 68282c7a1e Fix #2821. 2023-03-01 20:54:07 +11:00
Sigma Dimensions d40dcae212 fix 5d csv imports with funky characters and numbers, fix 5d export 2023-03-01 10:51:52 +01:00
Dion Moult 12151c40ff Fix #2799. Drawing polygon merging now is purely material based. 2023-03-01 17:52:57 +11:00
Dion Moult 9c8b15fa1a Fix #2645. No longer override built-in operators for critical features. 2023-03-01 14:30:56 +11:00
Dion Moult 3d49cc9d13 By default, the site is now cut with a nice thick line on drawings 2023-03-01 11:28:45 +11:00
Dion Moult 955c0d19a6 See #2799. Cut walls with the same material in drawings are now merged by default. 2023-02-28 22:59:45 +11:00
Andrej730 3cf7a9e925 Renamed batting pset 2023-02-28 11:24:47 +05:00
Andrej730 8cbf719772 Replaced tool method from 17add48 with existing one 2023-02-28 10:04:18 +05:00
Dion Moult 2f614330c9 Fix #2781. Usability bug where it wasn't clear references were only loaded from the active external classification library. 2023-02-28 12:39:15 +11:00
Dion Moult 5a40519114 Minor fix 2023-02-28 11:43:36 +11:00
Dion Moult 96271e8bd8 Users can no longer create orphaned opening elements, which are invalid. 2023-02-28 10:05:22 +11:00
Dion Moult 9b75a415d4 See #2812. Resolve issue where obsolete link_to_scene argument was used. 2023-02-28 10:03:56 +11:00
Dion Moult 5f71abb5fa Minor fix to insulation scale 2023-02-28 09:23:28 +11:00
Dion Moult affb066b7b Fix #2813. Bug where the user could try to load thumbnails even though there were no types. 2023-02-28 08:44:36 +11:00
Andrej730 17add48254 Minor refactor for modifiers 2023-02-27 19:18:39 +05:00
Andrej730 f5b6fdcb5b Batting Annotation pattern
Added batting pattern to line annotations.
The way to use it is:
1) Add "Line" Annotation;
2) Change object type to "BATTING"
3) Add object property set "Pset_BBIM_Bating" (also added in this commit) to specify the batting thickness.

Currently there is no preview for batting in viewport.

Other changes:
- EPset_Annotation.ifc -> Psets_BBIM_Annotation.ifc (more general psets ifc library for the future use)
2023-02-27 19:18:39 +05:00
Dion Moult 68bdbe4c4f Bundle bpypolyskel so that users can start playing with the hipped roof generator 2023-02-27 21:49:04 +11:00
Dion Moult 363ddc2a9b Minor fix 2023-02-27 20:49:45 +11:00
Dion Moult 20d44378d9 You can now generate type-based spaces and regenerate spaces when boundaries change. 2023-02-27 20:49:38 +11:00
Dion Moult 4fe321275a Fix bug where space types were not loaded. 2023-02-27 20:47:20 +11:00
Dion Moult 60b1192703 Fix critical bug where a user might override and break existing objects if they reused an object name 2023-02-27 20:46:53 +11:00
Dion Moult b25233a748 Fix critical bug where duplicate orphaned collections were created in the background. 2023-02-27 20:12:39 +11:00
Dion Moult d9b54c923c Fix bug where you couldn't manage spatial types in the type manager 2023-02-27 20:10:27 +11:00
Dion Moult 131ee8270b Minor fix 2023-02-27 10:57:28 +11:00
Massimo Fabbro e71bace6a8 update makefile with shapely 2.0.1 2023-02-27 09:10:46 +11:00
Dion Moult 2c4a0669ed Fix bug where copying to container might get the wrong coordinates if containers weren't synced. 2023-02-26 22:31:21 +11:00
Dion Moult ee451b6b29 Experimental operator to generate hipped roofs from a footprint. 2023-02-26 21:23:35 +11:00
Dion Moult 7b858fffb2 All generated drawing text now has classes so you can customise their style. 2023-02-26 21:22:43 +11:00
Dion Moult 6ce0deeb63 Fix #2808. Bug where you couldn't assign element types in IFC4X3. 2023-02-26 11:26:13 +11:00
Dion Moult 96b2eaeae4 Experimental operator to generate spaces bounded by walls. 2023-02-25 21:40:02 +11:00
Andrej730 8fe8175a87 Monolithic stair variant generator 2023-02-25 10:40:27 +05:00
Andrej730 ee2bedfb64 Update openings position based on fillings position at wall regenarete
So basically now when you move windows or doors attached to the wall, their openings positions will also be updated if you hit "regenerate" for the wall.
2023-02-24 17:12:41 +05:00
Andrej730 aa8da74ed8 ifc2x3 pset library name fix + copyrights 2023-02-24 11:07:33 +05:00
Dion Moult f2c03a508f Fix #2600. Link back to exact docs folder in repo. 2023-02-24 16:21:21 +11:00
Dion Moult aa172488b0 Fix #2594. Document potential lag in PyPI releases of C++ core. 2023-02-24 13:35:46 +11:00
Dion Moult ae09adf854 Fix #2424. Bug where indirect assets (e.g. importing a type using a material) with relationships had their relationships duplicated 2023-02-24 13:01:26 +11:00
Andrej730 5b5dd73684 get_inverse_attributes - added more correct recursive unpacking for aggregates and selections
Not affected the result schemas though
2023-02-23 18:56:24 +05:00
Andrej730 3849a87adc Added simple tests for door and window modifier
This thing used to result in errors before we fixed `replace_object_ifc_representation`
2023-02-23 18:38:20 +05:00
Andrej730 708dc6aca2 IFC4X3/IFC2X3 pset templates library
Generated from xmls from the ISO release of IFC4X3.
Based on https://standards.buildingsmart.org/IFC/RELEASE/IFC4/ADD2_TC1/HTML/annex/annex-a/general-usage/IFC4_ADD2.ifc

Also generated pset templates library for IFC2X3 (also based on similar xmls) but IFC2X3 ifc pset library is using... IFC4X3 schema because IfcPropertySetTemplate and IfcRelDeclares are not available in IFC2X3. Which is okay for our purposes for now.

Will need to update IFC4X3 library if one of the issues will be resolved:
https://github.com/buildingSMART/IFC4.3.x-development/issues/587
https://github.com/buildingSMART/IFC4.3.x-development/issues/586
2023-02-23 18:17:14 +05:00
Dion Moult 2fe2c349fd Fix #2743. obj2ifc scripts updated to support multiple OBJ files. 2023-02-23 22:17:34 +11:00
Dion Moult d396d32a8f You can now extend beams to walls. 2023-02-23 18:33:31 +11:00
Dion Moult 1fd02755f8 Fix BCF module bugs where certain BCF entities were assumed to exist. 2023-02-23 18:32:44 +11:00
Dion Moult 79d92b511b Fix #2442. Fix bug where viewboxes were not clipped when compiling drawing sheets. 2023-02-23 13:16:33 +11:00
Andrej730 ff7d93e66c Undo tests - proof of concept
Created some simple undo tests.

This "flip wall and ctrl-z" test actually is crashing blender if I do it manually - so I guess undo in background mode is still kind of different.
2023-02-22 20:24:43 +05:00
Dion Moult 68a8c7a235 Add basic integration tests for modeling slabs and beams 2023-02-22 21:50:12 +11:00
Dion Moult 5e744ff7d1 Add integration tests for basic wall modeling features 2023-02-22 20:38:02 +11:00
Dion Moult 921a185ffa Fix bug where natively loaded faceted breps didn't respect false origins. 2023-02-22 16:32:32 +11:00
Dion Moult 855751f026 Fix #2767. Removing representations now cleans up after orphaned Blender mesh data. 2023-02-22 16:24:24 +11:00
Sigma Dimensions 255c2efe98 Fix sequence data loading for unnamed items, ref #2783 2023-02-21 22:55:44 +01:00
Sigma Dimensions 892b282054 Fix loading task properties when calendar doesn't have a name, ref issue #2783 2023-02-21 20:23:07 +01:00
Dion Moult 26efc6b4e7 Fix bug where BIM tool hotkeys could activate operations without being in a correct state. 2023-02-21 21:54:53 +11:00
Dion Moult a0618c5827 Fix #2769. Bug where parametric UI was hardcoded to only work for walls. Now works on any generic parametric vertical layers. 2023-02-21 21:41:52 +11:00
Andrej730 d4bbb6e2c7 Added Model/Profile/Elevation_VIEW context as default for new projects #2784
Default Model/Profile/Elevation_VIEW context could be helpful to make openings created with BIM tool more correct.
2023-02-21 11:46:05 +05:00
Andrej730 66b7692227 Fixed windows/openings bugs
1) Window bug (#2792) - lining_offset wasn't converted from ifc units during window properties editing
2) Openings bug - OveallWidth/OverallHeight based openings was converted to ifc units even though their dimensions were already in ifc units.
2023-02-21 11:20:36 +05:00
Dion Moult 2429f507ad Fix #2785. Fix bug where invalid models from Revit that reused material usages could create invalid models. 2023-02-21 13:48:24 +11:00
Dion Moult 03a66d2806 Fix #2787. Fix creating invalid orphaned property and group relationships when removing systems / groups / elements. 2023-02-21 10:59:47 +11:00
Dion Moult 9d8551cb48 Demo library now has profile names to follow native IFC best practices 2023-02-21 10:14:06 +11:00
Dion Moult 2ca0b52c6a Fix failing test when editing a material profile with an unnamed profile 2023-02-21 09:51:30 +11:00
Massimo Fabbro 9cc754488b calculate all quantities smoke test 2023-02-21 09:12:30 +11:00
Massimo Fabbro f81ceb53cf add qto feature test 2023-02-21 09:12:30 +11:00
Dion Moult d1d0b5724d Revert "Solving test fail - keeping unnamed profiles when updating profiles in MaterialsData"
This reverts commit 0e1689c2d9.
2023-02-21 08:51:44 +11:00
Sigma Dimensions 40560b71c2 BBIM: fix material errors, and add smoke tests 2023-02-20 17:49:54 +01:00
Andrej730 378a25bbaa Added some .feature convenience debug fixtures 2023-02-20 19:57:05 +05:00
Andrej730 1dfabe2591 Fixed issue with float vectors assertion during tests
`sequence.feature` - Added `[:]` to make errors more readable values in errors (for example, (0.20000000298023224, 0.20000000298023224, 0.20000000298023224, 1.0) instead of `<bpy_float[4], Object.color>`

`test_feature.py` - fixed `FAILED test/bim/test_feature.py::test_animate_the_consumption_of_a_wall - AssertionError: Value is <bpy_float[4], Object.color>`
Test was failing because of float garbage in object.color (the comparison was (0.20000000298023224, 0.20000000298023224, 0.20000000298023224, 1.0) <> [0.2, 0.2, 0.2, 1] )

After that fix all tests now are passed 🥲
2023-02-20 19:53:16 +05:00
Andrej730 0e1689c2d9 Solving test fail - keeping unnamed profiles when updating profiles in MaterialsData
Solves test_enable_editing_material_set_item test error
```
FAILED test/bim/test_feature.py::test_enable_editing_material_set_item - RuntimeError: Error: Python: Traceback (most recent call last).

RuntimeError: Error: Python: Traceback (most recent call last):
  File "\blenderbim\bim\module\material\operator.py", line 587, in execute
    self.mprops.profiles = str(material_set_item.Profile.id())
TypeError: bpy_struct: item.attr = val: enum "107" not found in ('79', '98')
Location: C:\software\Steam\steamapps\common\Blender\3.4\scripts\modules\bpy\ops.py:113
```

The problem was `bim.enable_editing_material_set_item"` was trying to set `MaterialsData` profiles and wasn't able to set unnamed profile because `MaterialsData.profiles()` was discarding unnamed profiles (which is seems contradictory because `profiles()` is also handling unnamed profiles anyway).
2023-02-20 18:00:48 +05:00
Sigma Dimensions bd071cc472 Add smoke test for editing material profiles 2023-02-20 11:08:15 +01:00
Dion Moult dde847cb5a IfcTester can now output reports in BCF 2023-02-20 17:50:36 +11:00
Dion Moult 3c17718f70 Fix bug where adding a BCF viewpoint didn't take into account project units 2023-02-20 17:50:36 +11:00
Andrej730 0445119e77 Shifting dimensions defined openings by min_x and min_z to prevent #2784 2023-02-20 11:22:02 +05:00
Dion Moult e82cb5c149 IfcTester can now create reports in ODS format 2023-02-20 17:05:07 +11:00
Dion Moult 984548f315 IfcTester can now output reports in plain text 2023-02-20 17:04:38 +11:00
Dion Moult a0be4f58e6 Fix #2780. Fix bug where validation couldn't be run. pytest is now bundled. 2023-02-20 11:26:09 +11:00
Dion Moult 147602e107 Fix bug where ifcopenshell express rule validator required a logger with set_state. 2023-02-20 11:26:09 +11:00
Andrea Ghensi ac81169290 build(bcf): remove conda dependency 2023-02-20 07:26:34 +11:00
Dion Moult 1d78e05370 Fix #2774. Bump IfcOpenShell. 2023-02-19 21:53:49 +11:00
Andrej730 4b15b02ac8 Fixed Door modifier initial opening problem #2784
- add check of OverallHeight and OverallWidth for creating openings for doors and windows;
- OverallHeight, OverallWidth update for all the occurences of the type for doors and windows;
- new tool.Ifc method - get_all_element_occurences
2023-02-18 17:11:04 +05:00
Thomas Krijnen 57d18a0644 Update IfcIShapeProfileDef.cpp 2023-02-18 13:00:45 +01:00
Dion Moult 2f73af7e6a Fix bug where BlenderBIM Add-on BCF module was completely broken. Now works with latest BCF library for BCF-XML v2. 2023-02-18 21:12:36 +11:00
Dion Moult e712ef344d New feature in BCF to allow extracting specific files like header files, snippets, or bitmaps. 2023-02-18 21:11:05 +11:00
Dion Moult f91e9a3119 Fix BCF bug where viewpoints were not created with a .bcfv suffix which is not compliant. 2023-02-18 21:10:27 +11:00
Dion Moult 9cf36f1d91 Fix BCF bug where BCFv2 files were unable to be loaded 2023-02-18 21:09:32 +11:00
Andrej730 ab9a4856ab Update entity-types mapping for ifc4
Added IfcWindowStyle and IfcDoorStyle for suitable StandartCases since StandartCases inherit from IfcDoor and IfcWindow.
2023-02-17 17:57:17 +05:00
Andrej730 d52618277e Ifc4x3 - entity-types mapping
- added mapping entity-types mapping based on iso release of ifc4x3

- added some manual corrections for `generate_util_type_json.py` if someone would regenerate the map for ifc4.

- manual correction in ifc4x3 mapping for IfcCivilElement. It could be removed in the future releases of IFC if https://github.com/buildingSMART/IFC4.3.x-development/issues/583 is resolved

If curious to look what were the changes for mapping between ifc4 and ifc4x3:
https://github.com/IfcOpenShell/IfcOpenShell/commit/da51253fb0a9d08aa93f5fe3c074d3592b3aa997#diff-98f525c91bb47b9820e603fba61cc015d3e6ae7261593d727c51114e3ff73aa7
2023-02-17 17:57:16 +05:00
CyrilWaechter 743bd2c48f Add buttons to selected related boundaries
Related by a common:
- BuildingElement
- BuildingElementType
- Space
- SpaceType
2023-02-17 13:21:24 +01:00
CyrilWaechter 11894de455 Add button space to select its boundaries 2023-02-17 10:43:48 +01:00
Dion Moult 0c8122afc4 See #2762. Final final attempt. 2023-02-17 13:28:02 +11:00
Dion Moult f893503d0c See #2762. Final attempt. 2023-02-17 13:12:09 +11:00
Dion Moult 504782f156 See #2762. Attempt 3. 2023-02-17 12:53:55 +11:00
Dion Moult 5d1f32bfc0 See #2762. 2023-02-17 12:28:19 +11:00
Dion Moult 5bc315be92 See #2762. 2023-02-17 12:27:31 +11:00
Dion Moult e8f21c79b1 See #2762. 2023-02-17 12:03:25 +11:00
Sigma Dimensions ba24f9b491 - Improve ODS export
- Fix XLSX export bug
- Improve active cost item UI active cost item
- Fix missing tool cost function
2023-02-16 20:22:45 +01:00
Andrej730 937fa21cce Fix to prevent pyrna_enum_to_py warnings using BIM Tool
Prevents couple `pyrna_enum_to_py` warnings that occured using BIM Tool

```
WARN (bpy.rna): C:\Users\blender\git\blender-v340\blender.git\source\blender\python\intern\bpy_rna.c:1341 pyrna_enum_to_py: current value '0' matches no enum in 'BIMModelProperties', '', 'ifc_class_browser'
WARN (bpy.rna): C:\Users\blender\git\blender-v340\blender.git\source\blender\python\intern\bpy_rna.c:1341 pyrna_enum_to_py: current value '0' matches no enum in 'BIMModelProperties', '', 'relating_type_id'
WARN (bpy.rna): C:\Users\blender\git\blender-v340\blender.git\source\blender\python\intern\bpy_rna.c:1341 pyrna_enum_to_py: current value '0' matches no enum in 'BIMModelProperties', '', 'ifc_class'
```
2023-02-16 17:43:34 +05:00
Andrej730 16cbab2de7 Commented how to regenerate BIM Tool keymap in case of errors 2023-02-16 16:40:07 +05:00
Andrej730 a85f81d8ca Refactor - moved some helpers functions to tool 2023-02-16 15:16:42 +05:00
Andrej730 1617ede010 Simplified addings hotkeys descriptions in BIM Tool
Now it's more universal and doesn't require some single operator to be attached to hotkey description.
Also added description for some hotkeys
2023-02-16 14:36:24 +05:00
Dion Moult d9f1d501aa See #2762. Try again. 2023-02-16 15:01:19 +11:00
Sigma Dimensions 8ee60db0df Re-assigning a product type class should also reassign the class of its typed instances 2023-02-15 23:11:30 +01:00
Sigma Dimensions d2e02c8ab3 complete cost schedule exports commit 9dc69f3 2023-02-15 23:09:15 +01:00
Sigma Dimensions 2d4e4d2445 forgotten commit for duplicating tasks 2023-02-15 23:00:43 +01:00
Sigma Dimensions 9dc69f3aa7 You can now export Cost Schedules as CSV, ODS, XSLX with BlenderBIM or using the cli app 2023-02-15 22:50:39 +01:00
Andrej730 476ab506d0 Added ifc4x3 json schema and it's parser
API for docs works the same way as it worked for ifc2x3 and ifc4.

Besides changing `doc.py` and adding `.json` schemas added `ifc4x3dev_scrape_data_for_docs.py` (it's kind of hacky now and relies on `server.py` code from the further mentioned repo) that's used to parse some entities descriptions from https://github.com/buildingSMART/IFC4.3.x-development for later use in `doc.py`.
2023-02-15 18:38:04 +05:00
CyrilWaechter a6fa6201f7 Fix bugs introduced in cf87852 2023-02-15 10:34:25 +01:00
Dion Moult 26f7db0504 Fix #2698. IfcClash results are now aware of multiple linked IFC models. 2023-02-15 20:32:50 +11:00
Dion Moult 77a0da2a17 See #2762. Another attempt at fixing PyPI build. 2023-02-15 20:06:07 +11:00
Thomas Krijnen 785d2e601c Fix after 31cf1127a6 2023-02-15 09:52:21 +01:00
Massimo Fabbro 3687e4ed91 finish mapping Qto_FootingBaseQuantities 2023-02-15 09:35:29 +11:00
Thomas Krijnen 31cf1127a6 Validation output enhancements 2023-02-14 20:55:14 +01:00
Thomas Krijnen 97385efbca entity_instance.get_info(scalar_only=) 2023-02-14 20:11:24 +01:00
Andrej730 6a87b68c3b Window Modifier - added 2d representation
+ fixed lining offset for door 2d representation
2023-02-14 16:54:43 +05:00
Andrej730 be06bd6369 Added note about core.geometry representations functions 2023-02-14 16:54:19 +05:00
Andrea Ghensi a5b4ac863b fix: ifc clash operator fixes
fixes #2698
2023-02-14 21:55:41 +11:00
Thomas Krijnen e535f911d1 Update extrusion-dir cases for undeterminate handling 2023-02-14 10:04:46 +01:00
Thomas Krijnen 18670bcbd6 Recompile rules 2023-02-14 10:04:46 +01:00
Thomas Krijnen 27511d362e Use inverse unpacking in rule execution 2023-02-14 10:04:45 +01:00
Thomas Krijnen c634bffa10 Update reverse compilation to eliminate getattr() calls 2023-02-14 10:04:45 +01:00
Thomas Krijnen dffa90bd5d Better conformance wrt indeterminate with AST rewriting and dedicated type 2023-02-14 10:04:45 +01:00
Thomas Krijnen 6a47d33974 Add zone IsGroupedBy where rule test case 2023-02-14 10:04:45 +01:00
Thomas Krijnen e87524ba11 ifcopenshell.settings.unpack_non_aggregate_inverses 2023-02-14 10:04:44 +01:00
CyrilWaechter b1154ae377 Adapt to code changes introduced in ea91f43 2023-02-14 09:22:20 +01:00
Andrej730 cbc24c31a2 aud dependency fork fix
Solves #2759
2023-02-14 00:59:17 +05:00
Dion Moult 0a8a6e5825 Fix #2383. Don't default text alignment via CSS, let attributes take precedence. 2023-02-13 22:28:53 +11:00
Andrej730 e088a10aa8 New openings size wasn't converted using unit_scale #2765 2023-02-13 15:29:32 +05:00
Dion Moult 007d984baf Fix #2274. You can now purge unused types. 2023-02-13 15:20:56 +11:00
Dion Moult 7d979e5a04 Fix #2575. We are incompatible with add-ons using dictionary overrides for delete/duplicate macros. 2023-02-13 11:22:57 +11:00
CyrilWaechter 4134c709a8 Add fallback solution for invalid geometries
When an inner boundary cut an outer boundary in an IfcCurveBoundedPlane
which is invalid in IFC schema then ifcopenshell fails to create
geometry.
See #635
2023-02-12 18:29:24 +01:00
Thomas Krijnen ff5e4991ab Test files 2023-02-12 15:28:14 +01:00
Thomas Krijnen 0b4b45b7c8 Validate bounds of non-aggregate inverses 2023-02-12 15:28:14 +01:00
Massimo Fabbro 145ac1a0f4 Fix #2716 issue (#2761) 2023-02-12 14:09:33 +01:00
Dion Moult 74de7436b7 See #2762. Fix pip build. 2023-02-12 20:32:30 +11:00
Dion Moult 60fa05a913 Fix #2521. Fill areas have limited dissolve applied before rendering. 2023-02-12 18:58:49 +11:00
Dion Moult 303de61417 See #2760. Fix bug where editing pset with null'ed enumeration fails. 2023-02-12 15:12:31 +11:00
Dion Moult a9a4c6049f Fix bug where you couldn't duplicate text annotations. 2023-02-12 15:02:41 +11:00
Dion Moult 82b201a14e Fix #2352. Text styling is now possible with custom classes. 2023-02-12 15:01:47 +11:00
Dion Moult c9bd7adf8a Fix bug where you couldn't create a drawing with no linework. 2023-02-12 13:31:49 +11:00
Dion Moult 0655d77210 See #2760. Fix bug where groups UI had undefined variable. 2023-02-12 13:31:49 +11:00
Sigma Dimensions 515ec28fb3 Place text leader annotations horizontally 2023-02-12 01:07:41 +01:00
Sigma Dimensions c28c2dd077 BIM tool hotkey to update base quantities 2023-02-12 00:47:54 +01:00
Sigma Dimensions b04383bb64 Smoke test for duplicating tasks 2023-02-12 00:38:22 +01:00
Sigma Dimensions f4b93ef243 You can now duplicate tasks 2023-02-12 00:37:37 +01:00
Sigma Dimensions 05cf00bef6 Add smoke test for task product selection & minor fix 2023-02-11 23:24:52 +01:00
Andrej730 e81346c339 Door openings updated on door parameters update
Based on 6d1e9f73a
2023-02-11 19:01:56 +05:00
Sigma Dimensions ac911cefd6 minor fix for d4eb56e 2023-02-11 14:24:53 +01:00
Li1506 c4cea20849 add IfcConvert testing on sample files step to ci.yml 2023-02-11 13:25:50 +01:00
Sigma Dimensions e30992b905 minor fix for commit d3b176e 2023-02-11 13:23:23 +01:00
Sigma Dimensions 5beea8640e BBIM: rewrite Selector search filter to use core and tool functions 2023-02-11 13:19:08 +01:00
Sigma Dimensions d3b176e5eb complete costing module refactoring 2023-02-11 12:34:54 +01:00
Andrej730 0d0691a012 Door modifier - double doors type support 2023-02-11 16:09:13 +05:00
Sigma Dimensions d4eb56e360 New Search and Spatial selection Tools
+ refactor sequence modules
2023-02-11 11:23:07 +01:00
Andrej730 5cfc122b79 Door modifier - double swing doors
still no dashed lines in 2d representation
2023-02-11 14:20:04 +05:00
Sigma Dimensions fa0f484922 Inlcude audio library for BlenderBIM costing chaching sound 2023-02-11 10:05:54 +01:00
Dion Moult ceaa930aad Fix #2756. Bug where reassigning classes with a enum didn't work. 2023-02-11 11:03:35 +11:00
Dion Moult bbd2b67041 Add link to dev fund in add-on about section. 2023-02-11 09:54:43 +11:00
Sigma Dimensions 6c82e6f889 Fix assign cost value usecase 2023-02-10 21:28:49 +01:00
Thomas Krijnen 531e07767f #2754 latebound schema handling 2023-02-10 21:08:20 +01:00
Thomas Krijnen da39c903f3 Latebound schema handling: Improve error messages 2023-02-10 21:07:25 +01:00
Andrej730 f458aa9932 Door fixes
1) do not create new ifc representation if editing was canceled (similar to 25c650f4c)
2) plan and profile representations now  are optional (similar to 50d71d5ea)
2023-02-10 18:00:43 +05:00
Andrej730 9e383959c8 door black formatting 2023-02-10 16:58:36 +05:00
Andrej730 3654e49f87 Door handles 2023-02-10 16:55:13 +05:00
Dion Moult 13f5767921 Minor fix 2023-02-10 19:01:54 +11:00
Dion Moult 6d1e9f73a6 Windows now regenerate openings when window parameters updated 2023-02-10 19:01:20 +11:00
Andrej730 d9ddf67afb small fix for 50d71d5ea
The error was:
```
Error: Python: Traceback (most recent call last):
  File "\blenderbim\bim\module\model\window.py", line 337, in execute
    element = blenderbim.core.root.assign_class(
NameError: name 'blenderbim' is not defined
```
2023-02-10 12:49:33 +05:00
Dion Moult 47e6352350 Don't create temporary objs when updating filling openings. 2023-02-10 18:45:53 +11:00
Dion Moult ae564d1b61 Fix #1040. New utility for geometric shape analysis only requiring numpy. 2023-02-10 16:03:16 +11:00
Vukas Pajic d9cee04769 Fix #2755 2023-02-09 11:00:25 +01:00
Dion Moult 50d71d5ea1 Black code and make profile representation optional for windows. 2023-02-09 20:13:14 +11:00
Dion Moult 25c650f4cd Don't edit IFC when simply disabling window editing. 2023-02-09 19:33:08 +11:00
Andrej730 f0502c123e Window modifier - fixed bugs related to ae5ea3857
1) now replacing actual representation instead of the map
2) removed `should_sync_changes_first` as unnecessary representation update
2023-02-08 18:17:47 +05:00
Sigma Dimensions 693960a4ab start refactoring costing operators into core & tool 2023-02-08 13:39:46 +01:00
Vukas Pajic 5df0cf39a0 minor fix 2023-02-08 12:06:16 +01:00
Vukas Pajic 578220a1ab (IfcPatch) allow user to specify output directory for "SplitByBuildingStorey" 2023-02-08 12:04:58 +01:00
Andrej730 ae5ea3857e Fixing bug with updating window/door modifier with element types
The bug occured when you created a window/door type and some instance of it and then would try to update modifier.

There were two problems:
1) Because `remove_representation` removes all the meshes of the representation, representation has to be switched before removing the old one.

2) `switch_representation` parameter `is_global` was set to `False` and it wasn't affecting all instances of the type which led to errors during representation switch later on.
2023-02-08 15:56:57 +05:00
Dion Moult 93d0ffd459 Fix #2520. You can now duplicate drawings with or without annotations. 2023-02-08 21:16:54 +11:00
Vukas Pajic 1b85928810 allow user to specify output directory for "SplitByBuildingStorey" 2023-02-08 10:42:05 +01:00
Dion Moult f118c50d1d Fix bug where removing a drawing didn't remove its references. 2023-02-08 19:08:45 +11:00
Sigma Dimensions ac5ec72acf BBIM: improve work schedule visualisation workflow & refactor visualise_work_schedule_date operator 2023-02-08 08:25:11 +01:00
Sigma Dimensions 7fe2634d32 Improve guess schedule date range ( including tasks with input assignements) 2023-02-08 08:18:08 +01:00
Dion Moult 1279b9848f Fix regression with editing material psets 2023-02-08 17:43:50 +11:00
Dion Moult ea91f4302c Drawings now load on-demand instead of at project load. See #2520. 2023-02-08 16:53:19 +11:00
Dion Moult 88bddb9531 See #2520. You can now duplicate drawings. 2023-02-08 12:29:49 +11:00
Sigma Dimensions 4e308a6e31 fix api docstring description for nest.unassign_object usecase 2023-02-07 15:35:34 +01:00
Andrej730 4bd7fc5304 Simplified door ifc representation 2023-02-07 16:48:37 +05:00
Andrej730 0122fe4382 Fix #2742 2023-02-07 14:57:37 +05:00
Dion Moult 1730f25a5a Fix #2584. You can now edit any layered or profile material agnostic of class. 2023-02-07 19:13:22 +11:00
Dion Moult 3f8314bcf3 Minor fix. 2023-02-07 12:37:10 +11:00
Dion Moult 5879d14803 See #2737. Fix bug where convert length unit patch did not work outside Blender session. 2023-02-07 09:05:20 +11:00
Andrej730 4c1a821922 Pset_StairFlightCommon update
Added Pset_StairFlightCommon update to stair modifier
2023-02-06 18:54:25 +05:00
Andrej730 e1456533f2 Doors - clean up + black format 2023-02-06 18:53:48 +05:00
Andrej730 7522a3a2ab renamed "data" parameter in model/data.py
renamed "data" parameter in model/data.py to make it a bit more distinctive from neighbour "Data" parameter with json string
2023-02-06 18:45:48 +05:00
Andrej730 144d01a0ef Added modifiers folding to prevent clutter 2023-02-06 18:45:48 +05:00
Andrej730 f6cb6c8b21 Accepting predefined type for windows/stairs/doors from type manager
Also assigned layout name property for windows/doors
2023-02-06 18:45:48 +05:00
Andrej730 0f5264af99 Door - added to type manager
Also added predefined type for door and bit of refactoring
2023-02-06 18:44:09 +05:00
Andrej730 e57ff19e16 Door - added 2d representation 2023-02-06 18:44:09 +05:00
Andrej730 b2bdbdd8c3 Door modifier - basic setup
Also:
- refactored window modifier code - part of it is now reused building a door and can be used by other module in the future
- fixed bug with window lining intersecting frame when lining_depth < panel_depth
- simplified the way lining is built in ifc - previously it was using 4-6 extrusions, now it's 1-2 which is also better for 2D drawings
2023-02-06 18:44:09 +05:00
Andrej730 a8400ec963 geonodes prototype copyright 2023-02-06 18:44:09 +05:00
Sigma Dimensions d028b52d77 fix visualise_work_schedule_date - issue #2740 2023-02-06 12:35:42 +01:00
Sigma Dimensions 65990255e8 Fix issue #2740 2023-02-06 12:29:06 +01:00
Sigma Dimensions 3a71b03a9a Fix sequence module test bugs 2023-02-06 12:04:03 +01:00
Dion Moult 99274c2d7a Fix #1806. Changing filling types now also updates the void representation. 2023-02-06 20:28:50 +11:00
Dion Moult e40bbf2525 See #1806. Typed fillings now share the same representation for their openings. 2023-02-06 17:01:29 +11:00
Dion Moult 38c6378315 See #1806. New fillings inherit their voids from existing occurrences if possible. 2023-02-06 14:40:59 +11:00
Dion Moult c050ca1037 Fix #2736. Increase tolerance for HLR rendering to prevent "see through" objects in drawings. 2023-02-06 13:42:37 +11:00
Thomas Krijnen 9813dda778 Express rules: test case for instance comparison 2023-02-05 13:08:55 +01:00
Thomas Krijnen 6b7aeb90c7 Express rules: allow comparison of instances to instances and values 2023-02-05 13:08:55 +01:00
Dion Moult 3cb29e1344 Fix unintuitive UI where objects had to be visible for the operation to run. 2023-02-05 22:27:56 +11:00
Dion Moult 4d4961a490 Close #2622. IfcCSV now supports ODS and XLSX formats for export. 2023-02-05 18:53:16 +11:00
Dion Moult ccd7db06f8 Fix #2611. Address multiple situations in the UI where the users could create invalid material data without an indication that it is invalid. 2023-02-05 17:10:25 +11:00
Dion Moult 77234706b0 Assigning a profile set auto creates profiles if none exist to prevent invalid data. 2023-02-05 15:29:54 +11:00
Einar Raknes 9f399b34fb Rename panel from IFC Construction Type to IFC Type
As discussed here: https://community.osarch.org/discussion/1332/blenderbim-ifc-construction-type-ifcbuiltelementtype-confusion
2023-02-05 12:18:17 +11:00
Dion Moult dc77a798b5 Assigning a layer set for the first time prefills with a layer to prevent invalid data. 2023-02-04 22:14:33 +11:00
Dion Moult 207093fe99 Fix regression where changing assigned types didn't update the materials. 2023-02-04 22:12:28 +11:00
Dion Moult 42c4a68108 Fix bug where unnamed profiles clogged up the material profile settings. 2023-02-04 16:20:52 +11:00
Dion Moult a7cc58fb50 Update libraries to use Plan/Body/PLAN_VIEW instead of annotations. 2023-02-04 14:09:35 +11:00
Dion Moult 6bab10d2ac Minor fix. 2023-02-04 12:51:01 +11:00
Thomas Krijnen c4b77c2a07 Recompile rules 2023-02-03 22:22:40 +01:00
Thomas Krijnen 66d0627035 Property names test case 2023-02-03 21:18:06 +01:00
Thomas Krijnen 3f4417c9f2 Window lining test case 2023-02-03 21:17:48 +01:00
Thomas Krijnen 5526bed4c3 Express rules: allow indexing in sets 2023-02-03 21:17:08 +01:00
Thomas Krijnen 078bf8646a Express rules: enclose rhs of not in parens when needed 2023-02-03 21:10:34 +01:00
Dion Moult 6adbcdd8e1 Fix #2472. BREAKING CHANGE. Annotations are now drawn in addition to body views, not in lieu of. 2023-02-03 21:31:15 +11:00
Dion Moult b4d633a34d Fix #2735. 2023-02-03 21:28:36 +11:00
Dion Moult e1e4380fc7 Fix 3 bugs related to representations:
* Bug when switching representations when active object not selected.
 * Bug when switching to a non MODEL_VIEW body representation would load the MODEL_VIEW one instead all the time.
 * Add support for plan body representations.
2023-02-03 21:27:25 +11:00
Dion Moult 1ed7b21ab0 Fix #1496. Mirrored elements have their placements correctly synced. 2023-02-03 15:53:21 +11:00
Dion Moult 158a4c5e75 Fix bug where IFC2X3 fallback styles couldn't be assigned. 2023-02-03 13:21:23 +11:00
Dion Moult f72d48aab5 Fix bug where calendar caching meant invalid duration calculations if you edited your calendar after a date calculation. 2023-02-03 10:06:55 +11:00
Dion Moult be26a77ecb Support times specified as ISO strings too in date utils, not just datetimes. 2023-02-02 23:01:49 +11:00
Dion Moult 7c275a99a2 New utility functions for automatic local to global elevation conversions and easier unit conversions 2023-02-02 23:01:12 +11:00
Dion Moult f77d2f449d Close #2451. Implement georeferenced elevations in drawings. 2023-02-02 22:55:45 +11:00
Dion Moult 18ba805a15 Fix silly bug. 2023-02-02 21:36:13 +11:00
Dion Moult a5adf0021f Fix #2599. Unassigning materials now also removes the Blender material. 2023-02-02 18:41:07 +11:00
Dion Moult 7d944255d0 Fix bug where you could unassign a material usage and create an invalid parametric occurrence 2023-02-02 18:26:14 +11:00
Dion Moult b984a77862 IfcFM parser and writer is now easier to override for custom FM requirements 2023-02-02 14:29:48 +11:00
Dion Moult d69aa20802 Fix #2620. You can now run patches from models in memory. 2023-02-01 19:29:35 +11:00
Dion Moult 7e16cb797f See #1848. Some straggling refactoring for resource data. 2023-02-01 17:37:59 +11:00
Dion Moult b3c7971ea9 Purge all data classes from API. 2023-02-01 15:44:08 +11:00
Dion Moult a778b98fdb Fix #1848. Purge remaining references to API data classes. 2023-02-01 15:41:21 +11:00
Dion Moult 4efb80efe4 See #1848. Refactor structural data class. 2023-02-01 14:54:42 +11:00
Sigma Dimensions cfaacf8650 Ifcopenshell api usecase to unassign object nesting 2023-01-31 18:59:33 +01:00
Sigma Dimensions 60da4cb87b BBIM: Refactor activate drawing view 2023-01-31 18:42:18 +01:00
Andrej730 db6207db6c prevent flickering in profile manager thumbnails 2023-01-31 14:48:26 +05:00
Dion Moult 9b4568c881 Minor fix 2023-01-31 20:40:32 +11:00
Dion Moult cd132d4fe9 See #1848. Refactor sequence data class. 2023-01-31 20:38:03 +11:00
Andrej730 f01900bdb1 Profile manager thumnails (#2568) 2023-01-31 13:55:50 +05:00
Dion Moult 0fddd243c2 See #1848. Refactor resource data class. 2023-01-31 18:30:26 +11:00
Dion Moult 1066e5e0a7 See #1848. Refactor layer data class. 2023-01-31 17:35:54 +11:00
Dion Moult 7e0b1b9cbd See #1848. Refactor group data class. Add support for multiple subgroup relationships. 2023-01-31 15:35:14 +11:00
Dion Moult 95e924a5bc Fix #2206. Bug where removing a cost item with active data created an error. 2023-01-31 14:33:29 +11:00
Dion Moult f9cfd17303 Fix #2251. Fix #2603. Bug where annotations don't show because redeclaration of built-in glsl variables is not allowed. 2023-01-31 11:04:23 +11:00
Dion Moult 9f37f73e52 Fix #2585. Bug where geometry could randomly get corrupted. 2023-01-31 10:54:07 +11:00
Andrej730 9acd2043d7 Window/Stair types added as presets in type manager 2023-01-30 15:31:50 +05:00
Dion Moult ab6159f173 See #1848. Refactor cost data class. 2023-01-30 20:53:17 +11:00
Andrej730 f9bff64f0d ifc geonodes modifier prototype 2023-01-30 13:45:52 +05:00
Andrej730 978f362073 More consistent default and current units for stair and window modifiers 2023-01-30 12:44:11 +05:00
Dion Moult 7a185e7f7c See #1848. Refactor constraint data class. 2023-01-30 11:47:02 +11:00
Dion Moult 044cd6e97b See #1848. Refactor boundary data class. 2023-01-30 11:27:38 +11:00
Dion Moult b939370f2b See #1848. Remove reliance on data class for material module. 2023-01-30 10:20:55 +11:00
Sigma Dimensions 4af0c1c98c BBIM: Fix editing slab representation bug 2023-01-29 21:20:33 +01:00
Dion Moult 181531ada8 Fix bug where circle profiles didn't follow project units. 2023-01-29 21:30:11 +11:00
Thomas Krijnen e92d908063 Delete ifcopenshell_wrapper.py 2023-01-29 10:26:05 +01:00
Dion Moult 686f4a023d Fix #2356. Handle cases where the annotation types get changed to an incompatible object type. 2023-01-29 20:10:23 +11:00
Thomas Krijnen c0c6c23fca Update schema.py 2023-01-29 09:47:46 +01:00
Dion Moult 396fd5520f Fix #2349. Be more defensive on invalid smart annotations. 2023-01-29 15:15:00 +11:00
Dion Moult efc3a692cb Fix #2726. 2023-01-29 12:27:50 +11:00
Ryan Schultz 2902d96690 #2692 - bulk assign and unassign ifcmaterials 2023-01-29 10:05:03 +11:00
Massimo Fabbro 70f35095ff Writing qto tests (#2728)
* Update qto tool tests and fix some bugs

* complete test_run qto tests
2023-01-29 10:03:07 +11:00
Ryan Schultz 87c67abac9 #2652 Removes all IFC data, and converts the file to a simple Blender file 2023-01-29 10:00:43 +11:00
Thomas Krijnen 7df9640807 #2704 properly propagate iterator destructor 2023-01-28 14:21:52 +01:00
Thomas Krijnen 25edc91976 #2704 retain kernel pool to free cache 2023-01-28 14:21:52 +01:00
Thomas Krijnen 2174fda88d #2704 keep track of simple types by iden to free later 2023-01-28 14:21:52 +01:00
Thomas Krijnen 2fc5c6c110 #2704 newobject after decl does not work (duh) 2023-01-28 14:21:52 +01:00
Dion Moult 6a2307308c Fix bug where copying objects with profiles should only share profiles if the profile is named. 2023-01-28 21:51:00 +11:00
Dion Moult 1a05fae826 Fix #2426. bug where unrelated objects would get drawing properties by accident. 2023-01-28 14:27:47 +11:00
Andrej730 cce27d73fd Fixed ifc window bugs
1) The bug occured if you would try to remove ifc window modifier and add it back again. Now adding new window checks if window was previously added
2) Second bug occured if you import .ifc project with window and some props were not used before (for example window was without transom), then newly added props would have incorrect units.
2023-01-27 17:44:52 +05:00
Andrej730 87515f3839 Added creating window to Shift+A menu 2023-01-27 16:30:35 +05:00
Dion Moult 24f3918769 Fix #2705. Annotation draw error when splines are outside the zoom level of the screen. 2023-01-27 14:32:41 +11:00
Dion Moult f7af38c863 Fix #2712. 2023-01-27 12:09:17 +11:00
Dion Moult 6c2a4711da Fix bug where annotations were assumed to only be part of one drawing group 2023-01-27 08:38:00 +11:00
Dion Moult 41fdd77bfa Fix #2579. Bug where measurements were considered to be greasepencil strokes when drawing walls. 2023-01-27 08:32:25 +11:00
Dion Moult 9185a51234 Fix #2363. Bug when adding unbuilt schedule to sheet. 2023-01-27 08:22:10 +11:00
Ryan Schultz c5ae86d10b fix bug on Extend IfcBeam: https://community.osarch.org/discussion/1327/blenderbim-bug-on-extend-ifcbeam 2023-01-26 08:31:04 -06:00
Andrej730 74477d0051 Window modifier - removed hardcoded mm units
Related to #2724
2023-01-26 18:29:58 +05:00
Andrej730 cee0ff2074 BIM tool UI black format 2023-01-26 17:14:42 +05:00
Andrej730 85bba9d5f8 Added default blender selection behaviour to BIM Tool
Copied keymap templates from blender source and mentioned them

Related to #2568
2023-01-26 17:14:42 +05:00
Andrej730 8e696cbf02 Added description to some operators with hotkeys 2023-01-26 17:14:42 +05:00
Andrej730 c7d1f5efc0 Changed split hotkey to Shift-K (#2568)
to preserve useful default shift-s hotkey
2023-01-26 17:14:42 +05:00
Andrej730 68bbb4d7a1 Solving interface issues from #2568
1) Added type manager to N-panel. Actually made side-panel and header layout logic more similar.
2) Added interface from sidebar to properties too
2023-01-26 17:14:42 +05:00
Andrej730 b1dd20fef7 Fixed window units in bmesh (#2724) 2023-01-26 14:42:35 +05:00
Thomas Krijnen a701624d7b #2720 add gltf to CD yml 2023-01-26 09:07:53 +01:00
Thomas Krijnen f912be7875 #2720 add gltf to CD yml 2023-01-26 08:59:38 +01:00
Andrej730 04bdb12e79 Window Modifier - added mullions/transoms, removed relative panel dimensions 2023-01-26 12:30:34 +05:00
Dion Moult d69f6c02b6 See #1636. Fix drawing caching when new voids are added or parametric objects updated. 2023-01-26 12:14:45 +11:00
Dion Moult 95c3a57a4d Fix #2722. 2023-01-26 11:11:04 +11:00
Dion Moult 0b6d321d83 Fix #2721. 2023-01-26 11:09:51 +11:00
Dion Moult e0fd3fd90e See #1636. Fix bug where moving an opening didn't update the drawing cache for it's element. 2023-01-26 09:18:08 +11:00
Dion Moult 7686e35858 Fix #2697. 2023-01-25 20:52:43 +11:00
Dion Moult 8eeb8804d4 Handle corrupt geometry caches (e.g. due to crash) by creating a fresh cache. 2023-01-25 17:56:05 +11:00
Dion Moult cb9a7cf5be Fix #2712. Handle deletion of rel services buildings. 2023-01-25 17:42:39 +11:00
Andrej730 54cec30a60 Window modifier - fixed bug in bmesh 2023-01-25 11:15:01 +05:00
Andrej730 9f0ad9be3c Black formatting window modifier 2023-01-25 11:13:41 +05:00
Andrej730 a6271d0936 IFC Window modifier
Added IFC Window in object modifiers tab (works similar way to Ifc Stair)
2023-01-25 11:13:41 +05:00
Andrej730 cf6acd5dd6 ShapeBuilder - added 3d rectangles and polylines support 2023-01-25 11:10:20 +05:00
Andrej730 f8468e66e6 Fixed omitted ifc operators returns 2023-01-25 11:10:20 +05:00
Andrej730 d0cf5f9d0c Fixed ShapeBuilder bug for mirroring IfcExtrudedAreaSolid
Also fixed typo in shape_builder_examples
2023-01-25 11:10:19 +05:00
Dion Moult 2c123fdbfb Bump IfcOpenShell - mainly to fix geometry caching bug 2023-01-25 16:55:05 +11:00
Dion Moult 49b5bbd585 Fix PyPI IfcOpenShell action 2023-01-25 14:08:59 +11:00
Dion Moult bf3063ec00 You can now convert ArchiCAD spaces across multiple stories to Revit rooms 2023-01-25 13:55:38 +11:00
Sigma Dimensions 1e2ac1fe24 Fix IFC Array bug 2023-01-23 22:51:41 +01:00
Sigma Dimensions 9d7145746f Drawing feature tests 2023-01-23 22:06:29 +01:00
Sigma Dimensions 6e7fee5bc8 BBIM: Fix drawing elevation view bug 2023-01-21 12:00:07 +01:00
Sigma Dimensions 9638ae3e77 BBIM: Fix bug error when trying to open a drawing rather than a sheet/schedule 2023-01-21 01:26:26 +01:00
Sigma Dimensions 69cee56b7c BBIM: fix profile joiner for beams & other products 2023-01-21 01:18:06 +01:00
Sigma Dimensions 2257942676 BBIM: When adding doors to a wall, maintain the wall as the active object.
This allows adding multiple doors smoothly.
2023-01-21 00:51:46 +01:00
Sigma Dimensions a5ca7c540f remove useless lines and run quality check black 2023-01-20 21:39:24 +01:00
Sigma Dimensions c9b0a7c3de Attempt to fix selector bug where retrieving material values gets caught in exception 2023-01-20 21:23:40 +01:00
Sigma Dimensions 358d19c883 BBIM: fix bug where task inputs could also be "USERDEFINED" or "NOTDEFINED" 2023-01-20 13:51:08 +01:00
Sigma Dimensions e624d56516 BBIM: improve task bar visual creation 2023-01-20 13:48:14 +01:00
Sigma Dimensions 78a6532615 ifcopenshell: Improve purging for remove_task usecase 2023-01-20 12:58:11 +01:00
Sigma Dimensions 44bb4ac74d BBIM: enable adding task bars visual when creating an animation 2023-01-20 11:34:38 +01:00
Sigma Dimensions f782d784af BBIM: improve task object selection 2023-01-20 11:31:06 +01:00
Sigma Dimensions caf9034839 BBIM: refactor gantt generation operator 2023-01-20 11:26:32 +01:00
Sigma Dimensions 893fd50b85 BBIM: Attempt to fix 3D viewport decoration issue 2023-01-20 10:12:42 +01:00
Sigma Dimensions 7a3e53a9f8 update qto core and qto tools:
- when calculating quantities of an object, assign base qto to object if none exists.
- optimise core and tool functions so it's faster for many selected objects
2023-01-19 21:05:47 +01:00
Dion Moult 07ee62eb91 Add support for editing material set item psets. 2023-01-18 16:40:15 +11:00
Thomas Krijnen b41878e960 #2697 take only a single inverse at a time 2023-01-16 21:29:59 +01:00
Vukas Pajic d9f1cb5525 reassign_class now preserves original STEP ID and GLOBALID - #2701 2023-01-16 13:34:57 +01:00
Vukas Pajic 8110951987 Now support custom attributes in IfcSelector #2649 2023-01-16 08:58:14 +01:00
Vukas Pajic 6b63b5aae7 selector now correctly applies comparison operator. #2643 2023-01-16 08:08:26 +01:00
Martyna Jakubowska e814736e68 Update README.md 2023-01-16 06:15:38 +11:00
Thomas Krijnen 802e3a0ea1 #2688 fix non-planar face triangulation 2023-01-15 14:42:24 +01:00
Massimo Fabbro 4e8a962f60 Minor fix 2023-01-15 11:34:54 +11:00
Massimo Fabbro e20d4c93b7 Delete unuseful qto tool function 2023-01-15 11:34:54 +11:00
Massimo Fabbro 1be76c8aaa Fix little bug 2023-01-15 11:34:18 +11:00
Andrea Ghensi a4566797fe fix: ifcclash bcfxml export 2023-01-15 07:23:42 +11:00
Kristoffer Andersen 4ee3458ff9 Run linux/osx builds with fewer cpus 2023-01-14 17:23:44 +01:00
Sigma Dimensions f86de533f8 BBIM: Feature to select an annotation's assigned object 2023-01-13 16:13:57 +01:00
Sigma Dimensions 693831dca3 BBIM: replace "guess_all_quantities" operator in the UI 2023-01-13 15:00:17 +01:00
Kristoffer Andersen 7500919b5d Set to fixed daily release
Remove association to every completed CI workflow. High frequency of releases makes it better to keep this at a fixed interval given it's so compute intensive
2023-01-13 14:59:06 +01:00
Sigma Dimensions e37b6fa8a2 BBIM: Replace "GuessAllQuantities" with "CalculateQuantities in QTO subpanel, and also re-calculate for all selected objects 2023-01-13 14:57:36 +01:00
Thomas Krijnen 9de9645229 #2665 increase halfspace tolerance comparison 2023-01-13 13:56:38 +01:00
Thomas Krijnen 373d664251 #2361 2023-01-13 12:50:18 +01:00
Dion Moult 6ab912a049 Fix invalid IFC context dimensionality 2023-01-13 22:35:23 +11:00
Dion Moult 9b9c900340 You can now manage material set psets from the UI 2023-01-13 22:35:23 +11:00
Thomas Krijnen a1ac820050 #2685 Recompile rules 2023-01-13 12:12:32 +01:00
Thomas Krijnen e812a886dc #2685 also implement __mul__ on express_set 2023-01-13 12:12:32 +01:00
Thomas Krijnen b759e22875 #2685 assoc material test cases 2023-01-13 12:12:32 +01:00
Thomas Krijnen 93e0babe5a #1785 disable hdf5 brep softlinking 2023-01-13 12:10:57 +01:00
Kristoffer Andersen 7d021fb7a4 reduce number of parallel tasks 2023-01-13 08:03:16 +01:00
Kristoffer Andersen b2cb8ffd8f Update ci-ifcopenshell-conda-daily.yml 2023-01-13 07:56:24 +01:00
Kristoffer Andersen 25a5651e50 Update ci-ifcopenshell-conda-daily.yml 2023-01-13 07:53:53 +01:00
Thomas Krijnen b301eb6520 Update boolean_utils.cpp 2023-01-12 13:07:40 +01:00
Thomas Krijnen 9f90d37401 Delete .travis.yml 2023-01-12 12:41:28 +01:00
Dion Moult ba7741fef5 Fix #2285. You can now get all the elements in a presentation layer. 2023-01-12 12:28:09 +11:00
Thomas Krijnen d1a40d129f #2685 Recompile rules 2023-01-11 13:38:12 +01:00
Thomas Krijnen 791076df2d invalid escape sequence 2023-01-11 13:20:44 +01:00
Thomas Krijnen 608952a4dd #2685 WR test cases for local placement / indeterminate 2023-01-11 12:50:30 +01:00
Thomas Krijnen e64047c511 WR test cases for rigid op / typeof() of simple types 2023-01-11 12:49:47 +01:00
Thomas Krijnen fc3c6599c7 WR test cases for MLS / usedin() 2023-01-11 12:48:53 +01:00
Thomas Krijnen 2336f299f7 Implement typeof() on simple types 2023-01-11 12:47:40 +01:00
Thomas Krijnen 4a71ab9631 #2685 Don't raise issues on WR evaluating to indeterminate 2023-01-11 12:47:13 +01:00
Dion Moult ac3c4cac89 Flange thickness is thickness at edge. 2023-01-11 09:33:20 +01:00
Dion Moult 2be1baab32 I-shape angle fix, fix incorrect flange thickness, and clean up ifdef. 2023-01-11 09:33:20 +01:00
Dion Moult 3e42fdb883 Minor fix 2023-01-11 09:33:20 +01:00
Dion Moult ed37d11002 Fix #2631. Add support for flange edge radius and flange slope for I-shapes. 2023-01-11 09:33:20 +01:00
Dion Moult 4cf896f564 Fix bug where half space booleans didn't show in the right spot due to units 2023-01-11 17:05:02 +11:00
Dion Moult 7e151799b0 Fix #2650. IFC selector only operates on visible objects. 2023-01-11 15:20:58 +11:00
Dion Moult 597b2bb0a8 Fix #2596. Bug with IFC4X3 UI errors as docs couldn't be fetched. 2023-01-10 12:14:10 +11:00
Dion Moult ddc0f7e652 Theme improvements to IfcOpenShell docs 2023-01-10 11:43:20 +11:00
Jesusbill 4845d191f4 Minor fixes to docs 2023-01-10 01:06:49 +01:00
Dion Moult da84cc5925 Add documentation for IfcPatch and all recipes 2023-01-10 10:18:13 +11:00
Dion Moult c8ba96cde8 Make syntax highlighting explicit in docs 2023-01-10 10:16:28 +11:00
Dion Moult 66e067d1ce Remove IfcMax from documentation as it's no longer relevant 2023-01-10 06:38:53 +11:00
Dion Moult 9d39760f6f Add IfcClash to docs 2023-01-10 06:38:53 +11:00
Sigma Dimensions 8aa4934d92 BBIM: Move out Search/Selection sub-panels from "IFC Collaboration" to "IFC Selection" 2023-01-09 14:49:59 +01:00
Dion Moult f848340124 Fix #2681. Fix 90 degree rotation on walls. 2023-01-09 21:55:22 +11:00
Dion Moult b699f55d9c Deleting a spatial or aggregated element now also removes its collection 2023-01-09 16:46:51 +11:00
Dion Moult 745709c56a Handle orphaned spatial elements when loading projects 2023-01-09 16:46:23 +11:00
Dion Moult 0c4c8ad9bc Fix #1012. Half complete example documentation for the IFC Project panel.
Incredibly incomplete, but serves as an example of how reference user-based documentation should be structured.
2023-01-09 15:24:50 +11:00
Ryan Schultz 3ce010de77 added IfcCivilElement to entity_to_type_map_4.json 2023-01-09 12:14:11 +11:00
Dion Moult dd600dd20f Fix #2024. Boolean diagram included in IfcOpenShell docs. 2023-01-09 11:50:49 +11:00
Dion Moult 360b9956c0 Fix failing tests from refactor which I really should've done before the release 2023-01-09 11:00:46 +11:00
Andrej730 1888048d4d Moved ShapeBuilder to separate module #2679
Moved ShapeBuilder to separate module - now `mathutils` will be only required if you're actually using ShapeBuilder (related to #2679)
2023-01-08 19:47:18 +05:00
Andrej730 4ab6d648c9 sverchok_modifier - minor refactor 2023-01-08 19:47:18 +05:00
Andrej730 c29048ecfb Furniture library bug fixes 2023-01-08 19:47:18 +05:00
Dion Moult 0294c4e02c Fix #2678. Critical typo bug meant that units were fixed to metric millimeters. 2023-01-08 12:58:53 +11:00
Dion Moult 3cfcd847cf Fix #2677. Docs now generate in a reasonable time and exclude generated IFC modules. 2023-01-08 11:12:54 +11:00
Massimo Fabbro 694b21a0e1 Delete unuseful functions and improve speed (#2672)
* Delete unuseful functions and improve speed

* Delete active object function, cleaning around and improve performance

* Better functions names and prevent user defined qto use
2023-01-07 18:11:46 +01:00
Dion Moult 73d43649a5 Link to latest IfcSverchok release 2023-01-07 17:08:46 +11:00
Dion Moult 55036653df Update IfcSverchok loading based on latest Sverchok master 2023-01-07 13:04:30 +11:00
Dion Moult 66ecb92cc2 Minor UX improvements to library name and Sverchok UI 2023-01-07 12:00:22 +11:00
Andrej730 23c7bc3f56 Added ShapeBuilder class and library for non structural assets (
`ShapeBuilder` class is used to programmatically create 2d and 3d ifc shapes and representations. It's inspired by the way OpenSCAD language is designed - the goal was to create a readable and easy way to create new shapes. The class can be imported from `ifcopenshell.util.representation` module.

Examples of things created with `ShapeBuilder` can be found in `shape_builder_examples.py` or `generate_furniture_library.py` / `Non_structural_assets_library.ifc`.

Also added ifc library of non structual assets (furniture etc) - `Non_structural_assets_library.ifc`. All assets are using most common dimensions for them - it makes it good for prototyping. Related to https://community.osarch.org/discussion/1192
2023-01-06 16:35:55 +05:00
Andrej730 74fee24004 Update ifc geometry on sverchok update 2023-01-06 12:23:54 +05:00
Dion Moult 618ecccb7b Fix #2428. Document minimum system support. 2023-01-06 17:11:51 +11:00
Dion Moult f818fc659a Bundle ifcopenshell for Python 3.11 on PyPI. See #2551. 2023-01-06 16:37:50 +11:00
Dion Moult 4afada48a6 Fix #2440. Fix #2439. Describe how to access advanced mode when dealing with large models. 2023-01-06 14:01:42 +11:00
Dion Moult 59451cb90c Fix #2664. Package with latest IfcOpenShell build. See #2670. 2023-01-06 11:16:29 +11:00
Sigma Dimensions 53bf746227 BBIM: Fixes for:
- Task Time attributes
- Fix typo animation time calculation
2023-01-05 18:43:50 +01:00
Sigma Dimensions cd6f995471 BBIM: Disable "Create animation" buttons when no start dates/end dates are given 2023-01-05 18:36:22 +01:00
Dion Moult 839a00c2a8 Run black on validation, lazy-load _pytest.assertion so that it isn't a hard dependency for non-express rule validation. 2023-01-05 20:54:17 +11:00
Dion Moult 9208781b8f Bump IfcOpenShell version 2023-01-05 18:38:32 +11:00
Dion Moult 25af42f4cb Fix circular import of json_logger when doing import ifcopenshell.validate 2023-01-05 18:37:14 +11:00
Dion Moult d386a884aa You can now purge properties explicitly instead of setting them to None 2023-01-05 17:37:40 +11:00
Dion Moult cb92be2b08 No need to specify SI unit names as they can be derived from the unit type 2023-01-05 17:37:40 +11:00
Martyna Jakubowska 70b7f1424f Resolved Code Review 2023-01-05 17:37:40 +11:00
Martyna Jakubowska 56858540b8 Update README.md 2023-01-05 17:37:40 +11:00
Martyna Jakubowska 0331a21280 Update README.md 2023-01-05 17:37:40 +11:00
Martyna Jakubowska 9f53d724d1 Update README.md 2023-01-05 17:37:40 +11:00
martinaCodes c114f09f9a Added example model and a corresponding description 2023-01-05 17:37:40 +11:00
martinaCodes 1a2183ef71 Bug fixes in create_entity 2023-01-05 17:37:40 +11:00
martinaCodes 0ab0213dea Bug fixes and changed behaviour of create_entity, so it creates an entity pr. each representation 2023-01-05 17:37:40 +11:00
Martyna Jakubowska 421f861e46 Updated README 2023-01-05 17:37:38 +11:00
martinaCodes 6e5f2f3f8d Updated by_query and removed print statements 2023-01-05 17:36:33 +11:00
martinaCodes 05633cd657 Updated following nodes to work with the current workflow: add_pset, by_guid, get_attribute, get_property, read_entity. Added tooltips and other minor fixes 2023-01-05 17:36:33 +11:00
Martyna Jakubowska 41ae350f33 Create README.md 2023-01-05 17:36:33 +11:00
martinaCodes 8a26f30506 Important rework of handling multiple/nested items in bmesh_to_ifc, create_entity and sverchok_to_ifc nodes. Formatting and other minor fixes. 2023-01-05 17:36:33 +11:00
martinaCodes 4ae7643874 cleaned print statements etc 2023-01-05 17:36:33 +11:00
martinaCodes b09068e1f4 write_file added logic that ensures proper model hierarchy 2023-01-05 17:36:33 +11:00
martinaCodes 87dbaa39d8 bmesh_to_ifc now creates separate representations for each distinct bmesh geometry 2023-01-05 17:36:33 +11:00
martinaCodes d193e8a3eb major changes primarily to file creation/saving logic.
Bug fix in create entity.
Other..
this commit is way to big and unstructured.
2023-01-05 17:36:33 +11:00
martinaCodes f9e766138c new pick_ifc_class node + minor fixes. Add_spatial_element is WIP 2023-01-05 17:36:33 +11:00
martinaCodes 36899d362e added blender panel for saving file + minor fix in create_entity 2023-01-05 17:36:33 +11:00
martinaCodes fd789178c1 Add_spatial_element node updated 2023-01-05 17:36:33 +11:00
martinaCodes a0757851c8 Add_spacial_element node updated to work with multiple elements. V0.1 - still a bit buggy. 2023-01-05 17:36:33 +11:00
martinaCodes 039727cb19 added entity locations 2023-01-05 17:36:33 +11:00
martinaCodes b5133f1c41 write_file node updated 2023-01-05 17:36:33 +11:00
martinaCodes ab218b842a create_shape node updated + minor changes 2023-01-05 17:36:33 +11:00
martinaCodes 37aa17fcf3 sverchok_to_ifc node added + works for multiple geometries. Parent contexts also get deleted if not used. 2023-01-05 17:36:33 +11:00
martinaCodes 6542fc7db3 updated by_type to current workflow + added sv_to_ifc 2023-01-05 17:36:33 +11:00
martinaCodes c8c690afc2 changes
1) pasing ID references
2) bugs in create_entities, where number of representations couldn't be updated
3) by_id node updated to current workflow
... other small fixes
2023-01-05 17:36:33 +11:00
martinaCodes 5d569dea30 fixed create_entity and minor changes to bmesh_to_ifc 2023-01-05 17:36:33 +11:00
martinaCodes 38031a02bc new nodes, and changes to create_entity2, but not working yet 2023-01-05 17:36:33 +11:00
martinaCodes 25460661ab created new singleton class SvIfcStore, created new 'create_entity2' node 2023-01-05 17:36:33 +11:00
martinaCodes 3684be1936 fixed api_WIP, minor cleanup in other nodes 2023-01-05 17:36:33 +11:00
martinaCodes 0ada921ad8 fixed a typo-bug 2023-01-05 17:36:33 +11:00
martinaCodes 8fb285596a added new nodes to node index 2023-01-05 17:36:33 +11:00
martinaCodes ba4130d395 Added new nodes: api_WIP, bmesh_to_ifc, create_project and quick_project_setup
Modified nodes: api, create_entity
2023-01-05 17:36:33 +11:00
Sigma Dimensions f818446e7e BBIM fix: prevent "guess_all_quantities" operator from showing up on Property Sets 2023-01-04 13:59:00 +01:00
Dion Moult 82ac895bbb Write docs for void API module 2023-01-04 16:10:13 +11:00
Dion Moult fd8774718e Write docs for unit API module 2023-01-04 16:10:13 +11:00
Dion Moult 90d4d5afda Write docs for type API module 2023-01-04 16:10:12 +11:00
Dion Moult 92623b98e2 Write docs for system API module 2023-01-04 16:10:12 +11:00
Dion Moult b86818ead3 Write docs for style API module 2023-01-04 16:10:12 +11:00
Dion Moult 9e45435024 Documentation example fixes where I forgot to give things with representations a placement 2023-01-04 16:10:12 +11:00
Sigma Dimensions 981b6cd65f Various 4D improvements:
- refactor work schedule visualisation operator
- Fix text handler
- Improve durations UI for task times (proposal to replicate for all durations)
- Simplify durations ( P32H as P4D or P1D8H)
- Implement years/months in various datetime calculations
- Feature to customise animation colors per construction task type
- Feature to add Visual task bars
- Feature to customise Visual task bar material colors
- Move helper functions from blenderbim.bim.module.sequence to ifcopenshell.util.sequence
2023-01-04 02:08:52 +01:00
Dion Moult 0c77fb81ce Write documentation for structural API module 2023-01-03 17:32:08 +11:00
Dion Moult e53a9cd66c Write documentation for spatial API module 2023-01-03 17:31:56 +11:00
Dion Moult 2805109cef Write documentation for sequence API module 2023-01-03 17:31:48 +11:00
Dion Moult 6594445fa3 Add new code example for creating a work schedule 2023-01-03 17:31:23 +11:00
Massimo Fabbro bac6c62073 Finish mapping quantities (see #2533) (#2661)
* Finish Qto_SignBaseQuantities

* Finish Qto_RailBaseQuantities

* Finish Qto_PitorialSignQuantities

* Finish Qto_JunctionBoxBaseQuantities

* Finish Qto_ArealStratumBaseQuantities

* Finish Qto_SiteBaseQuantities

* Finish Qto_RoofBaseQuantities

* Finish Qto_RoofBaseQuantities

* Finish Qto_ChimneyBaseQuantities

* Finish Qto_EarthworksCutBaseQuantities

* Finish Qto_KerbBaseQuantities

* Finish Qto_PavementBaseQuantities

* Finish Qto_RampFlightBaseQuantities

* Finish Qto_SurfaceFeatureBaseQuantities

* Finish Qto_StairFlightBaseQuantities

* Finish Qto_ConstructionMaterialResourceBaseQuantities

* Finish Qto_DistributionChamberElementBaseQuantities

* Finish Qto_CourseBaseQuantities

* Finish Qto_RailingBaseQuantities

* Finish Qto_SleeperBaseQuantities

* Finish Qto_TankSurfaceQuantities

* Finish Qto_BuildingElementProxy

* Finish Qto_MemberBaseQuantities

* Finish Qto_BodyGeometryValidation

* Finish Qto_VolumetricStratumBaseQuantities

* Finish Qto_SpatialZoneBaseQuantities

* Finish Qto_ReinforcingElementBaseQuantities

* Finish update calculate all quantities button with new calculating functions
2022-12-30 21:33:18 +01:00
Thomas Krijnen 6180d73f75 Fix build-all collada compile on gcc 9.4.0 2022-12-28 13:33:16 +01:00
Sigma Dimensions 599c391407 code clean up for sequence module 2022-12-26 22:48:51 +01:00
Sigma Dimensions 1f18c5ab82 features to guess schedule date range and setup default task columns, and code clean up 2022-12-26 18:30:25 +01:00
Sigma Dimensions 2bb4e645b2 Fix: When counting working days, consider if calendar is applicable 2022-12-26 17:19:57 +01:00
Sigma Dimensions 5326e21fef 2 Fixes for 1 commit:
- Consider all tasks descendants when deriving task earliest or latest dates
2022-12-26 17:18:33 +01:00
Sigma Dimensions 891b49ff6f BBIM: feature to display total task Assignements 2022-12-26 13:38:54 +01:00
Thomas Krijnen 0f9c84c1ce Feature: express rules (#2662)
* temp reasonable state, missing rule_head contents

* better state, with init() and rule_id, but some missing parameters

* performance; embed root in dict; fix lookup

* Add ast_utils

* Fixes related to listnode and typo

* First steps with code gen

* Finalize first steps towards working code generation

* Backwards compat

* Rule execution, error formatting, test cases

* Where rule: support indexing, more expressions, test plane angle measure

* positive length measure test cases

* Venture into entity rules, test actor role

* Fixed for not unary op and address test cases

* Test group qualifier and air terminal type

* typeof() implementation and test annotation curve occ

* Flexible handling of expression, type set intersection, IfcAnnotationSurface test cases

* Functions, derived attrs, fix branch order, allow to terminate branches, apply -1 to index

* Implement express query(), test cases for 2x3 bspline curve

* Function args, if-else, repeat, entity instance construction, cshape test cases

* Multiple function call arguments and other small but influential changes. IfcDotProject() almost working except for variable case

* Make lowercase and fix assignment to qualified lhs

* Entity instance schema without file, aggregate assignment workaround, range fix, lowercase instance locals, extruded area direction test cases

* Enumeration item handling, query() robustness, arbitrary profile test cases

* Empty aggregate_initializer, xor and instance equality, nested expression fix in IfcCrossProduct, axis2-3d test cases

* Numeric stable sort with indices greater then 10, get ast node parent, redeclared derived support, nested expression robustness, define entity functions, case statements, xor, mod, bool literals, nvl, unknown, conversion based unit test cases

* Safeguard for schema name case norm, case norm query variable_id

* free instance comparison, supertype serialization fix, include inherited attributes in locals, proper elif-else in case stmt, loindex, shape rep test cases

* Union operator on set, retain general_aggr_types in parse tree, test cases for property set

* Escape stmt, rule locals and statements

* Return calculated values for redeclared derived attributes

* fix for rules without stmt, add derived and inverse attributes to locals, filter unused locals, wrap exists() arg with lambda to catch indexerror, support repeated aggr init element, typeof() none check, enum namespace uppercase

* Regen 2x3 rules

* Rule test filter only on basename

* Update fixtures for compliance with full body of rules

* Add rule support to ifcopenshell.validate

* Implement usedin() function, test cases for IfcWallSC MLS

* blength

* Run code generation on all schemas

* Try to eliminate runtime pyparsing dep

* Try to eliminate runtime pyparsing dep
2022-12-26 11:29:32 +01:00
Sigma Dimensions 2ccf25f7eb Display Scheduled Resource Usage as a property within rersource tree 2022-12-26 07:04:11 +01:00
Sigma Dimensions 082a326e67 Enable displaying number of resources used by a task 2022-12-26 06:16:19 +01:00
Sigma Dimensions d33a7244a3 Task Output selection improvements - allow recursive nesting and add checkbox to toggle between nested and non-nested 2022-12-26 05:17:56 +01:00
Thomas Krijnen bdb352ab22 Update ci-py-only.yml 2022-12-25 17:36:31 +01:00
Thomas Krijnen 04fb7cdf9c Update ci.yml 2022-12-25 17:36:18 +01:00
Andrej730 16de2f2e7e Added mention of sverchok's copyrights 2022-12-23 09:24:26 +05:00
Andrej730 0b6c8fe83e Added base for ifc sverchok modifier
It's located in "Modifiers" section of the properties (the same way as IFC Array or IFC Stair).
It requires Sverchok addon to be enabled (it's lazy importing it when it's needed, so there is no new constant dependency).

What you can now do with it:
1) Add sverchok graphs to this modifier and store simple data from sverchok in IFC ("Update data from sverchok). The "output" node of the sverchok graph has to be type of "Viewer Draw" and it's name should start with "ifcoutput" (no case-sensitive).
2) Import/export json of sverchok graphs.
2022-12-21 20:10:39 +05:00
Andrej730 d11959d303 Removed deprecated angle annotations operator
As it's currently completely replace with new more intuitive operator.
2022-12-19 20:13:59 +05:00
Andrej730 2bd5f3bbb3 Fixed annotations angle operator svg rendering bug
Fixed bug where the angle was drawn in svg only for the first two edges of the curve.
Now it takes into account all edges - first angle = edge0 + edge1, second angle = edge1 + edge2 etc.
2022-12-19 20:07:29 +05:00
CyrilWaechter cabc91dd5e Allow to write to unexisting directory
`ifcopenshell.write("/unexisting/path/model.ifc")` was failing without
throwing an error. It now works and a test ensure it works.
2022-12-19 01:44:40 +01:00
Sigma Dimensions 88c9f15320 fix library import for date utils 2022-12-18 04:34:20 +01:00
Sigma Dimensions b206e90097 Proposal to use parent productivity to calculate resource work. 2022-12-18 04:17:17 +01:00
Sigma Dimensions 73d3e9589c BBIM: forgotten commit for "ScheduleDuration" formatting 2022-12-18 03:56:10 +01:00
Sigma Dimensions 84a07c3fdf fix typo for resource_work calculation 2022-12-18 03:41:13 +01:00
Sigma Dimensions ea1c306733 fix offset date calculation when finish date lies outside of calendar range 2022-12-18 03:34:20 +01:00
Dion Moult 30dc13f1a7 Add support for loading IFCs with aggregated types 2022-12-17 20:48:05 +11:00
Dion Moult 9b3b06adf3 Write documentation for root API module 2022-12-16 15:29:50 +11:00
Dion Moult 436482532d Write documentation for resource API module 2022-12-16 15:07:02 +11:00
Dion Moult d2fee728f2 Write documentation for pset_template API module 2022-12-16 11:22:46 +11:00
Dion Moult 0ccea3cef8 Add documentation for pset API module 2022-12-15 16:02:27 +11:00
Dion Moult 241406f676 Consolidate standard "clean environment" instructions in docs 2022-12-14 23:13:01 +11:00
Dion Moult a89c061b58 Write docs for project API module 2022-12-14 17:28:34 +11:00
Dion Moult 1211c153d9 Revert detailed SPF comments in code example
Sorry I find these really hard to read an intimidating for new users.
2022-12-14 17:28:12 +11:00
Dion Moult a5bdcf488b Write docs for profile API module 2022-12-14 16:49:06 +11:00
Dion Moult a5a1ef2e8e Write docs for owner API module 2022-12-14 15:58:53 +11:00
Ryan Schultz 05cd11ae12 Added some troubleshooting measures to determine if another plugin is interfering with BB. 2022-12-13 08:12:21 -06:00
fbpyr 307f9a2322 bump python version
bumping python version, so it works with our ubuntu latest image and `actions/setup-python@v2`
2022-12-13 21:35:42 +11:00
CyrilWaechter 3d05dc234a Ignore mypy cache, swig and compiled files 2022-12-11 22:49:44 +01:00
CyrilWaechter 1f87165601 Remove bloat line 2022-12-11 22:46:05 +01:00
CyrilWaechter a513e1b56a Remove duplicate line 2022-12-10 19:45:17 +01:00
CyrilWaechter ec0c8f509e Move boundary origin to space origin
Ensure that boundary origin is same as space origin to assign correct
geometry into IFC.
2022-12-10 19:44:28 +01:00
Ryan Schultz a23bac6ecb where to look to see if a dependency has changed. 2022-12-09 10:31:57 -06:00
Kristoffer Andersen 569c19abca Merge pull request #2642 from CyrilWaechter/v0.7.0
Remove unecessary line which make build failing
2022-12-09 10:52:01 +01:00
CyrilWaechter dfeac601e4 Remove unecessary line which make build failing 2022-12-09 09:44:19 +01:00
Dion Moult 53cecb3546 Write documentation for the nest API module. 2022-12-07 18:56:44 +11:00
Dion Moult cf87852d9c Add API documentation for the material module 2022-12-07 17:30:08 +11:00
Dion Moult 7da3d9ee70 Add docs for library API module 2022-12-07 12:20:29 +11:00
Dion Moult 9650bbb5ee Add docs to layer API 2022-12-07 08:59:24 +11:00
Dion Moult 45953c6b49 Add API documentation for group module 2022-12-06 16:42:47 +11:00
Dion Moult b34caa1b5f Add documentation for grid API module 2022-12-05 17:10:22 +11:00
Ryan Schultz ea8433b187 Added more examples to the Code Examples page 2022-12-05 15:44:38 +11:00
Andrej730 390f23a30c Added ReloadSelectedIfcFile operator
Added ReloadSelectedIfcFile operator and added it to IFC Quality Control -> IFC Debug, it's useful when you're debugging and doing a lot of iterations on the same file.
2022-12-05 14:59:58 +11:00
Massimo Fabbro c8ba2b53c9 Mapping quantities (see #2533) (#2627)
* Finish mapping Qto_PileBaseQuantities

* Finish mapping IfcPipeSegmentBaseQuantities

* Finish mapping IfcVehicleBaseQuantities

* Finish mapping Qto_OpeningElementBaseQuantities

* Finish mapping Qto_PlateBaseQuantities

* Finish Qto_MarineFacilityBaseQuantities

* Finish Qto_FacilityPartBaseQuantities

* Finish Qto_ProjectionElementBaseQuantities

* Better syntax
2022-12-02 18:19:43 +01:00
Thomas Krijnen dbbbb52e9e #2624 2022-12-02 13:43:44 +01:00
Dion Moult 052d6e2254 Add API docs for georeferencing module 2022-11-28 10:30:51 +11:00
Massimo Fabbro b05c711fb9 Merge pull request #2619 from maxfb87/mapping_quantities
Finish mapping quantities Qto_SpaceBaseQuantities (see #2533)
2022-11-27 08:17:32 +01:00
CyrilWaechter eb0322759c Allow ifcpatch to work with .ifcZIP | .ifcXML
Closes #2350
2022-11-26 05:37:00 +01:00
CyrilWaechter 25a7a95284 Allow to write .ifcZIP | .ifcXML #2350
Transparently write any .ifc | .ifcXML | .ifcZIP formatted file
 with any extension :
- by guessing format from its extension
(eg. .zip | .ifczip | .ifcZIP | .ifcXML | .ifcxml | .IFC | .ifc)
zipped file can file can be of any supported format
- by specifying a format
- by specifying if it should be zipped
2022-11-26 05:19:01 +01:00
Ryan Schultz 8ec1b7bb3e misspellings with outer_boundary 2022-11-25 12:29:00 -06:00
CyrilWaechter 5f094f6a95 Fix IfcSystem assignment bug introduced in f0b1935
Fixing my own bug…
Note : always run all test before pushing not only the one which used to fail…
2022-11-25 19:01:07 +01:00
CyrilWaechter f0b1935861 Add system assignment check
@aothms Is there a way to check against IFC formal propositions ?
Example for [IfcZone](http://ifc43-docs.standards.buildingsmart.org/IFC/RELEASE/IFC4x3/HTML/lexical/IfcZone.htm#5.4.3.82.4-Formal-propositions)
@Moult Should I move is_assignable to an util ?
2022-11-25 18:52:58 +01:00
Massimo Fabbro 2540ba3467 Finish mapping quantities Qto_SpaceBaseQuantities 2022-11-25 17:22:13 +01:00
CyrilWaechter 88093728a7 Add IfcSpatialElementType to assignable classes
Required for IFC4+ to assign IfcSpaceType and IfcSpatialZoneType
Solves #2615
2022-11-25 15:55:32 +01:00
Thomas Krijnen af6734d7b0 IfcOpenShell WASM module build script (#2617) 2022-11-25 13:16:36 +01:00
Thomas Krijnen 8a108f37c3 Moar schema indices 2022-11-24 09:36:02 +01:00
Andrej730 d88510b919 Added new angle annotations operator
New operator should be more intuitive to work with. I kept the old one too for now.
2022-11-24 12:05:54 +06:00
Thomas Krijnen afe9f7602f Test cases for #2586 2022-11-23 13:46:15 +01:00
Thomas Krijnen ff2b79a41f Distinguish between nil and derived in validate.py 2022-11-23 13:45:44 +01:00
Thomas Krijnen 631722303f https://raw.githubusercontent.com/buildingSMART/IFC4.3-html/sep-13-release/IFC/RELEASE/IFC4x3/HTML/IFC4X3_TC1.exp 2022-11-23 13:23:49 +01:00
Dion Moult 4b20a407e9 Add API docs for drawing module 2022-11-23 11:23:40 +09:00
Dion Moult b23f445946 Add API documentation for document module 2022-11-23 10:56:41 +09:00
CyrilWaechter 09c8268494 Fix path for ci (root at src/ifcopenshell-python) 2022-11-22 23:25:11 +01:00
CyrilWaechter 0bc3543914 Update test/input submodule to https://github.com/IfcOpenShell/files/commit/20a17fcf3b1be2bc48af0273f7604af5b7cc4068
#2350
2022-11-22 21:23:26 +01:00
CyrilWaechter 0412eb48a0 Fix type hints #2350 for python <3.10 2022-11-22 01:00:04 +01:00
CyrilWaechter e7d5add13d Add test suite for ifcopenshell.open #2350
Fix open function: format argument was unused
2022-11-22 00:40:27 +01:00
Thomas Krijnen 25948a608a Missing parse updates after 4e0a19e 2022-11-21 09:43:13 +01:00
Dion Moult 11f772b5a3 Add documentation for cost module 2022-11-21 12:05:58 +09:00
CyrilWaechter 412cf7c6cb Add stable AUR package 2022-11-21 01:42:26 +01:00
CyrilWaechter b2d5580c37 Allow to open .ifcZIP | .ifcXML #2350
Transparently open any .ifc | .ifcXML | .ifcZIP formatted file
 with any extension :
- by guessing format from its extension
(eg. .zip | .ifczip | .ifcZIP | .ifcXML | .ifcxml | .IFC | .ifc)
zipped file can file can be of any supported format
-  by specifying a format
2022-11-21 01:32:12 +01:00
CyrilWaechter 8386aa0e0a IfcZone: Allow to remove an object from an IfcZone 2022-11-20 17:48:30 +01:00
CyrilWaechter ae0f2a9de6 IfcZone : Allow basic selection/deletion/creation 2022-11-20 17:35:27 +01:00
Thomas Krijnen 4e0a19e013 https://raw.githubusercontent.com/buildingSMART/IFC4.3-html/v4.3.1.0/IFC/RELEASE/IFC4x3/HTML/IFC4X3_ADD1.exp 2022-11-20 16:52:46 +01:00
Thomas Krijnen 9a840174d2 Fix test case 2022-11-20 14:38:17 +01:00
Massimo Fabbro 83528ba80a Merge pull request #2612 from maxfb87/Mapping_quantities
Finish mapping Qto_CoveringBaseQuantities (see #2533)
2022-11-19 23:05:29 +01:00
Massimo Fabbro eb23372fd0 Finish mapping Qto_CoveringBaseQuantities 2022-11-19 21:44:51 +01:00
Massimo Fabbro 286e9dfda9 Merge pull request #2605 from maxfb87/mapping_quantities
Mapping quantities (see #2533)
2022-11-19 17:28:29 +01:00
Vukas Pajic f0b9c9ad7b #2602 get_properties no longer throws error when EnumerationValues = None 2022-11-18 14:35:57 +01:00
Kristoffer Andersen afd79ee16d bump conda daily build number 2022-11-18 13:52:35 +01:00
Ryan Schultz caa4445eb0 Added diffuse_color inside IFC Style panel 2022-11-18 12:36:10 +11:00
Andrej730 f850bd5741 documented create_simple_2dcurve() 2022-11-17 12:03:28 +06:00
Massimo Fabbro 8c5883ffaa Finish mapping Qto_DoorBaseQuantities and Qto_WindowBaseQuantities 2022-11-16 22:28:10 +01:00
Massimo Fabbro 8f8940de2a Minor fix 2022-11-16 21:56:29 +01:00
Massimo Fabbro bf59871db5 Fix get_gross_side_area for Qto_WallBaseQuantities 2022-11-16 21:50:52 +01:00
Dion Moult 22eb0bf2e4 Write API documentation for control module 2022-11-16 18:38:51 +09:00
Dion Moult 68838a37e5 Add API documentation for context module 2022-11-16 18:18:22 +09:00
Dion Moult 22b4bfe07d Add API docs for constraint module 2022-11-16 08:57:25 +09:00
Andrej730 ff2714d991 Added c-, z-profiles with lips to AU steel library
Added c- and z-profiles with lips to IFC AU Steel profile library (based on data from https://github.com/boltsparts/boltsparts/pull/15).

For z-profiles I've created simple 2D curve generation function that can be reused later - it requires list of points and list of points with fillets and the results are list of curve points, segments and IfcIndexedPolyCurve.

Example:

    points, segments, ifc_curve = create_simple_curve_from_coords(coords,
        fillets =     (0,   1,   4, 5, 6,   7,   10, 11),
        fillet_radius=(r+t, r+t, r, r, r+t, r+t, r, r),
        closed=True, ifc_file=ifc_file)
2022-11-15 13:35:44 +06:00
Dion Moult 308ee7f7a9 Add API documentation for classification module 2022-11-15 16:11:47 +09:00
Dion Moult c87924c4ba Add API docs for boundary module 2022-11-15 08:27:26 +09:00
Thomas Krijnen 8f33c2ca9d Missing file 2022-11-14 09:38:51 +01:00
Thomas Krijnen 9351038009 Refactoring 2022-11-14 09:23:59 +01:00
Dion Moult 66281ec1f1 Add docs for attribute API 2022-11-14 07:55:50 +11:00
Dion Moult ae843e6faf Add docs for aggregate api 2022-11-14 07:48:20 +11:00
Massimo Fabbro 5ca0a254ff Cleaning around in qto_calculator 2022-11-14 06:50:33 +11:00
Thomas Krijnen c18458b3db Refactoring 2022-11-13 11:21:58 +01:00
Thomas Krijnen 3736a8b4b4 Refactoring 2022-11-13 11:04:16 +01:00
Dion Moult 6558f68cd4 Minor fix 2022-11-13 15:32:24 +11:00
Dion Moult 4fd5806f70 Minor documentation tweaks 2022-11-13 15:30:35 +11:00
Thomas Krijnen b1c730c04d draw.include_projection setting 2022-11-12 15:49:29 +01:00
Dion Moult bdec443410 Minor fixes to IfcTester 2022-11-12 14:08:01 +11:00
Erik Abrahamsson d9afb0f8a2 Fix translation of days in Powerproject importer 2022-11-12 08:32:19 +11:00
Andrej730 9dfd7e03f7 IFC Stair - added "Wood / Steel" stair type
Added new stair type "Wood / Steel" to IFC Stair modifier. It's less sophisticated than "Concrete" stair type - it acts more like a "Dumb stair" operator we have.
2022-11-11 17:32:57 +06:00
Andrej730 31b633b8b6 IFC Stair - cosmetic adjustments 2022-11-11 16:22:55 +06:00
Massimo Fabbro 20f4737ffd Fix some errors and update notes 2022-11-11 12:00:08 +11:00
Massimo Fabbro 4d4ab63404 Finish mapping Qto_BeamBaseQuantities 2022-11-11 12:00:08 +11:00
Massimo Fabbro 056f7610c1 Fix some get_lateral_area function errors 2022-11-11 12:00:08 +11:00
Massimo Fabbro bfb2f06e44 Finish mapping Qto_BeamBaseQuantities 2022-11-11 12:00:08 +11:00
Dion Moult a7febaa9b0 Fix astapowerproject import to ifc which seemed mostly broken for some reason 2022-11-11 11:38:09 +11:00
Sigma Dimensions ff984f62af BBIM feature to load nested tasks outputs, and select all nested task outputs 2022-11-10 18:05:26 +01:00
Otso Alho d005524c4c catch missing instances one by one. do not throw away whole relation. 2022-11-10 14:18:50 +01:00
Dion Moult a2362668a3 The profile manager now only manages named profiles 2022-11-10 23:32:15 +11:00
Andrej730 277317e6fd Added "IFC Stair" to object modifiers
1) Added "IFC Stair" to object modifiers - it works in similar way as "IFC Array". It creates a stair from current object (if it's IfcStairFlight) and writes it's parameters to property set "BBIM_Stair" and also to IfcStairFlight parameters.
Then you can edit it - modifying stair parameters and immediately see the changes, then you can save those changes or discard them.
2) "Clever Stair" operator (in Shift+A menu) works a bit different now - it creates new IfcStairFlight with IFC Stair modifier activated.
2022-11-10 15:57:08 +06:00
Dion Moult b3f0b9b37b Get cross section area from profile directly rather than mesh parsing 2022-11-10 17:37:14 +11:00
Dion Moult 6de1e73e4f Distinguish between calculating gross and net surface area 2022-11-10 17:02:11 +11:00
Thomas Krijnen c6cdf4ab77 Be a bit more careful in throwing NoSuchObject in case of triangulated face handling https://github.com/IfcOpenShell/wasm-preview/issues/1 2022-11-09 20:32:53 +01:00
Dion Moult 21f8aca00f Elementary fixes to the BCF module just so that things load (but lots are still broken) 2022-11-09 23:35:47 +11:00
Thomas Krijnen 1d6c3b3fc2 Update build-all.py 2022-11-09 10:58:38 +01:00
Thomas Krijnen 4362163ea9 Update build-all.py 2022-11-09 10:57:42 +01:00
Dion Moult 67808b8384 Fix issue where sometimes world coordinate system would trigger the georeferencing distance threshold 2022-11-09 18:37:16 +11:00
Andrea Ghensi 2cbc7a10ab [BCF] New BCF XML handler with better performances (#2355)
BREAKING CHANGE: incompatible methods and objects with previous version.

closes #2321
2022-11-09 08:54:23 +11:00
Massimo Fabbro d97594df96 Finish Qto_SlabBaseQuantities quantities (#2567) 2022-11-08 22:21:00 +11:00
Dion Moult c7eca135de Document how you can get the matrix of elements from IfcOpenShell Python. 2022-11-08 20:18:08 +11:00
Dion Moult e63ec83325 Fix some bugs in IfcTester that prevented tests running on IFC2X3 2022-11-08 20:05:56 +11:00
Dion Moult 1ddae8a6f5 Fix #2577. Bug where system editing UI appears multiple times. 2022-11-08 20:04:59 +11:00
Andrej730 03781bdf9b Updated EU, AU steel profiles libraries
1) Updated AU profiles based on more correct data (https://github.com/boltsparts/boltsparts/pull/4) - also added welded i-beam profiles
2) Added inner and outer fillet radius to hollow profiles since this data was added to https://github.com/boltsparts/boltsparts
3) Added more data to ifc profiles that was available on bolts: FilletRadius for I-beams, C-beams; FilletRadius and EdgeRadius for I-beams. Sovles #2556
4) Set names IfcProfileDef names too. Solves #2556
2022-11-08 11:29:43 +06:00
Dion Moult 62e5c3684b Fix #2564. Bug where profiles were not reused across copies. 2022-11-07 22:37:53 +11:00
Dion Moult ff90728a22 New unassign container API function 2022-11-07 18:47:15 +11:00
Dion Moult dadf23681b Fix #2123. Bug where mesh to extrusion conversion didn't work for thin extrusions. 2022-11-07 17:45:05 +11:00
Dion Moult 516bd37518 Fix #2550. Bug where material styles weren't included when appending from a library 2022-11-07 16:20:23 +11:00
Dion Moult 521ec1b124 Support styles defined somewhere along a boolean result stack 2022-11-07 11:24:13 +11:00
Thomas Krijnen 4881e4c686 Error in type checking introduced in ca98e77b40 2022-11-06 14:45:00 +01:00
Thomas Krijnen a57cac5f9c #2558 make conditional 2022-11-06 14:39:01 +01:00
Thomas Krijnen ca98e77b40 #2471 Fix refcount when setting aggregates 2022-11-05 16:24:04 +01:00
Dion Moult cbd9c898c3 Fix failing tests 2022-11-04 17:08:41 +11:00
Massimo Fabbro f57731a10a Mapping quantities #2533 (#2565)
* Implement some Qto_WallBaseQuantities quantities

* finish Qto_WallBaseQuantities
2022-11-04 08:56:38 +11:00
Dion Moult 0142bface5 You can now edit parameterised profiles again in the material panel 2022-11-04 00:05:09 +11:00
Dion Moult 5acbf4658f Material UI now prompts to add a profile if none exist in your library 2022-11-03 23:44:47 +11:00
Dion Moult 32e00f6d49 Refactor material UI to not depend on IOS API data class 2022-11-03 23:36:16 +11:00
Gorgious56 4e3ce192cc Custom property set attributes now show their description when right clicking the field
+ Add explicit numerical constraint members to attribute class #2562
+ Fix error in numerical value callback #2562
+ Fix error in setting attribute values because of wrong type cast
2022-11-03 09:54:35 +01:00
Gorgious56 841bb59d18 Fix error when the user selects a class suggestion that is not a predefined type 2022-11-03 08:21:55 +01:00
Gorgious56 8dd8a23af9 The predefined type suggestions now fetch their values from the ifcopenshell.util.doc module instead of parsing the file data 2022-11-03 08:16:40 +01:00
Dion Moult adc59de2bf Minor fix to accommodate null descriptions and parents with no attributes
# Conflicts:
#	src/ifcopenshell-python/ifcopenshell/util/doc.py
2022-11-03 17:13:56 +11:00
Gorgious56 20198bccdb Numerical Attribute validation callback (#2562)
* Numerical attributes can now be clamped

* #2545 : IfcMaterialLayer Priority is now clamped between 0 and 100

* Run black
2022-11-03 14:41:47 +11:00
Andrej730 c0909dace0 black.py formatting 2022-11-02 17:35:51 +06:00
Andrej730 bd054d4baf Added more advanced stair generating operator 2022-11-02 17:31:27 +06:00
Dion Moult 35a70a4ae3 Fix #2559. Don't consider door and window styles in IFC4X3. 2022-11-02 17:31:10 +11:00
Dion Moult a1d30d157b Minor fix. 2022-11-02 17:27:18 +11:00
Kristoffer Andersen 621d89c80e Update ci-ifcopenshell-conda-daily.yml
Bump GA versions away from deprecated versions
2022-11-01 20:58:59 +01:00
Gorgious 2fa3793622 Selecting an ifc predefined type in addition to the ifc class in the object ifc class selector now correctly assigns it 2022-11-01 17:34:29 +01:00
Kristoffer Andersen 872c057c4f bump conda daily to python v 3.10 and 3.11 2022-11-01 16:16:28 +01:00
Kristoffer Andersen f6a530e5e3 remove cap on boost version 2022-11-01 15:17:32 +01:00
Dion Moult 2043a629c7 Material profile sets UI cleanup and now lets you choose from a profile in your library instead of creating new profiles on the fly all the time 2022-11-01 23:39:07 +11:00
Kristoffer Andersen a7f9d548cf fix: add conditional #include <windows.h> for certain files breaking … (#2558)
* fix: add conditional #include <windows.h> for certain files breaking with boost v1.78+

* Revert "fix: add conditional #include <windows.h> for certain files breaking with boost v1.78+"

This reverts commit 7cd5c6292b.

* fix: add only `BOOST_REGEX_NO_W32` to fix issues boost v1.78+
2022-11-01 13:30:07 +01:00
Dion Moult 1391dd38ec Update README.md 2022-11-01 13:29:20 +01:00
Dion Moult 38f6b7aca0 Clean up README
This new proposed readme makes it more obvious to readers that there is a large collection of tools available, a brief glance of what they do, and directs users to the dedicated websites and documentation for further instructions on installation and so on.
2022-11-01 13:29:20 +01:00
Dion Moult f0e4397ef9 Change PyPI package readme. See #2531. 2022-11-01 09:08:13 +11:00
Dion Moult 6b7ffc8ca6 Merge pull request #2544 from Gorgious56/Tooltips
Blenderbim : Implement tooltips and online docs in the interface
2022-11-01 08:46:51 +11:00
Gorgious 5458f4f9dd Slightly optimise the display of the description popup 2022-10-31 22:22:46 +01:00
Gorgious 0c3269d9e1 Revert "Squashed commit of the following:"
This reverts commit f07cf1d1ef.
2022-10-31 19:53:19 +01:00
Gorgious 84dde4c5c0 Property set templates attributes now show a tooltip on hover 2022-10-31 19:34:59 +01:00
Gorgious 7eefb3f62f Pset nominal values now show their description on right click 2022-10-31 19:09:58 +01:00
Gorgious 90369bf7f7 Directly use predefined type doc function instead of wrapper 2022-10-31 18:10:03 +01:00
Gorgious eff3318399 Directly use attribute doc functions instead of wrapper 2022-10-31 18:01:59 +01:00
Gorgious ee59d366dc Directly use entity doc functions instead of wrappers 2022-10-31 17:57:24 +01:00
Gorgious c0b91848a3 Refactor right click context menu 2022-10-31 17:30:33 +01:00
Gorgious d05d430642 Directly use pset doc functions instead of wrapped ones 2022-10-31 17:30:18 +01:00
Gorgious e8a73e008e Pset types and template types enums now show tooltips on hover 2022-10-31 17:15:58 +01:00
Thomas Krijnen 259bb4f36a Let's try #2551 2022-10-31 13:39:01 +01:00
Dion Moult b87191a358 Forgot to commit new profile import export in model tool 2022-10-31 22:34:48 +11:00
Gorgious a359230181 Actually fix #2553 : Add safeguard to unregister custom right click context menu 2022-10-31 11:29:04 +01:00
Gorgious a95e12c0b2 Pset enums now display a tooltip on hover 2022-10-31 11:09:31 +01:00
Gorgious 2ac27c6fdd Add additional line to the ifc description popup to display the attribute type 2022-10-31 10:43:50 +01:00
Gorgious 757578a74b Fix error fetching the description of a nameless attribute 2022-10-31 10:34:18 +01:00
Gorgious 3466a38a44 Removed hardcoded descriptions thanks to 937f39c 2022-10-31 10:32:49 +01:00
Gorgious f07cf1d1ef Squashed commit of the following:
commit 7fb4cdaa16
Author: Gorgious <nathan.hild@gmail.com>
Date:   Mon Oct 31 09:35:06 2022 +0100

    Fix #2546 : Editing a material now automatically ends the edition of its material set item if necessary

commit 427411e758
Author: Dion Moult <dion@thinkmoult.com>
Date:   Mon Oct 31 19:04:57 2022 +1100

    You can now edit arbitrary profiles in the profile manager

commit cc056d5d53
Author: Gorgious <nathan.hild@gmail.com>
Date:   Mon Oct 31 08:52:11 2022 +0100

    Fix #2553 : Right click documentation is now only available for Blender 3.3+
    Also fix an error in the console when right clicking a button

commit 31600033bf
Author: ArturTomczak <artomczak@gmail.com>
Date:   Sun Oct 30 23:16:08 2022 +0100

    add BCF reporter to IDS (#2552)

    * grammar

    * reason not always a list

    * extend readme with instruction

    * remove microseconds from date

    * add BCF reporter

commit 0338825175
Author: Dion Moult <dion@thinkmoult.com>
Date:   Sun Oct 30 23:26:59 2022 +1100

    You can now add new profile definitions in the profile manager

commit d9f8aa4e7b
Author: Andrej730 <azhilenkov@gmail.com>
Date:   Sun Oct 30 11:29:42 2022 +0600

    Added ifc types schema for Ifc2x3 and Ifc4

    Types schema located in separate json file, it's structure:
    { ifc_type_name: {"description": type_description, "spec_url": type_spec_url} }

    I've also added new API function to get type data - `get_type_doc(version, ifc_type)`

commit 6803788676
Author: Dion Moult <dion@thinkmoult.com>
Date:   Sun Oct 30 11:02:18 2022 +1100

    Load thumbnails in a paginated manner to allow to scale to larger models

commit d421cc0bbb
Author: Massimo Fabbro <79401028+maxfb87@users.noreply.github.com>
Date:   Sun Oct 30 00:07:56 2022 +0200

    No mapped quantities in qto calculator  has None value (#2549)

commit bf57c8b1bf
Author: Dion Moult <dion@thinkmoult.com>
Date:   Sat Oct 29 23:45:04 2022 +1100

    Refactor profile module to use data class

commit 9a25db6584
Author: Andrej730 <azhilenkov@gmail.com>
Date:   Sat Oct 29 18:31:40 2022 +0600

    get_attribute_doc get_entity_doc now use recursive method by default

commit 17ccd0adf7
Author: Andrej730 <azhilenkov@gmail.com>
Date:   Sat Oct 29 18:27:51 2022 +0600

    Simplified getting entity parent information for schema api

    Removed unnecssary parent information from json schema - now API is getting it from ifcopenshell schema.

commit 937f39c898
Author: Andrej730 <azhilenkov@gmail.com>
Date:   Sat Oct 29 17:35:43 2022 +0600

    Added information about parent entity to schema

    Added information about parent entity to schema (it's located in "parent_entity" entity parameter inside schema), both for Ifc2x3 and Ifc4.

    Modified get_entity_doc and get_attribute_doc - now you can use additional optional parameter `recursive=True` with those functions - then parent entities attributes will be included to the list of entity's attributes. For example IfcWindow will also have attributes from IfcBuildingElement, IfcElement, IfcProduct etc...

commit 0b5ccd88a5
Author: Andrej730 <azhilenkov@gmail.com>
Date:   Sat Oct 29 16:31:54 2022 +0600

    Added descriptions for psets and qsets to ifc2x3, ifc4 schema

    Example of getting pset description: `get_property_set_doc("IFC4", "Pset_ZoneCommon")['description']`

commit ebf3cd8909
Author: Andrej730 <azhilenkov@gmail.com>
Date:   Sat Oct 29 10:32:26 2022 +0600

    Added IFC libraries for AU and EU profiles

    Also added script that was used to generate those libraries (the script is using data from https://github.com/boltsparts/BOLTS).

    Types of steel profiles included:
    I profiles, Z profiles, C profiles (known as U profiles in IFC), L profiles (both equal and unequal), hollow profiles (circle, square and rectangular).

commit 08afec3461
Author: Dion Moult <dion@thinkmoult.com>
Date:   Fri Oct 28 22:32:15 2022 +1100

    Support material layer set usage negative direction sense for parametric walls

commit 4408a23873
Author: Dion Moult <dion@thinkmoult.com>
Date:   Fri Oct 28 22:30:43 2022 +1100

    Merge duplicate types IfcPatch recipe can now merge based on any attribute
2022-10-31 09:51:05 +01:00
Gorgious 7fb4cdaa16 Fix #2546 : Editing a material now automatically ends the edition of its material set item if necessary 2022-10-31 09:35:06 +01:00
Dion Moult 427411e758 You can now edit arbitrary profiles in the profile manager 2022-10-31 19:05:04 +11:00
Gorgious cc056d5d53 Fix #2553 : Right click documentation is now only available for Blender 3.3+
Also fix an error in the console when right clicking a button
2022-10-31 08:52:11 +01:00
ArturTomczak 31600033bf add BCF reporter to IDS (#2552)
* grammar

* reason not always a list

* extend readme with instruction

* remove microseconds from date

* add BCF reporter
2022-10-31 09:16:08 +11:00
Dion Moult 0338825175 You can now add new profile definitions in the profile manager 2022-10-30 23:27:11 +11:00
Andrej730 d9f8aa4e7b Added ifc types schema for Ifc2x3 and Ifc4
Types schema located in separate json file, it's structure:
{ ifc_type_name: {"description": type_description, "spec_url": type_spec_url} }

I've also added new API function to get type data - `get_type_doc(version, ifc_type)`
2022-10-30 11:33:20 +06:00
Dion Moult 6803788676 Load thumbnails in a paginated manner to allow to scale to larger models 2022-10-30 11:02:31 +11:00
Massimo Fabbro d421cc0bbb No mapped quantities in qto calculator has None value (#2549) 2022-10-30 09:07:56 +11:00
Dion Moult bf57c8b1bf Refactor profile module to use data class 2022-10-29 23:45:12 +11:00
Andrej730 9a25db6584 get_attribute_doc get_entity_doc now use recursive method by default 2022-10-29 18:31:40 +06:00
Andrej730 17ccd0adf7 Simplified getting entity parent information for schema api
Removed unnecssary parent information from json schema - now API is getting it from ifcopenshell schema.
2022-10-29 18:27:51 +06:00
Andrej730 937f39c898 Added information about parent entity to schema
Added information about parent entity to schema (it's located in "parent_entity" entity parameter inside schema), both for Ifc2x3 and Ifc4.

Modified get_entity_doc and get_attribute_doc - now you can use additional optional parameter `recursive=True` with those functions - then parent entities attributes will be included to the list of entity's attributes. For example IfcWindow will also have attributes from IfcBuildingElement, IfcElement, IfcProduct etc...
2022-10-29 17:35:43 +06:00
Andrej730 0b5ccd88a5 Added descriptions for psets and qsets to ifc2x3, ifc4 schema
Example of getting pset description: `get_property_set_doc("IFC4", "Pset_ZoneCommon")['description']`
2022-10-29 16:31:54 +06:00
Andrej730 ebf3cd8909 Added IFC libraries for AU and EU profiles
Also added script that was used to generate those libraries (the script is using data from https://github.com/boltsparts/BOLTS).

Types of steel profiles included:
I profiles, Z profiles, C profiles (known as U profiles in IFC), L profiles (both equal and unequal), hollow profiles (circle, square and rectangular).
2022-10-29 10:32:26 +06:00
Gorgious56 d9b1c26bf0 Fix bug when prop_with_search is used with a prop that is not an enum 2022-10-28 16:50:11 +02:00
Gorgious56 490da99792 Pset primary measure type should now display a tooltip on hover
Awaiting for ifc measure descriptions to be added to the docs
2022-10-28 16:32:17 +02:00
Gorgious56 528df00027 Organization and person now show a tooltip on hover 2022-10-28 16:30:04 +02:00
Gorgious56 bc10f934d6 Add tooltips to attributes to guide users to their description 2022-10-28 15:46:02 +02:00
Gorgious56 819db11db4 Simplify attribute description 2022-10-28 15:44:31 +02:00
Gorgious56 37a0854d40 Material set profile attributes now show a description on right click
+ added link to docs to Material set profile attributes and Material set item
2022-10-28 14:39:36 +02:00
Gorgious56 b984268b5d parameterized profile classes now shot a tooltip on hover 2022-10-28 14:34:57 +02:00
Gorgious56 e4d2ae185d Fix bug when an entity doesn't have any predefined type to fetch in the docs 2022-10-28 14:26:08 +02:00
Gorgious56 345098b4af Fix bug when attribute enum items descriptions are not filled in 2022-10-28 13:51:52 +02:00
Gorgious56 98b517954f Material layer set item attributes now show a description on right click 2022-10-28 13:47:42 +02:00
Gorgious56 dba8d2df9d Fix bug when right clicking an operator button in the interface 2022-10-28 13:43:41 +02:00
Gorgious56 6756ba7022 Ifc profile classes enum now shows a tooltip on hover 2022-10-28 13:42:51 +02:00
Dion Moult 08afec3461 Support material layer set usage negative direction sense for parametric walls 2022-10-28 22:32:15 +11:00
Dion Moult 4408a23873 Merge duplicate types IfcPatch recipe can now merge based on any attribute 2022-10-28 22:30:57 +11:00
Gorgious56 c33b5aa4b7 Extract attribute description fetching 2022-10-28 12:08:28 +02:00
Gorgious56 0ebbc62a06 Add popup window when clicking Ifc description in right click context menu 2022-10-28 11:54:07 +02:00
Gorgious56 0494373155 Store Ifc class in attribute
This shouldn't be necessary ? but it's easier for now
2022-10-28 11:53:23 +02:00
Gorgious56 c897cb3ea0 Show descriptions for attributes in right click context menu
This is hacky, looking for a solution to get tooltips on hover over field
2022-10-28 11:10:12 +02:00
Gorgious56 f38e8f26f5 You can now access property sets online documentation through the right click context menu 2022-10-28 09:07:33 +02:00
Gorgious56 7164103a80 Search button now only displays when an enum has more than 10 items
To reduce visual clutter for enums with only a few values
Also tweak the online docs ui function
2022-10-28 08:33:56 +02:00
Gorgious56 5fb7f33fb0 You can now access the ifc classes online docs from the right click context menu
+ Remove the ugly buttons in the interface
2022-10-28 08:19:35 +02:00
Gorgious56 e602f16ed3 Add description to more ifc entities enums
- Constraint type
- Material type
- ObjectMaterial type
- Actor class and type
- Structural load type and boundary condition type
- Style type
- System type
- Relating type
- Unit type
2022-10-27 17:19:24 +02:00
Gorgious56 17a872a8d8 Use new get_predefined_type_doc function #1982 2022-10-27 16:00:12 +02:00
Dion Moult 4533b74d65 Minor IfcTester fixes 2022-10-27 23:37:01 +11:00
Dion Moult 62229b032e You can now array IFC elements parametrically 2022-10-27 23:36:09 +11:00
Andrej730 f2c2fa8dce Added entities predefined types to schema
Both for ifc2x3 and ifc4 but there is still a problem with ifc2x3 predefined types description - it's empty since constants have no description in ifc2x3. For temporary solution I've used description available on ifc4 for ifc2x3 too.

I've also added API function to get entity's predefined type description: `get_predefined_type_doc(version, entity, predefined_type)`

Example for the same constant that has no description in ifc2x3 and has one in ifc4:
https://github.com/buildingSMART/IFC/blob/Ifc2.3.0.1/Constants/s/STEAMINJECTION_1b6zZZM99EevT2LVdQ7B%24V.xml
https://github.com/buildingSMART/IFC/blob/Ifc4.0.2.1/Constants/s/STEAMINJECTION_1b6zZZM99EevT2LVdQ7B$V.xml
2022-10-27 16:23:46 +06:00
Dion Moult ae170bbfac Fix #2541. Forgot that wall body must be based off the axis reference line. 2022-10-27 19:08:37 +11:00
Dion Moult 706b925f4c FM documents now use the identification as the key, and refer to the doc info instead of doc reference 2022-10-27 09:46:11 +11:00
Dion Moult 65288eac04 Minor fix. See #2533. 2022-10-27 09:45:28 +11:00
Massimo Fabbro bf5a9bdac6 Start quantity calculator implementation (related to #2533) (#2534)
* Start quantity calculator implementation

* Fix get qto_name
2022-10-26 23:51:52 +11:00
Dion Moult e22ebfbf94 Fix #2523. Extrusion depth now reflects perpendicular depth 2022-10-26 22:24:18 +11:00
Dion Moult fb2989c17f Fix #2528. Setting x angle on slabs now only affects the X euler angle 2022-10-26 18:11:54 +11:00
Dion Moult ffbf6483b5 You can now disconnect a wall from a roof clipping 2022-10-26 17:53:20 +11:00
Dion Moult 5c5488fa49 You can now clip walls by sloped slabs / roofs. 2022-10-25 23:13:44 +11:00
Dion Moult 7ff1b8a34d New API for connecting and disconnecting elements 2022-10-25 17:54:24 +11:00
Dion Moult fb786bb90c Batch reassignments now take advantage of inverse indices for a slight speedup. See #2408. 2022-10-25 16:27:13 +11:00
Dion Moult fad80eacaf Bump IOS 2022-10-25 14:03:25 +11:00
Gorgious56 84020c9832 Type Manager : Add search to ifc class and descriptions to class an predefined type enums 2022-10-24 15:20:52 +02:00
Dion Moult 59bce590cc Fix #2529. Bulk copying decomposed elements to multiple storeys now maintains decomposition. 2022-10-24 22:57:23 +11:00
Dion Moult a7ae78ec2a Fix crash when deleting opening. See #2529. 2022-10-24 21:49:44 +11:00
Dion Moult 523a97329e Fix door appearing on wrong RL when not on ground floor. See #2529. 2022-10-24 20:34:09 +11:00
Dion Moult 248dab936d Experimental reimplementation of reloading an updated IFC 2022-10-24 13:36:50 +11:00
Dion Moult a908fa62ba Loading model elements is now half aware of existing elements and will reuse where possible. 2022-10-24 13:07:45 +11:00
Dion Moult 2f7643424d IfcDiff now uses the iterator to compare geometry, which seems significantly faster. 2022-10-24 13:06:03 +11:00
Dion Moult 226c94381b IfcDiff now supports file objects as inputs instead of filepaths 2022-10-23 23:33:52 +11:00
Dion Moult 548a2972bc You can now add new profileset based types easily in the type manager. 2022-10-23 21:17:52 +11:00
Dion Moult 6263110733 You can now add layerset types in the type manager and access the manager on blank projects. 2022-10-23 20:02:34 +11:00
Dion Moult 89e8bf1ed6 You can now add new mesh based types in the type manager 2022-10-23 18:15:33 +11:00
Dion Moult 3809b5a34b You can now create new empty types, and select type objects from the type manager 2022-10-23 16:53:09 +11:00
Ryan Schultz 3cda25773d Maintaining the MaterialLayer thickness when X_Angle is used (#2525) 2022-10-23 15:35:17 +11:00
Ryan Schultz 77f2ad8f68 'X angle' rotates ifcslab/ifcramp in space. (#2522)
* 'X angle' rotates ifcslab/ifcramp in space.

* rotation w/ mathutils.Matrix.Rotation instead
per https://github.com/IfcOpenShell/IfcOpenShell/pull/2522#issuecomment-1287969832
2022-10-23 15:32:31 +11:00
Dion Moult 733b89be12 Link to C++ API reference from Python Sphinx docs 2022-10-23 12:15:11 +11:00
Thomas Krijnen 6346c5ba47 #1444 V3d_DirectionalLight compatibility fix 2022-10-22 20:30:13 +02:00
Thomas Krijnen dbb342d494 Small changes to code_examples.rst 2022-10-21 09:25:55 +02:00
Massimo Fabbro cb0ad67bcc Fixed errors and little improvement 2022-10-21 09:17:40 +02:00
Massimo Fabbro f0266a16a3 Little improve about code example doc and geometry setting doc 2022-10-21 09:17:40 +02:00
Thomas Krijnen cdde536651 Test cases for #2486 and #2517 2022-10-20 20:31:56 +02:00
Thomas Krijnen c1aca6ba8c #2517 Don't free parsed simple types as part of parent entity, but at file destruction 2022-10-20 20:30:48 +02:00
Thomas Krijnen f9391f80c4 #2408 test case 2022-10-20 13:36:00 +02:00
Thomas Krijnen f012286eda #2408 ifcopenshell.file.get_inverse(with_attribute_indices) 2022-10-20 13:35:02 +02:00
Dion Moult 45087e8822 The BIM Tool now provides similar slab-like editing tools for ramps and roofs 2022-10-20 20:51:32 +11:00
Dion Moult 8fa944d2a8 You can now have sloped slabs, good for doing roof slabs. 2022-10-20 19:56:15 +11:00
Dion Moult 67955b4e35 Batch reassign utility to address performance issues in #2408. 2022-10-20 18:25:14 +11:00
Dion Moult 9a0f29170a Fix #2518. Don't fail on non-existent schemas to allow for custom schemas 2022-10-20 15:03:33 +11:00
Dion Moult d09286eeca Schema migrator now supports IfcElectricDistributionPoint 2022-10-20 14:52:39 +11:00
Gorgious56 89f64eacef Remove info mode and streamline entity url fetching 2022-10-19 18:42:05 +02:00
Gorgious56 3334ea5c10 Fix error when toggling viewport annotations if there is no active camera in the current scene 2022-10-19 16:13:53 +02:00
Dion Moult 16b05d9981 Fix support for document references in IFC2X3 2022-10-19 20:17:10 +11:00
Thomas Krijnen 7f278fbde4 Import submodule explicitly 2022-10-19 10:44:29 +02:00
Dion Moult 2cad62554e Fix #2510. 2022-10-19 18:54:42 +11:00
Boris Brangeon 83bd0a973c Add function grouped_by in Selector (#2515) 2022-10-19 18:49:06 +11:00
Boris Brangeon b2c5153c1c Add IsGroupedBy in function get_decomposition (#2513)
* Add IsGroupedBy in function get_decomposition

selector example : "@ .IfcZone & .IfcSpace"

* Update element.py

* Change name function get_group

get_group to get_grouped_by
2022-10-19 18:48:55 +11:00
Dion Moult ec955ca717 You can now draw walls at a set RL 2022-10-19 17:54:25 +11:00
Dion Moult 9c28a95f41 Fix #2416. 2022-10-19 12:44:55 +11:00
Dion Moult 80020970e1 Purge old dynamic void system as Blender booleans are not sufficient. 2022-10-19 12:32:02 +11:00
Dion Moult f55b47dcb3 Include sample file generator in IfcTester doc generator 2022-10-19 11:54:30 +11:00
Dion Moult 7197db796c Fix #2508 2022-10-19 09:48:05 +11:00
Dion Moult a5aa970977 Add support for normalised ratio diffuse colours. See #2509. 2022-10-19 09:37:22 +11:00
Dion Moult 159e2ca779 Run black and minor fix. See #1990. 2022-10-19 09:17:37 +11:00
Gorgious56 ec1fbabd00 Dynamic Attribute Info (#1990)
* Add info mode toggle in addon prefs

* Add documentation property to Attribute

* Add webbrowser open operator

* Populate attribute doc on import

* Add attribute doc popup operator

* use path_resolve instead of eval

* Rename operator

* Add description field

* Panel UI is managed by operator

* Revert "Panel UI is managed by operator"

This reverts commit a7bbd06865.

* Revert "Revert "Panel UI is managed by operator""

This reverts commit d62115bf63.

* Add info popup to ifc class panel in object properties

* Implement fetching doc for non-ifc classes from jsonlike format

* Draw doc from non ifc classes

* Add utility function to draw info button on a given layout

* Add info buttons in the create project UI

* Display entity descriptions as tooltips in enum items

* Move predefined types fetching to data class

* Remove leftover prop code

* Use tool to get schema
2022-10-19 08:17:31 +11:00
Dion Moult b70bf5ed33 Cute developer function to spit out a debug object to help when coding. 2022-10-18 23:11:37 +11:00
Dion Moult d6be887bde Minor IfcTester test case fixes 2022-10-18 23:11:11 +11:00
Dion Moult 6098d94223 Fix #2507. 2022-10-18 22:47:42 +11:00
Dion Moult f045e86a38 Rebuild wall engine (again) to allow for sloped wall clippings. 2022-10-18 20:02:00 +11:00
Dion Moult 9ef65c9cc5 Add basic support for sloped walls, sloping along the local X axis 2022-10-17 22:52:44 +11:00
Ryan Schultz f8a8250429 searching for an IfcMaterial in IfcMaterialDefinitions (#2503)
* searching for an IfcMaterial in IfcMaterialDefinitions
A start to trying to address: https://community.osarch.org/discussion/comment/13024/#Comment_13024

* refactored to a tighter version. Thanks Thomas.
2022-10-17 20:24:05 +11:00
Dion Moult a75341b36e Fix #2505. Missing rotate button in UI. 2022-10-17 20:11:37 +11:00
Dion Moult 0a0271a30e Filled openings can now be based off a custom profile representation 2022-10-17 18:34:34 +11:00
Andrej730 871f6ebdf1 Updated windows batch script for setting up environment for blenderbim
Previous batch scripts was resulting in broken sym links (probably because mklink and some other comands were expecting full paths). New script provide required full paths and also use 1 line to set up blenderbim location.
2022-10-17 12:19:53 +06:00
Dion Moult 90f1a179bc You can now flip the direction of doors and windows 2022-10-16 23:50:00 +11:00
Andrej730 81d80ee415 Doc API is now accessible without setting up DocAPI class
Now you can access Doc API functions directly (like `ifcopenshell.util.doc.get_entity_doc(...)`) without setting up DocAPI class.
To make it work I've set up singleton DocDatabase class and made all paths relative to module location.
2022-10-16 16:54:05 +06:00
Dion Moult 1eeb820d26 Flipping walls with fillings now works. See #2491. 2022-10-16 21:05:05 +11:00
Andrej730 4dc860c019 Added IFC v4.0 json schema and added docs API for working with schemas
The schema for IFC4 the same as it was for IFC2x3.
Properties schema for IFC4 includes both quantity and propety sets.

Also cleaned up entities description for IFC2x3 from HTML code and IFC tags.
2022-10-16 13:32:22 +06:00
Dion Moult cb28a0b298 Flipping walls with openings now works. See #2491. 2022-10-16 17:58:06 +11:00
Dion Moult 76e6923a3e Filled openings now handle offset wall axes 2022-10-16 10:16:10 +11:00
Dion Moult 56a09e51bd Modeling dimensions now affect newly created walls and profiles 2022-10-15 22:53:19 +11:00
Dion Moult b90ab70658 Modeling dimensions now have sensible defaults depending on units and show prior to element creation 2022-10-15 11:06:21 +11:00
Andrej730 28aab490df IFC v2.3 json schema and parsing tool to regenerate it (#2501)
* IFC v2.3 json schema and parsing tool to regenerate it

Added entities and propeties schema in json format.

ifc2x3_entities.json format:
entity_name -> description, url, attributes;
attributes format: attribute_name -> attribute_descrption

ifc2x3_properties.json format:
property_set_name -> property_name -> description, children
children format: child_property_name -> child_property_description.

Also added doc.py script that can generate the same json schema files but requires docs IFC 2.3 docs in the same folder (https://github.com/buildingSMART/IFC/tree/Ifc2.3.0.1)

* Moved all json schema files to /util/schema

* Moved json files back to /util/, changed doc.py export location

* Added specification urls for entities and properties

Added specification urls for entities and properties.
Also added a function to parse actual property sets domain from the website to generate specification urls (domain on website and on github do not match).

Schema structure was changed:

ifc2x3_entities.json format:
entity_name -> description, spec_url, attributes;
attributes format: attribute_name -> attribute_descrption

ifc2x3_properties.json format:
property_set_name -> properties, spec_url
properties format: property_name -> description, children_properties
children_properties format: child_property_name -> child_property_description.

ifc2x3_property_sets_domains.json format:
property_set_name -> ifc_domain
2022-10-15 07:14:34 +11:00
Thomas Krijnen 0810fa7564 Escape \W in selector grammar 2022-10-14 11:30:11 +02:00
Dion Moult a34c0cb35c Fix a variety of IFC validation errors in entity creation and asset appending 2022-10-14 18:19:35 +11:00
fbpyr 10bde73c1a choco nightly path (#2498)
* fix choco nightly scripts path

* fix choco nightly scripts path
2022-10-14 17:16:50 +11:00
Massimo Fabbro 670399f327 Add gross volume calculation (#2487)
* Now gross volume calculation doesn't consider related voids

* Qto gross volume calculation minor fixes

* No need to create a new entity and better mesh creation

* Use bmesh to calculate volume so it's not necessary to create a new object
2022-10-14 16:50:04 +11:00
Dion Moult 241c5b1f48 Fix bug where unnamed types didn't show up in the UI. 2022-10-14 10:08:52 +11:00
Dion Moult 9ef3b4389b Change pip name to ifcopenshell. See #2468. 2022-10-14 08:25:15 +11:00
Dion Moult 2d37d3c914 More robust type switching of parametric objects 2022-10-13 22:51:06 +11:00
Thomas Krijnen ede9c5fca5 Fixes to svgfill/cgal/mpfr/gmp for -shared build on nix 2022-10-13 09:52:22 +02:00
Thomas Krijnen 4cccfd08d3 #671 check for zero magnitude vector in newells method 2022-10-13 09:34:14 +02:00
Thomas Krijnen 153c5a06e7 #671 use new faceset_helper api in IfcFace 2022-10-13 09:22:49 +02:00
Thomas Krijnen 9a4d3e706a #671 api in faceset_helper to obtain multiple bounds from single loop in case of intersections 2022-10-13 09:22:28 +02:00
Thomas Krijnen 0b20d3ae2c #671 correct check for NO_WIRE_INTERSECTION_CHECK setting 2022-10-13 09:21:50 +02:00
Thomas Krijnen 92fb46558f #671 perform fix on wires after wire_intersections() 2022-10-13 09:20:44 +02:00
Dion Moult 8be1a913ec Basic support for mesh booleans 2022-10-13 17:04:53 +11:00
Dion Moult c354de7b83 Minor fix 2022-10-13 11:50:33 +11:00
Dion Moult 19b718cdf5 Thumbnails auto load when projects are loaded. 2022-10-13 10:19:09 +11:00
Dion Moult cdffeba4cc Map units are now supported in converting to and from local to global coordinates 2022-10-12 20:32:16 +11:00
fbpyr e6e8db8a00 choco yesterday (#2495)
* fix check for available bbim releases yesterday

* fix check yesterday bbim releases after midnight

* fix check all releases url
2022-10-12 17:39:50 +11:00
Thomas Krijnen 8dab1810c7 #2486 #1861 Don't fail on overwriting header values 2022-10-11 10:48:53 +02:00
Dion Moult c5c9a192b0 You can now duplicate existing types in the type manager 2022-10-11 17:51:01 +11:00
Dion Moult 4279576d3c Type manager can now browse to type classes that don't have any types yet 2022-10-11 17:34:17 +11:00
Dion Moult dff35c173d You can now delete a type when managing types 2022-10-11 15:31:31 +11:00
Dion Moult 38f563d4f4 New timerless thumbnailed type manager. 2022-10-11 13:49:46 +11:00
Dion Moult 36fdd3f7fc Bundle pillow as dependency for thumbnail generator 2022-10-11 10:54:08 +11:00
fbpyr 47e0ec43c2 fix get sha256sum directly from release download (#2493) 2022-10-11 09:40:00 +11:00
Thomas Krijnen 0446fca56a --json --spf option in validate.py 2022-10-10 14:25:45 +02:00
Thomas Krijnen 785dc2a300 Test case for string formatting 2022-10-10 14:20:21 +02:00
Thomas Krijnen 64ff046e96 #2482 Use u32string for character encoder, remove CODECVT_BOOST_FALLBACK 2022-10-10 14:19:42 +02:00
Dion Moult 16582cf57f Experimental new thumbnail with smarter layer / profile thumbnails and no timers. 2022-10-10 23:13:37 +11:00
Dion Moult a5517071cc Make remove opening more accessible in UI and refactor 2022-10-10 11:45:50 +11:00
Gorgious 5d5ab3dafd Fix bad indenting in last commit
Sorry, I'm a bit rusty !
2022-10-09 22:05:56 +02:00
Gorgious ccfbeab51e Creating a wall with a IfcMaterialLayerSet with the BIM tool now makes it active (yellow outline)
+ deduplicate code under new function
2022-10-09 22:04:01 +02:00
Dion Moult c9214bf04a The BIM Tool workspace now intelligently reflects the active object 2022-10-09 23:51:40 +11:00
Dion Moult 492a535312 You can now set a fixed RL for inserted windows 2022-10-09 23:29:06 +11:00
Dion Moult 278931f5db Minor fix 2022-10-09 22:40:20 +11:00
Dion Moult d847f358ba Minor fix 2022-10-09 22:26:38 +11:00
Dion Moult ab31fd7e48 Copying filled openings is now possible. 2022-10-09 22:25:55 +11:00
Dion Moult 32f0911479 Elements with filled openings don't have their openings copied, as it depends on the fill 2022-10-09 22:22:12 +11:00
Dion Moult bdbd874fa8 Fix #2488. Copying objects now copy deep instead of adding afresh (and losing parametric data and openings). 2022-10-09 18:09:22 +11:00
Dion Moult 232252f61d Copy deep can now exclude things, useful for copying representation graphs where you don't want to duplicate the context 2022-10-09 17:15:39 +11:00
Dion Moult 3ee4b1f0e3 Fix #2489. Prevent openings from being added twice and only save changed openings. 2022-10-09 15:22:10 +11:00
Thomas Krijnen cd27d48701 #2482 entity_instance.to_string() 2022-10-08 17:18:47 +02:00
Thomas Krijnen 94ba1a121d #2486 store provenance to file also in simple type instances 2022-10-08 15:16:53 +02:00
Dion Moult 4110b81270 Decomposition mode now selects all children (not parenting) to move a host and all children easily 2022-10-08 23:42:03 +11:00
Dion Moult 37028857b4 Suspicious undo stack fix 2022-10-08 22:29:13 +11:00
Dion Moult 7c1f02cafe You can now reinsert windows and doors into other hosts 2022-10-08 22:28:46 +11:00
Dion Moult 7d779130e1 Removing products now handles purging a bunch more inverse relationships 2022-10-08 21:15:01 +11:00
fbpyr fb6d24b3ed add choco alpha version tag, description fixes (#2484) 2022-10-07 22:14:04 +11:00
Dion Moult c6ee1d1679 Deleting a fill auto deletes the opening 2022-10-07 20:55:46 +11:00
Dion Moult 1db5d3b06c Begin purging old dynamic void feature 2022-10-07 20:47:13 +11:00
garylzimmer 3b81c158f3 Added auto renaming for null project name (#2478)
Sorry it took me almost a year to implement @aothms excellent suggestion!
https://github.com/IfcOpenShell/IfcOpenShell/issues/1954#issuecomment-1002463624
2022-10-07 20:36:25 +11:00
Dion Moult 34aff01eb2 New prototype operator to regen fill openings 2022-10-07 17:06:19 +11:00
Dion Moult 7d1a41c1c7 Minor fix 2022-10-07 16:08:21 +11:00
Dion Moult d187c588d3 Minor fix 2022-10-07 16:04:06 +11:00
Dion Moult 82f847f5d4 Basic adding of filled openings reimplemented with new opening system 2022-10-07 16:00:17 +11:00
Dion Moult 27dc81544c Minor fixes to IfcTester testcases 2022-10-07 13:34:19 +11:00
Dion Moult 1677a6c83f IfcTester now supports new entityType data in partof facet 2022-10-07 13:11:52 +11:00
Dion Moult 61f4c48a4a Write docs for basic description of what's in an IFC 2022-10-06 21:07:58 +11:00
Dion Moult 0259b75d4c Write documentation for IOS code examples 2022-10-06 19:56:53 +11:00
Dion Moult 0db28917a4 Write docs on IOS geometry processing. See #671. 2022-10-06 17:06:37 +11:00
Dion Moult 15b4ab543b Update geom settings with newly added settings, and add example code. See #671. 2022-10-06 15:52:12 +11:00
Dion Moult 72147e51f5 Migrate old Doxygen geom markdown to new Sphinx rst docs. See #671 2022-10-06 11:18:23 +11:00
Sigma Dimensions 835e3f00b4 fix the bug fix on commit #88893a8 2022-10-05 13:59:41 +01:00
Thomas Krijnen 2dee2afdfa #1861 test case 2022-10-05 13:07:16 +02:00
Thomas Krijnen 3d82791a99 #1861 update globalid map on attribute change 2022-10-05 13:03:52 +02:00
Dion Moult 2cb8eebf83 Profiles now retain manual booleans alongside autogenerated clipping planes 2022-10-05 21:52:07 +11:00
Dion Moult 49d3ee2f73 Copying an opening now tracks it as a special objects in the scene 2022-10-05 20:04:19 +11:00
Dion Moult aeaef641bf Bump IOS build 2022-10-05 19:52:24 +11:00
Dion Moult e97d427e9f Copying elements with openings now also copies openings 2022-10-05 19:44:32 +11:00
Dion Moult d525dfa46f Deleting voided objects now works with new opening system 2022-10-05 18:22:35 +11:00
Dion Moult 272a00941e Openings now move with profiles, but stay fixed along the local Z axis 2022-10-05 17:57:51 +11:00
Dion Moult 1590e8c0e7 Openings locations are fixed relative to slab profile editing 2022-10-05 16:39:10 +11:00
Dion Moult ac4e2f142b Openings now move with the host, but also intuitively stay along the local X axis of the host 2022-10-05 15:26:27 +11:00
Dion Moult 428ee648b4 Wall representations now distinguish between auto and manual booleans and manual booleans move with the wall 2022-10-05 13:09:18 +11:00
Thomas Krijnen fa6bbf2d4a A bunch of not so pretty validate.py performance improvements 2022-10-04 15:16:34 +02:00
Dion Moult 12aa66fdcb Fix nasty bug related to inconsistent behaviour of wall intersection math 2022-10-05 00:14:12 +11:00
Thomas Krijnen f68db3d3be Fixes after 698c708bf6 2022-10-04 12:38:40 +02:00
Dion Moult 1f56b36bfa Minor fix 2022-10-04 20:16:36 +11:00
Thomas Krijnen be805a3e96 Fixes after 698c708bf6 2022-10-04 11:14:13 +02:00
Thomas Krijnen 5d95475970 #2471 test case 2022-10-04 10:23:27 +02:00
Thomas Krijnen f41ad0d5de #2471 work around file gc with instance refs 2022-10-04 10:23:08 +02:00
Dion Moult f81b22240c Minor fix 2022-10-04 18:35:01 +11:00
Dion Moult 7d63b03dd3 Fix bug where linking an element twice caused stacked undos to fail. See #2200. 2022-10-04 14:23:02 +11:00
Dion Moult e74eb0cc53 Fix bug where unlinking operations were not stored in the undo stack 2022-10-04 13:41:27 +11:00
Dion Moult 008d6bed5c PIP publish now only happens once a month, on a full moon 2022-10-04 10:41:25 +11:00
Dion Moult d0985a23d0 Fix critical bug where default context was not set on project load 2022-10-04 10:03:59 +11:00
Massimo Fabbro a5d49e81a0 Fix little bug in qto_calculator about net footprint area (#2470) 2022-10-04 09:59:50 +11:00
Dion Moult bfcc086aad Attempt to change PyPI name to ifcopenshell 2022-10-03 23:40:29 +11:00
Dion Moult 0eae3de6a2 Openings now move with the host by default. Small change, big impact. 2022-10-03 23:30:19 +11:00
Thomas Krijnen 1d39413717 Test cases for previous commits 2022-10-03 14:29:41 +02:00
Thomas Krijnen c57e5e2100 Capture lower level errors in validate.py reported in C++ 2022-10-03 14:19:29 +02:00
Thomas Krijnen ca5249a179 More resiliance against wrong attribute counts 2022-10-03 14:05:08 +02:00
Thomas Krijnen 698c708bf6 Reduce heap allocations during parse by reusing vector for top level instances 2022-10-03 14:04:42 +02:00
Thomas Krijnen 084151ed4c Augment invalid entity message with offset in file 2022-10-03 14:03:53 +02:00
Thomas Krijnen c56c7288e3 Clarify wrong attribute count message 2022-10-03 14:03:04 +02:00
Thomas Krijnen f5398c77d5 Clarify invalid entity message 2022-10-03 14:02:28 +02:00
Thomas Krijnen a724b5cb24 Clarify character offset in exception 2022-10-03 14:02:04 +02:00
Thomas Krijnen f3a15953b2 Missing include 2022-10-03 14:01:43 +02:00
Dion Moult 567548c7f3 Fix bug where adding an opening didn't create a relative placement 2022-10-03 22:35:53 +11:00
Dion Moult 8c25349b49 Add new opening functions to BIM tool workspace UI 2022-10-03 20:50:33 +11:00
Amoki 49cd966d43 remove-yacc 2022-10-03 11:16:42 +02:00
Dion Moult b552ea1376 Openings now can be explicitly edited and saved and use IOS instead of Blender modifiers 2022-10-03 01:02:08 +11:00
Dion Moult 9c91ee31e5 New booleans UI panel to manage representation boolean stack 2022-10-02 23:48:19 +11:00
Carlos Villagrasa e9a063ccbd Construction Types Browser - Multipreview now runs smoothly (#2463)
* Construction types multipreview now runs smoothly

* Minor fix

* Minor fix
2022-10-02 16:46:14 +11:00
Dion Moult e4e9db0b3e Implement show and hide openings and hide booleans operator 2022-10-01 23:45:49 +10:00
Dion Moult 2ec41bf3a0 Add support for processing rectangular profiles in the profile editor 2022-10-01 23:27:05 +10:00
Dion Moult 944cbeea1a Handle both 2D and 3D placement matrixes in IfcOpenShell utils 2022-10-01 23:25:34 +10:00
Dion Moult 4b8238a602 Openings are no longer loaded when loading fresh IFC projects 2022-10-01 20:32:40 +10:00
Dion Moult 8789a19f57 Basic show and remove representation boolean operators 2022-10-01 20:31:46 +10:00
Kristoffer Andersen 8c8e83d98f update ci-daily build use win2019 for upload 2022-10-01 10:04:24 +02:00
Dion Moult 527d26c1c6 Openings are now specially shaded, and you can now add half space clipping booleans
# Conflicts:
#	src/blenderbim/blenderbim/bim/module/model/ui.py
2022-10-01 14:33:33 +10:00
Massimo Fabbro e2a5b09d77 Add calculate all qtos button: initial fixing (#2456) 2022-10-01 10:55:42 +10:00
Kristoffer Andersen 98b6edf119 Merge pull request #2461 from Krande/fix-daily-conda-build
fix: daily builds of conda ifcopenshell
2022-09-30 19:42:34 +02:00
Carlos Villagrasa 0a05197d3e Construction Types Browser: Solution to most of the current issues (#2460)
* Delay asset generation

* bpy.app.is_job_running only in Blender >= 3.3

* First time preview on sidebar works again

* Avoid flickering

* Show multiple previews on the first run

* Preserve mouse position with hacky operator
2022-10-01 02:01:26 +10:00
krande 75645a837a fix: daily builds of conda
Ran into a lot of `build not compiled for windows` errors on windows. So using the host and dependencies from conda-forge meta.yaml and pin boost-cpp to <=1.74 to at least allow windows builds of ifcopenshell to be created while we figure out how to support boost-cpp >=1.78
2022-09-30 17:49:55 +02:00
Thomas Krijnen 40e463a55f #2457 uplift curves to wires in geometric sets 2022-09-30 13:59:31 +02:00
Dion Moult 7b817f7359 Minor fix 2022-09-30 18:53:14 +10:00
Dion Moult 22e69a606d CAD sketcher constraints can now be saved and loaded from IFC 2022-09-30 16:04:16 +10:00
Dion Moult 8c7b2ab2a1 Slab depth auto-updates on type/layer changes with new slab system 2022-09-30 13:43:23 +10:00
Dion Moult 3512a2ce36 Add undo support to profile and wall element operators 2022-09-30 13:08:39 +10:00
Dion Moult 9e76b2b9eb Footprints are now supported in the new profile editor 2022-09-30 13:00:40 +10:00
Dion Moult a08a78b3c9 Slabs are now first created directly in IFC instead of reverse engineering meshes 2022-09-30 12:08:57 +10:00
Dion Moult 9fc5f72831 Minor fix 2022-09-29 23:51:25 +10:00
Dion Moult 391e09c16c Convenience operator to draw rectangles when editing profiles 2022-09-29 23:31:11 +10:00
Dion Moult 60e4de5ffa You can now align the view to the edited profile, for angled profiles 2022-09-29 22:33:32 +10:00
Vukas Pajic a248f16cf8 indentation 2022-09-29 14:30:25 +02:00
Vukas Pajic 9240a10fa8 no need for Shapely.libs when using macos 2022-09-29 14:25:42 +02:00
Vukas Pajic 19d3208744 add Shapely.libs 2022-09-29 14:08:24 +02:00
Vukas Pajic c080567f53 update makefile for shapely dependancy (#2452)
* initial

* unzip instead of tar

Co-authored-by: Dion Moult <dion@thinkmoult.com>
2022-09-29 22:01:54 +10:00
Dion Moult ac72f41051 You can now change the radius of existing arcs. Minor interface cleanup. 2022-09-29 17:24:00 +10:00
Dion Moult fc9273c1d3 You can now change the radius of existing circles. Radius settings are remembered. 2022-09-29 16:47:40 +10:00
Dion Moult 43dc2da05f Minor fix 2022-09-29 15:43:19 +10:00
Dion Moult 121190c9b9 Vertex group indices in repeated operations do crazy stuff. This is more robust. 2022-09-29 15:41:06 +10:00
Dion Moult 0f2f6e2721 More robust arcindex generation and let user specify radius for circles 2022-09-29 11:41:52 +10:00
Carlos Villagrasa 05070c3758 Construction Types - Attempt to solve repeated object creation (#2450)
* Constr types dicts to Blender props

* Reduce update interval

* Base for not linking dummy asset objects to collections
2022-09-29 10:00:39 +10:00
Dion Moult d4d923e51b New feature to fillet profiles with true arcs 2022-09-28 23:35:29 +10:00
Dion Moult 766ffa71cd Operator to clear parametric vertices when editing profile 2022-09-28 23:04:07 +10:00
Dion Moult cbf213952b Minor fix 2022-09-28 22:45:03 +10:00
Vukas Pajic b7c76048ab comment out tests 2022-09-28 14:24:17 +02:00
Kristoffer Andersen 20fdb09a0c Update meta.yaml
Do not force boost version 1.80.0. It fails horribly
2022-09-28 14:21:47 +02:00
Vukas Pajic 1943d59339 Add additional quantity calculations to QtoCalculator (#2405) 2022-09-28 14:20:10 +02:00
Dion Moult d2836e07d5 Minor fix 2022-09-28 22:18:54 +10:00
Dion Moult 90a788082d New 2D CAD offset operator 2022-09-28 21:07:28 +10:00
Kristoffer Andersen eafad2862f Update meta.yaml
test using boost 1.80.0
2022-09-28 09:21:39 +02:00
Dion Moult 1c0fa13f39 Fix CAD arc bug where sometimes arc went the wrong way, and now auto-clean verts when creating arc 2022-09-28 11:02:49 +10:00
Carlos Villagrasa 2e5ce6b862 Fix bim tool crash (#2446)
* Attempt to wait for assets (triggers infinite loop)

* Using timer instead of sleep

* remove sleep import

* Reduce asset update interval

Co-authored-by: Dion Moult <dion@thinkmoult.com>
2022-09-28 09:30:52 +10:00
Ryan Schultz f63a33647b relocate remove drawing button per https://community.osarch.org/discussion/comment/12744/#Comment_12744 (#2444)
* added 3"=1'-0" scale (a common scale), and corrected 6"=1'-0" scale

* relocate remove drawing button per
https://community.osarch.org/discussion/comment/12744/#Comment_12744
2022-09-28 01:54:11 +10:00
Carlos Villagrasa 2f84c188f5 Fix bim tool crash (#2445)
* Attempt to wait for assets (triggers infinite loop)

* Using timer instead of sleep

* remove sleep import
2022-09-28 01:31:59 +10:00
Dion Moult 01b1b57f71 Mitre joints now auto merge and are accessible in the new profile editor 2022-09-27 23:35:40 +10:00
Dion Moult 1ad0ef82d4 Fix bug where CAD filleting sometimes led to crashes 2022-09-27 23:34:08 +10:00
Dion Moult 23212003e9 Add support for circles in profile editing 2022-09-27 17:16:26 +10:00
Dion Moult aff281d00b Add unit support in new profile editing tool 2022-09-26 22:40:33 +10:00
Dion Moult 4bbcf3fa1e Set and unset 3-point arcs only for profiles 2022-09-26 22:06:11 +10:00
Dion Moult 5e50a15b41 New smart profile editor for extruded elements inspired by CAD Sketcher 2022-09-26 18:00:05 +10:00
Massimo Fabbro b673fc94a5 Add calculate all qtos button (#2441)
* Add button to calculate all object qtos in qto n-panel

* Calculate all qtos button: now the schema is readed from the file

* Calculate all qtos button: now edit_qto runs only one time every object

* Add button to assign pset qto to selected objects

* Calculate all qtos button: small fixing and unable to execute if no selected objects

* Calculate all qtos button: first tool test

* Calculate all qtos button: use better built-in function to get ifc obj entity
2022-09-26 16:05:08 +10:00
Dion Moult 4c7a5e8a1a Experimental CAD Sketcher integration for simple arbitary polyline extrusions 2022-09-25 12:27:10 +10:00
Dion Moult 33ebcd7664 New convenient modifier to rotate beam/wall/column etc by 90 degrees 2022-09-24 21:46:32 +10:00
Dion Moult 76ce726f1d Implement refresh profiles on type and profile changes 2022-09-24 20:19:01 +10:00
Ryan Schultz 54da579891 Ifc text tweaks (#2431)
* added 3"=1'-0" scale (a common scale), and corrected 6"=1'-0" scale

* Allow float point values in smart tags, and avoid breaking when no assigned product See #2340, #2349
2022-09-24 20:07:32 +10:00
Dion Moult e024e9e622 You can now set cardinal point on creation and bulk change for profile elements 2022-09-24 16:21:20 +10:00
Dion Moult 56f4b72161 Reimplement profile cardinal points 1-9 with new profile engine 2022-09-24 15:42:50 +10:00
Dion Moult 7545313dee Removing an element now also purges connection relationships 2022-09-24 14:12:45 +10:00
Dion Moult 48eb6b70e3 You can now manually set the length/height of profiled extrusions 2022-09-23 23:53:12 +10:00
Dion Moult 5f2acb43b1 You can now recalculate connections manually for profiles 2022-09-23 23:41:37 +10:00
Dion Moult b7eaefee50 Fix bug when deleting elements may possibly create an invalid containment relationship 2022-09-23 23:26:29 +10:00
Dion Moult 13a387cc73 Add support for descriptions in path connection relationships 2022-09-23 23:00:27 +10:00
Dion Moult f139f2ba1e Fix bug where removing an element in an aggregation could leave the file in an invalid state 2022-09-23 23:00:07 +10:00
Dion Moult 1d8085f6c9 New profile engine now supports mitred profile joints. 2022-09-23 19:23:22 +10:00
Dion Moult 6699bfeb54 Mitred wall joints rebuilt on the new wall engine 2022-09-23 15:42:05 +10:00
Dion Moult 7cee0a85c6 3D axis representation contexts are now created by default for all new projects 2022-09-23 12:39:23 +10:00
Dion Moult 351dcfa241 Implement profile unjoin and start cleaning up legacy architectural tools panel 2022-09-23 12:38:49 +10:00
Dion Moult 28022581a7 You can now have connection aware L joints for profiled elements 2022-09-23 00:09:56 +10:00
Dion Moult 748aaa671d Extending profiled elements (e.g. beams and columns) now supports axis connectivity and uses new profile engine 2022-09-22 23:32:22 +10:00
Thomas Krijnen 95b474c37d Delete HdfSerializer.h~ 2022-09-22 13:13:57 +02:00
Thomas Krijnen 9bb9f91f57 Delete HdfSerializer.cpp~ 2022-09-22 13:13:47 +02:00
Dion Moult 7db967583b Profile extensions now use the new engine and support 3D axis representations 2022-09-22 16:05:35 +10:00
Dion Moult 5d43f6db37 Adding a profile now uses the new profile engine 2022-09-21 23:28:03 +10:00
Dion Moult 4cfa327159 New API functions for adding arbitrary profile and profile-based representations 2022-09-21 23:27:24 +10:00
Dion Moult 920177d8c6 Minor fix. See #2416. 2022-09-21 10:50:02 +10:00
Dion Moult 5f902600e3 Minor fix. See #2416 2022-09-21 00:04:02 +10:00
Dion Moult db9af13843 Fix #2427. Don't treat missing mandatory attributes as fatal in IFC version migration 2022-09-20 22:46:15 +10:00
Thomas Krijnen dd49c092c6 #2419 remove map erasure from destructor
de initialization order can result in map already destroyed when unique_ptr schemas are still being deleted
2022-09-20 11:35:08 +02:00
Thomas Krijnen d347a7f893 Don't run choco from other repos 2022-09-20 11:33:07 +02:00
Dion Moult 3c61804e8b Flipping walls now preserves connections, and flips around the reference axis 2022-09-20 17:21:11 +10:00
Dion Moult e179070978 New interface to show, select, and remove path connections 2022-09-20 16:25:52 +10:00
Dion Moult de2ada1141 Walls recalculate on type and layer thickness changes 2022-09-20 14:05:04 +10:00
Dion Moult eb48a68dd1 Copying elements do not copy connections to prevent mutually exclusive connectivity 2022-09-20 12:01:40 +10:00
Dion Moult fc6bf5e2bb You can now set an exact wall length 2022-09-20 10:48:44 +10:00
Dion Moult 3f2d86255d Merge projects now merges all entities, not just rooted ones. 2022-09-19 23:44:10 +10:00
Dion Moult d751ee9995 Fix critical typo in rendering styles creation that led to invisible styles 2022-09-19 23:10:56 +10:00
Dion Moult 83f70624a4 Attempt to get LXML working across all platforms. See #2422. 2022-09-19 22:23:09 +10:00
Dion Moult 356253c4f0 Minor fix 2022-09-19 21:40:53 +10:00
Dion Moult a459c39c97 Minor fix 2022-09-19 17:36:20 +10:00
Dion Moult e5719bd3c6 You can now change wall heights in bulk 2022-09-19 16:29:43 +10:00
Dion Moult 18387e7732 You can now switch contexts of of objects in bulk 2022-09-19 15:59:37 +10:00
Dion Moult 57e8e47061 Minor regression fix 2022-09-19 13:33:40 +10:00
Dion Moult 5c5bb03652 IfcPatch now allows passing in IFC objects instead of filepath strings 2022-09-19 13:31:33 +10:00
Dion Moult ea1d797605 Add documentation for IfcPatch 2022-09-19 12:25:35 +10:00
Dion Moult bc3bf07a60 Minor fix to 12DToRevitTINS patch 2022-09-19 10:49:03 +10:00
Dion Moult fbd4177d08 New feature to merge aligned walls and retain parametric connections 2022-09-19 09:12:42 +10:00
Thomas Krijnen 4842891fd7 #2322 Implement IfcSweptDiskSolidPolygonal.FilletRadius 2022-09-18 15:59:24 +02:00
Dion Moult f6056f9bc3 Shift-Y in the BIM tool for walls now regenerates wall connections 2022-09-18 23:26:18 +10:00
Dion Moult c7af6c4482 Fix #2420. Bug where project library assets sharing relationships with other assets would pull in other assets 2022-09-18 23:19:23 +10:00
Dion Moult c9c905fd3e Splitting walls now uses the new wall engine 2022-09-18 22:00:27 +10:00
Dion Moult 7f76488869 New recalculate wall operator to manually trigger an update of all wall connections 2022-09-18 15:57:07 +10:00
Dion Moult cd930d809a New wall engine slowly being wired up to wall join hotkeys 2022-09-18 15:56:23 +10:00
Dion Moult f49d7ec2cb Implement unjoin in new wall engine 2022-09-18 15:54:24 +10:00
Dion Moult 322abdff53 Minor fix 2022-09-17 22:19:49 +10:00
Dion Moult 984978bc00 Add axis support to new wall engine 2022-09-17 21:52:03 +10:00
Dion Moult ce8da8bd85 An axis context is now added by default for all new projects 2022-09-17 21:41:09 +10:00
Dion Moult 6d0fdb32c6 Fix #2416. 2022-09-17 14:51:50 +10:00
Dion Moult 0cb3c0a907 Update docs about new Apple M1 support 2022-09-16 22:29:04 +10:00
Dion Moult d9ea62a670 Distribute Apple M1 to PyPi 2022-09-16 22:21:58 +10:00
Dion Moult 2228104a8e Apple M1 builds. This stuff never works the first time. 2022-09-16 21:48:38 +10:00
Dion Moult e473574086 Setup BlenderBIM Apple M1 builds. Fingers crossed! 2022-09-16 20:30:33 +10:00
Dion Moult f93604d6b7 Implement connection aware wall L-joints 2022-09-16 18:30:57 +10:00
Dion Moult d106b0e017 Fix #2413. Bug where multiple tasks may accidentally override animation keyframes. 2022-09-16 11:53:25 +10:00
Dion Moult 90e35810d9 Prototype connection-aware wall extension and T-joints 2022-09-15 22:44:06 +10:00
Bruno Postle 4fb910fc44 wrapper is a bash script not a sh script 2022-09-15 07:42:00 +01:00
Dion Moult 280ce56431 Creating walls are more stable and now directly goes to the IFC representation instead of reverse engineering Blender meshes 2022-09-15 10:46:52 +10:00
Dion Moult 81e46b533b New API to directly create wall-like representations without Blender geometry 2022-09-15 10:44:43 +10:00
Dion Moult 171db4b241 Add support for connecting/disconnecting paths in API 2022-09-15 10:32:01 +10:00
Martin15135215 8fe9ddd599 Small Change
https://github.com/IfcOpenShell/IfcOpenShell/issues/2409#issuecomment-1246767831
2022-09-15 00:13:01 +10:00
Dirk Olbrich b299694ca0 doc: library flags for macos build 2022-09-14 15:19:53 +02:00
Dirk Olbrich ca76b77130 update doc for building on macOS 2022-09-14 15:19:53 +02:00
Thomas Krijnen e94a5c97df Merge remote-tracking branch 'remotes/origin/pr/1911' into v0.7.0 2022-09-14 14:57:27 +02:00
GisSpace df845653f3 fix IFC to xml - IFCGROUP in IFC cannot be found in xml #1154 2022-09-14 14:54:05 +02:00
Thomas Krijnen a3e499656c Don't log vertex counts in helper when they didn't change 2022-09-14 14:13:24 +02:00
Thomas Krijnen 79bb40092f Apparently --disable-static no longer works? 2022-09-14 10:57:08 +02:00
Thomas Krijnen 2c7a4ca880 Filter unsupported py versions on recent osx 2022-09-14 10:56:52 +02:00
Thomas Krijnen 6a4375cf54 Update build-all.py versions 2022-09-14 10:56:16 +02:00
Thomas Krijnen c74b79213b Remove asterisks before branch name 2022-09-14 10:55:32 +02:00
Ryan Schultz 806d147a85 A preference for locking grids upon import 2022-09-14 18:33:26 +10:00
Dion Moult 227b1391bd Clarify behaviour of funny characters and pattern matching on numbers 2022-09-14 10:15:19 +10:00
Bruno Postle 68e2bb1fa7 oops, correct version of wrapper that quotes special characters 2022-09-13 23:21:49 +10:00
Dion Moult fccc233f42 Merge pull request #2406 from brunopostle/desktop-files2
Configure blenderbim file associations and desktop icon
2022-09-13 23:06:04 +10:00
Bruno Postle 86785ab181 Configure blenderbim file associations and desktop icon 2022-09-13 13:57:13 +01:00
Dion Moult 3255053ac4 Implement all restrictions for IfcTester 2022-09-13 22:09:40 +10:00
Dion Moult 422cc4802c Implement optionality in IfcTester, and generate integration testcases 2022-09-13 19:50:51 +10:00
Dion Moult fc0b0ca188 Minor fix to ids.xsd 2022-09-13 19:44:36 +10:00
Dion Moult 3120b0c6e2 Add support for IfcTester and predefined properties 2022-09-12 23:03:50 +10:00
Dion Moult 91fac6d4bd Add IfcTester support and test cases for bounded, table, and reference props 2022-09-12 22:35:05 +10:00
Dion Moult c7c59d9496 IfcTester now supports list and enumerated properties 2022-09-12 21:34:06 +10:00
Dion Moult 73ac5d314b Complex properties and quantities are not supported in IDS 2022-09-12 20:10:25 +10:00
Dion Moult 3b2cbac9d1 Generate stable GlobalIds for IDS docs to prevent commit noise 2022-09-12 20:10:25 +10:00
Thomas Krijnen a63d6475b2 Keep moving schema agnostic code out of kernel 2022-09-12 10:34:11 +02:00
Thomas Krijnen 4cd0932d7d Fix to boolean utils, version detection, and behaviour on old versions 2022-09-12 10:34:11 +02:00
Dion Moult cb447fe902 IfcTester Add support for qto checks 2022-09-12 18:26:11 +10:00
Dion Moult 5ee4e2704d User can now explicitly choose the quantity type via the edit qto API 2022-09-12 18:05:13 +10:00
Dion Moult 5b5540494d Qtos now support being added to types and contexts (despite being rare) 2022-09-12 12:55:15 +10:00
Dion Moult 85e123fadb IfcTester now supports occurs attributes on facets 2022-09-12 11:51:03 +10:00
Dion Moult f745222d37 IfcTester now supports mandatory measures for properties 2022-09-12 11:21:47 +10:00
Sigma Dimensions 88893a8c2c BBIM - Fix cost item products not loading for 1st cost item created 2022-09-11 22:14:57 +01:00
Dion Moult eb8bf60e93 Fix #2398. Add support for IFC4X3 entities. 2022-09-11 22:17:41 +10:00
Dion Moult 319aada33b Fix #2388. 2022-09-11 22:14:11 +10:00
Dion Moult 77c9bf5bb6 Implement newly proposed IDS PartOf facet 2022-09-11 17:20:50 +10:00
Dion Moult e5e81c818e IfcTester now handles floating point precision checks 2022-09-10 23:31:21 +10:00
Dion Moult 7aad0fc119 Implement type casting for property checks in IDS, bump to IDS v0.9 2022-09-10 22:42:22 +10:00
Sigma Dimensions f7403e8eee BBIM - Feature to guess all quantities at once 2022-09-09 13:25:04 +01:00
Dion Moult e2df4f335d API now supports adding representations using the Sverchok geometry structure 2022-09-09 22:20:06 +10:00
Sigma Dimensions cbe944d030 BBIM - temp fix to refresh cost items products' quantities UI, when qto is edited 2022-09-09 11:43:28 +01:00
bosonprojets 87f0475b99 Quality - run black on api/sequence directory 2022-09-09 02:25:20 +01:00
bosonprojets 4689cc858a BBIM Feature to import resources data from CSV 2022-09-09 02:23:53 +01:00
bosonprojets 6d6b893db2 Core tests for Resource module 2022-09-09 02:18:08 +01:00
bosonprojets e2d4a3ae24 Refactor Resource module 2022-09-09 02:17:28 +01:00
Dion Moult e4c1f7518d Revert "Hiding all objects in the "Types" Collection "
This reverts commit 2c0ea75960.
2022-09-09 10:59:10 +10:00
Dion Moult 48f8c0e085 Merge pull request #2395 from IfcOpenShell/Hiding-all-objects-in-the-"Types"-Collection
Hiding all objects in the "Types" Collection
2022-09-09 10:56:26 +10:00
Ryan Schultz 2c0ea75960 Hiding all objects in the "Types" Collection
When all the objects in the "Types" collection are hidden, it makes it quicker to turn on, and isolate one type for viewing and/or toggling other types on to compare to.
2022-09-08 13:12:47 -05:00
Thomas Krijnen e643972669 #2390 Submodule 2022-09-08 13:54:17 +02:00
Dion Moult d7c4936255 New recipe to fix dense TINs from 12D loading properly in Revit 2022-09-08 16:36:12 +10:00
Sigma Dimensions 96d19952e9 Quality check - run black on api/resource 2022-09-08 03:15:41 +01:00
Sigma Dimensions 57caf6a31f IfcOpenShell API: Deep purge resources upon removal 2022-09-08 03:12:44 +01:00
Dion Moult 189fc6e1e4 Minor fix 2022-09-07 20:39:55 +10:00
Dion Moult 88117941c5 Fix #2387. Bundling for Blender makefile now works on Mac. Thanks dirkolbrich! 2022-09-07 20:26:44 +10:00
Dion Moult 0a6c8a4343 Write docs on creating a single object 2022-09-07 20:14:08 +10:00
Christian Martínez de la Rosa 5bfad88a75 [IfcConvert] Added IfcRelConnectsElements to xml export (#2197)
* [IfcConvert] Export tasks in the xml conversion

The exportion in the XML format exports in a new tag, named "tasks", all the tasks from the file with a hierarchy. Each task contains the IfcTaskTime object if it has it.

* [ifcConvert] Add related objects in tasks

* [IfcConvert] Added IsSuccessorFrom and IsPredecessorTo in xml task export

* Get IfcTasks from IfcWorkSchedule

* [IfcConver] Changed OperatesOn hierarchy level in xml task export

* Added task to property / quanty relationship

* [IfcConvert] Added calendars to xml output file

* [IfcConvert] Added Output objects in the XML file

* [IfcConvert] Fix crash when IfcWorkCalendar does not contain IfcWorkTime

* [IfcConvert] Added IfcWorkPlan to xml export

* [IfcConvert] Added IfcRelConnectsElements to xml export

* [IfcConvert] Added IfcRelConnectsElements to xml export

* [IfcConvert] Improved related and relating xml export
2022-09-05 14:58:22 +02:00
Dion Moult 72544419da External resource relationships are now also purged when removing classifications 2022-09-05 16:51:42 +10:00
Dion Moult d1baaa21e7 Update IfcFM to use actors, not contacts, support federated datasets, and be more true to spec 2022-09-05 12:41:06 +10:00
Dion Moult 5d9fc44a69 Fix #2374. Axis for walls should be in the 2D plan context. 2022-09-05 11:35:04 +10:00
Dion Moult 917344ee1d Fix bug where new instances may have a wrong Z coordinate 2022-09-05 11:13:31 +10:00
Dion Moult 68ef6458d7 Fix #2379. Regressions where context adding never had any tests and failed. 2022-09-05 11:13:31 +10:00
Sigma Dimensions 36576c8d40 IFC resources utility: batch import Resource Data from CSV 2022-09-05 01:51:53 +01:00
Sigma Dimensions b44a1cb2e2 Fix 4d import context 2022-09-05 01:46:19 +01:00
Thomas Krijnen 5c7cf4469f Compute meaningful hash and eq on simple type instances 2022-09-04 14:23:35 +02:00
Dion Moult 147216cb7b Revert "Fix bug where IFC data types were hashed as the same value in RecycleNonRootedElements IfcPatch recipe"
This reverts commit 3be8e4f1ce.
2022-09-04 22:22:54 +10:00
Dion Moult 62b1478af1 Merge pull request #2377 from Martin15135215/v0.7.0
From append methode to use numpy and ifcpatch bug
2022-09-04 20:13:51 +10:00
Dion Moult 0f0055b0f1 Merge branch 'v0.7.0' into v0.7.0 2022-09-04 20:13:38 +10:00
Dion Moult 3be8e4f1ce Fix bug where IFC data types were hashed as the same value in RecycleNonRootedElements IfcPatch recipe 2022-09-04 20:12:54 +10:00
Martin15135215 6aa4ca89fe Merge branch 'IfcOpenShell:v0.7.0' into v0.7.0 2022-09-04 09:22:58 +00:00
Dion Moult 5fb574cf5c Fix #1589. Saving beveled curves as rswept disk solids is now supported. 2022-09-04 17:46:34 +10:00
Dion Moult 85a502a038 Support multiple swept disk solids with equal radii as a native Blender object 2022-09-04 17:45:26 +10:00
Dion Moult a7c56e742b Fix UI bug where adding nested groups closed the UI 2022-09-04 11:17:55 +10:00
Martin15135215 f11f648630 From append methode to do with numpy 2022-09-04 10:25:02 +10:00
Martin15135215 74d1bd7e3e Added "or element.is_a('IfcPropertySingleValue')" 2022-09-03 19:19:02 +02:00
Martin15135215 248ac71215 From append methode to use numpy 2022-09-03 19:13:55 +02:00
Dion Moult af4cb22756 Fix bug where appended assets sometimes duplicated geometry contexts 2022-09-03 22:16:35 +10:00
Dion Moult 56393ef358 Fix #170. Add note about not mixing OpenCascade installations. 2022-09-03 20:16:33 +10:00
Dion Moult 5d4512033d Fix #2286. Classifications can now be added for cost items. 2022-09-03 17:11:14 +10:00
Dion Moult b9cb1ab012 Black 2022-09-03 15:34:52 +10:00
Dion Moult e34b737428 Fix #2304. You can now manage classifications for materials. Bulk classification now supported. 2022-09-03 15:33:52 +10:00
Dion Moult 557d3429eb Support bulk deletion of psets on selected objects 2022-09-03 14:32:39 +10:00
Dion Moult f9019a4007 Test non-rooted classifications in IDS 2022-09-03 11:54:12 +10:00
Dion Moult 0668eadc36 IDS doc generator now also generates a sample IDS file 2022-09-03 10:48:46 +10:00
Dion Moult fdfaf54698 Support resource level classifications in IfcOpenShell API 2022-09-02 18:23:49 +10:00
Dion Moult ffa3aae132 Fix UI bug where changing classification levels sometimes didn't display 2022-09-02 15:21:27 +10:00
Dion Moult 0293c133ab Fix #2364. Bug where classifications couldn't be added in IFC2X3. 2022-09-02 14:03:05 +10:00
Dion Moult f9db685753 Fix #2343. Pset template applicability is refreshed when you save your templates. 2022-09-01 18:25:00 +10:00
Dion Moult a800d1af7e Fix pset template UI bug where changing to another prop didn't cancel editing older props. Also add support for blank or falsey enums (e.g. a real of 0.0). 2022-09-01 18:06:33 +10:00
Dion Moult f2bd362f57 Fix bug where adding a pset template didn't auto refresh the UI to the newly added template 2022-09-01 18:06:33 +10:00
krande 87021ebbe7 fix: edit ci triggers for ifcopenshell.
Changes are made to the github actions workflow files to reduce unnecessary triggering of ifcopenshell compilation, testing and conda package building
2022-09-01 09:41:30 +02:00
Dion Moult 36f2ed6da6 Allow disabling undo on save
The transaction system does not scale on large scale or complex remove_deep deletions. So if you want to delete a mesh with many thousands of vertices, it becomes very, very slow. Unfortunately we cannot also clear Blender's undo history, so this advanced feature should be used carefully.

Tested:

 - deleting 250 average objects: 264s before, 246s after (6.8% faster)
 - deleting 1 object with 6,000 vertices: 5 minutes and counting (basically impractical) before, 11s after
2022-09-01 11:17:06 +10:00
Dion Moult a61c084f27 Minor fix 2022-09-01 10:17:45 +10:00
Dion Moult 6849bb8c17 OpenCascade is not practically optional for now 2022-09-01 09:07:40 +10:00
Dion Moult a26f60861e Add pip/docker install instructions 2022-09-01 09:05:06 +10:00
Thomas Krijnen 106b8fdd07 Update Dockerfile 2022-08-31 21:01:09 +02:00
Thomas Krijnen 87c6b06cfc Update CMakeLists.txt 2022-08-31 20:48:36 +02:00
Thomas Krijnen af4917efba Sync dockerfile libs with ci libs 2022-08-31 20:28:26 +02:00
Dion Moult 806b2e2714 Add PyPi badge and switch to Shields badge for Anaconda
See https://github.com/ContinuumIO/anaconda-issues/issues/10231
2022-08-31 18:15:33 +10:00
Dion Moult 4ae8e4c74b Rename PyPi package to ifcopenshell-python due to naming conflict 2022-08-31 17:18:18 +10:00
Dion Moult 8101ffe06a Try using existing PYPI_TOKEN as the ifcopenshell package name is blocked 2022-08-31 16:54:27 +10:00
Dion Moult f07b6e14b4 Second time lucky? 2022-08-31 16:06:07 +10:00
Dion Moult f2c31cc17d Add optimistic Github action to upload wheels to PyPi 2022-08-31 16:02:39 +10:00
Dion Moult 39a626edeb Super simple wheel creator for PyPi 2022-08-31 15:41:01 +10:00
Sigma Dimensions 02379c5110 BBIM - New Sequence Toolkit Panel & new feature to highlight tasks for current selected object 2022-08-31 02:26:01 +01:00
Sigma Dimensions 1e661c42fb BBIM Feature - expand and contract all tasks in a work schedule 2022-08-31 02:21:28 +01:00
Thomas Krijnen eb7e9bacbf Update README.md 2022-08-30 21:58:11 +02:00
Thomas Krijnen c38e608a7c Update README.md 2022-08-30 21:49:51 +02:00
Dion Moult 544ed696da Add install instructions for ArchLinux for IfcOpenShell/IfcConvert 2022-08-30 23:00:18 +10:00
Dion Moult 322e47c5b5 Add badges to readme 2022-08-30 22:57:54 +10:00
Dion Moult 3ee9e6f45c Remove mention of outdated 3DS max from install instructions 2022-08-30 22:27:09 +10:00
Thomas Krijnen 7df94a906d #2305 fix cone boolean op 2022-08-30 13:31:26 +02:00
Dion Moult af1a40c913 Fix bug where if an object placement was reused elsewhere a circular reference was created 2022-08-30 20:08:50 +10:00
Dion Moult 451512ddff #1812 Add batching support for remove_deep2 for faster removals 2022-08-30 20:08:03 +10:00
Dion Moult fbd33145e1 Fix #2360. Fix documentation on IfcConvert flags that also apply to STP. 2022-08-30 18:28:30 +10:00
Dion Moult 8b0b1699f6 Fix #2370. Asset preview code did not clean up after itself properly after generating objects. 2022-08-30 16:21:25 +10:00
Dion Moult 2e13ed77d8 Fix #2371. Bug where you couldn't edit psets of a hidden object. 2022-08-30 11:38:04 +10:00
Dion Moult 804c0f4a77 Partially write tests for sequence refactor 2022-08-30 11:08:26 +10:00
Sigma Dimensions 37dec500fd massive refactor of the sequence module 2022-08-29 21:55:37 +01:00
krande ac3eb6fbda Merge remote-tracking branch 'origin/v0.7.0' into v0.7.0 2022-08-29 14:03:26 +02:00
krande 6a0bc0cd91 feature: align conda daily builds of ifcopenshell feature-wise with IfcOpenBot builds 2022-08-29 14:02:51 +02:00
Sigma Dimensions 699c8bf6b6 fix path windows test-bim 2022-08-29 12:51:18 +01:00
Dion Moult 7806f989f3 Minor fix 2022-08-29 21:47:12 +10:00
Dion Moult a0ca387ae7 Minor fix 2022-08-29 21:34:29 +10:00
Dion Moult 2a716ec242 Minor fix 2022-08-29 17:28:44 +10:00
Dion Moult 93ab51fb5e Fix #1958 - document other useful Blender add-ons 2022-08-29 16:25:17 +10:00
Dion Moult 7c59fc0b83 Document installation and usage of IfcConvert 2022-08-29 13:04:37 +10:00
Dion Moult 819466a819 Port over compilation instructions to Sphinx 2022-08-29 11:40:38 +10:00
Dion Moult 33a8ba9834 Add install instructions for Conda / Chocolatey 2022-08-29 09:14:26 +10:00
Ryan Schultz 6ce86ae368 Closing the ends of a swept_disk_solid by default 2022-08-29 08:49:46 +10:00
luz paz 68bf7a08e0 BlenderBIM: typo fixes 2022-08-28 11:39:15 +10:00
luz paz 771ba4c337 Revert 3rd party code changes 2022-08-27 15:34:16 +02:00
luz paz 33199b4bb6 Fix various typos 2022-08-27 15:34:16 +02:00
krande 74d730f368 [fix] - conda-build - set explicit env python path in conda build script for unix 2022-08-26 14:19:41 +02:00
Dion Moult eb2a71bf48 Fix #2159. Disable JUnit in Behave in Blender due to Etree conflicts. 2022-08-26 13:40:34 +10:00
Dion Moult 4b4e2e1622 Improve instructions on how to run tests and set up a dev environment 2022-08-26 13:40:34 +10:00
Thomas Krijnen b5f4c8218d #2358 fix header entity parsing in case of too few fields 2022-08-24 11:57:06 +02:00
Christian Kimmig e3a22601d5 Set Position of extrusions with height = 0 2022-08-24 11:10:45 +02:00
Dion Moult f67856a2ae Minor fix 2022-08-24 10:13:30 +10:00
Dion Moult 6b71b32e63 Improve documentation for running tests 2022-08-24 09:54:15 +10:00
Dion Moult 60d99fe2fa Update dev install process docs and bump IfcOpenShell dep 2022-08-23 17:15:11 +10:00
Dion Moult 75e1786682 Purge IDS features from BIMTester as superseded by IfcTester 2022-08-23 16:37:15 +10:00
Dion Moult 9b3f964000 Fix #2060. Large lists of types in a library can now be filtered. 2022-08-23 13:26:38 +10:00
Dion Moult de6b578d9c Fix #1375. Spatial zones as non-hierarchical entities are now supported. 2022-08-22 17:31:44 +10:00
Dion Moult f50e790b11 Minor fix 2022-08-22 17:02:05 +10:00
Dion Moult 9821c3af67 Fix #2317 add graphical support for viewing and editing referenced structures 2022-08-22 13:52:12 +10:00
Dion Moult 0844d6f52e Fix #2354 - add support for selector queries for enumerated properties 2022-08-19 20:10:54 +10:00
Dion Moult 520e7653e4 #1375 #2317 add API support for referencing in spatial structures 2022-08-19 18:43:39 +10:00
Dion Moult 9512075506 Minor fix 2022-08-19 12:41:08 +10:00
Dion Moult bdd61713ea WIP refactor sequence module 2022-08-19 11:20:18 +10:00
Dion Moult 97cf1da4ff #2339 Read directly from raw data instead of using strings for IfcDiff output 2022-08-18 17:57:11 +10:00
Dion Moult 836a162d57 #2342 Support different IFC schema versions for obj2ifc 2022-08-18 17:15:39 +10:00
Dion Moult 09a6f56f47 #2319 Add documentation for IfcDiff 2022-08-18 16:12:10 +10:00
Ryan Schultz 35ce8c2848 Updated links to point to current branch 2022-08-17 16:12:35 -05:00
Dion Moult ae2fd67260 #2342 New Meshlab based OBJ2IFC converter 2022-08-17 14:33:48 +10:00
Dion Moult 9def041f27 You can now create multiple new IDSes side by side and close them 2022-08-16 17:14:54 +10:00
Dion Moult e9d86253ec Minor fixes to IfcTester 2022-08-16 11:52:01 +10:00
Dion Moult f95466ee0c IfcTester now integrated into BlenderBIM Add-on UI 2022-08-16 11:52:01 +10:00
Dion Moult e85f21ce7a Minor fix 2022-08-16 11:52:01 +10:00
Sigma Dimensions d3795c9836 Documentation for ifcopenshell.util.element 2022-08-15 19:40:51 +01:00
krande ab647b13d9 fix ci initializer to prevent accidentally triggering and add tagged release for conda-forge release 2022-08-15 16:59:32 +02:00
Kristoffer Andersen dcad4146b6 PR daily builds of ifcopenshell and upload to conda (#2132)
* WIP PR for daily builds of ifcopenshell

* fix indentation in yaml

* fix branch name

* test daily builds using minimum occt ==v7.5.3

* chore: WIP daily builds - add tests

* add test script bat/sh. Continue work in PR

* fix: add more packages to test requires

* fix: remove space in minimum version requirement of numpy

* use manually installed MacOSX SDK on github runner. Minor rewrite of dynamic/static zlib conditional for conda_build.

* fix MacOSX SDK address and made it platform conditional

* make tests pass

* try to skip ids tests for common icopenshell builds (caused failure on windows tests probably due to special character in filepath)

* add conditional upload and testing of all available platform versions on github actions

* fix wrong path to source files

* fix errors in tests

* remove test files and skip tests

* only do import of ifcopenshell as means of testing and rely on the successful completion of ci.yml as a triggering mechanism instead

* make conditional switch between original implementation of zlib suffix and new depending on conda packaging or not

* point to occt v0.7.6

* make conditional import of BRepAdaptor_HCompCurve

* try removing libxml2 include path

* minor changes

* Test nix builds

* Test nix builds using only a single python version (in order to limit cpu/memory usage)

* remove run check

* remove testing of nix builds

* Revert "Test nix builds using only a single python version (in order to limit cpu/memory usage)"

This reverts commit 22a552a9ac.

* Revert "ci-py-only test modification"

This reverts part of commit af1e832f

* update occt version to 7.6.2 in daily builds

* Revert "Test nix builds"

This reverts commit af1e832f81.

* Complete setups for local and cloud environments. And start by adding IfcPerson as a test case for the REST api communication

* Revert changing checkout version of MVD
2022-08-15 16:40:42 +02:00
Thomas Krijnen adb2883310 #2344 Disable /MP by default 2022-08-15 13:53:23 +02:00
Dion Moult 7867c71b6e Fix IFCTester handling of falsey properties 2022-08-11 16:38:44 +10:00
Gorgious a5b1a96dfd Revert hack to automatically close enum search popups
It was insta-closing for some users
2022-08-10 21:58:00 +02:00
Carlos Villagrasa 4e5503002a Construction Type Browser, polishing of 2nd iteration (#2336)
* Polish a bit the type browser UI

* Remove SELECT from type browser

* model and geometry module tests fixed

* Polishing of type authoring layout redesign

* Further polishing of type authoring layout
2022-08-10 21:23:13 +10:00
fbpyr fa8fc161da Choco action (#2335)
* check cron based trigger isolated

* check cron based trigger isolated

* fix args

* add scheduled choco build action

* revert to original

* fix action name

* fix action name

* remove apt install as required packages exist already in the container

* remove apt install as required packages exist already in the container
2022-08-10 21:22:26 +10:00
Dion Moult e4016313c4 IfcTester now supports HTML reports 2022-08-09 17:04:12 +10:00
Dion Moult 81fdfbacd0 OffsetObjectPlacements patch now allows 3D rotations, such as to fix wrong Z axis coming from software like Solidworks 2022-08-08 14:34:06 +10:00
Dion Moult 7c2c946b2f Fix bug in diff visualisation for non-rooted entities. Refactor diff UI to data class. 2022-08-05 10:59:07 +10:00
Dion Moult 5b34e08c37 #2321 Remove IDS from IfcOpenShell to prevent confusion as it is now refactored heavily and lives in ifctester 2022-08-05 09:29:01 +10:00
Vukas Pajic 0b16c07e3a return result when calling diff() 2022-08-04 16:45:10 +02:00
Vukas Pajic 0210131a56 enhance ui for ifc-diff 2022-08-04 16:44:22 +02:00
Vukas Pajic a44d7e997a typo 2022-08-04 10:25:30 +02:00
Vukas Pajic 1df8908689 fix commit mistake 2022-08-04 10:24:13 +02:00
Vukas Pajic f9daba9fba filter diff with IFCSelector 2022-08-04 10:04:06 +02:00
Vukas Pajic fd6f2f3fc4 Diff can be restricted by elements that match Selector query 2022-08-04 09:54:11 +02:00
Dion Moult a4d0378405 More IfcDiff optimisations (461s->247s), bump DeepDiff version, less false positives with more accurate number comparisons 2022-08-04 17:49:18 +10:00
Dion Moult 1629205c3f Some optimisations to IfcDiff for a 50% speed up (461s down to 300s on sample data) 2022-08-04 11:47:34 +10:00
befr d058f17c15 add logic to build blenderbim-nightly chocolatey package 2022-08-04 11:05:12 +10:00
Carlos Villagrasa bbb3b62b8a Construction Type Browser, 2nd iteration (#2334)
* Polish a bit the type browser UI

* Remove SELECT from type browser

* model and geometry module tests fixed

* Polishing of type authoring layout redesign
2022-08-04 11:04:40 +10:00
Dion Moult f9ef00fd45 WIP experimental layout for authoring tool with Carlos and Vukas 2022-08-03 19:03:47 +10:00
Dion Moult 709c530434 Fix bug where MergeDuplicateTypesByTag recipe would've left multiple IfcRelDefinesByType relationships which is no good 2022-08-03 17:33:23 +10:00
Dion Moult 0ee93294dd Fix bug where element types wouldn't load if a filter was applied 2022-08-03 17:11:56 +10:00
Dion Moult 73124dd597 Fix failing tests 2022-08-02 19:34:12 +10:00
Dion Moult 759e134e3b Check and correct for object mode in operator, not in poll, as operator may be called headlessly (e.g. in export function).
Note that after the operator has been refactored to use the core / tool design pattern, the poll code may return if necessary.
2022-08-02 19:34:12 +10:00
Dion Moult 1f11354188 Add support for adding non-library based classification references for IFC2X3 2022-08-02 19:34:12 +10:00
Vukas Pajic eaffb9d8c0 Remove outdated test in "search" 2022-08-02 10:53:02 +02:00
Vukas Pajic f297b1709d add search to pytest.ini 2022-08-02 10:52:13 +02:00
Carlos Villagrasa 1f637660d1 model and geometry module tests fixed 2022-08-02 18:13:31 +10:00
Carlos Villagrasa c349523ea9 Remove SELECT from type browser 2022-08-02 18:13:31 +10:00
Carlos Villagrasa 5cc11a170b Polish a bit the type browser UI 2022-08-02 18:13:31 +10:00
Dion Moult 21094c59d9 API now supports adding classifications by identifier instead of from a library 2022-08-02 10:10:02 +10:00
Vukas Pajic 8ca5dd747e Fix issues with updating groups 2022-08-01 18:32:19 +02:00
Dion Moult ffe9ac6614 Run black 2022-08-01 19:45:36 +10:00
Dion Moult d2083b9a3d Refactor: move UI code for construction types panel into UI file 2022-08-01 19:42:57 +10:00
Dion Moult 70d1ad59c2 Merge pull request #2315 from cvillagrasa/v0.7.0
Addition of Construction Type Browser
2022-08-01 18:42:09 +10:00
Carlos Villagrasa 53687e6b7c Merge branch 'IfcOpenShell:v0.7.0' into v0.7.0 2022-08-01 10:41:33 +02:00
Vukas Pajic 67993071a6 UIlist no longer closes after adding group to group 2022-08-01 10:32:05 +02:00
Vukas Pajic 29c98a5996 Support for nested IfcGroups 2022-08-01 10:16:27 +02:00
Dion Moult 5b5a4649c5 Fix #2310. Manually patch applicable class errors in official IFC pset templates. 2022-08-01 13:05:57 +10:00
Dion Moult d654110fc1 Support removing representations from IFC models that do not correctly follow the convention that mapped representations come from types 2022-08-01 11:23:35 +10:00
Carlos Villagrasa 735f308abd Merge branch 'IfcOpenShell:v0.7.0' into v0.7.0 2022-07-28 23:50:10 +02:00
Dion Moult f86f988d6e Fix #2318. Hotfix only. Needs proper code review. 2022-07-28 12:17:23 +10:00
Sigma Dimensions a1a684cd2b refactor BBIM Module Workplans (data loading) (Part 2of2) 2022-07-28 01:32:08 +01:00
Carlos Villagrasa 6180f5be33 Merge branch 'IfcOpenShell:v0.7.0' into v0.7.0 2022-07-27 08:37:39 +02:00
Carlos Villagrasa cd58b994dd Renaming AddConstrTypeInstance 2022-07-27 08:24:50 +02:00
Carlos Villagrasa 40854eb3d3 Renaming constr_type back to relating_type 2022-07-27 08:18:34 +02:00
Carlos Villagrasa 79453a6ae0 Renaming constr_class back to ifc_class 2022-07-27 08:11:52 +02:00
Bruno Postle eec4c23017 Transfer psets and style representations when appending a material 2022-07-27 09:53:22 +10:00
Sigma Dimensions beeba10b22 refactor BBIM sequence module - workplans (add, edit, delete) 2022-07-26 19:55:47 +01:00
Carlos Villagrasa 7a6005d0ea Merge branch 'IfcOpenShell:v0.7.0' into v0.7.0 2022-07-26 20:43:38 +02:00
Carlos Villagrasa 58150a296d Revert "Merge remote-tracking branch 'origin/master' into v0.7.0"
This reverts commit 14bca5d199, reversing
changes made to 7321138d57.
2022-07-26 20:20:29 +02:00
Dion Moult 7de454337d Minor fix 2022-07-26 10:33:40 +10:00
Carlos Villagrasa 3e25ef9222 Merge branch 'IfcOpenShell-v0.7.0' into v0.7.0 2022-07-26 01:39:49 +02:00
Carlos Villagrasa 9278e43d72 Merge branch 'v0.7.0' of https://github.com/IfcOpenShell/IfcOpenShell into IfcOpenShell-v0.7.0 2022-07-26 01:39:09 +02:00
Dion Moult fafdc76494 Minor fix 2022-07-26 09:30:04 +10:00
Carlos Villagrasa 99c47069cd Tests polished 2022-07-26 01:22:22 +02:00
Carlos Villagrasa cee48d7424 Some more renaming/refactoring 2022-07-26 01:21:51 +02:00
Ryan Schultz dc7062e182 fix broken links in Documentation 2022-07-25 14:55:37 -05:00
Vukas Pajic 5f6c584a58 fix error where prop name wasn't shown 2022-07-25 12:25:55 +02:00
Vukas Pajic 5f7630e527 added test for creating new ifcgroups 2022-07-25 11:13:15 +02:00
Gorgious 733e80737a Fix error messages when using the search operator on blank file (F3) 2022-07-23 15:03:26 +02:00
carlos 64752e52c9 Tuning feature tests 2022-07-23 00:39:17 +02:00
carlos 6c260ef5c9 Margins function for UILayouts 2022-07-23 00:38:26 +02:00
carlos e0e0572ff5 Minor renaming and bug fixing 2022-07-23 00:37:31 +02:00
Carlos Villagrasa a3942ee5e2 Merge branch 'IfcOpenShell:v0.7.0' into v0.7.0 2022-07-22 18:42:25 +02:00
Vukas Pajic 40d5a94e2d Added new test for Selector UI 2022-07-22 09:37:46 +02:00
Vukas Pajic f9fe1607ff load_query now closes automatically 2022-07-22 08:20:06 +02:00
Gorgious56 2a019e8090 Enum search popup now automatically closes on item selection
+ move close_operator_panel higher in hierarchy to access it
2022-07-21 17:50:43 +02:00
Gorgious56 901a582c6c Add tooltip to append library element operator 2022-07-21 16:57:31 +02:00
Vukas Pajic 29a4f78689 Integrate ifcgroups with selector 2022-07-21 16:10:10 +02:00
Vukas Pajic f1e0375b6a api: assign_group now expects product to be a list
* minor change to assign_group

* api: assign_group now expects product: list
2022-07-21 10:14:58 +02:00
Vukas Pajic 52e354d1b8 delete search.feature (not ready yet) 2022-07-21 09:31:54 +02:00
Vukas Pajic eef961a39e Merge branch 'v0.7.0' into v0.7.0 2022-07-21 08:37:44 +02:00
Vukas Pajic fcab5d445f test features 2022-07-21 08:20:25 +02:00
Dion Moult b534895ae3 Slightly more dodgy but more robust test dependency installation script 2022-07-21 15:44:11 +10:00
Vukas Pajic 5b76e83965 Selector: added new tests and improved UX
Selector: added tests to check non-standard characters and missing values
2022-07-21 07:37:48 +02:00
Dion Moult a21b73225a Fix #2296. Bug where material and profile psets couldn't be removed. 2022-07-21 15:12:00 +10:00
Dion Moult a11a4032f6 You can now audit and view basic results using the IfcTester webapp 2022-07-21 13:13:38 +10:00
carlos a09f864651 Fetch latest commits 2022-07-20 19:17:52 +02:00
Vukas Pajic 609fd35410 quality of life improvements :) 2022-07-20 14:54:03 +02:00
Vukas Pajic df0c136b6c users can now add selection to ifcgroup 2022-07-20 13:48:26 +02:00
Vukas Pajic ce6d4ea59a match elements when attribute is none and negation used 2022-07-20 09:33:58 +02:00
Vukas Pajic 29594b50b5 test when value does not exist 2022-07-20 09:06:04 +02:00
Vukas Pajic 2a2da56a0e added test to check non standard characters 2022-07-20 08:32:36 +02:00
Gorgious dd041478b3 Add utility method to retrieve dynamic enum items without needing a reference to the callback
This is useful because trying to directly access a dynamic enum with an empty items list throws an error in the console
+ Remove prop search from template_type in pset ui which has only 2 elements
2022-07-19 22:17:39 +02:00
Vukas Pajic 650e5b0cd3 Added UI for IFC Selector Tool
UI for IFC Selector tool
2022-07-19 14:54:39 +02:00
Vukas Pajic afa0db3c7e all tests in test_selector.py now passing 2022-07-19 14:51:48 +02:00
Gorgious56 b9f1f3438c Fix typo 2022-07-19 14:30:32 +02:00
Vukas Pajic 31f21dcb29 abstract away ui code from operator 2022-07-19 14:16:59 +02:00
Vukas Pajic 64a22fe5c6 further refinements 2022-07-19 13:55:20 +02:00
Dion Moult 3f85140d60 Continuing adding tests for the refactored property support 2022-07-19 20:38:53 +10:00
Gorgious56 1b1588359f Ifc class suggestion (#2290)
* You can now use suggestions in ifc class enum search popup

* Move data to data submodule

* Fix error when suggestion mapping contains only one value

* Add predefined types to the search popup

* Use defaultdict to be able to add suggestions later

* Support predefined types and format name to display the ifc class
and fix bug where the prop is not defined in the suggestion dictionary

* Move data retrieval to data module

* Simplify prop search items retrieval

* Support prop search for more enums
2022-07-19 10:19:58 +02:00
Vukas Pajic 4c562c1af0 turn ui into popup operator 2022-07-19 10:05:20 +02:00
Vukas Pajic a0fdb9f777 update according to review comments 2022-07-19 09:21:13 +02:00
Vukas Pajic 2c29f89fe9 Selector - update regex for pset filter 2022-07-19 09:19:32 +02:00
Dion Moult f4aac566d5 Handle cyclic task dependencies in schedule cascading and CPM analysis 2022-07-19 12:39:54 +10:00
Dion Moult 57521bd106 Whoops 2022-07-19 09:47:32 +10:00
Dion Moult 1413cf4f9d Fix bug when adding material sets to a non parametric object 2022-07-19 09:46:28 +10:00
Vukas Pajic 3fa74469f4 minor changes 2022-07-18 15:39:19 +02:00
Vukas Pajic e3d9dd747d draft
endofday 1207

240pm 14/07

draft version

cleanup
2022-07-18 15:11:27 +02:00
Vukas Pajic d71ebb8d25 fix typo 2022-07-18 14:44:13 +02:00
Vukas Pajic 0097d98669 fix #2289 2022-07-18 14:42:39 +02:00
Thomas Krijnen dd635340aa Retry schema macro rewriting 2022-07-18 13:51:45 +02:00
Thomas Krijnen 1b06cb8014 Retry schema macro rewriting 2022-07-18 13:04:21 +02:00
Thomas Krijnen 163e10b608 More schema macro rewriting 2022-07-18 11:57:02 +02:00
Thomas Krijnen dc67287d4b Correct extern function declaration names 2022-07-18 10:46:01 +02:00
Thomas Krijnen 73f959c45a Correct extern function declaration names 2022-07-18 10:08:46 +02:00
Thomas Krijnen 65e66352b7 CMake typo error 2022-07-18 09:31:12 +02:00
Thomas Krijnen 205ff0914c Respect tokens in macro string concatenation 2022-07-18 09:24:20 +02:00
Dion Moult 2e76a800f5 You can now download modified IDSes via the webapp 2022-07-18 14:06:29 +10:00
Dion Moult 1890bf4cb9 You can now load multiple Blends simultaneously when linking IFCs 2022-07-18 10:58:25 +10:00
Dion Moult 3fd472549e Fix bug where material categories don't exist in IFC2X3 2022-07-18 10:29:32 +10:00
Thomas Krijnen 28d15a6c9f Add IFC4x3 (https://standards.buildingsmart.org/IFC/RELEASE/IFC4_3/annex-a-express.html) 2022-07-17 21:45:07 +02:00
Thomas Krijnen 6026e037fa Update schema references 2022-07-17 21:13:46 +02:00
Vukas Pajic 0ca90817d8 Fix for Issue #2288 2022-07-17 10:08:24 +02:00
Dion Moult 3436f3e0bb Visualising diffs now show results from the actively loaded IFC 2022-07-16 11:53:08 +10:00
Dion Moult 71f0170966 IDS webapp with some basic read/write functionality 2022-07-15 15:58:39 +10:00
Dion Moult 97cd07226d Support JSON output for IDS results 2022-07-15 15:14:04 +10:00
Dion Moult 309ce20068 Added error sentences for IDS property facet results 2022-07-15 14:38:57 +10:00
Dion Moult 282c140c14 More aggressive refactoring for IfcTester to break up the monolithic codebase 2022-07-15 14:09:55 +10:00
Bruno Perdigão bdf46f9431 Update installation.rst
Minor correction
2022-07-15 12:42:19 +10:00
Dion Moult e79068854a Refactor IDS into IfcTester with less magic and less code
* String building code all deleted and replaced with more maintainable code
 * Obscure features like metaclasses deleted
 * Regular constructors used instead of factory create and parse methods
 * Use Python class naming convention
 * Use polymorphism more (e.g. asdict, init) for facet classes
 * No more boolean any/and as users may want to test everything and not fail early
 * Error state is stored instead of streamed to logger so it can be tested and more flexible formatting
2022-07-15 09:57:40 +10:00
carlos 7be93b5386 Add testing to construction type previews 2022-07-15 01:09:08 +02:00
carlos 1b4da58a15 Restore IFCFileSelector UI rendering 2022-07-14 13:59:47 +02:00
Carlos Villagrasa 356ce48af5 Merge branch 'IfcOpenShell:v0.7.0' into v0.7.0 2022-07-14 13:42:02 +02:00
carlos 3f24d54e8f Distinguish bt active and selected constr type + renaming ifc_class -> constr_type 2022-07-14 13:40:57 +02:00
Vukas Pajic 1586c85314 added option to import all library assets 2022-07-11 11:07:40 +02:00
carlos f9f9746a9a Element Type Browser UI refactoring and improved wording 2022-07-11 07:53:14 +02:00
carlos 493faf22ff Move col_with_margins utility to helper.py 2022-07-11 07:52:10 +02:00
Thomas Krijnen bab6313313 Work on more readable ast for express schema parser 2022-07-10 21:51:25 +02:00
carlos 618bed3889 Improved version with optional cascading 2022-07-10 07:46:30 +02:00
carlos 8c9115c0ff Merge remote-tracking branch 'origin/v0.7.0' into v0.7.0 2022-07-09 01:22:44 +02:00
Carlos Villagrasa 0a561d1a30 Merge branch 'IfcOpenShell:v0.7.0' into v0.7.0 2022-07-09 01:19:15 +02:00
dependabot[bot] 443af3f7e7 Bump lxml from 4.6.5 to 4.9.1 in /src/ifcopenshell-python/ifcopenshell
Bumps [lxml](https://github.com/lxml/lxml) from 4.6.5 to 4.9.1.
- [Release notes](https://github.com/lxml/lxml/releases)
- [Changelog](https://github.com/lxml/lxml/blob/master/CHANGES.txt)
- [Commits](https://github.com/lxml/lxml/compare/lxml-4.6.5...lxml-4.9.1)

---
updated-dependencies:
- dependency-name: lxml
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-07 09:29:42 +02:00
Thomas Krijnen 2f6ac0be9f Fix test_wall_opening invocation 2022-07-07 08:46:38 +02:00
Thomas Krijnen 07c152f513 Submodule 2022-07-06 22:09:13 +02:00
Thomas Krijnen 158c62bdca Update ci-py-only.yml 2022-07-06 22:01:15 +02:00
Thomas Krijnen 1029271e91 Update ci-py-only.yml 2022-07-06 18:20:32 +02:00
Thomas Krijnen 9b59d24fc7 Update test_wall_opening.py 2022-07-06 18:20:25 +02:00
Thomas Krijnen 1d0e8c59d2 Capital OR 2022-07-06 16:19:57 +02:00
Thomas Krijnen b479d82251 CI workflow with BUILD_CONVERT=Off 2022-07-06 16:09:52 +02:00
Thomas Krijnen 6b6ac38f96 Link serializers also with only BUILD_IFCPYTHON 2022-07-06 16:06:16 +02:00
Vukas Pajic 57fe895ae0 ensure modules are installed to blender python
thankyou to @Gorgious56 for help on this one ;)  https://blender.stackexchange.com/a/238995/130742
2022-07-06 13:56:24 +02:00
Gorgious56 4195d41e4c Enums from attributes can now be searched by name 2022-07-06 12:09:37 +02:00
Dion Moult 7eac5397cd Run black 2022-07-06 18:29:22 +10:00
Dion Moult 084823164e Fix #2264 refactor property data structures to be separate from attributes 2022-07-06 18:25:29 +10:00
Gorgious56 87f110bae5 Add search operator to material enum field 2022-07-05 15:24:10 +02:00
Thomas Krijnen 952719f19b #2260 correct init order 2022-07-05 10:27:44 +02:00
Thomas Krijnen 2ab4e44248 #2256 try explicit cast for clang 2022-07-05 09:46:19 +02:00
Vukas Pajic 6b9e670bf3 missing comma 2022-07-05 07:41:51 +02:00
Vukas Pajic 9e87f0f027 fix for issue #2261 2022-07-05 07:34:23 +02:00
Gorgious56 c7272065e6 Improve prop search v2 (#2262)
* Minor fixes

* Fix #2257 : enums with a different id and name now correctly show the name in the search field

* Add prop search to template_type
2022-07-04 23:09:03 +02:00
carlos 14bca5d199 Merge remote-tracking branch 'origin/master' into v0.7.0 2022-07-04 18:52:11 +02:00
Carlos Villagrasa dbeb7d392c Merge branch 'IfcOpenShell:v0.7.0' into v0.7.0 2022-07-04 18:50:53 +02:00
Vukas Pajic 22cb7b3b67 Merge pull request #2258 from vulevukusej/create-pset_templates-in-bbim
support enums in new pset_templates
2022-07-04 14:20:14 +02:00
Vukas Pajic 018be92063 support enums in new pset_templates 2022-07-04 13:48:51 +02:00
Gorgious56 37f91461d2 Add prop search to fields with a lot of enumerated values (#2253)
* Add prop_search layout function

* Display props operator

* display search for pset

* Display search for root

* Update operator and UI layout function

* Add search buttons to brick, geometry, patch, project, pset, pset_template, root and unit modules enums
2022-07-03 22:37:41 +02:00
Vukas Pajic c73fedaaaf fix error that stopped user from adding properties 2022-07-01 13:41:20 +02:00
Gorgious56 4ad4bdef3b Initial Commit 2022-06-30 09:44:00 +10:00
Vukas Pajic e50259f8fa fix error I accidentally introduced. 2022-06-29 18:07:32 +02:00
carlos 7321138d57 Adding a preview popup for IFC Type additions 2022-06-29 17:43:28 +02:00
carlos 319f63c861 Preventing error when IfcSpatialElement has been deleted and an IFC Type instance is added 2022-06-29 17:39:40 +02:00
carlos 662cd6232c Preventing edge case (vertical slabs & horizontal walls) 2022-06-29 17:37:42 +02:00
Vukas Pajic 3461a1e96f Submodule_mvd 2022-06-29 17:23:27 +10:00
Vukas Pajic 919c007509 Submodule 2022-06-29 17:23:27 +10:00
Vukas Pajic 5b77001568 updated according to comments 2022-06-29 17:23:27 +10:00
Vukas Pajic 1f4022a41b fix error from util/element.py 2022-06-29 17:23:27 +10:00
Vukas Pajic c8c9262090 initial commit
-Added support for adding and editing enums
-changed behaviour of template psets that have enums.
2022-06-29 17:23:27 +10:00
Thomas Krijnen 104cabfb67 Minor things for drawing profiling and a warning 2022-06-29 11:35:43 +10:00
Kristoffer Andersen 4978a67e19 Add more subdirs for blenderbim build trigger
Add more subdirectories to the github actions workflow to trigger builds whenever a change occurs in relevant directories.
2022-06-29 11:33:44 +10:00
dependabot[bot] e44e03f02e Bump numpy in /src/ifcopenshell-python/ifcopenshell
Bumps [numpy](https://github.com/numpy/numpy) from 1.21.0 to 1.22.0.
- [Release notes](https://github.com/numpy/numpy/releases)
- [Changelog](https://github.com/numpy/numpy/blob/main/doc/HOWTO_RELEASE.rst)
- [Commits](https://github.com/numpy/numpy/compare/v1.21.0...v1.22.0)

---
updated-dependencies:
- dependency-name: numpy
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-22 09:21:40 +02:00
Thomas Krijnen 5a636a925b #2244 file.add() Don't fail on project without unit info 2022-06-21 14:15:59 +02:00
Dion Moult d23f14f8aa Cleaner IFC doc generation showing all contextual entities not only those related to the target instance 2022-06-21 22:05:26 +10:00
Dion Moult 1706ca5293 Fix bug where adding heavy classification references led to duplicate classification systems 2022-06-21 19:28:53 +10:00
Dion Moult ff3e2f14e1 Inherited and overridden classification references per system is now supported 2022-06-21 19:28:29 +10:00
Dion Moult c4433489b7 IDS now supports type casting 2022-06-21 17:01:12 +10:00
Dion Moult 4761c58571 IDS now supports failing inverse checks 2022-06-21 17:00:46 +10:00
Dion Moult 1de6a7e792 Improve geolocation docs with rotation diagram and scale explanation 2022-06-19 17:53:37 +10:00
Thomas Krijnen 7d6ba89496 Fixes after restructuring 2022-06-15 15:21:46 +02:00
Thomas Krijnen c4dc3934fa Add missing file 2022-06-15 14:46:37 +02:00
Thomas Krijnen 25f1d21a85 Fixes for some of the header renames 2022-06-15 14:23:58 +02:00
Thomas Krijnen 2bd6d9343c Fixes for some of the header renames 2022-06-15 13:56:47 +02:00
Thomas Krijnen bc2d76e685 Include-what-you-use 2022-06-15 13:41:13 +02:00
Thomas Krijnen 124f786007 Update Kernel.cpp 2022-06-14 17:18:44 +02:00
Thomas Krijnen b49cfe9744 msvc /mp 2022-06-14 15:25:14 +02:00
Thomas Krijnen 6f5f189443 Missing files 2022-06-14 15:24:38 +02:00
Thomas Krijnen d6f8448c83 IfcGeom refactoring pt. 1 2022-06-14 15:02:54 +02:00
Thomas Krijnen 0f85890c72 #2237 workaround for openings on extrusions of compound profiles 2022-06-11 15:48:04 +02:00
Thomas Krijnen bf3eb68b67 template template template template template 2022-06-10 11:20:01 +02:00
Dion Moult ce3a6bba0f Fix bug where MS Project files with optional weekdays failed to import 2022-06-10 19:07:58 +10:00
Thomas Krijnen f1e3d9c573 typename typename typename typename typename typename 2022-06-10 11:07:40 +02:00
Thomas Krijnen 0a30d1a438 #2213 Read precision from rep context in create_shape() 2022-06-10 11:00:45 +02:00
Dion Moult 8311983d5e You can now toggle visibility and wireframe modes of linked models and fix bug where links with the same name were not unique 2022-06-09 21:48:13 +10:00
Dion Moult 97bf4e3d0d Fix bug where object class selection didn't work with linked models 2022-06-09 21:46:24 +10:00
Dion Moult 15661536dc Extract elements recipe now handles spatial elements as an upgrade to the ExtractSpaces recipe 2022-06-09 19:01:32 +10:00
Dion Moult f451c51451 Fix bug where some appended assets created invalid graphs due to poor purging 2022-06-09 18:59:20 +10:00
Dion Moult b5e27e4ced Fix bug where transaction history was polluted when starting a new file in an existing Blender session 2022-06-09 15:30:18 +10:00
Dion Moult 95881c6258 Fix embarrassing geolocation bug for showing / setting grid north 2022-06-09 10:22:02 +10:00
Thomas Krijnen cb8cfd7905 Update CMakeLists.txt 2022-06-08 13:59:29 +02:00
Dmitry Sedov 96fe1018ed implemented the minimal build version 2022-06-08 13:46:18 +02:00
Thomas Krijnen 73c006a977 Use OCCT github mirror for reliability 2022-06-08 13:37:48 +02:00
Thomas Krijnen 133fa5547b Use OCCT github mirror for reliability 2022-06-08 13:37:06 +02:00
Dion Moult c95d263ca5 #2224 Write documentation for dealing with large models 2022-06-08 19:10:20 +10:00
Dion Moult 3507920c09 #2224 Expose unload project in UI to aid in unlinking IFCs for coordination only 2022-06-08 19:09:55 +10:00
Dion Moult cdabc507e1 #2224 New headless import script 2022-06-08 14:09:02 +10:00
Dion Moult bcbee0659b #2224 Coordination mode now allows interspersed (much faster) object merging during model loading to crunch down large models, with a new by type merge mode 2022-06-08 12:10:01 +10:00
Dion Moult 053e4e1185 #2224 Enabling coordination mode now excludes types and openings 2022-06-08 12:06:59 +10:00
Dion Moult d76679a45f #2224 Cache seems unstable for some large models so allow option to disable 2022-06-08 11:56:22 +10:00
Dion Moult a1ed78e755 #2224 You can now specify element offset / limit ranges when loading models 2022-06-08 11:53:58 +10:00
Dion Moult d0f38bc919 #2224 You can now filter models by type when loading 2022-06-08 11:32:00 +10:00
Dion Moult 4681d3198f #841 #2224 Users can now enable native mesh processing with support for FBSM geometry 2022-06-08 10:19:55 +10:00
Dion Moult 96e4641ebf #2224 Optimise import by 10-40% by removing unnecessary slow traversal of representations 2022-06-08 09:14:36 +10:00
Dion Moult 2ab808a216 #2224 You can now bulk check/uncheck filter categories on import 2022-06-08 09:09:35 +10:00
Dion Moult 1ec0e1ce19 Fix bug with displaying inherited psets by accident. 2022-06-08 09:07:22 +10:00
bimworld bc734c263e Comment deconstructor IfcFile 2022-06-07 12:14:30 +02:00
Thomas Krijnen a96bffa341 Update schema.py 2022-06-06 10:31:33 +02:00
Thomas Krijnen fb3e9ad1b7 Quality IteratorSettings name in wrapper gen 2022-06-06 10:13:48 +02:00
Thomas Krijnen 4c854fbb62 Try to do less allocation during parse, favour upper case entity names in spf 2022-06-06 09:59:32 +02:00
Thomas Krijnen 0e8d7bdc97 Log result of unify() in boolean_operation() 2022-06-06 09:58:57 +02:00
Thomas Krijnen a92d37cd64 Quick fix py create_shape() setting propagation 2022-06-06 09:58:42 +02:00
Dion Moult 00e46ce39e More meaningful percentage completion in console when loading models 2022-06-06 09:59:43 +10:00
Esteban Dugueperoux 54b82fd149 Update README travis badge URL 2022-06-03 09:24:22 +02:00
Esteban Dugueperoux e508fb44f2 Update CMake release requirement 2022-06-02 13:33:06 +02:00
Dion Moult 89e2ad9262 Write documentation for georeferencing 2022-06-02 19:01:09 +10:00
Dion Moult 419901649e You can now configure the distance limit for false origin offsets 2022-06-01 14:25:30 +10:00
Dion Moult 18cb767a95 More IDS test structuring and add support for checking logical unknown 2022-05-31 22:27:37 +10:00
Thomas Krijnen a11b51c971 Revert "Temporarily disable release tag guard"
This reverts commit c6b86e45f3.
2022-05-31 11:30:25 +02:00
Thomas Krijnen d7f913d464 #2218 Decreate (hardcode) angular tolerance on boolean op extrusion detection 2022-05-31 11:24:27 +02:00
Dion Moult 0d982090e3 More descriptive test names and slightly more concise IDS doc layout 2022-05-31 19:13:39 +10:00
Thomas Krijnen be6617d9f9 Update release.yml 2022-05-31 10:31:56 +02:00
Thomas Krijnen fc0efa2339 Tweak release.yml configure opts 2022-05-31 10:21:45 +02:00
Thomas Krijnen c6b86e45f3 Temporarily disable release tag guard 2022-05-31 09:55:40 +02:00
Thomas Krijnen 53b6247bb8 Unify release.yml and ci.yml deps 2022-05-31 09:54:10 +02:00
Thomas Krijnen eab06bda6c Submodule 2022-05-31 09:43:53 +02:00
Thomas Krijnen 524fa58f05 Remove erroneous .gitmodule entry 2022-05-31 09:39:31 +02:00
Dion Moult 4c4846bc8f Support userdefined process types in util module 2022-05-31 16:23:13 +10:00
Dion Moult 0dfe1d995f Update IDS to support process types and require uppercase entities 2022-05-31 16:22:44 +10:00
Dion Moult a4434413d2 Fix bug where rooted tasks with no subactivities would not export correctly to P6 2022-05-31 15:36:13 +10:00
Dion Moult 5ca19ce2f7 WIP update to support current IDS v0.6 2022-05-31 15:35:47 +10:00
Dion Moult 3e1c2c4daf Code review and tests for georeferencing module refactor 2022-05-29 23:44:18 +10:00
Dion Moult 2d4e316df2 Fix bug where unit editing failed for named units 2022-05-29 17:25:28 +10:00
maxfb87 4b426e1fc0 Refactor Georeference Module 2022-05-29 15:54:06 +10:00
Dion Moult d2ad4b2b68 Allow rooted tasks when exporting schedules to P6XML 2022-05-29 11:15:37 +10:00
Dion Moult 67522e03d1 Fix import error bugs when importing P6XML to enterprise environments 2022-05-27 17:17:31 +10:00
AToradaIBIM 24f307130c BCFv3 "get_comments" error #2212
Fix for Issue #2212 

The method get_comments wasn't working as expected because on line 649, it was trying to access the element "Topics" instead of "Topic", based on the XSD "Topics" doesn't exist.
2022-05-25 11:19:53 +02:00
Dion Moult 0a3e5f65fa Fix multiple specifications in IDS 2022-05-25 17:49:12 +10:00
Dion Moult e302fea33b Resolve merge conflict. Still WIP IDS test cases. 2022-05-22 22:10:28 +10:00
Dion Moult c352181f8c Fix bug where underlays didn't work 2022-05-22 21:32:57 +10:00
Thomas Krijnen 3a1416536a Oops 2022-05-17 22:31:37 +02:00
Thomas Krijnen 4eec863cad Example for turning IDS test cases into spec. Sorry for butchering your code @Moult 2022-05-17 22:21:11 +02:00
Thomas Krijnen 96bcd31d99 #2202 Check for nested compound of solid in boolean result handling 2022-05-16 14:24:57 +02:00
Thomas Krijnen b09ff828de #2186 rerun codegen 2022-05-16 13:07:40 +02:00
Thomas Krijnen 3cb68ca388 #2186 optional attribute setter fix 2022-05-16 13:07:40 +02:00
Dion Moult c95d3693ea OpenSourceBIM contributors badge now in README 2022-05-16 11:35:39 +10:00
Dion Moult 67d2ab2577 Write documentation on materials, locations, and measurements 2022-05-16 08:15:31 +10:00
Dion Moult 970b24b63b #1153 New annotation objects have their placement Z in the drawing direction to allow for 2D geometry. 2022-05-15 11:45:47 +10:00
Dion Moult fdaae048c2 Implement IDS partOf facet 2022-05-12 14:33:44 +10:00
Dion Moult 4da5a38237 Implement IDS material null checks, inheritance checks, and set item checks 2022-05-12 12:06:23 +10:00
Dion Moult 0cf2d7e05e Implement IDS uri/use/instructions for material facet 2022-05-11 23:30:10 +10:00
Dion Moult 3122cf21db Implement IDS property facet measure conversions 2022-05-11 19:59:10 +10:00
Dion Moult 4bf25d5d9c Minor fix 2022-05-11 18:46:27 +10:00
Dion Moult dc10c7a360 Implement null check for IDS properties, and support restrictions 2022-05-11 17:10:22 +10:00
Dion Moult 94e082fc7d Support IDS uri/use/instructions for property facets 2022-05-11 15:30:39 +10:00
Dion Moult 9671df8491 You can now choose between lightweight and full classifications 2022-05-11 15:19:31 +10:00
Dion Moult 8aa38917eb New classification utility module 2022-05-11 15:19:17 +10:00
Dion Moult 0774100606 IDS classification facets not handle inheritance, full refs, and restrictions 2022-05-11 14:49:47 +10:00
Dion Moult 95b48b02e4 Add support for IDS classification uri, use, and instructions 2022-05-11 13:27:19 +10:00
Dion Moult c5de1d8727 Add IDS support for restrictions in attribute facets and handle inheritance 2022-05-11 13:06:15 +10:00
Dion Moult 7e09ab0ced Add support for IDS attribute use/instructions 2022-05-11 10:12:36 +10:00
Dion Moult eb3e137a6e #2196 Get psets now handleds inheritance by default 2022-05-11 09:18:23 +10:00
Dion Moult f528ad9744 Minor fix 2022-05-10 23:49:14 +10:00
Dion Moult 650f9eb7f5 Attribute filtering in IDS now checks null-like values too. 2022-05-10 22:42:21 +10:00
Dion Moult a78d6f42e5 Allow IDS to audit any entity, not just IfcObjects 2022-05-10 22:13:28 +10:00
Dion Moult 4326a74c64 Fix IDS to not allow subclasses and allow restrictions in the class name 2022-05-10 21:40:35 +10:00
Dion Moult 08fc62d4d9 Add support for userdefined predefined types in IDS entity facets 2022-05-10 21:20:10 +10:00
Dion Moult ae298de8dc Implement identifier, desc, and instructions for specification node in IDS 2022-05-10 19:26:12 +10:00
Dion Moult a24c4b269a Fix mandatory title and optional date and check invalid dates in IDS 2022-05-10 17:36:24 +10:00
Dion Moult 083d9d3e3e Implement attribute facet for IDS 2022-05-10 16:23:07 +10:00
Dion Moult 12e7ed356c Fix IDS namespace bug that prevented XML encoding, simplify XML writing, and new to_string() method to decrease dependency on the filesystem 2022-05-10 16:22:38 +10:00
Dion Moult 3f15dd71b1 Run black on ids module 2022-05-10 16:18:08 +10:00
Adrien SCHVALBERG 42448cae4e Add missing exports for ifcopenshell-python when we build shared libs. 2022-05-09 14:13:47 +02:00
Dion Moult 7e28d193ec #2185 Document installation and hello world examples for IfcOpenShell-python 2022-05-09 19:27:33 +10:00
Thomas Krijnen 8f2b32532c validate.py text result formatting improvements 2022-05-09 11:00:04 +02:00
Dion Moult f0a00cbc94 #2185 Set up auto generated API reference documentation via sphinx-autoapi 2022-05-09 15:35:52 +10:00
Dion Moult fd73b2cf0a #2185 Migrate web files to website repo 2022-05-08 19:51:17 +10:00
Adrien SCHVALBERG e5b3455533 Fix memory leak for HeaderEntity instances:
the getArgumentCount() call in IfcEntityInstanceData destructor isn't virtually dispatched so it returns 0 instead of correct number of arguments => memory leak
added IfcEntityInstanceData::clearArguments() which clears all arguments and resets the attributes_ field to nullptr

Remove unnecessary copy in IfcEntityInstanceData::setArgument() when argument is created at the call site (no more leak of original argument)

Fix memory leak in IfcFile: delete entities from both byid and entity_file_map
2022-05-08 10:21:46 +02:00
Adrien SCHVALBERG e677355438 Add IfcParse::clear_schemas() and individual Ifc___::clear_schema() to clear any resource allocated by registered schemas
Add missing virtual destructors in IfcSchema.h
2022-05-08 10:21:46 +02:00
Dion Moult 93fd3f97e3 #2111 New feature to select by style and see style usage 2022-05-08 18:03:18 +10:00
Dion Moult 910d189f35 #2188 support displaying inherited materials 2022-05-08 16:27:35 +10:00
Dion Moult c8d6d12442 The material manager now groups materials into categories 2022-05-08 15:48:09 +10:00
Dion Moult 1f3ba3d09d New makefile targets to specifically run tests of single modules 2022-05-08 15:45:47 +10:00
Dion Moult f67941221e Enable syntax highlighting in test suite for easier debugging 2022-05-08 15:24:06 +10:00
Dion Moult 8252ef82ad #2185 Write documentation about viewing construction types 2022-05-07 21:50:38 +10:00
Dion Moult 3b825e35ae #1153 You can now provide custom stylesheets, markers, symbols, and hatches 2022-05-07 20:28:24 +10:00
Dion Moult 4a4912e817 Editing URIReference properties now provides a file browse button 2022-05-07 20:26:25 +10:00
Dion Moult 5a38604ec2 #1153 Boilerplate styles and definitions now can be used with any drawing layer combination 2022-05-07 17:57:05 +10:00
Dion Moult b15e0d0e2b #2185 Commit logos and homepage mockup by Paulina Godoy and Meetlat 2022-05-07 11:48:20 +10:00
Dion Moult 5a5f52a5c2 #2185 Standardise graphic style for annotation images in documentation 2022-05-07 11:42:12 +10:00
Dion Moult 816a690519 Commit WIP website design by Paulina Godoy :) 2022-05-07 10:20:11 +10:00
Dion Moult 60303c6560 Minor fix 2022-05-06 20:51:36 +10:00
Dion Moult cc88e6f112 #2185 Write documentation about viewing attributes, pets, and qtos 2022-05-06 20:44:26 +10:00
Dion Moult 5f1b5d0c63 You can now manage actor assignments to products 2022-05-06 17:47:24 +10:00
Dion Moult b54caa8967 Person / organisation roles and acting actors are now shown 2022-05-06 16:21:12 +10:00
Dion Moult 73e048a9a8 #1153 You can now manage assigned products for all annotations 2022-05-06 15:35:39 +10:00
Dion Moult 316a2b7f53 #2185 Write documentation for viewing element classes 2022-05-06 12:46:29 +10:00
Dion Moult 42edcda8bd Deleting an element now also auto deletes its associated distribution ports 2022-05-06 10:38:38 +10:00
Dion Moult 92432f453d You can now remove ports 2022-05-06 10:35:12 +10:00
Dion Moult 4b6ebe7b1c Fix bug where deleted objects were not cleared after saving 2022-05-06 09:20:37 +10:00
Emad Aghajani 3f6d25ed43 Fixes #2175: Fixes a crash when blender is in background mode or is used as bpy Python module 2022-05-05 19:23:36 +10:00
Dion Moult d4b2cc7f2c Bump IfcOpenShell build 2022-05-05 18:00:58 +10:00
Dion Moult 53c050c6ed Port locations now sync relative to their parent even when not actively displayed in the viewport 2022-05-05 18:00:42 +10:00
Dion Moult 3213af2f48 #2185 Write documentation on the object outliner panel 2022-05-05 16:29:40 +10:00
Dion Moult 85122ba184 #2185 Document how to navigate through a model 2022-05-05 14:43:34 +10:00
Dion Moult b8791d43aa Minor documentation update for loading an IFC model 2022-05-05 12:19:40 +10:00
Dion Moult 6a82f27d48 Standalone Blender import script now available for debugging 2022-05-05 09:59:04 +10:00
Dion Moult 4e2400952a Fix #2147 #2143 Fix hanging when reloading a cache of a file with 2D and 3D data 2022-05-05 09:58:10 +10:00
Dion Moult de1dae8b6e Grids are now locked by default when loading IFCs 2022-05-05 09:28:36 +10:00
Dion Moult dd127db969 Minor documentation improvements 2022-05-04 16:04:18 +10:00
Dion Moult 194bc53bdb Minor refactor 2022-05-04 15:54:15 +10:00
Dion Moult 8c3e29c351 Split BlenderBIM and other docs to not overwhelm users. Use Furo theme for Sphinx. 2022-05-04 13:06:39 +10:00
Gorgious56 6e55a04550 Refactor Standalone section shader (#2172)
* Refactor Standalone section shader

* Remove leftover code
2022-05-03 18:21:51 +02:00
Dion Moult 9333839267 Copying an element now also copies its distribution ports 2022-05-03 18:05:27 +10:00
Dion Moult 280236290e Fix #2182. File export IFC menu item now defaults to save as to improve usability for new users 2022-05-03 17:36:55 +10:00
Dion Moult c5773b5665 Port locations are now auto synchronised when hiding ports 2022-05-03 16:50:55 +10:00
Dion Moult 96babc4506 Creating a flow segment now also creates 2 ports at either end 2022-05-03 15:48:41 +10:00
Dion Moult f8acde0801 You can now add ports to types, and ports are created when placing occurrences of that type 2022-05-03 14:32:18 +10:00
Dion Moult 32c101cf74 #1153 Implement angular dimension annotations 2022-05-02 09:20:40 +10:00
Bruno Perdigão 2a1aa535ba Added VSCode extension to Live Development section 2022-05-02 08:06:27 +10:00
Dion Moult 02903c4929 #1153 New arc from 3 points command for 2D CAD 2022-05-01 17:25:03 +10:00
Dion Moult d80e26e4ab Design new icon for CAD workspace tool 2022-05-01 15:30:37 +10:00
Dion Moult a88b83306e #1153 New arc from 2 points command for 2D CAD (based on view direction) 2022-05-01 14:43:03 +10:00
Dion Moult 9577c40386 Fix #2107. Materials and styles in the scene manager are now shown alphabetically 2022-05-01 12:01:24 +10:00
Dion Moult f54a5cf6e0 Fix #2048. Fix bug where material and style IFC links were severed after reloading a saved Blender file 2022-05-01 09:41:03 +10:00
Dion Moult abcb492e5a Fix #2174. Don't show meaningless context dropdown when reassigning class. 2022-05-01 08:57:23 +10:00
Dion Moult 4d447c169f Fix #2176 2022-05-01 08:50:25 +10:00
Dion Moult b465605b63 #1153 CAD tool now provides hotkey access to offset edges command 2022-04-30 22:55:45 +10:00
Dion Moult fb6dc45b1b #1153 New fillet command for 2D CAD supporting both bevel and chamfer 2022-04-30 22:44:37 +10:00
Dion Moult b2aca0ae36 #1153 New mitre command for 2D cad (like chamfer with 0 distance) 2022-04-30 18:17:39 +10:00
Dion Moult 03831d440c #1153 New CAD workspace with hotkeys for super fast CAD operations 2022-04-30 15:50:40 +10:00
Dion Moult ac4679a376 #1153 New CAD module with basic trim / extend tool for 2D linework 2022-04-30 11:40:19 +10:00
Dion Moult 21fee721be #1153 Implement adding and removing schedules from a sheet 2022-04-29 13:32:34 +10:00
Dion Moult 6bcf00ef31 #1153 Reimplement ability to build SVG tables from referenced ODS documents 2022-04-28 19:57:47 +10:00
Christian Martínez de la Rosa 952d1c3b79 [IfcConvert] Added IfcWorkPlan to xml export 2022-04-28 17:54:43 +10:00
Christian Martínez de la Rosa 2d7a90bd2b [IfcConvert] Fix crash when IfcWorkCalendar does not contain IfcWorkTime 2022-04-28 17:54:43 +10:00
Christian Martínez de la Rosa b14de15a68 [IfcConvert] Added Output objects in the XML file 2022-04-28 17:54:43 +10:00
Christian Martínez de la Rosa 29ecba293b [IfcConvert] Added calendars to xml output file 2022-04-28 17:54:43 +10:00
Christian Martínez de la Rosa 8396c68e75 Added task to property / quanty relationship 2022-04-28 17:54:43 +10:00
Christian Martínez de la Rosa 01c6a0d9be [IfcConver] Changed OperatesOn hierarchy level in xml task export 2022-04-28 17:54:43 +10:00
Christian Martínez de la Rosa 99d8a225a9 Get IfcTasks from IfcWorkSchedule 2022-04-28 17:54:43 +10:00
Christian Martínez de la Rosa 89f13aa1e4 [IfcConvert] Added IsSuccessorFrom and IsPredecessorTo in xml task export 2022-04-28 17:54:43 +10:00
Christian Martínez de la Rosa f089d03dc6 [ifcConvert] Add related objects in tasks 2022-04-28 17:54:43 +10:00
Christian Martínez de la Rosa a4366ef151 [IfcConvert] Export tasks in the xml conversion
The exportion in the XML format exports in a new tag, named "tasks", all the tasks from the file with a hierarchy. Each task contains the IfcTaskTime object if it has it.
2022-04-28 17:54:43 +10:00
Dion Moult 9483abcdd5 Revert "Refactor BIM_PT_gis"
This reverts commit 265ebaebb8.
2022-04-28 17:25:31 +10:00
Dion Moult 200a343746 Revert "Refactor BIM_PT_gis added files"
This reverts commit 445e77bac0.
2022-04-28 17:25:31 +10:00
Dion Moult 2313fa00cc Revert "minox fix"
This reverts commit dfb980e0d1.
2022-04-28 17:25:31 +10:00
Dion Moult 99c5f895fc Revert "Finish refactor georeference module"
This reverts commit fcd5908ac9.
2022-04-28 17:25:31 +10:00
maxfb87 fcd5908ac9 Finish refactor georeference module 2022-04-28 14:34:35 +10:00
maxfb87 dfb980e0d1 minox fix 2022-04-28 14:34:35 +10:00
maxfb87 445e77bac0 Refactor BIM_PT_gis added files 2022-04-28 14:34:35 +10:00
maxfb87 265ebaebb8 Refactor BIM_PT_gis 2022-04-28 14:34:35 +10:00
Dion Moult 07fa7003fb Minor fix 2022-04-28 14:34:18 +10:00
Ryan Schultz 3a90d664fa added 3"=1'-0" scale (a common scale), and corrected 6"=1'-0" scale 2022-04-28 14:26:37 +10:00
Dion Moult 3f28ae18c0 #1153 You can now add / remove / open schedules, implemented as IFC documents 2022-04-28 14:16:39 +10:00
Dion Moult 9ea6499b5a #2082 You can now filter by metadata existence in the selector syntax 2022-04-27 22:20:12 +10:00
Adrien SCHVALBERG 11c3a6e547 Fix ifcparse/Ifc____.h template 2022-04-27 14:08:05 +02:00
Adrien SCHVALBERG e7f3856d64 Fix shared libraries exports. 2022-04-27 14:08:05 +02:00
Dion Moult 7e7d576855 Basic WIP Australian project library with some materials and walls 2022-04-27 20:45:34 +10:00
Dion Moult cfa1428a75 Fix bug where material layer set usage axis was not consistent for non walls 2022-04-27 20:44:26 +10:00
Dion Moult d4ee74455c Show construction type descriptions as tooltips in BIM authoring tool 2022-04-27 20:36:32 +10:00
Dion Moult 07d2cc62c1 Fix #2163 bug where launching viewing apps could freeze Blender 2022-04-26 09:53:32 +10:00
Dion Moult 8aff4badf7 Minor housekeeping 2022-04-25 19:37:03 +10:00
Dion Moult aa3325c010 #1153 Implement diameter annotation 2022-04-25 10:32:33 +10:00
Dion Moult 9b13cd8d5f #1153 Dimensions can now have custom text 2022-04-25 10:02:00 +10:00
Dion Moult 0fe32c0c75 #1153 Add support for radius annotations 2022-04-25 09:54:08 +10:00
Thomas Krijnen efc43c0fe9 #1153 merge-cells option in draw 2022-04-24 14:54:49 +02:00
Thomas Krijnen 5bfaa32c7c #1153 add ray_distance to tree result 2022-04-24 14:51:24 +02:00
Thomas Krijnen 38e4ccdb0a #1153 submodule 2022-04-24 14:50:53 +02:00
Dion Moult 7b71a7a866 #1153 You can now include and exclude elements from a drawing using queries 2022-04-24 22:15:14 +10:00
Dion Moult b5ee20cb7a #1153 New global referencing property determines whether or not a drawing is mean to be referenced from all other drawings 2022-04-24 18:39:22 +10:00
Dion Moult cc8da4abf4 #1153 Symbol background option for text is now stored in a pset 2022-04-24 13:13:21 +10:00
Dion Moult f2c4b20187 #1153 Experimental support for curve bounded planes for 3D annotations 2022-04-24 12:25:04 +10:00
Dion Moult 7c460bcf29 #1153 Viewport decoration now supports miscellaneous linework and fills 2022-04-24 11:12:24 +10:00
Dion Moult 31ddb0f2c5 #1153 Add support for Annotation3D representations 2022-04-24 10:00:31 +10:00
Thomas Krijnen c2cad06cfa Default BUILD_QTVIEWER to off for the time being 2022-04-23 15:39:03 +02:00
Dushyant Basson 421b58850c Updated to use Qt5 2022-04-23 15:19:10 +02:00
Dushyant Basson 7c89aa1098 Enabled option to build QtViewer 2022-04-23 15:19:10 +02:00
Dushyant Basson be7e85fc2d Revert "Updated to use Qt5"
This reverts commit 06fe4abf6a.
2022-04-23 15:19:10 +02:00
Dushyant Basson d91442de59 Revert "Enabled option to build QtViewer"
This reverts commit b82dddf441.
2022-04-23 15:19:10 +02:00
Dushyant Basson 9cd3d73a23 Enabled option to build QtViewer 2022-04-23 15:19:10 +02:00
Dushyant Basson 0cf3c97eb2 Updated to use Qt5 2022-04-23 15:19:10 +02:00
Dushyant Basson d49095844a added output directories to .gitignore 2022-04-23 15:19:10 +02:00
Dion Moult be65f77311 #1153 Breaklines are now pure lines separate from fill areas and orient correctly 2022-04-23 18:56:06 +10:00
Thomas Krijnen 2081dc4c08 #2156 Don't try to convert unset placements in element hierarchy parsing 2022-04-23 10:51:16 +02:00
Dion Moult bd16345b76 #1153 Utility to convert an edge to an arc in preparation for angular dimensions 2022-04-23 17:25:39 +10:00
Dion Moult 3264f338c7 #1153 Section RLs now show storey names or custom descriptions 2022-04-23 11:10:02 +10:00
Dion Moult 0c06c67f2d #1153 Storey level annotations are now automatically generated for sections and elevations 2022-04-22 12:41:21 +10:00
Dion Moult a66ba6a6f9 #1153 Reimplement metadata keys so you can specify attribute-based classes in drawings 2022-04-22 10:06:28 +10:00
Massimo Fabbro 80d8665992 Insert the link to Reboot Addon 2022-04-21 11:13:32 +10:00
Dion Moult 337ce89919 Fix bug where "Not Georeferenced" showed up twice in the Georeferencing UI panel 2022-04-21 10:47:09 +10:00
Dion Moult 1237a8ce97 Improve georeferencing documentation 2022-04-21 10:41:47 +10:00
Dion Moult c3c9ed2975 #2150 Document how to manually reconcile large coordinate ranges 2022-04-21 09:58:28 +10:00
Dion Moult 87cb1c69f4 #2150 Fix bug where cartesian point offsets didn't consider object placement rotations 2022-04-21 09:09:34 +10:00
Dion Moult 3aa7f8e4c8 #2150 Fix bug where manual offsets and autodetected offset could stack 2022-04-21 09:08:08 +10:00
Dion Moult 2c301d734b #1153 You can now specify the ZIndex of 2D annotations 2022-04-20 16:28:10 +10:00
Thomas Krijnen 1705e6f565 Changes for mpfr toolset discussed in #1993 2022-04-19 15:33:09 +02:00
renjianqiang 2cd7b08c47 Fix the problem that build dependencies failed under Debug mode 2022-04-18 09:56:41 +02:00
renjianqiang 647a5105b5 Fix the bug that can't install python when IFCOS_INSTALL_PYTHON is true 2022-04-18 09:56:41 +02:00
Dion Moult 9fc0baf175 #1153 Add support for IfcAnnotationFillArea representation 2022-04-18 10:27:20 +10:00
Dion Moult ca502cc293 #1153 Fix bugs with importing existing annotations 2022-04-18 10:27:20 +10:00
CyrilWaechter f70ab060e3 Add default when getting space collection
A case has been encountered where space object and space collection did
not share the same name (eg. space.0011 and space.0021).
@Moult I wonder if it is expected or if there is a consistency issue
with space object/collection naming.
2022-04-17 15:10:18 +02:00
Dion Moult 6fb3c28f1a #1153 Switching representations for annotations and drawing cameras now works 2022-04-17 18:41:19 +10:00
Dion Moult c79eb60959 #1153 Drawings that are pure annotation now do not generate references 2022-04-17 12:29:34 +10:00
Dion Moult 538419a23f #1153 New markers and patterns for insulation batting, steel, and wood grain 2022-04-17 12:19:20 +10:00
Dion Moult eb19165ebc #1153 Predefined type is now also included in CSS classes for drawings. 2022-04-16 18:32:17 +10:00
Dion Moult 1138ffee7e #2139 Fix bug where some objects were invalidated during undo or redo 2022-04-15 19:45:59 +10:00
Dion Moult 0f3416774c #1153 Drawing layers (underlay, linework, annotation) are now per drawing instead of global 2022-04-15 11:45:23 +10:00
Dion Moult 1ba7977587 #1153 Fix newlines in text literals and smart tags in SVGs 2022-04-14 21:08:06 +10:00
Dion Moult 5b1b8e8f50 #1153 Annotation reference and sheet IDs now implemented in SVG. 2022-04-14 15:20:09 +10:00
Dion Moult 78811d331b #2136 Minor fix 2022-04-14 15:20:09 +10:00
Jesusbill 4aa91cfa7f add feature to toggle wireframe visibility for linked models - no testcases 2022-04-13 18:28:48 +02:00
Dion Moult c099a6cb75 #1153 Drawing titles now display IFC scale and identification data 2022-04-13 12:21:18 +10:00
Dion Moult 029b402d11 Minor fix 2022-04-12 18:30:03 +10:00
Dion Moult a243cdd6c6 Minor fix 2022-04-12 18:09:45 +10:00
Dion Moult 1fae835de9 Update installation docs to distinguish between package from source and developer setups 2022-04-12 18:07:39 +10:00
Dion Moult f0c7ff1e57 #1153. Titleblock revision / data is are derived from IfcDocumentInformation 2022-04-12 08:29:29 +10:00
Thomas Krijnen 460fd5ca87 #2133 faceset helper: compare index vectors by address instead of value 2022-04-11 14:12:17 +02:00
Thomas Krijnen 054c0a9a27 Improve faceset logging 2022-04-11 14:08:44 +02:00
Thomas Krijnen 5af1baa48b Update release.yml 2022-04-10 20:47:01 +02:00
Thomas Krijnen 0e5d2cc0c9 Update release.yml 2022-04-10 10:15:07 +02:00
Dion Moult 48148f00a3 #2129 Support some FreeCAD annotation types. 2022-04-09 10:22:12 +10:00
Thomas Krijnen 564c4b7644 #2126 reverse 1st operand inner wires in 2d opening subtraction 2022-04-08 10:45:28 +02:00
Bruno Postle 33c53a2c9a regenerate site library 2022-04-08 16:49:06 +10:00
Bruno Postle c049007ee8 add missing import 2022-04-08 16:49:06 +10:00
Bruno Postle 05345e8ddf Add missing demo library 2022-04-08 16:49:06 +10:00
Thomas Krijnen 461b78665a OCCT 7.6 compatibility 2022-04-04 08:29:29 +00:00
Boris Brangeon 6160d65d18 Update selector.py
filter_rule.children[2].children[0].lower() == 'true'
2022-03-31 20:50:26 +02:00
Thomas Krijnen d526314190 #2115 Let --strict-tolerance govern degeneracy of periodic curve trim 2022-03-31 11:28:30 +02:00
Massimo Fabbro 85bac37bed Fix two broken links
Fixed "./installation.rst" and "./running_tests.rst" links
2022-03-30 20:31:00 +11:00
Dion Moult e38184b152 Adding a document now auto adds a reference for convenience. 2022-03-30 18:15:26 +11:00
Dion Moult a0c8d87ad0 #1153. You can now assign and remove drawings from sheets. 2022-03-30 18:15:11 +11:00
Dion Moult 8686462eed #1153. Section markers are now supported in SVG. 2022-03-29 20:44:20 +11:00
Dion Moult 6cd4a2d78b #1153. Add support for elevation symbols in generated SVGs. 2022-03-29 20:30:10 +11:00
jakob-beetz 89023df4e5 Update readme.md 2022-01-07 10:37:40 +01:00
admin f794b647e1 merge v0.6.0 2021-12-06 09:59:18 +08:00
admin 2e81b2bd17 merage v0.6
ADD IFCGroup parse #1154
2021-12-02 10:19:47 +08:00
admin 8527d0fcbd merage new 0.6 2021-12-01 10:32:20 +08:00
admin bc32481185 merge 2021-07-05 10:30:06 +08:00
admin 58e9f1baf9 merage 2021-05-10 14:06:18 +08:00
admin db5432d902 merge master v0.6.0 2021-05-06 09:54:33 +08:00
admin 397b6ae5fe merage master v6.0.0 2021-04-12 10:26:10 +08:00
admin 72fdca9e82 merage 2021-04-01 16:41:28 +08:00
admin 29b8e67bc8 merge all 2021-03-25 10:04:25 +08:00
admin 33ec80e54d merge update 2021-01-28 13:56:47 +08:00
admin 371e4137f1 update mager 2021-01-21 13:43:19 +08:00
admin 555a2ce79e merge master v6.0 2021-01-11 11:39:36 +08:00
admin 699742880e fix IFC to xml - IFCGROUP in IFC cannot be found in xml #1154 2021-01-11 10:59:03 +08:00
GisSpace d99348f163 Merge pull request #3 from IfcOpenShell/v0.6.0
merge master
2020-12-31 15:44:04 +08:00
GisSpace d7034c6a40 Merge pull request #2 from IfcOpenShell/v0.6.0
merge
2020-12-21 11:13:59 +08:00
GisSpace ac632d0698 Merge pull request #1 from IfcOpenShell/v0.6.0
同步源库
2020-12-18 16:23:04 +08:00
admin f3696788cb #1097
fix:IFC file conversion obj file, some cases will be rotated 90 °
2020-12-10 18:44:23 +08:00
1579 changed files with 669812 additions and 43554 deletions
+3 -1
View File
@@ -29,7 +29,7 @@ jobs:
sudo apt-get install --no-install-recommends \
git cmake gcc g++ libboost-all-dev python3-all-dev swig libpcre3-dev libxml2-dev \
libocct-foundation-dev libocct-modeling-algorithms-dev libocct-modeling-data-dev libocct-ocaf-dev libocct-visualization-dev libocct-data-exchange-dev \
libhdf5-dev libcgal-dev
libhdf5-dev libcgal-dev nlohmann-json3-dev
-
name: ccache
@@ -61,6 +61,8 @@ jobs:
-DGMP_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
-DMPFR_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
-DHDF5_INCLUDE_DIR=/usr/include/hdf5/serial \
-DGLTF_SUPPORT=On \
-DJSON_INCLUDE_DIR=/usr/include \
../cmake
make -j $(nproc)
make install
+104
View File
@@ -0,0 +1,104 @@
import pathlib
import shutil
import requests
import zipfile
import os
# To test this locally, set these environment variables
REPO_OWNER = os.environ.get("REPO_OWNER", "IfcOpenShell/IfcOpenShell")
MY_WORKFLOW = os.environ.get("MY_WORKFLOW", "ci-ifcopenshell-conda-daily")
WORKFLOW_RUN_ID = os.environ.get("WORKFLOW_RUN_ID", None)
TOKEN = os.environ.get("GITHUB_TOKEN", None)
# To test this locally create a fine-grained personal access token for this repo with permissions "actions:read"
# See https://github.com/settings/tokens?type=beta
# This is a list of strings that indicate that a job has stopped abruptly.
SIGNS_OF_STOPPAGE = [
"Error: The operation was canceled.",
"fatal error C1060: compiler is out of heap space",
]
def start_request_session():
s = requests.Session()
headers = {
"Accept": "application/vnd.github+json",
"X-GitHub-Api-Version": "2022-11-28",
}
if TOKEN:
headers["Authorization"] = f"Bearer {TOKEN}"
s.headers = headers
return s
def get_ci_run(repo_name, run_id):
url = f"https://api.github.com/repos/{repo_name}/actions/runs/{run_id}"
s = start_request_session()
response = s.get(url)
return response.json()
def evaluate_log_file_for_abrupt_stop(log_file):
with open(log_file) as f:
for i, line in enumerate(f):
for sign in SIGNS_OF_STOPPAGE:
if sign in line:
print(f"Found sign of abrupt stoppage in [line {i}]: '{sign}'")
return True
return False
def get_ci_specific_run_specific_failure_details(repo_name, run_id):
url = f"https://api.github.com/repos/{repo_name}/actions/runs/{run_id}/attempts/1/logs"
s = start_request_session()
response = s.get(url)
# SAVE zip file
with open("logs.zip", "wb") as f:
f.write(response.content)
# unzip file
with zipfile.ZipFile("logs.zip", "r") as zip_ref:
zip_ref.extractall("logs")
failed_logs = []
for file in pathlib.Path("logs").iterdir():
if file.is_dir():
continue
if evaluate_log_file_for_abrupt_stop(file):
failed_logs.append(file)
return failed_logs
def restart_job(repo_name, job_id):
url = f"https://api.github.com/repos/{repo_name}/actions/runs/{job_id}/rerun-failed-jobs"
s = start_request_session()
response = s.post(url)
return response.json()
def eval_jobs():
run = get_ci_run(REPO_OWNER, WORKFLOW_RUN_ID)
if run["run_attempt"] > 1:
print("This is not the first attempt. Exiting")
return
failed_logs = get_ci_specific_run_specific_failure_details(REPO_OWNER, WORKFLOW_RUN_ID)
if len(failed_logs) == 0:
print("No runs exhibit signs of abrupt stoppage")
return
print("restarting job", WORKFLOW_RUN_ID)
r = restart_job(REPO_OWNER, WORKFLOW_RUN_ID)
print(r)
shutil.rmtree("logs")
os.remove("logs.zip")
if __name__ == "__main__":
eval_jobs()
+5 -6
View File
@@ -19,20 +19,19 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.x'
python-version: '3.10'
- name: Build package
run: |
cd src/bcf
pip install build
python -m build
- name: Test
run: |
cd src/bcf
make test
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
packages_dir: src/bcf/dist
+92
View File
@@ -0,0 +1,92 @@
name: Publish-blenderbim-chocolatey package
on:
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# * * * * *
- cron: "30 0 * * *" # 30min past utc midnight
env:
major: 0
minor: 0
name: blenderbim
choco_version: 1.1.0
CHOCO_TOKEN: ${{ secrets.CHOCO_TOKEN }}
jobs:
activate:
runs-on: ubuntu-latest
if: |
github.repository == 'IfcOpenShell/IfcOpenShell'
steps:
- name: Set env
run: echo ok go
build:
needs: activate
name: ${{ matrix.config.name }}-${{ matrix.pyver }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pyver: [py310]
config:
- {
name: "Windows Build",
short_name: win,
}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
with:
python-version: '3.10.9' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- run: echo ${{ env.DATE }}
- name: Check in published releases if we should do a choco release
id: do_choco
run: |
echo "::set-output name=choco_release::$(python3 /home/runner/work/IfcOpenShell/IfcOpenShell/choco/blenderbim/check_repo_infos.py --do_choco_release?)"
- name: Fill chocolatey scripts on win with latest blender python
if: ${{steps.do_choco.outputs.choco_release}} == 'do_choco_release'
run: |
yesterday_non_iso="$(date --date='yesterday' +'%y%m%d' | tr -d '\n')" &&
target_os=${{ matrix.config.short_name }} &&
latest_blender_python_version_maj_min=$(python3 /home/runner/work/IfcOpenShell/IfcOpenShell/choco/blenderbim/check_repo_infos.py --latest_blender_python_version_maj_min?) &&
echo "latest_blender_python_version_maj_min?: $latest_blender_python_version_maj_min" &&
pyver=$(python3 /home/runner/work/IfcOpenShell/IfcOpenShell/choco/blenderbim/check_repo_infos.py --pyver?) &&
export latest_blender_version_maj_min=$(python3 /home/runner/work/IfcOpenShell/IfcOpenShell/choco/blenderbim/check_repo_infos.py --latest_blender_release_maj_min?) &&
export latest_blender_version_maj_min_pat=$(python3 /home/runner/work/IfcOpenShell/IfcOpenShell/choco/blenderbim/check_repo_infos.py --latest_blender_release_maj_min_pat?) &&
echo latest_blender_version_maj_min_pat?: $latest_blender_version_maj_min_pat &&
export blenderbim_build_version="${{ env.major }}.${{ env.minor }}.$yesterday_non_iso" &&
export url_blenderbim_py310_win_zip="https://github.com/IfcOpenShell/IfcOpenShell/releases/download/blenderbim-$yesterday_non_iso/blenderbim-$yesterday_non_iso-$pyver-$target_os.zip" &&
wget $url_blenderbim_py310_win_zip --no-verbose &&
export sha256sum_blenderbim_py310_win_zip=$( sha256sum blenderbim-$yesterday_non_iso-$pyver-$target_os.zip --tag | cut -d ' ' -f 4 | tr -d '\n') &&
echo sha256sum_blenderbim_py310_win_zip: $sha256sum_blenderbim_py310_win_zip &&
python3 choco/blenderbim/fill_dynamic_parameters.py &&
echo __build choco with mono &&
wget "https://github.com/chocolatey/choco/archive/refs/tags/$choco_version.tar.gz" --quiet &&
tar -xzf "$choco_version.tar.gz" &&
cd choco-$choco_version &&
chmod +x build.sh zip.sh &&
./build.sh &&
cp -r build_output/chocolatey /opt/chocolatey &&
cd /home/runner/work/IfcOpenShell/IfcOpenShell/choco/blenderbim/ &&
echo __choco pack &&
mono /opt/chocolatey/choco.exe --version &&
mono /opt/chocolatey/choco.exe pack --allow-unofficial &&
echo __choco set apiKey &&
mono /opt/chocolatey/choco.exe setapikey --key="$CHOCO_TOKEN" --source="https://push.chocolatey.org/" --allow-unofficial # &&
echo __choco push &&
mono /opt/chocolatey/choco.exe push --source="https://push.chocolatey.org/" --key="$CHOCO_TOKEN" --allow-unofficial --verbose
- name: Inform user about not packaging
if: ${{steps.do_choco.outputs.choco_release}} != 'do_choco_release'
run: |
echo "no releases found today ${{ env.DATE }}, therefore choco packaging is skipped."
+16 -2
View File
@@ -3,8 +3,18 @@ name: Publish-blenderbim-multiplatform
on:
push:
paths:
- 'src/blenderbim/**'
- '.github/workflows/ci-blenderbim-matrix.yml'
- 'src/blenderbim/**'
- 'src/ifcopenshell-python/ifcopenshell/**'
- 'src/bcf/src/bcf/**'
- 'src/ifcclash/ifcclash/**'
- 'src/ifccobie/**'
- 'src/ifcdiff/**'
- 'src/ifccsv/**'
- 'src/ifcpatch/ifcpatch/**'
- 'src/ifc4d/ifc4d/**'
- 'src/ifc5d/ifc5d/**'
- 'src/ifccityjson/**'
branches:
- v0.7.0
@@ -43,12 +53,16 @@ jobs:
name: "MacOS Build",
short_name: macos
}
- {
name: "MacOS ARM Build",
short_name: macosm1
}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
with:
python-version: '3.7.7' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
python-version: '3.10'
- run: echo ${{ env.DATE }}
- name: Get current date
id: date
@@ -0,0 +1,70 @@
name: ci-ifcopenshell-conda-daily
on:
push:
paths:
- .github/workflows/ci-ifcopenshell-conda-daily.yml
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# * * * * *
- cron: "49 23 * * *" # 11min before utc midnight every day
jobs:
activate:
runs-on: ubuntu-latest
if: |
github.repository == 'IfcOpenShell/IfcOpenShell'
steps:
- name: Set env
run: echo ok go
test:
name: ${{ matrix.platform.distver }}-${{ matrix.pyver.name }}
needs: activate
runs-on: ${{ matrix.platform.distver }}
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
pyver: [
{ name: py310, distver: '3.10'},
{ name: py311, distver: '3.11'}
]
platform: [
{ name: Windows, distver: windows-2022, upload: 'true' },
{ name: Linux, distver: ubuntu-22.04, upload: 'true' },
{ name: macOS, distver: macos-12, upload: 'true' }
]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Download MacOSX SDK
if: ${{ matrix.platform.name == 'macOS' }}
run: |
curl -o MacOSX10.13.sdk.tar.xz -L https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.13.sdk.tar.xz && \
tar xf MacOSX10.13.sdk.tar.xz && \
sudo mv -v MacOSX10.13.sdk /opt/ && \
ls /opt/
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: conda-incubator/setup-miniconda@v2 # https://github.com/conda-incubator/setup-miniconda
with:
activate-environment: conda-build
python-version: ${{ matrix.pyver.distver }}
environment-file: conda/environment.yml
- name: build, test and upload ifcopenshell
if: ${{ matrix.platform.upload == 'true' }}
run: |
conda-build . --python ${{ matrix.pyver.distver }} -c conda-forge --token ${{ secrets.ANACONDA_TOKEN }} --user ifcopenshell
working-directory: ./conda
- name: build & test ifcopenshell
if: ${{ matrix.platform.upload == 'false' }}
run: |
conda-build . --python ${{ matrix.pyver.distver }} -c conda-forge
working-directory: ./conda
@@ -0,0 +1,77 @@
name: ci-ifcopenshell-pypi
on:
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# * * * * *
- cron: "0 0 18 * *"
push:
paths:
- '.github/workflows/ci-ifcopenshell-pypi.yml'
env:
major: 0
minor: 0
name: ifcopenshell
jobs:
activate:
runs-on: ubuntu-latest
if: |
github.repository == 'IfcOpenShell/IfcOpenShell'
steps:
- name: Set env
run: echo ok go
build:
needs: activate
name: ${{ matrix.config.name }}-${{ matrix.pyver }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pyver: [py36, py37, py38, py39, py310, py311]
config:
- {
name: "Windows Build",
short_name: win,
}
- {
name: "Linux Build",
short_name: linux
}
- {
name: "MacOS Build",
short_name: macos
}
- {
name: "MacOS ARM Build",
short_name: macosm1
}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
with:
python-version: '3.10' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- run: echo ${{ env.DATE }}
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%y%m%d')"
- name: Compile
run: |
pip install build
cp -r src/ifcopenshell-python src/ifcopenshell_${{ matrix.config.short_name }}_${{ matrix.pyver }} &&
cd src/ifcopenshell_${{ matrix.config.short_name }}_${{ matrix.pyver }} &&
make dist PLATFORM=${{ matrix.config.short_name }} PYVERSION=${{ matrix.pyver }}
- name: Publish a Python distribution to PyPI
uses: ortega2247/pypi-upload-action@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: src/ifcopenshell_${{ matrix.config.short_name }}_${{ matrix.pyver }}/dist
+97
View File
@@ -0,0 +1,97 @@
name: ci_py_only
on:
push:
paths:
- 'src/**'
- 'test/**'
- 'conda/**'
- 'cmake/**'
- '.github/workflows/ci-py-only.yml'
pull_request:
jobs:
activate:
runs-on: ubuntu-latest
if: |
github.repository == 'IfcOpenShell/IfcOpenShell' &&
!contains(github.event.head_commit.message, 'skip ci')
steps:
- run: echo ok go
build:
runs-on: ubuntu-20.04
needs: activate
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install C++ dependencies
run: |
sudo apt update
sudo apt-get install --no-install-recommends \
git cmake gcc g++ \
libboost-date-time-dev \
libboost-filesystem-dev \
libboost-iostreams-dev \
libboost-program-options-dev \
libboost-regex-dev \
libboost-system-dev \
libboost-thread-dev \
python3-all-dev python3-pip \
swig libpcre3-dev libxml2-dev \
libtbb-dev nlohmann-json3-dev \
libocct-foundation-dev libocct-modeling-algorithms-dev libocct-modeling-data-dev libocct-ocaf-dev libocct-visualization-dev libocct-data-exchange-dev \
libhdf5-dev libcgal-dev
- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${GITHUB_WORKFLOW}
- name: Build ifcopenshell
run: |
sudo /usr/sbin/update-ccache-symlinks
mkdir build && cd build
PATH="/usr/lib/ccache:$PATH" cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=/usr \
-DCMAKE_SYSTEM_PREFIX_PATH=/usr \
-DOCC_INCLUDE_DIR=/usr/include/opencascade \
-DOCC_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
-DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 \
-DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.8 \
-DPYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.8.so \
-DCOLLADA_SUPPORT=Off \
"-DSCHEMA_VERSIONS=2x3;4;4x3_add1" \
-DBUILD_CONVERT=Off \
-DGLTF_SUPPORT=On \
-DJSON_INCLUDE_DIR=/usr/include \
-DCGAL_INCLUDE_DIR=/usr/include \
-DGMP_INCLUDE_DIR=/usr/include \
-DMPFR_INCLUDE_DIR=/usr/include \
-DGMP_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
-DMPFR_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
-DHDF5_INCLUDE_DIR=/usr/include/hdf5/serial \
../cmake
sudo make -j $(nproc)
sudo make install
- name: Install Python dependencies
run: |
sudo /usr/bin/python -m pip install -U pip
sudo /usr/bin/python -m pip install xmlschema xsdata numpy lxml
sudo /usr/bin/python -m pip install src/bcf --no-deps
sudo /usr/bin/python -m pip install pytest
sudo /usr/bin/python -m pip install isodate
sudo /usr/bin/python -m pip install lark
sudo /usr/bin/python -m pip install networkx
sudo /usr/bin/python -m pip install tabulate
- name: Test
run: |
cd test
sudo /usr/bin/python tests.py
cd ../src/ifcopenshell-python
mv ifcopenshell ifcopenshell-local # Force testing on installed module
make test
@@ -0,0 +1,34 @@
name: Restart failed daily conda builds
on:
workflow_run:
workflows: [ ci-ifcopenshell-conda-daily ]
types:
- completed
env:
REPO_OWNER: IfcOpenShell/IfcOpenShell
MY_WORKFLOW: ci-ifcopenshell-conda-daily
jobs:
restart-failed-runs:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- name: checkout
uses: actions/checkout@v3
- name: Use python 3.11
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- name: Check for failed runs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WORKFLOW_RUN_ID: ${{ github.event.workflow_run.id }}
run: |
python check_repo_ci_jobs.py
working-directory: .github/workflows
+34 -5
View File
@@ -3,8 +3,19 @@ name: ci
on:
push:
paths:
- 'src/**'
- 'test/**'
- 'src/ifcblender/**'
- 'src/ifcconvert/**'
- 'src/ifcgeom/**'
- 'src/ifcgeom_schema_agnostic/**'
- 'src/ifcgeomserver/**'
- 'src/ifcjni/**'
- 'src/ifcmax/**'
- 'src/ifcopenshell-python/**'
- '!src/ifcopenshell-python/docs/**'
- 'src/ifcparse/**'
- 'src/ifcwrap/**'
- 'src/qtviewer/**'
- 'src/serializers/**'
- 'conda/**'
- 'cmake/**'
- '.github/workflows/ci.yml'
@@ -46,6 +57,8 @@ jobs:
- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${GITHUB_WORKFLOW}
- name: Build ifcopenshell
run: |
@@ -62,7 +75,7 @@ jobs:
-DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.8 \
-DPYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.8.so \
-DCOLLADA_SUPPORT=Off \
"-DSCHEMA_VERSIONS=2x3;4" \
"-DSCHEMA_VERSIONS=2x3;4;4x3_add1" \
-DGLTF_SUPPORT=On \
-DJSON_INCLUDE_DIR=/usr/include \
-DCGAL_INCLUDE_DIR=/usr/include \
@@ -75,15 +88,31 @@ jobs:
sudo make -j $(nproc)
sudo make install
- name: Run IfcConvert on Sample files
run: |
(find test/input src/blenderbim/test/files -name '*.ifc' | while read i; do \
echo $i | tee -a log; \
timeout 1m "$(which IfcConvert)" -yv "$i" "$i.obj" --validate >> log 2>&1; \
echo $i $? >> statuses; \
done) || true
echo Failed
grep -v 0$ statuses
grep -v 0$ statuses | wc -l
echo Succeeded
grep 0$ statuses
grep 0$ statuses | wc -l
- name: Install Python dependencies
run: |
sudo /usr/bin/python -m pip install -U pip
sudo /usr/bin/python -m pip install xmlschema numpy lxml
sudo /usr/bin/python -m pip install src/bcf
sudo /usr/bin/python -m pip install xmlschema xsdata numpy lxml
sudo /usr/bin/python -m pip install src/bcf --no-deps
sudo /usr/bin/python -m pip install pytest
sudo /usr/bin/python -m pip install isodate
sudo /usr/bin/python -m pip install lark
sudo /usr/bin/python -m pip install networkx
sudo /usr/bin/python -m pip install https://github.com/Andrej730/aud/archive/refs/heads/master-reduced-size.zip
sudo /usr/bin/python -m pip install tabulate
- name: Test
run: |
+25 -7
View File
@@ -18,14 +18,24 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
with:
lfs: true
-
name: Update ubuntu
submodules: recursive
- name: Install C++ dependencies
run: |
sudo apt update
sudo apt-get install git cmake gcc g++ libboost1.67-all-dev python3-all-dev swig libpcre3-dev libxml2-dev
sudo apt-get install libocct-foundation-dev libocct-modeling-algorithms-dev libocct-modeling-data-dev libocct-ocaf-dev libocct-visualization-dev libocct-data-exchange-dev \
libhdf5-dev
sudo apt-get install --no-install-recommends \
git cmake gcc g++ \
libboost-date-time-dev \
libboost-filesystem-dev \
libboost-iostreams-dev \
libboost-program-options-dev \
libboost-regex-dev \
libboost-system-dev \
libboost-thread-dev \
python3-all-dev python3-pip \
swig libpcre3-dev libxml2-dev \
libtbb-dev nlohmann-json3-dev \
libocct-foundation-dev libocct-modeling-algorithms-dev libocct-modeling-data-dev libocct-ocaf-dev libocct-visualization-dev libocct-data-exchange-dev \
libhdf5-dev libcgal-dev opencollada-dev
- name: Build
env:
@@ -44,10 +54,18 @@ jobs:
-DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 \
-DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.8 \
-DPYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.8.so \
-DCOLLADA_SUPPORT=Off \
-DLIBXML2_INCLUDE_DIR=/usr/include/libxml2 \
-DLIBXML2_LIBRARIES=/usr/lib/x86_64-linux-gnu/libxml2.so \
-DGLTF_SUPPORT=On \
-DJSON_INCLUDE_DIR=/usr/include \
-DCGAL_INCLUDE_DIR=/usr/include \
-DGMP_INCLUDE_DIR=/usr/include \
-DMPFR_INCLUDE_DIR=/usr/include \
-DGMP_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
-DMPFR_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
-DHDF5_INCLUDE_DIR=/usr/include/hdf5/serial \
-DOPENCOLLADA_INCLUDE_DIR=/usr/include/opencollada \
-DOPENCOLLADA_LIBRARY_DIR=/usr/lib/opencollada/ \
../cmake
make -j $(nproc)
make install
+33
View File
@@ -5,6 +5,15 @@
/_installed-vs*-x*/
/build/
# output directories
/cmake/out/
/docs/out/
/src/examples/out/
/src/ifcmax/out/
/src/ifcwrap/out/
/src/qtviewer/out/
/win/BuildDepsCache*.txt
# IfcExpressParser residue
/src/ifcexpressparser/express_parser.py
@@ -13,6 +22,7 @@ __pycache__
*.py.bak
# Visual Studio Code files
.vscode
.vs
# PyCharm files
.idea
@@ -57,3 +67,26 @@ htmlcov
# Blender
*.blend1
# Sphinx
_build/
# IDS Docs
src/ifcopenshell-python/test/build
# tox cache
.tox/
*.egg-info/
# mypy cache
.mypy_cache
# blenderbim libs
src/blenderbim/blenderbim/libs
# blenderbim test temp files
src/blenderbim/test/files/temp
# ifcopenshell swig and compiled files
src/ifcopenshell-python/ifcopenshell/_ifcopenshell_wrapper.so
src/ifcopenshell-python/ifcopenshell/ifcopenshell_wrapper.py
+1 -4
View File
@@ -8,9 +8,6 @@
[submodule "src/svgfill"]
path = src/svgfill
url = https://github.com/IfcOpenShell/svgfill
[submodule "src/ifcopenshell-python/ifcopenshell/Sample-BIM-Files"]
path = src/ifcopenshell-python/ifcopenshell/Sample-BIM-Files
url = https://github.com/atomczak/Sample-BIM-Files
[submodule "src/ifcopenshell-python/test/Sample-BIM-Files"]
path = src/ifcopenshell-python/test/Sample-BIM-Files
url = https://github.com/atomczak/Sample-BIM-Files
url = https://github.com/IfcOpenShell/ids-test-files
-81
View File
@@ -1,81 +0,0 @@
language: cpp
compiler: gcc
cache: ccache
os: linux
dist: focal
addons:
apt:
update: true
packages:
- libboost-date-time-dev
- libboost-filesystem-dev
- libboost-iostreams-dev
- libboost-program-options-dev
- libboost-regex-dev
- libboost-system-dev
- libboost-thread-dev
- libocct-data-exchange-dev
- libocct-foundation-dev
- libocct-modeling-algorithms-dev
- libocct-modeling-data-dev
- libxml2-dev
- nlohmann-json3-dev
- opencollada-dev
- python3-all-dev
- python3-pip
- swig
- libhdf5-dev
before_script:
- if [ $TRAVIS_OS_NAME == "linux" ]; then ccache -z; fi
install:
# for IDS
- python3 -m pip install xmlschema
script:
- pwd
- mkdir build && cd build
- |
cmake \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DOCC_INCLUDE_DIR=/usr/include/opencascade \
-DOCC_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
-DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 \
-DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.8 \
-DPYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.8.so \
"-DSCHEMA_VERSIONS=2x3;4" \
-DGLTF_SUPPORT=On \
-DJSON_INCLUDE_DIR=/usr/include \
-DHDF5_INCLUDE_DIR=/usr/include/hdf5/serial \
../cmake
# TODO: Drop sudo
- sudo make -j $(nproc) install
- cd ../test
- /usr/bin/python tests.py
- /usr/bin/python ../src/ifcopenshell-python/ifcopenshell/test_ids.py
- cd input
- /usr/local/bin/IfcConvert -yv acad2010_walls.ifc acad2010_walls.glb
- /usr/bin/python -c "from io import open; import ifcopenshell; f = ifcopenshell.open('encoding.ifc'); assert list(map(ord, f[1][0])) == [39, 97, 39, 32, 49, 109, 179, 32, 8804, 32, 53, 109, 179, 32, 8805, 32, 49, 48, 109, 179]"
- |
(for i in *.ifc; do \
echo $i | tee -a log; \
timeout 1m /usr/local/bin/IfcConvert -yv "$i" "$i.dae" --validate >> log 2>&1; \
echo $i $? >> statuses; \
done) || true
- echo Failed
- grep -v 0$ statuses
- grep -v 0$ statuses | wc -l
- echo Succeeded
- grep 0$ statuses
- grep 0$ statuses | wc -l
after_script:
- if [ $TRAVIS_OS_NAME == "linux" ]; then ccache -s; fi
+5 -3
View File
@@ -23,9 +23,11 @@ RUN echo "deb http://archive.ubuntu.com/ubuntu focal-proposed main restricted" |
echo "deb http://archive.ubuntu.com/ubuntu focal-proposed multiverse" | tee -a /etc/apt/sources.list; \
apt-get -qq update; \
apt-get -y install tzdata dos2unix rsync; \
apt-get -y install python3 libxml2 liboce-foundation11 liboce-modeling11 liboce-ocaf11 liboce-visualization11 \
liboce-ocaf-lite11 libpython3.8 libboost-system1.67.0 libboost-program-options1.67.0 \
libboost-regex1.67.0 libboost-thread1.67.0 libboost-date-time1.67.0; \
apt-get -y install python3 libxml2 libpython3.8 \
libboost-all-dev \
libocct-foundation-dev libocct-modeling-algorithms-dev libocct-modeling-data-dev \
libocct-ocaf-dev libocct-visualization-dev libocct-data-exchange-dev \
libhdf5-serial-dev ; \
rm -rf /var/lib/apt/lists/* ;
COPY . /home/IfcOpenShell/
+60 -291
View File
@@ -1,305 +1,74 @@
IfcOpenShell
============
IfcOpenShell is an open source ([LGPL]) software library for working with the Industry Foundation Classes ([IFC])
file format. Extensive geometric support is implemented for the IFC releases [IFC2x3 TC1] and [IFC4 Add2 TC1].
Support for parsing is provided for IFC4x1, IFC4x2, and the IFC4x3 release candidates. Extending with support for
arbitrary IFC schemas is possible at compile-time when using C++ and at run-time when using Python.
For more information, see
* [http://ifcopenshell.org](http://ifcopenshell.org)
* [http://academy.ifcopenshell.org](http://academy.ifcopenshell.org)
IfcOpenShell is an open source ([LGPL]) software library for working with Industry Foundation Classes ([IFC]). Complete
parsing support is provided for [IFC2x3 TC1], [IFC4 Add2 TC1], IFC4x1, IFC4x3, and IFC4x3. Extensive geometric support
is implemented for the IFC releases [IFC2x3 TC1] and [IFC4 Add2 TC1]. Extending with support for arbitrary IFC schemas
is possible at compile-time when using C++ and at run-time when using Python.
[![Build Status](https://travis-ci.org/IfcOpenShell/IfcOpenShell.svg?branch=v0.6.0)](https://travis-ci.org/IfcOpenShell/IfcOpenShell)
In addition to a C++ and Python API, IfcOpenShell comes with an ecosystem of tools, notably including IfcConvert (an application to convert IFC models to
other formats), the BlenderBIM Add-on (an add-on to Blender providing a graphical IFC authoring platform), and many
other libraries, CLI apps, and more. Support is also provided for auxiliary standards such as BCF and IDS.
Prerequisites
-------------
* Git
* CMake (2.6 or newer)
* Windows: [Visual Studio] 2008 to 2019 (2022 not yet supported by dependency CMake) with C++ toolset (or [Visual C++ Build Tools]) or [MSYS2] + MinGW
* *nix: GCC 4.7 or newer, or Clang (any version)
For more information, see:
Dependencies
-------------
* [Boost](http://www.boost.org/)
* [Open Cascade](https://dev.opencascade.org/) - *optional*, but required for building IfcGeom
([official](https://dev.opencascade.org/release), "OCCT", or [community edition](https://github.com/tpaviot/oce), "OCE")
For converting IFC representation items into BRep solids and tesselated meshes
* [OpenCOLLADA](https://github.com/khronosGroup/OpenCOLLADA/) - *optional*
For IfcConvert to be able to write tessellated Collada (.dae) files
* [SWIG](http://www.swig.org/) and [Python](https://www.python.org/) - *optional*
For building the IfcOpenShell Python interface and the Blender add-on
* [3ds Max SDK](http://www.autodesk.com/products/3ds-max/free-trial) - *optional*
For building the 3ds Max plug-in.
All recent versions of 3ds Max (2014 and newer) are 64-bit only, so a 64-bit installation is assumed.
* [IfcOpenShell Website](http://ifcopenshell.org)
* [IfcOpenShell Documentation](http://blenderbim.org/docs-python)
* [IfcOpenShell C++ Installation](https://blenderbim.org/docs-python/ifcopenshell/installation.html)
* [IfcOpenShell Python Installation](https://blenderbim.org/docs-python/ifcopenshell-python/installation.html)
* [IfcOpenShell Python Hello World Tutorial](https://blenderbim.org/docs-python/ifcopenshell-python/hello_world.html)
* [BlenderBIM Add-on Website](https://blenderbim.org)
* [BlenderBIM Add-on Documentation](http://blenderbim.org/docs)
* [Add-on Installation](https://blenderbim.org/docs/users/installation.html)
* [Exploring an IFC model](https://blenderbim.org/docs/users/exploring_an_ifc_model.html)
Building IfcOpenShell
---------------------
| Service | Status |
| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| Anaconda Daily Build | [![Anaconda-Server Badge](https://img.shields.io/conda/vn/ifcopenshell/ifcopenshell)](https://anaconda.org/ifcopenshell/ifcopenshell) |
| Anaconda v0.7.0 Stable | [![Anaconda-Server Badge](https://img.shields.io/conda/vn/conda-forge/ifcopenshell)](https://anaconda.org/conda-forge/ifcopenshell) |
| PyPi Daily Build | [![PyPi Badge](https://img.shields.io/pypi/v/ifcopenshell)](https://pypi.org/project/ifcopenshell/) |
| ArchLinux AUR Package Stable | [![AUR Badge](https://img.shields.io/aur/version/ifcopenshell)](https://aur.archlinux.org/packages/ifcopenshell) |
| ArchLinux AUR Package git | [![AUR Badge](https://img.shields.io/aur/version/ifcopenshell-git)](https://aur.archlinux.org/packages/ifcopenshell-git) |
| BlenderBIM Add-on Chocolatey (under moderation) | [![Chocolatey Badge](https://img.shields.io/chocolatey/v/blenderbim-nightly)](https://community.chocolatey.org/packages/blenderbim-nightly/) |
| Sponsor development on OpenCollective | [![Financial Contributors](https://opencollective.com/opensourcebim/tiers/badge.svg)](https://opencollective.com/opensourcebim/) |
| Docker hub | [![Docker Pulls](https://img.shields.io/docker/pulls/aecgeeks/ifcopenshell)](https://hub.docker.com/r/aecgeeks/ifcopenshell) |
Note 1: The path where the source code is cloned to can contain spaces but non-ASCII characters are very likely to cause problems with the build.
Note 2: If you had not used `git clone --recursive https://github.com/IfcOpenShell/IfcOpenshell.git`, update the submodules by running `git submodule init & git submodule update`.
Note 3: Be careful with special characters is the path when using the nix or win build scripts, because the OpenCASCADE build will fail on paths containing ++ and likely other situations.
### Compiling on Windows
The preferred way to fetch and build this project's dependencies is to use the build scripts
in win/ folder. **See [win/readme.md] for more information**.
#### Using Visual Studio
Instructions in a nutshell (**assuming Visual Studio 2015 x64 environment variables set**):
> cd IfcOpenShell\win
> build-deps.cmd
> run-cmake.bat
NB: `build-deps.cmd` need to be ran from the directory containing it, i.e. the `./win` folder.
You can now open and build the solution file in Visual Studio:
> ..\build-vs2015-x64\IfcOpenShell.sln
As the scripts default to using the `RelWithDebInfo` configuration, and a freshly created solution by CMake defaults
to `Debug`, make sure to switch the used build configuration. Build the `INSTALL` project (right-click -> Project
Only) to deploy the headers and binaries into a single location if wanted/needed.
Alternatively, one can use the utility batch file(s) to build and install the project easily from the command-line
(installing a project will build it also, if required):
> install-ifcopenshell.bat
#### Using MSYS2 + MinGW
Start the MSYS2 Shell and then:
$ cd IfcOpenShell/win
$ ./build-deps.sh
$ ./run-cmake.sh
$ ./install-ifcopenshell.sh
#### Using Bash on Ubuntu on Windows
Start Bash on Ubuntu on Windows and follow the instructions below. Compiling on Ubuntu 14.04.4 LTS using GCC 4.8.4
or Clang 3.5 has been confirmed to work.
### Compiling on *nix
The following instructions are for Ubuntu, modify as required for other operating systems. [nix/build-all.py] script
can be experimented with and studied for pointers for other operating systems, but note that this script is not currently
meant to be used for a typical IfcOpenShell workspace setup.
Note 1: It is recommeded to use OCCT for IfcOpenShell. You could use OCE as well, but sometimes it may lag behind OCCT and
therefore not compile with the latest IfcOpenShell.
Note 2: where `make -j` is written, add a number roughly equal to the amount of CPU cores + 1.
**1)** Install most of the prerequisites and dependencies:
$ sudo apt-get install git cmake gcc g++ libboost-all-dev libcgal-dev
**2a)** Either use an OCCT package from your operating system's software repository
$ sudo apt-get install libocct-data-exchange-dev libocct-draw-dev libocct-foundation-dev libocct-modeling-algorithms-dev libocct-modeling-data-dev libocct-ocaf-dev libocct-visualization-dev
**2b)** or, if OCCT is not available or the latest code is wanted, obtain and compile OCCT from https://dev.opencascade.org/release
**2c)** or, if you'd like to try using OCE, use the package from your operating system's software repository
$ sudo apt-get install liboce-foundation-dev liboce-modeling-dev liboce-ocaf-dev liboce-visualization-dev liboce-ocaf-lite-dev
**2d)** or if OCE is not available, or the latest code is wanted, compile OCE yourself (note that the build takes a long time)
$ sudo apt-get install libftgl-dev libtbb2 libtbb-dev libgl1-mesa-dev libfreetype6-dev
$ git clone https://github.com/tpaviot/oce.git
$ cd oce
$ mkdir build && cd build
$ cmake ..
$ make -j
$ sudo make install
**3)** For building IfcConvert with COLLADA (.dae) support (on by default), OpenCOLLADA is needed:
$ sudo apt-get install libpcre3-dev libxml2-dev
$ git clone https://github.com/KhronosGroup/OpenCOLLADA.git
$ cd OpenCOLLADA
Using a known good revision, but HEAD should work too:
$ git checkout 064a60b65c2c31b94f013820856bc84fb1937cc6
$ mkdir build && cd build
$ cmake ..
$ make -j
$ sudo make install
**4)** For building the IfcPython wrapper (on by default), SWIG and Python development are needed, if not already available:
$ sudo apt-get install python-all-dev swig
**5)** To build IfcOpenShell please take the following steps. Alternatively use environment variables for setting the
dependencies' paths. `OCC_INCLUDE_DIR` might be needed to set also. `OPENCOLLADA_INCLUDE_DIR` and `OPENCOLLADA_LIBRARY_DIR`
(and potentially `PCRE_LIBRARY_DIR`) are needed if building with COLLADA support. (`-DCOLLADA_SUPPORT=0` disables it).
$ cd /path/to/IfcOpenShell
$ mkdir build && cd build
$ cmake ../cmake -DOCC_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu/ \
-DOPENCOLLADA_INCLUDE_DIR="/usr/local/include/opencollada" \
-DOPENCOLLADA_LIBRARY_DIR="/usr/local/lib/opencollada" \
-DPCRE_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu/ \
-DCGAL_INCLUDE_DIR=/usr/include \
-DGMP_INCLUDE_DIR=/usr/include \
-DMPFR_INCLUDE_DIR=/usr/include \
-DGMP_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
-DMPFR_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
-DHDF5_SUPPORT=Off
$ make -j
If all worked out correctly you can now use IfcOpenShell. See the examples below.
**6)** Install the project if wanted:
$ sudo make install
### Installing on MacOS Using Homebrew
**1)** Install all dependencies using [Homebrew](https://brew.sh/)
```{shell}
$ brew install boost swig cmake ftgl cgal gmp libaec opencascade
```
**2)** Clone the git repo and its submodules
```{shell}
$ git clone --recurse-submodules https://github.com/IfcOpenShell/IfcOpenShell.git
```
**3)** Build IfcOpenShell with flags for Homebrew dependencies (```/usr/local/```)
```{shell}
$ cd /path/to/IfcOpenShell
$ mkdir build && cd build
$ cmake ../cmake -DOCC_LIBRARY_DIR=/usr/local/lib/ \
-DOCC_INCLUDE_DIR=/usr/local/include/opencascade/ \
-DCOLLADA_SUPPORT=0 \
-DCGAL_INCLUDE_DIR=/usr/local/include/ \
-DGMP_LIBRARY_DIR=/usr/local/lib/ \
-DMPFR_LIBRARY_DIR=/usr/local/lib/
$ make -j -lboost_options
```
Note: Make sure to compile using XCode, rather than a ```brew``` installed C/C++ compiler.
Installing IfcOpenShell with Conda
----------------------------------
Another option for building and installing IfcOpenShell is to use the popular
[Anaconda Python Distribution](https://www.anaconda.com/download).
The requirements are spread across a number of channels.
You can add these channels to your configuration, or specify them all on the command line:
$ conda install -c conda-forge -c oce -c dlr-sc -c ifcopenshell ifcopenshell
Usage examples
--------------
**Invoking IfcConvert from the command line**
$ wget -O duplex.zip https://portal.nibs.org/files/wl/\?id=4DsTgHFQAcOXzFetxbpRCECPbbfUqpgo
$ unzip duplex.zip
$ ./IfcConvert Duplex_A_20110907_optimized.ifc
$ less Duplex_A_20110907_optimized.obj
**Using the IfcOpenShell Python interface**
$ wget -O duplex.zip https://portal.nibs.org/files/wl/\?id=4DsTgHFQAcOXzFetxbpRCECPbbfUqpgo
$ unzip duplex.zip
$ python
>>> import ifcopenshell
>>> f = ifcopenshell.open("Duplex_A_20110907_optimized.ifc")
>>>
>>> # Accessing entity instances by type:
>>> f.by_type("ifcwall")[:2]
[#91=IfcWallStandardCase('2O2Fr$t4X7Zf8NOew3FL9r',#1,'Basic Wall:Interior - Partition (92mm Stud):144586',$,'Basic Wall:Interior - Partition (92mm Stud):128360',#5198,#18806,'144586'), #92=IfcWallStandardCase('2O2Fr$t4X7Zf8NOew3FLIE',#1,'Basic Wall:Interior - Partition (92mm Stud):143921',$,'Basic Wall:Interior - Partition (92mm Stud):128360',#5206,#18805,'143921')]
>>> wall = _[0]
>>> len(wall) # number of EXPRESS attributes
8
>>>
>>> # Accessing EXPRESS attributes by name:
>>> wall.GlobalId
'2O2Fr$t4X7Zf8NOew3FL9r'
>>> wall.Name = "My wall"
>>> wall.NonExistingAttr
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".\ifcopenshell.py", line 14, in __getattr__
except: raise AttributeError("entity instance of type '%s' has no attribute'%s'"%(self.wrapped_data.is_a(), name)) from None
AttributeError: entity instance of type 'IfcWallStandardCase' has no attribute 'NonExistingAttr'
>>> wall.GlobalId = 3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".\ifcopenshell.py", line 26, in __setattr__
self[self.wrapped_data.get_argument_index(key)] = value
File ".\ifcopenshell.py", line 30, in __setitem__
self.wrapped_data.set_argument(idx, entity_instance.map_value(value))
File ".\ifc_wrapper.py", line 118, in <lambda>
set_argument = lambda self,x,y: self._set_argument(x) if y is None else self
._set_argument(x,y)
File ".\ifc_wrapper.py", line 114, in _set_argument
def _set_argument(self, *args): return _ifc_wrapper.entity_instance__set_argument(self, *args)
RuntimeError: INT is not a valid type for 'GlobalId'
>>> # Creating new entity instances
>>> f.createIfcCartesianPoint(Coordinates=(1.0,1.5,2.0))
#27530=IfcCartesianPoint((1.,1.5,2.))
>>>
>>> # Working with GlobalId attributes:
>>> import uuid
>>> ifcopenshell.guid.compress(uuid.uuid1().hex)
'3x4C8Q_6qHuv$P$FYkANRX'
>>> new_guid = _
>>> owner_hist = f.by_type("IfcOwnerHistory")[0]
>>> new_wall = f.createIfcWallStandardCase(new_guid, owner_hist, None, None, Tag='my_tag')
>>> new_wall.ObjectType = ''
>>> new_wall.ObjectPlacement = new_wall.Representation = None
>>>
>>> # Accessing entity instances by instance id or GlobalId:
>>> f[92]
#92=IfcWallStandardCase('2O2Fr$t4X7Zf8NOew3FLIE',#1,'Basic Wall:Interior - Partition (92mm Stud):143921',$,'Basic Wall:Interior - Partition (92mm Stud):128360',#5206,#18805,'143921')
>>> f['2O2Fr$t4X7Zf8NOew3FLIE']
#92=IfcWallStandardCase('2O2Fr$t4X7Zf8NOew3FLIE',#1,'Basic Wall:Interior - Partition (92mm Stud):143921',$,'Basic Wall:Interior - Partition (92mm Stud):128360',#5206,#18805,'143921')
>>>
>>> # Writing IFC-SPF files to disk:
>>> f.write("out.ifc")
Extra tools
-----------
Also available are a series of utilities that are based on or related to IfcOpenShell.
Contents
--------
Those marked with an asterisk are part of IfcOpenShell.
Name | License
--- | ---
bcf | LGPL-3.0-or-later
blenderbim | GPL-3.0-or-later
bsdd | LGPL-3.0-or-later
ifc2ca | LGPL-3.0-or-later
ifc4d | LGPL-3.0-or-later
ifc5d | LGPL-3.0-or-later
ifcbimtester | LGPL-3.0-or-later
ifcblender | LGPL-3.0-or-later\*
ifccityjson | LGPL-3.0-or-later
ifcclash | LGPL-3.0-or-later
ifccobie | LGPL-3.0-or-later
ifcconvert | LGPL-3.0-or-later\*
ifccsv | LGPL-3.0-or-later
ifcdiff | LGPL-3.0-or-later
ifcfm | LGPL-3.0-or-later
ifcgeom | LGPL-3.0-or-later\*
ifcgeom\_schema\_agnostic | LGPL-3.0-or-later\*
ifcgeomserver | LGPL-3.0-or-later\*
ifcjni | LGPL-3.0-or-later\*
ifcmax | LGPL-3.0-or-later\*
ifcopenshell-python | LGPL-3.0-or-later\*
ifcparse | LGPL-3.0-or-later\*
ifcpatch | LGPL-3.0-or-later
ifcsverchok | GPL-3.0-or-later
ifcwrap | LGPL-3.0-or-later\*
qtviewer | LGPL-3.0-or-later\*
serializers | LGPL-3.0-or-later\*
| Name | Description | License |
| ------------------------- | ----------------------------------------------------------------------| ------------------- |
| bcf | Library to read and write BCF-XML and query OpenCDE BCF-API modules | LGPL-3.0-or-later |
| blenderbim | Add-on to Blender providing a graphical native IFC authoring platform | GPL-3.0-or-later |
| bsdd | Library to query the bSDD API | LGPL-3.0-or-later |
| ifc2ca | Utility to convert IFC structural analysis models to Code_Aster | LGPL-3.0-or-later |
| ifc4d | Convert to and from IFC and project management software | LGPL-3.0-or-later |
| ifc5d | Report and optimise cost information from IFC | LGPL-3.0-or-later |
| ifcbimtester | Wrapper for Gherkin based unit testing for IFC models | LGPL-3.0-or-later |
| ifcblender | Historic Blender IFC import add-on | LGPL-3.0-or-later\* |
| ifccityjson | Convert CityJSON to IFC | LGPL-3.0-or-later |
| ifcclash | Clash detection library and CLI app | LGPL-3.0-or-later |
| ifccobie | Extract IFC data for COBie handover requirements | LGPL-3.0-or-later |
| ifcconvert | CLI app to convert IFC to many other formats | LGPL-3.0-or-later\* |
| ifccsv | Library and CLI app to export and import schedules from IFC | LGPL-3.0-or-later |
| ifcdiff | Compare changes between IFC models | LGPL-3.0-or-later |
| ifcfm | Extract IFC data for FM handover requirements | LGPL-3.0-or-later |
| ifcgeom | Internal library for IfcOpenShell | LGPL-3.0-or-later\* |
| ifcgeom\_schema\_agnostic | Internal library for IfcOpenShell | LGPL-3.0-or-later\* |
| ifcgeomserver | Internal library for IfcOpenShell | LGPL-3.0-or-later\* |
| ifcjni | Internal library for IfcOpenShell | LGPL-3.0-or-later\* |
| ifcmax | Historic extension for IFC support in 3DS Max | LGPL-3.0-or-later\* |
| ifcopenshell-python | Python library for IFC manipulation | LGPL-3.0-or-later\* |
| ifcparse | Internal library for IfcOpenShell | LGPL-3.0-or-later\* |
| ifcpatch | Utility to run pre-packaged scripts to manipulate IFCs | LGPL-3.0-or-later |
| ifcsverchok | Blender Add-on for visual node programming with IFC | GPL-3.0-or-later |
| ifctester | Library, CLI and webapp for IDS model auditing | LGPL-3.0-or-later |
| ifcwrap | Internal library for IfcOpenShell | LGPL-3.0-or-later\* |
| qtviewer | Internal library for IfcOpenShell | LGPL-3.0-or-later\* |
| serializers | Internal library for IfcOpenShell | LGPL-3.0-or-later\* |
[LGPL]: https://github.com/IfcOpenShell/IfcOpenShell/tree/master/COPYING.LESSER "LGPL-3.0-or-later"
[IFC]: https://technical.buildingsmart.org/standards/ifc/ "IFC"
+34
View File
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Do not remove this test for UTF-8: if “Ω” doesnt appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. -->
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>blenderbim-nightly</id>
<version>blenderbim_build_version-alpha</version>
<packageSourceUrl>https://github.com/IfcOpenShell/IfcOpenShell</packageSourceUrl>
<owners>fbpyr</owners>
<!-- == SOFTWARE SPECIFIC SECTION == -->
<title>BlenderBIM install nightly</title>
<authors>Dion Moult and many more, see: https://github.com/IfcOpenShell/IfcOpenShell/graphs/contributors</authors>
<projectUrl>https://github.com/IfcOpenShell/IfcOpenShell</projectUrl>
<iconUrl>https://rawcdn.githack.com/IfcOpenShell/IfcOpenShell/c6ee1d1679d1298de0d7447ff108c22709c68e54/choco/blenderbim/blenderbim.png</iconUrl>
<!-- <copyright>Year Software Vendor</copyright> -->
<licenseUrl>https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/COPYING</licenseUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<projectSourceUrl>https://github.com/IfcOpenShell/IfcOpenShell</projectSourceUrl>
<docsUrl>https://blenderbim.org/docs/</docsUrl>
<!--<mailingListUrl></mailingListUrl>-->
<bugTrackerUrl>https://github.com/IfcOpenShell/IfcOpenShell/issues</bugTrackerUrl>
<tags>blender bim blenderbim ifc python opensource foss</tags>
<summary>opensource bim</summary>
<description>opensource bim addon for blender - source code at: https://github.com/IfcOpenShell/IfcOpenShell</description>
<!-- <releaseNotes>__REPLACE_OR_REMOVE__MarkDown_Okay</releaseNotes> -->
<dependencies>
<dependency id="blender" version="latest_blender_version_maj_min_pat" />
<dependency id="7zip" version="22.1"/>
</dependencies>
</metadata>
<files>
<file src="tools\**" target="tools" />
</files>
</package>
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

+80
View File
@@ -0,0 +1,80 @@
import datetime
import re
import sys
from urllib import request
def request_repo_info(url: str):
req = request.Request(url)
resp = request.urlopen(req)
if not resp.status == 200:
print(f"[ERROR] could not contact server: {url}")
quit(1)
return resp
if sys.argv[1] == "--do_choco_release?":
now = datetime.datetime.now()
blenderbim_date = (now - datetime.timedelta(days=1)).strftime("%y%m%d")
url = "https://github.com/IfcOpenShell/IfcOpenShell/releases"
resp = request_repo_info(url)
text = str(resp.read())
if blenderbim_date in text:
print("do_choco_release", end="")
elif sys.argv[1] == "--latest_blender_release_maj_min_pat?":
re_blender_version_min_maj_pat = r"Latest Version.+<span>Blender (\d+\.\d+\.\d+)</span>"
url = "https://community.chocolatey.org/packages/blender"
resp = request_repo_info(url)
html_txt = str(resp.read())
found = re.findall(re_blender_version_min_maj_pat, html_txt)
if found:
print(found[0], end="")
elif sys.argv[1] == "--latest_blender_release_maj_min?":
re_blender_version_min_maj = r"Latest Version.+<span>Blender (\d+\.\d+)\..+</span>"
url = "https://community.chocolatey.org/packages/blender"
resp = request_repo_info(url)
html_txt = str(resp.read())
found = re.findall(re_blender_version_min_maj, html_txt)
if found:
print(found[0], end="")
elif sys.argv[1] == "--latest_blender_python_version_maj_min?":
# get latest blender version first
re_blender_version_min_maj_pat = r"Latest Version.+<span>Blender (\d+\.\d+\.\d+)</span>"
url = "https://community.chocolatey.org/packages/blender"
resp = request_repo_info(url)
html_txt = str(resp.read())
found = re.findall(re_blender_version_min_maj_pat, html_txt)
if found:
latest_blender_version_tag = f"v{found[0]}"
re_blender_python_version_maj_min = r"SET\(PYTHON_VERSION (\d+.\d+) "
url = f"https://raw.githubusercontent.com/blender/blender/{latest_blender_version_tag}/build_files/cmake/Modules/FindPythonLibsUnix.cmake"
resp = request_repo_info(url)
html_txt = str(resp.read())
found = re.findall(re_blender_python_version_maj_min, html_txt)
if found:
print(found[0], end="")
elif sys.argv[1] == "--pyver?":
# get latest blender version first
re_blender_version_min_maj_pat = r"Latest Version.+<span>Blender (\d+\.\d+\.\d+)</span>"
url = "https://community.chocolatey.org/packages/blender"
resp = request_repo_info(url)
html_txt = str(resp.read())
found = re.findall(re_blender_version_min_maj_pat, html_txt)
if found:
latest_blender_version_tag = f"v{found[0]}"
re_blender_python_version_maj_min = r"SET\(PYTHON_VERSION (\d+.\d+) "
url = f"https://raw.githubusercontent.com/blender/blender/{latest_blender_version_tag}/build_files/cmake/Modules/FindPythonLibsUnix.cmake"
resp = request_repo_info(url)
html_txt = str(resp.read())
found = re.findall(re_blender_python_version_maj_min, html_txt)
if found:
print(f"py{found[0].replace('.', '')}", end="")
@@ -0,0 +1,49 @@
import os
from pathlib import Path
print("[INFO] inserting dynamic chocolatey package parameters")
HERE_DIR = Path(__file__).parent.absolute()
# print(f"[INFO] HERE_DIR: {HERE_DIR}")
topics = {
"spec": {
"path": HERE_DIR / "blenderbim.nuspec",
"env_vars": {
"latest_blender_version_maj_min_pat",
"blenderbim_build_version",
},
},
"install": {
"path": HERE_DIR / "tools" / "chocolateyinstall.ps1",
"env_vars": {
"url_blenderbim_py310_win_zip",
"sha256sum_blenderbim_py310_win_zip",
"latest_blender_version_maj_min",
},
},
"uninstall": {
"path": HERE_DIR / "tools" / "chocolateyuninstall.ps1",
"env_vars": {
"latest_blender_version_maj_min",
},
},
}
for topic, info in topics.items():
print(f"[INFO] {topic}:")
for env_var_name in info["env_vars"]:
print(f"[INFO] {env_var_name} exists?: {os.environ[env_var_name]}")
with open(info["path"], encoding="utf-8") as txt:
content = txt.read()
for env_var_name in info["env_vars"]:
# print(f"[INFO] replace: {env_var_name}")
content = content.replace(env_var_name, os.environ[env_var_name])
with open(info["path"], "w", encoding="utf-8") as txt:
txt.write(content)
print(f"[INFO] written: {info['path']}")
print("[INFO] inserting dynamic chocolatey package parameters successful")
@@ -0,0 +1,11 @@
$processName = "blender"
$blenderIsRunning = Get-Process -Name $processName -ErrorAction SilentlyContinue
if($blenderIsRunning -eq $null) {
echo "Blender is not running ready for next action."
}
else {
Write-Warning "$processName is still running - installer cannot safely proceed to next action."
Write-Warning "Please retry after closing all running blender applications."
exit 1
}
@@ -0,0 +1,29 @@
$ErrorActionPreference = 'Stop'
$url64 = 'url_blenderbim_py310_win_zip'
$checksum64 = 'sha256sum_blenderbim_py310_win_zip'
$checksumType64 = 'sha256'
$appDataUserDir = [System.Environment]::GetEnvironmentVariable('appdata')
$unzipTargetDir = "$appDataUserDir\Blender Foundation\Blender\latest_blender_version_maj_min\scripts\addons"
$chocoBaseDir = [System.Environment]::GetEnvironmentVariable('ChocolateyInstall')
$addonEnable = "$chocoBaseDir\lib\blenderbim-nightly\tools\enable_blenderbim_addon.py"
$programFilesDir = [System.Environment]::GetEnvironmentVariable('ProgramFiles')
$blenderExePath = "$env:ProgramFiles\Blender Foundation\Blender latest_blender_version_maj_min\blender.exe"
$processName = "blender"
$blenderIsRunning = Get-Process -Name $processName -ErrorAction SilentlyContinue
if($blenderIsRunning -eq $null) {
echo "attempting to install blenderbim."
Install-ChocolateyZipPackage -PackageName $env:ChocolateyPackageName -Url64 $url64 -Checksum64 $checksum64 -checksumType $checksumType64 -UnzipLocation $unzipTargetDir
Start-Process -FilePath $blenderExePath -ArgumentList "-b", "-y", "--python", "$addonEnable"
}
else {
Write-Warning "$processName is still running - blenderbim cannot be safely installed."
Write-Warning "Please retry after closing all running blender applications."
exit 1
}
@@ -0,0 +1,22 @@
$appDataUserDir = [System.Environment]::GetEnvironmentVariable('appdata')
$unzippedDir = "$appDataUserDir\Blender Foundation\Blender\latest_blender_version_maj_min\scripts\addons\blenderbim"
$chocoBaseDir = [System.Environment]::GetEnvironmentVariable('ChocolateyInstall')
$addonDisable = "$chocoBaseDir\lib\blenderbim-nightly\tools\disable_blenderbim_addon.py"
$programFilesDir = [System.Environment]::GetEnvironmentVariable('ProgramFiles')
$blenderExePath = "$env:ProgramFiles\Blender Foundation\Blender latest_blender_version_maj_min\blender.exe"
$processName = "blender"
$blenderIsRunning = Get-Process -Name $processName -ErrorAction SilentlyContinue
if($blenderIsRunning -eq $null) {
echo "attempting to uninstall blenderbim."
Start-Process -FilePath $blenderExePath -ArgumentList "-b", "-y", "--python", "$addonDisable"
Remove-Item -LiteralPath $unzippedDir -Force -Recurse
}
else {
Write-Warning "$processName is still running - blenderbim cannot be safely uninstalled."
Write-Warning "Please retry after closing all running blender applications."
exit 1
}
@@ -0,0 +1,8 @@
import bpy
bpy.ops.preferences.addon_disable(module='blenderbim')
bpy.ops.wm.save_userpref()
print("disabled blenderbim addon successfully.")
@@ -0,0 +1,8 @@
import bpy
bpy.ops.preferences.addon_enable(module='blenderbim')
bpy.ops.wm.save_userpref()
print("enabled blenderbim addon successfully.")
+154 -51
View File
@@ -38,7 +38,7 @@ MESSAGE(STATUS "Autodesk 3ds Max SDK found at ${max_sdk}")
set(HAS_MAX TRUE)
endif()
endforeach()
OPTION(MINIMAL_BUILD "The build is to make a minimal version of IFC converter from OCCT into IFC." OFF)
OPTION(COLLADA_SUPPORT "Build IfcConvert with COLLADA support (requires OpenCOLLADA)." ON)
OPTION(IFCXML_SUPPORT "Build IfcParse with ifcXML support (requires libxml2)." ON)
OPTION(ENABLE_BUILD_OPTIMIZATIONS "Enable certain compiler and linker optimizations on RelWithDebInfo and Release builds." OFF)
@@ -53,6 +53,8 @@ OPTION(HDF5_SUPPORT "Enable HDF5 support (requires HDF5, zlib)" ON)
OPTION(USE_VLD "Use Visual Leak Detector for debugging memory leaks, MSVC-only." OFF)
OPTION(USE_MMAP "Adds a command line options to parse IFC files from memory mapped files using Boost.Iostreams" OFF)
OPTION(BUILD_SHARED_LIBS "Build IfcParse and IfcGeom as shared libs (SO/DLL)." OFF)
OPTION(MSVC_PARALLEL_BUILD "Multi-threaded compilation in Microsoft Visual Studio (/MP)" OFF)
OPTION(WASM_BUILD OFF)
if (${HAS_MAX})
OPTION(BUILD_IFCMAX "Build IfcMax, a 3ds Max plug-in, Windows-only." OFF)
endif()
@@ -66,8 +68,12 @@ IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE "Release")
ENDIF()
# TODO QtViewer is deprecated ATM as it uses the 0.4 API
# OPTION(BUILD_QTVIEWER "Build IfcOpenShell Qt GUI Viewer (requires Qt 4 framework)." OFF)
if(MSVC AND MSVC_PARALLEL_BUILD)
add_definitions("/MP")
endif()
# QtViewer requires Qt5
OPTION(BUILD_QTVIEWER "Build IfcOpenShell Qt GUI Viewer" OFF)
include(GNUInstallDirs)
if((BUILD_CONVERT OR BUILD_GEOMSERVER OR BUILD_IFCPYTHON) AND (NOT BUILD_IFCGEOM))
message(STATUS "'IfcGeom' is required with current outputs")
@@ -121,6 +127,7 @@ ENDMACRO()
UNIFY_ENVVARS_AND_CACHE(OCC_INCLUDE_DIR)
UNIFY_ENVVARS_AND_CACHE(OCC_LIBRARY_DIR)
if (NOT MINIMAL_BUILD)
UNIFY_ENVVARS_AND_CACHE(OPENCOLLADA_INCLUDE_DIR)
UNIFY_ENVVARS_AND_CACHE(OPENCOLLADA_LIBRARY_DIR)
UNIFY_ENVVARS_AND_CACHE(LIBXML2_INCLUDE_DIR)
@@ -130,17 +137,28 @@ UNIFY_ENVVARS_AND_CACHE(PYTHON_EXECUTABLE)
UNIFY_ENVVARS_AND_CACHE(HDF5_INCLUDE_DIR)
UNIFY_ENVVARS_AND_CACHE(HDF5_LIBRARY_DIR)
UNIFY_ENVVARS_AND_CACHE(HDF5_LIBRARIES)
endif()
UNIFY_ENVVARS_AND_CACHE(BOOST_ROOT)
UNIFY_ENVVARS_AND_CACHE(BOOST_LIBRARYDIR)
if (NOT MINIMAL_BUILD)
UNIFY_ENVVARS_AND_CACHE(CGAL_INCLUDE_DIR)
UNIFY_ENVVARS_AND_CACHE(CGAL_LIBRARY_DIR)
UNIFY_ENVVARS_AND_CACHE(GMP_INCLUDE_DIR)
UNIFY_ENVVARS_AND_CACHE(GMP_LIBRARY_DIR)
UNIFY_ENVVARS_AND_CACHE(MPFR_INCLUDE_DIR)
UNIFY_ENVVARS_AND_CACHE(MPFR_LIBRARY_DIR)
endif()
if (GLTF_SUPPORT AND BUILD_CONVERT)
if(WASM_BUILD)
# when using the nix/build-all.py build script we should not
# look into the sysroot for most of the dependencies but rather
# in the designated build/ folder created by the script.
set(CMAKE_FIND_ROOT_PATH_BACKUP "${CMAKE_FIND_ROOT_PATH}")
set(CMAKE_FIND_ROOT_PATH "")
endif()
if (NOT MINIMAL_BUILD AND GLTF_SUPPORT AND BUILD_CONVERT)
UNIFY_ENVVARS_AND_CACHE(JSON_INCLUDE_DIR)
FIND_FILE(json_hpp "json.hpp" ${JSON_INCLUDE_DIR}/nlohmann)
IF(json_hpp)
@@ -190,7 +208,14 @@ ELSE()
ENDIF()
ENDIF()
set(BOOST_COMPONENTS system program_options regex thread date_time)
if (WASM_BUILD)
set(BOOST_COMPONENTS)
else()
# @todo review this, shouldn't this be all possible header-only now?
# ... or rewritten using C++17 features?
set(BOOST_COMPONENTS system program_options regex thread date_time)
endif()
if(USE_MMAP)
if(MSVC)
# filesystem is necessary for the utf-16 wpath
@@ -201,18 +226,19 @@ if(USE_MMAP)
add_definitions(-DUSE_MMAP)
endif()
# libxml2 is required for IFCXML (optional) and SVGFILL (mandatory)
find_package(LibXml2 REQUIRED)
if (IFCXML_SUPPORT)
add_definitions(-DWITH_IFCXML)
set(SWIG_DEFINES ${SWIG_DEFINES} -DWITH_IFCXML)
endif()
FIND_PACKAGE(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
MESSAGE(STATUS "Boost include files found in ${Boost_INCLUDE_DIRS}")
MESSAGE(STATUS "Boost libraries found in ${Boost_LIBRARY_DIRS}")
if (NOT MINIMAL_BUILD)
# libxml2 is required for IFCXML (optional) and SVGFILL (mandatory)
find_package(LibXml2 REQUIRED)
endif()
if (NOT MINIMAL_BUILD AND IFCXML_SUPPORT)
add_definitions(-DWITH_IFCXML)
set(SWIG_DEFINES ${SWIG_DEFINES} -DWITH_IFCXML)
endif()
# Usage:
# set(SOME_LIRARIES foo bar)
@@ -332,10 +358,21 @@ if("${libTKernelExt}" STREQUAL ".a")
set(OCCT_STATIC ON)
endif()
if(WASM_BUILD)
set(CMAKE_FIND_ROOT_PATH "${CMAKE_FIND_ROOT_PATH_BACKUP}")
endif()
if(OCCT_STATIC)
find_package(Threads)
# OPENCASCADE_LIBRARIES repeated three times below in order to fix cyclic dependencies - use --start-group ... --end-group instead?
set(OPENCASCADE_LIBRARIES ${OPENCASCADE_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
if(WASM_BUILD)
set(OPENCASCADE_LIBRARIES ${OPENCASCADE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
else()
# OPENCASCADE_LIBRARIES repeated N times below in order to fix cyclic dependencies - use --start-group ... --end-group instead?
# tfk: --start-group ... --end-group didn't work on the apple linker when last tested
set(OPENCASCADE_LIBRARIES ${OPENCASCADE_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
endif()
if (NOT APPLE AND NOT WIN32)
set(OPENCASCADE_LIBRARIES ${OPENCASCADE_LIBRARIES} "rt")
endif()
@@ -346,7 +383,7 @@ endif()
endif(BUILD_IFCGEOM)
IF(COLLADA_SUPPORT)
IF(NOT MINIMAL_BUILD AND COLLADA_SUPPORT)
# Find OpenCOLLADA
IF("${OPENCOLLADA_INCLUDE_DIR}" STREQUAL "")
MESSAGE(STATUS "No OpenCOLLADA include directory specified")
@@ -426,7 +463,7 @@ IF(COLLADA_SUPPORT)
ENDIF()
ENDIF()
if(HDF5_SUPPORT)
if(NOT MINIMAL_BUILD AND HDF5_SUPPORT)
IF("${HDF5_INCLUDE_DIR}" STREQUAL "")
MESSAGE(STATUS "No HDF5 include directory specified")
ElSE()
@@ -441,30 +478,60 @@ if(HDF5_SUPPORT)
if (HDF5_LIBRARY_DIR)
# result of the HDF5 ctest package
if (WIN32)
set(zlib_post lib)
set(lib_ext lib)
else()
set(lib_ext a)
# Find zlib using cmake find_library. How should this be implemented?
# FIND_LIBRARY(NAMES z libz libz_debug PATHS ... NO_DEFAULT_PATH)
if ("$ENV{CONDA_BUILD}" STREQUAL "")
# result of the HDF5 ctest package
if (WIN32)
set(zlib_post lib)
set(lib_ext lib)
else()
set(lib_ext a)
endif()
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
set(debug_postfix "_debug")
endif()
SET(HDF5_LIBRARIES
"${HDF5_LIBRARY_DIR}/libhdf5_cpp${debug_postfix}.${lib_ext}"
"${HDF5_LIBRARY_DIR}/libhdf5${debug_postfix}.${lib_ext}"
"${HDF5_LIBRARY_DIR}/libz${zlib_post}${debug_postfix}.${lib_ext}"
"${HDF5_LIBRARY_DIR}/libsz${debug_postfix}.${lib_ext}"
"${HDF5_LIBRARY_DIR}/libaec${debug_postfix}.${lib_ext}"
)
ELSE()
MESSAGE(STATUS "Packaging hdf5 and zlib for conda distribution")
if (WIN32)
# Windows
set(zlib_post zlib)
set(lib_ext lib)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# macOS
set(zlib_post libz)
set(lib_ext dylib)
else()
# linux
set(zlib_post libz)
set(lib_ext so)
endif()
SET(HDF5_LIBRARIES
"${HDF5_LIBRARY_DIR}/libhdf5_cpp.${lib_ext}"
"${HDF5_LIBRARY_DIR}/libhdf5.${lib_ext}"
"${HDF5_LIBRARY_DIR}/${zlib_post}.${lib_ext}"
)
endif()
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
set(debug_postfix "_debug")
endif()
SET(HDF5_LIBRARIES
"${HDF5_LIBRARY_DIR}/libhdf5_cpp${debug_postfix}.${lib_ext}"
"${HDF5_LIBRARY_DIR}/libhdf5${debug_postfix}.${lib_ext}"
"${HDF5_LIBRARY_DIR}/libz${zlib_post}${debug_postfix}.${lib_ext}"
"${HDF5_LIBRARY_DIR}/libsz${debug_postfix}.${lib_ext}"
"${HDF5_LIBRARY_DIR}/libaec${debug_postfix}.${lib_ext}"
)
endif()
if (NOT HDF5_LIBRARIES)
# debian default
SET(HDF5_LIBRARIES
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5_cpp.so
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.so
@@ -579,13 +646,21 @@ function(files_for_ifc_version IFC_VERSION RESULT_NAME)
endfunction()
if(NOT SCHEMA_VERSIONS)
set(SCHEMA_VERSIONS "2x3" "4" "4x1" "4x2" "4x3_rc1" "4x3_rc2" "4x3_rc3" "4x3_rc4")
if(WASM_BUILD)
# super arbitrarily try to keep size down at least a little bit
set(SCHEMA_VERSIONS "2x3" "4")
else()
set(SCHEMA_VERSIONS "2x3" "4" "4x1" "4x2" "4x3_rc1" "4x3_rc2" "4x3_rc3" "4x3_rc4" "4x3" "4x3_tc1" "4x3_add1")
endif()
endif()
foreach(s ${SCHEMA_VERSIONS})
add_definitions(-DHAS_SCHEMA_${s})
endforeach()
string(REPLACE ";" ")(" schema_version_seq "(${SCHEMA_VERSIONS})")
ADD_DEFINITIONS(-DSCHEMA_SEQ=${schema_version_seq})
if(COMPILE_SCHEMA)
# @todo, this appears to be untested at the moment
@@ -653,9 +728,13 @@ if (BUILD_IFCGEOM)
foreach(s ${SCHEMA_VERSIONS})
set(IFCGEOM_SCHEMA_LIBRARIES ${IFCGEOM_SCHEMA_LIBRARIES} IfcGeom_ifc${s})
endforeach()
set(IFCOPENSHELL_LIBRARIES ${IFCOPENSHELL_LIBRARIES} IfcGeom ${IFCGEOM_SCHEMA_LIBRARIES} IfcGeom ${IFCGEOM_SCHEMA_LIBRARIES})
if (WASM_BUILD)
set(IFCOPENSHELL_LIBRARIES ${IFCOPENSHELL_LIBRARIES} IfcGeom ${IFCGEOM_SCHEMA_LIBRARIES})
else()
set(IFCOPENSHELL_LIBRARIES ${IFCOPENSHELL_LIBRARIES} IfcGeom ${IFCGEOM_SCHEMA_LIBRARIES} IfcGeom ${IFCGEOM_SCHEMA_LIBRARIES})
endif()
endif()
if (BUILD_CONVERT)
if (BUILD_CONVERT OR BUILD_IFCPYTHON)
foreach(s ${SCHEMA_VERSIONS})
set(SERIALIZER_SCHEMA_LIBRARIES ${SERIALIZER_SCHEMA_LIBRARIES} Serializers_ifc${s})
endforeach()
@@ -697,7 +776,11 @@ set(IFCPARSE_FILES ${IFCPARSE_CPP_FILES} ${IFCPARSE_H_FILES})
add_library(IfcParse ${IFCPARSE_FILES})
set_target_properties(IfcParse PROPERTIES COMPILE_FLAGS -DIFC_PARSE_EXPORTS VERSION "0.6.0" SOVERSION "0.6")
TARGET_LINK_LIBRARIES(IfcParse ${Boost_LIBRARIES} ${BCRYPT_LIBRARIES} ${LIBXML2_LIBRARIES})
if (WASM_BUILD)
TARGET_LINK_LIBRARIES(IfcParse ${BCRYPT_LIBRARIES} ${LIBXML2_LIBRARIES})
else()
TARGET_LINK_LIBRARIES(IfcParse ${Boost_LIBRARIES} ${BCRYPT_LIBRARIES} ${LIBXML2_LIBRARIES})
endif()
if (BUILD_IFCGEOM)
@@ -709,7 +792,9 @@ set(IFCGEOM_FILES ${IFCGEOM_CPP_FILES} ${IFCGEOM_H_FILES})
foreach(s ${SCHEMA_VERSIONS})
add_library(IfcGeom_ifc${s} STATIC ${IFCGEOM_FILES})
set_target_properties(IfcGeom_ifc${s} PROPERTIES COMPILE_FLAGS "-DIFC_GEOM_EXPORTS -DIfcSchema=Ifc${s}")
TARGET_LINK_LIBRARIES(IfcGeom_ifc${s} IfcParse ${OPENCASCADE_LIBRARIES})
if (NOT WASM_BUILD)
TARGET_LINK_LIBRARIES(IfcGeom_ifc${s} IfcParse ${OPENCASCADE_LIBRARIES})
endif()
endforeach()
# IfcGeom (schema agnostic)
@@ -724,11 +809,15 @@ if (UNIX)
find_package(Threads)
endif()
TARGET_LINK_LIBRARIES(IfcGeom IfcParse ${IFCGEOM_SCHEMA_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
if (WASM_BUILD)
TARGET_LINK_LIBRARIES(IfcGeom ${IFCGEOM_SCHEMA_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
else()
TARGET_LINK_LIBRARIES(IfcGeom IfcParse ${IFCGEOM_SCHEMA_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
endif()
endif(BUILD_IFCGEOM)
if (BUILD_CONVERT)
if (BUILD_CONVERT OR BUILD_IFCPYTHON)
# Serializers
file(GLOB SERIALIZERS_H_FILES ../src/serializers/*.h)
@@ -741,7 +830,12 @@ set(SERIALIZERS_S_FILES ${SERIALIZERS_S_H_FILES} ${SERIALIZERS_S_CPP_FILES})
foreach(s ${SCHEMA_VERSIONS})
add_library(Serializers_ifc${s} STATIC ${SERIALIZERS_S_FILES})
set_target_properties(Serializers_ifc${s} PROPERTIES COMPILE_FLAGS "-DIFC_GEOM_EXPORTS -DIfcSchema=Ifc${s} ${CONVERT_PRECISION}")
TARGET_LINK_LIBRARIES(Serializers_ifc${s} IfcGeom ${OPENCASCADE_LIBRARIES} ${HDF5_LIBRARIES})
if (WASM_BUILD)
TARGET_LINK_LIBRARIES(Serializers_ifc${s} ${HDF5_LIBRARIES})
else()
TARGET_LINK_LIBRARIES(Serializers_ifc${s} IfcGeom ${OPENCASCADE_LIBRARIES} ${HDF5_LIBRARIES})
endif()
endforeach()
add_library(Serializers ${SERIALIZERS_FILES})
@@ -749,6 +843,10 @@ set_target_properties(Serializers PROPERTIES COMPILE_FLAGS "-DIFC_GEOM_EXPORTS $
TARGET_LINK_LIBRARIES(Serializers ${SERIALIZER_SCHEMA_LIBRARIES} ${OPENCOLLADA_LIBRARIES})
endif(BUILD_CONVERT or BUILD_IFCPYTHON)
if (BUILD_CONVERT)
# IfcConvert
file(GLOB IFCCONVERT_CPP_FILES ../src/ifcconvert/*.cpp)
file(GLOB IFCCONVERT_H_FILES ../src/ifcconvert/*.h)
@@ -774,7 +872,7 @@ INSTALL(TARGETS IfcConvert
endif(BUILD_CONVERT)
# IfcGeomServer
if(BUILD_GEOMSERVER)
if(NOT MINIMAL_BUILD AND BUILD_GEOMSERVER)
file(GLOB CPP_FILES ../src/ifcgeomserver/*.cpp)
file(GLOB H_FILES ../src/ifcgeomserver/*.h)
@@ -805,7 +903,8 @@ if (GIT_FOUND)
)
string(REPLACE "\n" ";" git_branch_list "${git_branches}")
foreach(git_branch_candidate IN ITEMS ${git_branch_list})
string(STRIP "${git_branch_candidate}" git_branch_candidate_2)
string(REPLACE "*" "" git_branch_candidate_temp "${git_branch_candidate}")
string(STRIP "${git_branch_candidate_temp}" git_branch_candidate_2)
if (NOT git_branch_candidate_2 MATCHES "^HEAD$")
set(git_branch ${git_branch_candidate_2})
endif()
@@ -828,7 +927,7 @@ IF(BUILD_DOCUMENTATION)
ADD_SUBDIRECTORY(../docs docs)
ENDIF()
IF(BUILD_IFCPYTHON)
IF(NOT MINIMAL_BUILD AND BUILD_IFCPYTHON)
ADD_SUBDIRECTORY(../src/ifcwrap ifcwrap)
ENDIF()
@@ -836,11 +935,12 @@ IF(BUILD_EXAMPLES)
ADD_SUBDIRECTORY(../src/examples examples)
ENDIF()
IF(BUILD_IFCMAX)
IF(NOT MINIMAL_BUILD AND BUILD_IFCMAX)
ADD_SUBDIRECTORY(../src/ifcmax ifcmax)
ENDIF()
if (NOT MINIMAL_BUILD)
ADD_SUBDIRECTORY(../src/svgfill svgfill)
endif()
# CMake installation targets
INSTALL(FILES ${IFCPARSE_H_FILES}
@@ -885,6 +985,9 @@ INSTALL(FILES ${SERIALIZERS_S_FILES}
)
endif()
IF(BUILD_QTVIEWER)
ADD_SUBDIRECTORY(../src/qtviewer qtviewer)
endif()
list(APPEND CPACK_SOURCE_IGNORE_FILES
.git
@@ -909,12 +1012,12 @@ set(CPACK_SOURCE_GENERATOR "TGZ")
FOREACH(COMPONENT IN ITEMS ${BOOST_COMPONENTS})
string(REPLACE "_" "-" COMP ${COMPONENT})
set(BOOST_DEPS "${BOOST_DEPS}, libboost-${COMP}1.67.0")
set(BOOST_DEPS "${BOOST_DEPS}, libboost-${COMP}-dev")
endforeach(COMPONENT)
set(CPACK_DEBIAN_PACKAGE_NAME "${PROJECT_NAME}")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_PACKAGE_CONTACT}")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "python3, libxml2, liboce-foundation11, liboce-modeling11, liboce-ocaf11, liboce-visualization11, liboce-ocaf-lite11, libpython3.8 ${BOOST_DEPS}")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "python3, libxml2, libocct-foundation-dev, libocct-modeling-algorithms-dev, libocct-modeling-data-dev, libocct-ocaf-dev, libocct-visualization-dev, libocct-data-exchange-dev, libhdf5-serial-dev, libpython3.8, python3-pytest ${BOOST_DEPS}")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION_SUMMARY "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION}")
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
+8
View File
@@ -0,0 +1,8 @@
compile:
conda activate conda-build && conda-build -c conda-forge . --keep-old-work --python 3.10.5
debug:
conda activate conda-build && conda-debug -c conda-forge . --python 3.10.4
env:
conda env update --f environment.yml --prune
+38 -23
View File
@@ -1,29 +1,44 @@
mkdir build && cd build
REM Remove dot from PY_VER for use in library name
REM From https://github.com/tpaviot/pythonocc-core/blob/master/ci/conda/bld.bat
set MY_PY_VER=%PY_VER:.=%
set LIBXML2="%LIBRARY_PREFIX%/lib/libxml2.lib"
cmake -G "NMake Makefiles" ^
-DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
-DCMAKE_SYSTEM_PREFIX_PATH="%LIBRARY_PREFIX%" ^
-DPYTHON_EXECUTABLE="%PYTHON%" ^
-DPYTHON_INCLUDE_DIR="%PREFIX%"/include ^
-DPYTHON_LIBRARY="%PREFIX%"/libs/python%MY_PY_VER%.lib ^
-DBOOST_LIBRARYDIR="%LIBRARY_PREFIX%\lib" ^
-DBOOST_INCLUDEDIR="%LIBRARY_PREFIX%\include" ^
-DOCC_INCLUDE_DIR="%LIBRARY_PREFIX%\include\oce" ^
-DOCC_LIBRARY_DIR="%LIBRARY_PREFIX%\lib" ^
-DCOLLADA_SUPPORT=Off ^
-DBUILD_EXAMPLES=Off ^
-DBUILD_GEOMSERVER=Off ^
-DBUILD_CONVERT=Off ^
../cmake
if errorlevel 1 exit 1
cmake --build . --target INSTALL --config Release
cmake -G "Ninja" ^
-D CMAKE_BUILD_TYPE:STRING=Release ^
-D CMAKE_INSTALL_PREFIX:FILEPATH="%LIBRARY_PREFIX%" ^
-D CMAKE_PREFIX_PATH:FILEPATH="%LIBRARY_PREFIX%" ^
-D CMAKE_SYSTEM_PREFIX_PATH:FILEPATH="%LIBRARY_PREFIX%" ^
-D OCC_INCLUDE_DIR:FILEPATH="%LIBRARY_PREFIX%\include\opencascade" ^
-D OCC_LIBRARY_DIR:FILEPATH="%LIBRARY_PREFIX%\lib" ^
-D CGAL_INCLUDE_DIR:FILEPATH="%LIBRARY_PREFIX%\include" ^
-D GMP_INCLUDE_DIR:FILEPATH="%LIBRARY_PREFIX%\include" ^
-D GMP_LIBRARY_DIR:FILEPATH="%LIBRARY_PREFIX%\lib" ^
-D MPFR_LIBRARY_DIR:FILEPATH="%LIBRARY_PREFIX%\lib" ^
-D COLLADA_SUPPORT=OFF ^
-D HDF5_SUPPORT=ON ^
-D HDF5_INCLUDE_DIR="%LIBRARY_PREFIX%\include" ^
-D HDF5_LIBRARY_DIR="%LIBRARY_PREFIX%\lib" ^
-D JSON_INCLUDE_DIR="%LIBRARY_PREFIX%\include" ^
-D PYTHON_INCLUDE_DIR=%PREFIX%\include ^
-D PYTHON_EXECUTABLE:FILEPATH=%PREFIX%\python.exe ^
-D PYTHON_LIBRARY:FILEPATH="%PREFIX%"\libs/python%MY_PY_VER%.lib ^
-D BUILD_IFCPYTHON=ON ^
-D BUILD_IFCGEOM=ON ^
-D COLLADA_SUPPORT:BOOL=OFF ^
-D BUILD_EXAMPLES:BOOL=OFF ^
-D BUILD_GEOMSERVER:BOOL=OFF ^
-D GLTF_SUPPORT:BOOL=ON ^
-D BUILD_CONVERT:BOOL=ON ^
-D BUILD_IFCMAX:BOOL=OFF ^
-D IFCXML_SUPPORT:BOOL=ON ^
-D Boost_LIBRARYDIR:FILEPATH="%LIBRARY_PREFIX%\lib" ^
-D Boost_INCLUDEDIR:FILEPATH="%LIBRARY_PREFIX%\include" ^
-D Boost_USE_STATIC_LIBS:BOOL=OFF ^
%SRC_DIR%/cmake
if errorlevel 1 exit 1
:: Build and install
cmake --build . -- install
if errorlevel 1 exit 1
+34 -24
View File
@@ -1,34 +1,44 @@
# From https://github.com/tpaviot/pythonocc-core/blob/master/ci/conda/build.sh
if [ "$PY3K" == "1" ]; then
MY_PY_VER="${PY_VER}m"
else
MY_PY_VER="${PY_VER}"
#!/bin/bash
declare -a CMAKE_PLATFORM_FLAGS
if [[ ${HOST} =~ .*linux.* ]]; then
CMAKE_PLATFORM_FLAGS+=(-DCMAKE_TOOLCHAIN_FILE=$RECIPE_DIR/cross-linux.cmake)
fi
if [ `uname` == Darwin ]; then
PY_LIB="libpython${MY_PY_VER}.dylib"
export CFLAGS="$CFLAGS -Wl,-flat_namespace,-undefined,suppress"
export CXXFLAGS="$CXXFLAGS -Wl,-flat_namespace,-undefined,suppress"
export LDFLAGS="$LDFLAGS -Wl,-flat_namespace,-undefined,suppress"
else
PY_LIB="libpython${MY_PY_VER}.so"
export CFLAGS="$CFLAGS -Wl,-flat_namespace,-undefined,suppress"
export CXXFLAGS="$CXXFLAGS -Wl,-flat_namespace,-undefined,suppress"
export LDFLAGS="$LDFLAGS -Wl,-flat_namespace,-undefined,suppress"
fi
mkdir build && cd build
cmake \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
${CMAKE_PLATFORM_FLAGS[@]} \
-DCMAKE_PREFIX_PATH=$PREFIX \
-DCMAKE_SYSTEM_PREFIX_PATH=$PREFIX \
-DOCC_INCLUDE_DIR=$PREFIX/include/oce \
-DOCC_LIBRARY_DIR=$PREFIX/lib \
-DPYTHON_EXECUTABLE:FILEPATH=$PYTHON \
-DPYTHON_INCLUDE_DIR:PATH=$PREFIX/include/python$MY_PY_VER \
-DPYTHON_LIBRARY:FILEPATH=$PREFIX/lib/${PY_LIB} \
-DCOLLADA_SUPPORT=Off \
../cmake
-DGMP_LIBRARY_DIR=$PREFIX/lib \
-DMPFR_LIBRARY_DIR=$PREFIX/lib \
-DOCC_INCLUDE_DIR=$PREFIX/include/opencascade \
-DOCC_LIBRARY_DIR=$PREFIX/lib \
-DHDF5_SUPPORT:BOOL=ON \
-DHDF5_INCLUDE_DIR=$PREFIX/include \
-DHDF5_LIBRARY_DIR=$PREFIX/lib \
-DJSON_INCLUDE_DIR=$PREFIX/include \
-DCGAL_INCLUDE_DIR=$PREFIX/include \
-DCOLLADA_SUPPORT=0 \
-DBUILD_EXAMPLES:BOOL=OFF \
-DIFCXML_SUPPORT:BOOL=ON \
-DGLTF_SUPPORT:BOOL=ON \
-DBUILD_CONVERT:BOOL=ON \
-DBUILD_IFCPYTHON:BOOL=ON \
-DBUILD_IFCGEOM:BOOL=ON \
-DBUILD_GEOMSERVER:BOOL=OFF \
-DBOOST_USE_STATIC_LIBS:BOOL=OFF \
./cmake
make -j$CPU_COUNT _ifcopenshell_wrapper
cd ifcwrap
make install/local
ninja
ninja install -j 2
+2
View File
@@ -0,0 +1,2 @@
CONDA_BUILD_SYSROOT:
- /opt/MacOSX10.13.sdk # [osx]
+16
View File
@@ -0,0 +1,16 @@
# this one is important
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_PLATFORM Linux)
# specify the cross compiler
set(CMAKE_C_COMPILER $ENV{CC})
set(CMAKE_CXX_COMPILER $ENV{CXX})
# where is the target environment
set(CMAKE_FIND_ROOT_PATH $ENV{PREFIX} $ENV{BUILD_PREFIX}/$ENV{HOST}/sysroot)
# search for programs in the build host directories
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+14
View File
@@ -0,0 +1,14 @@
name: conda-build
channels:
- conda-forge
dependencies:
- conda-build
- conda-verify
- anaconda-client
- ninja
- doxygen
- ripgrep
- pip
- pip:
- --extra-index-url https://lief.s3-website.fr-par.scw.cloud/latest
- lief==0.13.0.dev0
+49 -30
View File
@@ -1,42 +1,61 @@
{% set name = "ifcopenshell" %}
{% set version = "0.7.0" %}
package:
name: ifcopenshell
version: "0.6.0a1"
name: {{ name }}
version: {{ version }}
source:
git_rev: "v0.6.0a1"
git_url: https://github.com/IfcOpenShell/IfcOpenShell
path: ..
build:
number: 0
features:
- vc9 # [win and py27]
- vc10 # [win and py34]
- vc14 # [win and py35]
- vc14 # [win and py36]
binary_relocation: false [osx]
number: 1
requirements:
build:
- gcc # [osx]
- make
- python
- oce ==0.18.3
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- ninja >=1.10.2
- cmake
- swig >=3.0.9
- libboost
- icu
- xmlschema
- lxml
- numpy
run:
- libgcc # [osx]
- swig >=4.0.2
host:
- python
- oce ==0.18.3
- libboost
- icu
- xmlschema
- lxml
- numpy
- boost-cpp
- occt
- libxml2
- cgal-cpp
- hdf5
- mpfr
- gmp # [unix]
- mpir # [win]
- nlohmann_json
run:
- python
- boost-cpp
- occt
- libxml2
- cgal-cpp
- hdf5
- mpfr
- gmp # [unix]
- mpir # [win]
- nlohmann_json
test:
imports:
- ifcopenshell
about:
home: http://ifcopenshell.org
license: LGPL
license: LGPL-3.0-or-later
license_file: COPYING
summary: 'IfcOpenShell is a library to support the IFC file format'
description: |
IfcOpenShell is an open source (LGPL) software library for
working with the Industry Foundation Classes (IFC) file format.
doc_url: http://ifcopenshell.org/
dev_url: https://github.com/IfcOpenShell/IfcOpenShell
+187 -79
View File
@@ -23,10 +23,10 @@
# This script builds IfcOpenShell and its dependencies #
# #
# Prerequisites for this script to function correctly: #
# * cmake * git * bzip2 * tar * c(++) compilers * yacc * autoconf #
# * cmake * git * bzip2 * tar * c(++) compilers * autoconf #
# #
# if building with USE_OCCT additionally: #
# * freetype * glx.h #
# * glx.h #
# #
# if building with OCCT 7.4.0 additionally: #
# * libfontconfig1-dev #
@@ -39,14 +39,14 @@
# #
# on debian 7.8 these can be obtained with: #
# $ apt-get install git gcc g++ autoconf bison bzip2 cmake #
# libfreetype6-dev mesa-common-dev libffi-dev libfontconfig1-dev #
# mesa-common-dev libffi-dev libfontconfig1-dev #
# #
# on ubuntu 14.04: #
# $ apt-get install git gcc g++ autoconf bison make cmake #
# libfreetype6-dev mesa-common-dev libffi-dev libfontconfig1-dev #
# mesa-common-dev libffi-dev libfontconfig1-dev #
# #
# on OS X El Capitan with homebrew: #
# $ brew install git bison autoconf automake freetype libffi cmake #
# $ brew install git bison autoconf automake libffi cmake #
# #
###############################################################################
import logging
@@ -72,19 +72,19 @@ PROJECT_NAME = "IfcOpenShell"
USE_CURRENT_PYTHON_VERSION = os.getenv("USE_CURRENT_PYTHON_VERSION")
ADD_COMMIT_SHA = os.getenv("ADD_COMMIT_SHA")
PYTHON_VERSIONS = ["3.6.14", "3.7.12", "3.8.12", "3.9.7", "3.10.0"]
PYTHON_VERSIONS = ["3.6.14", "3.7.13", "3.8.13", "3.9.11", "3.10.3", "3.11.0"]
JSON_VERSION = "v3.6.1"
OCE_VERSION = "0.18.3"
OCCT_VERSION = "7.5.3"
BOOST_VERSION = "1.71.0"
BOOST_VERSION = "1.80.0"
PCRE_VERSION = "8.41"
LIBXML2_VERSION = "2.9.11"
SWIG_VERSION = "4.0.2"
OPENCOLLADA_VERSION = "v1.6.68"
HDF5_VERSION = "1.12.1"
GMP_VERSION = "6.1.2"
MPFR_VERSION = "3.1.5" # latest is 4.1.0
GMP_VERSION = "6.2.1"
MPFR_VERSION = "3.1.6" # latest is 4.1.0
CGAL_VERSION = "5.3"
# binaries
@@ -97,13 +97,15 @@ cc = "cc"
cplusplus = "c++"
autoconf = "autoconf"
automake = "automake"
yacc = "yacc"
make = "make"
date = "date"
curl = "curl"
wget = "wget"
strip = "strip"
explicit_targets = [s for s in sys.argv[1:] if not s.startswith("-")]
flags = set(s.lstrip('-') for s in sys.argv[1:] if s.startswith("-"))
# Helper function for coloured printing
NO_COLOR = "\033[0m" # <ref>http://stackoverflow.com/questions/5947742/how-to-change-the-output-color-of-echo-in-linux</ref>
@@ -136,9 +138,11 @@ if platform.system() == "Darwin":
IFCOS_NUM_BUILD_PROCS = os.getenv("IFCOS_NUM_BUILD_PROCS", multiprocessing.cpu_count() + 1)
CMAKE_DIR = os.path.realpath(os.path.join("..", "cmake"))
CMAKE_DIR = os.path.realpath(os.path.join(os.path.dirname(__file__), "..", "cmake"))
path = ["..", "build", platform.system(), platform.machine()]
build_dir = os.environ.get("BUILD_DIR", os.path.join(os.path.dirname(__file__), "..", "build"))
path = [build_dir, platform.system(), "wasm" if "wasm" in flags else platform.machine()]
if TOOLSET:
path.append(TOOLSET)
DEFAULT_DEPS_DIR = os.path.realpath(os.path.join(*path))
@@ -187,11 +191,12 @@ dependency_tree = {
'boost': (),
'libxml2': (),
'python': (),
'occ': (),
'occ': ('freetype',),
'pcre': (),
'json': (),
'hdf5': (),
'cgal': ()
'cgal': (),
'freetype': (),
}
def v(dep):
@@ -200,10 +205,12 @@ def v(dep):
for x in v(d):
yield x
tgts = [s for s in sys.argv[1:] if not s.startswith("-")]
flags = set(s for s in sys.argv[1:] if s.startswith("-"))
if "v" in flags:
logger.setLevel(logging.DEBUG)
else:
logger.setLevel(logging.INFO)
BUILD_STATIC = not "-shared" in flags
BUILD_STATIC = "shared" not in flags
ENABLE_FLAG = "--enable-static" if BUILD_STATIC else "--enable-shared"
DISABLE_FLAG = "--disable-shared" if BUILD_STATIC else "--disable-static"
LINK_TYPE = "static" if BUILD_STATIC else "shared"
@@ -211,16 +218,21 @@ LINK_TYPE_UCFIRST = LINK_TYPE[0].upper() + LINK_TYPE[1:]
LIBRARY_EXT = "a" if BUILD_STATIC else "so"
PIC = "-fPIC" if BUILD_STATIC else ""
if len(tgts):
targets = set(sum((list(v(target)) for target in tgts), []))
if any(f.startswith("py-") for f in flags):
PYTHON_VERSIONS = [pyv for pyv in PYTHON_VERSIONS if "py-%s" % "".join(pyv.split('.')[0:2]) in flags]
if len(explicit_targets):
targets = set(sum((list(v(target)) for target in explicit_targets), []))
else:
targets = set(dependency_tree.keys())
targets = set(t for t in targets if 'without-%s' % t.lower() not in flags)
print("Building:", *sorted(targets, key=lambda t: len(list(v(t)))))
# Check that required tools are in PATH
for cmd in [git, bunzip2, tar, cc, cplusplus, autoconf, automake, yacc, make, "patch", "cmake"]:
for cmd in [git, bunzip2, tar, cc, cplusplus, autoconf, automake, make, "patch", "cmake"]:
if which(cmd) is None:
raise ValueError(f"Required tool '{cmd}' not installed or not added to PATH")
@@ -238,7 +250,7 @@ if not os.path.exists(LOG_FILE):
open(LOG_FILE, "w").close()
logger.info(f"using command log file '{LOG_FILE}'")
def run(cmds, cwd=None):
def run(cmds, cwd=None, can_fail=False):
"""
Wraps `subprocess.Popen.communicate()` and logs the command being executed,
@@ -255,7 +267,7 @@ def run(cmds, cwd=None):
log_file_handle.close()
logger.debug(f"command returned {proc.returncode}")
if proc.returncode != 0:
if proc.returncode != 0 and not can_fail:
print("-" * 70)
print(stderr)
print("-" * 70)
@@ -263,6 +275,14 @@ def run(cmds, cwd=None):
return stdout.strip()
if platform.system() == "Darwin":
if run(["sw_vers", "-productVersion"]) >= "11.":
# Apparently not supported
PYTHON_VERSIONS = [pv for pv in PYTHON_VERSIONS if tuple(map(int, pv.split("."))) >= (3, 7)]
if run(["sw_vers", "-productVersion"]) < "10.16":
# Apparently not supported
PYTHON_VERSIONS = [pv for pv in PYTHON_VERSIONS if tuple(map(int, pv.split("."))) < (3, 11)]
BOOST_VERSION_UNDERSCORE = BOOST_VERSION.replace(".", "_")
OCE_LOCATION = f"https://github.com/tpaviot/oce/archive/OCE-{OCE_VERSION}.tar.gz"
@@ -277,7 +297,12 @@ def run_autoconf(arg1, configure_args, cwd):
run([bash, "./autogen.sh"], cwd=os.path.realpath(os.path.join(cwd, ".."))) # only run autogen.sh in the directory it is located and use cwd to achieve that in order to not mess up things
# Using `sh` over `bash` fixes issues with building swig
prefix = os.path.realpath(f"{DEPS_DIR}/install/{arg1}")
run(["/bin/sh", "../configure"] + configure_args + [f"--prefix={prefix}"], cwd=cwd)
wasm = []
if "wasm" in flags:
wasm.append("emconfigure")
run([*wasm, "/bin/sh", "../configure"] + configure_args + [f"--prefix={prefix}"], cwd=cwd)
def run_cmake(arg1, cmake_args, cmake_dir=None, cwd=None):
@@ -285,7 +310,12 @@ def run_cmake(arg1, cmake_args, cmake_dir=None, cwd=None):
P = ".."
else:
P = cmake_dir
run(["cmake", P] + cmake_args + [f"-DCMAKE_BUILD_TYPE={BUILD_CFG}"], cwd=cwd)
wasm = []
if "wasm" in flags:
wasm.append("emcmake")
run([*wasm, "cmake", P, *cmake_args, f"-DCMAKE_BUILD_TYPE={BUILD_CFG}"], cwd=cwd)
def git_clone_or_pull_repository(clone_url, target_dir, revision=None):
@@ -367,12 +397,15 @@ def build_dependency(name, mode, build_tool_args, download_url, download_name, d
urlretrieve(url, os.path.join(extract_dir, path))
if patch is not None:
patch_abs = os.path.abspath(os.path.join(os.path.dirname(__file__), patch))
if os.path.exists(patch_abs):
try: run(["patch", "-p1", "--batch", "--forward", "-i", patch_abs], cwd=extract_dir)
except Exception as e:
# Assert that the patch has already been applied
run(["patch", "-p1", "--batch", "--reverse", "--dry-run", "-i", patch_abs], cwd=extract_dir)
if isinstance(patch, str):
patch = [patch]
for p in patch:
patch_abs = os.path.abspath(os.path.join(os.path.dirname(__file__), p))
if os.path.exists(patch_abs):
try: run(["patch", "-p1", "--batch", "--forward", "-i", patch_abs], cwd=extract_dir)
except Exception as e:
# Assert that the patch has already been applied
run(["patch", "-p1", "--batch", "--reverse", "--dry-run", "-i", patch_abs], cwd=extract_dir)
if mode == "ctest":
run(["ctest", "-S", "HDF5config.cmake,BUILD_GENERATOR=Unix", "-C", BUILD_CFG, "-V", "-O", "hdf5.log"], cwd=extract_dir)
@@ -403,7 +436,7 @@ def build_dependency(name, mode, build_tool_args, download_url, download_name, d
logger.info(f"\rConfiguring {name}...")
run([bash, "./bootstrap.sh"], cwd=extract_dir)
logger.info(f"\rBuilding {name}... ")
run(["./b2", f"-j{IFCOS_NUM_BUILD_PROCS}"] + build_tool_args, cwd=extract_dir)
run(["./b2", f"-j{IFCOS_NUM_BUILD_PROCS}"] + build_tool_args, cwd=extract_dir, can_fail="wasm" in flags)
logger.info(f"\rInstalling {name}... ")
shutil.copytree(os.path.join(extract_dir, "boost"), os.path.join(DEPS_DIR, "install", f"boost-{BOOST_VERSION}", "boost"))
logger.info(f"\rInstalled {name} \n")
@@ -414,11 +447,13 @@ cecho("Collecting dependencies:", GREEN)
# TODO: This is untested
ADDITIONAL_ARGS = []
BOOST_ADDRESS_MODEL = []
if platform.system() == "Darwin":
ADDITIONAL_ARGS = [f"-mmacosx-version-min={TOOLSET}"] + ADDITIONAL_ARGS
if "wasm" in flags:
ADDITIONAL_ARGS.extend(("-sWASM_BIGINT", "-fexceptions"))
# If the linker supports GC sections, set it up to reduce binary file size
# -fPIC is required for the shared libraries to work
@@ -427,7 +462,7 @@ CFLAGS = os.environ.get("CFLAGS", "")
LDFLAGS = os.environ.get("LDFLAGS", "")
ADDITIONAL_ARGS_STR = " ".join(ADDITIONAL_ARGS)
if sp.call([bash, "-c", "ld --gc-sections 2>&1 | grep -- --gc-sections &> /dev/null"]) != 0:
if "wasm" not in flags and sp.call([bash, "-c", "ld --gc-sections 2>&1 | grep -- --gc-sections &> /dev/null"]) != 0:
CXXFLAGS_MINIMAL = f"{CXXFLAGS} {PIC} {ADDITIONAL_ARGS_STR}"
CFLAGS_MINIMAL = f"{CFLAGS} {PIC} {ADDITIONAL_ARGS_STR}"
if BUILD_STATIC:
@@ -497,8 +532,27 @@ if "swig" in targets:
download_tool=download_tool_git,
revision=f"rel-{SWIG_VERSION}"
)
if "freetype" in targets:
build_dependency(
name=f"freetype",
mode="cmake",
build_tool_args=[
f"-DCMAKE_INSTALL_PREFIX={DEPS_DIR}/install/freetype"
],
download_url = "https://github.com/freetype/freetype",
download_name = "freetype2",
download_tool=download_tool_git,
)
if USE_OCCT and "occ" in targets:
patches = []
if OCCT_VERSION < "7.4":
patches.append("./patches/occt/enable-exception-handling.patch")
if "wasm" in flags:
patches.append("./patches/occt/no_em_js.patch")
build_dependency(
name=f"occt-{OCCT_VERSION}",
mode="cmake",
@@ -506,12 +560,13 @@ if USE_OCCT and "occ" in targets:
f"-DINSTALL_DIR={DEPS_DIR}/install/occt-{OCCT_VERSION}",
f"-DBUILD_LIBRARY_TYPE={LINK_TYPE_UCFIRST}",
"-DBUILD_MODULE_Draw=0",
"-DBUILD_RELEASE_DISABLE_EXCEPTIONS=Off"
"-DBUILD_RELEASE_DISABLE_EXCEPTIONS=Off",
f"-D3RDPARTY_FREETYPE_DIR={DEPS_DIR}/install/freetype"
],
download_url = "https://git.dev.opencascade.org/repos/occt.git",
download_url = "https://github.com/Open-Cascade-SAS/OCCT",
download_name = "occt",
download_tool=download_tool_git,
patch=None if OCCT_VERSION >= "7.4" else "./patches/occt/enable-exception-handling.patch",
patch=patches,
revision="V" + OCCT_VERSION.replace('.', '_')
)
elif "occ" in targets:
@@ -548,6 +603,15 @@ if "libxml2" in targets:
)
if "OpenCOLLADA" in targets:
patches = ["./patches/opencollada/pr622_and_disable_subdirs.patch"]
if "wasm" in flags:
# This is necessary for the WASM build, because recent versions of
# clang don't have the tr1:: namespace anymore. However, it breaks
# some versions of gcc (9.4.0 at least) due to specializing std::hash
# outside of the std:: namespace.
patches.append("./patches/opencollada/remove_tr1.patch")
build_dependency(
"OpenCOLLADA",
"cmake",
@@ -562,11 +626,11 @@ if "OpenCOLLADA" in targets:
download_url="https://github.com/KhronosGroup/OpenCOLLADA.git",
download_name="OpenCOLLADA",
download_tool=download_tool_git,
patch="./patches/opencollada/pr622_and_disable_subdirs.patch",
patch=patches,
revision=OPENCOLLADA_VERSION
)
if "python" in targets and not USE_CURRENT_PYTHON_VERSION:
if "python" in targets and not USE_CURRENT_PYTHON_VERSION and "wasm" not in flags:
# Python should not be built with -fvisibility=hidden, from experience that introduces segfaults
OLD_CXX_FLAGS = os.environ["CXXFLAGS"]
OLD_C_FLAGS = os.environ["CFLAGS"]
@@ -577,7 +641,7 @@ if "python" in targets and not USE_CURRENT_PYTHON_VERSION:
# with the system python because of some threading initialization
PYTHON_CONFIGURE_ARGS = []
if platform.system() == "Darwin":
PYTHON_CONFIGURE_ARGS = ["--disable-static", "--enable-shared"]
PYTHON_CONFIGURE_ARGS = ["--enable-shared"]
for PYTHON_VERSION in PYTHON_VERSIONS:
try:
@@ -605,6 +669,9 @@ if "python" in targets and not USE_CURRENT_PYTHON_VERSION:
if "boost" in targets:
str_concat = lambda prefix: lambda postfix: "" if postfix.strip() == "" else "=".join((prefix, postfix.strip()))
toolset = []
if "wasm" in flags:
toolset.append("toolset=emscripten")
build_dependency(
f"boost-{BOOST_VERSION}",
mode="bjam",
@@ -616,21 +683,30 @@ if "boost" in targets:
"--with-thread",
"--with-date_time",
"--with-iostreams",
f"link={LINK_TYPE}"
] + \
BOOST_ADDRESS_MODEL + \
list(map(str_concat("cxxflags"), CXXFLAGS.strip().split(' '))) + \
list(map(str_concat("linkflags"), LDFLAGS.strip().split(' '))) + \
["stage", "-s", "NO_BZIP2=1"],
f"link={LINK_TYPE}",
*toolset,
*map(str_concat("cxxflags"), CXXFLAGS.strip().split(' ')),
*map(str_concat("linkflags"), LDFLAGS.strip().split(' ')),
"stage", "-s", "NO_BZIP2=1"],
download_url=BOOST_LOCATION,
patch="./patches/boost/boostorg_regex_62.patch",
download_name=f"boost_{BOOST_VERSION_UNDERSCORE}.tar.bz2"
)
if "wasm" in flags:
# only supported on nix for now
run(("find", ".", "-name", "*.bc", "-exec", "bash", "-c", "emar q ${1%.bc}.a $1", "bash", "{}", ";"), cwd=f"{DEPS_DIR}/install/boost-{BOOST_VERSION}/lib")
if "cgal" in targets:
gmp_args = []
mpfr_args = []
if "wasm" in flags:
gmp_args.extend(("--disable-assembly", "--host", "none", "--enable-cxx"))
mpfr_args.extend(("--host", "none"))
build_dependency(
name=f"gmp-{GMP_VERSION}",
mode="autoconf",
build_tool_args=["--disable-shared", "--with-pic"],
build_tool_args=[ENABLE_FLAG, DISABLE_FLAG, "--with-pic", *gmp_args],
download_url="https://ftp.gnu.org/gnu/gmp/",
download_name=f"gmp-{GMP_VERSION}.tar.bz2"
)
@@ -638,7 +714,7 @@ if "cgal" in targets:
build_dependency(
name=f"mpfr-{MPFR_VERSION}",
mode="autoconf",
build_tool_args=["--disable-shared", f"--with-gmp={DEPS_DIR}/install/gmp-{GMP_VERSION}"],
build_tool_args=[ENABLE_FLAG, DISABLE_FLAG, *mpfr_args, f"--with-gmp={DEPS_DIR}/install/gmp-{GMP_VERSION}"],
download_url=f"http://www.mpfr.org/mpfr-{MPFR_VERSION}/",
download_name=f"mpfr-{MPFR_VERSION}.tar.bz2"
)
@@ -647,9 +723,9 @@ if "cgal" in targets:
name=f"cgal-{CGAL_VERSION}",
mode="cmake",
build_tool_args=[
f"-DGMP_LIBRARIES={DEPS_DIR}/install/gmp-{GMP_VERSION}/lib/libgmp.a",
f"-DGMP_LIBRARIES={DEPS_DIR}/install/gmp-{GMP_VERSION}/lib/libgmp.{LIBRARY_EXT}",
f"-DGMP_INCLUDE_DIR={DEPS_DIR}/install/gmp-{GMP_VERSION}/include",
f"-DMPFR_LIBRARIES={DEPS_DIR}/install/mpfr-{MPFR_VERSION}/lib/libmpfr.a" ,
f"-DMPFR_LIBRARIES={DEPS_DIR}/install/mpfr-{MPFR_VERSION}/lib/libmpfr.{LIBRARY_EXT}" ,
f"-DMPFR_INCLUDE_DIR={DEPS_DIR}/install/mpfr-{MPFR_VERSION}/include",
f"-DBoost_INCLUDE_DIR={DEPS_DIR}/install/boost-{BOOST_VERSION}",
f"-DCMAKE_INSTALL_PREFIX={DEPS_DIR}/install/cgal-{CGAL_VERSION}/",
@@ -672,18 +748,8 @@ os.makedirs(IFCOS_DIR, exist_ok=True)
executables_dir = os.path.join(IFCOS_DIR, "executables")
os.makedirs(executables_dir, exist_ok=True)
logger.info("\rConfiguring executables...")
OFF_ON = ["OFF", "ON"]
exec_args = [
"-DBUILD_IFCGEOM=" +OFF_ON["IfcGeom" in targets],
"-DBUILD_GEOMSERVER=" +OFF_ON["IfcGeomServer" in targets],
"-DBUILD_CONVERT=" +OFF_ON["IfcConvert" in targets],
"-DBUILD_IFCPYTHON=" "OFF",
"-DCMAKE_INSTALL_PREFIX=" f"{DEPS_DIR}/install/ifcopenshell",
]
cmake_args = [
"-DUSE_MMAP=" "OFF",
"-DBUILD_EXAMPLES=" "OFF",
@@ -695,6 +761,11 @@ cmake_args = [
"-DADD_COMMIT_SHA=" +("On" if ADD_COMMIT_SHA else "Off")
]
if "wasm" in flags:
# Boost is built by the build script so should not be found
# inside of the sysroot set by the emscriptem toolchain
cmake_args.append("-DWASM_BUILD=On")
if "cgal" in targets:
cmake_args.extend([
"-DCGAL_INCLUDE_DIR=" f"{DEPS_DIR}/install/cgal-{CGAL_VERSION}/include",
@@ -746,20 +817,36 @@ if "hdf5" in targets:
"-DHDF5_INCLUDE_DIR=" f"{DEPS_DIR}/install/hdf5-{HDF5_VERSION}/include",
"-DHDF5_LIBRARY_DIR=" f"{DEPS_DIR}/install/hdf5-{HDF5_VERSION}/lib"
])
else:
cmake_args.append("-DHDF5_SUPPORT=Off")
run_cmake("", exec_args + cmake_args, cmake_dir=CMAKE_DIR, cwd=executables_dir)
if not explicit_targets or {"IfcGeom", "IfcConvert", "IfcGeomServer"} & set(explicit_targets):
logger.info("\rConfiguring executables...")
logger.info("\rBuilding executables... ")
exec_args = [
"-DBUILD_IFCGEOM=" +OFF_ON["IfcGeom" in targets],
"-DBUILD_GEOMSERVER=" +OFF_ON["IfcGeomServer" in targets],
"-DBUILD_CONVERT=" +OFF_ON["IfcConvert" in targets],
"-DBUILD_IFCPYTHON=" "OFF",
"-DCMAKE_INSTALL_PREFIX=" f"{DEPS_DIR}/install/ifcopenshell",
]
run_cmake("", exec_args + cmake_args, cmake_dir=CMAKE_DIR, cwd=executables_dir)
run([make, f"-j{IFCOS_NUM_BUILD_PROCS}"], cwd=executables_dir)
run([make, "install/strip" if BUILD_CFG == "Release" else "install"], cwd=executables_dir)
logger.info("\rBuilding executables... ")
run([make, f"-j{IFCOS_NUM_BUILD_PROCS}"], cwd=executables_dir)
run([make, "install/strip" if BUILD_CFG == "Release" else "install"], cwd=executables_dir)
if "IfcOpenShell-Python" in targets:
# On OSX the actual Python library is not linked against.
ADDITIONAL_ARGS = ""
if platform.system() == "Darwin":
ADDITIONAL_ARGS = "-Wl,-flat_namespace,-undefined,suppress"
if "wasm" in flags:
ADDITIONAL_ARGS = f"-Wl,-undefined,suppress -sSIDE_MODULE=2 -sEXPORTED_FUNCTIONS=_PyInit__ifcopenshell_wrapper"
os.environ["CXXFLAGS"] = f"{CXXFLAGS_MINIMAL} {ADDITIONAL_ARGS}"
os.environ["CFLAGS"] = f"{CFLAGS_MINIMAL} {ADDITIONAL_ARGS}"
os.environ["LDFLAGS"] = f"{LDFLAGS} {ADDITIONAL_ARGS}"
@@ -776,36 +863,57 @@ if "IfcOpenShell-Python" in targets:
os.environ["PYTHON_LIBRARY_BASENAME"] = os.path.basename(python_library)
swig_when_built = []
if "swig" in targets:
swig_when_built.append(f"-DSWIG_EXECUTABLE={DEPS_DIR}/install/swig/bin/swig")
run_cmake("",
cmake_args + [
"-DPYTHON_LIBRARY=" +python_library,
"-DPYTHON_EXECUTABLE=" +python_executable,
*([f"-DPYTHON_EXECUTABLE={python_executable}"] if python_executable else []),
# *([f"-DPYTHON_MODULE_INSTALL_DIR={os.environ['PYTHONPATH']}/ifcopenshell"] if "wasm" in flags else []),
*(["-DPYTHON_MODULE_INSTALL_DIR="+os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "package"))] if "wasm" in flags else []),
"-DPYTHON_INCLUDE_DIR=" +python_include,
"-DSWIG_EXECUTABLE=" f"{DEPS_DIR}/install/swig/bin/swig",
"-DCMAKE_INSTALL_PREFIX=" f"{DEPS_DIR}/install/ifcopenshell/tmp",
"-DUSERSPACE_PYTHON_PREFIX=" +["Off", "On"][os.environ.get("PYTHON_USER_SITE", "").lower() in {"1", "on", "true"}]
], cmake_dir=CMAKE_DIR, cwd=python_dir)
"-DUSERSPACE_PYTHON_PREFIX=" +["Off", "On"][os.environ.get("PYTHON_USER_SITE", "").lower() in {"1", "on", "true"}],
*swig_when_built],
cmake_dir=CMAKE_DIR, cwd=python_dir)
logger.info(f"\rBuilding python {python_version} wrapper... ")
run([make, f"-j{IFCOS_NUM_BUILD_PROCS}", "_ifcopenshell_wrapper"], cwd=python_dir)
run([make, "install/local"], cwd=os.path.join(python_dir, "ifcwrap"))
module_dir = os.path.dirname(run([python_executable, "-c", "import inspect, ifcopenshell; print(inspect.getfile(ifcopenshell))"]))
if python_executable:
module_dir = os.path.dirname(run([python_executable, "-c", "import inspect, ifcopenshell; print(inspect.getfile(ifcopenshell))"]))
if platform.system() != "Darwin":
# TODO: This symbol name depends on the Python version?
run([strip, "-s", "-K", "PyInit__ifcopenshell_wrapper", "_ifcopenshell_wrapper.so"], cwd=module_dir)
return module_dir
if platform.system() != "Darwin":
# TODO: This symbol name depends on the Python version?
run([strip, "-s", "-K", "PyInit__ifcopenshell_wrapper", "_ifcopenshell_wrapper.so"], cwd=module_dir)
return module_dir
if USE_CURRENT_PYTHON_VERSION:
python_info = sysconfig.get_paths()
python_lib = os.path.join(
sysconfig.get_config_var('LIBDIR'),
sysconfig.get_config_var('multiarchsubdir').replace("/", ""),
sysconfig.get_config_var("INSTSONAME")
if "wasm" in flags:
compile_python_wrapper(
f"{os.environ['PYMAJOR']}.{os.environ['PYMINOR']}.{os.environ['PYMICRO']}",
f"{os.environ['TARGETINSTALLDIR']}/lib/libpython{os.environ['PYMAJOR']}.{os.environ['PYMINOR']}.a",
os.environ['PYTHONINCLUDE'],
None
)
elif USE_CURRENT_PYTHON_VERSION:
python_info = sysconfig.get_paths()
py_path_components = [
sysconfig.get_config_var('LIBDIR'),
sysconfig.get_config_var("INSTSONAME")
]
if sysconfig.get_config_var('multiarchsubdir'):
py_path_components.insert(1, sysconfig.get_config_var('multiarchsubdir').replace("/", ""))
python_lib = os.path.join(*py_path_components)
compile_python_wrapper(platform.python_version(), python_lib, python_info["include"], sys.executable)
else:
for python_version in PYTHON_VERSIONS:
+20
View File
@@ -0,0 +1,20 @@
--- a/tools/build/src/tools/emscripten.jam
+++ b/tools/build/src/tools/emscripten.jam
@@ -6,6 +6,7 @@
import feature ;
import os ;
import toolset ;
+import generators ;
import common ;
import gcc ;
import type ;
@@ -52,6 +53,8 @@
<debug-symbols>off <debug-symbols>on
<rtti>off <rtti>on
;
+generators.override builtin.lib-generator : emscripten.prebuilt ;
+generators.override emscripten.searched-lib-generator : searched-lib-generator ;
type.set-generated-target-suffix EXE : <toolset>emscripten : "js" ;
type.set-generated-target-suffix OBJ : <toolset>emscripten : "bc" ;
+99
View File
@@ -0,0 +1,99 @@
diff --git a/src/Message/Message_PrinterSystemLog.cxx b/src/Message/Message_PrinterSystemLog.cxx
index 0c82c2167..a2e9e6d68 100644
--- a/src/Message/Message_PrinterSystemLog.cxx
+++ b/src/Message/Message_PrinterSystemLog.cxx
@@ -55,27 +55,6 @@
return ANDROID_LOG_DEBUG;
}
#elif defined(__EMSCRIPTEN__)
- #include <emscripten/emscripten.h>
-
- //! Print message to console.debug().
- EM_JS(void, occJSConsoleDebug, (const char* theStr), {
- console.debug(UTF8ToString(theStr));
- });
-
- //! Print message to console.info().
- EM_JS(void, occJSConsoleInfo, (const char* theStr), {
- console.info(UTF8ToString(theStr));
- });
-
- //! Print message to console.warn().
- EM_JS(void, occJSConsoleWarn, (const char* theStr), {
- console.warn(UTF8ToString(theStr));
- });
-
- //! Print message to console.error().
- EM_JS(void, occJSConsoleError, (const char* theStr), {
- console.error(UTF8ToString(theStr));
- });
#else
#include <syslog.h>
@@ -169,16 +148,6 @@ void Message_PrinterSystemLog::send (const TCollection_AsciiString& theString,
#elif defined(__ANDROID__)
__android_log_write (getAndroidLogPriority (theGravity), myEventSourceName.ToCString(), theString.ToCString());
#elif defined(__EMSCRIPTEN__)
- // don't use bogus emscripten_log() corrupting UNICODE strings
- switch (theGravity)
- {
- case Message_Trace: occJSConsoleDebug(theString.ToCString()); return;
- case Message_Info: occJSConsoleInfo (theString.ToCString()); return;
- case Message_Warning: occJSConsoleWarn (theString.ToCString()); return;
- case Message_Alarm: occJSConsoleError(theString.ToCString()); return;
- case Message_Fail: occJSConsoleError(theString.ToCString()); return;
- }
- occJSConsoleWarn (theString.ToCString());
#else
syslog (getSysLogPriority (theGravity), "%s", theString.ToCString());
#endif
diff --git a/src/OSD/OSD_MemInfo.cxx b/src/OSD/OSD_MemInfo.cxx
index 08a939beb..7c1fc79b3 100644
--- a/src/OSD/OSD_MemInfo.cxx
+++ b/src/OSD/OSD_MemInfo.cxx
@@ -37,15 +37,6 @@
#include <OSD_MemInfo.hxx>
-#if defined(__EMSCRIPTEN__)
- #include <emscripten.h>
-
- //! Return WebAssembly heap size in bytes.
- EM_JS(size_t, OSD_MemInfo_getModuleHeapLength, (), {
- return Module.HEAP8.length;
- });
-#endif
-
// =======================================================================
// function : OSD_MemInfo
// purpose :
@@ -156,29 +147,6 @@ void OSD_MemInfo::Update()
}
#elif defined(__EMSCRIPTEN__)
- if (IsActive (MemHeapUsage)
- || IsActive (MemWorkingSet)
- || IsActive (MemWorkingSetPeak))
- {
- // /proc/%d/status is not emulated - get more info from mallinfo()
- const struct mallinfo aMI = mallinfo();
- if (IsActive (MemHeapUsage))
- {
- myCounters[MemHeapUsage] = aMI.uordblks;
- }
- if (IsActive (MemWorkingSet))
- {
- myCounters[MemWorkingSet] = aMI.uordblks;
- }
- if (IsActive (MemWorkingSetPeak))
- {
- myCounters[MemWorkingSetPeak] = aMI.usmblks;
- }
- }
- if (IsActive (MemVirtual))
- {
- myCounters[MemVirtual] = OSD_MemInfo_getModuleHeapLength();
- }
#elif (defined(__linux__) || defined(__linux))
if (IsActive (MemHeapUsage))
{
+81
View File
@@ -0,0 +1,81 @@
diff --git a/COLLADABaseUtils/include/COLLADABUhash_map.h b/COLLADABaseUtils/include/COLLADABUhash_map.h
index 8ab0fb9b..12503bfb 100644
--- a/COLLADABaseUtils/include/COLLADABUhash_map.h
+++ b/COLLADABaseUtils/include/COLLADABUhash_map.h
@@ -32,9 +32,9 @@
#include <unordered_map>
#include <unordered_set>
- #define COLLADABU_HASH_MAP std::tr1::unordered_map
- #define COLLADABU_HASH_MULTIMAP std::tr1::unordered_multimap
- #define COLLADABU_HASH_SET std::tr1::unordered_set
+ #define COLLADABU_HASH_MAP std::unordered_map
+ #define COLLADABU_HASH_MULTIMAP std::unordered_multimap
+ #define COLLADABU_HASH_SET std::unordered_set
#define COLLADABU_HASH_NAMESPACE_OPEN std { namespace tr1
#define COLLADABU_HASH_NAMESPACE_CLOSE }
#define COLLADABU_HASH_FUN hash
@@ -50,12 +50,12 @@
#define COLLADABU_HASH_FUN hash
#endif
#elif defined(__MINGW32__) || defined(__MINGW64__)
- #include <tr1/unordered_map>
- #include <tr1/unordered_set>
+ #include <unordered_map>
+ #include <unordered_set>
- #define COLLADABU_HASH_MAP std::tr1::unordered_map
- #define COLLADABU_HASH_MULTIMAP std::tr1::unordered_multimap
- #define COLLADABU_HASH_SET std::tr1::unordered_set
+ #define COLLADABU_HASH_MAP std::unordered_map
+ #define COLLADABU_HASH_MULTIMAP std::unordered_multimap
+ #define COLLADABU_HASH_SET std::unordered_set
#define COLLADABU_HASH_NAMESPACE_OPEN std { namespace tr1
#define COLLADABU_HASH_NAMESPACE_CLOSE }
#define COLLADABU_HASH_FUN hash
@@ -107,12 +107,12 @@
#define COLLADABU_HASH_NAMESPACE_CLOSE
#define COLLADABU_HASH_FUN hash
#else
- #include <tr1/unordered_map>
- #include <tr1/unordered_set>
+ #include <unordered_map>
+ #include <unordered_set>
- #define COLLADABU_HASH_MAP std::tr1::unordered_map
- #define COLLADABU_HASH_MULTIMAP std::tr1::unordered_multimap
- #define COLLADABU_HASH_SET std::tr1::unordered_set
+ #define COLLADABU_HASH_MAP std::unordered_map
+ #define COLLADABU_HASH_MULTIMAP std::unordered_multimap
+ #define COLLADABU_HASH_SET std::unordered_set
#define COLLADABU_HASH_NAMESPACE_OPEN std { namespace tr1
#define COLLADABU_HASH_NAMESPACE_CLOSE }
#define COLLADABU_HASH_FUN hash
diff --git a/common/libBuffer/include/CommonFWriteBufferFlusher.h b/common/libBuffer/include/CommonFWriteBufferFlusher.h
index c7af45b2..fac4f133 100644
--- a/common/libBuffer/include/CommonFWriteBufferFlusher.h
+++ b/common/libBuffer/include/CommonFWriteBufferFlusher.h
@@ -15,12 +15,12 @@
#if (defined(WIN64) || defined(_WIN64) || defined(__WIN64__)) || (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined(__APPLE__))
#if defined(__GNUC__) && !defined(_LIBCPP_VERSION)
-# include <tr1/unordered_map>
+# include <unordered_map>
#else
# include <unordered_map>
#endif
#else
-# include <tr1/unordered_map>
+# include <unordered_map>
#endif
#ifdef _LIBCPP_VERSION
@@ -58,7 +58,7 @@ namespace Common
#else
typedef __int64 FilePosType;
#endif
- typedef std::tr1::unordered_map<MarkId, FilePosType > MarkIdToFilePos;
+ typedef std::unordered_map<MarkId, FilePosType > MarkIdToFilePos;
public:
static const size_t DEFAUL_BUFFER_SIZE = 64*1024;
+18
View File
@@ -0,0 +1,18 @@
package:
name: ifcopenshell
version: 0.7.0
source:
path: IfcOpenShell
build:
script: |
python nix/build-all.py --without-hdf5 --without-opencollada --without-swig --without-pcre -v --wasm --py310 IfcOpenShell-Python
cp pyodide/setup.py .
about:
home: http://ifcopenshell.org
license: LGPL-3.0-or-later
summary: |
IfcOpenShell is an open source (LGPL) software library for
working with the Industry Foundation Classes (IFC) file format.
+11
View File
@@ -0,0 +1,11 @@
from setuptools import setup, find_packages
setup(name='IfcOpenShell',
version='0.7.0',
description='IfcOpenShell is an open source (LGPL) software library for working with the Industry Foundation Classes (IFC) file format.',
author='Thomas Krijnen',
author_email='thomas@aecgeeks.com',
url='http://ifcopenshell.org',
packages=find_packages(),
package_data={'': ['*.so']},
)
+1
View File
@@ -0,0 +1 @@
.tox
+17
View File
@@ -0,0 +1,17 @@
.PHONY: ci
ci:
tox
.PHONY: license
license:
copyright-header --license LGPL3 --copyright-holder "Andrea Ghensi <andrea.ghensi@gmail.com>" --copyright-year "2022" --copyright-software "IfcOpenShell" --copyright-software-description "BCF XML file handling" -a ./ -o ./
# TODO: make this based on xsd file presence
.PHONY: models
models:
cd src && xsdata generate -p bcf.v2.model --unnest-classes --kw-only --slots -ds Google bcf/v2/xsd
cd src && xsdata generate -p bcf.v3.model --unnest-classes --kw-only --slots -ds Google bcf/v3/xsd
# .PHONY
# api:
# openapi-python-client generate --url https://api.swaggerhub.com/apis/buildingSMART/BCF/3.0
+31 -48
View File
@@ -1,64 +1,54 @@
# bcf
A simple Python implementation of BCF. The data model is described in `data.py`.
A simple Python implementation of BCF.
Manipulation of BCF-XML is available via `bcfxml.py` and manipulation of BCF-API
is available via `bcfapi.py`.
- BCF-XML version 2.1: Fully supported
- BCF-API version 2.1: Not supported, will probably tackle this after BCF-API v3.0
- BCF-XML version 3.0: Almost fully supported, except for the documents module
- BCF-API version 3.0: Almost fully supported, except for two requests.
It tries to support BCF-XML version 2.1 and 3.0, and BCF-API 3.0.
## bcfxml
The `bcfxml` module lets you interact with the BCF-XML standard.
The `bcfxml.load` function lets you read a BCF-XML file.
It takes care of using the right version based on the "bcf.version" file contained in the BCF package.
The BCF files are extracted and parsed on-demand, and edits are stored in memory until you call the `save` method.
```python
from bcf import bcfxml
from bcf.bcfxml import load
# Load a project
bcfxml = bcfxml.load("/path/to/file.bcf")
with load("/path/to/file.bcf") as bcfxml:
project = bcfxml.project
print(project.name)
# To edit a project, just modify the object directly
bcfxml.project.name = "New name"
# The project is also stored in the module
# project == bcfxml.project
project=bcfxml.get_project()
print(project.name)
# Get a dictionary of topics
topics = bcfxml.topics
# To edit a project, just modify the object directly
bcfxml.project.name = "New name"
bcfxml.edit_project()
for topic_guid, topic_handler in bcfxml.topics.items():
topic = topic_handler.topic
print("Topic guid is", topic.guid)
print("Topic title is", topic.title)
# The BCF file is extracted to this temporary directory
print(bcfxml.filepath)
# Fetch extra data about a topic
header = topic_handler.header
comments = topic_handler.comments
viewpoints = topic_handler.viewpoints
# Get a dictionary of topics
topics = bcfxml.get_topics()
for comment in comments:
print(comment.guid)
print(comment.comment)
print(comment.author)
# Note: topics == bcfxml.topics
for guid, topic in bcfxml.topics.items():
print("Topic guid is", guid)
print("Topic guid is", topic.guid)
print("Topic title is", topic.title)
# Get a particular topic
topic = bcfxml.get_topic(guid)
# Fetch extra data about a topic
header = bcfxml.get_header(guid)
comments = bcfxml.get_comments(guid)
viewpoints = bcfxml.get_viewpoints(guid)
# Modify a topic
topic.title = "New title"
# Note: comments == topic.comments, and so on
for comment_guid, comment in comments.items():
print(comment_guid)
print(comment.comment)
print(comment.author)
# Get a particular topic
topic = bcfxml.get_topic(guid)
# Modify a topic
topic.title = "New title"
bcfxml.edit_topic(topic)
bcfxml.save()
```
## bcfapi
@@ -92,10 +82,3 @@ print(data)
data = bcf_client.get_extensions(project_id)
print(data)
```
## Todo List
The remaining work that needs to be completed in `bcfxml.py` and `bcfapi.py`.
- For `bcfxml.py` two xsds support is remaining namely 'documents.xsd`and`extensions.xsd`.
- For `bcfapi.py` two requests that are `get_topics` and `get_comments` are remaining.
+131 -2
View File
@@ -1,12 +1,141 @@
[build-system]
requires = [
"setuptools>=42",
"setuptools>=61",
"wheel"
]
build-backend = "setuptools.build_meta"
[project]
name = "bcf-client"
# author = "IfcOpenShell"
description = "BCF-XML file handler."
readme = "README.md"
requires-python = ">=3.8"
keywords = ["IFC", "BCF", "BIM", "eingineering"]
dependencies = [
"xsdata",
"numpy",
"ifcopenshell",
]
version = "0.0.1"
classifiers = [
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering",
"Topic :: Utilities",
]
[project.urls]
Source = "https://github.com/IfcOpenShell/IfcOpenShell"
Issues = "https://github.com/IfcOpenShell/IfcOpenShell/issues"
[tool.black]
line-length = 120
extend-exclude = "model"
[tool.isort]
profile = "black"
profile = "black"
extend_skip_glob = ["src/bcf/*/model/*"]
[tool.coverage.paths]
source = ["src"]
[tool.coverage.run]
branch = true
source = ["bcf"]
omit = ["*/model/*"]
[tool.coverage.report]
show_missing = true
fail_under = 65
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING",
"if __name__ == .__main__.:",
"Protocol",
]
[tool.tox]
legacy_tox_ini = """
[tox]
env_list = lint, type, py3{10,11}
skip_missing_interpreters = true
[testenv]
deps =
pytest
pytest-cov
coverage
commands = pytest --cov --cov-report=term tests
[testenv:lint]
description = run linters
skip_install = true
deps =
black
isort
pylint
commands =
black {posargs:.}
isort {posargs:.}
pylint {posargs:.} --output-format=colorized
[testenv:type]
description = run type checks
deps =
mypy>=0.991
commands =
- mypy {posargs:src}
"""
[tool.mypy]
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_defs = true
no_implicit_optional = true
#no_implicit_reexport = true
show_column_numbers = true
show_error_codes = true
show_error_context = true
strict_equality = true
strict_optional = true
warn_redundant_casts = true
#warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
exclude= "src/bcf/v(2|3)/model"
plugins = "numpy.typing.mypy_plugin"
[[tool.mypy.overrides]]
module = "tests"
disallow_untyped_decorators = false
disallow_untyped_defs = false
[[tool.mypy.overrides]]
module = [
"pytest",
"pytest_mock",
"ifcopenshell",
"ifcopenshell.*",
]
ignore_missing_imports = true
[tool.pylint.main]
ignore = ["model"]
ignored-modules = ["bcf.v2.model", "bcf.v3.model", "xsdata"]
jobs = 0
disable="all"
enable="E" # B,B9,BLK,C,D,E,F,I,N,S,W
[tool.pylint.design]
max-args = 10
max-attributes = 10
[tool.pylint.format]
expected-line-ending-format = "LF"
max-line-length = 120
+6
View File
@@ -0,0 +1,6 @@
black
mypy
pylint
isort
xsdata
tox==3.27.1
-1
View File
@@ -1 +0,0 @@
xmlschema
-37
View File
@@ -1,37 +0,0 @@
[metadata]
name=bcf-client
version=0.0.1
author = Ifcopenshell
description = A simple Python implementation of BCF
url = https://github.com/IfcOpenShell/IfcOpenShell
project_urls =
Code=https://github.com/IfcOpenShell/IfcOpenShell
Issues=https://github.com/IfcOpenShell/IfcOpenShell/issues
long_description = file: README.md
long_description_content_type = text/markdown
classifiers =
License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Operating System :: OS Independent
Programming Language :: Python :: 3
Topic :: Scientific/Engineering
Topic :: Utilities
keywords =
Python
file formats
engineering
[options]
package_dir =
= src
packages = find:
python_requires = >=3
install_requires=
xmlschema
include_package_data = True
[options.packages.find]
where = src
[flake8]
max-line-length = 120
ignore = E24, E121, E123, E126, E203, E226, E704, E741, W503, W504
+3
View File
@@ -0,0 +1,3 @@
from setuptools import setup
setup()
+62 -50
View File
@@ -1,61 +1,73 @@
# BCF - BCF Python library
# Copyright (C) 2021 Prabhat Singh <singh01prabhat@gmail.com>
#
# This file is part of BCF.
#
# BCF is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BCF is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with BCF. If not, see <http://www.gnu.org/licenses/>.
"""
BCF - BCF Python library
Copyright (C) 2021 Prabhat Singh <singh01prabhat@gmail.com>
Copyright (C) 2022 Andrea Ghensi <andrea.ghensi@gmail.com>
This file is part of BCF.
import os.path
BCF is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
BCF is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with BCF. If not, see <http://www.gnu.org/licenses/>.
"""
import zipfile
import tempfile
from xml.dom import minidom
from pathlib import Path
from typing import Optional, Union
from bcf.v2.bcfxml import BcfXml as BcfXml2
from bcf.v2.model import Version as Version2
from bcf.v3.bcfxml import BcfXml as BcfXml3
from bcf.v3.model import Version as Version3
from bcf.xml_parser import AbstractXmlParserSerializer, XmlParserSerializer
def load(filepath):
filepath = extract_project(filepath)
if os.path.isfile(os.path.join(filepath, "bcf.version")):
version_path = os.path.join(filepath, "bcf.version")
version_id = get_version(version_path)
# TODO: we actually coded it for 2.1, let's check the difference between 2.0 and 2.1
if version_id == "2.1" or version_id == "2.0":
from bcf.v2.bcfxml import BcfXml
def load(
filepath: Path, xml_handler: Optional[AbstractXmlParserSerializer] = None
) -> Optional[Union[BcfXml2, BcfXml3]]:
"""
Load a BCF file.
bcfxml = BcfXml()
bcfxml.filepath = filepath
return bcfxml
elif version_id == "3.0":
from bcf.v3.bcfxml import BcfXml
Args:
filepath: The path to the BCF file.
bcfxml = BcfXml()
bcfxml.filepath = filepath
return bcfxml
else:
raise Exception(f"Version {version_id} not supported.")
Returns:
The loaded BCF file.
Raises:
ValueError: If the BCF version is not supported.
"""
xml_handler = xml_handler or XmlParserSerializer()
version_id = _get_version(filepath, xml_handler)
if version_id in {"2.1", "2.0"}:
return BcfXml2.load(filepath, xml_handler)
if version_id == "3.0":
return BcfXml3.load(filepath, xml_handler)
raise ValueError(f"Version {version_id} not supported.")
def get_version(version_path):
xmlparse = minidom.parse(version_path)
version_el = xmlparse.getElementsByTagName("Version")[0]
version = version_el.getAttribute("VersionId")
return version
def _get_version(filepath: Union[str, Path], xml_handler: Optional[AbstractXmlParserSerializer] = None) -> str:
"""
Returns the version of the BCF file.
Args:
filepath: The path to the BCF file.
xml_handler: The XML handler. If none is given, XmlParserSerializer is used.
def extract_project(filepath):
if not filepath:
return
zip_file = zipfile.ZipFile(filepath)
filepath = tempfile.mkdtemp()
zip_file.extractall(filepath)
return filepath
Returns:
The version of the BCF file.
"""
xml_handler = xml_handler or XmlParserSerializer()
with zipfile.ZipFile(filepath) as bcf_zip:
try:
version = xml_handler.parse(bcf_zip.read("bcf.version"), Version3)
except:
version = xml_handler.parse(bcf_zip.read("bcf.version"), Version2)
return version.version_id
+64
View File
@@ -0,0 +1,64 @@
from typing import Optional
import numpy as np
from numpy.typing import NDArray
def camera_vectors_from_element_placement(
elem_placement: NDArray[np.float_],
) -> tuple[NDArray[np.float_], NDArray[np.float_], NDArray[np.float_]]:
"""
Calculate the vectors of a camera pointing to an element.
Args:
elem_placement: Placement matrix of an element.
Returns:
Camera position, direction and up vectors
"""
target_position = elem_placement[:3, 3]
return camera_vectors_from_target_position(target_position)
def camera_vectors_from_target_position(
target_position: NDArray[np.float_], offset: Optional[NDArray[np.float_]] = None
) -> tuple[NDArray[np.float_], NDArray[np.float_], NDArray[np.float_]]:
"""
Calculate the vectors of a camera pointing to a target point.
Args:
target_position: point the camera is pointing to.
camera_offset: offset of the camera from the target point.
Returns:
Camera position, direction and up vectors
"""
camera_offset = np.array((5, 5, 5)) if offset is None else offset
camera_position = target_position + camera_offset
camera_direction = unit_vector(-camera_offset) # pylint: disable=invalid-unary-operand-type
camera_right = unit_vector(np.cross(np.array([0.0, 0.0, 1.0]), camera_direction))
camera_up = unit_vector(np.cross(camera_direction, camera_right))
return camera_position, camera_direction, camera_up
# rotation_transform = np.eye(4)
# rotation_transform[0, :3] = camera_right
# rotation_transform[1, :3] = camera_up
# rotation_transform[2, :3] = camera_direction
# translation_transform = np.eye(4)
# translation_transform[:3, -1] = -camera_position
# look_at_transform = np.matmul(rotation_transform, translation_transform)
# mat = np.linalg.inv(look_at_transform)
# return camera_position, -mat[:3, 2], mat[:3, 1]
def unit_vector(v: NDArray[np.float_]) -> NDArray[np.float_]:
"""
Return the unit vector of a vector.
Args:
v: vector
Returns:
unit vector.
"""
norm = np.linalg.norm(v)
return v if norm == 0 else v / norm
+55
View File
@@ -0,0 +1,55 @@
"""
In Memory Zip File management, taken from ruamel.std.zipfile
Copyright (c) 2017-2020 Anthon van der Neut, Ruamel bvba
original idea from https://stackoverflow.com/a/19722365/1307905
"""
import zipfile
from io import BytesIO
from os import PathLike
from pathlib import Path
from typing import Any, Optional, Protocol
class ZipFileInterface(Protocol):
def writestr(self, filename_in_zip: str | zipfile.ZipInfo, file_contents: bytes | str) -> None:
...
class InMemoryZipFile:
def __init__(
self, file_name: Optional[str | Path] = None, compression: int = zipfile.ZIP_DEFLATED, debug: int = 0
) -> None:
# Create the in-memory file-like object
self._file_name: Optional[str | Path] = str(file_name) if hasattr(file_name, "_from_parts") else file_name
self.in_memory_data = BytesIO()
# Create the in-memory zipfile
self.in_memory_zip = zipfile.ZipFile(self.in_memory_data, "w", compression, False)
self.in_memory_zip.debug = debug
def writestr(self, filename_in_zip: str | zipfile.ZipInfo, file_contents: bytes | str) -> None:
"""Appends a file with name filename_in_zip and contents of
file_contents to the in-memory zip."""
self.in_memory_zip.writestr(filename_in_zip, file_contents)
def write_to_file(self, filename: str | bytes | PathLike[str] | PathLike[bytes] | int) -> None:
"""Writes the in-memory zip to a file."""
# Mark the files as having been created on Windows so that
# Unix permissions are not inferred as 0000
for zfile in self.in_memory_zip.filelist:
zfile.create_system = 0
self.in_memory_zip.close()
with open(filename, "wb") as f:
f.write(self.data)
@property
def data(self) -> bytes:
return self.in_memory_data.getvalue()
def __enter__(self) -> "InMemoryZipFile":
return self
def __exit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> None:
if self._file_name:
self.write_to_file(self._file_name)
View File
-2
View File
@@ -1,4 +1,3 @@
# BCF - BCF Python library
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
@@ -16,4 +15,3 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with BCF. If not, see <http://www.gnu.org/licenses/>.
File diff suppressed because it is too large Load Diff
-198
View File
@@ -1,198 +0,0 @@
# BCF - BCF Python library
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BCF.
#
# BCF is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BCF is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with BCF. If not, see <http://www.gnu.org/licenses/>.
class Project:
def __init__(self):
self.project_id = ""
self.name = ""
self.extension_schema = ""
class BimSnippet:
def __init__(self):
self.snippet_type = None
self.is_external = False
self.reference = None
self.reference_schema = None
class DocumentReference:
def __init__(self):
self.referenced_document = None
self.description = None
self.guid = None
self.is_external = False
class RelatedTopic:
def __init__(self):
self.guid = None
class HeaderFile:
def __init__(self):
self.filename = None
self.date = None
self.reference = None
self.ifc_project = None
self.ifc_spatial_structure_element = None
self.is_external = True
class Header:
def __init__(self):
self.files = []
class Topic:
def __init__(self):
self.reference_links = []
self.title = ""
self.priority = None
self.index = None # Deprecated, stored, but ignored
self.labels = []
self.creation_date = None
self.creation_author = None
self.modified_date = None
self.modified_author = None
self.due_date = None
self.assigned_to = None
self.stage = None
self.description = None
self.bim_snippet = None
self.document_references = []
self.related_topics = []
self.topic_status = None
self.topic_type = None
self.guid = None
self.header = None
self.comments = {}
self.viewpoints = {}
class Comment:
def __init__(self):
self.guid = None
self.date = None
self.author = None
self.comment = None
self.viewpoint = None
self.modified_date = None
self.modified_author = None
self.topic_guid = None # Part of BCF-API
class ViewSetupHints:
def __init__(self):
self.spaces_visible = False
self.space_boundaries_visible = False
self.openings_visible = False
class Component:
def __init__(self):
self.originating_system = None
self.authoring_tool_id = None
self.ifc_guid = None
class ComponentVisibility:
def __init__(self):
self.exceptions = []
self.default_visibility = False
class Color:
def __init__(self):
self.color = None
self.components = []
class Components:
def __init__(self):
self.view_setup_hints = None
self.selection = []
self.visibility = None
self.coloring = []
class Point:
def __init__(self):
self.x = 0
self.y = 0
self.z = 0
class Direction(Point):
pass
class OrthogonalCamera:
def __init__(self):
self.camera_view_point = Point()
self.camera_direction = Direction()
self.camera_up_vector = Direction()
self.view_to_world_scale = 1.0
class PerspectiveCamera:
def __init__(self):
self.camera_view_point = Point()
self.camera_direction = Direction()
self.camera_up_vector = Direction()
self.field_of_view = 60.0
class Line:
def __init__(self):
self.start_point = Point()
self.end_point = Point()
class ClippingPlane:
def __init__(self):
self.location = Point()
self.direction = Direction()
class Bitmap:
def __init__(self):
self.reference = "" # Only in BCF-XML
self.bitmap_data = None # Only in BCF-API
self.bitmap_format = "PNG" # Enum of png or jpg
self.location = Point()
self.normal = Direction()
self.up = Direction()
self.height = 1.0
class Viewpoint:
def __init__(self):
self.guid = None
self.viewpoint = None
self.snapshot = None
self.index = None
self.components = None # It's not a list, despite the plural name
self.orthogonal_camera = None
self.perspective_camera = None
self.lines = []
self.clipping_planes = []
self.bitmaps = []
+70
View File
@@ -0,0 +1,70 @@
from bcf.v2.model.markup import (
BimSnippet,
Comment,
CommentViewpoint,
Header,
HeaderFile,
Markup,
Topic,
TopicDocumentReference,
TopicRelatedTopic,
ViewPoint,
)
from bcf.v2.model.project import Project, ProjectExtension
from bcf.v2.model.version import Version
from bcf.v2.model.visinfo import (
BitmapFormat,
ClippingPlane,
Component,
ComponentColoring,
ComponentColoringColor,
Components,
ComponentSelection,
ComponentVisibility,
ComponentVisibilityExceptions,
Direction,
Line,
OrthogonalCamera,
PerspectiveCamera,
Point,
ViewSetupHints,
VisualizationInfo,
VisualizationInfoBitmap,
VisualizationInfoClippingPlanes,
VisualizationInfoLines,
)
__all__ = [
"BimSnippet",
"Comment",
"CommentViewpoint",
"Header",
"HeaderFile",
"Markup",
"Topic",
"TopicDocumentReference",
"TopicRelatedTopic",
"ViewPoint",
"Project",
"ProjectExtension",
"Version",
"BitmapFormat",
"ClippingPlane",
"Component",
"ComponentColoring",
"ComponentColoringColor",
"ComponentSelection",
"ComponentVisibility",
"ComponentVisibilityExceptions",
"Components",
"Direction",
"Line",
"OrthogonalCamera",
"PerspectiveCamera",
"Point",
"ViewSetupHints",
"VisualizationInfo",
"VisualizationInfoBitmap",
"VisualizationInfoClippingPlanes",
"VisualizationInfoLines",
]
+461
View File
@@ -0,0 +1,461 @@
from dataclasses import dataclass, field
from typing import List, Optional
from xsdata.models.datatype import XmlDateTime
@dataclass(slots=True, kw_only=True)
class BimSnippet:
reference: str = field(
metadata={
"name": "Reference",
"type": "Element",
"namespace": "",
"required": True,
}
)
reference_schema: str = field(
metadata={
"name": "ReferenceSchema",
"type": "Element",
"namespace": "",
"required": True,
}
)
snippet_type: str = field(
metadata={
"name": "SnippetType",
"type": "Attribute",
"required": True,
}
)
is_external: bool = field(
default=False,
metadata={
"name": "isExternal",
"type": "Attribute",
}
)
@dataclass(slots=True, kw_only=True)
class CommentViewpoint:
class Meta:
global_type = False
guid: str = field(
metadata={
"name": "Guid",
"type": "Attribute",
"required": True,
"pattern": r"[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}",
}
)
@dataclass(slots=True, kw_only=True)
class HeaderFile:
class Meta:
global_type = False
filename: Optional[str] = field(
default=None,
metadata={
"name": "Filename",
"type": "Element",
"namespace": "",
}
)
date: Optional[XmlDateTime] = field(
default=None,
metadata={
"name": "Date",
"type": "Element",
"namespace": "",
}
)
reference: Optional[str] = field(
default=None,
metadata={
"name": "Reference",
"type": "Element",
"namespace": "",
}
)
ifc_project: Optional[str] = field(
default=None,
metadata={
"name": "IfcProject",
"type": "Attribute",
"length": 22,
"pattern": r"[0-9,A-Z,a-z,_$]*",
}
)
ifc_spatial_structure_element: Optional[str] = field(
default=None,
metadata={
"name": "IfcSpatialStructureElement",
"type": "Attribute",
"length": 22,
"pattern": r"[0-9,A-Z,a-z,_$]*",
}
)
is_external: bool = field(
default=True,
metadata={
"name": "isExternal",
"type": "Attribute",
}
)
@dataclass(slots=True, kw_only=True)
class TopicDocumentReference:
class Meta:
global_type = False
referenced_document: Optional[str] = field(
default=None,
metadata={
"name": "ReferencedDocument",
"type": "Element",
"namespace": "",
}
)
description: Optional[str] = field(
default=None,
metadata={
"name": "Description",
"type": "Element",
"namespace": "",
}
)
guid: Optional[str] = field(
default=None,
metadata={
"name": "Guid",
"type": "Attribute",
"pattern": r"[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}",
}
)
is_external: bool = field(
default=False,
metadata={
"name": "isExternal",
"type": "Attribute",
}
)
@dataclass(slots=True, kw_only=True)
class TopicRelatedTopic:
class Meta:
global_type = False
guid: str = field(
metadata={
"name": "Guid",
"type": "Attribute",
"required": True,
"pattern": r"[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}",
}
)
@dataclass(slots=True, kw_only=True)
class ViewPoint:
viewpoint: Optional[str] = field(
default=None,
metadata={
"name": "Viewpoint",
"type": "Element",
"namespace": "",
}
)
snapshot: Optional[str] = field(
default=None,
metadata={
"name": "Snapshot",
"type": "Element",
"namespace": "",
}
)
index: Optional[int] = field(
default=None,
metadata={
"name": "Index",
"type": "Element",
"namespace": "",
}
)
guid: str = field(
metadata={
"name": "Guid",
"type": "Attribute",
"required": True,
"pattern": r"[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}",
}
)
@dataclass(slots=True, kw_only=True)
class Comment:
date: XmlDateTime = field(
metadata={
"name": "Date",
"type": "Element",
"namespace": "",
"required": True,
}
)
author: str = field(
metadata={
"name": "Author",
"type": "Element",
"namespace": "",
"required": True,
}
)
comment: str = field(
metadata={
"name": "Comment",
"type": "Element",
"namespace": "",
"required": True,
}
)
viewpoint: Optional[CommentViewpoint] = field(
default=None,
metadata={
"name": "Viewpoint",
"type": "Element",
"namespace": "",
}
)
modified_date: Optional[XmlDateTime] = field(
default=None,
metadata={
"name": "ModifiedDate",
"type": "Element",
"namespace": "",
}
)
modified_author: Optional[str] = field(
default=None,
metadata={
"name": "ModifiedAuthor",
"type": "Element",
"namespace": "",
}
)
guid: str = field(
metadata={
"name": "Guid",
"type": "Attribute",
"required": True,
"pattern": r"[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}",
}
)
@dataclass(slots=True, kw_only=True)
class Header:
file: List[HeaderFile] = field(
default_factory=list,
metadata={
"name": "File",
"type": "Element",
"namespace": "",
"min_occurs": 1,
}
)
@dataclass(slots=True, kw_only=True)
class Topic:
reference_link: List[str] = field(
default_factory=list,
metadata={
"name": "ReferenceLink",
"type": "Element",
"namespace": "",
}
)
title: str = field(
metadata={
"name": "Title",
"type": "Element",
"namespace": "",
"required": True,
}
)
priority: Optional[str] = field(
default=None,
metadata={
"name": "Priority",
"type": "Element",
"namespace": "",
}
)
index: Optional[int] = field(
default=None,
metadata={
"name": "Index",
"type": "Element",
"namespace": "",
}
)
labels: List[str] = field(
default_factory=list,
metadata={
"name": "Labels",
"type": "Element",
"namespace": "",
}
)
creation_date: XmlDateTime = field(
metadata={
"name": "CreationDate",
"type": "Element",
"namespace": "",
"required": True,
}
)
creation_author: str = field(
metadata={
"name": "CreationAuthor",
"type": "Element",
"namespace": "",
"required": True,
}
)
modified_date: Optional[XmlDateTime] = field(
default=None,
metadata={
"name": "ModifiedDate",
"type": "Element",
"namespace": "",
}
)
modified_author: Optional[str] = field(
default=None,
metadata={
"name": "ModifiedAuthor",
"type": "Element",
"namespace": "",
}
)
due_date: Optional[XmlDateTime] = field(
default=None,
metadata={
"name": "DueDate",
"type": "Element",
"namespace": "",
}
)
assigned_to: Optional[str] = field(
default=None,
metadata={
"name": "AssignedTo",
"type": "Element",
"namespace": "",
}
)
stage: Optional[str] = field(
default=None,
metadata={
"name": "Stage",
"type": "Element",
"namespace": "",
}
)
description: Optional[str] = field(
default=None,
metadata={
"name": "Description",
"type": "Element",
"namespace": "",
}
)
bim_snippet: Optional[BimSnippet] = field(
default=None,
metadata={
"name": "BimSnippet",
"type": "Element",
"namespace": "",
}
)
document_reference: List[TopicDocumentReference] = field(
default_factory=list,
metadata={
"name": "DocumentReference",
"type": "Element",
"namespace": "",
}
)
related_topic: List[TopicRelatedTopic] = field(
default_factory=list,
metadata={
"name": "RelatedTopic",
"type": "Element",
"namespace": "",
}
)
guid: str = field(
metadata={
"name": "Guid",
"type": "Attribute",
"required": True,
"pattern": r"[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}",
}
)
topic_type: Optional[str] = field(
default=None,
metadata={
"name": "TopicType",
"type": "Attribute",
}
)
topic_status: Optional[str] = field(
default=None,
metadata={
"name": "TopicStatus",
"type": "Attribute",
}
)
@dataclass(slots=True, kw_only=True)
class Markup:
header: Optional[Header] = field(
default=None,
metadata={
"name": "Header",
"type": "Element",
"namespace": "",
}
)
topic: Topic = field(
metadata={
"name": "Topic",
"type": "Element",
"namespace": "",
"required": True,
}
)
comment: List[Comment] = field(
default_factory=list,
metadata={
"name": "Comment",
"type": "Element",
"namespace": "",
}
)
viewpoints: List[ViewPoint] = field(
default_factory=list,
metadata={
"name": "Viewpoints",
"type": "Element",
"namespace": "",
}
)
+41
View File
@@ -0,0 +1,41 @@
from dataclasses import dataclass, field
from typing import Optional
@dataclass(slots=True, kw_only=True)
class Project:
name: Optional[str] = field(
default=None,
metadata={
"name": "Name",
"type": "Element",
"namespace": "",
}
)
project_id: str = field(
metadata={
"name": "ProjectId",
"type": "Attribute",
"required": True,
}
)
@dataclass(slots=True, kw_only=True)
class ProjectExtension:
project: Optional[Project] = field(
default=None,
metadata={
"name": "Project",
"type": "Element",
"namespace": "",
}
)
extension_schema: str = field(
metadata={
"name": "ExtensionSchema",
"type": "Element",
"namespace": "",
"required": True,
}
)
+21
View File
@@ -0,0 +1,21 @@
from dataclasses import dataclass, field
from typing import Optional
@dataclass(slots=True, kw_only=True)
class Version:
detailed_version: Optional[str] = field(
default=None,
metadata={
"name": "DetailedVersion",
"type": "Element",
"namespace": "",
}
)
version_id: Optional[str] = field(
default=None,
metadata={
"name": "VersionId",
"type": "Attribute",
}
)
+476
View File
@@ -0,0 +1,476 @@
from dataclasses import dataclass, field
from enum import Enum
from typing import List, Optional
class BitmapFormat(Enum):
PNG = "PNG"
JPG = "JPG"
@dataclass(slots=True, kw_only=True)
class Component:
originating_system: Optional[str] = field(
default=None,
metadata={
"name": "OriginatingSystem",
"type": "Element",
}
)
authoring_tool_id: Optional[str] = field(
default=None,
metadata={
"name": "AuthoringToolId",
"type": "Element",
}
)
ifc_guid: Optional[str] = field(
default=None,
metadata={
"name": "IfcGuid",
"type": "Attribute",
"length": 22,
"pattern": r"[0-9,A-Z,a-z,_$]*",
}
)
@dataclass(slots=True, kw_only=True)
class Direction:
x: float = field(
metadata={
"name": "X",
"type": "Element",
"required": True,
}
)
y: float = field(
metadata={
"name": "Y",
"type": "Element",
"required": True,
}
)
z: float = field(
metadata={
"name": "Z",
"type": "Element",
"required": True,
}
)
@dataclass(slots=True, kw_only=True)
class Point:
x: float = field(
metadata={
"name": "X",
"type": "Element",
"required": True,
}
)
y: float = field(
metadata={
"name": "Y",
"type": "Element",
"required": True,
}
)
z: float = field(
metadata={
"name": "Z",
"type": "Element",
"required": True,
}
)
@dataclass(slots=True, kw_only=True)
class ViewSetupHints:
spaces_visible: Optional[bool] = field(
default=None,
metadata={
"name": "SpacesVisible",
"type": "Attribute",
}
)
space_boundaries_visible: Optional[bool] = field(
default=None,
metadata={
"name": "SpaceBoundariesVisible",
"type": "Attribute",
}
)
openings_visible: Optional[bool] = field(
default=None,
metadata={
"name": "OpeningsVisible",
"type": "Attribute",
}
)
@dataclass(slots=True, kw_only=True)
class ClippingPlane:
location: Point = field(
metadata={
"name": "Location",
"type": "Element",
"required": True,
}
)
direction: Direction = field(
metadata={
"name": "Direction",
"type": "Element",
"required": True,
}
)
@dataclass(slots=True, kw_only=True)
class ComponentColoringColor:
class Meta:
global_type = False
component: List[Component] = field(
default_factory=list,
metadata={
"name": "Component",
"type": "Element",
"min_occurs": 1,
}
)
color: Optional[str] = field(
default=None,
metadata={
"name": "Color",
"type": "Attribute",
"pattern": r"[0-9,a-f,A-F]{6}([0-9,a-f,A-F]{2})?",
}
)
@dataclass(slots=True, kw_only=True)
class ComponentSelection:
component: List[Component] = field(
default_factory=list,
metadata={
"name": "Component",
"type": "Element",
"min_occurs": 1,
}
)
@dataclass(slots=True, kw_only=True)
class ComponentVisibilityExceptions:
class Meta:
global_type = False
component: List[Component] = field(
default_factory=list,
metadata={
"name": "Component",
"type": "Element",
"min_occurs": 1,
}
)
@dataclass(slots=True, kw_only=True)
class Line:
start_point: Point = field(
metadata={
"name": "StartPoint",
"type": "Element",
"required": True,
}
)
end_point: Point = field(
metadata={
"name": "EndPoint",
"type": "Element",
"required": True,
}
)
@dataclass(slots=True, kw_only=True)
class OrthogonalCamera:
"""
Attributes
camera_view_point:
camera_direction:
camera_up_vector:
view_to_world_scale: view's visible size in meters
"""
camera_view_point: Point = field(
metadata={
"name": "CameraViewPoint",
"type": "Element",
"required": True,
}
)
camera_direction: Direction = field(
metadata={
"name": "CameraDirection",
"type": "Element",
"required": True,
}
)
camera_up_vector: Direction = field(
metadata={
"name": "CameraUpVector",
"type": "Element",
"required": True,
}
)
view_to_world_scale: float = field(
metadata={
"name": "ViewToWorldScale",
"type": "Element",
"required": True,
}
)
@dataclass(slots=True, kw_only=True)
class PerspectiveCamera:
"""
Attributes
camera_view_point:
camera_direction:
camera_up_vector:
field_of_view: It is currently limited to a value between 45 and
60 degrees. This limitation will be dropped in the next
release and viewers should be expect values outside this
range in current implementations.
"""
camera_view_point: Point = field(
metadata={
"name": "CameraViewPoint",
"type": "Element",
"required": True,
}
)
camera_direction: Direction = field(
metadata={
"name": "CameraDirection",
"type": "Element",
"required": True,
}
)
camera_up_vector: Direction = field(
metadata={
"name": "CameraUpVector",
"type": "Element",
"required": True,
}
)
field_of_view: float = field(
metadata={
"name": "FieldOfView",
"type": "Element",
"required": True,
"min_inclusive": 1.0,
"max_inclusive": 170.0,
}
)
@dataclass(slots=True, kw_only=True)
class VisualizationInfoBitmap:
class Meta:
global_type = False
bitmap: BitmapFormat = field(
metadata={
"name": "Bitmap",
"type": "Element",
"required": True,
}
)
reference: str = field(
metadata={
"name": "Reference",
"type": "Element",
"required": True,
}
)
location: Point = field(
metadata={
"name": "Location",
"type": "Element",
"required": True,
}
)
normal: Direction = field(
metadata={
"name": "Normal",
"type": "Element",
"required": True,
}
)
up: Direction = field(
metadata={
"name": "Up",
"type": "Element",
"required": True,
}
)
height: float = field(
metadata={
"name": "Height",
"type": "Element",
"required": True,
}
)
@dataclass(slots=True, kw_only=True)
class ComponentColoring:
color: List[ComponentColoringColor] = field(
default_factory=list,
metadata={
"name": "Color",
"type": "Element",
"min_occurs": 1,
}
)
@dataclass(slots=True, kw_only=True)
class ComponentVisibility:
exceptions: Optional[ComponentVisibilityExceptions] = field(
default=None,
metadata={
"name": "Exceptions",
"type": "Element",
}
)
default_visibility: Optional[bool] = field(
default=None,
metadata={
"name": "DefaultVisibility",
"type": "Attribute",
}
)
@dataclass(slots=True, kw_only=True)
class VisualizationInfoClippingPlanes:
class Meta:
global_type = False
clipping_plane: List[ClippingPlane] = field(
default_factory=list,
metadata={
"name": "ClippingPlane",
"type": "Element",
}
)
@dataclass(slots=True, kw_only=True)
class VisualizationInfoLines:
class Meta:
global_type = False
line: List[Line] = field(
default_factory=list,
metadata={
"name": "Line",
"type": "Element",
"min_occurs": 1,
}
)
@dataclass(slots=True, kw_only=True)
class Components:
view_setup_hints: Optional[ViewSetupHints] = field(
default=None,
metadata={
"name": "ViewSetupHints",
"type": "Element",
}
)
selection: Optional[ComponentSelection] = field(
default=None,
metadata={
"name": "Selection",
"type": "Element",
}
)
visibility: ComponentVisibility = field(
metadata={
"name": "Visibility",
"type": "Element",
"required": True,
}
)
coloring: Optional[ComponentColoring] = field(
default=None,
metadata={
"name": "Coloring",
"type": "Element",
}
)
@dataclass(slots=True, kw_only=True)
class VisualizationInfo:
"""
VisualizationInfo documentation.
"""
components: Optional[Components] = field(
default=None,
metadata={
"name": "Components",
"type": "Element",
}
)
orthogonal_camera: Optional[OrthogonalCamera] = field(
default=None,
metadata={
"name": "OrthogonalCamera",
"type": "Element",
}
)
perspective_camera: Optional[PerspectiveCamera] = field(
default=None,
metadata={
"name": "PerspectiveCamera",
"type": "Element",
}
)
lines: Optional[VisualizationInfoLines] = field(
default=None,
metadata={
"name": "Lines",
"type": "Element",
}
)
clipping_planes: Optional[VisualizationInfoClippingPlanes] = field(
default=None,
metadata={
"name": "ClippingPlanes",
"type": "Element",
}
)
bitmap: List[VisualizationInfoBitmap] = field(
default_factory=list,
metadata={
"name": "Bitmap",
"type": "Element",
}
)
guid: str = field(
metadata={
"name": "Guid",
"type": "Attribute",
"required": True,
"pattern": r"[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}",
}
)
+304
View File
@@ -0,0 +1,304 @@
"""BCF XML V2 Topic handler."""
import datetime
import tempfile
import uuid
import zipfile
from pathlib import Path
from typing import Any, NoReturn, Optional
import numpy as np
from ifcopenshell import entity_instance
from numpy.typing import NDArray
from xsdata.models.datatype import XmlDateTime
import bcf.v2.model as mdl
from bcf.inmemory_zipfile import ZipFileInterface
from bcf.v2.visinfo import VisualizationInfoHandler
from bcf.xml_parser import AbstractXmlParserSerializer, XmlParserSerializer
class TopicHandler:
"""BCF Topic and related objects handler."""
def __init__(
self,
topic_dir: Optional[zipfile.Path] = None,
xml_handler: Optional[AbstractXmlParserSerializer] = None,
) -> None:
self._markup: Optional[mdl.Markup] = None
self._viewpoints: dict[str, VisualizationInfoHandler] = {}
self._reference_files: dict[str, bytes] = {}
self._document_references: dict[str, bytes] = {}
self._bim_snippet: Optional[bytes] = None
self._xml_handler = xml_handler or XmlParserSerializer()
self._topic_dir = topic_dir
@property
def markup(self) -> Optional[mdl.Markup]:
if not self._markup:
markup_path = self._topic_dir.joinpath("markup.bcf")
if markup_path.exists():
self._markup = self._xml_handler.parse(markup_path.read_bytes(), mdl.Markup)
return self._markup
@markup.setter
def markup(self, value: mdl.Markup) -> None:
self._markup = value
@property
def topic(self) -> mdl.Topic:
"""Return the Topic object."""
return self.markup.topic
@property
def guid(self) -> str:
"""Return the GUID of the topic."""
if self._markup:
return self.topic.guid
return self._topic_dir.name if self._topic_dir else ""
@property
def header(self) -> Optional[mdl.Header]:
"""Return the header of the topic."""
return self.markup.header if self.markup else None
@property
def comments(self) -> list[mdl.Comment]:
"""Return the comments of the topic."""
return self.markup.comment if self.markup else []
@property
def bim_snippet(self) -> Optional[bytes]:
if not self._bim_snippet and self._topic_dir:
self._bim_snippet = self._load_bim_snippet()
return self._bim_snippet
@bim_snippet.setter
def bim_snippet(self, value: bytes) -> None:
self._bim_snippet = value
@property
def viewpoints(self) -> dict[str, VisualizationInfoHandler]:
if not self._viewpoints and self._topic_dir:
self._viewpoints = self._load_viewpoints()
return self._viewpoints
@property
def reference_files(self) -> dict[str, bytes]:
if self._reference_files or not self.header:
return self._reference_files
for ref in self.header.file:
if ref.is_external:
continue
real_path = self._topic_dir
for path_part in ref.reference.split("/"):
real_path = real_path.parent if path_part == ".." else real_path.joinpath(path_part)
self._reference_files[ref.reference] = real_path.read_bytes()
return self._reference_files
@property
def document_references(self) -> dict[str, bytes]:
if self._document_references or not self.topic:
return self._document_references
for doc in self.topic.document_reference:
if doc.is_external or not doc.referenced_document:
continue
real_path = self._topic_dir
for path_part in doc.referenced_document.split("/"):
real_path = real_path.parent if path_part == ".." else real_path.joinpath(path_part)
self._document_references[doc.referenced_document] = real_path.read_bytes()
return self._document_references
def _load_bim_snippet(self) -> Optional[bytes]:
bim_snippet_obj = self.topic.bim_snippet
if bim_snippet_obj and not bim_snippet_obj.is_external:
bim_snippet_path = self._topic_dir.joinpath(bim_snippet_obj.reference)
if bim_snippet_path.exists():
return bim_snippet_path.read_bytes()
return None
def _load_viewpoints(self) -> dict[str, VisualizationInfoHandler]:
if self.markup and (viewpoints := self.markup.viewpoints):
return VisualizationInfoHandler.from_topic_viewpoints(self._topic_dir, viewpoints)
return {}
@classmethod
def create_new(
cls,
title: str,
description: str,
author: str,
topic_type: str = "",
topic_status: str = "",
xml_handler: Optional[AbstractXmlParserSerializer] = None,
) -> "TopicHandler":
"""
Create a new BCF topic.
Args:
title: The title of the topic.
description: The description of the topic.
author: The author of the topic.
topic_type: The type of the topic.
topic_status: The status of the topic.
xml_handler: The XML parser/serializer to use.
Returns:
The BCF topic definition.
"""
creation_date = XmlDateTime.from_datetime(datetime.datetime.now())
guid = str(uuid.uuid4())
topic = mdl.Topic(
title=title,
description=description,
creation_author=author,
creation_date=creation_date,
guid=guid,
topic_type=topic_type,
topic_status=topic_status,
)
markup = mdl.Markup(topic=topic)
obj = cls(topic_dir=Path(guid), xml_handler=xml_handler or XmlParserSerializer())
obj.markup = markup
return obj
def save(self, destination_zip: ZipFileInterface) -> None:
"""
Save the topic to a BCF zip file.
Args:
bcf_zip: The BCF zip file to save to.
"""
topic_dir = self.guid
self._save_xml(destination_zip, self._markup, "markup.bcf")
self._save_viewpoints(destination_zip, topic_dir)
self._save_bim_snippet(destination_zip)
self._save_reference_files(destination_zip)
self._save_document_references(destination_zip)
def _save_viewpoints(self, destination_zip: ZipFileInterface, topic_dir: str) -> None:
if not self.markup or not (viewpoints := self.markup.viewpoints):
return
for vpt in viewpoints:
if vpt.viewpoint:
self.viewpoints[vpt.viewpoint].save(destination_zip, topic_dir, vpt)
def _save_xml(self, destination_zip: ZipFileInterface, item: Any, target: str) -> None:
if self._topic_dir is None:
return
to_write = self._xml_handler.serialize(item) if item else self._topic_dir.joinpath(target).read_bytes()
destination_zip.writestr(f"{self._topic_dir.name}/{target}", to_write)
def _save_bim_snippet(self, destination_zip: ZipFileInterface) -> None:
snippet = self.topic.bim_snippet
if not snippet or snippet.is_external:
return
ref_filename = Path(snippet.reference).name
if self.bim_snippet:
destination_zip.writestr(f"{self.topic.guid}/{ref_filename}", self.bim_snippet)
def _save_reference_files(self, destination_zip: ZipFileInterface) -> None:
if not self.header:
return
for ref in self.header.file:
if ref.is_external or not ref.reference:
continue
real_path = self._topic_dir
for path_part in ref.reference.split("/"):
real_path = real_path.parent if path_part == ".." else real_path.joinpath(path_part)
destination_zip.writestr(real_path.at, self.reference_files[ref.reference])
def _save_document_references(self, destination_zip: ZipFileInterface) -> None:
if not self.topic:
return
for doc in self.topic.document_reference:
if doc.is_external or not doc.referenced_document:
continue
real_path = self._topic_dir
for path_part in doc.referenced_document.split("/"):
real_path = real_path.parent if path_part == ".." else real_path.joinpath(path_part)
destination_zip.writestr(real_path.at, self.document_references[doc.referenced_document])
def extract_file(self, entity, outfile: Optional[Path] = None) -> Path:
"""Extracts an element with a file into a temporary directory
These include header files, bim snippets, document references, and
viewpoint bitmaps. External reference are not downloaded. Instead, the
URI reference is returned.
:param entity: The entity with a file reference to extract
:type entity: bcf.v2.model.HeaderFile,bcf.v2.model.BimSnippet,bcf.v2.model.TopicDocumentReference
:param outfile: If provided, save the header file to that location.
Otherwise, a temporary directory is created and the filename is
derived from the header's original filename.
:type outfile: pathlib.Path,optional
:return: The filepath of the extracted file. It may be a URL if the
header file is external.
:rtype: Path
"""
if hasattr(entity, "reference"):
reference = entity.reference
else:
reference = entity.referenced_document
if not reference:
return
if getattr(entity, "is_external", False):
return entity.reference
resolved_reference = self._topic_dir
for part in Path(reference).parts:
if part == "..":
resolved_reference = resolved_reference.parent
else:
resolved_reference = resolved_reference.joinpath(part)
if not outfile:
if getattr(entity, "filename", None):
filename = entity.filename
else:
filename = resolved_reference.name
outfile = Path(tempfile.mkdtemp()) / filename
with open(outfile, "wb") as f:
f.write(resolved_reference.read_bytes())
return outfile
def add_viewpoint(self, element: entity_instance) -> None:
"""Add a viewpoint pointed at the placement of an IFC element to the topic.
Args:
element: The IFC element.
"""
new_viewpoint = VisualizationInfoHandler.create_new(element, self._xml_handler)
self.add_visinfo_handler(new_viewpoint)
def add_viewpoint_from_point_and_guids(self, position: NDArray[np.float_], *guids: str) -> None:
"""Add a viewpoint pointing at an XYZ point in space
Args:
position: the XYZ point in space
guids: one or more element GlobalIds.
"""
vi_handler = VisualizationInfoHandler.create_from_point_and_guids(
position, *guids, xml_handler=self._xml_handler
)
self.add_visinfo_handler(vi_handler)
def add_visinfo_handler(self, new_viewpoint: VisualizationInfoHandler) -> None:
self.viewpoints[new_viewpoint.guid + ".bcfv"] = new_viewpoint
self.markup.viewpoints.append(mdl.ViewPoint(viewpoint=new_viewpoint.guid + ".bcfv", guid=new_viewpoint.guid))
def __eq__(self, other: object) -> bool | NoReturn:
return (
(
self.markup == other.markup
and self.viewpoints == other.viewpoints
and self.bim_snippet == other.bim_snippet
)
if isinstance(other, TopicHandler)
else NotImplemented
)
+299
View File
@@ -0,0 +1,299 @@
import uuid
import zipfile
from functools import lru_cache
from typing import Any, Iterable, Optional
import numpy as np
from ifcopenshell import entity_instance
import ifcopenshell.util.unit
import ifcopenshell.util.placement
from numpy.typing import NDArray
import bcf.v2.model as mdl
from bcf.geometry import (
camera_vectors_from_element_placement,
camera_vectors_from_target_position,
)
from bcf.inmemory_zipfile import ZipFileInterface
from bcf.xml_parser import AbstractXmlParserSerializer, XmlParserSerializer
class VisualizationInfoHandler:
"""Handle the VisualizationInfo and related objects."""
def __init__(
self,
visualization_info: mdl.VisualizationInfo,
snapshot: Optional[bytes] = None,
bitmaps: Optional[dict[str, bytes]] = None,
xml_handler: Optional[AbstractXmlParserSerializer] = None,
) -> None:
self.visualization_info = visualization_info
self.snapshot = snapshot
self.bitmaps = bitmaps or {}
self._xml_handler = xml_handler or XmlParserSerializer()
@property
def guid(self) -> str:
"""Return the GUID of the visualization info."""
return self.visualization_info.guid
@classmethod
def from_topic_viewpoints(
cls,
topic_dir: zipfile.Path,
vps: Iterable[mdl.ViewPoint],
xml_handler: Optional[AbstractXmlParserSerializer] = None,
) -> dict[str, "VisualizationInfoHandler"]:
"""Create VisualizationInfoHandler objects of a Topic's ViewPoints."""
viewpoints = {}
for vpt in vps:
visinfo = cls.load(topic_dir, vpt, xml_handler)
if visinfo and vpt.viewpoint:
viewpoints[vpt.viewpoint] = visinfo
return viewpoints
@classmethod
def load(
cls,
topic_dir: zipfile.Path,
vpt: mdl.ViewPoint,
xml_handler: Optional[AbstractXmlParserSerializer] = None,
) -> Optional["VisualizationInfoHandler"]:
"""
Load the VisualizationInfo and related objects from a BCF zip file.
Args:
topic_dir: The directory in the BCF zip file to load from.
vpt: The ViewPoint to load.
xml_handler: The XML handler to use to parse the VisualizationInfo.
Returns:
The VisualizationInfoHandler object.
"""
visinfo = cls._load_visinfo(topic_dir, vpt.viewpoint, xml_handler)
if not visinfo:
return None
snapshot = cls._load_snapshot(topic_dir, vpt.snapshot)
bitmaps = cls._load_bitmaps(topic_dir, visinfo)
return cls(visinfo, snapshot, bitmaps, xml_handler)
@staticmethod
def _load_visinfo(
topic_dir: zipfile.Path,
vp_name: Optional[str],
xml_handler: Optional[AbstractXmlParserSerializer] = None,
) -> Optional[mdl.VisualizationInfo]:
if not vp_name:
return None
vp_path = topic_dir.joinpath(vp_name)
if vp_path.exists():
xml_handler = xml_handler or XmlParserSerializer()
return xml_handler.parse(vp_path.read_bytes(), mdl.VisualizationInfo)
return None
@staticmethod
def _load_snapshot(topic_dir: zipfile.Path, vp_snapshot: Optional[str]) -> Optional[bytes]:
if vp_snapshot:
snapshot_path = topic_dir.joinpath(vp_snapshot)
if snapshot_path.exists():
return snapshot_path.read_bytes()
return None
@staticmethod
def _load_bitmaps(topic_dir: zipfile.Path, visinfo: Optional[mdl.VisualizationInfo]) -> dict[str, bytes]:
if not visinfo or not (bitmaps := visinfo.bitmap):
return {}
bitmaps_dict = {}
for bitmap in bitmaps:
if not bitmap.reference:
continue
bitmap_path = topic_dir.joinpath(bitmap.reference)
if bitmap_path.exists():
bitmaps_dict[bitmap.reference] = bitmap_path.read_bytes()
return bitmaps_dict
def save(
self,
bcf_zip: ZipFileInterface,
topic_dir: str,
vpt: mdl.ViewPoint,
) -> None:
"""
Save the VisualizationInfo and related objects to a BCF zip file.
Args:
bcf_zip: The BCF zip file to save to.
topic_dir: The directory in the BCF zip file to save to.
vpt: The ViewPoint to save.
"""
if not (vp_name := vpt.viewpoint):
return
self._save_visinfo(bcf_zip, topic_dir, vp_name)
self._save_snapshot(bcf_zip, topic_dir, vpt.snapshot)
self._save_bitmaps(bcf_zip, topic_dir)
def _save_snapshot(self, bcf_zip: ZipFileInterface, topic_dir: str, filename: Optional[str]) -> None:
if self.snapshot and filename:
bcf_zip.writestr(f"{topic_dir}/{filename}", self.snapshot)
def _save_visinfo(self, bcf_zip: ZipFileInterface, topic_dir: str, vp_name: str) -> None:
bcf_zip.writestr(
f"{topic_dir}/{vp_name}",
self._xml_handler.serialize(self.visualization_info),
)
def _save_bitmaps(self, bcf_zip: ZipFileInterface, topic_dir: str) -> None:
if not self.bitmaps:
return
if not (bitmaps_defs := self.visualization_info.bitmap):
return
for bitmap_def in bitmaps_defs:
if not (bitmap_name := bitmap_def.reference):
continue
if bitmap_name in self.bitmaps:
bcf_zip.writestr(f"{topic_dir}/{bitmap_name}", self.bitmaps[bitmap_name])
@classmethod
def create_new(
cls,
element: entity_instance,
xml_handler: Optional[AbstractXmlParserSerializer] = None,
) -> "VisualizationInfoHandler":
"""
Create a new VisualizationInfoHandler object from an IFC element.
Args:
element: The IFC element to point at.
xml_handler: The XML handler to use.
Returns:
The VisualizationInfoHandler object.
"""
xml_handler = xml_handler or XmlParserSerializer()
return cls(visualization_info=build_viewpoint(element), xml_handler=xml_handler)
@classmethod
def create_from_point_and_guids(
cls,
position: NDArray[np.float_],
*guids: str,
xml_handler: Optional[AbstractXmlParserSerializer] = None,
) -> "VisualizationInfoHandler":
"""
Create a new VisualizationInfoHandler object from an IFC element.
Args:
position: target point coordinates.
*guids: One or more IFC element GUID.
xml_handler: The XML handler to use.
Returns:
The VisualizationInfoHandler object.
"""
xml_handler = xml_handler or XmlParserSerializer()
return cls(
visualization_info=build_viewpoint_from_position_and_guids(position, *guids), xml_handler=xml_handler
)
@lru_cache(maxsize=None)
def build_viewpoint(element: entity_instance) -> mdl.VisualizationInfo:
"""
Return a BCF viewpoint of an IFC element.
This function is cached to speedudp the creation of multiple BCF topics regarding the same element.
Args:
element: The IFC element to point at.
Returns:
The BCF viewpoint definition.
"""
ifc_file = element.wrapped_data.file
unit_scale = ifcopenshell.util.unit.calculate_unit_scale(ifc_file)
elem_placement = ifcopenshell.util.placement.get_local_placement(element.ObjectPlacement)
elem_placement[0][3] *= unit_scale
elem_placement[1][3] *= unit_scale
elem_placement[2][3] *= unit_scale
return mdl.VisualizationInfo(
guid=str(uuid.uuid4()),
components=build_components(element.GlobalId),
perspective_camera=build_camera(elem_placement),
)
def build_viewpoint_from_position_and_guids(position: NDArray[np.float_], *guids: str) -> mdl.VisualizationInfo:
"""
Return a BCF viewpoint of an IFC element.
This function is cached to speedudp the creation of multiple BCF topics regarding the same element.
Args:
position: target point coordinates.
*guids: One or more IFC element GUID.
Returns:
The BCF viewpoint definition.
"""
return mdl.VisualizationInfo(
guid=str(uuid.uuid4()),
components=build_components(*guids),
perspective_camera=build_camera_from_vectors(*camera_vectors_from_target_position(position)),
)
def build_components(*guids: str) -> mdl.Components:
"""
Return the BCF components from an IFC element GUID.
Args:
*guids: One or more IFC element GUID.
Returns:
The BCF components definition.
"""
components = [mdl.Component(ifc_guid=guid) for guid in guids]
return mdl.Components(
selection=mdl.ComponentSelection(component=components),
visibility=mdl.ComponentVisibility(default_visibility=True),
)
def build_camera(elem_placement: NDArray[np.float_]) -> mdl.PerspectiveCamera:
"""
Return a BCF camera for an IFC element placement matrix.
Args:
elem_placement: The IFC element placement as a rototranslation matrix.
Returns:
The BCF camera definition.
"""
return build_camera_from_vectors(*camera_vectors_from_element_placement(elem_placement))
def build_camera_from_vectors(
camera_position: NDArray[np.float_], camera_dir: NDArray[np.float_], camera_up: NDArray[np.float_]
) -> mdl.PerspectiveCamera:
"""
Return a BCF camera for an IFC element placement matrix.
Args:
camera_position: camera position array
camera_dir: camera direction versor
camera_up_vector: camera up versor
Returns:
The BCF camera definition.
"""
camera_viewpoint = mdl.Point(x=camera_position[0], y=camera_position[1], z=camera_position[2])
camera_direction = mdl.Direction(x=camera_dir[0], y=camera_dir[1], z=camera_dir[2])
camera_up_vector = mdl.Direction(x=camera_up[0], y=camera_up[1], z=camera_up[2])
return mdl.PerspectiveCamera(
camera_view_point=camera_viewpoint,
camera_direction=camera_direction,
camera_up_vector=camera_up_vector,
field_of_view=60.0,
)
+1 -19
View File
@@ -1,19 +1 @@
# BCF - BCF Python library
# Copyright (C) 2021 Prabhat Singh <singh01prabhat@gmail.com>
#
# This file is part of BCF.
#
# BCF is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BCF is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with BCF. If not, see <http://www.gnu.org/licenses/>.
"""BCF XML v3 handler."""
+172 -184
View File
@@ -1,4 +1,3 @@
# BCF - BCF Python library
# Copyright (C) 2021 Prabhat Singh <singh01prabhat@gmail.com>
#
@@ -17,25 +16,27 @@
# You should have received a copy of the GNU Lesser General Public License
# along with BCF. If not, see <http://www.gnu.org/licenses/>.
import uuid
import time
import json
import urllib
import requests
import webbrowser
import http.server
import base64
import tempfile
import http.server
import os
import tempfile
import time
import urllib
import uuid
import webbrowser
from re import A
from typing import Any, Optional, Tuple
import requests
client_id, client_secret = "", ""
class OAuthReceiver(http.server.BaseHTTPRequestHandler):
def do_GET(self):
def do_GET(self) -> None:
query = urllib.parse.parse_qs(urllib.parse.urlparse(self.path).query)
self.server.auth_code = query.get("code", [""])[0]
self.server.auth_state = query.get("state", [""])[0]
self.server.auth_code = query.get("code", [""])[0] # type:ignore
self.server.auth_state = query.get("state", [""])[0] # type:ignore
self.send_response(200)
self.send_header("Content-type", "text/plain")
self.end_headers()
@@ -43,20 +44,21 @@ class OAuthReceiver(http.server.BaseHTTPRequestHandler):
class FoundationClient:
def __init__(self, client_id, client_secret, base_url=None, redirect_subdir=None):
def __init__(
self, client_id: str, client_secret: str, base_url: Optional[str] = None, redirect_subdir: Optional[str] = None
) -> None:
self.baseurl = base_url
self.access_token = ""
self.refresh_token = ""
self.access_token_expires_on = time.time()
self.refresh_token_expires_on = float("inf")
self.auth_endpoint = None
self.token_endpoint = None
self.token_endpoint = ""
self.client_id = client_id
self.client_secret = client_secret
self.auth_method = None
self.auth_method: Optional[str] = None
self.redirect_subdir = redirect_subdir
def get_access_token(self):
def get_access_token(self) -> str:
if self.access_token and self.access_token_expires_on > time.time():
return self.access_token
elif self.refresh_token and self.refresh_token_expires_on > time.time():
@@ -65,18 +67,18 @@ class FoundationClient:
self.login()
return self.access_token
def get_auth_methods(self):
def get_auth_methods(self) -> list[Any]:
resp = requests.get(f"{self.baseurl}foundation/1.0/auth")
return resp.json()["supported_oauth2_flows"]
def get_versions(self):
def get_versions(self) -> list[Any]:
resp = requests.get(f"{self.baseurl}foundation/versions")
return resp.json()["versions"]
def login(self):
def login(self) -> None:
resp = requests.get(f"{self.baseurl}foundation/1.0/auth")
values = resp.json()
self.auth_endpoint = values["oauth2_auth_url"]
auth_endpoint = values["oauth2_auth_url"]
self.token_endpoint = values["oauth2_token_url"]
with http.server.HTTPServer(("", 8080), OAuthReceiver) as server:
@@ -89,25 +91,22 @@ class FoundationClient:
"redirect_uri": f"http://localhost:{server.server_address[1]}/{self.redirect_subdir}",
}
)
if "?" in self.auth_endpoint:
webbrowser.open(f"{self.auth_endpoint}&{query}")
if "?" in auth_endpoint:
webbrowser.open(f"{auth_endpoint}&{query}")
else:
webbrowser.open(f"{self.auth_endpoint}?{query}")
webbrowser.open(f"{auth_endpoint}?{query}")
server.timeout = 100
server.state = state
server.handle_request()
if server.auth_code and server.auth_state == state:
if server.auth_code and server.auth_state == state: # pylint: disable=E1101
data = {
"grant_type": "authorization_code",
"code": server.auth_code,
"code": server.auth_code, # pylint: disable=E1101 type:ignore
"redirect_uri": f"http://localhost:{server.server_address[1]}/{self.redirect_subdir}",
}
auth_string = f"{self.client_id}:{self.client_secret}"
header_string = base64.b64encode(auth_string.encode("utf-8")).decode("utf-8")
headers = {"Authorization": f"Basic {header_string}"}
headers = self._get_access_token_headers()
self.set_tokens_from_response(requests.post(self.token_endpoint, data=data, headers=headers))
def get_refresh_token(self):
def get_refresh_token(self) -> None:
self.set_tokens_from_response(
requests.post(
self.token_endpoint,
@@ -118,10 +117,8 @@ class FoundationClient:
).json()
)
def get_new_access_token(self):
auth_string = f"{self.client_id}:{self.client_secret}"
header_string = base64.b64encode(auth_string.encode("utf-8")).decode("utf-8")
headers = {"Authorization": f"Basic {header_string}"}
def get_new_access_token(self) -> None:
headers = self._get_access_token_headers()
self.set_tokens_from_response(
requests.post(
self.token_endpoint,
@@ -133,35 +130,41 @@ class FoundationClient:
).json()
)
def set_auth_method(self, method="authorization_code_grant"):
def _get_access_token_headers(self) -> dict[str, str]:
auth_string = f"{self.client_id}:{self.client_secret}"
header_string = base64.b64encode(auth_string.encode("utf-8")).decode("utf-8")
return {"Authorization": f"Basic {header_string}"}
def set_auth_method(self, method: str = "authorization_code_grant") -> None:
if method != "authorization_code_grant":
raise NotImplementedError(f"{method} not supported")
else:
self.auth_method = method
def set_tokens_from_response(self, response):
response = response.json()
self.access_token = response["access_token"]
self.refresh_token = response["refresh_token"]
self.access_token_expires_on = time.time() + response["expires_in"]
if "refresh_token_expires_in" in response:
self.refresh_token_expires_on = time.time() + response["refresh_token_expires_in"]
def set_tokens_from_response(self, response: requests.Response) -> None:
response_dict = response.json()
self.access_token = response_dict["access_token"]
self.refresh_token = response_dict["refresh_token"]
self.access_token_expires_on = time.time() + response_dict["expires_in"]
if "refresh_token_expires_in" in response_dict:
self.refresh_token_expires_on = time.time() + response_dict["refresh_token_expires_in"]
class BcfClient:
def __init__(self, foundation_client):
def __init__(self, foundation_client: FoundationClient) -> None:
self.foundation_client = foundation_client
self.version_id = None
self.baseurl = None
self.version_id: Optional[str] = None
self.baseurl: Optional[str] = None
self.filepath = tempfile.mkdtemp()
def set_version(self, version):
def set_version(self, version: dict[str, str]) -> None:
self.version_id = version["version_id"]
self.baseurl = version["api_base_url"]
def get(self, endpoint, params=None, is_auth_required=False):
def get(self, endpoint: str, params: Any = None, is_auth_required: bool = False) -> Any:
# TODO: handle error http status codes and raise exception. Follow error.json standard.
headers = {"Authorization": "Bearer " + self.foundation_client.get_access_token()}
headers = {"Authorization": f"Bearer {self.foundation_client.get_access_token()}"}
response = requests.get(f"{self.baseurl}{endpoint}", headers=headers, params=params or None)
try:
response = requests.get(f"{self.baseurl}{endpoint}", headers=headers, params=params or None)
@@ -171,68 +174,62 @@ class BcfClient:
except requests.exceptions.HTTPError as e:
print(f"message: {response.reason}' '{response.status_code}' '{ e }")
def post(self, endpoint, data=None, params=None):
def post(self, endpoint: str, data: Any = None, params: Any = None) -> Tuple[int, str]:
headers = {
"Authorization": "Bearer " + self.foundation_client.get_access_token(),
"Authorization": f"Bearer {self.foundation_client.get_access_token()}",
"Content-type": "application/json",
}
try:
response = requests.post(
f"{self.baseurl}{endpoint}",
headers=headers,
params=params or None,
data=data or None,
f"{self.baseurl}{endpoint}", headers=headers, params=params or None, data=data or None
)
if response.status_code == 201:
return response.status_code, response.text
response.raise_for_status()
if response.status_code != 201:
response.raise_for_status()
return response.status_code, response.text
except requests.exceptions.HTTPError as errh:
print(f"message: {response.reason}' '{response.status_code}, {errh}")
return response.status_code, response.reason
def put(self, endpoint, data=None, params=None):
def put(self, endpoint: str, data: Any = None, params: Any = None) -> Tuple[int, str]:
headers = {
"Authorization": "Bearer " + self.foundation_client.get_access_token(),
"Authorization": f"Bearer {self.foundation_client.get_access_token()}",
"Content-type": "application/json",
}
try:
response = requests.put(
f"{self.baseurl}{endpoint}",
headers=headers,
params=params or None,
data=data or None,
f"{self.baseurl}{endpoint}", headers=headers, params=params or None, data=data or None
)
if response.status_code == 200:
return response.status_code, response.text
response.raise_for_status()
if response.status_code != 200:
response.raise_for_status()
return response.status_code, response.text
except requests.exceptions.HTTPError as errh:
print(f"message: {response.reason}' '{response.status_code}, {errh}")
return response.status_code, response.reason
def delete(self, endpoint, params=None):
def delete(self, endpoint: str, params: Any = None) -> Tuple[int, str]:
headers = {
"Authorization": "Bearer " + self.foundation_client.get_access_token(),
"Authorization": f"Bearer {self.foundation_client.get_access_token()}",
"Content-type": "application/json",
}
try:
response = requests.delete(
f"{self.baseurl}{endpoint}",
headers=headers,
params=params or None,
)
if response.status_code == 200:
return response.status_code, response.text
response.raise_for_status()
response = requests.delete(f"{self.baseurl}{endpoint}", headers=headers, params=params or None)
if response.status_code != 200:
response.raise_for_status()
return response.status_code, response.text
except requests.exceptions.HTTPError as errh:
print(f"message: {response.reason}' '{response.status_code}, {errh}")
return response.status_code, response.reason
def get_projects(self) -> list:
return self.get(
f"/projects",
)
def get_projects(self) -> list[Any]:
return self.get("/projects")
def get_project(
self,
project_id="",
) -> dict:
def get_project(self, project_id: str = "") -> dict[str, Any]:
return self.get(
f"/projects/{project_id}",
{
@@ -240,16 +237,13 @@ class BcfClient:
},
)
def update_project(self, project_id="", data=None) -> dict:
def update_project(self, project_id: str = "", data: Any = None) -> Tuple[int, str]:
url = f"{self.baseurl}/projects/{project_id}"
headers = {"Authorization": "Bearer " + self.foundation_client.get_access_token()}
headers = {"Authorization": f"Bearer {self.foundation_client.get_access_token()}"}
resp = requests.put(url, headers=headers, data=data)
return resp.status_code, resp.text
def get_extensions(
self,
project_id="",
) -> dict:
def get_extensions(self, project_id: str = "") -> dict[str, Any]:
return self.get(
f"/projects/{project_id}/extensions",
{
@@ -259,10 +253,10 @@ class BcfClient:
def get_topics(
self,
project_id="",
topics="",
query_string=None,
) -> list:
project_id: str = "",
topics: str = "",
query_string: Optional[str] = None,
) -> list[Any]:
# return self.get(
# f"/projects/{project_id}/topics",
# {
@@ -273,7 +267,7 @@ class BcfClient:
# )
pass
def get_topic(self, project_id="", topic_id="") -> dict:
def get_topic(self, project_id: str = "", topic_id: str = "") -> dict[str, Any]:
return self.get(
f"/projects/{project_id}/topics/{topic_id}",
{
@@ -282,42 +276,40 @@ class BcfClient:
},
)
def create_topic(self, project_id="", data=None):
def create_topic(self, project_id: str = "", data: Any = None) -> Tuple[int, str]:
return self.post(f"/projects/{project_id}/topics", data=data)
def update_topic(self, project_id="", topic_id="", data=None) -> dict:
def update_topic(self, project_id: str = "", topic_id: str = "", data: Any = None) -> Tuple[int, str]:
return self.put(f"/projects/{project_id}/topics/{topic_id}", data=data)
def delete_topic(self, project_id="", topic_id=""):
def delete_topic(self, project_id: str = "", topic_id: str = "") -> Tuple[int, str]:
return self.delete(f"/projects/{project_id}/topics/{topic_id}")
def get_snippet(self, project_id="", topic_id="") -> str:
def get_snippet(self, project_id: str = "", topic_id: str = "") -> Tuple[int, str]:
headers = {
"Authorization": "Bearer " + self.foundation_client.get_access_token(),
"Authorization": f"Bearer {self.foundation_client.get_access_token()}",
"Content-type": "application/octet-stream",
}
response = requests.get(
f"{self.baseurl}/projects/{project_id}/topics/{topic_id}/snippet",
headers=headers,
)
# TODO: write to tmpdir
with open(os.path.join(self.filepath, f"{project_id}_{topic_id}_snippet.txt"), "wb") as f:
f.write(response.content.decode("utf-8"))
return response.status_code, response.content
def update_snippet(self, project_id="", topic_id="", files=None, data=None):
response = requests.get(f"{self.baseurl}/projects/{project_id}/topics/{topic_id}/snippet", headers=headers)
content = response.content.decode("utf-8")
with open(os.path.join(self.filepath, f"{project_id}_{topic_id}_snippet.txt"), "w") as f:
f.write(content)
return response.status_code, content
def update_snippet(self, project_id: str = "", topic_id: str = "", files: Any = None, data: Any = None) -> int:
headers = {
"Authorization": "Bearer " + self.foundation_client.get_access_token(),
"Authorization": f"Bearer {self.foundation_client.get_access_token()}",
"Content-type": "application/octet-stream",
}
response = requests.put(
f"{self.baseurl}/projects/{project_id}/topics/{topic_id}/snippet",
headers=headers,
files=files,
f"{self.baseurl}/projects/{project_id}/topics/{topic_id}/snippet", headers=headers, files=files
)
return response.status_code
def get_files_information(self, project_id="") -> list:
def get_files_information(self, project_id: str = "") -> list[Any]:
return self.get(
f"/projects/{project_id}/files_information",
{
@@ -325,7 +317,7 @@ class BcfClient:
},
)
def get_files(self, project_id="", topic_id="") -> list:
def get_files(self, project_id: str = "", topic_id: str = "") -> list[Any]:
return self.get(
f"/projects/{project_id}/topics/{topic_id}/files",
{
@@ -336,32 +328,32 @@ class BcfClient:
def update_files(
self,
project_id="",
topic_id="",
data=None,
params=None,
):
project_id: str = "",
topic_id: str = "",
data: Any = None,
params: Any = None,
) -> Tuple[int, str]:
return self.put(
f"/projects/{project_id}/topics/{topic_id}/files",
data=data,
)
def get_comments(self, project_id="", topic_id="") -> list:
def get_comments(self, project_id: str = "", topic_id: str = "") -> None:
pass
def create_comments(
self,
project_id="",
topic_id="",
data=None,
params=None,
):
project_id: str = "",
topic_id: str = "",
data: Any = None,
params: Any = None,
) -> Tuple[int, str]:
return self.post(
f"/projects/{project_id}/topics/{topic_id}/comments",
data=data,
)
def get_comment(self, project_id="", topic_id="", comment_id="") -> dict:
def get_comment(self, project_id: str = "", topic_id: str = "", comment_id: str = "") -> dict[str, Any]:
return self.get(
f"/projects/{project_id}/topics/{topic_id}/comments/{comment_id}",
{
@@ -371,22 +363,22 @@ class BcfClient:
},
)
def delete_comment(self, project_id="", topic_id="", comment_id=""):
def delete_comment(self, project_id: str = "", topic_id: str = "", comment_id: str = "") -> Tuple[int, str]:
return self.delete(f"/projects/{project_id}/topics/{topic_id}/comments/{comment_id}")
def update_comment(
self,
project_id="",
topic_id="",
comment_id="",
data=None,
):
project_id: str = "",
topic_id: str = "",
comment_id: str = "",
data: Any = None,
) -> Tuple[int, str]:
return self.put(
f"/projects/{project_id}/topics/{topic_id}/comments/{comment_id}",
data=data,
)
def get_viewpoints(self, project_id="", topic_id="") -> list:
def get_viewpoints(self, project_id: str = "", topic_id: str = "") -> list[Any]:
return self.get(
f"/projects/{project_id}/topics/{topic_id}/viewpoints",
{
@@ -395,13 +387,13 @@ class BcfClient:
},
)
def create_viewpoints(self, project_id="", topic_id="", data=None):
def create_viewpoints(self, project_id: str = "", topic_id: str = "", data: Any = None) -> Tuple[int, str]:
return self.post(
f"/projects/{project_id}/topics/{topic_id}/viewpoints",
data=data,
)
def get_viewpoint(self, project_id="", topic_id="", viewpoint_id="") -> dict:
def get_viewpoint(self, project_id: str = "", topic_id: str = "", viewpoint_id: str = "") -> dict[str, Any]:
return self.get(
f"/projects/{project_id}/topics/{topic_id}/viewpoints/{viewpoint_id}",
{
@@ -413,15 +405,15 @@ class BcfClient:
def delete_viewpoint(
self,
project_id="",
topic_id="",
viewpoint_id="",
):
project_id: str = "",
topic_id: str = "",
viewpoint_id: str = "",
) -> Tuple[int, str]:
return self.delete(
f"/projects/{project_id}/topics/{topic_id}/viewpoints/{viewpoint_id}",
)
def get_snapshot(self, project_id="", topic_id="", viewpoint_id="") -> str:
def get_snapshot(self, project_id: str = "", topic_id: str = "", viewpoint_id: str = "") -> str:
return self.get(
f"/projects/{project_id}/topics/{topic_id}/viewpoints/{viewpoint_id}/snapshot",
{
@@ -431,7 +423,7 @@ class BcfClient:
},
)
def get_bitmap(self, project_id="", topic_id="", viewpoint_id="", bitmap_id="") -> str:
def get_bitmap(self, project_id: str = "", topic_id: str = "", viewpoint_id: str = "", bitmap_id: str = "") -> str:
return self.get(
f"/projects/{project_id}/topics/{topic_id}/viewpoints/{viewpoint_id}/bitmaps/{bitmap_id}",
{
@@ -442,7 +434,7 @@ class BcfClient:
},
)
def get_selection(self, project_id="", topic_id="", viewpoint_id="") -> dict:
def get_selection(self, project_id: str = "", topic_id: str = "", viewpoint_id: str = "") -> dict[str, Any]:
return self.get(
f"/projects/{project_id}/topics/{topic_id}/viewpoints/{viewpoint_id}/selection",
{
@@ -452,7 +444,7 @@ class BcfClient:
},
)
def get_coloring(self, project_id="", topic_id="", viewpoint_id="") -> dict:
def get_coloring(self, project_id: str = "", topic_id: str = "", viewpoint_id: str = "") -> dict[str, Any]:
return self.get(
f"/projects/{project_id}/topics/{topic_id}/viewpoints/{viewpoint_id}/coloring",
{
@@ -462,7 +454,7 @@ class BcfClient:
},
)
def get_visibility(self, project_id="", topic_id="", viewpoint_id="") -> dict:
def get_visibility(self, project_id: str = "", topic_id: str = "", viewpoint_id: str = "") -> dict[str, Any]:
return self.get(
f"/projects/{project_id}/topics/{topic_id}/viewpoints/{viewpoint_id}/visibility",
{
@@ -472,7 +464,7 @@ class BcfClient:
},
)
def get_related_topics(self, project_id="", topic_id="") -> list:
def get_related_topics(self, project_id: str = "", topic_id: str = "") -> list[Any]:
return self.get(
f"/projects/{project_id}/topics/{topic_id}/related_topics",
{
@@ -483,16 +475,16 @@ class BcfClient:
def update_related_topics(
self,
project_id="",
topic_id="",
data=None,
):
project_id: str = "",
topic_id: str = "",
data: Any = None,
) -> Tuple[int, str]:
return self.put(
f"/projects/{project_id}/topics/{topic_id}/related_topics",
data=data,
)
def get_document_references(self, project_id="", topic_id="") -> list:
def get_document_references(self, project_id: str = "", topic_id: str = "") -> list[Any]:
return self.get(
f"/projects/{project_id}/topics/{topic_id}/document_references",
{
@@ -503,10 +495,10 @@ class BcfClient:
def create_document_reference(
self,
project_id="",
topic_id="",
data=None,
):
project_id: str = "",
topic_id: str = "",
data: Any = None,
) -> Tuple[int, str]:
return self.post(
f"/projects/{project_id}/topics/{topic_id}/document_references",
data=data,
@@ -514,17 +506,17 @@ class BcfClient:
def update_document_references(
self,
project_id="",
topic_id="",
document_reference_id="",
data=None,
):
project_id: str = "",
topic_id: str = "",
document_reference_id: str = "",
data: Any = None,
) -> Tuple[int, str]:
return self.put(
f"/projects/{project_id}/topics/{topic_id}/document_references/{document_reference_id}",
data=data,
)
def get_documents(self, project_id="", topic_id="") -> list:
def get_documents(self, project_id: str = "", topic_id: str = "") -> list[Any]:
return self.get(
f"/projects/{project_id}/topics/{topic_id}/documents",
{
@@ -534,40 +526,36 @@ class BcfClient:
)
def create_document(
self,
project_id="",
topic_id="",
guid=None,
files=None,
data=None,
):
self, project_id: str = "", topic_id: str = "", guid: Optional[str] = None, files: Any = None, data: Any = None
) -> int:
headers = {
"Authorization": "Bearer " + self.foundation_client.get_access_token(),
"Authorization": f"Bearer {self.foundation_client.get_access_token()}",
"Content-type": "application/octet-stream",
}
response = requests.post(
f"/projects/{project_id}/topics/{topic_id}/documents",
data=data,
params={guid},
params={"guid": guid},
files=files,
headers=headers,
)
return response.status_code
def get_document(self, project_id="", topic_id="", document_id="") -> str:
def get_document(self, project_id: str = "", topic_id: str = "", document_id: str = "") -> Tuple[int, str]:
headers = {
"Authorization": "Bearer " + self.foundation_client.get_access_token(),
"Authorization": f"Bearer {self.foundation_client.get_access_token()}",
"Content-type": "application/octet-stream",
}
response = requests.get(
f"{self.baseurl}/projects/{project_id}/topics/documents/{document_id}",
headers=headers,
)
with open(os.path.join(self.filepath, f"{project_id}_{topic_id}_{document_id}_document.txt"), "wb") as f:
f.write(response.content.decode("utf-8"))
return response.status_code, response.content
def get_topics_events(self, project_id="") -> list:
response = requests.get(f"{self.baseurl}/projects/{project_id}/topics/documents/{document_id}", headers=headers)
content = response.content.decode("utf-8")
with open(os.path.join(self.filepath, f"{project_id}_{topic_id}_{document_id}_document.txt"), "w") as f:
f.write(content)
return response.status_code, content
def get_topics_events(self, project_id: str = "") -> list[Any]:
return self.get(
f"/projects/{project_id}/topics/events",
{
@@ -575,7 +563,7 @@ class BcfClient:
},
)
def get_topic_events(self, project_id="", topic_id="") -> list:
def get_topic_events(self, project_id: str = "", topic_id: str = "") -> list[Any]:
return self.get(
f"/projects/{project_id}/topics/{topic_id}/events",
{
@@ -584,7 +572,7 @@ class BcfClient:
},
)
def get_comments_events(self, project_id="") -> list:
def get_comments_events(self, project_id: str = "") -> list[Any]:
return self.get(
f"/projects/{project_id}/topics/comments/events",
{
@@ -592,7 +580,7 @@ class BcfClient:
},
)
def get_comment_events(self, project_id="", topic_id="", comment_id="") -> list:
def get_comment_events(self, project_id: str = "", topic_id: str = "", comment_id: str = "") -> list[Any]:
return self.get(
f"/projects/{project_id}/topics/{topic_id}/comments/{comment_id}/events",
{
File diff suppressed because it is too large Load Diff
-200
View File
@@ -1,200 +0,0 @@
# BCF - BCF Python library
# Copyright (C) 2021 Prabhat Singh <singh01prabhat@gmail.com>
#
# This file is part of BCF.
#
# BCF is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BCF is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with BCF. If not, see <http://www.gnu.org/licenses/>.
class Project:
def __init__(self):
self.project_id = ""
self.name = ""
class BimSnippet:
def __init__(self):
self.snippet_type = None
self.is_external = False
self.reference = None
self.reference_schema = None
class DocumentReference:
def __init__(self):
self.description = None
self.document_guid = None
self.url = None
self.guid = None
class RelatedTopic:
def __init__(self):
self.guid = None
class HeaderFile:
def __init__(self):
self.filename = ""
self.date = None
self.reference = ""
self.ifc_project = None
self.ifc_spatial_structure_element = None
self.is_external = True
class Header:
def __init__(self):
self.files = []
class Topic:
def __init__(self):
self.reference_links = []
self.title = ""
self.priority = None
self.index = None # Deprecated, stored, but ignored
self.labels = []
self.creation_date = None
self.creation_author = None
self.modified_date = None
self.modified_author = None
self.due_date = None
self.assigned_to = None
self.stage = None
self.description = None
self.bim_snippet = None
self.document_references = []
self.related_topics = []
self.topic_status = None
self.topic_type = None
self.guid = None
self.header = None
self.comments = {}
self.viewpoints = {}
self.server_assigned_id = ""
class Comment:
def __init__(self):
self.guid = None
self.date = None
self.author = ""
self.comment = ""
self.viewpoint = None
self.modified_date = None
self.modified_author = ""
class ViewSetupHints:
def __init__(self):
self.spaces_visible = False
self.space_boundaries_visible = False
self.openings_visible = False
class Component:
def __init__(self):
self.originating_system = None
self.authoring_tool_id = None
self.ifc_guid = None
class ComponentVisibility:
def __init__(self):
self.exceptions = []
self.default_visibility = False
self.view_setup_hints = None
class Color:
def __init__(self):
self.color = None
self.components = []
class Components:
def __init__(self):
self.selection = []
self.visibility = None
self.coloring = []
class Point:
def __init__(self):
self.x = 0
self.y = 0
self.z = 0
class Direction(Point):
pass
class OrthogonalCamera:
def __init__(self):
self.camera_view_point = Point()
self.camera_direction = Direction()
self.camera_up_vector = Direction()
self.view_to_world_scale = 1.0
self.aspect_ratio = 1.0
class PerspectiveCamera:
def __init__(self):
self.camera_view_point = Point()
self.camera_direction = Direction()
self.camera_up_vector = Direction()
self.field_of_view = 60.0
self.aspect_ratio = 1.0
class Line:
def __init__(self):
self.start_point = Point()
self.end_point = Point()
class ClippingPlane:
def __init__(self):
self.location = Point()
self.direction = Direction()
class Bitmap:
def __init__(self):
self.reference = "" # Only in BCF-XML
self.bitmap_data = None # Only in BCF-API
self.bitmap_format = "PNG" # Enum of png or jpg
self.location = Point()
self.normal = Direction()
self.up = Direction()
self.height = 1.0
class Viewpoint:
def __init__(self):
self.guid = None
self.viewpoint = None
self.snapshot = None
self.index = None
self.components = None # It's not a list, despite the plural name
self.orthogonal_camera = None
self.perspective_camera = None
self.lines = []
self.clipping_planes = []
self.bitmaps = []
+61
View File
@@ -0,0 +1,61 @@
"""BCF XML V3 Documents handler."""
import zipfile
from typing import Any, Optional
import bcf.v3.model as mdl
from bcf.inmemory_zipfile import ZipFileInterface
from bcf.xml_parser import AbstractXmlParserSerializer, XmlParserSerializer
class DocumentsHandler:
"""BCF documents handler."""
def __init__(
self,
definition: mdl.DocumentInfo,
documents: Optional[dict[str, bytes]] = None,
xml_handler: Optional[AbstractXmlParserSerializer] = None,
) -> None:
self.definition = definition
self.documents = documents or {}
self._xml_handler = xml_handler or XmlParserSerializer()
@classmethod
def load(
cls,
zip_file: zipfile.ZipFile,
xml_handler: Optional[AbstractXmlParserSerializer] = None,
) -> Optional["DocumentsHandler"]:
"""
Loads the documents from the given zip file directory.
Args:
zip_path: The directory path inside the zip file.
xml_handler: The xml parser/serializer to use.
Returns:
The documents handler.
"""
xml_handler = xml_handler or XmlParserSerializer()
file_to_open = zipfile.Path(zip_file, "documents.xml")
if not file_to_open.exists():
return None
definition = xml_handler.parse(file_to_open.read_bytes(), mdl.DocumentInfo)
documents = {}
if def_docs := definition.documents:
for document in def_docs.document:
document_path = zipfile.Path(zip_file, f"documents/{document.guid}")
if document_path.exists():
documents[document.filename] = document_path.read_bytes()
return cls(definition, documents=documents)
def save(self, bcf_zip: ZipFileInterface) -> None:
"""Save the documents to the zip file."""
bcf_zip.writestr("documents.xml", self._xml_handler.serialize(self.definition))
if documents := self.definition.documents:
for doc in documents.document:
if doc.filename in self.documents:
bcf_zip.writestr(
f"documents/{doc.guid}",
self.documents[doc.filename],
)
+110
View File
@@ -0,0 +1,110 @@
from bcf.v3.model.documents import Document, DocumentInfo, DocumentInfoDocuments
from bcf.v3.model.extensions import (
Extensions,
ExtensionsPriorities,
ExtensionsSnippetTypes,
ExtensionsStages,
ExtensionsTopicLabels,
ExtensionsTopicStatuses,
ExtensionsTopicTypes,
ExtensionsUsers,
)
from bcf.v3.model.markup import (
BimSnippet,
Comment,
CommentViewpoint,
DocumentReference,
File,
Header,
HeaderFiles,
Markup,
Topic,
TopicComments,
TopicDocumentReferences,
TopicLabels,
TopicReferenceLinks,
TopicRelatedTopics,
TopicRelatedTopicsRelatedTopic,
TopicViewpoints,
ViewPoint,
)
from bcf.v3.model.project import Project, ProjectInfo
from bcf.v3.model.version import Version
from bcf.v3.model.visinfo import (
Bitmap,
BitmapFormat,
ClippingPlane,
Component,
ComponentColoring,
ComponentColoringColor,
ComponentColoringColorComponents,
Components,
ComponentSelection,
ComponentVisibility,
ComponentVisibilityExceptions,
Direction,
Line,
OrthogonalCamera,
PerspectiveCamera,
Point,
ViewSetupHints,
VisualizationInfo,
VisualizationInfoBitmaps,
VisualizationInfoClippingPlanes,
VisualizationInfoLines,
)
__all__ = [
"Document",
"DocumentInfo",
"DocumentInfoDocuments",
"Extensions",
"ExtensionsPriorities",
"ExtensionsSnippetTypes",
"ExtensionsStages",
"ExtensionsTopicLabels",
"ExtensionsTopicStatuses",
"ExtensionsTopicTypes",
"ExtensionsUsers",
"BimSnippet",
"Comment",
"CommentViewpoint",
"DocumentReference",
"File",
"Header",
"HeaderFiles",
"Markup",
"Topic",
"TopicComments",
"TopicDocumentReferences",
"TopicLabels",
"TopicReferenceLinks",
"TopicRelatedTopics",
"TopicRelatedTopicsRelatedTopic",
"TopicViewpoints",
"ViewPoint",
"Project",
"ProjectInfo",
"Version",
"Bitmap",
"BitmapFormat",
"ClippingPlane",
"Component",
"ComponentColoring",
"ComponentColoringColor",
"ComponentColoringColorComponents",
"ComponentSelection",
"ComponentVisibility",
"ComponentVisibilityExceptions",
"Components",
"Direction",
"Line",
"OrthogonalCamera",
"PerspectiveCamera",
"Point",
"ViewSetupHints",
"VisualizationInfo",
"VisualizationInfoBitmaps",
"VisualizationInfoClippingPlanes",
"VisualizationInfoLines",
]
+61
View File
@@ -0,0 +1,61 @@
from dataclasses import dataclass, field
from typing import List, Optional
@dataclass(slots=True, kw_only=True)
class Document:
filename: str = field(
metadata={
"name": "Filename",
"type": "Element",
"namespace": "",
"required": True,
"min_length": 1,
"white_space": "collapse",
}
)
description: Optional[str] = field(
default=None,
metadata={
"name": "Description",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
)
guid: str = field(
metadata={
"name": "Guid",
"type": "Attribute",
"required": True,
"pattern": r"[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}",
}
)
@dataclass(slots=True, kw_only=True)
class DocumentInfoDocuments:
class Meta:
global_type = False
document: List[Document] = field(
default_factory=list,
metadata={
"name": "Document",
"type": "Element",
"namespace": "",
}
)
@dataclass(slots=True, kw_only=True)
class DocumentInfo:
documents: Optional[DocumentInfoDocuments] = field(
default=None,
metadata={
"name": "Documents",
"type": "Element",
"namespace": "",
}
)
+181
View File
@@ -0,0 +1,181 @@
from dataclasses import dataclass, field
from typing import List, Optional
@dataclass(slots=True, kw_only=True)
class ExtensionsPriorities:
class Meta:
global_type = False
priority: List[str] = field(
default_factory=list,
metadata={
"name": "Priority",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
)
@dataclass(slots=True, kw_only=True)
class ExtensionsSnippetTypes:
class Meta:
global_type = False
snippet_type: List[str] = field(
default_factory=list,
metadata={
"name": "SnippetType",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
)
@dataclass(slots=True, kw_only=True)
class ExtensionsStages:
class Meta:
global_type = False
stage: List[str] = field(
default_factory=list,
metadata={
"name": "Stage",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
)
@dataclass(slots=True, kw_only=True)
class ExtensionsTopicLabels:
class Meta:
global_type = False
topic_label: List[str] = field(
default_factory=list,
metadata={
"name": "TopicLabel",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
)
@dataclass(slots=True, kw_only=True)
class ExtensionsTopicStatuses:
class Meta:
global_type = False
topic_status: List[str] = field(
default_factory=list,
metadata={
"name": "TopicStatus",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
)
@dataclass(slots=True, kw_only=True)
class ExtensionsTopicTypes:
class Meta:
global_type = False
topic_type: List[str] = field(
default_factory=list,
metadata={
"name": "TopicType",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
)
@dataclass(slots=True, kw_only=True)
class ExtensionsUsers:
class Meta:
global_type = False
user: List[str] = field(
default_factory=list,
metadata={
"name": "User",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
)
@dataclass(slots=True, kw_only=True)
class Extensions:
topic_types: Optional[ExtensionsTopicTypes] = field(
default=None,
metadata={
"name": "TopicTypes",
"type": "Element",
"namespace": "",
}
)
topic_statuses: Optional[ExtensionsTopicStatuses] = field(
default=None,
metadata={
"name": "TopicStatuses",
"type": "Element",
"namespace": "",
}
)
priorities: Optional[ExtensionsPriorities] = field(
default=None,
metadata={
"name": "Priorities",
"type": "Element",
"namespace": "",
}
)
topic_labels: Optional[ExtensionsTopicLabels] = field(
default=None,
metadata={
"name": "TopicLabels",
"type": "Element",
"namespace": "",
}
)
users: Optional[ExtensionsUsers] = field(
default=None,
metadata={
"name": "Users",
"type": "Element",
"namespace": "",
}
)
snippet_types: Optional[ExtensionsSnippetTypes] = field(
default=None,
metadata={
"name": "SnippetTypes",
"type": "Element",
"namespace": "",
}
)
stages: Optional[ExtensionsStages] = field(
default=None,
metadata={
"name": "Stages",
"type": "Element",
"namespace": "",
}
)
+616
View File
@@ -0,0 +1,616 @@
from dataclasses import dataclass, field
from typing import List, Optional
from xsdata.models.datatype import XmlDateTime
@dataclass(slots=True, kw_only=True)
class BimSnippet:
reference: str = field(
metadata={
"name": "Reference",
"type": "Element",
"namespace": "",
"required": True,
"min_length": 1,
"white_space": "collapse",
}
)
reference_schema: str = field(
metadata={
"name": "ReferenceSchema",
"type": "Element",
"namespace": "",
"required": True,
"min_length": 1,
"white_space": "collapse",
}
)
snippet_type: str = field(
metadata={
"name": "SnippetType",
"type": "Attribute",
"required": True,
"min_length": 1,
"white_space": "collapse",
}
)
is_external: bool = field(
default=False,
metadata={
"name": "IsExternal",
"type": "Attribute",
}
)
@dataclass(slots=True, kw_only=True)
class CommentViewpoint:
class Meta:
global_type = False
guid: str = field(
metadata={
"name": "Guid",
"type": "Attribute",
"required": True,
"pattern": r"[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}",
}
)
@dataclass(slots=True, kw_only=True)
class DocumentReference:
document_guid: Optional[str] = field(
default=None,
metadata={
"name": "DocumentGuid",
"type": "Element",
"namespace": "",
"pattern": r"[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}",
}
)
url: Optional[str] = field(
default=None,
metadata={
"name": "Url",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
)
description: Optional[str] = field(
default=None,
metadata={
"name": "Description",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
)
guid: str = field(
metadata={
"name": "Guid",
"type": "Attribute",
"required": True,
"pattern": r"[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}",
}
)
@dataclass(slots=True, kw_only=True)
class File:
filename: Optional[str] = field(
default=None,
metadata={
"name": "Filename",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
)
date: Optional[XmlDateTime] = field(
default=None,
metadata={
"name": "Date",
"type": "Element",
"namespace": "",
}
)
reference: Optional[str] = field(
default=None,
metadata={
"name": "Reference",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
)
ifc_project: Optional[str] = field(
default=None,
metadata={
"name": "IfcProject",
"type": "Attribute",
"length": 22,
"pattern": r"[0-9A-Za-z_$]*",
}
)
ifc_spatial_structure_element: Optional[str] = field(
default=None,
metadata={
"name": "IfcSpatialStructureElement",
"type": "Attribute",
"length": 22,
"pattern": r"[0-9A-Za-z_$]*",
}
)
is_external: bool = field(
default=True,
metadata={
"name": "IsExternal",
"type": "Attribute",
}
)
@dataclass(slots=True, kw_only=True)
class TopicLabels:
class Meta:
global_type = False
label: List[str] = field(
default_factory=list,
metadata={
"name": "Label",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
)
@dataclass(slots=True, kw_only=True)
class TopicReferenceLinks:
class Meta:
global_type = False
reference_link: List[str] = field(
default_factory=list,
metadata={
"name": "ReferenceLink",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
)
@dataclass(slots=True, kw_only=True)
class TopicRelatedTopicsRelatedTopic:
class Meta:
global_type = False
guid: str = field(
metadata={
"name": "Guid",
"type": "Attribute",
"required": True,
"pattern": r"[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}",
}
)
@dataclass(slots=True, kw_only=True)
class ViewPoint:
viewpoint: Optional[str] = field(
default=None,
metadata={
"name": "Viewpoint",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
)
snapshot: Optional[str] = field(
default=None,
metadata={
"name": "Snapshot",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
)
index: Optional[int] = field(
default=None,
metadata={
"name": "Index",
"type": "Element",
"namespace": "",
}
)
guid: str = field(
metadata={
"name": "Guid",
"type": "Attribute",
"required": True,
"pattern": r"[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}",
}
)
@dataclass(slots=True, kw_only=True)
class Comment:
date: XmlDateTime = field(
metadata={
"name": "Date",
"type": "Element",
"namespace": "",
"required": True,
}
)
author: str = field(
metadata={
"name": "Author",
"type": "Element",
"namespace": "",
"required": True,
"min_length": 1,
"white_space": "collapse",
}
)
comment: Optional[str] = field(
default=None,
metadata={
"name": "Comment",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
)
viewpoint: Optional[CommentViewpoint] = field(
default=None,
metadata={
"name": "Viewpoint",
"type": "Element",
"namespace": "",
}
)
modified_date: Optional[XmlDateTime] = field(
default=None,
metadata={
"name": "ModifiedDate",
"type": "Element",
"namespace": "",
}
)
modified_author: Optional[str] = field(
default=None,
metadata={
"name": "ModifiedAuthor",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
)
guid: str = field(
metadata={
"name": "Guid",
"type": "Attribute",
"required": True,
"pattern": r"[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}",
}
)
@dataclass(slots=True, kw_only=True)
class HeaderFiles:
class Meta:
global_type = False
file: List[File] = field(
default_factory=list,
metadata={
"name": "File",
"type": "Element",
"namespace": "",
}
)
@dataclass(slots=True, kw_only=True)
class TopicDocumentReferences:
class Meta:
global_type = False
document_reference: List[DocumentReference] = field(
default_factory=list,
metadata={
"name": "DocumentReference",
"type": "Element",
"namespace": "",
}
)
@dataclass(slots=True, kw_only=True)
class TopicRelatedTopics:
class Meta:
global_type = False
related_topic: List[TopicRelatedTopicsRelatedTopic] = field(
default_factory=list,
metadata={
"name": "RelatedTopic",
"type": "Element",
"namespace": "",
}
)
@dataclass(slots=True, kw_only=True)
class TopicViewpoints:
class Meta:
global_type = False
view_point: List[ViewPoint] = field(
default_factory=list,
metadata={
"name": "ViewPoint",
"type": "Element",
"namespace": "",
}
)
@dataclass(slots=True, kw_only=True)
class Header:
files: Optional[HeaderFiles] = field(
default=None,
metadata={
"name": "Files",
"type": "Element",
"namespace": "",
}
)
@dataclass(slots=True, kw_only=True)
class TopicComments:
class Meta:
global_type = False
comment: List[Comment] = field(
default_factory=list,
metadata={
"name": "Comment",
"type": "Element",
"namespace": "",
}
)
@dataclass(slots=True, kw_only=True)
class Topic:
reference_links: Optional[TopicReferenceLinks] = field(
default=None,
metadata={
"name": "ReferenceLinks",
"type": "Element",
"namespace": "",
}
)
title: str = field(
metadata={
"name": "Title",
"type": "Element",
"namespace": "",
"required": True,
"min_length": 1,
"white_space": "collapse",
}
)
priority: Optional[str] = field(
default=None,
metadata={
"name": "Priority",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
)
index: Optional[int] = field(
default=None,
metadata={
"name": "Index",
"type": "Element",
"namespace": "",
}
)
labels: Optional[TopicLabels] = field(
default=None,
metadata={
"name": "Labels",
"type": "Element",
"namespace": "",
}
)
creation_date: XmlDateTime = field(
metadata={
"name": "CreationDate",
"type": "Element",
"namespace": "",
"required": True,
}
)
creation_author: str = field(
metadata={
"name": "CreationAuthor",
"type": "Element",
"namespace": "",
"required": True,
"min_length": 1,
"white_space": "collapse",
}
)
modified_date: Optional[XmlDateTime] = field(
default=None,
metadata={
"name": "ModifiedDate",
"type": "Element",
"namespace": "",
}
)
modified_author: Optional[str] = field(
default=None,
metadata={
"name": "ModifiedAuthor",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
)
due_date: Optional[XmlDateTime] = field(
default=None,
metadata={
"name": "DueDate",
"type": "Element",
"namespace": "",
}
)
assigned_to: Optional[str] = field(
default=None,
metadata={
"name": "AssignedTo",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
)
stage: Optional[str] = field(
default=None,
metadata={
"name": "Stage",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
)
description: Optional[str] = field(
default=None,
metadata={
"name": "Description",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
)
bim_snippet: Optional[BimSnippet] = field(
default=None,
metadata={
"name": "BimSnippet",
"type": "Element",
"namespace": "",
}
)
document_references: Optional[TopicDocumentReferences] = field(
default=None,
metadata={
"name": "DocumentReferences",
"type": "Element",
"namespace": "",
}
)
related_topics: Optional[TopicRelatedTopics] = field(
default=None,
metadata={
"name": "RelatedTopics",
"type": "Element",
"namespace": "",
}
)
comments: Optional[TopicComments] = field(
default=None,
metadata={
"name": "Comments",
"type": "Element",
"namespace": "",
}
)
viewpoints: Optional[TopicViewpoints] = field(
default=None,
metadata={
"name": "Viewpoints",
"type": "Element",
"namespace": "",
}
)
guid: str = field(
metadata={
"name": "Guid",
"type": "Attribute",
"required": True,
"pattern": r"[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}",
}
)
server_assigned_id: Optional[str] = field(
default=None,
metadata={
"name": "ServerAssignedId",
"type": "Attribute",
"min_length": 1,
"white_space": "collapse",
}
)
topic_type: str = field(
metadata={
"name": "TopicType",
"type": "Attribute",
"required": True,
"min_length": 1,
"white_space": "collapse",
}
)
topic_status: str = field(
metadata={
"name": "TopicStatus",
"type": "Attribute",
"required": True,
"min_length": 1,
"white_space": "collapse",
}
)
@dataclass(slots=True, kw_only=True)
class Markup:
header: Optional[Header] = field(
default=None,
metadata={
"name": "Header",
"type": "Element",
"namespace": "",
}
)
topic: Topic = field(
metadata={
"name": "Topic",
"type": "Element",
"namespace": "",
"required": True,
}
)
+37
View File
@@ -0,0 +1,37 @@
from dataclasses import dataclass, field
from typing import Optional
@dataclass(slots=True, kw_only=True)
class Project:
name: Optional[str] = field(
default=None,
metadata={
"name": "Name",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
)
project_id: str = field(
metadata={
"name": "ProjectId",
"type": "Attribute",
"required": True,
"min_length": 1,
"white_space": "collapse",
}
)
@dataclass(slots=True, kw_only=True)
class ProjectInfo:
project: Project = field(
metadata={
"name": "Project",
"type": "Element",
"namespace": "",
"required": True,
}
)
+12
View File
@@ -0,0 +1,12 @@
from dataclasses import dataclass, field
@dataclass(slots=True, kw_only=True)
class Version:
version_id: str = field(
metadata={
"name": "VersionId",
"type": "Attribute",
"required": True,
}
)
+524
View File
@@ -0,0 +1,524 @@
from dataclasses import dataclass, field
from enum import Enum
from typing import List, Optional
class BitmapFormat(Enum):
PNG = "png"
JPG = "jpg"
@dataclass(slots=True, kw_only=True)
class Component:
originating_system: Optional[str] = field(
default=None,
metadata={
"name": "OriginatingSystem",
"type": "Element",
"min_length": 1,
"white_space": "collapse",
}
)
authoring_tool_id: Optional[str] = field(
default=None,
metadata={
"name": "AuthoringToolId",
"type": "Element",
"min_length": 1,
"white_space": "collapse",
}
)
ifc_guid: Optional[str] = field(
default=None,
metadata={
"name": "IfcGuid",
"type": "Attribute",
"length": 22,
"pattern": r"[0-9A-Za-z_$]*",
}
)
@dataclass(slots=True, kw_only=True)
class Direction:
x: float = field(
metadata={
"name": "X",
"type": "Element",
"required": True,
}
)
y: float = field(
metadata={
"name": "Y",
"type": "Element",
"required": True,
}
)
z: float = field(
metadata={
"name": "Z",
"type": "Element",
"required": True,
}
)
@dataclass(slots=True, kw_only=True)
class Point:
x: float = field(
metadata={
"name": "X",
"type": "Element",
"required": True,
}
)
y: float = field(
metadata={
"name": "Y",
"type": "Element",
"required": True,
}
)
z: float = field(
metadata={
"name": "Z",
"type": "Element",
"required": True,
}
)
@dataclass(slots=True, kw_only=True)
class ViewSetupHints:
spaces_visible: bool = field(
default=False,
metadata={
"name": "SpacesVisible",
"type": "Attribute",
}
)
space_boundaries_visible: bool = field(
default=False,
metadata={
"name": "SpaceBoundariesVisible",
"type": "Attribute",
}
)
openings_visible: bool = field(
default=False,
metadata={
"name": "OpeningsVisible",
"type": "Attribute",
}
)
@dataclass(slots=True, kw_only=True)
class Bitmap:
format: BitmapFormat = field(
metadata={
"name": "Format",
"type": "Element",
"required": True,
}
)
reference: str = field(
metadata={
"name": "Reference",
"type": "Element",
"required": True,
"min_length": 1,
"white_space": "collapse",
}
)
location: Point = field(
metadata={
"name": "Location",
"type": "Element",
"required": True,
}
)
normal: Direction = field(
metadata={
"name": "Normal",
"type": "Element",
"required": True,
}
)
up: Direction = field(
metadata={
"name": "Up",
"type": "Element",
"required": True,
}
)
height: float = field(
metadata={
"name": "Height",
"type": "Element",
"required": True,
}
)
@dataclass(slots=True, kw_only=True)
class ClippingPlane:
location: Point = field(
metadata={
"name": "Location",
"type": "Element",
"required": True,
}
)
direction: Direction = field(
metadata={
"name": "Direction",
"type": "Element",
"required": True,
}
)
@dataclass(slots=True, kw_only=True)
class ComponentColoringColorComponents:
class Meta:
global_type = False
component: List[Component] = field(
default_factory=list,
metadata={
"name": "Component",
"type": "Element",
"min_occurs": 1,
}
)
@dataclass(slots=True, kw_only=True)
class ComponentSelection:
component: List[Component] = field(
default_factory=list,
metadata={
"name": "Component",
"type": "Element",
}
)
@dataclass(slots=True, kw_only=True)
class ComponentVisibilityExceptions:
class Meta:
global_type = False
component: List[Component] = field(
default_factory=list,
metadata={
"name": "Component",
"type": "Element",
}
)
@dataclass(slots=True, kw_only=True)
class Line:
start_point: Point = field(
metadata={
"name": "StartPoint",
"type": "Element",
"required": True,
}
)
end_point: Point = field(
metadata={
"name": "EndPoint",
"type": "Element",
"required": True,
}
)
@dataclass(slots=True, kw_only=True)
class OrthogonalCamera:
"""
Attributes
camera_view_point:
camera_direction:
camera_up_vector:
view_to_world_scale: view's visible vertical size in meters
aspect_ratio: Proportional relationship between the width and
the height of the view (w/h).
"""
camera_view_point: Point = field(
metadata={
"name": "CameraViewPoint",
"type": "Element",
"required": True,
}
)
camera_direction: Direction = field(
metadata={
"name": "CameraDirection",
"type": "Element",
"required": True,
}
)
camera_up_vector: Direction = field(
metadata={
"name": "CameraUpVector",
"type": "Element",
"required": True,
}
)
view_to_world_scale: float = field(
metadata={
"name": "ViewToWorldScale",
"type": "Element",
"required": True,
}
)
aspect_ratio: float = field(
metadata={
"name": "AspectRatio",
"type": "Element",
"required": True,
"min_exclusive": 0.0,
}
)
@dataclass(slots=True, kw_only=True)
class PerspectiveCamera:
"""
Attributes
camera_view_point:
camera_direction:
camera_up_vector:
field_of_view: Vertical field of view, in degrees. It is
currently limited to a value between 45 and 60 degrees. This
limitation will be dropped in the next release and viewers
should be expect values outside this range in current
implementations.
aspect_ratio: Proportional relationship between the width and
the height of the view (w/h).
"""
camera_view_point: Point = field(
metadata={
"name": "CameraViewPoint",
"type": "Element",
"required": True,
}
)
camera_direction: Direction = field(
metadata={
"name": "CameraDirection",
"type": "Element",
"required": True,
}
)
camera_up_vector: Direction = field(
metadata={
"name": "CameraUpVector",
"type": "Element",
"required": True,
}
)
field_of_view: float = field(
metadata={
"name": "FieldOfView",
"type": "Element",
"required": True,
"min_exclusive": 0.0,
"max_exclusive": 180.0,
}
)
aspect_ratio: float = field(
metadata={
"name": "AspectRatio",
"type": "Element",
"required": True,
"min_exclusive": 0.0,
}
)
@dataclass(slots=True, kw_only=True)
class ComponentColoringColor:
class Meta:
global_type = False
components: ComponentColoringColorComponents = field(
metadata={
"name": "Components",
"type": "Element",
"required": True,
}
)
color: str = field(
metadata={
"name": "Color",
"type": "Attribute",
"required": True,
"pattern": r"[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?",
}
)
@dataclass(slots=True, kw_only=True)
class ComponentVisibility:
view_setup_hints: Optional[ViewSetupHints] = field(
default=None,
metadata={
"name": "ViewSetupHints",
"type": "Element",
}
)
exceptions: Optional[ComponentVisibilityExceptions] = field(
default=None,
metadata={
"name": "Exceptions",
"type": "Element",
}
)
default_visibility: bool = field(
default=False,
metadata={
"name": "DefaultVisibility",
"type": "Attribute",
}
)
@dataclass(slots=True, kw_only=True)
class VisualizationInfoBitmaps:
class Meta:
global_type = False
bitmap: List[Bitmap] = field(
default_factory=list,
metadata={
"name": "Bitmap",
"type": "Element",
}
)
@dataclass(slots=True, kw_only=True)
class VisualizationInfoClippingPlanes:
class Meta:
global_type = False
clipping_plane: List[ClippingPlane] = field(
default_factory=list,
metadata={
"name": "ClippingPlane",
"type": "Element",
}
)
@dataclass(slots=True, kw_only=True)
class VisualizationInfoLines:
class Meta:
global_type = False
line: List[Line] = field(
default_factory=list,
metadata={
"name": "Line",
"type": "Element",
}
)
@dataclass(slots=True, kw_only=True)
class ComponentColoring:
color: List[ComponentColoringColor] = field(
default_factory=list,
metadata={
"name": "Color",
"type": "Element",
}
)
@dataclass(slots=True, kw_only=True)
class Components:
selection: Optional[ComponentSelection] = field(
default=None,
metadata={
"name": "Selection",
"type": "Element",
}
)
visibility: Optional[ComponentVisibility] = field(
default=None,
metadata={
"name": "Visibility",
"type": "Element",
}
)
coloring: Optional[ComponentColoring] = field(
default=None,
metadata={
"name": "Coloring",
"type": "Element",
}
)
@dataclass(slots=True, kw_only=True)
class VisualizationInfo:
"""
VisualizationInfo documentation.
"""
components: Optional[Components] = field(
default=None,
metadata={
"name": "Components",
"type": "Element",
}
)
orthogonal_camera: Optional[OrthogonalCamera] = field(
default=None,
metadata={
"name": "OrthogonalCamera",
"type": "Element",
}
)
perspective_camera: Optional[PerspectiveCamera] = field(
default=None,
metadata={
"name": "PerspectiveCamera",
"type": "Element",
}
)
lines: Optional[VisualizationInfoLines] = field(
default=None,
metadata={
"name": "Lines",
"type": "Element",
}
)
clipping_planes: Optional[VisualizationInfoClippingPlanes] = field(
default=None,
metadata={
"name": "ClippingPlanes",
"type": "Element",
}
)
bitmaps: Optional[VisualizationInfoBitmaps] = field(
default=None,
metadata={
"name": "Bitmaps",
"type": "Element",
}
)
guid: str = field(
metadata={
"name": "Guid",
"type": "Attribute",
"required": True,
"pattern": r"[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}",
}
)
+206
View File
@@ -0,0 +1,206 @@
"""BCF XML V3 Topic handler."""
import datetime
import uuid
import zipfile
from pathlib import Path
from typing import Any, NoReturn, Optional
import numpy as np
from ifcopenshell import entity_instance
from numpy.typing import NDArray
from xsdata.models.datatype import XmlDateTime
import bcf.v3.model as mdl
from bcf.inmemory_zipfile import ZipFileInterface
from bcf.v3.visinfo import VisualizationInfoHandler
from bcf.xml_parser import AbstractXmlParserSerializer, XmlParserSerializer
class TopicHandler:
"""BCF Topic and related objects handler."""
def __init__(
self,
topic_dir: Optional[zipfile.Path] = None,
xml_handler: Optional[AbstractXmlParserSerializer] = None,
) -> None:
self._markup: Optional[mdl.Markup] = None
self._viewpoints: dict[str, VisualizationInfoHandler] = {}
self._bim_snippet: Optional[bytes] = None
self._xml_handler = xml_handler or XmlParserSerializer()
self._topic_dir = topic_dir
@property
def markup(self) -> Optional[mdl.Markup]:
if not self._markup and self._topic_dir:
markup_path = self._topic_dir.joinpath("markup.bcf")
if markup_path.exists():
self._markup = self._xml_handler.parse(markup_path.read_bytes(), mdl.Markup)
return self._markup
@markup.setter
def markup(self, value: mdl.Markup) -> None:
self._markup = value
@property
def topic(self) -> mdl.Topic:
"""Return the Topic object."""
return self.markup.topic
@property
def guid(self) -> Optional[str]:
"""Return the GUID of the topic."""
if self._markup:
return self.topic.guid
return self._topic_dir.name if self._topic_dir else None
@property
def header(self) -> Optional[mdl.Header]:
"""Return the header of the topic."""
return self.markup.header
@property
def comments(self) -> list[mdl.Comment]:
"""Return the comments of the topic."""
return self.topic.comments.comment if self.topic.comments else []
@property
def bim_snippet(self) -> Optional[bytes]:
if not self._bim_snippet and self._topic_dir:
self._bim_snippet = self._load_bim_snippet()
return self._bim_snippet
@bim_snippet.setter
def bim_snippet(self, value: bytes) -> None:
self._bim_snippet = value
@property
def viewpoints(self) -> dict[str, "VisualizationInfoHandler"]:
if (
not self._viewpoints
and self._topic_dir
and self.topic.viewpoints
and (viewpoints := self.topic.viewpoints.view_point)
):
self._viewpoints = VisualizationInfoHandler.from_topic_viewpoints(self._topic_dir, viewpoints)
return self._viewpoints
def _load_bim_snippet(self) -> Optional[bytes]:
bim_snippet_obj = self.topic.bim_snippet
if bim_snippet_obj and not bim_snippet_obj.is_external and self._topic_dir:
bim_snippet_path = self._topic_dir.joinpath(bim_snippet_obj.reference)
if bim_snippet_path.exists():
return bim_snippet_path.read_bytes()
return None
@classmethod
def create_new(
cls,
title: str,
description: str,
author: str,
topic_type: str = "",
topic_status: str = "",
xml_handler: Optional[AbstractXmlParserSerializer] = None,
) -> "TopicHandler":
"""
Create a new BCF topic.
Args:
title: The title of the topic.
description: The description of the topic.
author: The author of the topic.
topic_type: The type of the topic.
topic_status: The status of the topic.
xml_handler: The XML parser/serializer to use.
Returns:
The BCF topic definition.
"""
creation_date = XmlDateTime.from_datetime(datetime.datetime.now())
guid = str(uuid.uuid4())
topic = mdl.Topic(
title=title,
description=description,
creation_author=author,
creation_date=creation_date,
guid=guid,
topic_type=topic_type,
topic_status=topic_status,
)
markup = mdl.Markup(topic=topic)
obj = cls(topic_dir=Path(guid), xml_handler=xml_handler or XmlParserSerializer())
obj.markup = markup
return obj
def save(self, destination_zip: ZipFileInterface) -> None:
"""
Save the topic to a BCF zip file.
Args:
bcf_zip: The BCF zip file to save to.
"""
topic_dir = self.guid
self._save_xml(destination_zip, self._markup, "markup.bcf")
self._save_viewpoints(destination_zip, topic_dir)
self._save_bim_snippet(destination_zip)
def _save_viewpoints(self, destination_zip: ZipFileInterface, topic_dir: str) -> None:
if not self.topic.viewpoints or not (viewpoints := self.topic.viewpoints.view_point):
return
for vpt in viewpoints:
if vpt.viewpoint:
self.viewpoints[vpt.viewpoint].save(destination_zip, topic_dir, vpt)
def _save_xml(self, destination_zip: ZipFileInterface, item: Any, target: str) -> None:
to_write = self._xml_handler.serialize(item) if item else self._topic_dir.joinpath(target).read_bytes()
destination_zip.writestr(f"{self._topic_dir.name}/{target}", to_write)
def _save_bim_snippet(self, destination_zip: ZipFileInterface) -> None:
snippet = self.topic.bim_snippet
if not snippet or snippet.is_external:
return
ref_filename = Path(snippet.reference).name
if self.bim_snippet:
destination_zip.writestr(f"{self.topic.guid}/{ref_filename}", self.bim_snippet)
def add_viewpoint(self, element: entity_instance) -> None:
"""
Add a viewpoint tergeting an IFC element to the topic.
Args:
element: The IFC element.
"""
new_viewpoint = VisualizationInfoHandler.create_new(element, self._xml_handler)
self.add_visinfo_handler(new_viewpoint)
def add_viewpoint_from_point_and_guids(self, position: NDArray[np.float_], *guids: str) -> None:
"""
Add a viewpoint tergeting an IFC element to the topic.
Args:
element: The IFC element.
"""
vi_handler = VisualizationInfoHandler.create_from_point_and_guids(
position, *guids, xml_handler=self._xml_handler
)
self.add_visinfo_handler(vi_handler)
def add_visinfo_handler(self, new_viewpoint: VisualizationInfoHandler) -> None:
self.viewpoints[new_viewpoint.guid + ".bcfv"] = new_viewpoint
if self.topic.viewpoints is None:
self.topic.viewpoints = mdl.TopicViewpoints()
self.topic.viewpoints.view_point.append(
mdl.ViewPoint(viewpoint=new_viewpoint.guid + ".bcfv", guid=new_viewpoint.guid)
)
def __eq__(self, other: object) -> bool | NoReturn:
return (
(
self.markup == other.markup
and self.viewpoints == other.viewpoints
and self.bim_snippet == other.bim_snippet
)
if isinstance(other, TopicHandler)
else NotImplemented
)
+294
View File
@@ -0,0 +1,294 @@
import uuid
import zipfile
from functools import lru_cache
from typing import Any, Iterable, Optional
import numpy as np
from ifcopenshell import entity_instance
from ifcopenshell.util import placement
from numpy.typing import NDArray
import bcf.v3.model as mdl
from bcf.geometry import (
camera_vectors_from_element_placement,
camera_vectors_from_target_position,
)
from bcf.inmemory_zipfile import ZipFileInterface
from bcf.xml_parser import AbstractXmlParserSerializer, XmlParserSerializer
class VisualizationInfoHandler:
"""Handle the VisualizationInfo and related objects."""
def __init__(
self,
visualization_info: mdl.VisualizationInfo,
snapshot: Optional[bytes] = None,
bitmaps: Optional[dict[str, bytes]] = None,
xml_handler: Optional[AbstractXmlParserSerializer] = None,
) -> None:
self.visualization_info = visualization_info
self.snapshot = snapshot
self.bitmaps = bitmaps or {}
self._xml_handler = xml_handler or XmlParserSerializer()
@property
def guid(self) -> str:
"""Return the GUID of the visualization info."""
return self.visualization_info.guid
@classmethod
def from_topic_viewpoints(
cls,
topic_dir: zipfile.Path,
vps: Iterable[mdl.ViewPoint],
xml_handler: Optional[AbstractXmlParserSerializer] = None,
) -> dict[str, "VisualizationInfoHandler"]:
"""Create VisualizationInfoHandler objects of a Topic's ViewPoints."""
viewpoints = {}
for vpt in vps:
visinfo = cls.load(topic_dir, vpt, xml_handler)
if visinfo and vpt.viewpoint:
viewpoints[vpt.viewpoint] = visinfo
return viewpoints
@classmethod
def load(
cls,
topic_dir: zipfile.Path,
vpt: mdl.ViewPoint,
xml_handler: Optional[AbstractXmlParserSerializer] = None,
) -> Optional["VisualizationInfoHandler"]:
"""
Load the VisualizationInfo and related objects from a BCF zip file.
Args:
topic_dir: The directory in the BCF zip file to load from.
vpt: The ViewPoint to load.
xml_handler: The XML handler to use to parse the VisualizationInfo.
Returns:
The VisualizationInfoHandler object.
"""
visinfo = cls._load_visinfo(topic_dir, vpt.viewpoint, xml_handler)
if not visinfo:
return None
snapshot = cls._load_snapshot(topic_dir, vpt.snapshot)
bitmaps = cls._load_bitmaps(topic_dir, visinfo)
return cls(visinfo, snapshot, bitmaps, xml_handler)
@staticmethod
def _load_visinfo(
topic_dir: zipfile.Path,
vp_name: Optional[str],
xml_handler: Optional[AbstractXmlParserSerializer] = None,
) -> Optional[mdl.VisualizationInfo]:
if not vp_name:
return None
vp_path = topic_dir.joinpath(vp_name)
if vp_path.exists():
xml_handler = xml_handler or XmlParserSerializer()
return xml_handler.parse(vp_path.read_bytes(), mdl.VisualizationInfo)
return None
@staticmethod
def _load_snapshot(topic_dir: zipfile.Path, vp_snapshot: Optional[str]) -> Optional[bytes]:
if vp_snapshot:
snapshot_path = topic_dir.joinpath(vp_snapshot)
if snapshot_path.exists():
return snapshot_path.read_bytes()
return None
@staticmethod
def _load_bitmaps(topic_dir: zipfile.Path, visinfo: Optional[mdl.VisualizationInfo]) -> dict[str, bytes]:
if not visinfo or not (bitmaps := visinfo.bitmaps):
return {}
bitmaps_dict = {}
for bitmap in bitmaps.bitmap:
if not bitmap.reference:
continue
bitmap_path = topic_dir.joinpath(bitmap.reference)
if bitmap_path.exists():
bitmaps_dict[bitmap.reference] = bitmap_path.read_bytes()
return bitmaps_dict
def save(
self,
bcf_zip: ZipFileInterface,
topic_dir: str,
vpt: mdl.ViewPoint,
) -> None:
"""
Save the VisualizationInfo and related objects to a BCF zip file.
Args:
bcf_zip: The BCF zip file to save to.
topic_dir: The directory in the BCF zip file to save to.
vpt: The ViewPoint to save.
"""
if not (vp_name := vpt.viewpoint):
return
self._save_visinfo(bcf_zip, topic_dir, vp_name)
self._save_snapshot(bcf_zip, topic_dir, vpt.snapshot)
self._save_bitmaps(bcf_zip, topic_dir)
def _save_snapshot(self, bcf_zip: ZipFileInterface, topic_dir: str, filename: Optional[str]) -> None:
if self.snapshot and filename:
bcf_zip.writestr(f"{topic_dir}/{filename}", self.snapshot)
def _save_visinfo(self, bcf_zip: ZipFileInterface, topic_dir: str, vp_name: str) -> None:
bcf_zip.writestr(
f"{topic_dir}/{vp_name}",
self._xml_handler.serialize(self.visualization_info),
)
def _save_bitmaps(self, bcf_zip: ZipFileInterface, topic_dir: str) -> None:
if not self.bitmaps:
return
if not (bitmaps_defs := self.visualization_info.bitmaps):
return
for bitmap_def in bitmaps_defs.bitmap:
if not (bitmap_name := bitmap_def.reference):
continue
if bitmap_name in self.bitmaps:
bcf_zip.writestr(f"{topic_dir}/{bitmap_name}", self.bitmaps[bitmap_name])
@classmethod
def create_new(
cls,
element: entity_instance,
xml_handler: Optional[AbstractXmlParserSerializer] = None,
) -> "VisualizationInfoHandler":
"""
Create a new VisualizationInfoHandler object from an IFC element.
Args:
element: The IFC element to point at.
xml_handler: The XML handler to use.
Returns:
The VisualizationInfoHandler object.
"""
xml_handler = xml_handler or XmlParserSerializer()
return cls(visualization_info=build_viewpoint(element), xml_handler=xml_handler)
@classmethod
def create_from_point_and_guids(
cls,
position: NDArray[np.float_],
*guids: str,
xml_handler: Optional[AbstractXmlParserSerializer] = None,
) -> "VisualizationInfoHandler":
"""
Create a new VisualizationInfoHandler object from an IFC element.
Args:
position: target point coordinates.
*guids: One or more IFC element GUID.
xml_handler: The XML handler to use.
Returns:
The VisualizationInfoHandler object.
"""
xml_handler = xml_handler or XmlParserSerializer()
return cls(
visualization_info=build_viewpoint_from_position_and_guids(position, *guids), xml_handler=xml_handler
)
@lru_cache(maxsize=None)
def build_viewpoint(element: entity_instance) -> mdl.VisualizationInfo:
"""
Return a BCF viewpoint of an IFC element.
This function is cached to speedudp the creation of multiple BCF topics regarding the same element.
Args:
element: The IFC element to point at.
Returns:
The BCF viewpoint definition.
"""
elem_placement = placement.get_local_placement(element.ObjectPlacement)
return mdl.VisualizationInfo(
guid=str(uuid.uuid4()),
components=build_components(element.GlobalId),
perspective_camera=build_camera(elem_placement),
)
def build_viewpoint_from_position_and_guids(position: NDArray[np.float_], *guids: str) -> mdl.VisualizationInfo:
"""
Return a BCF viewpoint of an IFC element.
This function is cached to speedudp the creation of multiple BCF topics regarding the same element.
Args:
position: target point coordinates.
*guids: One or more IFC element GUID.
Returns:
The BCF viewpoint definition.
"""
return mdl.VisualizationInfo(
guid=str(uuid.uuid4()),
components=build_components(*guids),
perspective_camera=build_camera_from_vectors(*camera_vectors_from_target_position(position)),
)
def build_components(*guids: str) -> mdl.Components:
"""
Return the BCF components from an IFC element GUID.
Args:
*guids: One or more IFC element GUID.
Returns:
The BCF components definition.
"""
components = [mdl.Component(ifc_guid=guid) for guid in guids]
return mdl.Components(
selection=mdl.ComponentSelection(component=components),
visibility=mdl.ComponentVisibility(default_visibility=True),
)
def build_camera(elem_placement: NDArray[np.float_]) -> mdl.PerspectiveCamera:
"""
Return a BCF camera for an IFC element placement matrix.
Args:
elem_placement: The IFC element placement as a rototranslation matrix.
Returns:
The BCF camera definition.
"""
return build_camera_from_vectors(*camera_vectors_from_element_placement(elem_placement))
def build_camera_from_vectors(
camera_position: NDArray[np.float_], camera_dir: NDArray[np.float_], camera_up: NDArray[np.float_]
) -> mdl.PerspectiveCamera:
"""
Return a BCF camera for an IFC element placement matrix.
Args:
camera_position: camera position array
camera_dir: camera direction versor
camera_up_vector: camera up versor
Returns:
The BCF camera definition.
"""
camera_viewpoint = mdl.Point(x=camera_position[0], y=camera_position[1], z=camera_position[2])
camera_direction = mdl.Direction(x=camera_dir[0], y=camera_dir[1], z=camera_dir[2])
camera_up_vector = mdl.Direction(x=camera_up[0], y=camera_up[1], z=camera_up[2])
return mdl.PerspectiveCamera(
camera_view_point=camera_viewpoint,
camera_direction=camera_direction,
camera_up_vector=camera_up_vector,
aspect_ratio=1.0,
field_of_view=60.0,
)
+83
View File
@@ -0,0 +1,83 @@
"""XML Parser and Serializer factories."""
from typing import Optional, Protocol, Type, TypeVar
from xsdata.formats.dataclass.context import XmlContext
from xsdata.formats.dataclass.parsers import XmlParser
from xsdata.formats.dataclass.serializers import XmlSerializer
from xsdata.formats.dataclass.serializers.config import SerializerConfig
def build_xml_parser(context: Optional[XmlContext] = None) -> XmlParser:
"""Return a parser for an XML file."""
parser = XmlParser(context=context or XmlContext())
parser.register_namespace("xs", "http://www.w3.org/2001/XMLSchema")
return parser
def build_serializer(context: Optional[XmlContext] = None) -> XmlSerializer:
"""Return a serializer for an XML file."""
return XmlSerializer(
config=SerializerConfig(pretty_print=True),
context=context or XmlContext(),
)
T = TypeVar("T")
class AbstractXmlParserSerializer(Protocol):
"""XML Parser and serializer wrapper."""
def parse(self, xml: bytes, clazz: Type[T]) -> T:
"""
Parse an XML file to an object.
Args:
xml: The XML file as bytes.
clazz: The class to parse to.
"""
def serialize(self, obj: T, ns_map: Optional[dict[str, str]] = None) -> str:
"""
Serialize an object to XML.
Args:
obj: The object to serialize.
ns_map: The namespace map to use.
Returns:
The XML as string.
"""
class XmlParserSerializer:
"""XML Parser and serializer wrapper."""
def __init__(self) -> None:
self.context = XmlContext()
self.parser = build_xml_parser(self.context)
self.serializer = build_serializer(self.context)
def parse(self, xml: bytes, clazz: Type[T]) -> T:
"""
Parse an XML file to an object.
Args:
xml: The XML file as bytes.
clazz: The class to parse to.
"""
return self.parser.from_bytes(xml, clazz)
def serialize(self, obj: T, ns_map: Optional[dict[str, str]] = None) -> str:
"""
Serialize an object to XML.
Args:
obj: The object to serialize.
ns_map: The namespace map to use.
Returns:
The XML as string.
"""
ns_map = ns_map or {"xs": "http://www.w3.org/2001/XMLSchema"}
return self.serializer.render(obj, ns_map)
+1
View File
@@ -0,0 +1 @@
"""BCF tests."""
+8
View File
@@ -0,0 +1,8 @@
import pytest
from bcf.xml_parser import XmlParserSerializer
@pytest.fixture(scope="session")
def xml_handler() -> XmlParserSerializer:
return XmlParserSerializer()
Binary file not shown.
View File
+126
View File
@@ -0,0 +1,126 @@
"""BCF XML tests."""
import uuid
from pathlib import Path
from tempfile import TemporaryDirectory
import pytest
import bcf.v2.model as mdl
from bcf.v2.bcfxml import BcfXml
from bcf.v2.topic import TopicHandler
from bcf.v2.visinfo import (
VisualizationInfoHandler,
build_camera_from_vectors,
build_components,
)
from bcf.xml_parser import XmlParserSerializer
@pytest.fixture()
def build_sample(xml_handler: XmlParserSerializer) -> tuple[BcfXml, TopicHandler]:
bcf = BcfXml.create_new("Test project", xml_handler=xml_handler)
orig_th = bcf.add_topic("Test topic", "Test message", "Test author", "Test type")
return bcf, orig_th
def test_bcf_roundtrip(xml_handler, build_sample) -> None:
"""Saving and loading a bcf xml project returns the same objects."""
bcf, orig_th = build_sample
with TemporaryDirectory() as tmp_dir:
file_path = Path(tmp_dir) / "test.bcf"
bcf.save(file_path)
with BcfXml.load(file_path, xml_handler=xml_handler) as parsed:
assert parsed == bcf
parsed_th = parsed.topics[orig_th.guid]
assert parsed_th == orig_th
def test_bcf_edit_saveas(xml_handler, build_sample) -> None:
"""Saving and loading a bcf xml project returns the same objects."""
bcf, orig_th = build_sample
with TemporaryDirectory() as tmp_dir:
file_path = Path(tmp_dir) / "test.bcf"
bcf.save(file_path)
with BcfXml.load(file_path, xml_handler=xml_handler) as parsed:
for th in parsed.topics.values():
th.topic.title = "New Topic Title"
modified_path = Path(tmp_dir) / "edited.bcf"
parsed.save(modified_path)
with BcfXml.load(modified_path, xml_handler=xml_handler) as modified_parsed:
_assert_modified_parsed(modified_parsed, bcf, orig_th, parsed)
def _assert_modified_parsed(modified_parsed, bcf, orig_th, parsed):
assert modified_parsed == bcf
parsed_th = modified_parsed.topics[orig_th.guid]
assert parsed_th.markup != orig_th.markup
assert parsed_th.markup == parsed.topics[orig_th.guid].markup
assert parsed_th.viewpoints == orig_th.viewpoints
assert parsed_th.bim_snippet == orig_th.bim_snippet
def test_bcf_edit(xml_handler, build_sample) -> None:
"""Saving and loading a bcf xml project returns the same objects."""
bcf, orig_th = build_sample
with TemporaryDirectory() as tmp_dir:
file_path = Path(tmp_dir) / "test.bcf"
bcf.save(file_path)
with BcfXml.load(file_path, xml_handler=xml_handler) as parsed:
for th in parsed.topics.values():
th.topic.title = "New Topic Title"
parsed.save()
with BcfXml.load(file_path, xml_handler=xml_handler) as modified_parsed:
_assert_modified_parsed(modified_parsed, bcf, orig_th, parsed)
assert len(modified_parsed.topics) == 1
def test_save_no_filename(build_sample) -> None:
bcf, _ = build_sample
with pytest.raises(ValueError):
bcf.save()
def test_load_no_filename() -> None:
with pytest.raises(ValueError):
BcfXml.load("")
def test_save_keep_open(build_sample) -> None:
bcf, _ = build_sample
with TemporaryDirectory() as tmp_dir:
file_path = Path(tmp_dir) / "test.bcf"
bcf.save(file_path, keep_open=True)
assert bcf._zip_file is not None
bcf._zip_file.close()
def test_massive_bcf(xml_handler) -> None:
bcf = BcfXml.create_new("Test project", xml_handler=xml_handler)
for i in range(100):
th = bcf.add_topic(f"Topic {i:04}", f"Message {i:04}", "Test author", "Test type")
vi = mdl.VisualizationInfo(
guid=str(uuid.uuid4()),
components=build_components(str(uuid.uuid4())),
perspective_camera=build_camera_from_vectors([i, 0, 0], [0, 1, 0], [0, 0, 1]),
)
vh = VisualizationInfoHandler(visualization_info=vi, xml_handler=xml_handler)
th.add_visinfo_handler(vh)
assert len(bcf.topics) == 100
with TemporaryDirectory() as tmp_dir:
file_path = Path(tmp_dir) / "test.bcf"
bcf.save(file_path)
def test_equality_with_wrong_object(build_sample) -> None:
assert build_sample[0] != "Wrong object"
def test_topic_equality_with_wrong_object(build_sample) -> None:
assert build_sample[1] != "Wrong object"
def test_bcf_get_set_version(build_sample) -> None:
bcf = build_sample[0]
assert bcf.version.version_id == "2.1"
bcf.version.version_id = "2.0"
assert bcf.version.version_id == "2.0"
+365
View File
@@ -0,0 +1,365 @@
import json
import os
import zipfile
from pathlib import Path
from xsdata.models.datatype import XmlDateTime
import bcf.v2.model as mdl
from bcf.v2.bcfxml import BcfXml
from bcf.v2.topic import TopicHandler
def test_maximum_information() -> None:
"""
All the info in a BCF is parsed correctly.
Uses sample file from https://github.com/buildingSMART/BCF-XML/
"""
bcf_path = Path(__file__).parent / "MaximumInformation.bcf"
with BcfXml.load(bcf_path) as bcf:
assert_everything_in_place(bcf)
def test_save_maximum_information() -> None:
base_dir = Path(__file__).parent
bcf_path = base_dir / "MaximumInformation.bcf"
target_path = base_dir / "MaximumInformationSaved.bcf"
with BcfXml.load(bcf_path) as bcf:
bcf.save(target_path)
assert target_path.exists()
with BcfXml.load(target_path) as bcf2:
assert_everything_in_place(bcf2)
expected_files = [
"bcf.version",
"project.bcfp",
"7ddc3ef0-0ab7-43f1-918a-45e38b42369c/markup.bcf",
"7ddc3ef0-0ab7-43f1-918a-45e38b42369c/bitmap.png",
"7ddc3ef0-0ab7-43f1-918a-45e38b42369c/tux.png",
"7ddc3ef0-0ab7-43f1-918a-45e38b42369c/JsonElement.json",
"7ddc3ef0-0ab7-43f1-918a-45e38b42369c/Viewpoint_4ab7514b-b216-4d56-98d2-45cf8500ff5a.bcfv",
"7ddc3ef0-0ab7-43f1-918a-45e38b42369c/Viewpoint_9a4a1878-ecbd-4916-83a8-dad82e560231.bcfv",
"7ddc3ef0-0ab7-43f1-918a-45e38b42369c/Viewpoint_fc4019d7-365e-47f3-b6d0-b39fc48f15fc.bcfv",
"7ddc3ef0-0ab7-43f1-918a-45e38b42369c/Snapshot_4ab7514b-b216-4d56-98d2-45cf8500ff5a.png",
"7ddc3ef0-0ab7-43f1-918a-45e38b42369c/Snapshot_9a4a1878-ecbd-4916-83a8-dad82e560231.png",
"7ddc3ef0-0ab7-43f1-918a-45e38b42369c/Snapshot_fc4019d7-365e-47f3-b6d0-b39fc48f15fc.png",
"d1068c81-af04-4546-b63c-348810f6c716/markup.bcf",
"extensions.xsd",
"IfcPile_01.ifc",
"markup.xsd",
]
assert_files_present(target_path, expected_files)
os.unlink(target_path)
def assert_everything_in_place(bcf: BcfXml):
assert bcf.version.version_id == "2.1"
assert bcf.project.name == "BCF API Implementation"
assert bcf.project_info.extension_schema == "extensions.xsd"
assert len(bcf.topics) == 2
assert_first_topic_handler(bcf.topics["7ddc3ef0-0ab7-43f1-918a-45e38b42369c"])
second_th = bcf.topics["d1068c81-af04-4546-b63c-348810f6c716"]
assert second_th.topic == mdl.Topic(
title="Referenced topic",
creation_date=XmlDateTime(2017, 5, 22, 7, 51, 0, 42987900),
creation_author="dangl@iabi.eu",
description="This is just an empty topic that acts as a referenced topic.",
guid="d1068c81-af04-4546-b63c-348810f6c716",
)
def assert_first_topic_handler(topic_handler: TopicHandler):
assert topic_handler.guid == "7ddc3ef0-0ab7-43f1-918a-45e38b42369c"
expected_bs1 = mdl.BimSnippet(
reference="JsonElement.json", reference_schema="http://json-schema.org", snippet_type="JSON"
)
expected_t1 = mdl.Topic(
reference_link=["https://bim--it.net"],
title="Maximum Content",
priority="High",
index=0,
labels=["Structural", "IT Development"],
creation_date=XmlDateTime(2015, 6, 21, 12, 0, 0),
creation_author="dangl@iabi.eu",
modified_date=XmlDateTime(2015, 6, 21, 14, 22, 47),
modified_author="dangl@iabi.eu",
due_date=XmlDateTime(2016, 10, 2, 14, 22, 47),
assigned_to="linhard@iabi.eu",
stage="Construction Start",
description="This is a topic with all informations present.",
bim_snippet=expected_bs1,
document_reference=[
mdl.TopicDocumentReference(
referenced_document="https://github.com/BuildingSMART/BCF-XML",
description="GitHub BCF Specification",
is_external=True,
),
mdl.TopicDocumentReference(
referenced_document="../markup.xsd",
description="Markup.xsd Schema",
is_external=False,
),
],
related_topic=[mdl.TopicRelatedTopic(guid="d1068c81-af04-4546-b63c-348810f6c716")],
guid="7ddc3ef0-0ab7-43f1-918a-45e38b42369c",
topic_type="Structural",
topic_status="Open",
)
assert topic_handler.topic == expected_t1
expected_h1 = mdl.Header(
file=[
mdl.HeaderFile(
filename="IfcPile_01.ifc",
date=XmlDateTime(2014, 10, 27, 16, 27, 27),
reference="../IfcPile_01.ifc",
ifc_project="0M6o7Znnv7hxsbWgeu7oQq",
ifc_spatial_structure_element="23B$bNeGHFQuMYJzvUX0FD",
is_external=False,
)
]
)
assert topic_handler.header == expected_h1
expected_th1_comments = [
mdl.Comment(
date=XmlDateTime(2015, 8, 31, 12, 40, 17),
author="dangl@iabi.eu",
comment="This is an unmodified topic at the uppermost hierarchical level.\nAll times in the XML are marked as UTC times.",
guid="07ccdba0-1736-47e1-807d-67dc6f3addaa",
),
mdl.Comment(
date=XmlDateTime(2015, 8, 31, 14, 0, 1),
author="dangl@iabi.eu",
comment="This comment was a reply to the first comment in BCF v2.0. This is a no longer supported functionality and therefore is to be treated as a regular comment in v2.1.",
guid="a12766c2-61bc-40b4-ab19-e9f45fd0b0bf",
),
mdl.Comment(
date=XmlDateTime(2015, 8, 31, 13, 7, 11),
author="dangl@iabi.eu",
comment="This comment again is in the highest hierarchy level.\nIt references a viewpoint.",
viewpoint=mdl.CommentViewpoint(guid="4ab7514b-b216-4d56-98d2-45cf8500ff5a"),
guid="c2bb5bb0-773d-45dd-bdaa-19a216439ed3",
),
mdl.Comment(
date=XmlDateTime(2015, 8, 31, 15, 42, 58),
author="dangl@iabi.eu",
comment="This comment contained some spllng errs.\nHopefully, the modifier did catch them all.",
modified_date=XmlDateTime(2015, 8, 31, 16, 7, 11),
modified_author="dangl@iabi.eu",
guid="0b843a5c-c3bf-41ef-be98-52a9f7bd9790",
),
]
assert topic_handler.comments == expected_th1_comments
expected_th1_viewpoints = [
mdl.ViewPoint(
viewpoint="Viewpoint_4ab7514b-b216-4d56-98d2-45cf8500ff5a.bcfv",
snapshot="Snapshot_4ab7514b-b216-4d56-98d2-45cf8500ff5a.png",
index=2,
guid="4ab7514b-b216-4d56-98d2-45cf8500ff5a",
),
mdl.ViewPoint(
viewpoint="Viewpoint_fc4019d7-365e-47f3-b6d0-b39fc48f15fc.bcfv",
snapshot="Snapshot_fc4019d7-365e-47f3-b6d0-b39fc48f15fc.png",
index=0,
guid="fc4019d7-365e-47f3-b6d0-b39fc48f15fc",
),
mdl.ViewPoint(
viewpoint="Viewpoint_9a4a1878-ecbd-4916-83a8-dad82e560231.bcfv",
snapshot="Snapshot_9a4a1878-ecbd-4916-83a8-dad82e560231.png",
index=1,
guid="9a4a1878-ecbd-4916-83a8-dad82e560231",
),
]
expected_m1 = mdl.Markup(
header=expected_h1,
topic=expected_t1,
comment=expected_th1_comments,
viewpoints=expected_th1_viewpoints,
)
assert topic_handler.markup == expected_m1
assert json.loads(topic_handler.bim_snippet) == {"Material": "Concrete", "Temperatures": ["Cold", "Hot", "Hotter"]}
assert topic_handler.reference_files["../IfcPile_01.ifc"] is not None
assert_viewpoints(topic_handler.viewpoints)
def assert_viewpoints(viewpoints):
assert len(viewpoints) == 3
expected_selection = mdl.ComponentSelection(
component=[
mdl.Component(ifc_guid="0cSRUx$EX1NRjqiKcYQ$a0"),
mdl.Component(ifc_guid="1jQQiGIAnFzxOUzrdmJYDS"),
mdl.Component(ifc_guid="0fdpeZZEX3FwJ7x0ox5kzF"),
mdl.Component(ifc_guid="23Zwlpd71EyvHlH6OZ77nK"),
mdl.Component(ifc_guid="1OpjQ1Nlv4sQuTxfUC_8zS"),
]
)
expected_exception = mdl.ComponentVisibilityExceptions(
component=[
mdl.Component(ifc_guid="0Gl71cVurFn8bxAOox6M4X"),
mdl.Component(ifc_guid="23Zwlpd71EyvHlH6OZ77nK"),
mdl.Component(ifc_guid="3DvyPxGIn8qR0KDwbL_9r1"),
mdl.Component(ifc_guid="0fdpeZZEX3FwJ7x0ox5kzF"),
mdl.Component(ifc_guid="1OpjQ1Nlv4sQuTxfUC_8zS"),
]
)
expected_coloring = mdl.ComponentColoring(
color=[
mdl.ComponentColoringColor(
component=[
mdl.Component(ifc_guid="0fdpeZZEX3FwJ7x0ox5kzF"),
mdl.Component(ifc_guid="23Zwlpd71EyvHlH6OZ77nK"),
mdl.Component(ifc_guid="1OpjQ1Nlv4sQuTxfUC_8zS"),
mdl.Component(ifc_guid="0cSRUx$EX1NRjqiKcYQ$a0"),
],
color="3498DB",
)
]
)
assert_first_viewpoint(
viewpoints["Viewpoint_4ab7514b-b216-4d56-98d2-45cf8500ff5a.bcfv"],
expected_selection,
expected_exception,
expected_coloring,
)
assert_second_viewpoint(
viewpoints["Viewpoint_fc4019d7-365e-47f3-b6d0-b39fc48f15fc.bcfv"],
expected_selection,
expected_exception,
expected_coloring,
)
assert_third_viewpoint(
viewpoints["Viewpoint_9a4a1878-ecbd-4916-83a8-dad82e560231.bcfv"],
expected_selection,
expected_exception,
expected_coloring,
)
def assert_first_viewpoint(viewpoint, expected_selection, expected_exception, expected_coloring) -> None:
expected_vp = mdl.VisualizationInfo(
components=mdl.Components(
view_setup_hints=mdl.ViewSetupHints(
spaces_visible=True,
space_boundaries_visible=True,
openings_visible=True,
),
selection=expected_selection,
visibility=mdl.ComponentVisibility(
exceptions=expected_exception,
default_visibility=True,
),
coloring=expected_coloring,
),
perspective_camera=mdl.PerspectiveCamera(
camera_view_point=mdl.Point(x=0.43079984188079834, y=69.52057647705078, z=10.666350364685059),
camera_direction=mdl.Direction(x=0.09159398823976517, y=-0.9375035166740417, z=-0.3357048034667969),
camera_up_vector=mdl.Direction(x=0.01938679628074169, y=-0.3353792130947113, z=0.9418837428092957),
field_of_view=60,
),
lines=mdl.VisualizationInfoLines(
line=[
mdl.Line(start_point=mdl.Point(x=0, y=0, z=0), end_point=mdl.Point(x=0, y=0, z=1)),
mdl.Line(start_point=mdl.Point(x=0, y=0, z=1), end_point=mdl.Point(x=0, y=1, z=1)),
mdl.Line(start_point=mdl.Point(x=0, y=1, z=1), end_point=mdl.Point(x=1, y=1, z=1)),
]
),
clipping_planes=mdl.VisualizationInfoClippingPlanes(
clipping_plane=[
mdl.ClippingPlane(location=mdl.Point(x=0, y=0, z=0), direction=mdl.Direction(x=0, y=0, z=1)),
mdl.ClippingPlane(location=mdl.Point(x=0, y=0, z=0), direction=mdl.Direction(x=0, y=1, z=0)),
]
),
bitmap=[
mdl.VisualizationInfoBitmap(
bitmap=mdl.BitmapFormat.PNG,
reference="bitmap.png",
location=mdl.Point(x=10, y=-10, z=7),
normal=mdl.Direction(x=0, y=1, z=0),
up=mdl.Direction(x=0, y=0, z=1),
height=5.0,
),
mdl.VisualizationInfoBitmap(
bitmap=mdl.BitmapFormat.PNG,
reference="tux.png",
location=mdl.Point(x=20, y=-10, z=7),
normal=mdl.Direction(x=0, y=1, z=0),
up=mdl.Direction(x=0, y=0, z=1),
height=5.0,
),
],
guid="8dc86298-9737-40b4-a448-98a9e953293a",
)
assert viewpoint.visualization_info == expected_vp
assert viewpoint.snapshot is not None
def assert_second_viewpoint(viewpoint, expected_selection, expected_exception, expected_coloring) -> None:
expected_vp = mdl.VisualizationInfo(
components=mdl.Components(
view_setup_hints=mdl.ViewSetupHints(
spaces_visible=False,
space_boundaries_visible=False,
openings_visible=False,
),
selection=expected_selection,
visibility=mdl.ComponentVisibility(
exceptions=expected_exception,
default_visibility=False,
),
coloring=expected_coloring,
),
perspective_camera=mdl.PerspectiveCamera(
camera_view_point=mdl.Point(x=-47.18794250488281, y=43.829200744628906, z=10.666350364685059),
camera_direction=mdl.Direction(x=0.6745243072509766, y=-0.6599355936050415, z=-0.33091068267822266),
camera_up_vector=mdl.Direction(x=0.2271970510482788, y=-0.24091780185699463, z=0.9435783624649048),
field_of_view=60,
),
guid="21dd4807-e9af-439e-a980-04d913a6b1ce",
)
assert viewpoint.visualization_info == expected_vp
assert viewpoint.snapshot is not None
def assert_third_viewpoint(viewpoint, expected_selection, expected_exception, expected_coloring) -> None:
expected_vp = mdl.VisualizationInfo(
components=mdl.Components(
view_setup_hints=mdl.ViewSetupHints(
spaces_visible=False,
space_boundaries_visible=False,
openings_visible=True,
),
selection=expected_selection,
visibility=mdl.ComponentVisibility(
exceptions=expected_exception,
default_visibility=True,
),
coloring=expected_coloring,
),
perspective_camera=mdl.PerspectiveCamera(
camera_view_point=mdl.Point(x=-48.974571228027344, y=-64.20051574707031, z=10.666350364685059),
camera_direction=mdl.Direction(x=0.7232745289802551, y=0.5967116951942444, z=-0.3475759029388428),
camera_up_vector=mdl.Direction(x=0.27662187814712524, y=0.21082592010498047, z=0.937567412853241),
field_of_view=60,
),
guid="81daa431-bf01-4a49-80a2-1ab07c177717",
)
assert viewpoint.visualization_info == expected_vp
assert viewpoint.snapshot is not None
def assert_files_present(saved_bcf_path, expected_files):
with zipfile.ZipFile(saved_bcf_path) as bcf_zip:
for file_path in expected_files:
assert zipfile.Path(bcf_zip, file_path).exists()
+36
View File
@@ -0,0 +1,36 @@
import numpy as np
import pytest
from bcf.v2.bcfxml import BcfXml
def test_create_clash_set_bcf() -> None:
bcfxml = BcfXml.create_new("Clash Test")
topic = bcfxml.add_topic("Test", "Test topic", "IfcClash")
topic.add_viewpoint_from_point_and_guids(
np.array([10, 10, 10]),
"firstId",
"secondId",
)
assert len(topic.viewpoints) == 1
guid, vi_handler = next((k, v) for k, v in topic.viewpoints.items())
v_info = vi_handler.visualization_info
assert f"{v_info.guid}.bcfv" == guid
components = v_info.components.selection.component
assert {c.ifc_guid for c in components} == {"firstId", "secondId"}
camera = v_info.perspective_camera
viewpoint = camera.camera_view_point
assert viewpoint.x == 15
assert viewpoint.y == 15
assert viewpoint.z == 15
# default direction is the unit vector of -1, -1, -1
direction = camera.camera_direction
assert direction.x == pytest.approx(-1 / 3**0.5)
assert direction.y == pytest.approx(-1 / 3**0.5)
assert direction.z == pytest.approx(-1 / 3**0.5)
# default
up_vector = camera.camera_up_vector
assert up_vector.x == pytest.approx(-1 / 6**0.5)
assert up_vector.y == pytest.approx(-1 / 6**0.5)
assert up_vector.z == pytest.approx(1 / 1.5**0.5)
assert camera.field_of_view == 60
Binary file not shown.
View File
+121
View File
@@ -0,0 +1,121 @@
"""BCF XML tests."""
import uuid
from pathlib import Path
from tempfile import TemporaryDirectory
import pytest
import bcf.v3.model as mdl
from bcf.v3.bcfxml import BcfXml
from bcf.v3.topic import TopicHandler
from bcf.v3.visinfo import (
VisualizationInfoHandler,
build_camera_from_vectors,
build_components,
)
from bcf.xml_parser import XmlParserSerializer
@pytest.fixture()
def build_sample(xml_handler: XmlParserSerializer) -> tuple[BcfXml, TopicHandler]:
ext = mdl.Extensions(topic_types=mdl.ExtensionsTopicTypes(topic_type=["Test type"]))
bcf = BcfXml.create_new("Test project", extensions=ext, xml_handler=xml_handler)
orig_th = bcf.add_topic("Test topic", "Test message", "Test author", "Test type")
return bcf, orig_th
def test_bcf_roundtrip(xml_handler, build_sample) -> None:
"""Saving and loading a bcf xml project returns the same objects."""
bcf, orig_th = build_sample
with TemporaryDirectory() as tmp_dir:
file_path = Path(tmp_dir) / "test.bcf"
bcf.save(file_path)
with BcfXml.load(file_path, xml_handler=xml_handler) as parsed:
assert parsed == bcf
parsed_th = parsed.topics[orig_th.guid]
assert parsed_th == orig_th
def test_bcf_edit_saveas(xml_handler, build_sample) -> None:
"""Saving and loading a bcf xml project returns the same objects."""
bcf, orig_th = build_sample
with TemporaryDirectory() as tmp_dir:
file_path = Path(tmp_dir) / "test.bcf"
bcf.save(file_path)
with BcfXml.load(file_path, xml_handler=xml_handler) as parsed:
for th in parsed.topics.values():
th.topic.title = "New Topic Title"
modified_path = Path(tmp_dir) / "edited.bcf"
parsed.save(modified_path)
with BcfXml.load(modified_path, xml_handler=xml_handler) as modified_parsed:
_assert_modified_parsed(modified_parsed, bcf, orig_th, parsed)
def _assert_modified_parsed(modified_parsed, bcf, orig_th, parsed):
assert modified_parsed == bcf
parsed_th = modified_parsed.topics[orig_th.guid]
assert parsed_th.markup != orig_th.markup
assert parsed_th.markup == parsed.topics[orig_th.guid].markup
assert parsed_th.viewpoints == orig_th.viewpoints
assert parsed_th.bim_snippet == orig_th.bim_snippet
def test_bcf_edit(xml_handler, build_sample) -> None:
"""Saving and loading a bcf xml project returns the same objects."""
bcf, orig_th = build_sample
with TemporaryDirectory() as tmp_dir:
file_path = Path(tmp_dir) / "test.bcf"
bcf.save(file_path)
with BcfXml.load(file_path, xml_handler=xml_handler) as parsed:
for th in parsed.topics.values():
th.topic.title = "New Topic Title"
parsed.save()
with BcfXml.load(file_path, xml_handler=xml_handler) as modified_parsed:
_assert_modified_parsed(modified_parsed, bcf, orig_th, parsed)
assert len(modified_parsed.topics) == 1
def test_save_no_filename(build_sample) -> None:
bcf, _ = build_sample
with pytest.raises(ValueError):
bcf.save()
def test_load_no_filename() -> None:
with pytest.raises(ValueError):
BcfXml.load("")
def test_save_keep_open(build_sample) -> None:
bcf, _ = build_sample
with TemporaryDirectory() as tmp_dir:
file_path = Path(tmp_dir) / "test.bcf"
bcf.save(file_path, keep_open=True)
assert bcf._zip_file is not None
bcf._zip_file.close()
def test_massive_bcf(xml_handler) -> None:
ext = mdl.Extensions(topic_types=mdl.ExtensionsTopicTypes(topic_type=["Test type"]))
bcf = BcfXml.create_new("Test project", extensions=ext, xml_handler=xml_handler)
for i in range(100):
th = bcf.add_topic(f"Topic {i:04}", f"Message {i:04}", "Test author", "Test type")
vi = mdl.VisualizationInfo(
guid=str(uuid.uuid4()),
components=build_components(str(uuid.uuid4())),
perspective_camera=build_camera_from_vectors([i, 0, 0], [0, 1, 0], [0, 0, 1]),
)
vh = VisualizationInfoHandler(visualization_info=vi, xml_handler=xml_handler)
th.add_visinfo_handler(vh)
assert len(bcf.topics) == 100
with TemporaryDirectory() as tmp_dir:
file_path = Path(tmp_dir) / "test.bcf"
bcf.save(file_path)
def test_equality_with_wrong_object(build_sample) -> None:
assert build_sample[0] != "Wrong object"
def test_topic_equality_with_wrong_object(build_sample) -> None:
assert build_sample[1] != "Wrong object"
+230
View File
@@ -0,0 +1,230 @@
import json
import os
import zipfile
from pathlib import Path
from xsdata.models.datatype import XmlDateTime
import bcf.v3.model as mdl
from bcf.v3.bcfxml import BcfXml
from bcf.v3.topic import TopicHandler
def test_doc_ref_internal() -> None:
"""
All the info in a BCF is parsed correctly.
Uses sample file from https://github.com/buildingSMART/BCF-XML/
"""
bcf_path = Path(__file__).parent / "Document reference internal.bcf"
with BcfXml.load(bcf_path) as bcf:
assert_everything_in_place(bcf)
def test_doc_ref_internal_save() -> None:
base_dir = Path(__file__).parent
bcf_path = base_dir / "Document reference internal.bcf"
target_path = base_dir / "Document reference internal Saved.bcf"
with BcfXml.load(bcf_path) as bcf:
bcf.save(target_path)
assert target_path.exists()
with BcfXml.load(target_path) as bcf2:
assert_everything_in_place(bcf2)
assert_files_present(target_path)
os.unlink(target_path)
def assert_everything_in_place(bcf: BcfXml):
assert bcf.version.version_id == "3.0"
assert bcf.project.name == "BCF 3.0 test cases"
assert bcf.project.project_id == "de894a86-3a08-4ea0-b2d1-6c222b5602d1"
assert len(bcf.topics) == 1
topic_handler = bcf.topics["8ac9822a-761a-4deb-9f39-f61286acbf6a"]
expected_h1 = mdl.Header(
files=mdl.HeaderFiles(
file=[
mdl.File(
filename="BCF-ARK",
date=XmlDateTime(2021, 1, 4, 9, 37, 45),
reference="https://bimsync.com/project/f5fbb3c695274d1890036bf64f77eb71/revisions/007afab57f264d2296aae0a452486ae1",
is_external=True,
),
mdl.File(
filename="BCF-MEP",
date=XmlDateTime(2017, 8, 7, 9, 51, 34),
reference="https://bimsync.com/project/f5fbb3c695274d1890036bf64f77eb71/revisions/a21ed391f9e046a2bb2bc879c48f1d48",
is_external=True,
),
]
)
)
assert topic_handler.header == expected_h1
expected_comments = [
mdl.Comment(
date=XmlDateTime(2021, 2, 17, 9, 16, 4, 160_000_000),
author="Architect@example.com",
comment="A comment",
viewpoint=mdl.CommentViewpoint(guid="20ad2ff7-ceac-4d4b-b288-ad92a0f65182"),
guid="c045ef04-324d-4c36-9ac8-831f2a15c6d6",
),
]
assert topic_handler.comments == expected_comments
expected_viewpoints = [
mdl.ViewPoint(
viewpoint="Viewpoint_20ad2ff7-ceac-4d4b-b288-ad92a0f65182.bcfv",
snapshot="Snapshot_20ad2ff7-ceac-4d4b-b288-ad92a0f65182.png",
guid="20ad2ff7-ceac-4d4b-b288-ad92a0f65182",
),
]
expected_topic = mdl.Topic(
reference_links=mdl.TopicReferenceLinks(),
title="Document Reference Internal",
labels=mdl.TopicLabels(),
creation_date=XmlDateTime(2021, 2, 17, 9, 16, 4, 160_000_000),
creation_author="Architect@example.com",
modified_date=XmlDateTime(2021, 2, 17, 9, 16, 4, 160_000_000),
assigned_to="OtherUser@doe.com",
document_references=mdl.TopicDocumentReferences(
document_reference=[
mdl.DocumentReference(
document_guid="b1d1b7f0-60b9-457d-ad12-16e0fb997bc5",
description="ThisIsADocument.txt",
guid="048e898f-555f-47c3-a273-6c664fb2ef69",
),
],
),
related_topics=mdl.TopicRelatedTopics(),
comments=mdl.TopicComments(comment=expected_comments),
viewpoints=mdl.TopicViewpoints(view_point=expected_viewpoints),
guid="8ac9822a-761a-4deb-9f39-f61286acbf6a",
server_assigned_id="6",
topic_type="ERROR",
topic_status="OPEN",
)
assert topic_handler.topic == expected_topic
expected_m1 = mdl.Markup(
header=expected_h1,
topic=expected_topic,
)
assert topic_handler.markup == expected_m1
assert topic_handler.bim_snippet is None
assert_viewpoints(topic_handler.viewpoints)
def assert_viewpoints(viewpoints):
assert len(viewpoints) == 1
expected_vp = mdl.VisualizationInfo(
components=mdl.Components(
selection=mdl.ComponentSelection(),
visibility=mdl.ComponentVisibility(
view_setup_hints=mdl.ViewSetupHints(
spaces_visible=False,
space_boundaries_visible=False,
openings_visible=False,
),
exceptions=mdl.ComponentVisibilityExceptions(
component=[
mdl.Component(ifc_guid="1m5wAJelDFdhn6qBdOGjos", originating_system="https://bimsync.com"),
mdl.Component(ifc_guid="1bbI761TbBCOoIa5Kt6PXt", originating_system="https://bimsync.com"),
]
),
default_visibility=True,
),
coloring=mdl.ComponentColoring(),
),
perspective_camera=mdl.PerspectiveCamera(
camera_view_point=mdl.Point(x=23.112083480037754, y=-25.45574897560043, z=18.52519828443092),
camera_direction=mdl.Direction(x=-0.6289237666876837, y=0.5933487270610425, z=-0.5023864884632315),
camera_up_vector=mdl.Direction(x=-0.36542566067664123, y=0.3447553774917179, z=0.8646431727652648),
field_of_view=60,
aspect_ratio=1,
),
lines=mdl.VisualizationInfoLines(),
clipping_planes=mdl.VisualizationInfoClippingPlanes(),
bitmaps=mdl.VisualizationInfoBitmaps(),
guid="20ad2ff7-ceac-4d4b-b288-ad92a0f65182",
)
viewpoint = viewpoints["Viewpoint_20ad2ff7-ceac-4d4b-b288-ad92a0f65182.bcfv"]
assert viewpoint.visualization_info == expected_vp
assert viewpoint.snapshot is not None
def assert_second_viewpoint(viewpoint, expected_selection, expected_exception, expected_coloring) -> None:
expected_vp = mdl.VisualizationInfo(
components=mdl.Components(
view_setup_hints=mdl.ViewSetupHints(
spaces_visible=False,
space_boundaries_visible=False,
openings_visible=False,
),
selection=expected_selection,
visibility=mdl.ComponentVisibility(
exceptions=expected_exception,
default_visibility=False,
),
coloring=expected_coloring,
),
perspective_camera=mdl.PerspectiveCamera(
camera_view_point=mdl.Point(x=-47.18794250488281, y=43.829200744628906, z=10.666350364685059),
camera_direction=mdl.Direction(x=0.6745243072509766, y=-0.6599355936050415, z=-0.33091068267822266),
camera_up_vector=mdl.Direction(x=0.2271970510482788, y=-0.24091780185699463, z=0.9435783624649048),
field_of_view=60,
),
guid="21dd4807-e9af-439e-a980-04d913a6b1ce",
)
assert viewpoint.visualization_info == expected_vp
assert viewpoint.snapshot is not None
def assert_third_viewpoint(viewpoint, expected_selection, expected_exception, expected_coloring) -> None:
expected_vp = mdl.VisualizationInfo(
components=mdl.Components(
view_setup_hints=mdl.ViewSetupHints(
spaces_visible=False,
space_boundaries_visible=False,
openings_visible=True,
),
selection=expected_selection,
visibility=mdl.ComponentVisibility(
exceptions=expected_exception,
default_visibility=True,
),
coloring=expected_coloring,
),
perspective_camera=mdl.PerspectiveCamera(
camera_view_point=mdl.Point(x=-48.974571228027344, y=-64.20051574707031, z=10.666350364685059),
camera_direction=mdl.Direction(x=0.7232745289802551, y=0.5967116951942444, z=-0.3475759029388428),
camera_up_vector=mdl.Direction(x=0.27662187814712524, y=0.21082592010498047, z=0.937567412853241),
field_of_view=60,
),
guid="81daa431-bf01-4a49-80a2-1ab07c177717",
)
assert viewpoint.visualization_info == expected_vp
assert viewpoint.snapshot is not None
def assert_files_present(saved_bcf_path):
expected_files = [
"bcf.version",
"project.bcfp",
"documents.xml",
"extensions.xml",
"documents/b1d1b7f0-60b9-457d-ad12-16e0fb997bc5",
"8ac9822a-761a-4deb-9f39-f61286acbf6a/markup.bcf",
"8ac9822a-761a-4deb-9f39-f61286acbf6a/Viewpoint_20ad2ff7-ceac-4d4b-b288-ad92a0f65182.bcfv",
"8ac9822a-761a-4deb-9f39-f61286acbf6a/Snapshot_20ad2ff7-ceac-4d4b-b288-ad92a0f65182.png",
]
with zipfile.ZipFile(saved_bcf_path) as bcf_zip:
for file_path in expected_files:
assert zipfile.Path(bcf_zip, file_path).exists()
+36
View File
@@ -0,0 +1,36 @@
import numpy as np
import pytest
from bcf.v3.bcfxml import BcfXml
def test_create_clash_set_bcf() -> None:
bcfxml = BcfXml.create_new("Clash Test")
topic = bcfxml.add_topic("Test", "Test topic", "IfcClash")
topic.add_viewpoint_from_point_and_guids(
np.array([10, 10, 10]),
"firstId",
"secondId",
)
assert len(topic.viewpoints) == 1
guid, vi_handler = next((k, v) for k, v in topic.viewpoints.items())
v_info = vi_handler.visualization_info
assert f"{v_info.guid}.bcfv" == guid
components = v_info.components.selection.component
assert {c.ifc_guid for c in components} == {"firstId", "secondId"}
camera = v_info.perspective_camera
viewpoint = camera.camera_view_point
assert viewpoint.x == 15
assert viewpoint.y == 15
assert viewpoint.z == 15
# default direction is the unit vector of -1, -1, -1
direction = camera.camera_direction
assert direction.x == pytest.approx(-1 / 3**0.5)
assert direction.y == pytest.approx(-1 / 3**0.5)
assert direction.z == pytest.approx(-1 / 3**0.5)
# default
up_vector = camera.camera_up_vector
assert up_vector.x == pytest.approx(-1 / 6**0.5)
assert up_vector.y == pytest.approx(-1 / 6**0.5)
assert up_vector.z == pytest.approx(1 / 1.5**0.5)
assert camera.field_of_view == 60
+173 -24
View File
@@ -1,5 +1,5 @@
# BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
# Copyright (C) 2020-2023 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
@@ -16,6 +16,25 @@
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
PYTHON:=python3.10
PIP:=pip3.10
PATCH:=patch
SED:=sed -i
ifeq ($(OS),Windows_NT)
HOSTOS:=win
else
UNAME_S:=$(shell uname -s)
ifeq ($(UNAME_S),Linux)
HOSTOS:=linux
endif
ifeq ($(UNAME_S),Darwin)
HOSTOS:=macos
PYTHON:=python3
PATCH:=patch -d
SED:=sed -i '' -e
endif
endif
VERSION:=`date '+%y%m%d'`
PYVERSION:=py37
@@ -29,7 +48,7 @@ PYNUMBER:=39
endif
ifeq ($(PYVERSION), py310)
PYLIBDIR:=python3.10
PYNUMBER:=31
PYNUMBER:=310
endif
ifeq ($(PLATFORM), linux)
@@ -38,18 +57,24 @@ HPPFCL_URL:=https://anaconda.org/conda-forge/hpp-fcl/1.7.5/download/linux-64/hpp
EIGENPY_URL:=https://anaconda.org/conda-forge/eigenpy/2.6.5/download/linux-64/eigenpy-2.6.5-py37h95e2c48_0.tar.bz2
BOOST_URL:=https://anaconda.org/conda-forge/boost/1.74.0/download/linux-64/boost-1.74.0-py37h0379df6_3.tar.bz2
LXML_URL:=https://files.pythonhosted.org/packages/30/c0/d0526314971fc661b083ab135747dc68446a3022686da8c16d25fcf6ef07/lxml-4.6.3-cp37-cp37m-manylinux2014_x86_64.whl
SHAPELY_URL:=https://files.pythonhosted.org/packages/1d/a4/931d0780f31f3ea8c4f9ef6464a2825137c5241e6707a5fb03bef760a7eb/shapely-2.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
PILLOW_URL:=https://files.pythonhosted.org/packages/ed/d5/c2e84e1e36ab8ebea033921d5886a056c77e18bab5ab1051fcc22de2e8a2/Pillow-9.2.0-cp37-cp37m-manylinux_2_28_x86_64.whl
endif
ifeq ($(PYVERSION), py39)
HPPFCL_URL:=https://anaconda.org/conda-forge/hpp-fcl/1.7.5/download/linux-64/hpp-fcl-1.7.5-py39hbcdfc36_0.tar.bz2
EIGENPY_URL:=https://anaconda.org/conda-forge/eigenpy/2.6.5/download/linux-64/eigenpy-2.6.5-py39h5aed9d1_0.tar.bz2
BOOST_URL:=https://anaconda.org/conda-forge/boost/1.74.0/download/linux-64/boost-1.74.0-py39h5472131_3.tar.bz2
LXML_URL:=https://files.pythonhosted.org/packages/19/d9/a69c6aff5673554df48120565a14a50eaa41d29ae03b02faa0b023666318/lxml-4.6.3-cp39-cp39-manylinux2014_x86_64.whl
SHAPELY_URL:=https://files.pythonhosted.org/packages/2d/f2/8ec281d357e8bb7d08dc8d727f0e4c8ef3dae7d3fa75c69c8e452bb82d50/shapely-2.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
PILLOW_URL:=https://files.pythonhosted.org/packages/01/61/3ff85fb4bb596ce3d223c8fcf93c8df5c12bc8899dfb4fb3cb1c5b20dd5f/Pillow-9.2.0-cp39-cp39-manylinux_2_28_x86_64.whl
endif
ifeq ($(PYVERSION), py310)
HPPFCL_URL:=https://anaconda.org/conda-forge/hpp-fcl/1.8.0/download/linux-64/hpp-fcl-1.8.0-py310hdaf7e41_1.tar.bz2
EIGENPY_URL:=https://anaconda.org/conda-forge/eigenpy/2.6.11/download/linux-64/eigenpy-2.6.11-py310hf3e5c9c_0.tar.bz2
BOOST_URL:=https://anaconda.org/conda-forge/boost/1.74.0/download/linux-64/boost-1.74.0-py310h7c3ba0c_5.tar.bz2
LXML_URL:=https://files.pythonhosted.org/packages/25/1e/19b46d8e8881fe0df2e20945d51919eeb1817836d62a90efa8506530e45c/lxml-4.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
SHAPELY_URL:=https://files.pythonhosted.org/packages/a8/a5/403728b5614b28083f6424dfdefec5fcf58068495fb03bb08532671c642f/shapely-2.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
PILLOW_URL:=https://files.pythonhosted.org/packages/f6/51/320986ebd6d46a0e95c2240468ced73153b691ce07617078bcdf30c609ec/Pillow-9.2.0-cp310-cp310-manylinux_2_28_x86_64.whl
endif
ASSIMP_URL:=https://anaconda.org/conda-forge/assimp/5.0.1/download/linux-64/assimp-5.0.1-hedfc422_6.tar.bz2
OCTOMAP_URL:=https://anaconda.org/conda-forge/octomap/1.9.7/download/linux-64/octomap-1.9.7-h4bd325d_0.tar.bz2
@@ -62,48 +87,98 @@ HPPFCL_URL:=https://anaconda.org/conda-forge/hpp-fcl/1.7.5/download/osx-64/hpp-f
EIGENPY_URL:=https://anaconda.org/conda-forge/eigenpy/2.6.5/download/osx-64/eigenpy-2.6.5-py37h0695097_0.tar.bz2
BOOST_URL:=https://anaconda.org/conda-forge/boost/1.74.0/download/osx-64/boost-1.74.0-py37hd79e0ac_3.tar.bz2
LXML_URL:=https://files.pythonhosted.org/packages/1e/3e/f0abc15d5dac50939bccc589aae336d5ead4c72e7ad1039a2e0f3630ea92/lxml-4.6.3-cp37-cp37m-macosx_10_9_x86_64.whl
SHAPELY_URL:=https://files.pythonhosted.org/packages/e6/7d/4923f27c340339e1c896c77cafc8ed672c8d381a025bbab6c6ddcba27e8f/shapely-2.0.1-cp37-cp37m-macosx_10_9_x86_64.whl
PILLOW_URL:=https://files.pythonhosted.org/packages/88/49/c26fc3b5b0e82bdc9d8751d6b939da29327b0d98f7c3b95a575cbfed2743/Pillow-9.2.0-cp37-cp37m-macosx_10_10_x86_64.whl
endif
ifeq ($(PYVERSION), py39)
HPPFCL_URL:=https://anaconda.org/conda-forge/hpp-fcl/1.7.5/download/osx-64/hpp-fcl-1.7.5-py39h1e32b98_0.tar.bz2
EIGENPY_URL:=https://anaconda.org/conda-forge/eigenpy/2.6.5/download/osx-64/eigenpy-2.6.5-py39h5405915_0.tar.bz2
BOOST_URL:=https://anaconda.org/conda-forge/boost/1.74.0/download/osx-64/boost-1.74.0-py39ha641261_3.tar.bz2
LXML_URL:=https://files.pythonhosted.org/packages/b8/74/a71f7ad72e8db54ce899efab84507b801660750cbbfa6a39e6717557d36a/lxml-4.6.3-cp39-cp39-macosx_10_9_x86_64.whl
SHAPELY_URL:=https://files.pythonhosted.org/packages/36/a4/7e542a209f862f967d7cb8e939eff155f4294a27d17e16441fb8bdd51a2c/shapely-2.0.1-cp39-cp39-macosx_10_9_x86_64.whl
PILLOW_URL:=https://files.pythonhosted.org/packages/88/7a/ddfe28b485b623361457d4783007c1f9ba83a87f93e7fec32f64793efb6c/Pillow-9.2.0-cp39-cp39-macosx_10_10_x86_64.whl
endif
ifeq ($(PYVERSION), py310)
HPPFCL_URL:=https://anaconda.org/conda-forge/hpp-fcl/1.8.0/download/osx-64/hpp-fcl-1.8.0-py310h651ac30_1.tar.bz2
EIGENPY_URL:=https://anaconda.org/conda-forge/eigenpy/2.6.11/download/osx-64/eigenpy-2.6.11-py310hc03097c_0.tar.bz2
BOOST_URL:=https://anaconda.org/conda-forge/boost/1.74.0/download/osx-64/boost-1.74.0-py310h509978a_5.tar.bz2
LXML_URL:=https://files.pythonhosted.org/packages/a1/44/17b7dac7a18807d30e2fe10c3328c152808f5464565e230bfd0e77f178c6/lxml-4.8.0-cp310-cp310-macosx_10_15_x86_64.whl
SHAPELY_URL:=https://files.pythonhosted.org/packages/1f/2a/dc3353c2431cf53e8d04bb8fba27e584410ca3435c9c85f76d71bf0c0e80/shapely-2.0.1-cp310-cp310-macosx_10_9_x86_64.whl
PILLOW_URL:=https://files.pythonhosted.org/packages/d8/60/b13c00d403f34110e96c1b5c0afa73ce461efe3fe960c3a7e3e7fe190d82/Pillow-9.2.0-cp310-cp310-macosx_10_10_x86_64.whl
endif
ASSIMP_URL:=https://anaconda.org/conda-forge/assimp/5.0.1/download/osx-64/assimp-5.0.1-h1224e73_6.tar.bz2
OCTOMAP_URL:=https://anaconda.org/conda-forge/octomap/1.9.7/download/osx-64/octomap-1.9.7-h940c156_0.tar.bz2
ZLIB_URL:=https://anaconda.org/conda-forge/zlib/1.2.11/download/osx-64/zlib-1.2.11-h7795811_1010.tar.bz2
endif
ifeq ($(PLATFORM), macosm1)
ifeq ($(PYVERSION), py37)
# Warning: py37 not supported on Apple M1
HPPFCL_URL:=https://anaconda.org/conda-forge/hpp-fcl/1.7.5/download/osx-64/hpp-fcl-1.7.5-py37h2d7f23a_0.tar.bz2
EIGENPY_URL:=https://anaconda.org/conda-forge/eigenpy/2.6.5/download/osx-64/eigenpy-2.6.5-py37h0695097_0.tar.bz2
BOOST_URL:=https://anaconda.org/conda-forge/boost/1.74.0/download/osx-64/boost-1.74.0-py37hd79e0ac_3.tar.bz2
LXML_URL:=https://anaconda.org/conda-forge/lxml/4.9.1/download/osx-64/lxml-4.9.1-py37h994c40b_0.tar.bz2
SHAPELY_URL:=https://files.pythonhosted.org/packages/e6/7d/4923f27c340339e1c896c77cafc8ed672c8d381a025bbab6c6ddcba27e8f/shapely-2.0.1-cp37-cp37m-macosx_10_9_x86_64.whl
PILLOW_URL:=https://files.pythonhosted.org/packages/aa/bc/21097cd891dd2fa02f2b3d767e02e883e026482e59d29975d1bc30024aa3/Pillow-9.2.0-cp39-cp39-macosx_11_0_arm64.whl
endif
ifeq ($(PYVERSION), py39)
HPPFCL_URL:=https://anaconda.org/conda-forge/hpp-fcl/1.7.5/download/osx-arm64/hpp-fcl-1.7.5-py39ha69f3c1_2.tar.bz2
EIGENPY_URL:=https://anaconda.org/conda-forge/eigenpy/2.6.7/download/osx-arm64/eigenpy-2.6.7-py39ha69f3c1_0.tar.bz2
BOOST_URL:=https://anaconda.org/conda-forge/boost/1.78.0/download/osx-arm64/boost-1.78.0-py39h2550fe3_0.tar.bz2
LXML_URL:=https://anaconda.org/conda-forge/lxml/4.9.1/download/osx-arm64/lxml-4.9.1-py39h9eb174b_0.tar.bz2
SHAPELY_URL:=https://files.pythonhosted.org/packages/ea/aa/45fbd031edf3149cb767d8b9f9db45d5faf0324d743c6b8fb0298cc022d0/shapely-2.0.1-cp39-cp39-macosx_11_0_arm64.whl
PILLOW_URL:=https://files.pythonhosted.org/packages/aa/bc/21097cd891dd2fa02f2b3d767e02e883e026482e59d29975d1bc30024aa3/Pillow-9.2.0-cp39-cp39-macosx_11_0_arm64.whl
endif
ifeq ($(PYVERSION), py310)
HPPFCL_URL:=https://anaconda.org/conda-forge/hpp-fcl/1.8.0/download/osx-arm64/hpp-fcl-1.8.0-py310h5699539_2.tar.bz2
EIGENPY_URL:=https://anaconda.org/conda-forge/eigenpy/2.6.9/download/osx-arm64/eigenpy-2.6.9-py310habfc766_1.tar.bz2
BOOST_URL:=https://anaconda.org/conda-forge/boost/1.78.0/download/osx-arm64/boost-1.78.0-py310h4566fd1_0.tar.bz2
LXML_URL:=https://anaconda.org/conda-forge/lxml/4.9.1/download/osx-arm64/lxml-4.9.1-py310h02f21da_0.tar.bz2
SHAPELY_URL:=https://files.pythonhosted.org/packages/ec/41/d59208743e737184e1b403e95a937aebb022b8459e99efbcd5208fc8be46/shapely-2.0.1-cp310-cp310-macosx_11_0_arm64.whl
PILLOW_URL:=https://files.pythonhosted.org/packages/0c/5f/117b653cad585f3aedfe0de996c292e67d4b020ed77f652e5a6c8c24f908/Pillow-9.2.0-cp310-cp310-macosx_11_0_arm64.whl
endif
ASSIMP_URL:=https://anaconda.org/conda-forge/assimp/5.0.1/download/osx-arm64/assimp-5.0.1-h0f81e16_7.tar.bz2
OCTOMAP_URL:=https://anaconda.org/conda-forge/octomap/1.9.7/download/osx-arm64/octomap-1.9.7-hc021e02_0.tar.bz2
ZLIB_URL:=https://anaconda.org/conda-forge/zlib/1.2.11/download/osx-arm64/zlib-1.2.11-h90dfc92_1014.tar.bz2
endif
ifeq ($(PLATFORM), win)
ifeq ($(PYVERSION), py37)
HPPFCL_URL:=https://anaconda.org/conda-forge/hpp-fcl/1.7.5/download/win-64/hpp-fcl-1.7.5-py37h839d6b1_0.tar.bz2
EIGENPY_URL:=https://anaconda.org/conda-forge/eigenpy/2.6.5/download/win-64/eigenpy-2.6.5-py37h2c32e34_0.tar.bz2
BOOST_URL:=https://anaconda.org/conda-forge/boost/1.74.0/download/win-64/boost-1.74.0-py37h3b38789_3.tar.bz2
LXML_URL:=https://files.pythonhosted.org/packages/9e/5e/171ee9d40a600f565fe691ec5bf7596247ec62cfb2edc00c91afe8ea837b/lxml-4.6.3-cp37-cp37m-win_amd64.whl
SHAPELY_URL:=https://files.pythonhosted.org/packages/e2/87/b8b8d8d57b429b01aa56b7d723075c09f33c988b8091bb6f790c83436909/shapely-2.0.1-cp37-cp37m-win_amd64.whl
PILLOW_URL:=https://files.pythonhosted.org/packages/69/f5/9e802159d78b2eaf26bf1f8b94648605993f5ca7247ac8870f065063fc40/Pillow-9.2.0-cp37-cp37m-win_amd64.whl
endif
ifeq ($(PYVERSION), py39)
HPPFCL_URL:=https://anaconda.org/conda-forge/hpp-fcl/1.7.5/download/win-64/hpp-fcl-1.7.5-py39h2e7c763_0.tar.bz2
EIGENPY_URL:=https://anaconda.org/conda-forge/eigenpy/2.6.5/download/win-64/eigenpy-2.6.5-py39h3ce40e6_0.tar.bz2
BOOST_URL:=https://anaconda.org/conda-forge/boost/1.74.0/download/win-64/boost-1.74.0-py39hefe7e4c_3.tar.bz2
LXML_URL:=https://files.pythonhosted.org/packages/72/d4/426ecb8849c47c3e370c87aa0ac05d85768df917ffea27fcd6686a5e6495/lxml-4.6.3-cp39-cp39-win_amd64.whl
SHAPELY_URL:=https://files.pythonhosted.org/packages/a7/ae/eab645c4075093584b7a65ab71cb8ff4563a015bd935c9b55dba14b2c1eb/shapely-2.0.1-cp39-cp39-win_amd64.whl
PILLOW_URL:=https://files.pythonhosted.org/packages/19/3f/b4d4bcf05dbcbe07f2e9613a8f4180c297395e73a91d8ad22c32c6624f8c/Pillow-9.2.0-cp39-cp39-win_amd64.whl
endif
ifeq ($(PYVERSION), py310)
HPPFCL_URL:=https://anaconda.org/conda-forge/hpp-fcl/1.8.0/download/win-64/hpp-fcl-1.8.0-py310hc5a3c62_1.tar.bz2
EIGENPY_URL:=https://anaconda.org/conda-forge/eigenpy/2.6.11/download/win-64/eigenpy-2.6.11-py310hbd43d28_0.tar.bz2
BOOST_URL:=https://anaconda.org/conda-forge/boost/1.74.0/download/win-64/boost-1.74.0-py310hc781a3c_5.tar.bz2
LXML_URL:=https://files.pythonhosted.org/packages/f6/71/65c80a4caa1617a4c6e8fe1500cebb179db96232e2f623bfe6a1f4294e39/lxml-4.8.0-cp310-cp310-win_amd64.whl
SHAPELY_URL:=https://files.pythonhosted.org/packages/81/8a/7ac076a86b2632f1872284c5e60ed5f2fc26094875a85b35d9fa17b52504/shapely-2.0.1-cp310-cp310-win_amd64.whl
PILLOW_URL:=https://files.pythonhosted.org/packages/02/55/67a3c17b9e7d972ed8c246f104da99ca4f3ea42fba566697e479011b84b6/Pillow-9.2.0-cp310-cp310-win_amd64.whl
endif
ASSIMP_URL:=https://anaconda.org/conda-forge/assimp/5.0.1/download/win-64/assimp-5.0.1-hc2aa0de_6.tar.bz2
OCTOMAP_URL:=https://anaconda.org/conda-forge/octomap/1.9.7/download/win-64/octomap-1.9.7-h5362a0b_0.tar.bz2
ZLIB_URL:=https://anaconda.org/conda-forge/zlib/1.2.11/download/win-64/zlib-1.2.11-h62dcd97_1010.tar.bz2
endif
.PHONY: bump
bump:
cd . && $(SED) "s/$(OLD)/$(NEW)/" Makefile
cd ../ifcopenshell-python/ && $(SED) "s/$(OLD)/$(NEW)/" Makefile
cd ../ifcopenshell-python/docs/ifcconvert/ && $(SED) "s/$(OLD)/$(NEW)/" installation.rst
cd ../ifcopenshell-python/docs/ifcopenshell-python/ && $(SED) "s/$(OLD)/$(NEW)/" installation.rst
.PHONY: dist
dist:
ifndef PLATFORM
@@ -115,7 +190,7 @@ endif
cp -r blenderbim/* dist/blenderbim/
# Provides IfcOpenShell Python functionality
cd dist/working && wget https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-$(PYNUMBER)-v0.7.0-2985bba-$(PLATFORM)64.zip
cd dist/working && wget https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-$(PYNUMBER)-v0.7.0-476ab50-$(PLATFORM)64.zip
cd dist/working && unzip ifcopenshell-python*
cp -r dist/working/ifcopenshell dist/blenderbim/libs/site/packages/
@@ -133,16 +208,20 @@ endif
cp -r dist/working/IfcOpenShell-0.7.0/src/ifcopenshell-python/ifcopenshell/api/* dist/blenderbim/libs/site/packages/ifcopenshell/api/
cp dist/working/IfcOpenShell-0.7.0/src/ifcopenshell-python/ifcopenshell/entity_instance.py dist/blenderbim/libs/site/packages/ifcopenshell/
cp dist/working/IfcOpenShell-0.7.0/src/ifcopenshell-python/ifcopenshell/file.py dist/blenderbim/libs/site/packages/ifcopenshell/
cp dist/working/IfcOpenShell-0.7.0/src/ifcopenshell-python/ifcopenshell/validate.py dist/blenderbim/libs/site/packages/ifcopenshell/
cp dist/working/IfcOpenShell-0.7.0/src/ifcopenshell-python/ifcopenshell/express/rule_executor.py dist/blenderbim/libs/site/packages/ifcopenshell/express/
# Provides bcf functionality
cp -r dist/working/IfcOpenShell-0.7.0/src/bcf/src/bcf dist/blenderbim/libs/site/packages/
# Provides IFCClash functionality
cp -r dist/working/IfcOpenShell-0.7.0/src/ifcclash/ifcclash dist/blenderbim/libs/site/packages/
# Provides BIMTester functionality
cd dist/working && python -m venv env
cd dist/working && . env/bin/activate && pip install pybabel
cd dist/working && . env/bin/activate && pip install babel
cd dist/working && $(PYTHON) -m venv env
cd dist/working && . env/bin/activate && $(PIP) install pybabel
cd dist/working && . env/bin/activate && $(PIP) install babel
cd dist/working && . env/bin/activate && ./env/bin/pybabel compile -d ./IfcOpenShell-0.7.0/src/ifcbimtester/bimtester/locale/
cp -r dist/working/IfcOpenShell-0.7.0/src/ifcbimtester/bimtester dist/blenderbim/libs/site/packages/
# Provides IFCTester functionality
cp -r dist/working/IfcOpenShell-0.7.0/src/ifctester/ifctester dist/blenderbim/libs/site/packages/
# Provides IFCCOBie functionality
cp -r dist/working/IfcOpenShell-0.7.0/src/ifccobie/* dist/blenderbim/libs/site/packages/
# Provides IFCDiff functionality
@@ -160,10 +239,11 @@ endif
rm -rf dist/working
# Provides Mustache templating in construction documentation
# TODO: remove this dependency, it seems overkill and we seem to get by with str replaces
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/d6/fd/eb8c212053addd941cc90baac307c00ac246ac3fce7166b86434c6eae963/pystache-0.5.4.tar.gz
cd dist/working && wget https://files.pythonhosted.org/packages/3f/e7/8750ba6c6101d6aa5ceeb20c013adf2c6f3554a12c71d75654b468404bfa/pystache-0.6.0.tar.gz
cd dist/working && tar -xzvf pystache*
cd dist/working/pystache-0.5.4/ && python setup.py build && cp -r build/lib/pystache ../../blenderbim/libs/site/packages/
cd dist/working/pystache-0.6.0/ && $(PYTHON) setup.py build && cp -r build/lib/pystache ../../blenderbim/libs/site/packages/
rm -rf dist/working
# Provides SVG export in construction documentation
@@ -201,6 +281,13 @@ endif
cp -r dist/working/decorator-5.0.9/src/decorator.py dist/blenderbim/libs/site/packages/
rm -rf dist/working
# Provides audio playback for costing
mkdir -p dist/working
git clone https://github.com/Andrej730/aud.git --branch master-reduced-size --depth 1 dist/working/aud
cd dist/working/aud && git checkout 529af208fbcb707c387bfb681d2605c0b6112de7
cp -r dist/working/aud/aud dist/blenderbim/libs/site/packages/
rm -rf dist/working
# Provides jsgantt-improved supports for web-based construction sequencing gantt charts
mkdir dist/working
cd dist/working && wget https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.js
@@ -210,9 +297,9 @@ endif
# Required by IFCDiff
mkdir dist/working
cd dist/working && wget https://github.com/Moult/deepdiff/archive/master.zip
cd dist/working && unzip master.zip
cp -r dist/working/deepdiff-master/deepdiff dist/blenderbim/libs/site/packages/
cd dist/working && wget https://files.pythonhosted.org/packages/0f/ca/caead2949fbb824c7142e3774fa841aa853bb4d4331b440da8c8514dfc6f/deepdiff-5.8.1.tar.gz
cd dist/working && tar -xzvf deepdiff*
cp -r dist/working/deepdiff-5.8.1/deepdiff dist/blenderbim/libs/site/packages/
rm -rf dist/working
# Required by deepdiff
@@ -238,16 +325,23 @@ endif
# Required by bcf
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/bb/41/ad9ce53bb978b68af8ae415293cafc89b165b8ad55a593725299dca76729/xmlschema-1.1.1.tar.gz
cd dist/working && wget https://files.pythonhosted.org/packages/5b/ef/f97c3e1a7efa00e989a793fe15297214fc95ad7d9e3810586bd08ce9f0f3/xmlschema-2.0.2.tar.gz
cd dist/working && tar -xzvf xmlschema*
cp -r dist/working/xmlschema-1.1.1/xmlschema dist/blenderbim/libs/site/packages/
cp -r dist/working/xmlschema-2.0.2/xmlschema dist/blenderbim/libs/site/packages/
rm -rf dist/working
# Required by bcf
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/12/f9/f9960222d5274944b01391749e55e4dcdf28d8f0c108b64ac931ceff6fdb/elementpath-1.4.3.tar.gz
cd dist/working && wget https://files.pythonhosted.org/packages/ad/c7/17c9d16320d8e2cfdb27d2fd298b5e8f7a3f211025b0c1bc7a39a85bd690/xsdata-22.11.tar.gz
cd dist/working && tar -xzvf xsdata*
cp -r dist/working/xsdata-22.11/xsdata dist/blenderbim/libs/site/packages/
rm -rf dist/working
# Required by bcf
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/11/bc/5afb61dd5d863e5cf77cd952445c50c17e65953405986f19e97e4389692a/elementpath-3.0.2.tar.gz
cd dist/working && tar -xzvf elementpath*
cp -r dist/working/elementpath-1.4.3/elementpath dist/blenderbim/libs/site/packages/
cp -r dist/working/elementpath-3.0.2/elementpath dist/blenderbim/libs/site/packages/
rm -rf dist/working
# Required by bcf
@@ -271,6 +365,29 @@ endif
cp -r dist/working/PyP6Xer-1.13.0/xerparser dist/blenderbim/libs/site/packages/
rm -rf dist/working
# Required by QTOCalculator
mkdir dist/working
cd dist/working && wget $(SHAPELY_URL)
cd dist/working && cp *.whl shapely.zip && unzip shapely.zip
cp -r dist/working/shapely dist/blenderbim/libs/site/packages/
ifeq ($(PLATFORM), win)
cp -r dist/working/shapely.libs dist/blenderbim/libs/site/packages/
endif
ifeq ($(PLATFORM), linux)
cp -r dist/working/shapely.libs dist/blenderbim/libs/site/packages/
endif
rm -rf dist/working
# Required by the BIM tool thumbnail generator
mkdir dist/working
cd dist/working && wget $(PILLOW_URL)
cd dist/working && cp *.whl pillow.zip && unzip pillow.zip
cp -r dist/working/PIL dist/blenderbim/libs/site/packages/
ifeq ($(PLATFORM), linux)
cp -r dist/working/Pillow.libs dist/blenderbim/libs/site/packages/
endif
rm -rf dist/working
# Required by xerparser and IFC4D
# TODO: remove this dependency. It's only used to show a progress bar.
mkdir dist/working
@@ -279,11 +396,13 @@ endif
cp -r dist/working/tqdm-4.50.0/tqdm dist/blenderbim/libs/site/packages/
rm -rf dist/working
# Required by IFCCityJSON
mkdir dist/working
cd dist/working && python -m venv env
cd dist/working && $(PYTHON) -m venv env
cd dist/working && mkdir site-packages
cd dist/working && . env/bin/activate && pip install cjio --target=./site-packages
# Required by IFCCityJSON
cd dist/working && . env/bin/activate && $(PIP) install cjio --target=./site-packages
# Provides express rule validation for ifcopenshell.validate
cd dist/working && . env/bin/activate && $(PIP) install pytest --target=./site-packages
cd dist/working/site-packages/ && rm -r *dist-info*
cp -r dist/working/site-packages/* dist/blenderbim/libs/site/packages/
rm -rf dist/working
@@ -389,16 +508,30 @@ endif
# See bug #1294
cd dist/working/ && wget https://raw.githubusercontent.com/IfcOpenShell/IfcOpenShell/v0.7.0/src/ifcbimtester/patch/model_core.patch
cd dist/working/ && wget https://raw.githubusercontent.com/IfcOpenShell/IfcOpenShell/v0.7.0/src/ifcbimtester/patch/runner_util.patch
cd dist/working/ && patch ../blenderbim/libs/site/packages/behave/model_core.py < model_core.patch
cd dist/working/ && patch ../blenderbim/libs/site/packages/behave/runner_util.py < runner_util.patch
cd dist/working/ && $(PATCH) ../blenderbim/libs/site/packages/behave/model_core.py < model_core.patch
cd dist/working/ && $(PATCH) ../blenderbim/libs/site/packages/behave/runner_util.py < runner_util.patch
# See bug #2159
cd dist/working/ && wget https://raw.githubusercontent.com/IfcOpenShell/IfcOpenShell/v0.7.0/src/ifcbimtester/patch/junit.patch
cd dist/working/ && $(PATCH) ../blenderbim/libs/site/packages/behave/reporter/junit.py < junit.patch
rm -rf dist/working
# Required by ids - uh, not any more, but I'm trying it out in the drawing module
ifeq ($(PLATFORM), macosm1)
# No wheels available for MacOS M1, but turns out this Anaconda build works
mkdir dist/working
cd dist/working && wget $(LXML_URL)
cd dist/working && tar -xf lxml*
cp -r dist/working/lib/$(PYLIBDIR)/site-packages/lxml dist/blenderbim/libs/site/packages/
rm -rf dist/working
else
# Wheels are preferred for other OSes. A first attempt at using Anaconda
# builds for everything shows it breaks on windows. See #2422.
mkdir dist/working
cd dist/working && wget $(LXML_URL)
cd dist/working && cp *.whl lxml.zip && unzip lxml.zip
cp -r dist/working/lxml dist/blenderbim/libs/site/packages/
rm -rf dist/working
endif
# Required by behave
mkdir dist/working
@@ -415,6 +548,7 @@ endif
rm -rf dist/working
# Required by IFCCOBie for XLSX support
# TODO: see if we can replace this with openpyxl which does both read/write
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/0c/bc/82d6783f83f65f56d8b77d052773c4a2f952fa86385f0cd54e1e006658d7/XlsxWriter-1.2.9.tar.gz
cd dist/working && tar -xzvf XlsxWriter*
@@ -470,14 +604,14 @@ endif
cp -r dist/working/IFC2JSON_python-master/file_converters/ifcjson dist/blenderbim/libs/site/packages/
rm -rf dist/working
# Provides OpenLCA fucntionality
# Provides OpenLCA functionality
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/85/33/f91b96e9e8608ff65a003b692e8a9cdd60f2178f60617e5b1d21334c009c/olca-ipc-0.0.10.tar.gz
cd dist/working && tar -xzvf olca-ipc*
cd dist/working/olca-ipc-0.0.10/ && cp -r olca ../../blenderbim/libs/site/packages/
rm -rf dist/working
# Provides Brickschema fucntionality
# Provides Brickschema functionality
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/ca/37/8309da9a72407d2f5eb5489c197ac3cfe96ee3ccba1902d2a0ecc7843f92/brickschema-0.5.1.tar.gz
cd dist/working && tar -xzvf brickschema*
@@ -486,7 +620,7 @@ endif
cd dist/working/brickschema-0.5.1/ && cp -r brickschema ../../blenderbim/libs/site/packages/
# For now lets bundle the latest nightly schema
cd dist/working && wget https://github.com/BrickSchema/Brick/releases/download/nightly/Brick.ttl
cd dist/working && cp Brick.ttl ../../blenderbim/bim/schema/Brick.ttl
cd dist/working && cp Brick.ttl ../blenderbim/bim/schema/Brick.ttl
rm -rf dist/working
# Required by brickschema
@@ -518,7 +652,14 @@ endif
cd dist/working/ && cp -r pkg_resources ../blenderbim/libs/site/packages/
rm -rf dist/working
cd dist/blenderbim && sed -i "s/999999/$(VERSION)/" __init__.py
# Required for hipped roof generation
mkdir dist/working
cd dist/working && wget https://github.com/prochitecture/bpypolyskel/archive/refs/heads/master.zip
cd dist/working && unzip master.zip
cp -r dist/working/bpypolyskel-master/bpypolyskel dist/blenderbim/libs/site/packages/
rm -rf dist/working
cd dist/blenderbim && $(SED) "s/999999/$(VERSION)/" __init__.py
cd dist && zip -r blenderbim-$(VERSION)-$(PYVERSION)-$(PLATFORM).zip ./*
rm -rf dist/blenderbim
@@ -534,11 +675,19 @@ test-core:
.PHONY: test-bim
test-bim:
ifndef MODULE
pytest test/bim
else
pytest test/bim -m "$(MODULE)" ./ --maxfail=1
endif
.PHONY: test-tool
test-tool:
ifndef MODULE
pytest test/tool
else
pytest test/tool/test_$(MODULE).py
endif
.PHONY: qa
qa:
+16 -3
View File
@@ -27,6 +27,7 @@ modules = {
"root": None,
"unit": None,
"model": None,
"cad": None,
"georeference": None,
"context": None,
"drawing": None,
@@ -61,6 +62,7 @@ modules = {
"clash": None,
"lca": None,
"csv": None,
"tester": None,
"bimtester": None,
"diff": None,
"patch": None,
@@ -89,9 +91,14 @@ classes = [
operator.RemoveIfcFile,
operator.SelectDataDir,
operator.SelectIfcFile,
operator.ReloadSelectedIfcFile,
operator.SelectSchemaDir,
operator.SelectURIAttribute,
operator.EditBlenderCollection,
operator.BIM_OT_open_webbrowser,
operator.BIM_OT_show_description,
prop.StrProperty,
operator.BIM_OT_enum_property_search, # /!\ Register AFTER prop.StrProperty
prop.ObjProperty,
prop.Attribute,
prop.ModuleVisibility,
@@ -110,6 +117,7 @@ classes = [
ui.BIM_PT_project_info,
ui.BIM_PT_project_setup,
ui.BIM_PT_collaboration,
ui.BIM_PT_selection,
ui.BIM_PT_geometry,
ui.BIM_PT_services,
ui.BIM_PT_structural,
@@ -130,7 +138,8 @@ for mod in modules.values():
def on_register(scene):
handler.setDefaultProperties(scene)
bpy.app.handlers.depsgraph_update_post.remove(on_register)
if not bpy.app.background:
bpy.app.handlers.depsgraph_update_post.remove(on_register)
def register():
@@ -143,7 +152,7 @@ def register():
bpy.app.handlers.redo_post.append(handler.redo_post)
bpy.app.handlers.load_post.append(handler.setDefaultProperties)
bpy.app.handlers.load_post.append(handler.loadIfcStore)
bpy.app.handlers.save_pre.append(handler.ensureIfcExported)
bpy.app.handlers.save_post.append(handler.ensureIfcExported)
bpy.types.Scene.BIMProperties = bpy.props.PointerProperty(type=prop.BIMProperties)
bpy.types.Object.BIMObjectProperties = bpy.props.PointerProperty(type=prop.BIMObjectProperties)
bpy.types.Material.BIMObjectProperties = bpy.props.PointerProperty(type=prop.BIMObjectProperties)
@@ -153,6 +162,8 @@ def register():
bpy.types.Camera.BIMMeshProperties = bpy.props.PointerProperty(type=prop.BIMMeshProperties)
bpy.types.PointLight.BIMMeshProperties = bpy.props.PointerProperty(type=prop.BIMMeshProperties)
bpy.types.SCENE_PT_unit.append(ui.ifc_units)
if hasattr(bpy.types, "UI_MT_button_context_menu"):
bpy.types.UI_MT_button_context_menu.append(ui.draw_custom_context_menu)
for mod in modules.values():
mod.register()
@@ -163,7 +174,7 @@ def unregister():
bpy.utils.unregister_class(cls)
bpy.app.handlers.load_post.remove(handler.setDefaultProperties)
bpy.app.handlers.load_post.remove(handler.loadIfcStore)
bpy.app.handlers.save_pre.remove(handler.ensureIfcExported)
bpy.app.handlers.save_post.remove(handler.ensureIfcExported)
del bpy.types.Scene.BIMProperties
del bpy.types.Object.BIMObjectProperties
del bpy.types.Material.BIMObjectProperties
@@ -173,6 +184,8 @@ def unregister():
del bpy.types.Camera.BIMMeshProperties
del bpy.types.PointLight.BIMMeshProperties
bpy.types.SCENE_PT_unit.remove(ui.ifc_units)
if hasattr(bpy.types, "UI_MT_button_context_menu"):
bpy.types.UI_MT_button_context_menu.remove(ui.draw_custom_context_menu)
for mod in reversed(list(modules.values())):
mod.unregister()
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
@@ -1,13 +1,13 @@
ISO-10303-21;
HEADER;
FILE_DESCRIPTION(('ViewDefinition[DesignTransferView]'),'2;1');
FILE_NAME('/dev/null','2021-11-08T10:06:41+11:00',(),(),'IfcOpenShell v0.7.0-ab506098','IfcOpenShell v0.7.0-ab506098','Nobody');
FILE_NAME('/dev/null','2023-02-04T13:08:05+11:00',(),(),'IfcOpenShell v0.7.0-07ee62eb9','IfcOpenShell v0.7.0-07ee62eb9','Nobody');
FILE_SCHEMA(('IFC4'));
ENDSEC;
DATA;
#1=IFCPROJECT('1oJZZVd$b1PA6ggg_hh4cE',$,'BlenderBIM Demo',$,$,$,$,(#12,#16),#7);
#2=IFCPROJECTLIBRARY('3jWhYPJYL2eOMZ9UZerKqx',$,'BlenderBIM Demo Library',$,$,$,$,$,$);
#3=IFCRELDECLARES('1Wjv8iy5XBshHpEwChjCFa',$,$,$,#1,(#2));
#1=IFCPROJECT('3ubSuEuavEPfXTf4v0gmbA',$,'BlenderBIM Demo',$,$,$,$,(#12,#16),#7);
#2=IFCPROJECTLIBRARY('1Qq43hq0v3B9Ko7EGW0hJ5',$,'BlenderBIM Demo Library',$,$,$,$,$,$);
#3=IFCRELDECLARES('0hU2lTJfX70AKkhyURrbam',$,$,$,#1,(#2));
#4=IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.);
#5=IFCSIUNIT(*,.AREAUNIT.,$,.SQUARE_METRE.);
#6=IFCSIUNIT(*,.VOLUMEUNIT.,$,.CUBIC_METRE.);
@@ -17,89 +17,89 @@ DATA;
#10=IFCDIRECTION((1.,0.,0.));
#11=IFCAXIS2PLACEMENT3D(#8,#9,#10);
#12=IFCGEOMETRICREPRESENTATIONCONTEXT($,'Model',3,1.E-05,#11,$);
#13=IFCCARTESIANPOINT((0.,0.,0.));
#14=IFCDIRECTION((1.,0.,0.));
#13=IFCCARTESIANPOINT((0.,0.));
#14=IFCDIRECTION((1.,0.));
#15=IFCAXIS2PLACEMENT2D(#13,#14);
#16=IFCGEOMETRICREPRESENTATIONCONTEXT($,'Plan',2,1.E-05,#15,$);
#17=IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Body','Model',*,*,*,*,#12,$,.MODEL_VIEW.,$);
#18=IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Annotation','Plan',*,*,*,*,#16,$,.PLAN_VIEW.,$);
#18=IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Body','Plan',*,*,*,*,#16,$,.PLAN_VIEW.,$);
#19=IFCMATERIAL('Unknown',$,$);
#20=IFCWALLTYPE('24Js5pn1PCeA_DXGWh67_f',$,'DEMO50',$,$,$,$,$,$,$);
#20=IFCWALLTYPE('3yGmcLQT96CPWJXcV3vNPJ',$,'WAL50',$,$,$,$,$,$,.NOTDEFINED.);
#21=IFCMATERIALLAYERSET((#23),$,$);
#22=IFCRELASSOCIATESMATERIAL('3gPuTuaVf1AAgeln9$alDb',$,$,$,(#20),#21);
#22=IFCRELASSOCIATESMATERIAL('0JMzROKjj7i8EKtMLZ2nXy',$,$,$,(#20),#21);
#23=IFCMATERIALLAYER(#19,0.05,$,$,$,$,$);
#24=IFCRELDECLARES('3AJpFBgAf4OQzrklK7UbEn',$,$,$,#2,(#37,#41,#76,#47,#58,#91,#25,#225,#71,#159,#29,#62,#95,#20,#53,#86,#33,#66,#81));
#25=IFCWALLTYPE('1HCqnc9S51NhU$e0Xceg6o',$,'DEMO100',$,$,$,$,$,$,$);
#24=IFCRELDECLARES('1TTgyh7ynBQ8XpgpGSU6ao',$,$,$,#2,(#41,#76,#47,#58,#91,#25,#159,#225,#71,#29,#62,#95,#20,#53,#86,#33,#66,#81,#37));
#25=IFCWALLTYPE('20jY5HfLH4LBwMrDEoTdML',$,'WAL100',$,$,$,$,$,$,.NOTDEFINED.);
#26=IFCMATERIALLAYERSET((#28),$,$);
#27=IFCRELASSOCIATESMATERIAL('2Ikoi$G2PCXvk61V36wh3N',$,$,$,(#25),#26);
#27=IFCRELASSOCIATESMATERIAL('2sICOUhur5WgrNUOi1pvhV',$,$,$,(#25),#26);
#28=IFCMATERIALLAYER(#19,0.1,$,$,$,$,$);
#29=IFCWALLTYPE('3UPlZcHuTCi8CevFkzQjZ_',$,'DEMO200',$,$,$,$,$,$,$);
#29=IFCWALLTYPE('0xhGqQenH5Ov9L_CiLywqN',$,'WAL200',$,$,$,$,$,$,.NOTDEFINED.);
#30=IFCMATERIALLAYERSET((#32),$,$);
#31=IFCRELASSOCIATESMATERIAL('3uAo69i4j4nwMM7VRW3TQn',$,$,$,(#29),#30);
#31=IFCRELASSOCIATESMATERIAL('2pOhWSsWT4bQwtduxS8HNJ',$,$,$,(#29),#30);
#32=IFCMATERIALLAYER(#19,0.2,$,$,$,$,$);
#33=IFCWALLTYPE('1y03E8PfTAJPit3967Y5Uf',$,'DEMO300',$,$,$,$,$,$,$);
#33=IFCWALLTYPE('1HrJFcNVH4XQJIRrEmUD6Z',$,'WAL300',$,$,$,$,$,$,.NOTDEFINED.);
#34=IFCMATERIALLAYERSET((#36),$,$);
#35=IFCRELASSOCIATESMATERIAL('2pvy9lWJL62BoA9QC5KCOG',$,$,$,(#33),#34);
#35=IFCRELASSOCIATESMATERIAL('0cAK6yBnXAnO$5LYcU3QQl',$,$,$,(#33),#34);
#36=IFCMATERIALLAYER(#19,0.3,$,$,$,$,$);
#37=IFCCOVERINGTYPE('3ppA8IYrP2nffVvxie6ghZ',$,'DEMO10',$,$,$,$,$,$,$);
#37=IFCCOVERINGTYPE('11MVutxgn20fTEibOhUiS8',$,'COV10',$,$,$,$,$,$,.NOTDEFINED.);
#38=IFCMATERIALLAYERSET((#40),$,$);
#39=IFCRELASSOCIATESMATERIAL('2Lg3S9QRH4kPgHpYrtokt6',$,$,$,(#37),#38);
#39=IFCRELASSOCIATESMATERIAL('1$dvrpTAn6oPSVqcMtsvmV',$,$,$,(#37),#38);
#40=IFCMATERIALLAYER(#19,0.01,$,$,$,$,$);
#41=IFCCOVERINGTYPE('3KuCqMbY16DRUygYOrLyYE',$,'DEMO20',$,$,(#45),$,$,$,$);
#41=IFCCOVERINGTYPE('1DWvr7poP3ggxFE7vxOot2',$,'COV20',$,$,(#45),$,$,$,.NOTDEFINED.);
#42=IFCMATERIALLAYERSET((#44),$,$);
#43=IFCRELASSOCIATESMATERIAL('27BA_9uQT6OfxSGgEbsKY4',$,$,$,(#41),#42);
#43=IFCRELASSOCIATESMATERIAL('2uf2C_54501xFgLlk_jqMG',$,$,$,(#41),#42);
#44=IFCMATERIALLAYER(#19,0.02,$,$,$,$,$);
#45=IFCPROPERTYSET('11$WHz$79EMw60BdaUh77w',$,'EPset_Parametric',$,(#46));
#45=IFCPROPERTYSET('0fSGHPSBH9U8H_ph5xpH65',$,'EPset_Parametric',$,(#46));
#46=IFCPROPERTYSINGLEVALUE('LayerSetDirection',$,IFCLABEL('AXIS2'),$);
#47=IFCCOVERINGTYPE('2cYyQpe9f1vBW8C4D58QZS',$,'DEMO30',$,$,(#51),$,$,$,$);
#47=IFCCOVERINGTYPE('1ayqDfj8XDxB$G7ZFyRagM',$,'COV30',$,$,(#51),$,$,$,.NOTDEFINED.);
#48=IFCMATERIALLAYERSET((#50),$,$);
#49=IFCRELASSOCIATESMATERIAL('1ir_2IiXX4Ax4VH5lcXGEu',$,$,$,(#47),#48);
#49=IFCRELASSOCIATESMATERIAL('01vVE$oHTA3BLmh2imRGuu',$,$,$,(#47),#48);
#50=IFCMATERIALLAYER(#19,0.03,$,$,$,$,$);
#51=IFCPROPERTYSET('2IalIx1bj02AXv21tZC0Sz',$,'EPset_Parametric',$,(#52));
#51=IFCPROPERTYSET('3v7cOUGgT0qxrxlQkzwSIR',$,'EPset_Parametric',$,(#52));
#52=IFCPROPERTYSINGLEVALUE('LayerSetDirection',$,IFCLABEL('AXIS3'),$);
#53=IFCRAMPTYPE('23wMhiydD6yw5XpaFs6XCA',$,'DEMO200',$,$,$,$,$,$,$);
#53=IFCRAMPTYPE('0VEv7VZVnDzxHXC$QE2Crm',$,'RAM200',$,$,$,$,$,$,.NOTDEFINED.);
#54=IFCMATERIALLAYERSET((#56),$,$);
#55=IFCRELASSOCIATESMATERIAL('2SLXH7fU1D6OIOdV8Gq6T_',$,$,$,(#53),#54);
#55=IFCRELASSOCIATESMATERIAL('0ToQjR2aLAdgGPuqu6UH1o',$,$,$,(#53),#54);
#56=IFCMATERIALLAYER(#19,0.2,$,$,$,$,$);
#57=IFCCIRCLEPROFILEDEF(.AREA.,$,$,0.3);
#58=IFCPILETYPE('3J5r90lrL3kv3b8uqOGsY1',$,'DEMO1',$,$,$,$,$,$,$);
#58=IFCPILETYPE('26kmCVC0H4lOhCGn6cCLSQ',$,'P1',$,$,$,$,$,$,.NOTDEFINED.);
#59=IFCMATERIALPROFILESET($,$,(#61),$);
#60=IFCRELASSOCIATESMATERIAL('2vYxThgzHDSOHXKehbpw4S',$,$,$,(#58),#59);
#60=IFCRELASSOCIATESMATERIAL('2Ev3ucMBPDtwntRLG_4cBU',$,$,$,(#58),#59);
#61=IFCMATERIALPROFILE($,$,#19,#57,$,$);
#62=IFCSLABTYPE('0OWxf_nd97uvH$Sr4QbAVW',$,'DEMO150',$,$,$,$,$,$,$);
#62=IFCSLABTYPE('3cLRr85lHDAPjHswaO7574',$,'FLR150',$,$,$,$,$,$,.NOTDEFINED.);
#63=IFCMATERIALLAYERSET((#65),$,$);
#64=IFCRELASSOCIATESMATERIAL('3WSlLxuwH3Sfsul8DwR0LU',$,$,$,(#62),#63);
#64=IFCRELASSOCIATESMATERIAL('07afdGZLHCFej$qXPfCLn9',$,$,$,(#62),#63);
#65=IFCMATERIALLAYER(#19,0.2,$,$,$,$,$);
#66=IFCSLABTYPE('0wVKQLFFb2oAHccogmWWWy',$,'DEMO250',$,$,$,$,$,$,$);
#66=IFCSLABTYPE('2WiuelwGf3Ah3gnVgDGEAn',$,'FLR250',$,$,$,$,$,$,.NOTDEFINED.);
#67=IFCMATERIALLAYERSET((#69),$,$);
#68=IFCRELASSOCIATESMATERIAL('01R$pwjx14qOlDDfB34EBC',$,$,$,(#66),#67);
#68=IFCRELASSOCIATESMATERIAL('03XoY4bYD4ZwZgvg3JqIIK',$,$,$,(#66),#67);
#69=IFCMATERIALLAYER(#19,0.3,$,$,$,$,$);
#70=IFCRECTANGLEPROFILEDEF(.AREA.,$,$,0.5,0.6);
#71=IFCCOLUMNTYPE('2OGUvw6Tj9deH3dTY4Hk3T',$,'DEMO1',$,$,$,$,$,$,$);
#70=IFCRECTANGLEPROFILEDEF(.AREA.,'500x600',$,0.5,0.6);
#71=IFCCOLUMNTYPE('187MdL9O13_OzlwsOaT0zY',$,'C1',$,$,$,$,$,$,.NOTDEFINED.);
#72=IFCMATERIALPROFILESET($,$,(#74),$);
#73=IFCRELASSOCIATESMATERIAL('1f717ijc53DgmnoMRFBZ62',$,$,$,(#71),#72);
#73=IFCRELASSOCIATESMATERIAL('1CMVTn08P2Tu8afsZHQiUk',$,$,$,(#71),#72);
#74=IFCMATERIALPROFILE($,$,#19,#70,$,$);
#75=IFCCIRCLEHOLLOWPROFILEDEF(.AREA.,$,$,0.25,0.005);
#76=IFCCOLUMNTYPE('3_jg43QeDAWvPCl1D0Lw_q',$,'DEMO2',$,$,$,$,$,$,$);
#75=IFCCIRCLEHOLLOWPROFILEDEF(.AREA.,'500.0x5.0 CHS',$,0.25,0.005);
#76=IFCCOLUMNTYPE('3e6tIcskjDOuj1_UAWcT87',$,'C2',$,$,$,$,$,$,.NOTDEFINED.);
#77=IFCMATERIALPROFILESET($,$,(#79),$);
#78=IFCRELASSOCIATESMATERIAL('3mX_vYbF92vxfOrjZFAuYk',$,$,$,(#76),#77);
#78=IFCRELASSOCIATESMATERIAL('0ahT30pYb7zQ968gWY9q1A',$,$,$,(#76),#77);
#79=IFCMATERIALPROFILE($,$,#19,#75,$,$);
#80=IFCRECTANGLEHOLLOWPROFILEDEF(.AREA.,$,$,0.075,0.15,0.005,0.005,0.005);
#81=IFCCOLUMNTYPE('2ZJTQa2Db0MAv2N5bjUuXK',$,'DEMO3',$,$,$,$,$,$,$);
#80=IFCRECTANGLEHOLLOWPROFILEDEF(.AREA.,'150x75x2.0 RHS',$,0.075,0.15,0.002,0.005,0.005);
#81=IFCCOLUMNTYPE('0ZxXYg0BTFg8sbqXr50qPW',$,'C3',$,$,$,$,$,$,.NOTDEFINED.);
#82=IFCMATERIALPROFILESET($,$,(#84),$);
#83=IFCRELASSOCIATESMATERIAL('0Yslq2hlz9Qe3PO16oqESz',$,$,$,(#81),#82);
#83=IFCRELASSOCIATESMATERIAL('0ul_xSpIH2MxsZcv$ZFXG7',$,$,$,(#81),#82);
#84=IFCMATERIALPROFILE($,$,#19,#80,$,$);
#85=IFCISHAPEPROFILEDEF(.AREA.,'DEMO-I',$,0.1,0.2,0.005,0.01,0.005,$,$);
#86=IFCBEAMTYPE('2bUnl1uHnB$QSMF_fVajUw',$,'DEMO1',$,$,$,$,$,$,$);
#86=IFCBEAMTYPE('06Td_2IhD5OgyKW34Ikv$Z',$,'B1',$,$,$,$,$,$,.NOTDEFINED.);
#87=IFCMATERIALPROFILESET($,$,(#89),$);
#88=IFCRELASSOCIATESMATERIAL('08d9DxbyHAyRgRPc6W4Qsn',$,$,$,(#86),#87);
#88=IFCRELASSOCIATESMATERIAL('2cT5kDtU11jv2sFtIKVfJa',$,$,$,(#86),#87);
#89=IFCMATERIALPROFILE($,$,#19,#85,$,$);
#90=IFCCSHAPEPROFILEDEF(.AREA.,'DEMO-C',$,0.2,0.1,0.0015,0.03,0.005);
#91=IFCBEAMTYPE('0f1mNiwDTAiuSgrvotHh5$',$,'DEMO2',$,$,$,$,$,$,$);
#91=IFCBEAMTYPE('1JyktsoBP8DgMbJiECPZ6d',$,'B2',$,$,$,$,$,$,.NOTDEFINED.);
#92=IFCMATERIALPROFILESET($,$,(#94),$);
#93=IFCRELASSOCIATESMATERIAL('2cO0XhlFf8MxIg_eNDWX_X',$,$,$,(#91),#92);
#93=IFCRELASSOCIATESMATERIAL('2$_YKuP914sBZmflM_8l1s',$,$,$,(#91),#92);
#94=IFCMATERIALPROFILE($,$,#19,#90,$,$);
#95=IFCWINDOWTYPE('0ihTx2Iw1E2gRAq1N4pWVg',$,'DEMO1',$,$,$,(#136,#158),$,$,$,$,$,$);
#95=IFCWINDOWTYPE('0g10V5zVP8c96j3mPV0Xvn',$,'WT01',$,$,$,(#136,#158),$,$,.NOTDEFINED.,.NOTDEFINED.,$,$);
#96=IFCINDEXEDPOLYGONALFACE((13,17,18,14));
#97=IFCINDEXEDPOLYGONALFACE((5,6,3,4));
#98=IFCINDEXEDPOLYGONALFACE((7,8,2,1));
@@ -126,14 +126,14 @@ DATA;
#119=IFCPOLYGONALFACESET(#118,$,(#96,#97,#98,#99,#100,#102,#103,#104,#105,#106,#107,#108,#109,#110,#111,#112),$);
#120=IFCPOLYGONALFACESET(#118,$,(#101,#113,#114,#115,#116,#117),$);
#121=IFCSHAPEREPRESENTATION(#17,'Body','Tessellation',(#119,#120));
#122=IFCSURFACESTYLE('Frame',.BOTH.,(#125));
#123=IFCCOLOURRGB($,0.0429765619337559,0.0429765619337559,0.0429765619337559);
#122=IFCSURFACESTYLE('Frame',.BOTH.,(#123));
#123=IFCSURFACESTYLERENDERING(#124,0.,#125,$,$,$,IFCNORMALISEDRATIOMEASURE(0.),IFCSPECULARROUGHNESS(0.4),.NOTDEFINED.);
#124=IFCCOLOURRGB($,0.0429765619337559,0.0429765619337559,0.0429765619337559);
#125=IFCSURFACESTYLERENDERING(#123,0.,#124,$,$,$,$,$,$);
#126=IFCSURFACESTYLE('Glass',.BOTH.,(#129));
#127=IFCCOLOURRGB($,0.800000011920929,1.,1.);
#125=IFCCOLOURRGB($,0.800000011920929,0.800000011920929,0.800000011920929);
#126=IFCSURFACESTYLE('Glass',.BOTH.,(#127));
#127=IFCSURFACESTYLERENDERING(#128,0.,#129,$,$,$,IFCNORMALISEDRATIOMEASURE(0.),IFCSPECULARROUGHNESS(0.5),.NOTDEFINED.);
#128=IFCCOLOURRGB($,0.800000011920929,1.,1.);
#129=IFCSURFACESTYLERENDERING(#127,0.799999997019768,#128,$,$,$,$,$,$);
#129=IFCCOLOURRGB($,0.800000011920929,0.800000011920929,0.800000011920929);
#130=IFCSTYLEDITEM(#119,(#122),'Frame');
#131=IFCSTYLEDITEM(#120,(#126),'Glass');
#132=IFCCARTESIANPOINT((0.,0.,0.));
@@ -157,13 +157,13 @@ DATA;
#150=IFCINDEXEDPOLYCURVE(#137,(IFCLINEINDEX((5,11))),$);
#151=IFCINDEXEDPOLYCURVE(#137,(IFCLINEINDEX((6,12))),$);
#152=IFCGEOMETRICCURVESET((#138,#139,#140,#141,#142,#143,#144,#145,#146,#147,#148,#149,#150,#151));
#153=IFCSHAPEREPRESENTATION(#18,'Annotation','Annotation2D',(#152));
#153=IFCSHAPEREPRESENTATION(#18,'Body','Annotation2D',(#152));
#154=IFCCARTESIANPOINT((0.,0.,0.));
#155=IFCDIRECTION((1.,0.,0.));
#156=IFCDIRECTION((0.,0.,1.));
#157=IFCAXIS2PLACEMENT3D(#154,#156,#155);
#158=IFCREPRESENTATIONMAP(#157,#153);
#159=IFCDOORTYPE('0HLh8Cp3f58hay4OhB7SHy',$,'DEMO1',$,$,$,(#204,#224),$,$,$,$,$,$);
#159=IFCDOORTYPE('0nu4v3oPPFmQIz2RA1Vp_t',$,'DT01',$,$,$,(#204,#224),$,$,.NOTDEFINED.,.NOTDEFINED.,$,$);
#160=IFCINDEXEDPOLYGONALFACE((17,16,15,14));
#161=IFCINDEXEDPOLYGONALFACE((2,3,29,28));
#162=IFCINDEXEDPOLYGONALFACE((27,28,29,30,32,31));
@@ -194,14 +194,14 @@ DATA;
#187=IFCPOLYGONALFACESET(#186,$,(#161,#162,#163,#164,#165,#166,#169,#170,#171,#172,#173,#174,#175,#176,#179,#180,#182,#183,#184,#185),$);
#188=IFCPOLYGONALFACESET(#186,$,(#160,#167,#168,#177,#178,#181),$);
#189=IFCSHAPEREPRESENTATION(#17,'Body','Tessellation',(#187,#188));
#190=IFCSURFACESTYLE('Frame',.BOTH.,(#193));
#191=IFCCOLOURRGB($,0.0429765619337559,0.0429765619337559,0.0429765619337559);
#190=IFCSURFACESTYLE('Frame',.BOTH.,(#191));
#191=IFCSURFACESTYLERENDERING(#192,0.,#193,$,$,$,IFCNORMALISEDRATIOMEASURE(0.),IFCSPECULARROUGHNESS(0.4),.NOTDEFINED.);
#192=IFCCOLOURRGB($,0.0429765619337559,0.0429765619337559,0.0429765619337559);
#193=IFCSURFACESTYLERENDERING(#191,0.,#192,$,$,$,$,$,$);
#194=IFCSURFACESTYLE('Panel',.BOTH.,(#197));
#195=IFCCOLOURRGB($,0.184475064277649,0.184475019574165,0.184475019574165);
#193=IFCCOLOURRGB($,0.800000011920929,0.800000011920929,0.800000011920929);
#194=IFCSURFACESTYLE('Panel',.BOTH.,(#195));
#195=IFCSURFACESTYLERENDERING(#196,0.,#197,$,$,$,IFCNORMALISEDRATIOMEASURE(0.),IFCSPECULARROUGHNESS(0.5),.NOTDEFINED.);
#196=IFCCOLOURRGB($,0.184475064277649,0.184475019574165,0.184475019574165);
#197=IFCSURFACESTYLERENDERING(#195,0.,#196,$,$,$,$,$,$);
#197=IFCCOLOURRGB($,0.800000011920929,0.800000011920929,0.800000011920929);
#198=IFCSTYLEDITEM(#187,(#190),'Frame');
#199=IFCSTYLEDITEM(#188,(#194),'Panel');
#200=IFCCARTESIANPOINT((0.,0.,0.));
@@ -223,13 +223,13 @@ DATA;
#216=IFCINDEXEDPOLYCURVE(#205,(IFCLINEINDEX((11,15))),$);
#217=IFCINDEXEDPOLYCURVE(#205,(IFCLINEINDEX((17,18)),IFCLINEINDEX((18,19)),IFCLINEINDEX((19,20)),IFCLINEINDEX((20,21)),IFCLINEINDEX((21,22)),IFCLINEINDEX((22,23)),IFCLINEINDEX((23,24)),IFCLINEINDEX((24,25)),IFCLINEINDEX((25,26)),IFCLINEINDEX((26,27)),IFCLINEINDEX((27,28)),IFCLINEINDEX((28,29))),$);
#218=IFCGEOMETRICCURVESET((#206,#207,#208,#209,#210,#211,#212,#213,#214,#215,#216,#217));
#219=IFCSHAPEREPRESENTATION(#18,'Annotation','Annotation2D',(#218));
#219=IFCSHAPEREPRESENTATION(#18,'Body','Annotation2D',(#218));
#220=IFCCARTESIANPOINT((0.,0.,0.));
#221=IFCDIRECTION((1.,0.,0.));
#222=IFCDIRECTION((0.,0.,1.));
#223=IFCAXIS2PLACEMENT3D(#220,#222,#221);
#224=IFCREPRESENTATIONMAP(#223,#219);
#225=IFCFURNITURETYPE('1wgo6Pw4jDJO4F1GA9Qlmx',$,'BUNNY',$,$,$,(#946,#988),$,$,$,$);
#225=IFCFURNITURETYPE('2YuVxsKJL9URJtwIhHY2GN',$,'BUN01',$,$,$,(#946,#988),$,$,.NOTDEFINED.,.NOTDEFINED.);
#226=IFCINDEXEDPOLYGONALFACE((187,278,44));
#227=IFCINDEXEDPOLYGONALFACE((21,52,60));
#228=IFCINDEXEDPOLYGONALFACE((91,100,31));
@@ -987,7 +987,7 @@ DATA;
#980=IFCINDEXEDPOLYCURVE(#947,(IFCLINEINDEX((60,61)),IFCLINEINDEX((61,62)),IFCLINEINDEX((62,63))),$);
#981=IFCINDEXEDPOLYCURVE(#947,(IFCLINEINDEX((64,31))),$);
#982=IFCGEOMETRICCURVESET((#948,#949,#950,#951,#952,#953,#954,#955,#956,#957,#958,#959,#960,#961,#962,#963,#964,#965,#966,#967,#968,#969,#970,#971,#972,#973,#974,#975,#976,#977,#978,#979,#980,#981));
#983=IFCSHAPEREPRESENTATION(#18,'Annotation','Annotation2D',(#982));
#983=IFCSHAPEREPRESENTATION(#18,'Body','Annotation2D',(#982));
#984=IFCCARTESIANPOINT((0.,0.,0.));
#985=IFCDIRECTION((1.,0.,0.));
#986=IFCDIRECTION((0.,0.,1.));
File diff suppressed because one or more lines are too long
@@ -0,0 +1,24 @@
ISO-10303-21;
HEADER;
FILE_DESCRIPTION((),'2;1');
FILE_NAME('EPset_Drawing.ifc','2020-01-01T00:00:00',(),(),'EPset_Drawing','EPset_Drawing',$);
FILE_SCHEMA(('IFC4'));
ENDSEC;
DATA;
#1=IFCPROPERTYSETTEMPLATE('2JhNIvqZrFnAgxfhK0XVQX',$,'EPset_Drawing','',.PSET_OCCURRENCEDRIVEN.,'IfcAnnotation',(#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15));
#2=IFCSIMPLEPROPERTYTEMPLATE('23JavTMk98ZxXhrUEnjAcf',$,'TargetView','',.P_SINGLEVALUE.,'IfcLabel',$,$,$,$,$,.READWRITE.);
#3=IFCSIMPLEPROPERTYTEMPLATE('1yVWUt5H9DAOuu0OaMMLpe',$,'Scale','',.P_SINGLEVALUE.,'IfcLabel',$,$,$,$,$,.READWRITE.);
#4=IFCSIMPLEPROPERTYTEMPLATE('3gsuPBtU93b8f0gg1pjkq6',$,'HumanScale','',.P_SINGLEVALUE.,'IfcLabel',$,$,$,$,$,.READWRITE.);
#5=IFCSIMPLEPROPERTYTEMPLATE('0AK5C2UpL4$eaac2LszAx$',$,'HasUnderlay','',.P_SINGLEVALUE.,'IfcBoolean',$,$,$,$,$,.READWRITE.);
#6=IFCSIMPLEPROPERTYTEMPLATE('2j2ZEZR8X5tONm7kli5hM6',$,'HasLinework','',.P_SINGLEVALUE.,'IfcBoolean',$,$,$,$,$,.READWRITE.);
#7=IFCSIMPLEPROPERTYTEMPLATE('1ttChRysH9UuEX2FeMj5Hu',$,'HasAnnotation','',.P_SINGLEVALUE.,'IfcBoolean',$,$,$,$,$,.READWRITE.);
#8=IFCSIMPLEPROPERTYTEMPLATE('2NPPxuABv1huDTVh32TFgw',$,'GlobalReferencing','',.P_SINGLEVALUE.,'IfcBoolean',$,$,$,$,$,.READWRITE.);
#9=IFCSIMPLEPROPERTYTEMPLATE('10hT_1zrzEbRRKMXYAWvtD',$,'Metadata','',.P_SINGLEVALUE.,'IfcText',$,$,$,$,$,.READWRITE.);
#10=IFCSIMPLEPROPERTYTEMPLATE('3Z0BXPSG5CWgtI33ioV7aj',$,'Include','',.P_SINGLEVALUE.,'IfcText',$,$,$,$,$,.READWRITE.);
#11=IFCSIMPLEPROPERTYTEMPLATE('1RVts_g3PAw98PJA2yL3bO',$,'Exclude','',.P_SINGLEVALUE.,'IfcText',$,$,$,$,$,.READWRITE.);
#12=IFCSIMPLEPROPERTYTEMPLATE('0c1$8NpYDEaBiJrj16jHIo',$,'Stylesheet','',.P_SINGLEVALUE.,'IfcURIReference',$,$,$,$,$,.READWRITE.);
#13=IFCSIMPLEPROPERTYTEMPLATE('3mRF52q81FQB$h4oTh7M45',$,'Markers','',.P_SINGLEVALUE.,'IfcURIReference',$,$,$,$,$,.READWRITE.);
#14=IFCSIMPLEPROPERTYTEMPLATE('1rhr_0N3LDtuORcEJP0KXM',$,'Symbols','',.P_SINGLEVALUE.,'IfcURIReference',$,$,$,$,$,.READWRITE.);
#15=IFCSIMPLEPROPERTYTEMPLATE('2sHDBuW7P4TROy$hL2w7ct',$,'Patterns','',.P_SINGLEVALUE.,'IfcURIReference',$,$,$,$,$,.READWRITE.);
ENDSEC;
END-ISO-10303-21;
@@ -0,0 +1,22 @@
ISO-10303-21;
HEADER;
FILE_DESCRIPTION((),'2;1');
FILE_NAME('Psets_BBIM_Annotation.ifc','2020-01-01T00:00:00',(),(),'Psets_BBIM_Annotation','Psets_BBIM_Annotation',$);
FILE_SCHEMA(('IFC4'));
ENDSEC;
DATA;
#1=IFCPROPERTYSETTEMPLATE('3VuPUwdCD2Qx3XDDRs0R1N',$,'EPset_Annotation','',.PSET_OCCURRENCEDRIVEN.,'IfcAnnotation',(#2,#3,#4));
#2=IFCSIMPLEPROPERTYTEMPLATE('2P7JN79n96Q9pElZ83LKe4',$,'ZIndex','',.P_SINGLEVALUE.,'IfcInteger',$,$,$,$,$,.READWRITE.);
#3=IFCSIMPLEPROPERTYTEMPLATE('1Wpx_r2xj1_9w5JpI0QRJy',$,'Symbol','',.P_SINGLEVALUE.,'IfcLabel',$,$,$,$,$,.READWRITE.);
#4=IFCSIMPLEPROPERTYTEMPLATE('3q0oxMUKP47vZ4jnyG$dDb',$,'Classes','Classes separarated by spaces that end up in classes for this element in svg. Can be used to specify the text font size: small - 1.8mm; regular - 2.5mm; large - 3.5mm; header - 5mm; title - 7mm. By default regular size is used.',.P_SINGLEVALUE.,'IfcLabel',$,$,$,$,$,.READWRITE.);
#5=IFCPROPERTYSETTEMPLATE('0iKwujnQL9IevVQato8f7Z',$,'BBIM_Batting','',.PSET_OCCURRENCEDRIVEN.,'IfcAnnotation',(#6,#7));
#6=IFCSIMPLEPROPERTYTEMPLATE('0t2LEesGT1QRQtrIZUAR8L',$,'Thickness','Batting thickness',.P_SINGLEVALUE.,'IfcPositiveLengthMeasure',$,$,$,$,$,.READWRITE.);
#7=IFCSIMPLEPROPERTYTEMPLATE('082PndS6v2kBOiJoSboMnh',$,'Reverse pattern direction','Reverse batting pattern (swap starting and ending points)',.P_SINGLEVALUE.,'IfcBoolean',$,$,$,$,$,.READWRITE.);
#8=IFCPROPERTYSETTEMPLATE('1Dx2EiZnP67xotInXpwz90',$,'BBIM_Section','',.PSET_OCCURRENCEDRIVEN.,'IfcAnnotation',(#9,#10,#11,#12,#13));
#9=IFCSIMPLEPROPERTYTEMPLATE('2a_9s8spHDc9dZHtgg71XL',$,'ShowStartArrow','Display start arrow.',.P_SINGLEVALUE.,'IfcBoolean',$,$,$,$,$,.READWRITE.);
#10=IFCSIMPLEPROPERTYTEMPLATE('3i6SH_GbT7zhKea$wVE56A',$,'StartArrowSymbol','Custom symbol for the start of the section marker arrow. Need to make sure it''s present in "symbols.svg".',.P_SINGLEVALUE.,'IfcLabel',$,$,$,$,$,.READWRITE.);
#11=IFCSIMPLEPROPERTYTEMPLATE('1DtsPn5a9FG8$zXHDDMavY',$,'ShowEndArrow','Display end arrow.',.P_SINGLEVALUE.,'IfcBoolean',$,$,$,$,$,.READWRITE.);
#12=IFCSIMPLEPROPERTYTEMPLATE('2$6U0mLI9AiPRWeBabdY3u',$,'EndArrowSymbol','Custom symbol for the end of the section marker arrow. Need to make sure it''s present in "symbols.svg".',.P_SINGLEVALUE.,'IfcLabel',$,$,$,$,$,.READWRITE.);
#13=IFCSIMPLEPROPERTYTEMPLATE('1naFqntIL7igCY7hCaE7kq',$,'HasConnectedSectionLine','Connect or disconnect section markers with line (by default = True).',.P_SINGLEVALUE.,'IfcBoolean',$,$,$,$,$,.READWRITE.);
ENDSEC;
END-ISO-10303-21;
@@ -19,16 +19,41 @@
*/
* { stroke-linecap: round; stroke-linejoin: round; }
text { fill: black; stroke: none; }
text, tspan { /* 2.5mm */ fill: black; stroke: none; font-family: 'OpenGost Type B TT', 'DejaVu Sans Condensed', 'Liberation Sans', 'Arial Narrow', 'Arial'; font-size: 4.13px; }
.cut { fill: black; stroke: black; stroke-linecap: 'round'; stroke-width: 0.35; fill-rule: evenodd; }
.projection { fill: white; stroke: black; stroke-linecap: 'round'; stroke-width: 0.25; }
.annotation { fill: none; stroke: black; stroke-linecap: 'round'; stroke-width: 0.25; }
.hidden { stroke-dasharray: 3, 2; }
.solid {}
.leader { marker-end: url(#leader-marker); }
.stair { marker-start: url(#stair-marker-start); marker-end: url(#stair-marker-end); }
.break { fill: white; }
.breakline { fill: none; stroke: black; stroke-linecap: 'round'; stroke-width: 0.25; marker-mid: url(#breakline-marker); }
.IfcAnnotation { fill: none; stroke: black; stroke-linecap: 'round'; stroke-width: 0.25; }
.IfcGeographicElement { fill: none; stroke: black; stroke-linecap: 'round'; stroke-width: 1; }
.PredefinedType-LINEWORK { stroke: black; stroke-width: 0.25; }
.PredefinedType-BACKGROUND { stroke: black; stroke-width: 0.18; }
.PredefinedType-GRID { marker-start: url(#grid-marker); marker-end: url(#grid-marker); }
.PredefinedType-SECTION { stroke-dasharray: 12.5, 3, 3, 3; }
.PredefinedType-SECTIONLEVEL { marker-start: url(#section-level-marker); stroke-dasharray: 12.5, 3, 3, 3; }
.PredefinedType-PLANLEVEL { marker-end: url(#plan-level-marker); }
.PredefinedType-DIMENSION { marker-start: url(#dimension-marker-start); marker-end: url(#dimension-marker-end); }
.PredefinedType-ANGLE { marker-start: url(#angle-marker-start); marker-end: url(#angle-marker-end); }
.PredefinedType-RADIUS { marker-end: url(#fall-marker-end); }
.PredefinedType-FALL { marker-end: url(#radius-marker-end); }
.PredefinedType-SLOPEANGLE { marker-end: url(#radius-marker-end); }
.PredefinedType-SLOPEPERCENT { marker-end: url(#radius-marker-end); }
.PredefinedType-SLOPEFRACTION { marker-end: url(#radius-marker-end); }
.PredefinedType-DIAMETER { marker-start: url(#diameter-marker-start); marker-end: url(#diameter-marker-end); }
.PredefinedType-HIDDENLINE { stroke-dasharray: 3, 2; }
.PredefinedType-STAIRARROW { marker-start: url(#stair-marker-start); marker-end: url(#stair-marker-end); }
.PredefinedType-BOUNDARY { fill: none; stroke: red; stroke-width: 1; stroke-dasharray: 12, 4, 3, 4, 3, 4; }
.PredefinedType-SEALANT { fill: url(#crosshatch1); stroke-width: 0.25; }
.PredefinedType-FILLAREA { fill: white; stroke: black; }
.PredefinedType-BREAKLINE { fill: none; stroke: black; stroke-width: 0.25; marker-mid: url(#breakline-marker); }
.PredefinedType-TEXT { fill: black; stroke: none; }
path.PredefinedType-TEXTLEADER { marker-end: url(#leader-marker); }
text.PredefinedType-TEXTLEADER, tspan.PredefinedType-TEXTLEADER { fill: black; stroke: none; }
text.title, tspan.title { /* 7mm */ font-size: 11.55px; }
text.header, tspan.header { /* 5mm */ font-size: 8.25px; }
text.large, tspan.large { /* 3.5mm */ font-size: 5.78px; }
text.regular, tspan.regular { /* 2.5mm */ font-size: 4.13px; }
text.small, tspan.small { /* 1.8mm */ font-size: 2.97px; }
text.GRID, tspan.GRID { /* 5mm */ font-size: 8.25px; }
.material-blank { fill: white; }
.material-diagonal1 { fill: url(#diagonal1); }
.material-diagonal2 { fill: url(#diagonal2); }
@@ -44,5 +69,9 @@ text { fill: black; stroke: none; }
.material-honeycomb { fill: url(#honeycomb); }
.material-sand { fill: url(#sand); }
.material-concrete { fill: url(#concrete); stroke-width: 0.5; }
.material-boundary { fill: none; stroke: red; stroke-width: 1; stroke-dasharray: 12,4,3,4,3,4; }
.IfcSpace { fill: none; stroke: none; }
.PredefinedType-STUD { stroke: black; stroke-width: 1; }
.PredefinedType-WOOD { fill: url(#wood); stroke: black; stroke-width: 0.5; }
.PredefinedType-STEEL { fill: url(#steel); stroke: black; stroke-width: 0.5; }
.PredefinedType-CONCRETE { fill: url(#concrete); stroke: black; stroke-width: 0.5; }
.PredefinedType-PLASTERBOARD { fill: url(#sand); stroke: black; stroke-width: 0.25; }
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<svg baseProfile="full" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Tip: https://svg-path-visualizer.netlify.app/ -->
<!-- Tip: https://www.svgviewer.dev/ -->
<marker id="eng-dimension-marker-start" markerHeight="14" markerWidth="11" orient="auto" refX="1" refY="7">
<g>
<path d="M 11 3.5 L 11 10.5 L 1 7" class="annotation" style="fill:black;" />
@@ -12,6 +14,41 @@
<path d="M 10 0 L 10 14" class="annotation" style="stroke-width:1;" />
</g>
</marker>
<marker id="radius-marker-end" markerHeight="14" markerWidth="11" orient="auto" refX="10" refY="7">
<g>
<path d="M 0 3.5 L 0 10.5 L 10 7" class="annotation" style="fill:black;" />
</g>
</marker>
<!-- same as for the radius -->
<marker id="fall-marker-end" markerHeight="14" markerWidth="11" orient="auto" refX="10" refY="7">
<g>
<path d="M 0 3.5 L 0 10.5 L 10 7" class="annotation" style="fill:black;" />
</g>
</marker>
<marker id="angle-marker-start" markerHeight="14" markerWidth="11" orient="auto" refX="1" refY="7">
<g>
<path d="M 11 3.5 L 11 10.5 L 1 7" class="annotation" style="fill:black;" />
<path d="M 1 0 L 1 14" class="annotation" style="stroke-width:1;" />
</g>
</marker>
<marker id="angle-marker-end" markerHeight="14" markerWidth="11" orient="auto" refX="10" refY="7">
<g>
<path d="M 0 3.5 L 0 10.5 L 10 7" class="annotation" style="fill:black;" />
<path d="M 10 0 L 10 14" class="annotation" style="stroke-width:1;" />
</g>
</marker>
<marker id="diameter-marker-start" markerHeight="14" markerWidth="11" orient="auto" refX="1" refY="7">
<g>
<path d="M 11 3.5 L 11 10.5 L 1 7" class="annotation" style="fill:black;" />
<path d="M 1 0 L 1 14" class="annotation" style="stroke-width:1;" />
</g>
</marker>
<marker id="diameter-marker-end" markerHeight="14" markerWidth="11" orient="auto" refX="10" refY="7">
<g>
<path d="M 0 3.5 L 0 10.5 L 10 7" class="annotation" style="fill:black;" />
<path d="M 10 0 L 10 14" class="annotation" style="stroke-width:1;" />
</g>
</marker>
<marker id="dimension-marker-start" markerHeight="30" markerWidth="20" refX="10" refY="15" orient="auto">
<g>
<path d="M 0 15 L 20 15" class="annotation" style="stroke-width:1;" />
@@ -53,7 +90,7 @@
<path d="M 0 1 L 90 1" class="annotation" style="stroke-width:1;" />
</g>
</marker>
<marker id="breakline-marker" markerHeight="20" markerWidth="15" refX="7.5" refY="10">
<marker id="breakline-marker" markerHeight="20" markerWidth="15" refX="7.5" refY="10" orient="auto">
<g>
<path d="M 0 10 L 5 20 L 7.5 10" class="annotation" style="stroke-width:1; fill: white;" />
<path d="M 7.5 10 L 10 0 L 15 10" class="annotation" style="stroke-width:1; fill: white;" />

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

@@ -3,6 +3,10 @@
<pattern id="demolish" width="1" height="1" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse">
<line x1="0" y1="0" x2="0" y2="1" style="stroke:red; stroke-width:0.25" />
</pattern>
<pattern id="steel" width="3" height="1" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse">
<line x1="0" y1="0" x2="0" y2="1" style="stroke:black; stroke-width:0.25" />
<line x1="1" y1="0" x2="1" y2="1" style="stroke:black; stroke-width:0.25" />
</pattern>
<pattern id="diagonal1" width="1" height="1" patternTransform="rotate(45 0 0)" patternUnits="userSpaceOnUse">
<line x1="0" y1="0" x2="0" y2="1" style="stroke:black; stroke-width:0.25" />
</pattern>
@@ -80,6 +84,9 @@
<path d="M 1.25,2.165 L 2.5,4.33 L 5,4.33 L 6.25,2.165 L 5,0 L 2.5,0 L 1.25,2.165" style="stroke:black;stroke-width:0.25;stroke-linecap:round;fill:none" />
<path d="M 6.25,2.165 L 7.5,2.165" style="stroke:black;stroke-width:0.25;stroke-linecap:round" />
</pattern>
<pattern id="wood" width="50" height="50" patternUnits="userSpaceOnUse">
<path style="fill:none; stroke: black; stroke-width:0.25;" d="M 49.649999,1.3460737 A 69.019995,69.019995 0 0 0 48.653938,0.34999949 M 49.649999,4.9389583 A 66.554994,66.554994 0 0 0 45.06105,0.34999949 M 49.649999,8.6983527 A 64.089999,64.089999 0 0 0 41.301656,0.34999949 M 49.649999,12.675003 A 61.624998,61.624998 0 0 0 37.325,0.34999949 M 49.649999,16.948067 A 59.159997,59.159997 0 0 0 33.05192,0.34999949 M 49.649999,21.652972 A 56.694997,56.694997 0 0 0 28.347017,0.34999949 M 49.649999,27.057906 A 54.229999,54.229999 0 0 0 22.942096,0.34999949 M 49.649999,33.866298 A 51.764998,51.764998 0 0 0 16.1337,0.34999949 M 49.649999,49.649989 A 49.299997,49.299997 0 0 0 0.34999949,0.34999949 M 47.185,49.649989 A 46.834999,46.834999 0 0 0 0.34999949,2.8149951 M 44.72,49.649989 A 44.369998,44.369998 0 0 0 0.34999949,5.2799906 M 42.254999,49.649989 A 41.904997,41.904997 0 0 0 0.34999949,7.7450123 M 39.790001,49.649989 A 39.439999,39.439999 0 0 0 0.34999949,10.210008 M 37.325,49.649989 A 36.974998,36.974998 0 0 0 0.34999949,12.675003 M 34.859999,49.649989 A 34.509998,34.509998 0 0 0 0.34999949,15.139998 M 32.395001,49.649989 A 32.044999,32.044999 0 0 0 0.34999949,17.604994 M 29.93,49.649989 A 29.579999,29.579999 0 0 0 0.34999949,20.069989 M 27.465,49.649989 A 27.114998,27.114998 0 0 0 0.34999949,22.535011 M 24.999997,49.649989 A 24.649999,24.649999 0 0 0 0.34999949,25.000007 M 22.534998,49.649989 A 22.184999,22.184999 0 0 0 0.34999949,27.465003 M 20.069998,49.649989 A 19.719999,19.719999 0 0 0 0.34999949,29.929999 M 17.604998,49.649989 A 17.254999,17.254999 0 0 0 0.34999949,32.394994 M 15.139998,49.649989 A 14.789999,14.789999 0 0 0 0.34999949,34.85999 M 12.674999,49.649989 A 12.325,12.325 0 0 0 0.34999949,37.325011 M 10.209999,49.649989 A 9.8599994,9.8599994 0 0 0 0.34999949,39.790007 M 7.7449994,49.649989 A 7.3949999,7.3949999 0 0 0 0.34999949,42.255002 M 5.2799992,49.649989 A 4.9299997,4.9299997 0 0 0 0.34999949,44.719998 M 2.8149995,49.649989 A 2.4649999,2.4649999 0 0 0 0.34999949,47.184993 M 0.34999949,49.649989 H 3.8010003 M 0.34999949,49.649989 H 3.8010003 M 0.34999949,49.649989 H 3.8010003" />
</pattern>
<pattern id="sand" width="50" height="50" patternUnits="userSpaceOnUse">
<path style="fill: white;" d="M 0 0 50 0 50 50 0 50" />
<path

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 67 KiB

@@ -5,6 +5,22 @@
</g>
<g id="door-tag">
<circle cy="1.75" r="5" fill="white" stroke="black" style="stroke-width: 0.25;" />
<line x1="-5" y1="1.75" x2="5" y2="1.75" style="stroke:black; stroke-width: 0.25;" />
<text text-anchor="middle" dominant-baseline="middle" data-type="text-template"></text>
<line x1="-5" y1="1.75" x2="5" y2="1.75" style="stroke: black; stroke-width: 0.25;" />
<text y="5" text-anchor="middle" dominant-baseline="middle" data-type="text-template"></text>
</g>
<g id="elevation-arrow">
<path style="fill: black;" d="M -7.07106 0 0 -7.07106 7.07106 0" />
</g>
<g id="elevation-tag">
<circle r="5" fill="white" stroke="black" style="stroke-width: 0.25;" />
<line x1="-5" y1="0" x2="5" y2="0" style="stroke: black; stroke-width: 0.25;" />
</g>
<g id="section-arrow">
<path style="fill: black;" d="M -7.07106 0 0 -7.07106 7.07106 0" />
</g>
<g id="section-tag">
<circle r="5" fill="white" stroke="black" style="stroke-width: 0.25;" />
<line x1="-5" y1="0" x2="5" y2="0" style="stroke: black; stroke-width: 0.25;" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 572 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Some files were not shown because too many files have changed in this diff Show More