Compare commits

...

809 Commits

Author SHA1 Message Date
Ryan Schultz c62ed5d3b6 shift+click, to quickly switch the drawing view without turning anything on or off in the scene.
as discussed: https://community.osarch.org/discussion/2196/quick-way-to-switch-between-drawing-views#latest
2024-08-04 10:00:22 -05:00
Ryan Schultz ffb6c82541 snapshot 2024-08-04 09:40:34 -05:00
Ryan Schultz a9e366b238 Assure text 'wraps' in CloseError 2024-08-03 14:30:06 -05:00
Ryan Schultz 1ca0dfb1e0 Make sure drawings are loaded when calling bim.activate_drawing from sheets UI.
related: c11ba23a3d
2024-08-03 14:09:15 -05:00
Ryan Schultz c11ba23a3d Fix #3728 - Be able to bim.activate_drawing a drawing listed in the sheets UI, as well. 2024-08-03 11:01:31 -05:00
Dion Moult 556c769b40 Sun position add-on is now detected in the current session instead of needing to restart Blender 2024-08-03 23:21:31 +10:00
Dion Moult 78173dd546 Add basic tests for new web module 2024-08-03 23:12:21 +10:00
Dion Moult 2196c16097 Fix failing georeference and spatial core/tool/bim tests and clean dead code 2024-08-03 23:08:35 +10:00
Dion Moult 7af5db7cd4 Collector now unassigns from old ifc collections 2024-08-03 22:04:38 +10:00
Dion Moult c58672cc25 Allow selecting a container object when changing spatial container 2024-08-03 19:29:06 +10:00
Dion Moult 85e022d76e IfcTester now groups results by types to make long failure lists more useful 2024-08-02 23:58:01 +10:00
Andrej730 872f40933f remove Python 3.9 from bbim makefile since a31051a93 2024-08-02 18:54:37 +05:00
Andrej730 4491018f5e fix tool surveyor test 2024-08-02 18:54:37 +05:00
Andrej730 a21c440b5b fix tool geometry tests 2024-08-02 18:54:37 +05:00
Andrej730 143e094db8 assign default container on assigning IfcAnnotation class
Currently if you create a IfcAnnotation it might just get lost as it's not assigned anywhere. Also noticed this since previously we allowed using bim.add_reference_image without any specific drawings.
2024-08-02 18:54:37 +05:00
Andrej730 94e9e945d7 fix system/qto tool tests after e6ac012 2024-08-02 18:54:36 +05:00
Andrej730 5e56115050 typing 2024-08-02 18:54:36 +05:00
Andrej730 1ad654aab3 Fix Ifc tool tests after #4843 and unlinking changes 2024-08-02 18:54:36 +05:00
Andrej730 596ffb093b dev environment script - keep it possible to run the script without any changes
by default it assumes it's executed from ifcopenshell repo directory
2024-08-02 18:54:36 +05:00
Andrej730 3576362fd8 blenderbim make test - run all tests but return error code at the end 2024-08-02 18:11:25 +05:00
Andrej730 2c949bb39a blenderbim "make test" - run tool and bim tests even if some core tests failed 2024-08-02 17:20:29 +05:00
Andrej730 34faa0617b fix running core tests on python 3.10 2024-08-02 17:05:28 +05:00
Dion Moult 15f6b3803f Fix #4986. IfcTester now determines whether a spec is relevant to the ifc version 2024-08-02 22:02:56 +10:00
Andrej730 8514a426bb fix potential blenderbim issues for python 3.10
tomllib was added to python 3.11, tomli can be used for the previous versions.

Though it is a bit questionable since internally Blender is using just tomllib and because of that I'm not sure anymore if Blender still supports Python 3.10.
2024-08-02 16:00:49 +05:00
Andrej730 2062324294 prevent issues importing blenderbim for core test
initialize_bbim_semver was possible breaking on running core tests if system python was missing tomllib
2024-08-02 16:00:49 +05:00
Dion Moult 90c6218210 Fix #5115. Members (e.g. stringers) can now have a stair modifier applied as they may be used to support stairs 2024-08-02 16:34:30 +10:00
Dion Moult 321bb7178d See #5110. Minor fix when appending linked elements. 2024-08-02 16:29:14 +10:00
Dion Moult 42dda0a07a Run black on light 2024-08-02 16:00:45 +10:00
Dion Moult adb17d91f9 Dedicated doc section for blend open/save issue 2024-08-02 15:57:17 +10:00
Dion Moult 646cc59687 Update live install script on linux/mac and merge system support docs into dev setup docs 2024-08-02 15:57:17 +10:00
Dion Moult 38759348cd Document new install location on 4.2 2024-08-02 15:57:17 +10:00
Dion Moult ff44f4f395 Show warning if a blend file is used alongside an ifc 2024-08-02 15:57:17 +10:00
Dion Moult a31051a937 Drop py39 from build matrix for BBIM as we now only support Blender >=4.2 2024-08-02 15:57:17 +10:00
Chirag Singh 5cfd69f337 Merge branch 'v0.8.0' of https://github.com/IfcOpenShell/IfcOpenShell into v0.8.0 2024-08-02 11:23:09 +05:30
Chirag Singh f4100f7951 Added HDR support 2024-08-02 11:22:40 +05:30
Thomas Krijnen 785d5118d0 installation.rst - minor enhancement 2024-08-02 05:02:20 +02:00
Thomas Krijnen fddd85817a installation.rst - minor doc enhancements 2024-08-02 04:59:09 +02:00
Thomas Krijnen a689fc6377 Consistency TopExp_Explorer::Current() 2024-08-02 04:50:06 +02:00
Augustin Trancart 8e5a7ed24e improve json lib discovery for cmake 2024-08-02 03:31:17 +02:00
Dion Moult 788217c73c Use loader to get name instead of hardcoding when loading IFCs. See #4517. 2024-08-02 09:31:15 +10:00
Blender Defender 1abc3a1422 feat: Update the patch UI of ResetAbsoluteCoordinates
Instead of specifying parameters `a`, `b`, `c` and `d`, more meaningful parameters have been introduced (`threshold`, `automatic_offset_point`, `x`, `y` and `z`), which allow to do the same operations in a more understandable way.
2024-08-02 08:26:14 +10:00
Richard Brice c31c34b7d2 reimplements piecewise_function using PIMPL idiom
PIMPL idiom allows implementaiton of piecewise_function to evolve without envoking systemwide recompile (unless the class definition changes)
2024-08-01 12:34:49 -07:00
Richard Brice b22ecba179 Implements mutually exclusive access to mapping cache with a mutex 2024-08-01 07:15:22 -07:00
Chirag Singh 22bc98b48b Merge branch 'v0.8.0' of https://github.com/IfcOpenShell/IfcOpenShell into v0.8.0 2024-08-01 19:29:48 +05:30
Chirag Singh cf70026570 Gensky corrected and output in .tiff format 2024-08-01 19:29:02 +05:30
Andrej730 3c4a865e0b ci.yml - also run tests for other ifcopenshell packages 2024-08-01 18:01:59 +05:00
Andrej730 8523bb317a bcf, bsdd - add "make test" 2024-08-01 18:01:59 +05:00
Andrej730 4b00b268c0 fix core geometry trests after c4ae957 and 698c648 2024-08-01 18:01:58 +05:00
Andrej730 f0ca34d107 fix core project tests after 0dc084d and e3cb811 2024-08-01 18:01:58 +05:00
Andrej730 3834ecb06a fix core root test after e3cb811 2024-08-01 18:01:58 +05:00
Andrej730 047c9e3ee9 fix core aggregate module test after 6eb3c48 2024-08-01 18:01:58 +05:00
Andrej730 786b796f37 fix breaking bim.activate_model for new collections structure 2024-08-01 18:01:58 +05:00
Andrej730 3fd8be72c2 refresh_ui_data note 2024-08-01 18:01:58 +05:00
Andrej730 cb80081473 fix covering test and fix bug adding coverings in non-meters projects
Noticed that adding a covering in millimeters project didn't worked - the reason was that shapely was using tolerance in ifc project units when get_obj_base_points was returning points in si (blender always operates in meters internally).
I've changed get_obj_base_points to return data in project units and get_bmesh_from_polygon to convert it back to meters for Blender.
It's probably would be better to always operate in si until we need to save data to ifc but I'm not that familiar with that module to just change it everywhere.

Ping @maxfb87 just in case.
2024-08-01 18:01:58 +05:00
Andrej730 5ac84e2be7 covering - more detailed poll messages 2024-08-01 18:01:58 +05:00
Andrej730 c8466e0606 typing 2024-08-01 18:01:58 +05:00
Thomas Krijnen db5167bbaf Prevent infinite recursion 2024-08-01 07:59:23 +02:00
Thomas Krijnen 7d6e26bfd5 Add revolve as top-level item in occt kernel 2024-08-01 07:48:42 +02:00
Thomas Krijnen 2fd339ac6b Hack/workaround for #5064 2024-08-01 07:48:28 +02:00
Dion Moult 6f6dc08696 Minor typo fixes 2024-08-01 14:58:23 +10:00
Andrej730 6cb063ebd2 fix bim drawing module test after 47704b1 2024-07-31 19:00:34 +05:00
Andrej730 fb95e3eb51 fix enabling sverchok as legacy addon on Blender 4.2
It was failing when BBIM is installed as an extension
2024-07-31 19:00:34 +05:00
Andrej730 17a061f917 fix bim test after e6ac012
when Types collection was renamed to IfcTypeProduct
2024-07-31 19:00:34 +05:00
Andrej730 51db65b868 fix resource bim tests after c399eb2
IfcLaborResource doesn't actually support IfcQuantityArea quantities
2024-07-31 19:00:34 +05:00
Andrej730 faab9e04a3 fix resource bim tests after 1a4e467
operator prop was deprecated a long time ago in e2d4a3a
2024-07-31 19:00:34 +05:00
Andrej730 bea92455dd clean up bim tests from trailing spaces 2024-07-31 19:00:34 +05:00
Andrej730 6be1b80a82 fix container operators after a9a4b0c + mention a limitation
If you would select container1 + obj1 with intention to copy obj1 to container1 - running bim.copy_to_container would also copy container1.
Similar issue for referencing/dereferncing structures in other structures in ifc4x3.
2024-07-31 19:00:34 +05:00
Andrej730 2927eadada Display referenced structured elements during container edit for more responsive ui
Before - https://imgur.com/a/m5qtDUn
After - https://imgur.com/a/TFlUNTa
2024-07-31 19:00:33 +05:00
Andrej730 4c5e90dc77 fix bim tests after collections no longer represent spatial hierarchy 2024-07-31 19:00:33 +05:00
Andrej730 f860973172 fix spatial module bim tests after a9a4b0c 2024-07-31 19:00:33 +05:00
Andrej730 94ed0cd59c fix bim.assign_container uses after a9a4b0c + add TODOs 2024-07-31 19:00:33 +05:00
Andrej730 93ea1f98ac fix qto tests after 8c3d10a 2024-07-31 19:00:33 +05:00
Andrej730 b68a92f251 remove bim.assign_objects_base_qto from tests (removed in 8c3d10a) 2024-07-31 19:00:33 +05:00
Andrej730 902da2e720 remove bim.pie_update_container
as we no longer rely on collections for container assignment
2024-07-31 19:00:33 +05:00
Andrej730 d384aaeb9c fix tests after a9a4b0c 2024-07-31 19:00:33 +05:00
Andrej730 133494af97 remove bimtester from bbim (related to 7157590) 2024-07-31 19:00:32 +05:00
Andrej730 64fc9462b6 fix bim attribute tests after 9122f00 2024-07-31 19:00:32 +05:00
Andrej730 3d86e5fff3 fix bim geometry tests after fccf56d 2024-07-31 19:00:32 +05:00
Andrej730 a24bb069aa fix bim tests after changes in quantities calculations 2024-07-31 19:00:32 +05:00
Andrej730 159355d63a typing 2024-07-31 19:00:32 +05:00
Andrej730 598cf4ba79 bim.perform_quantity_take_off description + info message 2024-07-31 19:00:32 +05:00
Andrej730 c86a4c88a9 fix broken search test after 410fff6 2024-07-31 19:00:32 +05:00
Jonathan Gan 6a9e76c2af Documentation: Added getting started documentation for ifcopenshell core (#4965)
* Added getting started documentation for ifcopenshell core

* Apply suggestions from code review

Co-authored-by: Thomas Krijnen <t.krijnen@gmail.com>

* Updated code snippet to use ->as instead of dynamic_cast based on feedback

* Missed out two dynamic casts

* Using preprocessor macros instead of chaining if-else

---------

Co-authored-by: Jonathan Gan <jonathan.gan@inspacion.com>
Co-authored-by: Thomas Krijnen <t.krijnen@gmail.com>
2024-07-31 07:28:25 +10:00
Andrej730 2070071c49 fix bbim builds... 2024-07-30 21:20:14 +05:00
Andrej730 9bbf3bcaba mention supported formats in export window
as currently there is no other ui to indicate that other formats besides .ifc are supported and I guess we just expect users to change extension in the saved filename

https://i.imgur.com/Qa6OlmR.png
2024-07-30 20:47:48 +05:00
Andrej730 0395c0c6c7 fix ifcjson export support #4832
Bumped the version, so Blender would recognize the updated wheel.

Related https://github.com/IFCJSON-Team/IFC2JSON_python/pull/3
2024-07-30 20:47:47 +05:00
Andrej730 a175ec4d28 fix bim tests after d4b055a 2024-07-30 20:46:16 +05:00
Andrej730 139627b6ec fix bim tests after b9f76042b 2024-07-30 20:46:16 +05:00
Andrej730 6f2eb0a116 fix bim tests after a156864 2024-07-30 20:46:16 +05:00
Andrej730 d26561acee fix for bim style module test 2024-07-30 20:46:16 +05:00
Andrej730 de0374bdbd fix error purging unused types in 75f8e75 2024-07-30 20:46:16 +05:00
Ziad-I 51463ab674 fix pid file not there on first run so exception was thrown and not caught
when the user ran the web ui for the first time. the running_pid file was not created yet by the server so it threw an exception due to with open not inside the try block
2024-07-30 18:18:35 +03:00
Dion Moult 6012695cfe Use a tolerance when detecting project norths heuristically 2024-07-30 23:57:54 +10:00
Dion Moult 081b3fcf33 Remove misleading load project button in new project wizard.
Previously there were subtle differences and two ways to load projects which is bad UX.
2024-07-30 23:57:54 +10:00
Dion Moult 27a2c94b4a Fix #5065. Restore "Import IFC" menu item for those wishing to purely work with IFC geometry instead of native ifc 2024-07-30 23:57:54 +10:00
Dion Moult b9f76042bb Remove deprecated export IFC operator ID 2024-07-30 23:57:54 +10:00
Andrej730 e7ef307984 remove redundant indent in bdc5a7a
Co-Authored-By: Adi Shavit <1814800+adishavit@users.noreply.github.com>
2024-07-30 18:56:02 +05:00
Andrej730 1f68e52ac2 black format - exclude 'mvd' and reformat pyproject.toml for readibility 2024-07-30 18:49:10 +05:00
Dion Moult 87dfb75c21 Merge pull request #5103 from IfcOpenShell/webui_drawings
Web UI drawings page
2024-07-30 23:12:04 +10:00
Blender Defender 8afb1b8b30 feat: Display float properties as string properties for more precision in the patch panel
This change affects the following recipes: `OffsetObjectPlacements`, `OffsetStoreyElevations`, `SetFalseOrigin`, `SetRefElevation` and `SetWorldCoordinateSystem`
2024-07-30 23:05:44 +10:00
Blender Defender 5572991a7c style: Run black on geom/occ_utils.py 2024-07-30 23:04:58 +10:00
Blender Defender 653b9288c0 feat: Allow merging multiple ifc projects at once with the MergeProject recipe 2024-07-30 23:04:58 +10:00
Chirag Singh 233b0856af Implemented gensky and fixed executable flag error as mentioned by Manu in #5033 2024-07-30 13:51:20 +05:30
Dion Moult ec29e3d60b Send sigkill not sigterm because aiohttp swallows sigterm and takes a long time
I'm not smart enough to know exactly why
2024-07-30 17:54:28 +10:00
Dion Moult 70bc32b3df Check for PID file prior to connecting to newly started web socket server 2024-07-30 17:28:35 +10:00
Ziad-I ca781655b0 add displaying of svgs in drawings page 2024-07-29 23:35:28 +03:00
Ziad-I 03e2cb70bb remove unnecessary padding 2024-07-29 22:45:35 +03:00
Chirag Singh c7c95e1f9d Implemented gensky (Values Hardcoded) 2024-07-29 23:15:31 +05:30
Chirag Singh b040c5e25b Pulled changes 2024-07-29 23:13:21 +05:30
Richard Brice 60b007d28a Fixes domain of vertical and cant pwf (Issue #5072) 2024-07-29 09:48:15 -07:00
Andrej730 52130a3eb6 fix materials / styles bim tests #4843 2024-07-29 18:53:12 +05:00
Andrej730 5e849d7b81 update core.tool.Material to fix tests 2024-07-29 18:53:12 +05:00
Andrej730 a7a28f613b Fix errors in tests and scripts removing styles
remove_style relies on style_type which is using StylesData to get the enum of it's values and StylesData will fail to load on `material = tool.Ifc.get_object(ifc_file.by_id(style.ifc_definition_id))` as ifc_definition_id was removed but not yet removed as an item from styles ui.

This issue doesn't occur when user is working from UI since StylesData precached when they load styles UI but if they run a script (as we do in bim tests) StylesData is not precached and will be loaded when get_active_style_type() is called leading to errors.
2024-07-29 18:53:12 +05:00
Andrej730 46b3bfecd1 fix issues assigning material sets and material lists 2024-07-29 18:53:12 +05:00
Andrej730 11b62a0fdc fix console errors adding new style and changing it's color
1) As adding new styles means it's not assigned anywhere, there is no need to keep graph up to date.
2) Removed Ifc Operator super class from couple operators that do not write ifc data
3) Moved common code to tool.Style
2024-07-29 18:53:11 +05:00
Andrej730 732bb93826 fix duplicated lines in 2575348 2024-07-29 18:53:11 +05:00
Andrej730 a0bda1afd3 typing 2024-07-29 18:53:11 +05:00
Dion Moult e0790601df Black 2024-07-29 22:38:55 +10:00
Dion Moult a9a4b0ccf0 Deprecate "duplicate" spatial tree browser in favour of regular object selection 2024-07-29 22:29:44 +10:00
Blender Defender f8848051ca style: Run black formatter on spatial/ui.py 2024-07-29 21:37:29 +10:00
Blender Defender b81031eecf fix: Remove the "animatable" option from the "engine" and "format" property in BIMFMProperties 2024-07-29 21:37:29 +10:00
Blender Defender 95a7ea8dce refactor: Create property group MultipleFileSelect
To easier create and display properties that allow one or more files as input, a `MultipleFileSelect` property group has been extracted, together with an operator for selecting the files and the code for displaying the property.
2024-07-29 21:37:29 +10:00
Dion Moult 98edb5a34c Display the default container in the UI when creating new types 2024-07-29 19:50:21 +10:00
Dion Moult 8ca2a55616 Implement filtered selection in new spatial decomposition panel 2024-07-29 18:09:08 +10:00
Dion Moult 74141bec73 Sort pset names and properties alphabetically
Can't believe it took this long to get around to doing this
2024-07-29 10:43:15 +10:00
Dion Moult f60c4fd3c5 Forgot to commit these files for the georeferencing updates 2024-07-29 10:42:37 +10:00
Ziad-I d9ee3522bc empty panels before adding names 2024-07-28 22:28:20 +03:00
Ziad-I 2538c47d01 fix display of list items 2024-07-28 22:01:13 +03:00
Ziad-I ec3dc71c0e add showing of drawings' and sheets' names 2024-07-28 21:04:16 +03:00
Ziad-I e5edd9a34d add retrieving drawings data from blender to web ui 2024-07-28 15:09:55 +03:00
Ziad-I f72359918d use blenderbim version instead of blender version 2024-07-27 22:12:14 +03:00
Kurt Battisti dfd505a794 Fix. Docs Georeferencing URL (#5096)
use users/advanced/georeferencing.html
2024-07-28 00:14:50 +10:00
Blender Defender 4a311fe4de fix: Remove the "ifc_patch_args" property (#5095)
* fix: Remove the "ifc_patch_args" property

This property has been removed, because patch recipes with arguments other than the boilerplate arguments automatically display these arguments as properties, and patch recipes that don't allow more arguments than the boilerplate arguments fail, if "ifc_patch_args" is not None or "[]". The test cases have been adjusted accordingly.

* style: run the black formatter to fix failing checks
2024-07-27 22:58:48 +10:00
Ziad-I 9d4493e1da add footer to index and gantt page 2024-07-27 15:52:49 +03:00
Andrej730 a1d8fbdbe9 Fix missing materials from sets #5093 #4832
Regression in ifcopenshell 0.8 - missing materials and styles from IfcMaterialProfileSets, IfcMaterialProfileSetUsages, IfcMaterialLayerSet.
2024-07-27 15:38:22 +05:00
Andrej730 952abde48e fix console errors related to material rename from ui
1) update_material_name was triggered for categories and failed since ifc id in that case = 0
2) update_material_name was triggered for materials when they were still incomplete and ifc id was still 0
3) moved setting material.name before settings ifc_id to avoid triggering unnecessary changes in ifc
2024-07-27 15:24:05 +05:00
Andrej730 168718063f fix regression #5092 after be7661a83 2024-07-27 15:24:01 +05:00
Dion Moult 4abcbbb4f9 Georeferencing calculator can now calculate blender offsets too 2024-07-27 19:54:12 +10:00
Dion Moult 1ac1b289c1 Map coords always visualise using map units, visualise IFC local origin, and don't show blender coords if no blender offset 2024-07-27 19:53:45 +10:00
Ziad-I c25173aa12 add event listeners and joining of room in drawings page 2024-07-26 22:43:10 +03:00
Andrej730 ea8d303883 fix some test-bim errors in Blender 4.2 2024-07-26 21:23:39 +05:00
Ziad-I 9d79337fa7 edit drawings html/css/js 2024-07-26 17:29:39 +03:00
Blender Defender 82a6ddb01c feat: Make sql_type an enum property in the Ifc2Sql recipe
Since there is a limited number of choices, a string property wouldn't be very helpful. Use a dynamic enum property (which is adjusted according to which types of SQL are available) instead.
2024-07-26 23:35:02 +10:00
Blender Defender a7152bdef0 feat: Convert argument names into prettier looking property names in the IFC Patch Panel
Inspired by #4721
2024-07-26 23:29:41 +10:00
Andrej730 6484a529b0 black format 2024-07-26 18:29:18 +05:00
Andrej730 6e1e653ceb fix tests to use release version of ifc4x3 (ci was failing) 2024-07-26 16:29:46 +05:00
Andrej730 0488e4cccb bcfp numpy 2.0+ support #5080
`np.float_` is deprecated, it was just an alias for `np.float64`
2024-07-26 16:29:26 +05:00
Andrej730 3cf92fd508 bsddclassification - remove description prop as unused 2024-07-26 16:29:26 +05:00
Andrej730 fb2bb7554e bsdd - add buttons to open URIs in browser
Examples:
- https://i.imgur.com/zSvU9vp.png
- https://imgur.com/a/WkbTiVa
2024-07-26 16:29:26 +05:00
Andrej730 be7661a83b remove duplicated operator bim.open_webbrowser
it did exactly the same as bim.open_uri
2024-07-26 16:29:25 +05:00
Andrej730 9684e21d93 bsdd - hide domain selection operator for the active domain
Example - https://imgur.com/a/SkpECro
2024-07-26 16:29:25 +05:00
Andrej730 ee5c401823 bsdd - expose bsdd props descriptions to ui
Example - https://imgur.com/a/xUUeuF5
2024-07-26 16:29:25 +05:00
Andrej730 4aa3ffb765 bsdd - check keyword length only in tool
just to make it more straightforward and remove unused output
2024-07-26 16:29:25 +05:00
Dion Moult c9affcc622 Update README.md 2024-07-26 20:09:26 +10:00
Dion Moult 153a71f91e Distribute IfcConvert on GH actions 2024-07-26 20:04:04 +10:00
Dion Moult ae7b1bb9b4 Bump IOS 2024-07-26 20:03:36 +10:00
Dion Moult 6f70196a6c Make IfcConvert downloads also come consistently from github releases 2024-07-26 20:03:24 +10:00
Blender Defender 228bbc30ad refactor: Update code comments and docstrings 2024-07-26 19:28:10 +10:00
Blender Defender f83a7ac730 feat: Sort the available length units numerically
Length units are now sorted ascending by the value the prefix represents, i.e. METER is listed before KILOMETER, ...
2024-07-26 19:28:10 +10:00
Blender Defender fad4ea82a7 refactor: Update the type annotation in Migrate.py to be a literal 2024-07-26 19:28:10 +10:00
Blender Defender a252b459a2 refactor: Update the type annotation in ConvertLengthUnit.py to be a literal 2024-07-26 19:28:10 +10:00
Blender Defender 9ac159e0af feat: Parse type "Literal" as enum property in the IFC Patch Panel 2024-07-26 19:28:10 +10:00
Dion Moult 74fbf29d5f Change name of ci-black-formatting.yml 2024-07-26 12:21:11 +10:00
Dion Moult 1fef4c5857 Run black on BBIM 2024-07-26 12:19:21 +10:00
Dion Moult e7b791f4a2 Run black on utils 2024-07-26 12:16:36 +10:00
Dion Moult a6286293d8 Run black on IOS-Python 2024-07-26 12:00:57 +10:00
Ziad-I bddb8d1e56 add initial page layout 2024-07-26 02:19:55 +03:00
Andrej730 d51fa2c5f7 bsdd - info messages with amount of found classes / class props 2024-07-25 18:36:18 +05:00
Andrej730 e4afcc96d1 dev_environment script - echo instead of rem so users could see the instructions 2024-07-25 18:36:18 +05:00
Andrej730 5f94a84616 dev environment script - move username to a separate variable, use current user as default
Want to keep the script working for some users (me 👉👈) just by running it from the repo without any changes.
2024-07-25 18:36:18 +05:00
Andrej730 a883e9f490 bsdd - fix bug adding wrong classification to the project + info messages
1) we were identifying active domain just by name, therefore it would always pick up the first dictionary that has matching name (typically it's the most recent version) even though user selected a different version

2) Previously it would fail if it couldn't find a domain, now it will show an info message.

3) Also added info message when user is trying to add the same classification again, so it will be less confusing.
2024-07-25 18:36:17 +05:00
Andrej730 74db3fcbbe bsdd - show more info about the selected domain
Exposed all stored information to the UI, now it's possible to distinguish between different versions of the same domain:
https://i.imgur.com/6wlSkCP.png
2024-07-25 18:36:17 +05:00
Andrej730 d7b85d1264 bsdd - fix bug when it was always loading preview and inactive domains 2024-07-25 18:36:17 +05:00
Andrej730 455fe740c7 support assigning bsdd classifications in ifc4x3 too 2024-07-25 18:36:17 +05:00
Andrej730 eac4e80ee9 typing 2024-07-25 18:36:17 +05:00
Dion Moult 33e188b321 Visualisation of WCS now takes into account blender session offsets 2024-07-25 23:34:29 +10:00
Blender Defender 59a3c019a4 ci: Move the black formatter workflow to a seperate file 2024-07-25 18:24:31 +05:00
Blender Defender 30ab2f1e48 ci: Add black formatter to ci.yml
Check, whether the files are formatted properly using the black formatter on push and pull requests.
2024-07-25 18:24:31 +05:00
Dion Moult aae160b568 Don't clone in windows dev setup, also don't use appdata since it will run as root 2024-07-25 22:51:05 +10:00
Ziad-I c4d3dad639 add page setup functions 2024-07-25 15:35:08 +03:00
Ziad-I adbf9093d3 add initial drawings page 2024-07-25 15:12:37 +03:00
Ziad-I c8defbb77f add connected list to gantt chart page 2024-07-25 14:59:56 +03:00
Ziad-I a14fc0a7f5 edit css rules 2024-07-25 14:25:44 +03:00
Thomas Krijnen 91f4427bb5 Start from project instead of unit assignment #5074 2024-07-25 10:23:12 +02:00
Ziad-I 8d2717d25b add connected blender list for index page 2024-07-24 23:26:43 +03:00
Andrej730 8b29e50f11 add_classification - remove dead and deprecated code 2024-07-24 18:24:22 +05:00
Andrej730 7edd1225c0 Fix issue assigning bsdd classification in ifc2x3 #5073 2024-07-24 18:24:22 +05:00
Andrej730 075a0c79e2 migrator - consider IfcClassification renamed property 2024-07-24 18:24:22 +05:00
Andrej730 a1c4221cd7 fix ui in 3d4c85c7d
previous change was committed by accident
2024-07-24 18:24:22 +05:00
Dion Moult dc197a2ae2 Add text shadows and clearly distinguish units, blender, local, and map coordinates in georef decorator 2024-07-24 23:21:32 +10:00
Andrej730 5fab630a8b Fix #5052 #4832 2024-07-24 17:30:23 +05:00
Andrej730 b021dbf55e fix issue in 93fe2e9
forgot that bim.assign_class is used without context arguments too, moved poll to pie menu operator
2024-07-24 17:21:42 +05:00
Andrej730 d3bcd2f73e Add more instruction for python version mismatch error handler
Example - https://i.imgur.com/l9KCHGc.png
2024-07-24 16:56:56 +05:00
Andrej730 3d4c85c7dc Indicate that Blender needs a restart if BBIM was reinstalled
Example - https://i.imgur.com/lbP4PqO.png
2024-07-24 15:54:26 +05:00
Dion Moult adde772014 Also consider non elements when guessing a false origin 2024-07-24 17:10:46 +10:00
Chirag Singh 59579fd4c4 Merge branch 'v0.8.0' of https://github.com/IfcOpenShell/IfcOpenShell into v0.8.0 2024-07-24 12:15:08 +05:30
Chirag Singh 0dde4102bc Added support for mapping material inside the UI. Output file name and file extension taken from input. Plus Fixed some bugs mentioned in #5033 2024-07-24 12:11:56 +05:30
Thomas Krijnen b988df9e1f Address old merge issue regarding style lookup #5069 2024-07-24 03:07:17 +02:00
tim 390b280442 Screed added to IfcCovering options
Screed added to IfcCovering-predefined_types FLOORING and TOPPING
2024-07-24 10:08:09 +10:00
Ziad-I 9776adee86 fix packages path for blender > 4.2 2024-07-23 22:16:24 +03:00
Andrej730 06c8a9ef14 Blender 4.2 - experimental support for reinstalling BBIM on Windows 2024-07-23 18:56:48 +05:00
Andrej730 9713cc0c2e operator to quickly restart blender 2024-07-23 17:24:14 +05:00
Thomas Krijnen dda010b130 Wire up ___localplacement settings #5031 2024-07-23 10:15:52 +02:00
Ziad-I 4122f22ee1 remove hardcoded values 2024-07-23 17:04:37 +10:00
Ziad-I e833b0aa81 edit docstrings 2024-07-23 17:04:37 +10:00
Ziad-I 975b215bd0 add type hints and docstrings 2024-07-23 17:04:37 +10:00
Ziad-I 276c4b871e add starting server if no server is running during export to web 2024-07-23 17:04:37 +10:00
Ziad-I 8e6d13242e add css variables and switching themes for gantt page 2024-07-23 17:04:37 +10:00
Ziad-I c852e624e9 add theme switching for tables page 2024-07-23 17:04:37 +10:00
Ziad-I ad17a610eb edit css for csv tables to have two themes 2024-07-23 17:04:37 +10:00
Ziad-I 6b4c695942 add writing/removing webserver pid to a json file
on starting and killing the webserver subprocess
2024-07-23 17:04:37 +10:00
Ziad-I 61dfb42cee edit warning text color 2024-07-23 17:04:37 +10:00
Ziad-I 386caab840 move intial opening of browser to server on startup event
as a band aid fix to handle race condition between starting server and opening of web browser
2024-07-23 17:04:37 +10:00
Ziad-I f50bbf9704 add warning to web ui on changes and is_dirty in web module data 2024-07-23 17:04:37 +10:00
Ziad-I 4912e86e6e fix using errno module instead of hardcoded
since error code numbers differ based on OS
2024-07-23 17:04:37 +10:00
Ziad-I b0fe30c597 add caching of blender messages 2024-07-23 17:04:37 +10:00
Ziad-I 84d4bf16c3 remoce unnecessary div element 2024-07-23 17:04:37 +10:00
Ziad-I 7851efd0c8 use ifc_file instead of IFC_File 2024-07-23 17:04:37 +10:00
Ziad-I 500587f267 make webdata ifc_file only show filename instead of full path 2024-07-23 17:04:37 +10:00
Ziad-I 6defdc63b5 add type hints and docstring to send_webui_data function 2024-07-23 17:04:37 +10:00
Ziad-I 216b3a4e37 rename variables to have more meaningful names 2024-07-23 17:04:37 +10:00
Ziad-I 4e79384c8e fix packages path when using dev setup with symlinks 2024-07-23 17:04:37 +10:00
Ziad-I f7a3b0706b fix: using blender python executable 2024-07-23 17:04:37 +10:00
Dion Moult 5d4a3d504c Support alpha versions for all wheels 2024-07-23 17:00:22 +10:00
Dion Moult 96b4ad8cd3 No longer ship bbim addon with bimtester 2024-07-23 11:41:46 +10:00
Richard Brice 54131b3fe5 IfcSectionedSolidHorizontal logs warning if Directrix is not a piecewise function, rather than silently failing. 2024-07-22 13:21:49 -07:00
Andrej730 93fe2e9b0f bim.assing_class - add description, add poll check for selected objs
also added description to pie menu entry
2024-07-22 17:26:59 +05:00
Andrej730 a7e856c311 Update ci-blenderbim.yml after all makefile changes 2024-07-22 16:46:47 +05:00
Andrej730 1fbdb4811d makefile - move ifcopenshell packages wheels instead of copy to keep it clean 2024-07-22 16:46:47 +05:00
Andrej730 797e3e8d8c bbim_translations - not to fail if user has fake-bpy-module 2024-07-22 16:46:47 +05:00
Andrej730 4c53881242 blenderbim makefile - safeguards for wheels used in the build 2024-07-22 16:46:47 +05:00
Andrej730 44fc5768af blender 4.2 - fix errors detecting last commit hash
1) __file__ / bim no longer exists as 'bim' is moved to the wheel
2) there also was an issue detecting hash after it was moved from bim to blenderbim package in c0635af
2024-07-22 16:43:50 +05:00
Andrej730 ffbade0f7a fix bcf paths after 237cd99 2024-07-22 16:43:50 +05:00
Andrej730 1ca6c489b1 dev installation - update windows script for Blender 4.2 2024-07-22 16:43:50 +05:00
Andrej730 845b3e0f6b dev installation - move dev environment scripts to separate files 2024-07-22 16:43:50 +05:00
Andrej730 51e9626809 installation.rst - update platform names 2024-07-22 16:43:50 +05:00
Andrej730 1d12f54c36 reuse tool.Blender.get_blenderbim_version 2024-07-22 16:43:50 +05:00
Andrej730 1281eb4aea fix download urls in startup error handler after d96f96031 2024-07-22 16:43:49 +05:00
Thomas Krijnen c0f2ac592e Consider edge orientation in faceset helper for advanced planar breps #4895 2024-07-22 13:07:40 +02:00
Thomas Krijnen 41f1d66fee Fix 2d transform op + fixed ref column order #5048 2024-07-22 04:33:35 +02:00
Dion Moult aa31436c67 Move git/other addons/troubleshooting to top level of docs 2024-07-22 12:13:46 +10:00
Thomas Krijnen e95e92356f Update src/ifcopenshell-python/ifcopenshell/util/shape.py
Co-authored-by: Vyacheslav Dobranov <112861900+VDobranov@users.noreply.github.com>
2024-07-22 03:51:12 +02:00
VDobranov e27980f746 Update shape.py
Following the discussion in Live Chat about length of all edges in a given geometry:
https://matrix.to/#/!ssOmSJysZpXBupsgjO:matrix.org/$0ZHjIFCtpwQl06xdGWlQ9ymsiKWpPuLMczVJnNYmN84?via=matrix.org&via=crossbach.de&via=infeeeee.duckdns.org
2024-07-22 03:51:12 +02:00
Ryan Schultz 3f3f3b6aff whoops
Revert "Update installation.rst"

This reverts commit a428ae5c86.
2024-07-21 12:50:49 -05:00
Thomas Krijnen 2b3035ec02 Lookup styles on (arbitrarily) more taxonomy kinds 2024-07-21 11:56:02 +02:00
Thomas Krijnen cc0760d505 profile_helper() returns loop, not face, take into account in hollow profile def 2024-07-21 11:55:18 +02:00
Thomas Krijnen f683fd220f Take into account tapered extrusion position 2024-07-21 11:54:48 +02:00
Thomas Krijnen 889d3c5451 Don't fail on tapered extrusion over non-derived profile def #5046 2024-07-21 11:53:42 +02:00
Thomas Krijnen c16cfc8afd Support extrusion over composite profile 2024-07-21 11:52:48 +02:00
Thomas Krijnen 4d698deb21 Various improvements to USD serializer related to object naming 2024-07-21 02:41:43 +02:00
Thomas Krijnen 3bbe598dff Minor formatting improvements 2024-07-21 02:40:56 +02:00
Thomas Krijnen e88bd3af80 Fix profile fillets #4993 2024-07-21 02:40:09 +02:00
Ryan Schultz a428ae5c86 Update installation.rst 2024-07-20 16:08:16 -05:00
Ryan Schultz 05e202059e fix #5047 - order IfcAnnotationTypes alphabetically.
and order types regardless of case.
2024-07-20 13:02:21 -05:00
Ryan Schultz ab97f23b47 Fix #5039 - Assure count is an integer 2024-07-20 10:36:26 -05:00
Kristoffer Andersen 4f0a65baea Update ci-ifcopenshell-conda-cleaner.yml
fix conda cleaner version ordering
2024-07-20 09:45:55 +02:00
Chirag Singh e88abd881d Fixed Issue #5033 2024-07-20 12:02:57 +05:30
Dion Moult d6d5dbfaa3 Fix semver syntax for BBIM GH daily builds 2024-07-20 15:51:26 +10:00
Dion Moult 3ea1f95fcf Bump version as we've already released 0.7.10
This makes the -alpha suffix actually work
2024-07-20 15:49:37 +10:00
Dion Moult 48026c7a50 Fix bug where adding a duct failed due to no container obj being calculated 2024-07-20 15:49:11 +10:00
Andrej730 8f2e8ec64d fix builds for macos 2024-07-19 22:22:22 +05:00
Andrej730 15945d854a fix bbim build missing very important aud wheel 2024-07-19 22:22:22 +05:00
Andrej730 f69c42aaae makefiles - windows support 2024-07-19 22:22:22 +05:00
Kristoffer Andersen b88e35e3e7 Update ci-ifcopenshell-conda-daily.yml
remove illegal conda version character -
2024-07-19 13:50:08 +02:00
Kristoffer Andersen 6befa2dc12 Update ci-ifcopenshell-conda-daily.yml
making legal semver by using -alpha
2024-07-19 13:45:12 +02:00
Andrej730 c25bb03a9c Blenderbim startup error handler - switch to scene properties
Noticed that by default Blender is using object properties (and users may have something else their startup file), so no we switch to the scene properties so they could see our error handler immediately.
2024-07-19 14:23:26 +05:00
Andrej730 4fdf8145f0 Fix incorrect python version detection for Blender 4.2
Basically this error message is back - https://i.imgur.com/ANQe0eg.png
2024-07-19 14:21:57 +05:00
Andrej730 bb910e42ab fix dependencies that should be downloaded for specific platform
Builds are finally working (atleast tested on windows) 🥳

Thanks to Blender now we'll always now if some dependency will become platform specific.

It shows errors like:
Skipping wheel for other system (manylinux_2_24_x86_64.manylinux_2_28_x86_64 != win_amd64): greenlet-3.0.3-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Skipping wheel for other system (manylinux_2_17_x86_64.manylinux2014_x86_64 != win_amd64): yarl-1.9.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Skipping wheel for other system (manylinux_2_17_x86_64.manylinux2014_x86_64 != win_amd64): aiohttp-3.9.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Skipping wheel for other system (manylinux_2_17_x86_64.manylinux2014_x86_64 != win_amd64): MarkupSafe-2.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Skipping wheel for other system (manylinux_2_17_x86_64.manylinux2014_x86_64 != win_amd64): fonttools-4.53.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Skipping wheel for other system (manylinux_2_17_x86_64.manylinux2014_x86_64 != win_amd64): charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Skipping wheel for other system (manylinux_2_17_x86_64.manylinux2014_x86_64 != win_amd64): ezdxf-1.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Skipping wheel for other system (manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64 != win_amd64): frozenlist-1.4.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Skipping wheel for other system (manylinux_2_17_x86_64.manylinux2014_x86_64 != win_amd64): SQLAlchemy-2.0.31-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Skipping wheel for other system (manylinux_2_17_x86_64.manylinux2014_x86_64 != win_amd64): multidict-6.0.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
2024-07-18 22:05:36 +05:00
Andrej730 13dce9d663 github action - fix finding zip files with new naming
encapsulated zip archive name generation in the makefile, so we wouldn't be recreating it multiple times
2024-07-18 21:30:09 +05:00
Andrej730 bda69555f6 blenderbim makefile - fix bbim translations build 2024-07-18 21:30:09 +05:00
Dion Moult e50f88a91c Whoops 2024-07-19 00:59:58 +10:00
Dion Moult fc7288b9e7 Fix missing bdist wheel during build 2024-07-19 00:56:16 +10:00
Andrej730 1355f3ab6b common.mk - windows support 2024-07-18 19:46:18 +05:00
Andrej730 d60c03b632 fix bbim daily github workflow not being triggered by changes in itself 2024-07-18 19:39:16 +05:00
Dion Moult b39020ce74 Fix yaml syntax 2024-07-19 00:26:56 +10:00
Dion Moult cb23b00913 Separate build/dist dir for bbim makefile 2024-07-19 00:26:07 +10:00
Dion Moult 268ab107e2 Forgot to update bimtester makefile 2024-07-18 23:57:44 +10:00
Dion Moult 734b4901fd Don't copy over the entire blenderbim dir when building 2024-07-18 23:52:24 +10:00
Dion Moult 0ecc3d3e2a Share common makefile instructions, use venv for running build, and separate dist/build dirs 2024-07-18 23:43:12 +10:00
Dion Moult 237cd99e3b Make bcf follow the same folder hierarchy as everybody else 2024-07-18 23:41:30 +10:00
Dion Moult 31acd0a39b Forgot PYTHON var 2024-07-18 22:44:25 +10:00
Dion Moult 7fb04c7d8f Wrap IOS make in venv 2024-07-18 22:40:43 +10:00
Dion Moult ad05434777 Add prerelease info, inline make dist-blenderbim 2024-07-18 22:29:08 +10:00
Dion Moult 99cb50d365 Forgot to commit IfcBIMTester pyproject 2024-07-18 22:24:25 +10:00
Andrej730 d29a201814 makefile - create wheels dir 2024-07-18 15:56:50 +05:00
Andrej730 fb702afee6 makefile - install build module globally
as we run make dist for ifcopenshell packages not inside venv
2024-07-18 15:48:18 +05:00
Andrej730 657906a2dd makefile - fix missing build module 2024-07-18 15:36:51 +05:00
Dion Moult 5b96b4a414 Bundle BBIM as a wheel
Yes we really did it
2024-07-18 20:24:17 +10:00
Dion Moult 30623ba333 Fix missing imports prior to deciding 4.2 import strategy 2024-07-18 20:24:17 +10:00
Andrej730 34652aa2b7 Create blenderbim_redirect.py 2024-07-18 20:24:17 +10:00
Dion Moult e7fd06a6d6 Fix non-valid Blender manifest (strings too long apparently) 2024-07-18 20:24:17 +10:00
Dion Moult f0077b9e22 Fix ifcopenshell-python wheel packaging missing util schema json files 2024-07-18 20:24:17 +10:00
Dion Moult 71aa30a25f Fix ifc5d packaging missing json mapping files 2024-07-18 20:24:17 +10:00
Dion Moult d96f960313 Add blender platform support 2024-07-18 20:24:17 +10:00
Dion Moult 5a2a809061 Bump permissions and tags in blender manifest 2024-07-18 20:24:17 +10:00
Andrej730 2710148276 fix bpypolyskel and ifcjson wheels 2024-07-18 20:24:17 +10:00
Andrej730 7ff1c535e5 build wheel for bpypolyskel 2024-07-18 20:24:17 +10:00
Dion Moult 71575905cb Remove behave and bimtester module - only used by advanced users and confuses users with ifctester 2024-07-18 20:24:17 +10:00
Andrej730 56573160d1 makefile - do not download pkg_resources as it's provided by blender
It seems Blender started providing pkg_resources by default at some point, see:
blender-4.2.0/4.2/python/lib/site-packages/pkg_resources
2024-07-18 20:24:17 +10:00
Andrej730 49555eb81e pack ifcjson to wheel 2024-07-18 20:24:17 +10:00
Dion Moult 9ed286660e WIP BlenderBIM makefile update 2024-07-18 20:24:17 +10:00
Dion Moult 3d2dfdf9cb Fix ifccityjson wheel 2024-07-18 20:24:17 +10:00
Dion Moult c3d4847b29 Minor fix to sun_position < Blender 4.2 2024-07-18 18:26:39 +10:00
Richard Brice 9bf68db080 Fixes mapping of cant segments without superelevations 2024-07-17 15:46:36 -07:00
Bruno Perdigão 798cc6069f Fix bug related to Linked Aggregates 2024-07-17 15:45:10 -03:00
Dion Moult 0efa36940c Package BIMTester as a wheel 2024-07-17 20:50:36 +10:00
Andrej730 6fbb1a286c support sun position addon on blender 4.2 2024-07-17 15:26:12 +05:00
Andrej730 7c606fea9b make sun_position an optional addon for bbim 2024-07-17 13:18:42 +05:00
Andrej730 ae97350e64 blender_manifest - fix version
Blender requires blender_manifest version to be semver compatible otherwise it fails with an error below if you try to install BBIM as an extension.

Error:
Error in manifest key "version" invalid: to be a semantic-version, found '0.7.10.240717'
2024-07-17 13:16:17 +05:00
Andrej730 3e7dbcaeb6 blender_manifest - bump min blender version
as manifest is used only for installing addon as blender extension in Blender 4.2+
2024-07-17 13:16:17 +05:00
Thomas Krijnen 4ad426a5c5 Update IfcParse.cpp #4998 2024-07-17 09:45:34 +02:00
Dion Moult eeb200a19d Minor UI polish to show structural panels by default 2024-07-17 17:37:20 +10:00
Dion Moult 766eb75e3a Deprecate old set viewport shadow from sun in favour of new solar analysis tools 2024-07-17 17:37:09 +10:00
Dion Moult 607f79f2f5 New feature to set view from sun for solar analysis 2024-07-17 17:36:50 +10:00
Dion Moult 70f252988a Purge deprecated "set north" operators from georeference superseded by new visualisation features 2024-07-17 17:36:03 +10:00
Dion Moult f956545743 Fix tzfpy packaging 2024-07-17 16:45:35 +10:00
Dion Moult 6f8aac96f0 Fix #5027. Forgot to commit some files for solar analysis. 2024-07-17 14:57:06 +10:00
Dion Moult a2018a22a6 Add sun path visualisation for solar analysis 2024-07-17 13:59:01 +10:00
Thomas Krijnen 7a10edbd73 Fix ambiguous overload after dedbf7014a 2024-07-17 03:43:55 +02:00
Thomas Krijnen 669b0b8c83 Fix triangulated face set #5020 2024-07-17 03:26:23 +02:00
Thomas Krijnen 70336f179d Keep identities on indexed face sets #5020 2024-07-17 03:12:35 +02:00
Dion Moult 7fc7a73db8 New panel to manage solar analysis setup (location, date, and time) 2024-07-16 23:13:02 +10:00
Andrej730 41065f77d1 BBIM startup error handler - fix error redownloading addon after 5e6fe5e 2024-07-16 18:02:26 +05:00
Andrej730 010f854a07 BBIM startup error handler - message on python version mismatch
Example - https://i.imgur.com/U5CBdqU.png
Logs (only startup error logs) now also have information about binary python version and binary filename.
2024-07-16 18:02:26 +05:00
Andrej730 c0635afb64 BBIM error handler - include commit hash
Include commit hash to the copied logs and add it to the startup error handler (https://imgur.com/9yVMBnR)
2024-07-16 18:02:26 +05:00
Andrej730 dedbf7014a fill context attribute of the shape elements (similar to v0.7.0) #4832 2024-07-16 18:02:26 +05:00
Dion Moult d8cf6ca4fc Bundle pytz and tzfpy for timezone calculations for solar analysis 2024-07-16 22:56:51 +10:00
Andrej730 f1ab63dda9 pyradiance macos support + linux fix
See:
https://github.com/LBNL-ETA/pyradiance/issues/35
https://github.com/LBNL-ETA/pyradiance/issues/34
2024-07-16 12:11:11 +05:00
Andrej730 3a5c3d856a quick fix for 54fe0f8ff 2024-07-16 11:17:36 +05:00
Andrej730 54fe0f8ff9 Remove blenderbim/occ_utils.py #812
Goodbye duplicated file 😁
2024-07-16 11:06:49 +05:00
Dion Moult 483516a902 Implement show / hide / isolate in spatial decomposition panel 2024-07-16 14:23:30 +10:00
Dion Moult 83085ba3c1 You can now toggle recursive children in the spatial tree 2024-07-15 23:56:35 +10:00
Dion Moult 215866cf30 You can now make a spatial element the active object from the spatial decomposition panel 2024-07-15 23:40:40 +10:00
Andrej730 09d5fafdf8 note on OCC imports 2024-07-15 18:34:39 +05:00
Andrej730 54cc4192bd typing for pythonocc types 2024-07-15 18:34:39 +05:00
Andrej730 eff778d5be support pythonocc >= 7.8.0 #4942
Related: https://github.com/tpaviot/pythonocc-core/issues/1350
Also added a print so this type of errors won't go silently.
2024-07-15 18:34:38 +05:00
Andrej730 66877c227b typing 2024-07-15 18:34:38 +05:00
Andrej730 7e117bca90 Move supported OCCT version in docs to general dependencies 2024-07-15 18:34:38 +05:00
Andrej730 9f084558f6 mathutils note 2024-07-15 18:34:38 +05:00
Dion Moult c715d9a81b A spatial tree's icon can now be hovered to show the class and clicked to select children 2024-07-15 23:29:53 +10:00
Dion Moult 8923d02f68 Update to latest Sphinx AutoAPI 2024-07-15 09:20:56 +10:00
Dion Moult 447a13b6e7 Forgot to do the same for PyPI 2024-07-14 23:31:34 +10:00
Dion Moult 2531a58083 Fix IOS-Python build to use the new platform-specific blobs 2024-07-14 23:27:22 +10:00
Dion Moult 70ae0fd850 Same for IOS, I guess? 2024-07-14 23:21:04 +10:00
Dion Moult 174749caf7 Don't make IOS version dynamic for BBIM since this'll be locked to a particular commit 2024-07-14 23:14:40 +10:00
Dion Moult dd8ec95fad Whoops 2024-07-14 23:10:51 +10:00
Dion Moult 0a791a3b85 Release 0.7.10
This is just a test release to see if the workflow is smooth :)
2024-07-14 23:05:50 +10:00
Dion Moult 1c91b966b5 Fix pyradiance dependency 2024-07-14 23:03:45 +10:00
Dion Moult db6cda2816 Fix #4955. Add visualisation for georeferencing data. 2024-07-14 17:13:49 +10:00
Dion Moult d6dab75653 Allow warning and background decorator colours to be configurable 2024-07-14 16:39:29 +10:00
Dion Moult 0dc084d785 Refactor georeferencing properties to remove unnecessary blender_enh/project_north. 2024-07-14 09:06:01 +10:00
Blender Defender 3bafea62f4 feat: Make the ExecuteIfcTester operator work with multiple IFC and IDS files
The code that executes the tests has been moved to a seperate method, so it can be called for every IDS and IFC file
2024-07-14 08:34:39 +10:00
Blender Defender 69b7658196 fix(UI): Indicate, that multiple IDS and IFC files can be selected in the IFC Tester Panel 2024-07-14 08:34:39 +10:00
Blender Defender 9e93f22e53 fix: Remove "ANIMATABLE" option from the should_load_from_memory property 2024-07-14 08:34:39 +10:00
Blender Defender 94bcb8d266 feat: Allow selecting multiple IFC and IDS files in the IFC tester
This implements the "MultipleFileSelector" for the file selection in the "IFC Tester" panel, so multiple files can be selected at once. Attention: This commit only adds the User Interface, the actual functionality will be added in a later commit
2024-07-14 08:34:39 +10:00
Blender Defender bbd4e00972 refactor: Abstract "SelectFMIfcFile" to "MultipleFileSelector".
The "MultipleFileSelector" class can be used by child classes to implement the option to select multiple files at once. It requires two properties, which it will update: A StringProperty for a single path and a CollectionProperty for a list of paths.
2024-07-14 08:34:39 +10:00
Blender Defender 16e8c504f3 fix: Remove "Animatable" Property from the IFC Tester checkboxes 2024-07-14 08:34:39 +10:00
Dion Moult 95c457f53d Fix bug to use 0.8.0 materials when linking models 2024-07-13 14:50:46 +10:00
ay-ex 38f5b77f92 fix delete obsolete script 2024-07-13 00:32:09 +10:00
ay-ex 4f1a36753c fix delete obsolete script 2024-07-13 00:32:09 +10:00
ay-ex 565a0edb73 remove obsolete script 2024-07-13 00:32:09 +10:00
ay-ex 54a65abd76 fix cleanup 2024-07-13 00:32:09 +10:00
Dion Moult 5b16699eb4 Show length, area, volume units by default in unit panel for convenience 2024-07-13 00:06:14 +10:00
Dion Moult b4482780cf Linking models now acommodates files with different project or map units combinations correctly 2024-07-12 23:58:18 +10:00
Dion Moult 589b9d4a79 Add test files for georeferencing tests 2024-07-12 23:56:08 +10:00
Dion Moult 04365053a8 Fix deep purge of unit when converting units and fix bug where unit was removed if map unit was the same as the project unit 2024-07-12 22:48:23 +10:00
Dion Moult c79e490d6d Add test for fix in f56bae14 2024-07-12 21:57:29 +10:00
Johannes Schorr b674b8ca58 Fix typo in doctring in ifcdiff.py 2024-07-12 15:01:07 +10:00
VDobranov f56bae141b Update shape_builder.py
Described in the https://github.com/IfcOpenShell/IfcOpenShell/issues/4989
2024-07-12 14:59:04 +10:00
Andrej730 8579c61ab6 ifcopenshell.draw - add drawing_object_type argument and descriptions 2024-07-11 19:03:09 +05:00
Andrej730 5440445cbc ifcopenshell.draw - error if just 1 file is provided 2024-07-11 19:03:09 +05:00
Dion Moult e28b4d40ab Converting project length units now intelligently preserves map unit and coordinate operation scale. 2024-07-11 23:10:24 +10:00
Dion Moult a6940d2cba Fix bug where schema instead of schema_identifer was used to get the schema_by_name. Fix tests to use IFC4X3_ADD2 so that you only need the official version compiled 2024-07-11 22:26:19 +10:00
Dion Moult 9f14769cba Very minor UI improvement to saving work calendar changes to show the text in the edit button 2024-07-11 22:26:19 +10:00
Richard Brice 585eeb283a emits * for derived entities instead of $
Validation service 0.6.4 started giving errors for entities with derived types where $ was used. The correct coding is *.
2024-07-10 12:51:27 -07:00
Andrej730 3a6c3a8312 add typing-extensions to ifcopenshell explicit dependencies
typing-extensions is official python package for supporting typing features on older versions.

It was kind of included in both blenderbim and to ifcopenshell as typing-extensions is also numpy dependency, included it explicitly just in case.
2024-07-10 21:37:34 +05:00
Andrej730 86fa24aba3 fix support for Python <3.11 2024-07-10 21:37:08 +05:00
Andrej730 474d8381ab minor refactor 2024-07-10 18:38:39 +05:00
Andrej730 feea42f988 ifcopenshell.draw - add hlr_poly option 2024-07-10 15:34:35 +05:00
Andrej730 88d3152f04 bim.debug_active_drawing - fix issue running when Exclude is None
It was producing invalid selector expression "None, guid1, guid2, ..." leading to errors
2024-07-10 15:34:35 +05:00
Andrej730 515bfd1beb make bim.profile_import_ifc a bit more friendly 2024-07-10 15:34:35 +05:00
Andrej730 472e2f8e59 Add to debug UI an operator to toggle detailed ifcopenshell logs
https://i.imgur.com/tqwRSYs.png

Ping @theoryshaw just in case, I can image Ryan finding lots of edge cases in v0.8.0 and this can help narrow them down😁
2024-07-10 15:34:35 +05:00
Andrej730 83a0d7a63c prevent freezing the iterator in case of unhandled exceptions
Solving an issue in 355cca3 I've noticed that because of some unhandled exception iterator was freezing and hanging indefinitely, this should be resolved now to be safe.

Also added had_errors_during_initialization() method that can help identify whether there were errors either during iterator initialization or processing elements.
2024-07-10 15:34:35 +05:00
Dion Moult 4e78de6ce9 You can now select group and system data in selectors 2024-07-10 17:30:38 +10:00
ay-ex 670bf9d4a6 fix use release tag for choco version label 2024-07-10 17:16:54 +10:00
Dion Moult ad1183dab8 Update README.md with all distribution badges 2024-07-10 11:26:46 +10:00
Dion Moult a1568641b0 Fix #4969. Minor fix where demo library had misnamed slab thicknesses. 2024-07-10 09:23:12 +10:00
Dion Moult 76a6ad6596 Fix #4996. Don't use assert_never to support Python 3.10. 2024-07-10 09:01:35 +10:00
Andrej730 355cca3679 Improve styles handling (partially support non-shading styles/fix bugs)
1) Previously create_shape (was failing with "RuntimeError: Unexpected topology") or iterator (was hanging indefinetely trying initialize with a IfcSlab from #4898) were breaking if element had a material that had IfcSurfaceStyle with just IfcExternallyDefinedSurfaceStyle and no IfcSurfaceStyleShading.

Now get_surface_style is returning IfcSurfaceStyle as first element of the pair even if there was no IfcSurfaceStyleShading - so it can be used to create a `taxonomy::style::ptr` with it to indicate that geometry is still referring to some style.

2) Added logs for unsupported presentation styles (non-IfcSurfaceStyles) to both `mapping::map_impl(const IfcSchema::IfcStyledItem* inst)` and `mapping::map_impl(const IfcSchema::IfcMaterial* material)`. Also `map_impl` will not break now if it will meet IfcCurveStyle.
2024-07-09 20:13:59 +05:00
Chirag Singh 7e1eadf54c Wrapped import pyradiance in a try-except to accommodate mac intel 2024-07-09 23:30:57 +10:00
Chirag Singh a2dead2dd7 Radiance Support added 2024-07-09 23:30:57 +10:00
Chirag Singh 220fb13eec Created a UI for Radiance Rendering in the Services and System Panel 2024-07-09 23:30:57 +10:00
Dion Moult 7c1c139074 Attempt to bundle pyradiance 2024-07-09 22:03:04 +10:00
Dion Moult 3a3421897c Forgot to implement autoguessed project norths from site/building guessed origins (typically for 2X3 models with no georeferencing data) 2024-07-09 18:48:04 +10:00
Dion Moult b34d10bd35 Bump IOS 2024-07-09 08:23:04 +10:00
Andrej730 8e86b3d1d8 util.shape - optimize by using shape buffers and numpy 2024-07-08 18:49:12 +05:00
Andrej730 acf135a6ed Store item_ids in imported meshes and set them on toggling edit mode
It will be used later to add more IFC capabilities to EDIT mode.

Example - https://imgur.com/a/HAkjoCY
2024-07-08 17:46:11 +05:00
Andrej730 7c1459b83e clean up ios_materials after they were processed 2024-07-08 17:46:11 +05:00
Andrej730 dd561d3703 remove material assignment listener #4843 2024-07-08 17:46:11 +05:00
Andrej730 24c4858570 Profiles UI - support renaming profiles by double-click
Example - https://imgur.com/a/05I5tSz
2024-07-08 17:45:43 +05:00
Andrej730 9690bfb1ed Styles UI - support renaming styles by double click
Example - https://imgur.com/a/X7WBllz
2024-07-08 17:44:41 +05:00
Andrej730 fd48f70ef1 poll message that non-IfcSurfaceStyles are not currently supported
https://i.imgur.com/EBbMUaI.png
2024-07-08 17:43:55 +05:00
Andrej730 c33c19c483 Support renaming materials by double clicking them in materials ui
Example - https://imgur.com/a/NXr6Ku2

Which is especially important for non-IfcMaterials as they currently don't have their own editing UI (besides when they are applied to some element).
2024-07-08 17:43:55 +05:00
Andrej730 c9989c5f8f Materials UI - indiciate currently active material type
Example - https://imgur.com/a/hn7iJgP
2024-07-08 17:43:55 +05:00
Andrej730 d996811306 don't consider material usages as overriding materials
All it does it removes the "Inherited Material Is Occurrence Overridden" label for material usages.
2024-07-08 17:43:55 +05:00
Andrej730 10b5910654 support assigning existing non-ifcmaterials materials
Example - https://imgur.com/a/KN8mQPL

Also added some description to material operators (https://imgur.com/a/eIVNEdU). Need to somehow emphasize that this UI is only for IfcMaterials and cannot be used to assign existing layer sets, profile sets, etc...
2024-07-08 17:43:55 +05:00
Andrej730 ee5b3d1775 show materials descriptions in the tooltip when assigning a material
Example - https://i.imgur.com/yi96BMa.png
2024-07-08 17:43:55 +05:00
Andrej730 b45a995bb3 typing 2024-07-08 17:43:55 +05:00
ay-ex fc45e587c0 fix git clone depth 2024-07-08 20:40:03 +10:00
Thomas Krijnen c18e4ea6ce Update build-all.py 2024-07-08 08:48:53 +02:00
Dion Moult ff662fdfcf Merging projects now accomodates models with different project norths 2024-07-08 11:38:42 +10:00
Thomas Krijnen f075b0ca52 Update build-all.py 2024-07-07 21:51:03 +02:00
Dion Moult a3844fe098 More tests and fixes for linking in models with different project norths 2024-07-07 23:59:13 +10:00
Dion Moult d00e60369b Bump IOS 2024-07-07 22:24:35 +10:00
Dion Moult 22b7027746 Fix bug where automatic false origin detection didn't do anything if linking from an empty Blender session 2024-07-07 15:53:06 +10:00
Ryan Schultz 410fff6ee9 Fix #4494 - Be able to search (select objects in scene) from the Spreadsheet Import/Export UI, as well. 2024-07-06 11:43:39 -05:00
Dion Moult 9d11f8a25b Linking in models now considers multiple project norths and federates it properly 2024-07-06 17:00:21 +10:00
Dion Moult 95f71a2e2f You can now specify custom project norths when loading in models in absolute terms 2024-07-06 15:43:16 +10:00
Dion Moult accb1890dc Minor fix where bSDD didn't load IFC properties 2024-07-06 15:40:25 +10:00
Ryan Schultz 2a808318bf fix #4665 - View layerset thicknesses in feet and inches format 2024-07-05 22:26:36 -05:00
Andrej730 24d1a2ee64 black format 2024-07-05 18:33:49 +05:00
Andrej730 1d59edcbe8 typing & use common tool.Ifc.Operator class
Lazy imported some modules to prevent circular imports.
2024-07-05 18:33:49 +05:00
Andrej730 8a9ca9ac60 remove bbim material unassignment listener #4843
Listeners are implicit and get in the way sometimes, we should work on our core methods and make explicit calls.
2024-07-05 18:33:48 +05:00
Andrej730 7a89d8f5ed smal core.material.unassign_material refactor 2024-07-05 18:33:48 +05:00
Andrej730 a6951d1a6d fix material tool tests after 75f8e75 and 114fca8 2024-07-05 18:33:48 +05:00
Andrej730 1cdd4c27fc fix geometry core tests after fccf56d5f 2024-07-05 17:57:17 +05:00
Andrej730 7acea25fdf fix material core tests after 58a7ef6 2024-07-05 17:57:17 +05:00
Andrej730 2510e4e6c4 bim.add_representation - OBJECT method to use the final geometry
E.g. with all modifiers and shape keys applied.
Example - https://imgur.com/a/rbf5RtI
2024-07-05 17:01:39 +05:00
Andrej730 d0f4c25c9f bim.duplicate_material to handle IfcMaterialLayerSets names 2024-07-05 17:01:39 +05:00
Andrej730 0557ff810a Fix bug duplicating styles not duplicating blender material #4843 2024-07-05 17:01:39 +05:00
Andrej730 fdaf059c60 Fix bug duplicating and editing materials #4843
It was giving errors trying since ifc materials are no longer to connect to the blender materials.
2024-07-05 17:01:38 +05:00
Ziad-I 79f96d22a5 add logo and change path of jsgantt lib 2024-07-05 21:36:07 +10:00
Ziad-I 31e7cd7a8c add old gantt ui if web ui is not running 2024-07-05 21:36:07 +10:00
Ziad-I 6b274535c6 fix setting editable after printing 2024-07-05 21:36:07 +10:00
Ziad-I 410767921d add display and update for work schedule data 2024-07-05 21:36:07 +10:00
Ziad-I 78dd4856eb fix editing task name and time from webui 2024-07-05 21:36:07 +10:00
Ziad-I 166e75db3f add editing of gantt chart from webui 2024-07-05 21:36:07 +10:00
Ziad-I 01c7be2b48 fix sending work_schedule 2024-07-05 21:36:07 +10:00
Ziad-I d05e30b4c5 fix updating chart error 2024-07-05 21:36:07 +10:00
Ziad-I 4f44bde9e9 add sending updated task column data 2024-07-05 21:36:07 +10:00
Ziad-I bd50276e7d fix error with getting blenderId from chart id 2024-07-05 21:36:07 +10:00
Ziad-I 58b132136d remove unneeded loop for task creation in gantt chart 2024-07-05 21:36:07 +10:00
Ziad-I bd8988a474 add updating of gantt chart 2024-07-05 21:36:07 +10:00
Ziad-I c0216efffe add sending gantt data on pressing generate gantt chart in blender 2024-07-05 21:36:07 +10:00
Ziad-I 25e964788c add key name parameter in send_webui_data 2024-07-05 21:36:07 +10:00
Ziad-I 52d9cbff28 add change event handling in gantt data table 2024-07-05 21:36:07 +10:00
Ziad-I 1eb9537d58 refactor web ui operator handling 2024-07-05 21:36:07 +10:00
Ziad-I 24c753a09d add print options selection button 2024-07-05 21:36:07 +10:00
Ziad-I b5a130263a fix some css issues 2024-07-05 21:36:07 +10:00
Ziad-I 13a1252c77 add print button for gantt chart 2024-07-05 21:36:07 +10:00
Ziad-I f338f66b4b add gantt html/css/js 2024-07-05 21:36:07 +10:00
Ziad-I a782812911 rename styles.css to index.css
to reflect which page it is used for
2024-07-05 21:36:07 +10:00
Ziad-I 10f96d873a small index html/css changes 2024-07-05 21:36:07 +10:00
Ziad-I 09a2494967 add handler for gantt url path 2024-07-05 21:36:07 +10:00
Andrej730 84d58cc572 revert 4211e7a93 to restore bot builds #4980 2024-07-05 14:55:19 +05:00
Andrej730 74e27a27b5 bump BBIM build 2024-07-05 12:02:16 +05:00
Andrej730 f5b71543af makefile "bump" target changes
1) added current commit hash as a variable to the makefile, so you can now just `make bump NEW=xxxx` to bump the build version instead of `make bump OLD=yyyy NEW=xxxx`.

2) added binary mode to sed command, so it won't be changing current line endings
2024-07-05 12:02:05 +05:00
Andrej730 ef39acfb05 Suffixes for compiled .pyd/.so based on the platform #4686 2024-07-05 11:44:01 +05:00
ay-ex 8abb8d1102 fix fetch with tags 2024-07-05 15:24:34 +10:00
ay-ex 4db3c60ccf add choco_release git debug info 2024-07-05 15:24:34 +10:00
Ryan Schultz baec208303 For walls, labeling which side is exterior/interior 2024-07-04 08:51:39 -05:00
Thomas Krijnen dda4dd3ab5 occt 7.6 compatibility 2024-07-04 09:08:30 +02:00
petrisch 2ddbf57597 Little typo 2024-07-04 11:34:07 +05:00
Andrej730 f1290ef061 Replace SEW_SHELLS with REORIENT_SHELLS #4832 2024-07-04 11:10:24 +05:00
Thomas Krijnen cf3d050423 Rename taxonomy kind enum accordingly 2024-07-03 20:04:52 +02:00
Thomas Krijnen a4532cc722 Remove assumptions on solid topology in SVG camera frustrum detection #4924 2024-07-03 20:04:52 +02:00
Thomas Krijnen 813a8e12ed Update python bindings for name changes 2024-07-03 20:04:52 +02:00
Thomas Krijnen 10059a722b Handling of None in draw.py #4924 - mostly untested 2024-07-03 20:02:13 +02:00
Andrej730 4211e7a936 IfcWrap CMake - migrate to FindPython
Previously it was giving deprecation warnings:

CMake Warning (dev) at /IfcOpenShell/src/ifcwrap/CMakeLists.txt:38 (FIND_PACKAGE):
  Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

  CMake Warning (dev) at /IfcOpenShell/src/ifcwrap/CMakeLists.txt:73 (FIND_PACKAGE):
  Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.
2024-07-03 18:12:22 +05:00
Andrej730 33785620d5 Fix errors loading bounding box representations #4832 2024-07-03 18:12:21 +05:00
Andrej730 5a0df870f5 bim.add_representation - update occurrences too if there were no representations
and new representation was just added to the type

Example - https://imgur.com/a/v6a5kg2
2024-07-03 18:12:21 +05:00
Andrej730 f9aba58342 IfcOperator typing
Added typing to make sure IfcOperator is properly implemented and not used if there are no IFC changes.
2024-07-03 18:12:21 +05:00
Andrej730 788fb62f25 bim.add_representation - clean up orphaned temporary meshes 2024-07-03 18:12:21 +05:00
Andrej730 cc6d254698 bim.add_representation - option to add default cube representation
Example - https://imgur.com/a/Mklgmhj

It can be useful as a way to start working with the representation when object had no representations before.

You can also now add a representation from other object even if object had no representation before.
2024-07-03 18:12:21 +05:00
Andrej730 3f2703ca21 tool.Geometry method for adding a data to an empty object 2024-07-03 18:12:21 +05:00
Andrej730 e72f2758c6 bim.add_representation - OBJECT conversion method UX tweaks
1) Filter only objects with representations in the pointer property.
2) Add description to the pointer property.
3) More descriptive error if object is not selected.
2024-07-03 18:12:20 +05:00
Andrej730 2feae06ebd bim.add_representation - error if current object has is an empty 2024-07-03 18:12:20 +05:00
Andrej730 fccf56d5fd fix issue removing currently active representation
previously it would remove the object, now it's going to switch to some other representation
2024-07-03 18:12:20 +05:00
Andrej730 6e9309aefc common method for iterating over element's representations 2024-07-03 18:12:20 +05:00
Andrej730 fbe60c85a1 use common method to generate mesh name 2024-07-03 18:12:20 +05:00
Andrej730 8f92877fb4 typing 2024-07-03 18:12:20 +05:00
Andrej730 5d1b2e4651 black format 2024-07-03 18:12:19 +05:00
Thomas Krijnen 10c3893b79 Missing file 2024-07-03 15:07:28 +02:00
Thomas Krijnen e2198c3ba7 Advanced brep: closed underlying nurbs curve handling #4895 2024-07-03 15:03:49 +02:00
ay-ex 752a64bf3e choco release fix (#4971)
* add release script choco_release.py

* fix simplify action yaml
2024-07-03 22:52:32 +10:00
Thomas Krijnen 71ef1bf056 Advanced brep, sweeps and various fixes #4848 #4895 2024-07-03 14:42:51 +02:00
Thomas Krijnen d4efcd40f9 Advanced brep, sweeps and various fixes #4848 #4895 2024-07-03 14:36:35 +02:00
Andrej730 9485190604 ifcopenshell.draw - omit sys.argv + help message
To make sure user will get an error if files are not provided - if we use sys.argv then we always have __file__ in it and if user won't provide fiels they'll get a less readable error

Before:
    sr.setFile(files[0])
               ~~~~~^^^
IndexError: list index out of range

Now:
usage: draw.py files [files ...]
draw.py: error: the following arguments are required: files
2024-07-02 15:32:48 +05:00
Andrej730 d1523eaeac ifcopenshell.draw - update to v0.8 2024-07-02 15:32:48 +05:00
Andrej730 1af8e7d0ef ifcopenshell.geom.serializers - avoid wrappers for svg/obj
To keep the signatures
2024-07-02 15:32:48 +05:00
Thomas Krijnen 19b89a3b1f Workarounds for unstyled elements in tree and wrapper #4924 2024-07-02 11:44:00 +02:00
Dion Moult b73da046ee See #4964. Forgot to commit qto function. 2024-07-02 18:59:13 +10:00
Thomas Krijnen 675e1982ee Move macro logic into template function; mark failures as intended #4915 2024-07-01 20:34:51 +02:00
Thomas Krijnen 0357d15ce4 Exhaustive USD Format extensions 2024-07-01 20:30:34 +02:00
Thomas Krijnen 22cd1e8b9e Another case of mutability causing havoc 2024-07-01 19:55:14 +02:00
Andrej730 0f8f6419e9 Indicate in UI if object's ifc placement/representation is not synced
Example - https://imgur.com/a/lixOxeN

Ideally users shouldn't need those as syncing should work seamlessly but since we do have syncing it can be useful if you can check sync status from the UI.
2024-07-01 18:26:04 +05:00
Andrej730 bd7ee0a1c6 Recent IFC projects - add tests 2024-07-01 18:26:04 +05:00
Andrej730 4463548740 move recent IFC projects tools from Blender to Project module
as Project is probably more appropriate for this
2024-07-01 18:26:03 +05:00
Andrej730 5655df2081 Recent IFC projects - show schema in the tooltip
Example - https://i.imgur.com/0op89zh.png
2024-07-01 18:26:03 +05:00
Andrej730 deb0b3482b IfcHeaderExtractor tests 2024-07-01 18:26:03 +05:00
Andrej730 ae2a299616 move IfcHeaderExtractor to util.file
edited pyproject.toml as `disableBytesTypePromotions` is disabled by default in non-strict mode and type checker intrerprets `bytes` as `bytes | memoryview | bytearray` which is deprecated in https://peps.python.org/pep-0688/#no-special-meaning-for-bytes
2024-07-01 18:26:03 +05:00
Andrej730 375deaad1e Add description to "Upgrade to IFC4/IFC4X3)" operator
To emphasize that it won't overwrite the current file.

Example - https://i.imgur.com/CKIQJwn.png
2024-07-01 18:26:03 +05:00
Andrej730 f692e943c9 typing 2024-07-01 18:26:03 +05:00
Andrej730 8538a916a3 ifcopenshell.file docs 2024-07-01 18:26:02 +05:00
ay-ex a8b2997e58 fix choco.yml (#4959) 2024-07-01 17:12:58 +10:00
Dion Moult 5c151c6b57 Bump bot build 2024-07-01 11:44:17 +10:00
shungeer 8c12da13e6 Update README.md about extend express usage (#4841)
1. C++ code generation by extend express.
2. python rule code generation by extend express.
2024-07-01 11:20:30 +10:00
DimitriosThe 20f8181ac3 Update csv4d2ifc.py (#4935)
Please correct me if I am wrong:

while trying to create relationships I saw that in def create_rel_sequence (line 194) there is a parameter missing which should reflect the "rel_type", otherwise and according to "assign_sequence.py" the sequence_type remains 
def assign_sequence(
    file: ifcopenshell.file,
    relating_process: ifcopenshell.entity_instance,
    related_process: ifcopenshell.entity_instance,
    sequence_type: str = "FINISH_START",
2024-07-01 11:18:13 +10:00
John Yani 656a519126 [docs] Starting Project 0 tutorial (#4953) 2024-07-01 11:17:24 +10:00
Dion Moult 71869b65f3 Minor fix to warn users closing an error that their model could be in a bad state (future sync errors etc) 2024-07-01 10:43:07 +10:00
Dion Moult fe8d42c27c Minor fix for missing flip button for doors 2024-07-01 10:30:16 +10:00
Dion Moult 688c841a8e Fix #4946. Refactor model wall join operators into core for better error reporting
The operator is no longer needed and all the variations can be called exactly at the workspace hotkey level now (and thus nested operator errors won't cause runtime exceptions)
2024-07-01 10:15:48 +10:00
Dion Moult 989219e1e2 See #4946. Slowly start refactoring out model module into core for better error handling. 2024-07-01 00:10:51 +10:00
Dion Moult f2c3e62ba1 Minor signature clean up to tool.Model.load_openings (unused arg) 2024-06-30 21:46:21 +10:00
Dion Moult 73f546aab1 Don't attempt to manipulate type visibility when selecting a type. 2024-06-30 21:46:03 +10:00
Dion Moult c4b3e57677 Fix bug where using the alignment tool broke on flipped non-LAYER2 objects
The alignment tool was initially designed specifically for LAYER2 objects. It doesn't have to be, so now LAYER2 is a special case where it may have its baselines and sidelines aligned whereas non-LAYER2 objects simply align based on bbox.
2024-06-30 21:40:21 +10:00
Dion Moult 4e9f2ea4b2 Add georeferencing integration tests 2024-06-30 17:01:39 +10:00
Dion Moult 2efeb6edb3 Fix bug where context has no active_object when creating a new project from File > New with a preset 2024-06-29 22:20:08 +10:00
Thomas Krijnen c68dcba087 Implement element-hierarchy setting in USD 2024-06-29 14:16:07 +02:00
Thomas Krijnen a92d51aeb1 Merge branch 'v0.8.0' of https://github.com/IfcOpenShell/IfcOpenShell into v0.8.0 2024-06-29 14:14:59 +02:00
Dion Moult 0544bbc886 Temporarily disable material listeners as they need to be rewritten anyway (ideally without listeners) with the new style system
At least now we can create types for testing
2024-06-29 21:39:38 +10:00
Dion Moult 9a871f1459 Merging projects can now handle projects with different false origins
Warning: I haven't yet looked at rotations. Yikes. No CRS reprojection either.
2024-06-29 17:05:06 +10:00
Dion Moult 0d401c9272 Fix bug where migrating length units didn't change properties. Unit utility for checking attribute types now considers select types too
Changing properties is very critical for IFC2X3 georeferencing which is stored in a pset.
2024-06-29 17:04:27 +10:00
Dion Moult 2129350ab7 Fix bug where MergeProject didn't clean up duplicate CRS and coordinate operations 2024-06-29 17:03:26 +10:00
Dion Moult 43bc979114 The MergeProject recipe now accepts a file object, not always a filepath 2024-06-29 17:01:58 +10:00
Thomas Krijnen a0458eeb91 Fix USD transformations after v0.8 migration 2024-06-28 20:26:11 +02:00
Thomas Krijnen c7232a780a Remove debug print 2024-06-28 16:21:33 +02:00
Thomas Krijnen e96b4c11a2 Implement edge as top-level representation item #4924 2024-06-28 16:19:43 +02:00
Thomas Krijnen fecca6a8b2 What a bad idea to let ellipse inherit from circle" 2024-06-28 16:19:43 +02:00
Andrej730 1fc56585dd Support loading BlenderBIM in Blender 4.2+ as an extension
1) Used a hack to bring `blenderbim` into the main namespace instead of `bl_ext.repository.blenderbim`. This is not an official way to do it but this works for testing stuff (official way is to create a stub wheel that would redirect all `blenderbim` requests to `bl_ext.repository.blenderbim`).
2) AddonPreferences now require blender package name as it's bl_idname (e.g. bl_ext.repository.blenderbim)
3) Addressing preferences now also works through the blender package name. Created method in tool/Blender.py to incapsulate those details.
2024-06-28 18:46:08 +05:00
Andrej730 d1be0e8c1c create_shape - raise the same error for representations and rep items
To be consistent with how it's handled when product+representation is passed, previously it would fail silently.
2024-06-28 18:24:58 +05:00
Andrej730 dcc568f5a3 ifcopenshell.geom.create_shape - expose geometry_library argument 2024-06-28 18:24:58 +05:00
Andrej730 2e4a2712e9 ifcopenshell.geom - document available geometry libraries 2024-06-28 18:24:58 +05:00
Andrej730 d4b055aeb2 Open recent IFC project #3657
Example - https://imgur.com/a/EDfBTJS

Paths to the opened IFC projects are now stored and then you can open them from File -> Open Recent IFC Project menu. It's done in very similar way to how Blender does it, list of files is stored in `Blender\4.1\config\recent-ifc-projects.txt`.
2024-06-28 18:24:58 +05:00
Andrej730 0e2cc463c8 Fix issue loading curve representations #4924
Issue occurred in the process of solving #4843.
2024-06-28 18:16:32 +05:00
Andrej730 c3930a6573 black format 2024-06-28 18:16:32 +05:00
Andrej730 3c094b7bd2 typing 2024-06-28 18:16:32 +05:00
Dion Moult f8dffa1a9b Move new project wizard into its own panel and actually title it "New Project Wizard" for clarity 2024-06-28 22:50:02 +10:00
Dion Moult 03b6c08c50 Remove unload project button - superseded by Convert To Blender File operator 2024-06-28 22:50:02 +10:00
Thomas Krijnen 42b96d6290 Further work on trying to get orientation properly mapped 2024-06-28 13:41:01 +02:00
Thomas Krijnen c240f0582a Add TBB_INCLUDE_DIR 2024-06-28 13:40:19 +02:00
Thomas Krijnen 76b7748be1 Note some time points #4915 2024-06-28 13:39:58 +02:00
Thomas Krijnen a2334f4ce0 More 4X3 non-ADD2 permissiveness in param values on polynomials 2024-06-28 13:39:19 +02:00
Thomas Krijnen db50c87bf4 Fixed collections not being geom_items in mapped item handling 2024-06-28 13:38:56 +02:00
Thomas Krijnen dc8766cf0a Formatting improvements 2024-06-28 13:38:36 +02:00
Dion Moult 158f3d2962 Migrating calendar dates from IFC2X3 to IFC4 is now supported 2024-06-28 21:36:45 +10:00
Dion Moult 008fa70345 Fix failing collector tests to align with new behaviour 2024-06-28 21:15:53 +10:00
ay-ex e59cd80868 fix choco release (#4941)
* fix choco action

* fix choco action env vars

* fix choco action env vars

* fix choco action py version source regex
2024-06-28 19:33:58 +10:00
Dion Moult f0d7965d49 Fix #4804. Prevent possible execution of toggle edit mode if there is no active object.
Recent changes in the UI already make this very unlikely - we don't show the ability to toggle edit mode pre-emptively in the viewport tob bar but just in case...
2024-06-28 14:25:56 +10:00
Dion Moult b616cafa49 Minor typing hint and disable linear position elements from loading 2024-06-28 13:01:15 +10:00
Dion Moult 70bb0e5481 Update doc code examples to use static functions 2024-06-28 12:54:14 +10:00
Dion Moult 07060fc769 Replace all ifcopenshell.api.run with ifcopenshell.api static functions. 2024-06-28 12:36:31 +10:00
Dion Moult b5d613989e Merge pull request #4938 from Vanuan/documentation_geometry
[docs] Geometry related documentation
2024-06-28 07:05:46 +10:00
Vanuan f604aa8b6b Geometry related documentation 2024-06-27 23:40:39 +03:00
Andrej730 dc8912c128 -m ifcopenshell.validate not to print an empty line if file is valid 2024-06-27 18:26:49 +05:00
Andrej730 07a0b4fe2d -m ifcopenshell.validate to print a message if file is valid 2024-06-27 18:26:49 +05:00
Andrej730 eb67ffcbec Use ifc4 for enum entities in select attributes validation test #4927 2024-06-27 18:26:49 +05:00
Andrej730 4ec8345716 typing 2024-06-27 18:26:49 +05:00
Andrej730 56d3b2ca36 Use release ifc4x3 version for validation tests 2024-06-27 18:26:49 +05:00
Andrej730 dd06b1a6c4 small addition to 14dbe121f 2024-06-27 18:26:49 +05:00
Dion Moult 3469a9caad See #4727. Load alignments (linear elements, linear positioning elements, and referents) by default. 2024-06-27 21:49:44 +10:00
Thomas Krijnen 599ca56496 Mark piecewise_function as geom_item #4727 2024-06-27 09:33:04 +02:00
Andrej730 14dbe121f6 update serializer settings literals #4912 2024-06-27 10:59:35 +05:00
Dion Moult dee936b2c3 Fix beam Qto length and add more Qto mappings 2024-06-27 14:32:56 +10:00
mat a98cddf676 Add Text Literal re-ordering #3643 2024-06-27 12:41:33 +10:00
Dion Moult 48d058a32a Fix #4921. When upgrading to IFC4X3, preprocess the file to remove deprecated style assignments 2024-06-27 11:49:12 +10:00
Dion Moult 98afb72ba3 Prefer MapConversionScaled in IFC4X3 for SetFalseOrigin 2024-06-27 11:49:12 +10:00
Dion Moult 2d5be6cf89 Search replace 0.7.0 with 0.8.0 2024-06-27 11:49:12 +10:00
Thomas Krijnen 1299a8f512 Mark edge as geom_item 2024-06-26 21:21:47 +02:00
Thomas Krijnen eccbdfa76e Eval eigen auto #4727 2024-06-26 21:21:47 +02:00
Andrej730 24e16d97f3 deprecate non-batching api #4474 2024-06-26 18:11:07 +05:00
Andrej730 13d61f0135 rename sequence.assign_workplan for consistency 2024-06-26 17:17:34 +05:00
Andrej730 c56a4a6c9d Fix console errors from Representations UI if non-product element is selected 2024-06-26 17:17:34 +05:00
Andrej730 832dce462e spatial manager - fix bug with elevation not converted to si
Leading to issues if you would change it in non-meters project.
2024-06-26 17:17:34 +05:00
Andrej730 6f45373edd move switch_shading method from prop to tool 2024-06-26 17:06:30 +05:00
Andrej730 d5613e0e26 typing 2024-06-26 17:06:30 +05:00
Andrej730 d0ec4fe345 core tests - print unprocessed calls in pytest verbose mode
e.g. if you start test with pytest test_style.py -vv it will be easier to guess why it couldn't find a call
```
E               Exception: <class 'abc.Ifc'> was not called with run:
E                - {'type': 'SHOULD_BE_CALLED', 'number': None, 'call': {'name': 'run', 'args': ('style.add_surface_style',), 'kwargs': {'style': 'style', 'ifc_class': 'IfcSurfaceStyleShading', 'attributes': 'attributes'}}}
E               Unprocessed calls:
E                - {'name': 'run', 'args': ('style.add_style',), 'kwargs': {'name': 'name'}}
E                - {'name': 'link', 'args': ('element', 'obj'), 'kwargs': {}}
E                - {'name': 'run', 'args': ('style.add_surface_style',), 'kwargs': {'style': 'element', 'ifc_class': 'IfcSurfaceStyleShading', 'attributes': 'attributes'}}
```
2024-06-26 16:14:00 +05:00
Andrej730 665bf00f8b fix core.style tests #4843 2024-06-26 16:14:00 +05:00
Andrej730 2d2ca64a72 Do not use tool.Ifc.Operator if no ifc data is changed 2024-06-26 16:14:00 +05:00
Andrej730 60cb41a428 remove some props from Material.BIMStyleProperties as deprecated #4843 2024-06-26 16:13:59 +05:00
Andrej730 a69f3e8da9 remove unnecessary linking in IfcImporter.create_style #4843
As it's already linked by `self.link_element(style, blender_material)`
2024-06-26 16:13:59 +05:00
Andrej730 2f81cab5f1 deprecate Material.BIMMaterialProperties #4843
As it now stored just 1 property and it's now moved to the BIMStyleProperties.
2024-06-26 16:13:59 +05:00
Andrej730 78e81542d9 fix couple issues after ce9e4f285 #4843
1) BBIM was failing to unregister properly.
2) Failed to link materials on load.
3) Failed to purge IFC file.
4) Error changing style name
2024-06-26 16:13:59 +05:00
Andrej730 7bbc81b7c3 create_shape - include more types in the docs 2024-06-26 16:13:59 +05:00
ay-ex 6e6b256c22 fix use release tag for url, bump py version to 3.11 2024-06-26 19:37:37 +10:00
ay-ex d23eba9343 fix remove release needed check 2024-06-26 19:37:37 +10:00
ay-ex e899104d56 add simple check for "release needed?" 2024-06-26 19:37:37 +10:00
Dion Moult de00429df6 Make version in bot build download dynamic 2024-06-26 17:14:57 +10:00
Dion Moult 3aba82f608 Ensure all project feature tests pass 2024-06-26 17:14:39 +10:00
Dion Moult cb85b690e7 Bump bot build 2024-06-26 17:09:58 +10:00
Vanuan 527742ca93 Basic IFC concepts 2024-06-26 14:50:32 +10:00
Dion Moult b85dcdb437 Distribute IfcCityJSON on PyPI 2024-06-26 13:53:55 +10:00
Dion Moult f740ca3cf1 Distribute Ifc5D on PyPI 2024-06-26 13:02:59 +10:00
Dion Moult b9269b5a11 Distribute Ifc4D on PyPI 2024-06-26 13:02:18 +10:00
Dion Moult 16e98e1400 Distribute IfcFM on PyPI 2024-06-26 12:10:59 +10:00
Dion Moult 4976074b18 Distribute IfcDiff on PyPI 2024-06-26 12:03:08 +10:00
Dion Moult e670a7ca71 See #4826. If a Qto calculator returns none, don't fail
There can be valid reasons for this, such as if the calculator realises it cannot compute a value (e.g. no mass density when calculating weight)
2024-06-26 12:03:08 +10:00
Dion Moult d892ad956c See #4826. Fix Qto calculator which assumes that openings have a predefined type (in IFC2X3 they don't) 2024-06-26 12:03:08 +10:00
Vanuan ac42ed7bab Blender docs: More stubs, walls, doors, windows 2024-06-26 11:55:02 +10:00
Dion Moult bf677b839d Only get bot build binaries and use latest python to fix latest install issues 2024-06-26 10:24:32 +10:00
Dion Moult 464815b045 Update drawing generator to use v0.8.0 settings syntax 2024-06-26 09:20:46 +10:00
Dion Moult ae91c2b9f0 See #4919. Include pip install instructions for utils in docs. 2024-06-26 09:16:21 +10:00
Thomas Krijnen 39cd980008 Pin freetype version, incompatible change made 5d ago 2024-06-25 21:26:37 +02:00
Andrej730 f364643d7e fix assigning material usages / reloading reprs after c4ae9578e #4843 2024-06-25 18:30:52 +05:00
Andrej730 ef9bbd8de6 deprecate shading_checksum #4843
Changing diffuse color for Blender material now won't change the linked IFC style.

Since now all style parameters for styles are changed through styles UI and users shouldn't use Blender materials tab unless they want to do something advanced (though they are still currently can use it to assign material styles to the specific faces).

PS 1 less thing to sync 🥳
2024-06-25 18:30:52 +05:00
Andrej730 8172096a5b Do not directly access IfcStore.edited_objs 2024-06-25 18:30:52 +05:00
Andrej730 46d3d3afe1 calculate materials checksum in a common method 2024-06-25 18:30:52 +05:00
Andrej730 39cd4187ea Remove unused BIMMaterailProperties props #4843
attributes were deprecated in d219856
is_external and name were deprecated awhile ago in 3fe5c88 😁
2024-06-25 18:30:51 +05:00
Andrej730 d6a3bc3556 remove dead code for loading materials from external blend files
External blender materials are now supported from
2024-06-25 18:30:51 +05:00
Andrej730 ce9e4f2854 remove BIMObjectProperties from bpy.types.Material as deprecated #4843 2024-06-25 18:30:51 +05:00
Andrej730 7700e8016b ifcopenshell.geom.create_shape - document all return types 2024-06-25 18:30:51 +05:00
Andrej730 6e1ebb02ac file and entity - avoid infinite recursion if they fail to initialize
Example of the error:

Traceback (most recent call last):
  File "\test.py", line 133, in <module>
    ifc_file = ifcopenshell.file.from_string(ifc_str)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "\ifcopenshell\file.py", line 648, in from_string
    return file(ifcopenshell_wrapper.read(s))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "\ifcopenshell\file.py", line 264, in __init__
    raise exc(msg)
ifcopenshell.SchemaError: Unsupported schema: IFC2X3
Exception ignored in: <function file.__del__ at 0x00000250896EB740>
Traceback (most recent call last):
  File "\ifcopenshell\file.py", line 282, in __del__
    del file_dict[self.file_pointer()]
                  ^^^^^^^^^^^^^^^^^
  File "\ifcopenshell\file.py", line 424, in __getattr__
    return getattr(self.wrapped_data, attr)
                   ^^^^^^^^^^^^^^^^^
  File "\ifcopenshell\file.py", line 424, in __getattr__
    return getattr(self.wrapped_data, attr)
                   ^^^^^^^^^^^^^^^^^
  File "\ifcopenshell\file.py", line 424, in __getattr__
    return getattr(self.wrapped_data, attr)
                   ^^^^^^^^^^^^^^^^^
  [Previous line repeated 996 more times]
RecursionError: maximum recursion depth exceeded

Simple way to trigger those recursions was:

import ifcopenshell
ifcopenshell.file(schema="IFC4x3_RC4_43c3555")
ifcopenshell.entity_instance(("IFC4X3", "IfcPresentationStyleAssignment"))
2024-06-25 18:30:51 +05:00
Andrej730 d2e7e3daaf move ifc file handling logic to ifcopenshell.file
to reuse the same logic for both ifcopenshell.open and ifcopenshell.file.from_string()
2024-06-25 18:30:51 +05:00
Andrej730 5d6215d889 bim.unlink_object - add description 2024-06-25 18:30:51 +05:00
Andrej730 17eb45fb4e Object metadata to double check element belongs to the current project
Just to be safe if it got from other Blender session and there is an IFC element with the same id in the current project. I guess we can't check it anywhere but information in "Object metadata" should very accurate as here user might decide to unlink it.
2024-06-25 18:30:51 +05:00
Andrej730 0a06d58c42 typing 2024-06-25 18:30:50 +05:00
Andrej730 a65c6b6d3f bim.unlink_object to skip popup if element is not found
If element is not found then it should always use `should_delete == False`, so we can just hide the popup in that case so users won't get confused about what should they choose.
2024-06-25 18:30:50 +05:00
Andrej730 c5262274eb bim.unlink_style - fix issue saving project after unlinking 2024-06-25 18:30:50 +05:00
Andrej730 65f94bcc0c Fix for console errors in a0e5d350b when no material active 2024-06-25 18:30:50 +05:00
Ziad-I 804bbc47c3 fix exception when global id is not included in csv data 2024-06-25 23:15:58 +10:00
Ziad-I a967665cbd slight html/js/css changes 2024-06-25 23:15:58 +10:00
Ziad-I cbd017aceb now sets active object too when selecting from web UI 2024-06-25 23:15:58 +10:00
Ziad-I 8d9d142bc2 reorganize JS code to be outside of document.ready 2024-06-25 23:15:58 +10:00
Ziad-I f6c30f2ddf improved send function logic to make there be 1 function only 2024-06-25 23:15:58 +10:00
Ziad-I d2a27999ba add handling for web operator selection
where if user click on item in the table it gets selected in blender
2024-06-25 23:15:58 +10:00
Ziad-I 2738b280a1 now shows ifc file name before table 2024-06-25 23:15:58 +10:00
Ziad-I c8946a19f2 edit html/js/css to use tabulator to show csv data 2024-06-25 23:15:58 +10:00
Ziad-I 6b1932c8d9 add event listeners in sioserver.py
added event listeners for sending csv data from blender and receiving operator data from web UI
2024-06-25 23:15:58 +10:00
Ziad-I a133b51dcc add new output format "web". might need to...
might need to rewrite the logic for the output format "web" at a later date if there is a better way
2024-06-25 23:15:58 +10:00
Ziad-I 6155edef0d made sending data take the event and namespace names as args 2024-06-25 23:15:58 +10:00
Thomas Krijnen 439595f04c Update build-all.py #3927 2024-06-25 11:44:26 +02:00
Thomas Krijnen c1fa9fe28e Option to read VERSION file in cmake #3927 2024-06-25 11:40:42 +02:00
Thomas Krijnen 54a0a5b454 Some more python mapping wrapping experiments 2024-06-24 21:57:16 +02:00
Thomas Krijnen bace73f854 Switch back to minkowski dilation for the time being 2024-06-24 21:56:57 +02:00
Thomas Krijnen 8da68f599b Move print() to header, distinguish properly between curve_sense and edge orientation, unwrap trimmed curves as edge bases, don't mutated cached edge in oriented edge processing, etc. #4895 2024-06-24 21:56:27 +02:00
Thomas Krijnen 278524ee3e Uninitialized use of context 2024-06-24 21:52:31 +02:00
Thomas Krijnen a9912f351f Don't dereference empty unit assignment list 2024-06-24 21:52:08 +02:00
Thomas Krijnen 1e5c51e5b2 Update main.py 2024-06-24 21:48:54 +02:00
Dion Moult 44100f3c46 Fix isolating drawing camera now that we have a new collection structure 2024-06-24 23:41:00 +10:00
Dion Moult 713e9c8e14 Minor fix in IfcFM to derive occurrences from types (and make it easier to override) 2024-06-24 23:41:00 +10:00
Dion Moult e6238a1f75 Georeference UI now lets you edit either a decimal degrees angle or an abscissa ordinate and calculates on the fly
Seriously no normal person uses abscissa and ordinate
2024-06-24 23:41:00 +10:00
Dion Moult cfd440dae9 Remove georeferencing orientation calculator UI because it's superseded by built-in angle calculators 2024-06-24 23:41:00 +10:00
Andrej730 a0e5d350bd Small UI in Blender material properties tab with unlinking #4843
Example - https://i.imgur.com/7VqIowz.png

This tab is needed only to indicate whether style is linked to some IFC element and to unlink it. Unlinking from Blender material makes much more sense as you can see from this tab what you're actually unlinking.
Unlinking for styles now works very similar to how it works for objects.
2024-06-24 18:37:55 +05:00
Andrej730 c37240cf96 pyproject.toml - disable pyright setting that conflicts with Blender api
See https://github.com/microsoft/pylance-release/issues/5457
2024-06-24 18:34:01 +05:00
Andrej730 115844279f fix removing objects with materials after c4ae9578e #4843
temporary fix, we probably should indeed just get rid of that listener
2024-06-24 18:34:00 +05:00
Andrej730 cbb7c5620d Fix unlinking objects with should_delete=False after 75f8e75
It was keeping a reference to that object in IfcStore which could lead to issues.
2024-06-24 18:34:00 +05:00
Andrej730 6d5d15793b record material checksum if styles were changed during material assignment
previously they wasn't recorded leading to the applying them to the representation items on save
2024-06-24 18:34:00 +05:00
Andrej730 8ac6f59394 typing 2024-06-24 18:34:00 +05:00
Andrej730 5d8addf1f8 remove optimization option deprecated after e3cb811 2024-06-24 18:34:00 +05:00
Andrej730 9b9301cbb0 ifc4x3 docs parser - use release ifc4x3 version 2024-06-24 15:22:02 +05:00
Andrej730 4d9b461776 Update ifc4x3 docs with ifc4x3_add2 release version 2024-06-24 15:22:02 +05:00
Andrej730 36f7cdacbd ifc4x3 docs - temporary fix for issue upstream
see https://github.com/buildingSMART/IFC4.3.x-development/issues/754
2024-06-24 15:22:02 +05:00
Andrej730 feb0e46257 More readable error if express file is missing 2024-06-24 15:22:02 +05:00
Andrej730 0b901bff5f typing 2024-06-24 15:22:02 +05:00
Dion Moult b45b0f2c81 There is now an explicit "remove true north" button to make it consistent with other buttons like remove georeferencing 2024-06-24 18:21:06 +10:00
Dion Moult 7a36c05c30 Implement WCS consideration in XYZ <-> ENH conversions. 2024-06-24 18:21:06 +10:00
Dion Moult ac58e6b8b2 Minor fix to new collection organisation for drawings 2024-06-24 18:21:06 +10:00
Dion Moult 68d3771a83 Change active layer collection when setting a new default container 2024-06-24 18:21:06 +10:00
Kristoffer Andersen 80349d70d8 Update ci-ifcopenshell-conda-cleaner.yml
fix missing env activation defaults
2024-06-24 08:41:46 +02:00
Dion Moult e295d596fe Split true north in API and Blender UI to be editable independent of georeferencing
They are two separate concepts, after all.
2024-06-23 23:19:27 +10:00
Dion Moult 013b138e5c Default to adding EPSG:3857 when adding georeferencing and let users choose an EPSG when adding. 2024-06-23 23:17:44 +10:00
Dion Moult 95d2d0af83 You can now see and edit WCS in the Blender UI (new API for it too) 2024-06-23 22:23:48 +10:00
Dion Moult 03ee826e67 Add tests for xaxis and yaxis angle conversions
This tricked me today, the "XAxis" and "YAxis" vectors are from different perspectives (yikes!). XAxis is from the perspective of grid north, and YAxis is from the perspective of project north. I'm following this convention because that's what buildingSMART docs do but just FYI they serve two different purposes!
2024-06-23 22:23:48 +10:00
Kristoffer Andersen 9f31815d9e add conda cron daily cleaner (#4910) 2024-06-23 09:11:17 +02:00
Ryan Schultz 1e9bfec655 Fix #4493 - Save drawing boundaries on bim.activate_drawing as well. 2024-06-22 11:44:42 -05:00
Dion Moult fd8cb7e8ed Implement Blender UI for handling new coordinate operations in IFC4X3 2024-06-22 23:32:25 +10:00
Dion Moult 4ef237e0f7 Implement purge map unit when removing georeferencing and removing 2X3 and 4X3 georeferencing in API 2024-06-22 22:13:20 +10:00
Dion Moult 3c48cfbc19 Add support for IfcRigidOperation and IfcMapConversionScaled in API 2024-06-22 21:59:09 +10:00
Dion Moult 177d43c30e Redesign georeference calculator UI to show units and be explicit about local vs map (instead of input vs output) 2024-06-22 16:29:36 +10:00
Dion Moult a6c3ae8446 Typing and update geolocation conversion utils to follow IFC4X3 rules about unit scaling 2024-06-22 15:52:00 +10:00
Dion Moult d0373da0ad Update XYZ <-> ENH geolocation conversion after the clarifications made on how to handle scale in IFC4X3 2024-06-22 14:47:42 +10:00
John Yani 7bb3de8371 Add documentation for toolbar (#4907) 2024-06-22 13:36:21 +10:00
Dion Moult 45e0045820 Fix bug where merge duplicate types would trigger listeners in an active Blender session. Stop using listeners, I guess? 2024-06-21 23:32:53 +10:00
Dion Moult 347b2b783d Minor doc fix to SetFalseOrigin code example 2024-06-21 23:32:53 +10:00
Dion Moult 2fc7cc7de2 Show georeferencing unit symbols to make it clearer what units things are in 2024-06-21 23:32:53 +10:00
Andrej730 4d39804045 docs code block formatting
`console` type code-block is designed mainly for examples of the console commands with the output.

If it's just a shell script with comments, then `console` only gets in the way - e.g. if you try to select a console code block manually, you won't be able to select comment symbol `#` at the beginning of the command making code unrunnable if you try to copy and run it. I've replaced it with `bash` or `bat` (for Windows) code blocks where `console` wasn't necessary.

I've also removed `$` symbols at the beginning of the commands if it's not a `console` code-block - since otherwise it just breaks "Copy Code Block" because you copy unrunnable code.
2024-06-21 18:28:59 +05:00
Andrej730 746051815d TesselateElement ifcpatch recipe to support product types
Previously it would just fail if you provide some IfcTypeProduct in the patch query
2024-06-21 17:50:22 +05:00
Andrej730 4385bf0bcc create_shape - note about IfcTypeProducts 2024-06-21 17:50:22 +05:00
Andrej730 1e092c140f add ifc2x3 support for 301cdf650 2024-06-21 17:50:22 +05:00
Andrej730 c4ae9578e9 fix styles update on material assignment/unassignment #4843 2024-06-21 17:50:22 +05:00
Andrej730 a834e5b4cd element.get_type doc note 2024-06-21 17:50:22 +05:00
Andrej730 e329b18e33 simplify process of loading blender materials #4843
We no longer traverse through representations searching for IfcSurfaceStyles and just rely on geometry.materials.
Possible after #4886 since:
- create_shape is now considering inherited materials
- material.instance_id is not returning IfcMaterial's style id instead of IfcMaterial id.
2024-06-21 17:50:22 +05:00
Andrej730 5731c4036a unresolve_type_representation - typing and small optimization 2024-06-21 17:49:02 +05:00
Andrej730 a594a6cfe2 typing 2024-06-21 17:49:02 +05:00
Andrej730 8b6235f42f fix TessellateElements ifcpatch recipe
TessellateElements patch was failing because it was relying on optionality of `edges` argument. Though argument itself is currently useless and not used in the code.
2024-06-21 17:49:02 +05:00
Andrej730 d443c5e2a6 element.get_type - check schema explicitly for a small optimization
Previously if product had no types it would still run through all element.IsDefinedBy and check if they are IfcRelDefinesByType even if it's not IFC2X3.
2024-06-21 17:49:02 +05:00
Andrej730 68d3539a86 mapping binding - never overwrite already set item->instance
1) this way code should be more straightforward
2) this allows us not to reimplement mapping.get_surface_style logic in IfcGeomWrapper as it will be already handled in map_impl(const IfcSchema::IfcStyledItem* inst) and the resulting item->instance is not overridden by IfcStyledItem.
2024-06-21 14:52:37 +05:00
Andrej730 301cdf6504 Fix creating representation with inherited materials
It should be considered as inherited material can also have a style.
Though occurrence's material is still prioritized.
2024-06-21 14:52:37 +05:00
Andrej730 882e0a4ae9 Fix instance_id in geometry.materials returning material id instead of style id 2024-06-21 14:52:37 +05:00
John Yani f921b65953 Major documentation refactoring (#4905) 2024-06-21 17:54:05 +10:00
Andrej730 1e26587bd3 geometry.import_representation to disable apply-default-materials #4832
as material creator is not designed for this option
2024-06-21 12:11:47 +05:00
Dion Moult bce6485b91 Support adding / editing georeferencing for IFC2X3 fallback psets 2024-06-21 11:21:41 +10:00
Dion Moult a0cb980a8f See #4896. Bump to IDS v1.0. 2024-06-20 17:37:14 +10:00
Dion Moult fc0e9e900f Fix #3970. Show passing elements in IDS test report. 2024-06-20 16:36:18 +10:00
Dion Moult d700262e7f Support IDS tests for nest relationships in IFC2X3 2024-06-20 15:53:28 +10:00
Dion Moult d92679223e Fix #4879. Include metadata about original requirement in JSON reports. 2024-06-20 15:29:10 +10:00
Dion Moult 7ac117cd8d Use a json encoder for IfcTester JSON reports to ensure everything is stringable 2024-06-20 15:00:55 +10:00
Dion Moult b87a6bc15c Fix #4874. Checking restrictions of the wrong data type will now returned a failed result instead of an exception. 2024-06-20 13:22:16 +10:00
Dion Moult fbefe8c555 PartOf facet tests now give more granular reports on failing predefined type requirements 2024-06-20 12:58:42 +10:00
Dion Moult 030119fd0e Fix #4893. IfcTester now requires lowercase booleans or 0/1.
This changed on May 5: https://github.com/buildingSMART/IDS/issues/290
2024-06-20 09:52:45 +10:00
Dion Moult fcf2c37432 New SetFalseOrigin patch recipe to make it easy to "Just Fix It!"
This combines the best practices of a few other patch recipes to make it easy to say "this point here is this world coordinate".
2024-06-19 23:41:46 +10:00
Dion Moult fab3ee70dd Fix bug where 2D angles weren't correctly parsed in OffsetObjectPlacements recipe 2024-06-19 23:37:01 +10:00
Dion Moult 4738528e69 We now can do cartesian point offsets regardless if there is a false session origin or not.
For example, it doesn't matter if you have a false origin set or not, there can still be scenarios where local verts are far away.
2024-06-19 23:33:16 +10:00
Thomas Krijnen 88c8bcf119 Pin OCCT serialization version to v2 #4393 2024-06-19 14:44:52 +02:00
Ziad-I 3c3e4dd047 add pip install python-socketio and aiohttp in makefile 2024-06-19 13:17:29 +03:00
Thomas Krijnen b44b1cb8b0 Fix segfault on gcc #4832 2024-06-19 11:56:56 +02:00
Ziad-I 6ad2bef05c add webui server and static files 2024-06-19 12:27:03 +03:00
Andrej730 8e0c92d5eb Fix issue using IfcImporter after 8246d2c
E.g. there was an error on creating a project using demo template
2024-06-19 10:57:34 +05:00
Andrej730 6bafbd92f3 fix ui bug after 114fca8be 2024-06-19 10:57:34 +05:00
Andrej730 03663eec3f include socketio to fix starting bbim after 65a1fbe 2024-06-19 10:57:34 +05:00
Thomas Krijnen a3d4642ea9 Fix boolean results on non-solid shells #4832 2024-06-18 21:30:00 +02:00
Thomas Krijnen 0e42130e9d Taxonomy curve upgrades #4832 2024-06-18 20:18:39 +02:00
Thomas Krijnen 691fe549d7 taxonony::cast throws exceptions now on invalid casts 2024-06-18 13:52:42 +02:00
Thomas Krijnen f5979be4d5 Keep old behaviour of subtractions, when failed use first operand #4832 2024-06-18 13:09:32 +02:00
Kristoffer Andersen 9fe40c3137 make necessary changes for v0.8 daily conda builds (#4884)
* make necessary changes for v0.8 daily ci conda builds

* fix conda find hdf5 portion of CMakelists.txt
2024-06-18 12:52:00 +02:00
Thomas Krijnen 82496e8126 m4 not referenced in IfcEllipseProfileDef 2024-06-18 12:32:00 +02:00
Thomas Krijnen 9c22e6ecc8 Support evaluation of faces directly, add identity matrix on unplaced circle profile curves #4832 2024-06-18 12:32:00 +02:00
Thomas Krijnen 17a433a97b Don't pass around nullptr in case of failed representation mapping 2024-06-18 12:32:00 +02:00
Ziad-I b90c1ee7c9 forgot to undo changes after moving web UI code out to its own module/tool
forgot to remove changes done to csv module and search tool after moving web UI to its own module/tool
changes such as:
unused imports
panel header option
2024-06-18 18:31:39 +10:00
Ziad-I bd30f73b3a fix no such directory error when running server
and added a 0.5 sleep time between disconnecting and killing server
2024-06-18 18:31:39 +10:00
Ziad-I 0aad3d99b5 add data.py for web module and sending data via ws connection 2024-06-18 18:31:39 +10:00
Ziad-I f7d55a4a4a fix open_web_browser operator 2024-06-18 18:31:39 +10:00
Ziad-I df2655e7ae add open browser button and operator 2024-06-18 18:31:39 +10:00
Ziad-I 9ec51e040e change ui to show buttons according to connected/running
and moved setting is_connected and is_running to inside the tool itself
2024-06-18 18:31:39 +10:00
Ziad-I 467602aec3 add sending messages to server in web tool 2024-06-18 18:31:39 +10:00
Ziad-I 88610e23b2 move thread and asyncio loop management to its own class
as manually managing the thread and asyncio loop was quite a hassle. especially, cleanup after closing them.
2024-06-18 18:31:39 +10:00
Ziad-I 89fb59307c add disconnection from server functionality
had to refactor how the server connects
2024-06-18 18:31:39 +10:00
Ziad-I 65a1fbea78 add connection to webserver logic 2024-06-18 18:31:38 +10:00
Ziad-I 78bc8fe977 add methods to show running and connected status 2024-06-18 18:31:38 +10:00
Ziad-I 6ab08a2f49 remove debug flag in flask run command
removed debug flag in flask run command as it leaves a zombie process after closing blender
2024-06-18 18:31:38 +10:00
Ziad-I de7d315eb3 add starting webserver and terminating webserver 2024-06-18 18:31:38 +10:00
Ziad-I 24662d75e4 add tool methods to generate port and check port availability 2024-06-18 18:31:38 +10:00
Ziad-I 76e6697bbc remove open_web_ui button and operator from csv module 2024-06-18 18:31:38 +10:00
Ziad-I 3c2fcffd0d moved web ui logic to web tool/core 2024-06-18 18:31:38 +10:00
Ziad-I 0188757197 add new web module 2024-06-18 18:31:38 +10:00
Ziad-I 444554a12d add print messages and opening of web UI 2024-06-18 18:31:38 +10:00
Ziad-I ba42f01db2 add internal logic to start the web-ui websocket server
added internal logic to the Search tool/core to start the websocket server for the webui
2024-06-18 18:31:38 +10:00
Ziad-I 5d91766f07 changed the icon for the button to URL icon 2024-06-18 18:31:38 +10:00
Ziad-I c4cbc577d8 add open web ui button and dummy operator 2024-06-18 18:31:38 +10:00
Dion Moult bfd9cc0cf0 Allow calling ifcpatch from code with no arguments 2024-06-18 13:55:19 +10:00
Dion Moult ac0b5abfc5 You can now choose whether to use a cache / force reload a linked model 2024-06-18 12:51:14 +10:00
Dion Moult ad61cc3c92 Update linking styles to v0.8.0 syntax 2024-06-18 10:59:10 +10:00
Dion Moult 6fa586a1b6 When linking IFCs into a vanilla Blender session with no IFC, the origin from the first IFC you link determines the origin of subsequent links 2024-06-18 00:15:55 +10:00
John Yani 4c09773211 Refactor Project Info panel to clarify distinct modes (#4880)
* Rename modes in Project Info documentation

* Refactor project info panel UI code
2024-06-17 23:38:05 +10:00
Dion Moult 2300411ce4 Fix #4510. Linking in georeferenced models now reuses the host model's georeferencing settings
In addition to reusing a constant false origin, because we now reuse the same logic as project loading, we also now get the ability to mix map-conversion and non-map-conversion coordinates and also link in rotated models, not just translated.
2024-06-17 17:10:14 +10:00
Dion Moult 9c61a9eed7 Linking in models now uses the same cartesian point offset strategy as loading models with a dynamic distance limit
Previously, it would have a hardcoded 1km distance limit and any "far away" object would be treated as a chunk instead of an occurrence. Now it has dynamic distance limits and benefit from occurrence instancing.
2024-06-17 17:03:42 +10:00
Dion Moult 743a197542 False origin is always in terms of map coordinates, not as an offset.
Previously, the false origin would be in terms of local coordinates. This means that the same false origin would give two different results on files with different map conversions. Now, false origin is ... well, a true map coordinate and works equally for both IFCs with and without a map conversion.
2024-06-16 22:28:48 +10:00
Dion Moult 99f329c13d When guessing false origins, only consider geometry, not placements
Placements may be misleading and are "invisible". A far away placement and local geometry can cancel each other out.
2024-06-16 15:12:11 +10:00
Dion Moult 623d487df7 Use gross shapes for guessing false origins to be faster 2024-06-16 15:11:24 +10:00
Dion Moult 348ef4023f False origins can now be explicitly auto, manual, or disabled 2024-06-16 14:50:33 +10:00
Dion Moult b253b74e88 Linking projects now shares context prioritisation logic with regular project loading
This means it can link in more interesting shapes.
2024-06-16 14:21:25 +10:00
Dion Moult a3b6a6ea39 Black geom/main.py 2024-06-15 23:50:37 +10:00
Dion Moult 8246d2c593 Aggressively refactor out functions relevant to guessing a false origin to tool.Loader 2024-06-15 23:50:27 +10:00
Dion Moult 3a6cf0e5ae Fix #4854. Make IFC edit mode toggle dynamic to prevent editing uneditable things. 2024-06-15 16:40:53 +10:00
Dion Moult 1db26aab15 Fix #4837. Make mathutils dependency optional.
In the long term, I'd like to replace mathutils with numpy.
2024-06-15 15:10:36 +10:00
John Yani a23e6dcd66 Expand Project Info documentation. Reorganize General Usage (#4875) 2024-06-15 14:10:00 +10:00
Dion Moult 9331292dd1 Fix bug where editing qtos was hardcoded to IFC4. 2024-06-15 14:07:27 +10:00
Dion Moult cad7db0162 See #4838. Consistently use schema_identifiers throughout the code instead of schema to be more explicit.
This also means in the future we are better shaped to be a prototyping platform for future IFC versions.
2024-06-15 14:05:37 +10:00
Dion Moult 9f356542bc Remove dead code where material psets used to be on a bpy.types.Material 2024-06-15 13:29:48 +10:00
Andrej730 1f7d80e6f1 remove unused argument 2024-06-14 19:14:20 +05:00
Andrej730 f3f1e8721c remove name update for ifc materials based on blender materials name #4843 2024-06-14 19:14:20 +05:00
Andrej730 114fca8be5 unassociate bim.add_material from blender materials #4843 2024-06-14 19:14:20 +05:00
Andrej730 52167a47b9 minor refactor for bim.add_boolean
1)  Couple logic simplifications and info messages
2) Removed unlink as obj2 is a blender object (we check this before with `tool.Ifc.get_entity(obj2) == None`) and doesn't need to be unlinked
2024-06-14 19:14:20 +05:00
Andrej730 d4ff2c8dda typing 2024-06-14 19:14:20 +05:00
Andrej730 75f8e75a8e ifc.unlink fixes after 3df75e9af
Also some changes related to #4843

add
2024-06-14 19:14:19 +05:00
Andrej730 d0f612afc2 IfcStore.get_element - more explicit checks for missing elements 2024-06-14 19:14:19 +05:00
Andrej730 b6b681c244 bim.add_boundary - info message if no relevant elements selected 2024-06-14 19:14:19 +05:00
Dion Moult 5911a602b9 Purge legacy code which used JSON files for schema descriptions and entities
In our early days, we didn't use IfcOpenShell to dynamically query the schema.
2024-06-14 21:59:53 +10:00
Dion Moult 453ef437d3 Fix linking IFC coordinates to v0.8.0 2024-06-14 16:30:31 +10:00
Dion Moult 88494d3379 Linking IFCs now also includes spatial elements 2024-06-14 16:16:08 +10:00
John Yani 1b41440aba Update Blender BIM Project Info documentation (#4871)
* Update property-editor.rst

* Add project overview screenshots

* Update property-editor.rst

* Add BlenderBIM project info screenshots

* Update property-editor.rst
2024-06-14 14:48:49 +10:00
Dion Moult 105434fe68 See #4854. Don't show IFC mode UI if there is no IFC model.
Still quite a bit of work to be done here, but this is better than nothing.
2024-06-14 13:01:43 +10:00
Dion Moult a0a505d64b Minor fix to not show placement if offset is not applicable 2024-06-14 13:00:09 +10:00
Dion Moult 3a4bdd623d Fix #4867. Accommmodate invalid IFC data from 12D. 2024-06-14 09:18:14 +10:00
Andrej730 99338187de prevent possible errors initializing swig wrapper's Settings #4861 2024-06-13 18:19:12 +05:00
Andrej730 9d7ef6ff47 BBIM - fix invalid representation item style assignment in ifc2x3
It wasn't considering IfcPresentationStyleAssignment.
2024-06-12 18:24:14 +05:00
Andrej730 ffd944f4f9 style->instance_id to consider possible IfcPresentationStyleAssignment in ifc2x3/ifc4 2024-06-12 13:52:44 +02:00
Thomas Krijnen ecef745c3b OCCT doesn't like null shapes even on symmetric bools 2024-06-12 11:47:27 +02:00
Thomas Krijnen 44507785ac Rerun codegen 2024-06-12 11:47:27 +02:00
Thomas Krijnen 79c0246e6a Don't sort enum names for correspondence with header 2024-06-12 11:47:27 +02:00
Dion Moult 3c659a342f BCF workflow now uses VERSION 2024-06-12 19:23:10 +10:00
Dion Moult d192217e78 bSDD workflow now uses VERSION 2024-06-12 18:44:51 +10:00
Dion Moult 6474552649 IfcClash workflow now uses VERSION 2024-06-12 18:25:05 +10:00
Dion Moult 4b454dd646 IfcCSV workflow now uses VERSION 2024-06-12 18:15:13 +10:00
Dion Moult 85e1786ce5 IfcPatch workflow now uses VERSION 2024-06-12 18:05:33 +10:00
Dion Moult 45b81ab814 IfcTester workflow now uses VERSION 2024-06-12 17:52:35 +10:00
Dion Moult 8241b557fe Minor fix - add "unstable" word to Sverchok release and fix importing WAxes 2024-06-12 10:26:20 +10:00
Dion Moult 1312a8e704 Purge deprecated feature to enable coordination mode / merge modes in favour of new link IFC feature 2024-06-12 09:53:58 +10:00
Thomas Krijnen 2a5e42e359 Don't log 'no op defined' for failed conversions 2024-06-11 20:09:37 +02:00
Thomas Krijnen dae7d86dad Fix style lookup in accordance with v0.7 #4844 2024-06-11 20:09:37 +02:00
Andrej730 9906149b0d do not load ifc materials as blender materials #4843
also deprecate blender_material style argument as it's not used anywhere now
2024-06-11 18:26:19 +05:00
Andrej730 2e2c116180 deprecate mixing up ifc materials and styles in one blender material on loading #4843
Part of the transition process disconnecting blender materials from IFC materials to make it less confusing.

E.g. previously if we would load an element A with material M and style S it would load it as blender material M that looks like S.
But also if you would load element B with just style S, it would add it as blender material M though B has nothing to do with material M.
2024-06-11 18:26:19 +05:00
Andrej730 13c6b9d673 do not add Blender materials to objects without styles #4843
If part of the geometry has no style, we'll use empty empty material slots since Blender does require some material slot to assign each polygon to.
2024-06-11 18:26:19 +05:00
Andrej730 2fbac57faf remove bim.unlink_material #4843 2024-06-11 18:26:19 +05:00
Andrej730 f803447651 more safe collector.assign
Noticed after error below trying to duplicate an element

  File "addons\blenderbim\bim\module\geometry\operator.py", line 769, in execute
    return OverrideDuplicateMove.execute_duplicate_operator(self, context, linked=False)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "addons\blenderbim\bim\module\geometry\operator.py", line 778, in execute_duplicate_operator
    IfcStore.execute_ifc_operator(self, context)
  File "addons\blenderbim\bim\ifc.py", line 381, in execute_ifc_operator
    result = getattr(operator, "_execute")(context)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "addons\blenderbim\bim\module\geometry\operator.py", line 772, in _execute
    return OverrideDuplicateMove.execute_ifc_duplicate_operator(self, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "addons\blenderbim\bim\module\geometry\operator.py", line 855, in execute_ifc_duplicate_operator
    new = blenderbim.core.root.copy_class(tool.Ifc, tool.Collector, tool.Geometry, tool.Root, obj=new_obj)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "addons\blenderbim\core\root.py", line 54, in copy_class
    collector.assign(obj)
  File "addons\blenderbim\tool\collector.py", line 62, in assign
    collection.objects.link(obj)
RuntimeError: Error: Object 'IfcActuator/Cube.001' already in collection 'IfcBuildingStorey/My Storey'
2024-06-11 18:26:19 +05:00
Andrej730 bec834c651 typing 2024-06-11 18:26:19 +05:00
Andrej730 3df75e9af3 IfcStore.unlink_element breaking change
Previously there was a problem with this method that it might confuse Blender objects copied from other sessions (or even from the current session but a few steps back) from current IFC objects and might unlink them accidentally.

Option to provide either element or obj was more of a convenience feature but now they have a different meaning to clearly distinguish between unlinking ifc element and unlinking some blender object without touching any ifc elements.
2024-06-11 18:26:19 +05:00
Andrej730 6630db21ee Set apply default materials to False #4833
Since it's now True by default in v0.8.0, resetting it to False as it was in v0.7.0
2024-06-11 18:26:19 +05:00
Andrej730 f54f45a051 geom.settings - add a tooltip for available settings #4832
example - https://i.imgur.com/eTdqv5J.png
added a test so we won't miss if some setting will be added/removed
2024-06-11 18:26:18 +05:00
Thomas Krijnen acd4274136 Don't blindly assumes openings have representations for the selected contexts. #4832 2024-06-11 15:25:03 +02:00
Thomas Krijnen d400a48a9d Remember your own conventions: lines run along positive Z 2024-06-11 14:14:47 +02:00
Thomas Krijnen 4331f4f785 Don't stall threads on occt failures 2024-06-11 14:14:11 +02:00
Thomas Krijnen 95e36979d5 Don't link against svgfill from python when building without cgal #4832 2024-06-11 12:32:11 +02:00
Thomas Krijnen 07827940cc Some defensiveness against null shapes (should look into this better) 2024-06-11 11:20:55 +02:00
Thomas Krijnen c2efcda7bb Don't use cached items in multi-threaded mode for now until we have proper immutability 2024-06-11 11:20:40 +02:00
Thomas Krijnen aa0fbd434e Add geometry library install targets #4842 2024-06-11 10:33:19 +02:00
Dion Moult 8cff046a46 Doc download links now point to explicitly versioned releases, not bot builds
This ensures that IOS-Python always 1) has the appropriate version and 2) contains exactly the same content as PyPI (i.e. with the latest Python files that might be outdated from the bot builds)
2024-06-11 17:32:30 +10:00
Dion Moult ff4154c2bd Forgot to distribution Windows 32 bit IfcOpenShell-Python 2024-06-11 16:09:00 +10:00
Dion Moult d7e497727c More build fixes. 2024-06-11 16:01:14 +10:00
1395 changed files with 40218 additions and 48521 deletions
+2 -18
View File
@@ -1,24 +1,8 @@
name: ci-bcf-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-bcf-pypi.yml'
workflow_dispatch:
env:
major: 0
minor: 0
name: ifcopenshell
jobs:
activate:
runs-on: ubuntu-latest
@@ -48,10 +32,10 @@ jobs:
run: |
pip install build
cd src/bcf &&
make dist
make dist IS_STABLE=TRUE
- name: Publish a Python distribution to PyPI
uses: ortega2247/pypi-upload-action@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: src/bcf/dist
packages_dir: src/bcf/dist
+12
View File
@@ -0,0 +1,12 @@
name: ci-black-formatting
on:
push:
pull_request:
jobs:
lint-formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: psf/black@stable
+7 -54
View File
@@ -28,65 +28,18 @@ jobs:
build:
needs: activate
name: ${{ matrix.config.name }}-${{ matrix.pyver }}
name: "choco_release"
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
- uses: actions/checkout@v4
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
fetch-tags: true
fetch-depth: 0
- run: echo ${{ env.DATE }}
- name: Check in published releases if we should do a choco release
id: do_choco
- name: Check in release tags if we should do a choco release and perform the release if needed
id: do_choco_release
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."
python3 choco_release.py
+17 -13
View File
@@ -3,10 +3,10 @@ name: ci-blenderbim-daily
on:
push:
paths:
- '.github/workflows/ci-blenderbim-matrix.yml'
- '.github/workflows/ci-blenderbim-daily.yml'
- 'src/blenderbim/**'
- 'src/ifcopenshell-python/ifcopenshell/**'
- 'src/bcf/src/bcf/**'
- 'src/bcf/bcf/**'
- 'src/ifcclash/ifcclash/**'
- 'src/ifccobie/**'
- 'src/ifcdiff/**'
@@ -35,7 +35,7 @@ jobs:
strategy:
fail-fast: false
matrix:
pyver: [py39, py310, py311, py312]
pyver: [py310, py311, py312]
config:
- {
name: "Windows Build",
@@ -43,15 +43,15 @@ jobs:
}
- {
name: "Linux Build",
short_name: linux
short_name: linux,
}
- {
name: "MacOS Build",
short_name: macos
short_name: macos,
}
- {
name: "MacOS ARM Build",
short_name: macosm1
short_name: macosm1,
}
steps:
- uses: actions/checkout@v2
@@ -67,15 +67,19 @@ jobs:
run: echo "date=$(date +'%y%m%d')" >> $GITHUB_OUTPUT
- name: Compile
run: |
cp -r src/blenderbim src/blenderbim_${{ matrix.config.short_name }}_${{ matrix.pyver }} &&
cd src/blenderbim_${{ matrix.config.short_name }}_${{ matrix.pyver }} &&
make dist PLATFORM=${{ matrix.config.short_name }} PYVERSION=${{ matrix.pyver }}
cd src/blenderbim && make dist PLATFORM=${{ matrix.config.short_name }} PYVERSION=${{ matrix.pyver }}
- name: Find zip file name
id: find_zip
run: |
filepath=$(ls src/blenderbim/dist/blenderbim_*.zip)
echo "filepath=$filepath" >> $GITHUB_OUTPUT
echo "filename=$(basename $filepath)" >> $GITHUB_OUTPUT
- name: Upload zip file to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: src/blenderbim_${{ matrix.config.short_name }}_${{ matrix.pyver }}/dist/blenderbim-${{steps.version.outputs.version}}.${{steps.date.outputs.date}}-${{ matrix.pyver }}-${{ matrix.config.short_name }}.zip
asset_name: blenderbim-${{steps.version.outputs.version}}.${{steps.date.outputs.date}}-${{ matrix.pyver }}-${{ matrix.config.short_name }}.zip
release_name: "blenderbim-${{steps.version.outputs.version}}.${{steps.date.outputs.date}} (unstable)"
tag: "blenderbim-${{steps.version.outputs.version}}.${{steps.date.outputs.date}}"
file: ${{ steps.find_zip.outputs.filepath }}
asset_name: ${{ steps.find_zip.outputs.filename }}
release_name: "blenderbim-${{steps.version.outputs.version}}-alpha${{steps.date.outputs.date}} (unstable)"
tag: "blenderbim-${{steps.version.outputs.version}}-alpha${{steps.date.outputs.date}}"
overwrite: true
+15 -5
View File
@@ -1,5 +1,10 @@
name: ci-blenderbim
# Differences from ci-blenderbim-daily.yml:
# - make has IS_STABLE=TRUE
# - action is never triggered and executed only manually
# - doesn't add a current date to the release and tag
on:
workflow_dispatch:
@@ -19,7 +24,7 @@ jobs:
strategy:
fail-fast: false
matrix:
pyver: [py39, py310, py311, py312]
pyver: [py310, py311, py312]
config:
- {
name: "Windows Build",
@@ -48,15 +53,20 @@ jobs:
run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
- name: Compile
run: |
cp -r src/blenderbim src/blenderbim_${{ matrix.config.short_name }}_${{ matrix.pyver }} &&
cd src/blenderbim_${{ matrix.config.short_name }}_${{ matrix.pyver }} &&
cd src/blenderbim &&
make dist PLATFORM=${{ matrix.config.short_name }} PYVERSION=${{ matrix.pyver }} IS_STABLE=TRUE
- name: Find zip file name
id: find_zip
run: |
filepath=$(ls src/blenderbim/dist/blenderbim_*.zip)
echo "filepath=$filepath" >> $GITHUB_OUTPUT
echo "filename=$(basename $filepath)" >> $GITHUB_OUTPUT
- name: Upload zip file to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: src/blenderbim_${{ matrix.config.short_name }}_${{ matrix.pyver }}/dist/blenderbim-${{steps.version.outputs.version}}-${{ matrix.pyver }}-${{ matrix.config.short_name }}.zip
asset_name: blenderbim-${{steps.version.outputs.version}}-${{ matrix.pyver }}-${{ matrix.config.short_name }}.zip
file: ${{ steps.find_zip.outputs.filepath }}
asset_name: ${{ steps.find_zip.outputs.filename }}
release_name: "blenderbim-${{steps.version.outputs.version}}"
tag: "blenderbim-${{steps.version.outputs.version}}"
overwrite: true
+1 -14
View File
@@ -1,21 +1,8 @@
name: ci-bsdd-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 * *"
workflow_dispatch:
env:
major: 0
minor: 0
name: ifcopenshell
jobs:
activate:
runs-on: ubuntu-latest
@@ -39,7 +26,7 @@ jobs:
run: |
pip install build
cd src/bsdd &&
make dist
make dist IS_STABLE=TRUE
- name: Publish a Python distribution to PyPI
uses: ortega2247/pypi-upload-action@master
with:
+35
View File
@@ -0,0 +1,35 @@
name: ci-ifc4d-pypi
on:
workflow_dispatch:
jobs:
activate:
runs-on: ubuntu-latest
if: |
github.repository == 'IfcOpenShell/IfcOpenShell'
steps:
- name: Set env
run: echo ok go
build:
needs: activate
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
with:
python-version: '3.11' # Version range or exact version of a Python version to use, using SemVer's version range syntax
- name: Compile
run: |
pip install build
cd src/ifc4d &&
make dist IS_STABLE=TRUE
- name: Publish a Python distribution to PyPI
uses: ortega2247/pypi-upload-action@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: src/ifc4d/dist
+35
View File
@@ -0,0 +1,35 @@
name: ci-ifc5d-pypi
on:
workflow_dispatch:
jobs:
activate:
runs-on: ubuntu-latest
if: |
github.repository == 'IfcOpenShell/IfcOpenShell'
steps:
- name: Set env
run: echo ok go
build:
needs: activate
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
with:
python-version: '3.11' # Version range or exact version of a Python version to use, using SemVer's version range syntax
- name: Compile
run: |
pip install build
cd src/ifc5d &&
make dist IS_STABLE=TRUE
- name: Publish a Python distribution to PyPI
uses: ortega2247/pypi-upload-action@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: src/ifc5d/dist
@@ -0,0 +1,35 @@
name: ci-ifccityjson-pypi
on:
workflow_dispatch:
jobs:
activate:
runs-on: ubuntu-latest
if: |
github.repository == 'IfcOpenShell/IfcOpenShell'
steps:
- name: Set env
run: echo ok go
build:
needs: activate
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
with:
python-version: '3.11' # Version range or exact version of a Python version to use, using SemVer's version range syntax
- name: Compile
run: |
pip install build
cd src/ifccityjson &&
make dist IS_STABLE=TRUE
- name: Publish a Python distribution to PyPI
uses: ortega2247/pypi-upload-action@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: src/ifccityjson/dist
+1 -14
View File
@@ -1,21 +1,8 @@
name: ci-ifcclash-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 * *"
workflow_dispatch:
env:
major: 0
minor: 0
name: ifcopenshell
jobs:
activate:
runs-on: ubuntu-latest
@@ -39,7 +26,7 @@ jobs:
run: |
pip install build
cd src/ifcclash &&
make dist
make dist IS_STABLE=TRUE
- name: Publish a Python distribution to PyPI
uses: ortega2247/pypi-upload-action@master
with:
+65
View File
@@ -0,0 +1,65 @@
name: ci-ifcconvert
on:
workflow_dispatch:
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:
config:
- {
name: "Windows 64bit",
short_name: win64,
}
- {
name: "Windows 32bit",
short_name: win32,
}
- {
name: "Linux 64bit",
short_name: linux64
}
- {
name: "MacOS Intel 64bit",
short_name: macos64
}
- {
name: "MacOS Silicon 64bit",
short_name: macosm164
}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
with:
python-version: '3.11' # 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 version
id: version
run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
- name: Compile
run: |
cd src/ifcopenshell-python &&
make zip-ifcconvert PLATFORM=${{ matrix.config.short_name }}
- name: Upload zip file to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: src/ifcopenshell-python/dist/ifcconvert-${{ steps.version.outputs.version }}-${{ matrix.config.short_name }}.zip
asset_name: ifcconvert-${{ steps.version.outputs.version }}-${{ matrix.config.short_name }}.zip
release_name: "ifcconvert-${{steps.version.outputs.version}}"
tag: "ifcconvert-${{steps.version.outputs.version}}"
overwrite: true
+1 -14
View File
@@ -1,21 +1,8 @@
name: ci-ifccsv-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 * *"
workflow_dispatch:
env:
major: 0
minor: 0
name: ifcopenshell
jobs:
activate:
runs-on: ubuntu-latest
@@ -39,7 +26,7 @@ jobs:
run: |
pip install build
cd src/ifccsv &&
make dist
make dist IS_STABLE=TRUE
- name: Publish a Python distribution to PyPI
uses: ortega2247/pypi-upload-action@master
with:
+35
View File
@@ -0,0 +1,35 @@
name: ci-ifcdiff-pypi
on:
workflow_dispatch:
jobs:
activate:
runs-on: ubuntu-latest
if: |
github.repository == 'IfcOpenShell/IfcOpenShell'
steps:
- name: Set env
run: echo ok go
build:
needs: activate
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
with:
python-version: '3.11' # Version range or exact version of a Python version to use, using SemVer's version range syntax
- name: Compile
run: |
pip install build
cd src/ifcdiff &&
make dist IS_STABLE=TRUE
- name: Publish a Python distribution to PyPI
uses: ortega2247/pypi-upload-action@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: src/ifcdiff/dist
+35
View File
@@ -0,0 +1,35 @@
name: ci-ifcfm-pypi
on:
workflow_dispatch:
jobs:
activate:
runs-on: ubuntu-latest
if: |
github.repository == 'IfcOpenShell/IfcOpenShell'
steps:
- name: Set env
run: echo ok go
build:
needs: activate
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
with:
python-version: '3.11' # Version range or exact version of a Python version to use, using SemVer's version range syntax
- name: Compile
run: |
pip install build
cd src/ifcfm &&
make dist IS_STABLE=TRUE
- name: Publish a Python distribution to PyPI
uses: ortega2247/pypi-upload-action@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: src/ifcfm/dist
@@ -0,0 +1,104 @@
name: ci-ifcopenshell-conda-daily-cleaner
on:
workflow_dispatch:
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: "00 23 * * *" # 11min before utc midnight every day
env:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
NUM_SUPPORTED_VERSIONS: 5
jobs:
activate:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
if: |
github.repository == 'IfcOpenShell/IfcOpenShell'
steps:
- uses: mamba-org/setup-micromamba@v1 # https://github.com/mamba-org/setup-micromamba
with:
environment-name: test-env
create-args: >-
python=3.11
anaconda-client=1.12.3
- name: Run conda cleaner
run: |
python - << EOF
import os
from datetime import datetime, timedelta
from binstar_client.utils import get_server_api
from binstar_client.errors import BinstarError
# Configuration
api_token = os.environ.get('ANACONDA_TOKEN')
pkg_name = 'ifcopenshell'
channel_name = 'ifcopenshell'
# Authenticate with Anaconda
aserver_api = get_server_api(token=api_token)
# Get the list of packages in the channel
def get_package(filter_package_name: str = None):
try:
user_packages = aserver_api.user_packages(channel_name)
if filter_package_name:
user_packages = [pkg for pkg in user_packages if pkg['name'] == filter_package_name]
if len(user_packages) == 0:
print(f"No packages found for {filter_package_name}.")
if len(user_packages) > 1:
raise ValueError(f"Found {len(user_packages)} package for {filter_package_name}. Will only support 1 package.")
return user_packages[0]
except BinstarError as err:
raise ValueError(f"Failed to fetch packages: {err}")
# Delete a package version
def delete_package(package_name, version):
try:
aserver_api.remove_release(channel_name, package_name, version)
print(f"Deleted {package_name} version {version}")
except BinstarError as err:
print(f"Failed to delete {package_name} version {version}: {err}")
# Main logic
def main():
package = get_package(pkg_name)
if not package:
print("No packages found.")
return
number_of_supported_versions = ${{ env.NUM_SUPPORTED_VERSIONS }}
package_name = package['name']
versions = package["versions"]
if len(versions) <= number_of_supported_versions:
print(f"Number of versions {len(versions)} is less than or equal to {number_of_supported_versions}.")
return
# sort the versions in descending order
print(f"Before reversal: {versions=}")
versions.reverse()
print(f"After reversal: {versions=}")
releases = versions[number_of_supported_versions:]
for release in releases:
delete_package(package_name, release)
main()
EOF
@@ -2,21 +2,44 @@ name: ci-ifcopenshell-conda-daily-v0.8.0
on:
workflow_dispatch:
push:
branches:
- v0.8.0
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'
outputs:
version: ${{ steps.version.outputs.version }}
date: ${{ steps.date.outputs.date }}
verdate: ${{ steps.verdate.outputs.verdate }}
steps:
- uses: actions/checkout@v4
- name: Set env
run: echo ok go
- name: Get current version
id: version
run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
- name: Get current date
id: date
run: echo "date=$(date +'%y%m%d')" >> $GITHUB_OUTPUT
- name: Version + date str
id: verdate
run: echo "verdate='${{ steps.version.outputs.version }}alpha${{ steps.date.outputs.date }}'" >> $GITHUB_OUTPUT
test:
name: ${{ matrix.platform.distver }}-${{ matrix.pyver.name }}
name: ${{ matrix.platform.distver }}-${{ matrix.pyver.name }}-${{ matrix.variant }}
needs: activate
runs-on: ${{ matrix.platform.distver }}
defaults:
@@ -25,8 +48,9 @@ jobs:
strategy:
fail-fast: false
matrix:
variant: [novtk, all]
pyver: [
{ name: py311, distver: '3.11'},
# { name: py311, distver: '3.11'},
{ name: py312, distver: '3.12'}
]
platform: [
@@ -35,24 +59,28 @@ jobs:
{ name: macOS, distver: macos-latest, pkg_dir: 'osx-64' }
]
steps:
- uses: actions/checkout@v3
- name: Set up swap space
if: runner.os == 'Linux'
uses: pierotofy/set-swap-space@v1.0
with:
swap-size-gb: 10
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Download and extract MacOSX SDK
if: ${{ matrix.platform.name == 'macOS' }}
if: ${{ runner.os == '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
curl -L https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.13.sdk.tar.xz | tar -xvJf - -C /Users/runner/work/
- uses: mamba-org/setup-micromamba@v1 # https://github.com/mamba-org/setup-micromamba
with:
environment-file: conda/environment.build.yml
environment-name: test-env
create-args: >-
python=${{ matrix.pyver.distver }}
python=3.11
anaconda-client
boa
- name: create conda package dist dir
run: |
@@ -60,8 +88,10 @@ jobs:
- name: build & test ifcopenshell
run: |
boa build . --python ${{ matrix.pyver.distver }} --no-remove-work-dir --output-folder '${{ github.workspace }}/dist'
conda mambabuild . --python ${{ matrix.pyver.distver }} --no-remove-work-dir --output-folder '${{ github.workspace }}/dist' --variants='{variant: ${{ matrix.variant }}}'
working-directory: ./conda
env:
VERSION_OVERRIDE: ${{ needs.activate.outputs.verdate }}
- name: upload to anaconda
if: ${{ matrix.platform.name == 'win' }}
@@ -71,4 +101,4 @@ jobs:
- name: upload to anaconda
if: ${{ matrix.platform.name != 'win' }}
run: |
anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload --force --user ifcopenshell ${{ github.workspace }}/dist/${{ matrix.platform.pkg_dir }}/*.tar.bz2
anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload --force --user ifcopenshell ${{ github.workspace }}/dist/${{ matrix.platform.pkg_dir }}/*.tar.bz2
@@ -6,7 +6,6 @@ on:
tags:
- v0.**
jobs:
activate:
@@ -27,19 +27,19 @@ jobs:
pyver: [py39, py310, py311, py312]
config:
- {
name: "Windows Build",
name: "Windows 64bit",
short_name: win64,
}
- {
name: "Linux Build",
name: "Linux 64bit",
short_name: linux64
}
- {
name: "MacOS Build",
name: "MacOS Intel 64bit",
short_name: macos64
}
- {
name: "MacOS ARM Build",
name: "MacOS Silicon 64bit",
short_name: macosm164
}
steps:
@@ -57,7 +57,7 @@ jobs:
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 }}
make dist PLATFORM=${{ matrix.config.short_name }} PYVERSION=${{ matrix.pyver }} IS_STABLE=TRUE
- name: Publish a Python distribution to PyPI
uses: ortega2247/pypi-upload-action@master
with:
+8 -4
View File
@@ -22,19 +22,23 @@ jobs:
pyver: [py39, py310, py311, py312]
config:
- {
name: "Windows Build",
name: "Windows 64bit",
short_name: win64,
}
- {
name: "Linux Build",
name: "Windows 32bit",
short_name: win32,
}
- {
name: "Linux 64bit",
short_name: linux64
}
- {
name: "MacOS Build",
name: "MacOS Intel 64bit",
short_name: macos64
}
- {
name: "MacOS ARM Build",
name: "MacOS Silicon 64bit",
short_name: macosm164
}
steps:
+1 -14
View File
@@ -1,21 +1,8 @@
name: ci-ifcpatch-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 * *"
workflow_dispatch:
env:
major: 0
minor: 0
name: ifcopenshell
jobs:
activate:
runs-on: ubuntu-latest
@@ -39,7 +26,7 @@ jobs:
run: |
pip install build
cd src/ifcpatch &&
make dist
make dist IS_STABLE=TRUE
- name: Publish a Python distribution to PyPI
uses: ortega2247/pypi-upload-action@master
with:
+1 -1
View File
@@ -46,6 +46,6 @@ jobs:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: src/ifcsverchok/dist/ifcsverchok-${{steps.version.outputs.version}}.${{steps.date.outputs.date}}.zip
asset_name: ifcsverchok-${{steps.version.outputs.version}}.${{steps.date.outputs.date}}.zip
release_name: "ifcsverchok-${{steps.version.outputs.version}}.${{steps.date.outputs.date}}"
release_name: "ifcsverchok-${{steps.version.outputs.version}}.${{steps.date.outputs.date}} (unstable)"
tag: "ifcsverchok-${{steps.version.outputs.version}}.${{steps.date.outputs.date}}"
overwrite: true
+1 -14
View File
@@ -1,21 +1,8 @@
name: ci-ifctester-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 * *"
workflow_dispatch:
env:
major: 0
minor: 0
name: ifcopenshell
jobs:
activate:
runs-on: ubuntu-latest
@@ -39,7 +26,7 @@ jobs:
run: |
pip install build
cd src/ifctester &&
make dist
make dist IS_STABLE=TRUE
- name: Publish a Python distribution to PyPI
uses: ortega2247/pypi-upload-action@master
with:
@@ -1,34 +0,0 @@
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
+7 -1
View File
@@ -47,6 +47,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install xmlschema xsdata numpy lxml pytest isodate lark networkx tabulate python-dateutil shapely
pip install mathutils
pip install src/bcf --no-deps
pip install https://github.com/Andrej730/aud/archive/refs/heads/master-reduced-size.zip
@@ -125,4 +126,9 @@ jobs:
python tests.py
cd ../src/ifcopenshell-python
mv ifcopenshell ifcopenshell-local # Force testing on installed module
make test-safe
make test
cd ../bcf && make test
pip install requests
cd ../bsdd && make test
cd ../ifcpatch && make test
cd ../ifctester && make test
+26 -30
View File
@@ -26,49 +26,45 @@ For more information, see:
* [BlenderBIM Add-on Documentation](https://docs.blenderbim.org/index.html)
* [Add-on Installation](https://docs.blenderbim.org/users/installation.html)
* [Exploring an IFC model](https://docs.blenderbim.org/users/exploring_an_ifc_model.html)
Development is sponsored through your generous donations!
| 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) |
[![Open Collective Contributors](https://img.shields.io/opencollective/all/opensourcebim?label=Sponsors&color=22ce5f)](https://opencollective.com/opensourcebim/)
Contents
--------
Those marked with an asterisk are part of IfcOpenShell.
| Name | Description | License | Service |
| ------------------------- | --------------------------------------------------------------------- | ------------------- | ------- |
| bcf | Library to read and write BCF-XML and query OpenCDE BCF-API modules | LGPL-3.0-or-later | [![PyPI](https://img.shields.io/pypi/v/bcf-client?label=PyPI&color=006dad)](https://pypi.org/project/bcf-client/) |
| blenderbim | Add-on to Blender providing a graphical native IFC authoring platform | GPL-3.0-or-later | [![Official](https://img.shields.io/badge/BlenderBIM.org-Download-70ba35)](https://blenderbim.org/download.html) [![GitHub Unstable](https://img.shields.io/github/v/release/ifcopenshell/ifcopenshell?filter=blenderbim-*&label=GitHub-Unstable&color=f6f8fa)](https://github.com/IfcOpenShell/IfcOpenShell/releases?q=blenderbim&expanded=true) [![Chocolatey](https://img.shields.io/chocolatey/v/blenderbim-nightly?label=Chocolatey&color=5c9fd8)](https://community.chocolatey.org/packages/blenderbim-nightly/) |
| bsdd | Library to query the bSDD API | LGPL-3.0-or-later | [![PyPI](https://img.shields.io/pypi/v/bsdd?label=PyPI&color=006dad)](https://pypi.org/project/bsdd/) |
| 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 | [![PyPI](https://img.shields.io/pypi/v/ifc4d?label=PyPI&color=006dad)](https://pypi.org/project/ifc4d/) |
| ifc5d | Report and optimise cost information from IFC | LGPL-3.0-or-later | [![PyPI](https://img.shields.io/pypi/v/ifc5d?label=PyPI&color=006dad)](https://pypi.org/project/ifc5d/) |
| 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 | [![PyPI](https://img.shields.io/pypi/v/ifccityjson?label=PyPI&color=006dad)](https://pypi.org/project/ifccityjson/) |
| ifcclash | Clash detection library and CLI app | LGPL-3.0-or-later | [![PyPI](https://img.shields.io/pypi/v/ifcclash?label=PyPI&color=006dad)](https://pypi.org/project/ifcclash/) |
| ifcconvert | CLI app to convert IFC to many other formats | LGPL-3.0-or-later\* | [![Official](https://img.shields.io/badge/IfcOpenShell.org-Download-70ba35)](https://docs.ifcopenshell.org/ifcconvert/installation.html) [![GitHub](https://img.shields.io/github/v/release/ifcopenshell/ifcopenshell?filter=ifcconvert-*&label=GitHub&color=f6f8fa)](https://github.com/IfcOpenShell/IfcOpenShell/releases?q=ifcconvert&expanded=true)
| ifccsv | Library and CLI app to export and import schedules from IFC | LGPL-3.0-or-later | [![PyPI](https://img.shields.io/pypi/v/ifccsv?label=PyPI&color=006dad)](https://pypi.org/project/ifccsv/) |
| ifcdiff | Compare changes between IFC models | LGPL-3.0-or-later | [![PyPI](https://img.shields.io/pypi/v/ifcdiff?label=PyPI&color=006dad)](https://pypi.org/project/ifcdiff/) |
| ifcfm | Extract IFC data for FM handover requirements | LGPL-3.0-or-later | [![PyPI](https://img.shields.io/pypi/v/ifcfm?label=PyPI&color=006dad)](https://pypi.org/project/ifcfm/) |
| ifcmax | Historic extension for IFC support in 3DS Max | LGPL-3.0-or-later\* | [![Official](https://img.shields.io/badge/IfcOpenShell.org-Download-70ba35)](https://docs.ifcopenshell.org/ifcmax.html)
| ifcopenshell-python | Python library for IFC manipulation | LGPL-3.0-or-later\* | [![Official](https://img.shields.io/badge/IfcOpenShell.org-Download-70ba35)](https://docs.ifcopenshell.org/ifcopenshell-python/installation.html) [![GitHub](https://img.shields.io/github/v/release/ifcopenshell/ifcopenshell?filter=ifcopenshell-python-*&label=GitHub&color=f6f8fa)](https://github.com/IfcOpenShell/IfcOpenShell/releases?q=ifcopenshell-python&expanded=true) [![PyPI](https://img.shields.io/pypi/v/ifcopenshell?label=PyPI&color=006dad)](https://pypi.org/project/ifcopenshell/) [![Anaconda](https://img.shields.io/conda/vn/conda-forge/ifcopenshell?label=Anaconda&color=43b02a)](https://anaconda.org/conda-forge/ifcopenshell) [![Anaconda](https://img.shields.io/conda/vn/ifcopenshell/ifcopenshell?label=Anaconda-Unstable&color=43b02a)](https://anaconda.org/ifcopenshell/ifcopenshell) [![Docker](https://img.shields.io/docker/pulls/aecgeeks/ifcopenshell?label=Docker&color=1D63ED)](https://hub.docker.com/r/aecgeeks/ifcopenshell) [![AUR](https://img.shields.io/aur/version/ifcopenshell?label=AUR&color=1793d1)](https://aur.archlinux.org/packages/ifcopenshell) [![AUR Unstable](https://img.shields.io/aur/version/ifcopenshell-git?label=AUR-Unstable&color=1793d1)](https://aur.archlinux.org/packages/ifcopenshell-git) |
| ifcpatch | Utility to run pre-packaged scripts to manipulate IFCs | LGPL-3.0-or-later | [![PyPI](https://img.shields.io/pypi/v/ifcpatch?label=PyPI&color=006dad)](https://pypi.org/project/ifcpatch/) |
| ifcsverchok | Blender Add-on for visual node programming with IFC | GPL-3.0-or-later | [![GitHub Unstable](https://img.shields.io/github/v/release/ifcopenshell/ifcopenshell?filter=ifcsverchok-*.*.*.*&label=GitHub-Unstable&color=f6f8fa)](https://github.com/IfcOpenShell/IfcOpenShell/releases?q=ifcsverchok&expanded=true)
| ifctester | Library, CLI and webapp for IDS model auditing | LGPL-3.0-or-later | [![PyPI](https://img.shields.io/pypi/v/ifctester?label=PyPI&color=006dad)](https://pypi.org/project/ifctester/) |
The IfcOpenShell C++ codebase is split into multiple interal libraries:
| 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 |
| 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\* |
+1 -1
View File
@@ -1 +1 @@
0.7.9
0.7.11
+1 -1
View File
@@ -12,7 +12,7 @@
<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>
<licenseUrl>https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.8.0/COPYING</licenseUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<projectSourceUrl>https://github.com/IfcOpenShell/IfcOpenShell</projectSourceUrl>
<docsUrl>https://docs.blenderbim.org/</docsUrl>
-89
View File
@@ -1,89 +0,0 @@
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
def get_choco_package_info() -> str:
resp = request_repo_info(URL_CHOCO_PACKAGE)
html_txt = str(resp.read())
return html_txt
def get_latest_blender_version() -> list:
html_txt = get_choco_package_info()
return re.findall(RE_BLENDER_VERSION_MIN_MAJ_PAT, html_txt)
URL_IFCOS_RELEASES = "https://github.com/IfcOpenShell/IfcOpenShell/releases"
URL_CHOCO_PACKAGE = "https://community.chocolatey.org/packages/blender"
URL_BLENDER_CMAKE = "https://raw.githubusercontent.com/blender/blender/{}/build_files/cmake/Modules/FindPythonLibsUnix.cmake"
RE_BLENDER_VERSION_MIN_MAJ = r"Latest Version.+<span>Blender (\d+\.\d+)\..+</span>"
RE_BLENDER_VERSION_MIN_MAJ_PAT = r"Latest Version.+<span>Blender (\d+\.\d+\.\d+)</span>"
RE_BLENDER_PYTHON_VERSION_MAJ_MIN = r"(?:set|SET)\(_PYTHON_VERSION_SUPPORTED (\d+\.\d+)\)"
if sys.argv[1] == "--do_choco_release?":
now = datetime.datetime.now()
blenderbim_date = (now - datetime.timedelta(days=1)).strftime("%y%m%d")
resp = request_repo_info(URL_IFCOS_RELEASES)
text = str(resp.read())
if blenderbim_date in text:
print("do_choco_release", end="")
elif sys.argv[1] == "--latest_blender_release_maj_min_pat?":
latest_blender_version = get_latest_blender_version()
if latest_blender_version:
print(latest_blender_version[0], end="")
else:
print("[ERROR] could not determine blender_version_min_maj_pat")
quit(1)
elif sys.argv[1] == "--latest_blender_release_maj_min?":
html_txt = get_choco_package_info()
blender_version_min_maj = re.findall(RE_BLENDER_VERSION_MIN_MAJ, html_txt)
if blender_version_min_maj:
print(blender_version_min_maj[0], end="")
else:
print("[ERROR] could not determine blender_version_min_maj")
quit(1)
elif sys.argv[1] == "--latest_blender_python_version_maj_min?":
latest_blender_version = get_latest_blender_version()
if latest_blender_version:
latest_blender_version_tag = f"v{latest_blender_version[0]}"
resp = request_repo_info(URL_BLENDER_CMAKE.format(latest_blender_version_tag))
html_txt = str(resp.read())
found = re.findall(RE_BLENDER_PYTHON_VERSION_MAJ_MIN, html_txt)
if found:
print(found[0], end="")
else:
print("[ERROR] could not determine blender_python_version_maj_min")
quit(1)
elif sys.argv[1] == "--pyver?":
latest_blender_version = get_latest_blender_version()
if latest_blender_version:
latest_blender_version_tag = f"v{latest_blender_version[0]}"
resp = request_repo_info(URL_BLENDER_CMAKE.format(latest_blender_version_tag))
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="")
else:
print("[ERROR] could not determine pyver")
quit(1)
+212
View File
@@ -0,0 +1,212 @@
# commands to run it on a generic ubuntu 2404 oci container:
"""
apt update && apt install git wget curl ptpython mono-devel micro
mkdir -p /home/runner/work/IfcOpenShell && cd /home/runner/work/IfcOpenShell
git clone https://github.com/IfcOpenShell/IfcOpenShell
cd /home/runner/work/IfcOpenShell/IfcOpenShell/choco/blenderbim/
micro choco_release.py # paste this script, comment out push command
export CHOCO_TOKEN="secret_choco_release_token"
python3 choco_release.py
"""
import datetime
import hashlib
import os
import pathlib
import re
from urllib import request
def get_repo_tag_names():
git_return = os.popen("git tag -l").read()
tag_names = [tag_name for tag_name in git_return.split("\n") if tag_name]
print(f"{len(tag_names)} tag_names found in repo")
return tag_names
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
def get_choco_package_info() -> str:
resp = request_repo_info(URL_CHOCO_PACKAGE)
html_txt = str(resp.read())
return html_txt
def get_latest_choco_blender_version() -> list:
html_txt = get_choco_package_info()
return re.findall(RE_BLENDER_VERSION_MIN_MAJ_PAT, html_txt)
def get_file_sha256_hash(file_path):
BLOCKSIZE = 65536
hasher = hashlib.sha256()
with open(file_path, "rb") as input_file:
buffer = input_file.read(BLOCKSIZE)
while len(buffer) > 0:
hasher.update(buffer)
buffer = input_file.read(BLOCKSIZE)
return hasher.hexdigest()
def quit_with_error_message(message: str):
print(f"ERROR: {message}")
quit(0)
start = datetime.datetime.now()
URL_CHOCO_PACKAGE = "https://community.chocolatey.org/packages/blender"
URL_BLENDER_CMAKE = "https://raw.githubusercontent.com/blender/blender/{}/build_files/cmake/Modules/FindPythonLibsUnix.cmake"
URL_IFCOS_RELEASES = "https://github.com/IfcOpenShell/IfcOpenShell/releases/download/"
RE_BLENDER_VERSION_MIN_MAJ = r"Latest Version.+<span>Blender (\d+\.\d+)\..+</span>"
RE_BLENDER_VERSION_MIN_MAJ_PAT = r"Latest Version.+<span>Blender (\d+\.\d+\.\d+)</span>"
RE_BLENDER_PYTHON_VERSION_MAJ_MIN = r"\(_PYTHON_VERSION_SUPPORTED (\d+\.\d+)\)"
BLENDERBIM_DIR = pathlib.Path("/home/runner/work/IfcOpenShell/IfcOpenShell/choco/blenderbim/")
print("_____ check choco release needed?")
os.chdir(BLENDERBIM_DIR)
blenderbim_date_yesterday = (datetime.datetime.now() - datetime.timedelta(days=1)).strftime("%y%m%d")
should_release = False
target_release_tag = ""
target_os = "win"
git_status = os.popen("git status").read()
print(git_status)
for tag_name in get_repo_tag_names():
print(tag_name)
if blenderbim_date_yesterday in tag_name:
should_release = True
target_release_tag = tag_name
print(f"found {tag_name=} - {should_release=}")
break
if not should_release:
print(f"INFO: no blenderbim release tags found for {blenderbim_date_yesterday} -> no choco release today.")
quit(0)
print(f"{should_release=}")
if not os.environ.get("CHOCO_TOKEN"):
quit_with_error_message("could retrieve CHOCO_TOKEN env var")
choco_token = os.environ["CHOCO_TOKEN"]
print("\n_____ get blender info")
# blender_version_min_maj_pat - from chocolatey.org
latest_blender_release_maj_min_pat = get_latest_choco_blender_version()
if not latest_blender_release_maj_min_pat:
quit_with_error_message("could not determine blender_version_min_maj_pat")
latest_blender_release_maj_min_pat = latest_blender_release_maj_min_pat[0]
print(f"{latest_blender_release_maj_min_pat=}")
# blender_version_min_maj - from chocolatey.org
blender_version_min_maj = latest_blender_release_maj_min_pat.rsplit(".", 1)[0]
print(f"{blender_version_min_maj=}")
# blender_python_version_maj_min - from blender repo
python_version = ""
latest_blender_version_tag = f"v{latest_blender_release_maj_min_pat}"
resp = request_repo_info(URL_BLENDER_CMAKE.format(latest_blender_version_tag))
html_txt = str(resp.read())
found = re.findall(RE_BLENDER_PYTHON_VERSION_MAJ_MIN, html_txt)
if not found:
quit_with_error_message("could not determine blender_python_version_maj_min")
blender_python_version_maj_min = found[0]
print(f"{blender_python_version_maj_min=}")
python_version = f"py{found[0].replace('.', '')}"
print(f"{python_version=}")
blenderbim_build_version = target_release_tag.replace("blenderbim-", "")
# url_blenderbim_py3x_win_zip
release_zip_file_name = f"{target_release_tag}-{python_version}-{target_os}.zip"
# download release
url_blenderbim_py3x_win_zip = f"{URL_IFCOS_RELEASES}{target_release_tag}/{release_zip_file_name}"
os.popen(f"wget {url_blenderbim_py3x_win_zip} --no-verbose").read()
# sha256sum_blenderbim_py310_win_zip
sha256sum_blenderbim_py3x_win_zip = get_file_sha256_hash(release_zip_file_name)
print("\n_____ fill dynamic chocolatey package parameters")
HERE_DIR = pathlib.Path(__file__).parent.absolute()
# print(f"[INFO] HERE_DIR: {HERE_DIR}")
topics = {
"spec": {
"path": HERE_DIR / "blenderbim.nuspec",
"key_values": {
"latest_blender_version_maj_min_pat": latest_blender_release_maj_min_pat,
"blenderbim_build_version" : blenderbim_build_version,
},
},
"install": {
"path": HERE_DIR / "tools" / "chocolateyinstall.ps1",
"key_values": {
"url_blenderbim_py3x_win_zip" : url_blenderbim_py3x_win_zip,
"sha256sum_blenderbim_py3x_win_zip": sha256sum_blenderbim_py3x_win_zip,
"latest_blender_version_maj_min" : blender_version_min_maj,
},
},
"uninstall": {
"path": HERE_DIR / "tools" / "chocolateyuninstall.ps1",
"key_values": {
"latest_blender_version_maj_min": blender_version_min_maj,
},
},
}
for topic, info in topics.items():
print(f" {topic}:")
with open(info["path"], encoding="utf-8") as txt:
content = txt.read()
for key, value in info["key_values"].items():
# print(f"[INFO] replace: {env_var_name}")
if not key in content:
print(f" {key=} not found in {info['path']}")
content = content.replace(key, value)
with open(info["path"], "w", encoding="utf-8") as txt:
txt.write(content)
print(f" written: {info['path']}")
print("[INFO] inserting dynamic chocolatey package parameters successful")
print("\n_____ build choco.exe with mono")
choco_version = "1.1.0"
os.popen(f"wget https://github.com/chocolatey/choco/archive/refs/tags/{choco_version}.tar.gz --quiet").read()
os.popen(f"tar -xzf {choco_version}.tar.gz").read()
print("choco tar unpack successful")
os.chdir("choco-1.1.0")
os.popen("./build.sh").read()
os.popen("cp -r build_output/chocolatey /opt/chocolatey").read()
os.chdir(BLENDERBIM_DIR)
if pathlib.Path("/opt/chocolatey/choco.exe").exists():
print("choco build successful")
print("\n_____ build choco pack")
os.popen("mono /opt/chocolatey/choco.exe pack --allow-unofficial").read()
os.popen('mono /opt/chocolatey/choco.exe setapikey --key="{choco_token}" --source="https://push.chocolatey.org/" --allow-unofficial').read()
print("\n_____ build choco push")
os.popen('mono /opt/chocolatey/choco.exe push --source="https://push.chocolatey.org/" --key="$CHOCO_TOKEN" --allow-unofficial --verbose').read()
print(f"choco push of version: {target_release_tag} successful!")
print(f"it took: {datetime.datetime.now() - start}")
@@ -1,49 +0,0 @@
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")
+2 -2
View File
@@ -1,7 +1,7 @@
$ErrorActionPreference = 'Stop'
$url64 = 'url_blenderbim_py310_win_zip'
$checksum64 = 'sha256sum_blenderbim_py310_win_zip'
$url64 = 'url_blenderbim_py3x_win_zip'
$checksum64 = 'sha256sum_blenderbim_py3x_win_zip'
$checksumType64 = 'sha256'
$appDataUserDir = [System.Environment]::GetEnvironmentVariable('appdata')
+50 -33
View File
@@ -27,8 +27,6 @@ if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
endif()
project(IfcOpenShell VERSION 0.8.0)
cmake_policy(SET CMP0048 NEW)
cmake_policy(SET CMP0074 NEW)
cmake_policy(SET CMP0078 OLD)
@@ -82,6 +80,17 @@ option(WITH_RELATIONSHIP_VALIDATION "Build IfcConvert with option to validate ge
option(USERSPACE_PYTHON_PREFIX "Installs IfcPython for the current user only instead of system-wide." OFF)
option(ADD_COMMIT_SHA "Add commit sha and branch in version number, warning results in many rebuilds, requires git" OFF)
option(VERSION_OVERRIDE "Override the version defined in IfcParse.h with the file VERSION in the repository root" OFF)
if (VERSION_OVERRIDE)
file(READ "../VERSION" "RELEASE_VERSION_")
string(STRIP "${RELEASE_VERSION_}" RELEASE_VERSION)
message(STATUS "Detected version '${RELEASE_VERSION}'")
else()
set(RELEASE_VERSION "0.8.0")
endif()
project(IfcOpenShell VERSION ${RELEASE_VERSION})
if(MINIMAL_BUILD)
message(STATUS "Setting options for minimal build")
@@ -212,10 +221,11 @@ endif()
if(GLTF_SUPPORT OR CITYJSON_SUPPORT)
UNIFY_ENVVARS_AND_CACHE(JSON_INCLUDE_DIR)
find_file(json_hpp "json.hpp" ${JSON_INCLUDE_DIR}/nlohmann)
find_path(json_header_path "json.hpp" ${JSON_INCLUDE_DIR} PATH_SUFFIXES "nlohmann")
set(JSON_INCLUDE_DIR ${json_header_path})
if(json_hpp)
message(STATUS "JSON for Modern C++ header file found")
if(json_header_path)
message(STATUS "JSON for Modern C++ header file found in ${JSON_INCLUDE_DIR}")
else()
message(FATAL_ERROR "Unable to find JSON for Modern C++ header file, aborting")
endif()
@@ -590,25 +600,27 @@ if(HDF5_SUPPORT)
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")
if(${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
set(HDF5_LIBRARIES
"${HDF5_LIBRARY_DIR}/libhdf5_cpp.${lib_ext}"
"${HDF5_LIBRARY_DIR}/libhdf5.${lib_ext}"
"${HDF5_LIBRARY_DIR}/${zlib_post}.${lib_ext}"
)
else()
# linux and windows
# Find HDF5 package
find_package(HDF5 REQUIRED COMPONENTS C CXX)
# Find ZLIB package
find_package(ZLIB REQUIRED)
# Include directories
include_directories(${HDF5_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS})
# Link libraries
set(HDF5_LIBRARIES ${HDF5_LIBRARIES} ${ZLIB_LIBRARIES})
message(STATUS "HDF5 libraries: ${HDF5_LIBRARIES}")
endif()
endif()
endif()
@@ -741,6 +753,7 @@ endif(MSVC)
include_directories(${INCLUDE_DIRECTORIES} ${OCC_INCLUDE_DIR} ${OPENCOLLADA_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS} ${LIBXML2_INCLUDE_DIR} ${JSON_INCLUDE_DIR} ${HDF5_INCLUDE_DIR}
${EIGEN_DIR} ${CGAL_INCLUDE_DIR} ${GMP_INCLUDE_DIR} ${MPFR_INCLUDE_DIR} ${USD_INCLUDE_DIR}
${TBB_INCLUDE_DIR}
)
if(NOT SCHEMA_VERSIONS)
@@ -1095,22 +1108,26 @@ if(ADD_COMMIT_SHA)
find_package(Git)
if(GIT_FOUND)
message("git found: ${GIT_EXECUTABLE} with version ${GIT_VERSION_STRING}")
execute_process(
COMMAND ${GIT_EXECUTABLE} branch -a --contains HEAD
OUTPUT_VARIABLE git_branches
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string(REPLACE "\n" ";" git_branch_list "${git_branches}")
if (VERSION_OVERRIDE)
set (git_branch ${RELEASE_VERSION})
else()
message("git found: ${GIT_EXECUTABLE} with version ${GIT_VERSION_STRING}")
execute_process(
COMMAND ${GIT_EXECUTABLE} branch -a --contains HEAD
OUTPUT_VARIABLE git_branches
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string(REPLACE "\n" ";" git_branch_list "${git_branches}")
foreach(git_branch_candidate IN ITEMS ${git_branch_list})
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$")
string(REPLACE "/" ";" git_branch_candidate_2_list "${git_branch_candidate_2}")
list(GET git_branch_candidate_2_list -1 git_branch)
endif()
endforeach()
foreach(git_branch_candidate IN ITEMS ${git_branch_list})
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$")
string(REPLACE "/" ";" git_branch_candidate_2_list "${git_branch_candidate_2}")
list(GET git_branch_candidate_2_list -1 git_branch)
endif()
endforeach()
endif()
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
@@ -1177,7 +1194,7 @@ if(BUILD_IFCGEOM)
DESTINATION ${INCLUDEDIR}/ifcgeom_schema_agnostic
)
install(TARGETS ${IFCGEOM_SCHEMA_LIBRARIES} IfcGeom
install(TARGETS ${IFCGEOM_SCHEMA_LIBRARIES} ${kernel_libraries} IfcGeom
ARCHIVE DESTINATION ${LIBDIR}
LIBRARY DESTINATION ${LIBDIR}
RUNTIME DESTINATION ${BINDIR}
-1
View File
@@ -1 +0,0 @@
.env
+8 -6
View File
@@ -1,10 +1,13 @@
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:.=%
rem set LIBXML2="%LIBRARY_PREFIX%/lib/libxml2.lib"
set LIBXML2="%LIBRARY_PREFIX%/lib/libxml2.lib"
cmake -G "Ninja" ^
-D SCHEMA_VERSIONS="2x3;4;4x1;4x3;4x3_add1" ^
-D SCHEMA_VERSIONS="2x3;4;4x1;4x3_add2" ^
-D CMAKE_BUILD_TYPE:STRING=Release ^
-D CMAKE_INSTALL_PREFIX:FILEPATH="%LIBRARY_PREFIX%" ^
-D CMAKE_PREFIX_PATH:FILEPATH="%LIBRARY_PREFIX%" ^
@@ -39,11 +42,10 @@ cmake -G "Ninja" ^
-D Boost_INCLUDE_DIR:FILEPATH="%LIBRARY_PREFIX%\include" ^
-D Boost_USE_STATIC_LIBS:BOOL=OFF ^
-D CITYJSON_SUPPORT:BOOL=OFF ^
%SRC_DIR%/cmake
../cmake
if errorlevel 1 exit 1
:: Build and install
cmake --build . -- install
ninja install -j 1
if errorlevel 1 exit 1
+3 -5
View File
@@ -6,16 +6,14 @@
if [ "$(uname)" == "Darwin" ]; then
export FSUFFIX=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"
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
export FSUFFIX=so
fi
cmake -G Ninja \
-DSCHEMA_VERSIONS="2x3;4;4x1;4x3;4x3_add1" \
cmake ${CMAKE_ARGS} -G Ninja \
-DSCHEMA_VERSIONS="2x3;4;4x1;4x3_add2" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
${CMAKE_PLATFORM_FLAGS[@]} \
@@ -48,4 +46,4 @@ cmake -G Ninja \
ninja
ninja install -j 1
ninja install -j 1
+53 -6
View File
@@ -1,11 +1,58 @@
CONDA_BUILD_SYSROOT: # used for github actions conda daily build
- /Users/runner/work/MacOSX10.13.sdk # [osx]
variant:
- novtk
- all
occt:
- 7.7.1
- 7.8.1
c_compiler:
- vs2022 # [win]
- vs2022 # [win]
- gcc # [linux]
- clang # [osx]
c_stdlib:
- vs # [win]
- sysroot # [linux]
- macosx_deployment_target # [osx]
cxx_compiler:
- vs2022 # [win]
- vs2022 # [win]
- gcc # [linux]
- clangxx # [osx]
c_compiler_version:
- '12' # [linux]
- '16' # [osx]
cxx_compiler_version:
- '12' # [linux]
- '16' # [osx]
c_stdlib_version:
- '2.12' # [linux]
- '10.13' # [osx]
hdf5:
- 1.14.3
libboost_devel:
- '1.84'
libxml2:
- '2'
mpfr:
- '4'
gmp:
- '6' # [not win]
pin_run_as_build:
python:
min_pin: x.x
max_pin: x.x
zlib:
- '1'
target_platform:
- win-64 # [win]
- linux-64 # [linux]
- osx-64 # [osx]
macos_machine:
- x86_64-apple-darwin13.4.0
MACOSX_DEPLOYMENT_TARGET:
- '10.13'
MACOSX_SDK_VERSION:
- '10.13'
CONDA_BUILD_SYSROOT:
- "/Users/runner/work/MacOSX10.13.sdk" # [osx]
-58
View File
@@ -1,58 +0,0 @@
@echo off
:: This is a batch file to set the environment variables for the project
:: It is not necessary for conda compilation, but it provides you with type hints when working with the c++ libraries
:: OpenCascade, CGAL, Eigen, etc distributed using conda-forge in your IDE.
::
:: mamba env update -f environment.build.yml --prune
:: mamba activate ifcopenshell-build
::
:: Note!
:: You have to add a .env file next to this env.bat file where you set PREFIX=<path to your conda env>
set CONDA_BUILD=1
set MY_PY_VER=311
:: set this file's parent directory as a variable
set THIS_DIR=%~dp0
:: read the .env file located in THIS_DIR and set the environment variables.
:: the .env file should contain a line like this:
:: PREFIX=C:\Users\your_user_name\mambaforge3\envs\ifcopenshell-build
for /f "tokens=*" %%i in (%THIS_DIR%.env) do set %%i
set LIBRARY_PREFIX=%PREFIX%/Library
set CMAKE_PREFIX_PATH=%PREFIX%;%LIBRARY_PREFIX%/include;%LIBRARY_PREFIX%/lib;%LIBRARY_PREFIX%/bin
set OCC_LIBRARY_DIR=%LIBRARY_PREFIX%/lib
set OCC_INCLUDE_DIR=%LIBRARY_PREFIX%/include/opencascade
set CGAL_DIR=%LIBRARY_PREFIX%/lib/cmake/CGAL
set CGAL_INCLUDE_DIR=%LIBRARY_PREFIX%/include
set EIGEN_DIR=%LIBRARY_PREFIX%/include/eigen3
set LIBXML2_INCLUDE_DIR=%LIBRARY_PREFIX%/include/libxml2
set LIBXML2_LIBRARIES=%LIBRARY_PREFIX%/lib/libxml2.lib
set Boost_LIBRARY_DIR=%LIBRARY_PREFIX%/lib
set Boost_INCLUDE_DIR=%LIBRARY_PREFIX%/include
set Boost_USE_STATIC_LIBS=OFF
set GMP_INCLUDE_DIR=%LIBRARY_PREFIX%/include
set GMP_LIBRARY_DIR=%LIBRARY_PREFIX%/lib
set MPFR_LIBRARY_DIR=%LIBRARY_PREFIX%/lib
set HDF5_INCLUDE_DIR=%LIBRARY_PREFIX%/include
set HDF5_LIBRARY_DIR=%LIBRARY_PREFIX%/lib
set JSON_INCLUDE_DIR=%LIBRARY_PREFIX%/include
set HDF5_SUPPORT=ON
set BUILD_IFCPYTHON=ON
set BUILD_IFCGEOM=ON
set COLLADA_SUPPORT=OFF
set BUILD_EXAMPLES=OFF
set BUILD_GEOMSERVER=OFF
set GLTF_SUPPORT=ON
set BUILD_CONVERT=ON
set BUILD_IFCMAX=OFF
set IFCXML_SUPPORT=ON
set PYTHON_EXECUTABLE=%PREFIX%/python.exe
set PYTHON_LIBRARY=%PREFIX%/libs/python%MY_PY_VER%.lib
-17
View File
@@ -1,17 +0,0 @@
name: ifcopenshell-build
channels:
- conda-forge
dependencies:
- boa
- boost-cpp
- occt
- libxml2
- cgal-cpp
- hdf5
- mpfr
- nlohmann_json
- swig
- zlib
# These needs to be installed per platform
#- sel(unix): gmp
#- sel(win): mpir
+303
View File
@@ -0,0 +1,303 @@
{% set version = environ.get('VERSION_OVERRIDE', '0.8.0') %}
{% set build = 0 %}
# Higher number -> Always prioritize "novtk" variant over "all" variant
{% set build = build + 200 %} # [variant == "novtk"]
{% set build = build + 100 %} # [variant == "all"]
package:
name: ifcopenshell
version: {{ version }}
source:
path: ../
build:
number: {{ build }}
skip: true # [py<39]
binary_relocation: false # [osx]
string: py{{ CONDA_PY }}_{{ variant }}_h{{ PKG_HASH }}_{{ build }}
run_exports:
- {{ pin_subpackage('ifcopenshell', max_pin='x.x.x') }} *{{ variant }}*
requirements:
build:
- cmake
- ninja
- swig >=4.1.1
- {{ stdlib("c") }}
- {{ compiler('c') }}
- {{ compiler('cxx') }}
host:
- python
- libboost-devel
- occt *=*{{ variant }}*
- libxml2
- cgal-cpp
- hdf5
- eigen
- mpfr
- nlohmann_json
- gmp # [unix]
- mpir # [win]
- zlib
run:
- python
- {{ pin_compatible('occt', max_pin='x.x.x') }} *{{ variant }}*
- {{ pin_compatible('cgal-cpp', max_pin='x.x') }}
test:
imports:
- ifcopenshell
about:
home: https://ifcopenshell.org
license: LGPL-3.0-or-later
license_file: COPYING
summary: 'IfcOpenShell is a library to support the IFC file format'
description: |
IfcOpenShell
============
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.
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.
For more information, see:
* [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)
<table>
<thead>
<tr>
<th>Service</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>Anaconda Daily Build</td>
<td><a href="https://anaconda.org/ifcopenshell/ifcopenshell"><img src="https://img.shields.io/conda/vn/ifcopenshell/ifcopenshell" alt="Anaconda-Server Badge"></a></td>
</tr>
<tr>
<td>Anaconda v0.8.0 Stable</td>
<td><a href="https://anaconda.org/conda-forge/ifcopenshell"><img src="https://img.shields.io/conda/vn/conda-forge/ifcopenshell" alt="Anaconda-Server Badge"></a></td>
</tr>
<tr>
<td>PyPi Daily Build</td>
<td><a href="https://pypi.org/project/ifcopenshell/"><img src="https://img.shields.io/pypi/v/ifcopenshell" alt="PyPi Badge"></a></td>
</tr>
<tr>
<td>ArchLinux AUR Package Stable</td>
<td><a href="https://aur.archlinux.org/packages/ifcopenshell"><img src="https://img.shields.io/aur/version/ifcopenshell" alt="AUR Badge"></a></td>
</tr>
<tr>
<td>ArchLinux AUR Package git</td>
<td><a href="https://aur.archlinux.org/packages/ifcopenshell-git"><img src="https://img.shields.io/aur/version/ifcopenshell-git" alt="AUR Badge"></a></td>
</tr>
<tr>
<td>BlenderBIM Add-on Chocolatey (under moderation)</td>
<td><a href="https://community.chocolatey.org/packages/blenderbim-nightly/"><img src="https://img.shields.io/chocolatey/v/blenderbim-nightly" alt="Chocolatey Badge"></a></td>
</tr>
<tr>
<td>Sponsor development on OpenCollective</td>
<td><a href="https://opencollective.com/opensourcebim/"><img src="https://opencollective.com/opensourcebim/tiers/badge.svg" alt="Financial Contributors"></a></td>
</tr>
<tr>
<td>Docker hub</td>
<td><a href="https://hub.docker.com/r/aecgeeks/ifcopenshell"><img src="https://img.shields.io/docker/pulls/aecgeeks/ifcopenshell" alt="Docker Pulls"></a></td>
</tr>
</tbody>
</table>
Contents
--------
Those marked with an asterisk are part of IfcOpenShell.
<table>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>License</th>
</tr>
</thead>
<tbody>
<tr>
<td>bcf</td>
<td>Library to read and write BCF-XML and query OpenCDE BCF-API modules</td>
<td>LGPL-3.0-or-later</td>
</tr>
<tr>
<td>blenderbim</td>
<td>Add-on to Blender providing a graphical native IFC authoring platform</td>
<td>GPL-3.0-or-later</td>
</tr>
<tr>
<td>bsdd</td>
<td>Library to query the bSDD API</td>
<td>LGPL-3.0-or-later</td>
</tr>
<tr>
<td>ifc2ca</td>
<td>Utility to convert IFC structural analysis models to Code_Aster</td>
<td>LGPL-3.0-or-later</td>
</tr>
<tr>
<td>ifc4d</td>
<td>Convert to and from IFC and project management software</td>
<td>LGPL-3.0-or-later</td>
</tr>
<tr>
<td>ifc5d</td>
<td>Report and optimise cost information from IFC</td>
<td>LGPL-3.0-or-later</td>
</tr>
<tr>
<td>ifcbimtester</td>
<td>Wrapper for Gherkin based unit testing for IFC models</td>
<td>LGPL-3.0-or-later</td>
</tr>
<tr>
<td>ifcblender</td>
<td>Historic Blender IFC import add-on</td>
<td>LGPL-3.0-or-later*</td>
</tr>
<tr>
<td>ifccityjson</td>
<td>Convert CityJSON to IFC</td>
<td>LGPL-3.0-or-later</td>
</tr>
<tr>
<td>ifcclash</td>
<td>Clash detection library and CLI app</td>
<td>LGPL-3.0-or-later</td>
</tr>
<tr>
<td>ifccobie</td>
<td>Extract IFC data for COBie handover requirements</td>
<td>LGPL-3.0-or-later</td>
</tr>
<tr>
<td>ifcconvert</td>
<td>CLI app to convert IFC to many other formats</td>
<td>LGPL-3.0-or-later*</td>
</tr>
<tr>
<td>ifccsv</td>
<td>Library and CLI app to export and import schedules from IFC</td>
<td>LGPL-3.0-or-later</td>
</tr>
<tr>
<td>ifcdiff</td>
<td>Compare changes between IFC models</td>
<td>LGPL-3.0-or-later</td>
</tr>
<tr>
<td>ifcfm</td>
<td>Extract IFC data for FM handover requirements</td>
<td>LGPL-3.0-or-later</td>
</tr>
<tr>
<td>ifcgeom</td>
<td>Internal library for IfcOpenShell</td>
<td>LGPL-3.0-or-later*</td>
</tr>
<tr>
<td>ifcgeom_schema_agnostic</td>
<td>Internal library for IfcOpenShell</td>
<td>LGPL-3.0-or-later*</td>
</tr>
<tr>
<td>ifcgeomserver</td>
<td>Internal library for IfcOpenShell</td>
<td>LGPL-3.0-or-later*</td>
</tr>
<tr>
<td>ifcjni</td>
<td>Internal library for IfcOpenShell</td>
<td>LGPL-3.0-or-later*</td>
</tr>
<tr>
<td>ifcmax</td>
<td>Historic extension for IFC support in 3DS Max</td>
<td>LGPL-3.0-or-later*</td>
</tr>
<tr>
<td>ifcopenshell-python</td>
<td>Python library for IFC manipulation</td>
<td>LGPL-3.0-or-later*</td>
</tr>
<tr>
<td>ifcparse</td>
<td>Internal library for IfcOpenShell</td>
<td>LGPL-3.0-or-later*</td>
</tr>
<tr>
<td>ifcpatch</td>
<td>Utility to run pre-packaged scripts to manipulate IFCs</td>
<td>LGPL-3.0-or-later</td>
</tr>
<tr>
<td>ifcsverchok</td>
<td>Blender Add-on for visual node programming with IFC</td>
<td>GPL-3.0-or-later</td>
</tr>
<tr>
<td>ifctester</td>
<td>Library, CLI and webapp for IDS model auditing</td>
<td>LGPL-3.0-or-later</td>
</tr>
<tr>
<td>ifcwrap</td>
<td>Internal library for IfcOpenShell</td>
<td>LGPL-3.0-or-later*</td>
</tr>
<tr>
<td>qtviewer</td>
<td>Internal library for IfcOpenShell</td>
<td>LGPL-3.0-or-later*</td>
</tr>
<tr>
<td>serializers</td>
<td>Internal library for IfcOpenShell</td>
<td>LGPL-3.0-or-later*</td>
</tr>
</tbody>
</table>
[LGPL]: https://github.com/IfcOpenShell/IfcOpenShell/tree/master/COPYING.LESSER "LGPL-3.0-or-later"
[IFC]: https://technical.buildingsmart.org/standards/ifc/ "IFC"
[IFC2x3 TC1]: https://standards.buildingsmart.org/IFC/RELEASE/IFC2x3/TC1/HTML/ "IFC2x3 TC1"
[IFC4 Add2 TC1]: https://standards.buildingsmart.org/IFC/RELEASE/IFC4/ADD2_TC1/HTML/ "IFC4 Add2 TC1"
[Visual Studio]: https://www.visualstudio.com/ "Visual Studio"
[Visual C++ Build Tools]: http://landinghub.visualstudio.com/visual-cpp-build-tools "Visual C++ Build Tools"
[MSYS2]: https://msys2.github.io/ "MSYS2"
[win/readme.md]: https://github.com/IfcOpenShell/IfcOpenShell/tree/master/win/readme.md "win/readme.md"
[nix/build-all.py]: https://github.com/IfcOpenShell/IfcOpenShell/tree/master/nix/build-all.py "nix/build-all.py"
doc_url: https://ifcopenshell.org/
dev_url: https://github.com/IfcOpenShell/IfcOpenShell
extra:
recipe-maintainers:
- adrianinsaval
- looooo
- Krande
-64
View File
@@ -1,64 +0,0 @@
context:
name: ifcopenshell
version: 0.8.0alpha1
package:
name: '{{ name|lower }}'
version: '{{ version }}'
source:
path: ..
build:
number: 1
requirements:
build:
- "{{ compiler('c') }}"
- "{{ compiler('cxx') }}"
- ninja >=1.10.2
- cmake
- swig 4.1.1
host:
- python
- boost-cpp
- occt ==7.7.0
- libxml2
- cgal-cpp
- hdf5
- eigen
- mpfr
- sel(unix): gmp
- sel(win): mpir
- nlohmann_json
- zlib
run:
- python
- {{ pin_compatible('occt', max_pin='x.x.x') }}
- {{ pin_compatible('cgal-cpp', max_pin='x.x.x') }}
- {{ pin_compatible('boost-cpp', max_pin='x.x.x') }}
- libxml2
- hdf5
- eigen
- mpfr
- sel(unix): gmp
- sel(win): mpir
- nlohmann_json
- zlib
test:
imports:
- ifcopenshell
about:
home: https://ifcopenshell.org
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: https://blenderbim.org/docs-python/
dev_url: https://github.com/IfcOpenShell/IfcOpenShell
+5 -2
View File
@@ -53,6 +53,7 @@ import logging
import os
import re
import sys
import glob
import subprocess as sp
import shutil
import tarfile
@@ -576,6 +577,7 @@ if "freetype" in targets:
download_url = "https://github.com/freetype/freetype",
download_name = "freetype2",
download_tool=download_tool_git,
revision="VER-2-11-1"
)
if USE_OCCT and "occ" in targets:
@@ -830,7 +832,8 @@ cmake_args = [
"-DJSON_INCLUDE_DIR=" f"{DEPS_DIR}/install/json",
"-DEIGEN_DIR=" f"{DEPS_DIR}/install/eigen-3.3.9",
"-DBoost_NO_BOOST_CMAKE=" "On",
"-DADD_COMMIT_SHA=" +("On" if ADD_COMMIT_SHA else "Off")
"-DADD_COMMIT_SHA=" +("On" if ADD_COMMIT_SHA else "Off"),
"-DVERSION_OVERRIDE=" +("On" if ADD_COMMIT_SHA else "Off")
]
if "wasm" in flags:
@@ -969,7 +972,7 @@ if "IfcOpenShell-Python" in targets:
if platform.system() != "Darwin":
if BUILD_CFG == "Release":
# TODO: This symbol name depends on the Python version?
run([strip, "-s", "-K", "PyInit__ifcopenshell_wrapper", "_ifcopenshell_wrapper.so"], cwd=module_dir)
run([strip, "-s", "-K", "PyInit__ifcopenshell_wrapper", glob.glob(os.path.join(module_dir, "_ifcopenshell_wrapper*.so"))[0]], cwd=module_dir)
return module_dir
+1 -1
View File
@@ -1,6 +1,6 @@
package:
name: ifcopenshell
version: 0.7.0
version: 0.8.0
source:
path: IfcOpenShell
+1 -1
View File
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
setup(name='IfcOpenShell',
version='0.7.0',
version='0.8.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',
+34 -1
View File
@@ -1,2 +1,35 @@
[tool.black]
line-length = 120
line-length = 120
include = '''
src/(
bcf
|bcfserver
|blenderbim
|bsdd
|foundationserver
|ifc2ca
|ifc4d
|ifc5d
|ifcbimtester
|ifcblender
|ifccityjson
|ifcclash
|ifccsv
|ifcdiff
|ifcfm
|ifcpatch
|ifctester
|ifcopenshell-python
|ifcsverchok
|opencdeserver
)/.*.py$
'''
extend-exclude = '''
src/ifcopenshell-python/ifcopenshell/express/*
|src/ifcopenshell-python/ifcopenshell/mvd/*
|src/ifc2ca/templates/*
'''
[tool.pyright]
reportInvalidTypeForm = false
disableBytesTypePromotions = true
+1 -1
View File
@@ -10,7 +10,7 @@ type: software
authors:
- name: "IfcOpenShell contributors"
repository-code: >-
https://github.com/IfcOpenShell/IfcOpenShell/tree/v0.7.0/src/bcf
https://github.com/IfcOpenShell/IfcOpenShell/tree/v0.8.0/src/bcf
abstract: >-
Library to read and write BCF-XML and query OpenCDE
BCF-API modules
+24 -12
View File
@@ -1,8 +1,23 @@
VERSION:=`date '+%y%m%d'`
SED:=sed -i
ifeq ($(UNAME_S),Darwin)
SED:=sed -i '' -e
endif
# 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/>.
PACKAGE_NAME:=bcf
include ../common.mk
.PHONY: ci
ci:
@@ -18,13 +33,10 @@ 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: dist
dist:
rm -rf dist
$(SED) "s/999999/$(VERSION)/" pyproject.toml
python -m build
$(SED) "s/$(VERSION)/999999/" pyproject.toml
.PHONY: test
test:
pytest -p no:pytest-blender tests
# .PHONY
# api:
# openapi-python-client generate --url https://api.swaggerhub.com/apis/buildingSMART/BCF/3.0
# openapi-python-client generate --url https://api.swaggerhub.com/apis/buildingSMART/BCF/3.0
@@ -15,3 +15,5 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with BCF. If not, see <http://www.gnu.org/licenses/>.
__version__ = version = "0.0.0"
@@ -18,6 +18,7 @@ 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
from pathlib import Path
from typing import Optional, Union
@@ -5,8 +5,8 @@ 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_]]:
elem_placement: NDArray[np.float64],
) -> tuple[NDArray[np.float64], NDArray[np.float64], NDArray[np.float64]]:
"""
Calculate the vectors of a camera pointing to an element.
@@ -21,8 +21,8 @@ def camera_vectors_from_element_placement(
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_]]:
target_position: NDArray[np.float64], offset: Optional[NDArray[np.float64]] = None
) -> tuple[NDArray[np.float64], NDArray[np.float64], NDArray[np.float64]]:
"""
Calculate the vectors of a camera pointing to a target point.
@@ -50,7 +50,7 @@ def camera_vectors_from_target_position(
# return camera_position, -mat[:3, 2], mat[:3, 1]
def unit_vector(v: NDArray[np.float_]) -> NDArray[np.float_]:
def unit_vector(v: NDArray[np.float64]) -> NDArray[np.float64]:
"""
Return the unit vector of a vector.
@@ -5,6 +5,7 @@ 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
@@ -13,8 +14,7 @@ from typing import Any, Optional, Protocol
class ZipFileInterface(Protocol):
def writestr(self, filename_in_zip: str | zipfile.ZipInfo, file_contents: bytes | str) -> None:
...
def writestr(self, filename_in_zip: str | zipfile.ZipInfo, file_contents: bytes | str) -> None: ...
class InMemoryZipFile:
@@ -1,4 +1,5 @@
"""BCF XML V2 handler."""
import uuid
import warnings
import zipfile
@@ -34,7 +34,7 @@ class BimSnippet:
metadata={
"name": "isExternal",
"type": "Attribute",
}
},
)
@@ -64,7 +64,7 @@ class HeaderFile:
"name": "Filename",
"type": "Element",
"namespace": "",
}
},
)
date: Optional[XmlDateTime] = field(
default=None,
@@ -72,7 +72,7 @@ class HeaderFile:
"name": "Date",
"type": "Element",
"namespace": "",
}
},
)
reference: Optional[str] = field(
default=None,
@@ -80,7 +80,7 @@ class HeaderFile:
"name": "Reference",
"type": "Element",
"namespace": "",
}
},
)
ifc_project: Optional[str] = field(
default=None,
@@ -89,7 +89,7 @@ class HeaderFile:
"type": "Attribute",
"length": 22,
"pattern": r"[0-9,A-Z,a-z,_$]*",
}
},
)
ifc_spatial_structure_element: Optional[str] = field(
default=None,
@@ -98,14 +98,14 @@ class HeaderFile:
"type": "Attribute",
"length": 22,
"pattern": r"[0-9,A-Z,a-z,_$]*",
}
},
)
is_external: bool = field(
default=True,
metadata={
"name": "isExternal",
"type": "Attribute",
}
},
)
@@ -120,7 +120,7 @@ class TopicDocumentReference:
"name": "ReferencedDocument",
"type": "Element",
"namespace": "",
}
},
)
description: Optional[str] = field(
default=None,
@@ -128,7 +128,7 @@ class TopicDocumentReference:
"name": "Description",
"type": "Element",
"namespace": "",
}
},
)
guid: Optional[str] = field(
default=None,
@@ -136,14 +136,14 @@ class TopicDocumentReference:
"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",
}
},
)
@@ -170,7 +170,7 @@ class ViewPoint:
"name": "Viewpoint",
"type": "Element",
"namespace": "",
}
},
)
snapshot: Optional[str] = field(
default=None,
@@ -178,7 +178,7 @@ class ViewPoint:
"name": "Snapshot",
"type": "Element",
"namespace": "",
}
},
)
index: Optional[int] = field(
default=None,
@@ -186,7 +186,7 @@ class ViewPoint:
"name": "Index",
"type": "Element",
"namespace": "",
}
},
)
guid: str = field(
metadata={
@@ -230,7 +230,7 @@ class Comment:
"name": "Viewpoint",
"type": "Element",
"namespace": "",
}
},
)
modified_date: Optional[XmlDateTime] = field(
default=None,
@@ -238,7 +238,7 @@ class Comment:
"name": "ModifiedDate",
"type": "Element",
"namespace": "",
}
},
)
modified_author: Optional[str] = field(
default=None,
@@ -246,7 +246,7 @@ class Comment:
"name": "ModifiedAuthor",
"type": "Element",
"namespace": "",
}
},
)
guid: str = field(
metadata={
@@ -267,7 +267,7 @@ class Header:
"type": "Element",
"namespace": "",
"min_occurs": 1,
}
},
)
@@ -279,7 +279,7 @@ class Topic:
"name": "ReferenceLink",
"type": "Element",
"namespace": "",
}
},
)
title: str = field(
metadata={
@@ -295,7 +295,7 @@ class Topic:
"name": "Priority",
"type": "Element",
"namespace": "",
}
},
)
index: Optional[int] = field(
default=None,
@@ -303,7 +303,7 @@ class Topic:
"name": "Index",
"type": "Element",
"namespace": "",
}
},
)
labels: List[str] = field(
default_factory=list,
@@ -311,7 +311,7 @@ class Topic:
"name": "Labels",
"type": "Element",
"namespace": "",
}
},
)
creation_date: XmlDateTime = field(
metadata={
@@ -335,7 +335,7 @@ class Topic:
"name": "ModifiedDate",
"type": "Element",
"namespace": "",
}
},
)
modified_author: Optional[str] = field(
default=None,
@@ -343,7 +343,7 @@ class Topic:
"name": "ModifiedAuthor",
"type": "Element",
"namespace": "",
}
},
)
due_date: Optional[XmlDateTime] = field(
default=None,
@@ -351,7 +351,7 @@ class Topic:
"name": "DueDate",
"type": "Element",
"namespace": "",
}
},
)
assigned_to: Optional[str] = field(
default=None,
@@ -359,7 +359,7 @@ class Topic:
"name": "AssignedTo",
"type": "Element",
"namespace": "",
}
},
)
stage: Optional[str] = field(
default=None,
@@ -367,7 +367,7 @@ class Topic:
"name": "Stage",
"type": "Element",
"namespace": "",
}
},
)
description: Optional[str] = field(
default=None,
@@ -375,7 +375,7 @@ class Topic:
"name": "Description",
"type": "Element",
"namespace": "",
}
},
)
bim_snippet: Optional[BimSnippet] = field(
default=None,
@@ -383,7 +383,7 @@ class Topic:
"name": "BimSnippet",
"type": "Element",
"namespace": "",
}
},
)
document_reference: List[TopicDocumentReference] = field(
default_factory=list,
@@ -391,7 +391,7 @@ class Topic:
"name": "DocumentReference",
"type": "Element",
"namespace": "",
}
},
)
related_topic: List[TopicRelatedTopic] = field(
default_factory=list,
@@ -399,7 +399,7 @@ class Topic:
"name": "RelatedTopic",
"type": "Element",
"namespace": "",
}
},
)
guid: str = field(
metadata={
@@ -414,14 +414,14 @@ class Topic:
metadata={
"name": "TopicType",
"type": "Attribute",
}
},
)
topic_status: Optional[str] = field(
default=None,
metadata={
"name": "TopicStatus",
"type": "Attribute",
}
},
)
@@ -433,7 +433,7 @@ class Markup:
"name": "Header",
"type": "Element",
"namespace": "",
}
},
)
topic: Topic = field(
metadata={
@@ -449,7 +449,7 @@ class Markup:
"name": "Comment",
"type": "Element",
"namespace": "",
}
},
)
viewpoints: List[ViewPoint] = field(
default_factory=list,
@@ -457,5 +457,5 @@ class Markup:
"name": "Viewpoints",
"type": "Element",
"namespace": "",
}
},
)
@@ -10,7 +10,7 @@ class Project:
"name": "Name",
"type": "Element",
"namespace": "",
}
},
)
project_id: str = field(
metadata={
@@ -29,7 +29,7 @@ class ProjectExtension:
"name": "Project",
"type": "Element",
"namespace": "",
}
},
)
extension_schema: str = field(
metadata={
@@ -10,12 +10,12 @@ class Version:
"name": "DetailedVersion",
"type": "Element",
"namespace": "",
}
},
)
version_id: Optional[str] = field(
default=None,
metadata={
"name": "VersionId",
"type": "Attribute",
}
},
)
@@ -15,14 +15,14 @@ class Component:
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,
@@ -31,7 +31,7 @@ class Component:
"type": "Attribute",
"length": 22,
"pattern": r"[0-9,A-Z,a-z,_$]*",
}
},
)
@@ -92,21 +92,21 @@ class ViewSetupHints:
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",
}
},
)
@@ -139,7 +139,7 @@ class ComponentColoringColor:
"name": "Component",
"type": "Element",
"min_occurs": 1,
}
},
)
color: Optional[str] = field(
default=None,
@@ -147,7 +147,7 @@ class ComponentColoringColor:
"name": "Color",
"type": "Attribute",
"pattern": r"[0-9,a-f,A-F]{6}([0-9,a-f,A-F]{2})?",
}
},
)
@@ -159,7 +159,7 @@ class ComponentSelection:
"name": "Component",
"type": "Element",
"min_occurs": 1,
}
},
)
@@ -174,7 +174,7 @@ class ComponentVisibilityExceptions:
"name": "Component",
"type": "Element",
"min_occurs": 1,
}
},
)
@@ -205,6 +205,7 @@ class OrthogonalCamera:
camera_up_vector:
view_to_world_scale: view's visible size in meters
"""
camera_view_point: Point = field(
metadata={
"name": "CameraViewPoint",
@@ -247,6 +248,7 @@ class PerspectiveCamera:
release and viewers should be expect values outside this
range in current implementations.
"""
camera_view_point: Point = field(
metadata={
"name": "CameraViewPoint",
@@ -336,7 +338,7 @@ class ComponentColoring:
"name": "Color",
"type": "Element",
"min_occurs": 1,
}
},
)
@@ -347,14 +349,14 @@ class ComponentVisibility:
metadata={
"name": "Exceptions",
"type": "Element",
}
},
)
default_visibility: Optional[bool] = field(
default=None,
metadata={
"name": "DefaultVisibility",
"type": "Attribute",
}
},
)
@@ -368,7 +370,7 @@ class VisualizationInfoClippingPlanes:
metadata={
"name": "ClippingPlane",
"type": "Element",
}
},
)
@@ -383,7 +385,7 @@ class VisualizationInfoLines:
"name": "Line",
"type": "Element",
"min_occurs": 1,
}
},
)
@@ -394,14 +396,14 @@ class Components:
metadata={
"name": "ViewSetupHints",
"type": "Element",
}
},
)
selection: Optional[ComponentSelection] = field(
default=None,
metadata={
"name": "Selection",
"type": "Element",
}
},
)
visibility: ComponentVisibility = field(
metadata={
@@ -415,7 +417,7 @@ class Components:
metadata={
"name": "Coloring",
"type": "Element",
}
},
)
@@ -424,47 +426,48 @@ 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={
@@ -1,4 +1,5 @@
"""BCF XML V2 Topic handler."""
import datetime
import tempfile
import uuid
@@ -277,7 +278,7 @@ class TopicHandler:
self.add_visinfo_handler(new_viewpoint)
return new_viewpoint
def add_viewpoint_from_point_and_guids(self, position: NDArray[np.float_], *guids: str) -> None:
def add_viewpoint_from_point_and_guids(self, position: NDArray[np.float64], *guids: str) -> None:
"""Add a viewpoint pointing at an XYZ point in space
Args:
@@ -176,7 +176,7 @@ class VisualizationInfoHandler:
@classmethod
def create_from_point_and_guids(
cls,
position: NDArray[np.float_],
position: NDArray[np.float64],
*guids: str,
xml_handler: Optional[AbstractXmlParserSerializer] = None,
) -> "VisualizationInfoHandler":
@@ -224,7 +224,7 @@ def build_viewpoint(element: entity_instance) -> mdl.VisualizationInfo:
)
def build_viewpoint_from_position_and_guids(position: NDArray[np.float_], *guids: str) -> mdl.VisualizationInfo:
def build_viewpoint_from_position_and_guids(position: NDArray[np.float64], *guids: str) -> mdl.VisualizationInfo:
"""
Return a BCF viewpoint of an IFC element.
@@ -261,7 +261,7 @@ def build_components(*guids: str) -> mdl.Components:
)
def build_camera(elem_placement: NDArray[np.float_]) -> mdl.PerspectiveCamera:
def build_camera(elem_placement: NDArray[np.float64]) -> mdl.PerspectiveCamera:
"""
Return a BCF camera for an IFC element placement matrix.
@@ -275,7 +275,7 @@ def build_camera(elem_placement: NDArray[np.float_]) -> mdl.PerspectiveCamera:
def build_camera_from_vectors(
camera_position: NDArray[np.float_], camera_dir: NDArray[np.float_], camera_up: NDArray[np.float_]
camera_position: NDArray[np.float64], camera_dir: NDArray[np.float64], camera_up: NDArray[np.float64]
) -> mdl.PerspectiveCamera:
"""
Return a BCF camera for an IFC element placement matrix.
@@ -1,4 +1,5 @@
"""BCF XML V3 handlers."""
import uuid
import warnings
import zipfile
@@ -1,4 +1,5 @@
"""BCF XML V3 Documents handler."""
import zipfile
from typing import Any, Optional
@@ -22,7 +22,7 @@ class Document:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
guid: str = field(
metadata={
@@ -45,7 +45,7 @@ class DocumentInfoDocuments:
"name": "Document",
"type": "Element",
"namespace": "",
}
},
)
@@ -57,5 +57,5 @@ class DocumentInfo:
"name": "Documents",
"type": "Element",
"namespace": "",
}
},
)
@@ -15,7 +15,7 @@ class ExtensionsPriorities:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
@@ -32,7 +32,7 @@ class ExtensionsSnippetTypes:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
@@ -49,7 +49,7 @@ class ExtensionsStages:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
@@ -66,7 +66,7 @@ class ExtensionsTopicLabels:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
@@ -83,7 +83,7 @@ class ExtensionsTopicStatuses:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
@@ -100,7 +100,7 @@ class ExtensionsTopicTypes:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
@@ -117,7 +117,7 @@ class ExtensionsUsers:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
@@ -129,7 +129,7 @@ class Extensions:
"name": "TopicTypes",
"type": "Element",
"namespace": "",
}
},
)
topic_statuses: Optional[ExtensionsTopicStatuses] = field(
default=None,
@@ -137,7 +137,7 @@ class Extensions:
"name": "TopicStatuses",
"type": "Element",
"namespace": "",
}
},
)
priorities: Optional[ExtensionsPriorities] = field(
default=None,
@@ -145,7 +145,7 @@ class Extensions:
"name": "Priorities",
"type": "Element",
"namespace": "",
}
},
)
topic_labels: Optional[ExtensionsTopicLabels] = field(
default=None,
@@ -153,7 +153,7 @@ class Extensions:
"name": "TopicLabels",
"type": "Element",
"namespace": "",
}
},
)
users: Optional[ExtensionsUsers] = field(
default=None,
@@ -161,7 +161,7 @@ class Extensions:
"name": "Users",
"type": "Element",
"namespace": "",
}
},
)
snippet_types: Optional[ExtensionsSnippetTypes] = field(
default=None,
@@ -169,7 +169,7 @@ class Extensions:
"name": "SnippetTypes",
"type": "Element",
"namespace": "",
}
},
)
stages: Optional[ExtensionsStages] = field(
default=None,
@@ -177,5 +177,5 @@ class Extensions:
"name": "Stages",
"type": "Element",
"namespace": "",
}
},
)
@@ -40,7 +40,7 @@ class BimSnippet:
metadata={
"name": "IsExternal",
"type": "Attribute",
}
},
)
@@ -68,7 +68,7 @@ class DocumentReference:
"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,
@@ -78,7 +78,7 @@ class DocumentReference:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
description: Optional[str] = field(
default=None,
@@ -88,7 +88,7 @@ class DocumentReference:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
guid: str = field(
metadata={
@@ -110,7 +110,7 @@ class File:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
date: Optional[XmlDateTime] = field(
default=None,
@@ -118,7 +118,7 @@ class File:
"name": "Date",
"type": "Element",
"namespace": "",
}
},
)
reference: Optional[str] = field(
default=None,
@@ -128,7 +128,7 @@ class File:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
ifc_project: Optional[str] = field(
default=None,
@@ -137,7 +137,7 @@ class File:
"type": "Attribute",
"length": 22,
"pattern": r"[0-9A-Za-z_$]*",
}
},
)
ifc_spatial_structure_element: Optional[str] = field(
default=None,
@@ -146,14 +146,14 @@ class File:
"type": "Attribute",
"length": 22,
"pattern": r"[0-9A-Za-z_$]*",
}
},
)
is_external: bool = field(
default=True,
metadata={
"name": "IsExternal",
"type": "Attribute",
}
},
)
@@ -170,7 +170,7 @@ class TopicLabels:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
@@ -187,7 +187,7 @@ class TopicReferenceLinks:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
@@ -216,7 +216,7 @@ class ViewPoint:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
snapshot: Optional[str] = field(
default=None,
@@ -226,7 +226,7 @@ class ViewPoint:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
index: Optional[int] = field(
default=None,
@@ -234,7 +234,7 @@ class ViewPoint:
"name": "Index",
"type": "Element",
"namespace": "",
}
},
)
guid: str = field(
metadata={
@@ -274,7 +274,7 @@ class Comment:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
viewpoint: Optional[CommentViewpoint] = field(
default=None,
@@ -282,7 +282,7 @@ class Comment:
"name": "Viewpoint",
"type": "Element",
"namespace": "",
}
},
)
modified_date: Optional[XmlDateTime] = field(
default=None,
@@ -290,7 +290,7 @@ class Comment:
"name": "ModifiedDate",
"type": "Element",
"namespace": "",
}
},
)
modified_author: Optional[str] = field(
default=None,
@@ -300,7 +300,7 @@ class Comment:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
guid: str = field(
metadata={
@@ -323,7 +323,7 @@ class HeaderFiles:
"name": "File",
"type": "Element",
"namespace": "",
}
},
)
@@ -338,7 +338,7 @@ class TopicDocumentReferences:
"name": "DocumentReference",
"type": "Element",
"namespace": "",
}
},
)
@@ -353,7 +353,7 @@ class TopicRelatedTopics:
"name": "RelatedTopic",
"type": "Element",
"namespace": "",
}
},
)
@@ -368,7 +368,7 @@ class TopicViewpoints:
"name": "ViewPoint",
"type": "Element",
"namespace": "",
}
},
)
@@ -380,7 +380,7 @@ class Header:
"name": "Files",
"type": "Element",
"namespace": "",
}
},
)
@@ -395,7 +395,7 @@ class TopicComments:
"name": "Comment",
"type": "Element",
"namespace": "",
}
},
)
@@ -407,7 +407,7 @@ class Topic:
"name": "ReferenceLinks",
"type": "Element",
"namespace": "",
}
},
)
title: str = field(
metadata={
@@ -427,7 +427,7 @@ class Topic:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
index: Optional[int] = field(
default=None,
@@ -435,7 +435,7 @@ class Topic:
"name": "Index",
"type": "Element",
"namespace": "",
}
},
)
labels: Optional[TopicLabels] = field(
default=None,
@@ -443,7 +443,7 @@ class Topic:
"name": "Labels",
"type": "Element",
"namespace": "",
}
},
)
creation_date: XmlDateTime = field(
metadata={
@@ -469,7 +469,7 @@ class Topic:
"name": "ModifiedDate",
"type": "Element",
"namespace": "",
}
},
)
modified_author: Optional[str] = field(
default=None,
@@ -479,7 +479,7 @@ class Topic:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
due_date: Optional[XmlDateTime] = field(
default=None,
@@ -487,7 +487,7 @@ class Topic:
"name": "DueDate",
"type": "Element",
"namespace": "",
}
},
)
assigned_to: Optional[str] = field(
default=None,
@@ -497,7 +497,7 @@ class Topic:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
stage: Optional[str] = field(
default=None,
@@ -507,7 +507,7 @@ class Topic:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
description: Optional[str] = field(
default=None,
@@ -517,7 +517,7 @@ class Topic:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
bim_snippet: Optional[BimSnippet] = field(
default=None,
@@ -525,7 +525,7 @@ class Topic:
"name": "BimSnippet",
"type": "Element",
"namespace": "",
}
},
)
document_references: Optional[TopicDocumentReferences] = field(
default=None,
@@ -533,7 +533,7 @@ class Topic:
"name": "DocumentReferences",
"type": "Element",
"namespace": "",
}
},
)
related_topics: Optional[TopicRelatedTopics] = field(
default=None,
@@ -541,7 +541,7 @@ class Topic:
"name": "RelatedTopics",
"type": "Element",
"namespace": "",
}
},
)
comments: Optional[TopicComments] = field(
default=None,
@@ -549,7 +549,7 @@ class Topic:
"name": "Comments",
"type": "Element",
"namespace": "",
}
},
)
viewpoints: Optional[TopicViewpoints] = field(
default=None,
@@ -557,7 +557,7 @@ class Topic:
"name": "Viewpoints",
"type": "Element",
"namespace": "",
}
},
)
guid: str = field(
metadata={
@@ -574,7 +574,7 @@ class Topic:
"type": "Attribute",
"min_length": 1,
"white_space": "collapse",
}
},
)
topic_type: str = field(
metadata={
@@ -604,7 +604,7 @@ class Markup:
"name": "Header",
"type": "Element",
"namespace": "",
}
},
)
topic: Topic = field(
metadata={
@@ -12,7 +12,7 @@ class Project:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
project_id: str = field(
metadata={
@@ -17,7 +17,7 @@ class Component:
"type": "Element",
"min_length": 1,
"white_space": "collapse",
}
},
)
authoring_tool_id: Optional[str] = field(
default=None,
@@ -26,7 +26,7 @@ class Component:
"type": "Element",
"min_length": 1,
"white_space": "collapse",
}
},
)
ifc_guid: Optional[str] = field(
default=None,
@@ -35,7 +35,7 @@ class Component:
"type": "Attribute",
"length": 22,
"pattern": r"[0-9A-Za-z_$]*",
}
},
)
@@ -96,21 +96,21 @@ class ViewSetupHints:
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",
}
},
)
@@ -191,7 +191,7 @@ class ComponentColoringColorComponents:
"name": "Component",
"type": "Element",
"min_occurs": 1,
}
},
)
@@ -202,7 +202,7 @@ class ComponentSelection:
metadata={
"name": "Component",
"type": "Element",
}
},
)
@@ -216,7 +216,7 @@ class ComponentVisibilityExceptions:
metadata={
"name": "Component",
"type": "Element",
}
},
)
@@ -249,6 +249,7 @@ class OrthogonalCamera:
aspect_ratio: Proportional relationship between the width and
the height of the view (w/h).
"""
camera_view_point: Point = field(
metadata={
"name": "CameraViewPoint",
@@ -302,6 +303,7 @@ class PerspectiveCamera:
aspect_ratio: Proportional relationship between the width and
the height of the view (w/h).
"""
camera_view_point: Point = field(
metadata={
"name": "CameraViewPoint",
@@ -371,21 +373,21 @@ class ComponentVisibility:
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",
}
},
)
@@ -399,7 +401,7 @@ class VisualizationInfoBitmaps:
metadata={
"name": "Bitmap",
"type": "Element",
}
},
)
@@ -413,7 +415,7 @@ class VisualizationInfoClippingPlanes:
metadata={
"name": "ClippingPlane",
"type": "Element",
}
},
)
@@ -427,7 +429,7 @@ class VisualizationInfoLines:
metadata={
"name": "Line",
"type": "Element",
}
},
)
@@ -438,7 +440,7 @@ class ComponentColoring:
metadata={
"name": "Color",
"type": "Element",
}
},
)
@@ -449,21 +451,21 @@ class Components:
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",
}
},
)
@@ -472,47 +474,48 @@ 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={
@@ -1,4 +1,5 @@
"""BCF XML V3 Topic handler."""
import datetime
import uuid
import zipfile
@@ -174,7 +175,7 @@ class TopicHandler:
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:
def add_viewpoint_from_point_and_guids(self, position: NDArray[np.float64], *guids: str) -> None:
"""
Add a viewpoint tergeting an IFC element to the topic.
@@ -175,7 +175,7 @@ class VisualizationInfoHandler:
@classmethod
def create_from_point_and_guids(
cls,
position: NDArray[np.float_],
position: NDArray[np.float64],
*guids: str,
xml_handler: Optional[AbstractXmlParserSerializer] = None,
) -> "VisualizationInfoHandler":
@@ -218,7 +218,7 @@ def build_viewpoint(element: entity_instance) -> mdl.VisualizationInfo:
)
def build_viewpoint_from_position_and_guids(position: NDArray[np.float_], *guids: str) -> mdl.VisualizationInfo:
def build_viewpoint_from_position_and_guids(position: NDArray[np.float64], *guids: str) -> mdl.VisualizationInfo:
"""
Return a BCF viewpoint of an IFC element.
@@ -255,7 +255,7 @@ def build_components(*guids: str) -> mdl.Components:
)
def build_camera(elem_placement: NDArray[np.float_]) -> mdl.PerspectiveCamera:
def build_camera(elem_placement: NDArray[np.float64]) -> mdl.PerspectiveCamera:
"""
Return a BCF camera for an IFC element placement matrix.
@@ -269,7 +269,7 @@ def build_camera(elem_placement: NDArray[np.float_]) -> mdl.PerspectiveCamera:
def build_camera_from_vectors(
camera_position: NDArray[np.float_], camera_dir: NDArray[np.float_], camera_up: NDArray[np.float_]
camera_position: NDArray[np.float64], camera_dir: NDArray[np.float64], camera_up: NDArray[np.float64]
) -> mdl.PerspectiveCamera:
"""
Return a BCF camera for an IFC element placement matrix.
@@ -1,4 +1,5 @@
"""XML Parser and Serializer factories."""
from typing import Optional, Protocol, Type, TypeVar
from xsdata.formats.dataclass.context import XmlContext
+2 -2
View File
@@ -17,7 +17,7 @@ dependencies = [
"numpy",
"ifcopenshell",
]
version = "0.0.999999"
version = "0.0.0"
classifiers = [
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
@@ -138,4 +138,4 @@ max-attributes = 10
[tool.pylint.format]
expected-line-ending-format = "LF"
max-line-length = 120
max-line-length = 120
+1
View File
@@ -1,4 +1,5 @@
"""BCF XML tests."""
import uuid
from pathlib import Path
from tempfile import TemporaryDirectory
+1
View File
@@ -1,4 +1,5 @@
"""BCF XML tests."""
import uuid
from pathlib import Path
from tempfile import TemporaryDirectory
+1 -1
View File
@@ -10,7 +10,7 @@ type: software
authors:
- name: "IfcOpenShell contributors"
repository-code: >-
https://github.com/IfcOpenShell/IfcOpenShell/tree/v0.7.0/src/blenderbim
https://github.com/IfcOpenShell/IfcOpenShell/tree/v0.8.0/src/blenderbim
url: 'https://blenderbim.org/'
repository-artifact: 'https://blenderbim.org/download.html'
abstract: >-
+245 -193
View File
@@ -20,8 +20,12 @@ PYTHON:=python3.11
PIP:=pip3.11
PATCH:=patch
SED:=sed -i
VENV_ACTIVATE:=bin/activate
ifeq ($(OS),Windows_NT)
HOSTOS:=win
PYTHON:=python
VENV_ACTIVATE:=Scripts/activate
else
UNAME_S:=$(shell uname -s)
ifeq ($(UNAME_S),Linux)
@@ -45,11 +49,6 @@ LAST_COMMIT_HASH:=$(shell git rev-parse HEAD)
PYVERSION:=py310
PYPI_IMP:=cp
ifeq ($(PYVERSION), py39)
PYLIBDIR:=python3.9
PYNUMBER:=39
PYPI_VERSION:=3.9
endif
ifeq ($(PYVERSION), py310)
PYLIBDIR:=python3.10
PYNUMBER:=310
@@ -68,241 +67,294 @@ endif
ifeq ($(PLATFORM), linux)
PYPI_PLATFORM:=--platform manylinux_2_17_x86_64
BLENDER_PLATFORM:=linux-x64
endif
ifeq ($(PLATFORM), macos)
PYPI_PLATFORM:=--platform macosx_10_10_x86_64
BLENDER_PLATFORM:=macos-x64
endif
ifeq ($(PLATFORM), macosm1)
PYPI_PLATFORM:=--platform macosx_11_0_arm64
BLENDER_PLATFORM:=macos-arm64
endif
ifeq ($(PLATFORM), win)
PYPI_PLATFORM:=--platform win_amd64
BLENDER_PLATFORM:=windows-x64
endif
# Current build commit hash.
OLD:=d51fa2c
.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
cd . && $(SED) -b "s/$(OLD)/$(NEW)/" Makefile
cd ../ifcopenshell-python/ && $(SED) -b "s/$(OLD)/$(NEW)/" Makefile
.PHONY: dist
dist:
ifndef PLATFORM
$(error PLATFORM is not set)
endif
rm -rf dist
mkdir -p dist/working
mkdir -p dist/blenderbim
cp -r blenderbim/* dist/blenderbim/
rm -rf build
mkdir -p build
mkdir -p dist
cp -r blenderbim build/
# To scope any build-time dependencies
cd build && $(PYTHON) -m venv env && . env/$(VENV_ACTIVATE) && $(PIP) install build
cd build && . env/$(VENV_ACTIVATE) && $(PIP) install wheel
mkdir -p build/wheels
# Provides IfcOpenShell Python functionality
cd dist/working && wget https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-$(PYNUMBER)-v0.8.0-90ae709-$(PLATFORM)64.zip
cd dist/working && unzip ifcopenshell-python*
cp -r dist/working/ifcopenshell dist/blenderbim/libs/site/packages/
# See bug #812
cd dist/working && wget https://raw.githubusercontent.com/IfcOpenShell/IfcOpenShell/v0.8.0/src/blenderbim/occ_utils.py
cd dist/working && mv occ_utils.py ../blenderbim/libs/site/packages/ifcopenshell/geom/occ_utils.py
rm -rf dist/working
# Provides dependencies that are part of IfcOpenShell
mkdir dist/working
cd dist/working && wget https://github.com/IfcOpenShell/IfcOpenShell/archive/refs/heads/v0.8.0.zip
cd dist/working && unzip v0.8.0.zip
# IfcOpenBot sometimes lags behind, so we hotfix the Python utilities
rm -rf dist/blenderbim/libs/site/packages/ifcopenshell/util/
rm -rf dist/blenderbim/libs/site/packages/ifcopenshell/api/
cp -r dist/working/IfcOpenShell-0.8.0/src/ifcopenshell-python/ifcopenshell/util dist/blenderbim/libs/site/packages/ifcopenshell/
cp -r dist/working/IfcOpenShell-0.8.0/src/ifcopenshell-python/ifcopenshell/api dist/blenderbim/libs/site/packages/ifcopenshell/
cp dist/working/IfcOpenShell-0.8.0/src/ifcopenshell-python/ifcopenshell/*.py dist/blenderbim/libs/site/packages/ifcopenshell/
cp dist/working/IfcOpenShell-0.8.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.8.0/src/bcf/src/bcf dist/blenderbim/libs/site/packages/
# Provides IFCClash functionality
cp -r dist/working/IfcOpenShell-0.8.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 && . env/bin/activate && ./env/bin/pybabel compile -d ./IfcOpenShell-0.8.0/src/ifcbimtester/bimtester/locale/
cp -r dist/working/IfcOpenShell-0.8.0/src/ifcbimtester/bimtester dist/blenderbim/libs/site/packages/
# Provides IFCTester functionality
cp -r dist/working/IfcOpenShell-0.8.0/src/ifctester/ifctester dist/blenderbim/libs/site/packages/
# Provides IFCFM functionality
cp -r dist/working/IfcOpenShell-0.8.0/src/ifcfm/ifcfm dist/blenderbim/libs/site/packages/
# Provides bSDD functionality
cp -r dist/working/IfcOpenShell-0.8.0/src/bsdd/* dist/blenderbim/libs/site/packages/
# Provides IFCDiff functionality
cp -r dist/working/IfcOpenShell-0.8.0/src/ifcdiff/* dist/blenderbim/libs/site/packages/
# Provides IFCCSV functionality
cp -r dist/working/IfcOpenShell-0.8.0/src/ifccsv/* dist/blenderbim/libs/site/packages/
# Provides IFCPatch functionality
cp -r dist/working/IfcOpenShell-0.8.0/src/ifcpatch/ifcpatch dist/blenderbim/libs/site/packages/
# Provides IFC4D functionality
cp -r dist/working/IfcOpenShell-0.8.0/src/ifc4d/ifc4d dist/blenderbim/libs/site/packages/
# Provides IFC5D functionality
cp -r dist/working/IfcOpenShell-0.8.0/src/ifc5d/ifc5d dist/blenderbim/libs/site/packages/
# Provides IFCCityJSON functionality
cp -r dist/working/IfcOpenShell-0.8.0/src/ifccityjson dist/blenderbim/libs/site/packages/
# Provides IfcGit functionality
cd dist/working && . env/bin/activate && $(PIP) install GitPython --target=./site-packages
cp -r dist/working/site-packages/smmap dist/blenderbim/libs/site/packages/
cp -r dist/working/site-packages/gitdb dist/blenderbim/libs/site/packages/
cp -r dist/working/site-packages/git dist/blenderbim/libs/site/packages/
rm -rf dist/working
cd ../ifcopenshell-python && make dist PLATFORM=$(PLATFORM)64 PYVERSION=$(PYVERSION) && mv dist/*.whl ../blenderbim/build/wheels/
cd ../bcf && make dist && mv dist/*.whl ../blenderbim/build/wheels/
cd ../ifcclash && make dist && mv dist/*.whl ../blenderbim/build/wheels/
cd ../ifctester && make dist && mv dist/*.whl ../blenderbim/build/wheels/
cd ../ifcfm && make dist && mv dist/*.whl ../blenderbim/build/wheels/
cd ../bsdd && make dist && mv dist/*.whl ../blenderbim/build/wheels/
cd ../ifcdiff && make dist && mv dist/*.whl ../blenderbim/build/wheels/
cd ../ifccsv && make dist && mv dist/*.whl ../blenderbim/build/wheels/
cd ../ifcpatch && make dist && mv dist/*.whl ../blenderbim/build/wheels/
cd ../ifc4d && make dist && mv dist/*.whl ../blenderbim/build/wheels/
cd ../ifc5d && make dist && mv dist/*.whl ../blenderbim/build/wheels/
cd ../ifccityjson && make dist && mv dist/*.whl ../blenderbim/build/wheels/
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download GitPython --dest=./wheels
# 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
# This is a REALLY IMPORTANT feature
cd build && . env/$(VENV_ACTIVATE) && $(PIP) wheel git+https://github.com/Andrej730/aud.git --wheel-dir=./wheels
# IfcOpenShell dependency - support for new typing features
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download typing_extensions --dest=./wheels
# Required by IfcCSV
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download pandas $(PYPI_PLATFORM) --python-version $(PYPI_VERSION) --implementation $(PYPI_IMP) --only-binary=:all: --dest=./wheels
# Pandas ships with very heavy tests
# cd build/site-packages/pandas && rm -rf tests
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download openpyxl --dest=./wheels
# odfpy doesn't come with its own wheel, so whee'l (get it?) create it ourselves!
cd build && . env/$(VENV_ACTIVATE) && $(PIP) wheel odfpy --wheel-dir=./wheels
# Required by IFCCityJSON
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download cjio --dest=./wheels
# Provides express rule validation for ifcopenshell.validate
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download pytest --dest=./wheels
# Provides Brickschema functionality
# Is not platform specific but has platform specific dependencies.
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download "brickschema[persistence]==0.7.6a2" $(PYPI_PLATFORM) --python-version $(PYPI_VERSION) --implementation $(PYPI_IMP) --only-binary=:all: --dest=./wheels
# Required for SVG to DXF conversion
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download ezdxf $(PYPI_PLATFORM) --python-version $(PYPI_VERSION) --implementation $(PYPI_IMP) --only-binary=:all: --dest=./wheels
# Required by bcf
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download xsdata --dest=./wheels
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download xmlschema --dest=./wheels
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download elementpath --dest=./wheels
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download six --dest=./wheels
# Required by drawing module
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download lxml $(PYPI_PLATFORM) --python-version $(PYPI_VERSION) --implementation $(PYPI_IMP) --only-binary=:all: --dest=./wheels
# Required by qto and drawing module
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download shapely $(PYPI_PLATFORM) --python-version $(PYPI_VERSION) --implementation $(PYPI_IMP) --only-binary=:all: --dest=./wheels
# Required by the BIM type manager thumbnail generator
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download pillow $(PYPI_PLATFORM) --python-version $(PYPI_VERSION) --implementation $(PYPI_IMP) --only-binary=:all: --dest=./wheels
# Provides mustache templating in construction docs and web UI data
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download pystache --dest=./wheels
# Provides SVG export in construction documentation
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download svgwrite --dest=./wheels
# Provides fuzzy date parsing for construction sequencing
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download python-dateutil --dest=./wheels
# Provides duration parsing for construction sequencing
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download isodate --dest=./wheels
# Provides networkx graph analysis for project dependency calculations
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download networkx --dest=./wheels
# Required by IFCDiff
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download deepdiff --dest=./wheels
# Required by IFCCSV and ifcopenshell.util.selector
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download lark --dest=./wheels
# Required by IFC4D
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download PyP6Xer --dest=./wheels
# Required by web module
# Is not platform specific but has platform specific dependencies.
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download python-socketio[asyncio_client] $(PYPI_PLATFORM) --python-version $(PYPI_VERSION) --implementation $(PYPI_IMP) --only-binary=:all: --dest=./wheels
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download aiohttp $(PYPI_PLATFORM) --python-version $(PYPI_VERSION) --implementation $(PYPI_IMP) --only-binary=:all: --dest=./wheels
# Required by light module
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download pytz --dest=./wheels
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download tzfpy $(PYPI_PLATFORM) --python-version $(PYPI_VERSION) --implementation $(PYPI_IMP) --only-binary=:all: --dest=./wheels
# pyradiance is using different platform versions than defaults in our makefile.
ifeq ($(PLATFORM), linux)
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download pyradiance --platform manylinux_2_35_x86_64 --python-version $(PYPI_VERSION) --implementation $(PYPI_IMP) --only-binary=:all: --dest=./wheels
else ifeq ($(PLATFORM), macos)
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download pyradiance --platform macosx_10_13_x86_64 --python-version $(PYPI_VERSION) --implementation $(PYPI_IMP) --only-binary=:all: --dest=./wheels
else
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download pyradiance $(PYPI_PLATFORM) --python-version $(PYPI_VERSION) --implementation $(PYPI_IMP) --only-binary=:all: --dest=./wheels
endif
# tomllib replacement for < Python 3.11, used to parse blender_manifest
ifeq ($(PYVERSION), py310)
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download tomli --dest=./wheels
endif
# 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
cd dist/working && wget https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.css
cp dist/working/jsgantt* dist/blenderbim/bim/data/gantt/
rm -rf dist/working
mkdir dist/working
cd dist/working && $(PYTHON) -m venv env
cd dist/working && mkdir site-packages
# Required by IfcCSV
cd dist/working && . env/bin/activate && $(PIP) install pandas $(PYPI_PLATFORM) --python-version $(PYPI_VERSION) --implementation $(PYPI_IMP) --only-binary=:all: --target=./site-packages
# Pandas ships with very heavy tests
cd dist/working/site-packages/pandas && rm -rf tests
cd dist/working && . env/bin/activate && $(PIP) install openpyxl --target=./site-packages
cd dist/working && . env/bin/activate && $(PIP) install odfpy --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
# Provides Brickschema functionality
cd dist/working && . env/bin/activate && $(PIP) install "brickschema[persistence]==0.7.6a2" --target=./site-packages
# Required for SVG to DXF conversion
cd dist/working && . env/bin/activate && $(PIP) install ezdxf --target=./site-packages
# Required by bcf
cd dist/working && . env/bin/activate && $(PIP) install xsdata --target=./site-packages
cd dist/working && . env/bin/activate && $(PIP) install xmlschema --target=./site-packages
cd dist/working && . env/bin/activate && $(PIP) install elementpath --target=./site-packages
cd dist/working && . env/bin/activate && $(PIP) install six --target=./site-packages
# Required by drawing module
cd dist/working && . env/bin/activate && $(PIP) install lxml $(PYPI_PLATFORM) --python-version $(PYPI_VERSION) --implementation $(PYPI_IMP) --only-binary=:all: --target=./site-packages
# Required by qto and drawing module
cd dist/working && . env/bin/activate && $(PIP) install shapely $(PYPI_PLATFORM) --python-version $(PYPI_VERSION) --implementation $(PYPI_IMP) --only-binary=:all: --target=./site-packages
# Required by the BIM type manager thumbnail generator
cd dist/working && . env/bin/activate && $(PIP) install pillow $(PYPI_PLATFORM) --python-version $(PYPI_VERSION) --implementation $(PYPI_IMP) --only-binary=:all: --target=./site-packages
# Provides mustache templating in construction docs and web UI data
cd dist/working && . env/bin/activate && $(PIP) install pystache --target=./site-packages
# Provides SVG export in construction documentation
cd dist/working && . env/bin/activate && $(PIP) install svgwrite --target=./site-packages
# Provides fuzzy date parsing for construction sequencing
cd dist/working && . env/bin/activate && $(PIP) install python-dateutil --target=./site-packages
# Provides duration parsing for construction sequencing
cd dist/working && . env/bin/activate && $(PIP) install isodate --target=./site-packages
# Provides networkx graph analysis for project dependency calculations
cd dist/working && . env/bin/activate && $(PIP) install networkx --target=./site-packages
# Required by IFCDiff
cd dist/working && . env/bin/activate && $(PIP) install deepdiff --target=./site-packages
# Required by IFCCSV and ifcopenshell.util.selector
cd dist/working && . env/bin/activate && $(PIP) install lark --target=./site-packages
# Required by IFC4D
cd dist/working && . env/bin/activate && $(PIP) install PyP6Xer --target=./site-packages
cp -r dist/working/site-packages/* dist/blenderbim/libs/site/packages/
rm -rf dist/working
# Required by BIMTester
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/c8/4b/d0a8c23b6c8985e5544ea96d27105a273ea22051317f850c2cdbf2029fe4/behave-1.2.6.tar.gz
cd dist/working && tar -xzvf behave*
cd dist/working/behave-1.2.6/ && cp -r behave ../../blenderbim/libs/site/packages/
# See bug #1294
cd dist/working/ && wget https://raw.githubusercontent.com/IfcOpenShell/IfcOpenShell/v0.8.0/src/ifcbimtester/patch/model_core.patch
cd dist/working/ && wget https://raw.githubusercontent.com/IfcOpenShell/IfcOpenShell/v0.8.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
# See bug #2159
cd dist/working/ && wget https://raw.githubusercontent.com/IfcOpenShell/IfcOpenShell/v0.8.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 behave
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/f4/65/220bb4075fddb09d5b3ea2c1c1fa66c1c72be9361ec187aab50fa161e576/parse-1.15.0.tar.gz
cd dist/working && tar -xzvf parse*
cd dist/working/parse-1.15.0/ && cp parse.py ../../blenderbim/libs/site/packages/
rm -rf dist/working
# Required by behave
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/2e/79/81bebd1b0446d46733db99d74543b4bb80646ef4c988584bae0862e706bc/parse_type-0.5.2.tar.gz
cd dist/working && tar -xzvf parse_type*
cd dist/working/parse_type-0.5.2/ && cp -r parse_type ../../blenderbim/libs/site/packages/
rm -rf dist/working
cd build/blenderbim/bim/data/gantt/ && wget https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.js
cd build/blenderbim/bim/data/gantt/ && wget https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.css
# Provides IFCJSON functionality
mkdir dist/working
cd dist/working && wget https://github.com/IFCJSON-Team/IFC2JSON_python/archive/master.zip
cd dist/working && unzip master.zip
cp -r dist/working/IFC2JSON_python-master/file_converters/ifcjson dist/blenderbim/libs/site/packages/
rm -rf dist/working
# TODO: replace with main repo if https://github.com/IFCJSON-Team/IFC2JSON_python/pull/3 is merged.
cd build && wget -O ifc2json.zip https://github.com/Moult/IFC2JSON_python/archive/refs/heads/feature-ios-v0.8.0.zip
cd build && unzip ifc2json.zip && rm ifc2json.zip
# IFCJSON doesn't have pyproject.toml, so we use python command.
cd build && . env/$(VENV_ACTIVATE) && cd IFC2JSON_python-*/file_converters && \
$(PYTHON) -c "from setuptools import setup; \
setup( \
name='ifcjson', \
version='0.0.1', \
author='Jan Brouwer', \
author_email='jan@brewsky.nl', \
packages=['ifcjson'], \
)" bdist_wheel
cp -r build/IFC2JSON_python-*/file_converters/dist/*.whl build/wheels/
# Brickschema requires pkg_resources which is provided by Blender.
# Provides Brickschema functionality
mkdir dist/working
# 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
rm -rf dist/working
# Required by brickschema
# This is a bit of a dodgy one, it should be provided by setuptools which Blender doesn't ship.
mkdir dist/working
cd dist/working && wget https://github.com/IfcOpenShell/IfcOpenShell/raw/v0.8.0/src/blenderbim/scripts/pkg_resources.tar.gz
cd dist/working && tar -xzvf pkg_resources*
cd dist/working/ && cp -r pkg_resources ../blenderbim/libs/site/packages/
rm -rf dist/working
cd build/blenderbim/bim/schema && wget https://github.com/BrickSchema/Brick/releases/download/nightly/Brick.ttl
# 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 build && wget https://github.com/prochitecture/bpypolyskel/archive/refs/heads/master.zip
cd build && unzip master.zip && rm master.zip
cd build && . env/$(VENV_ACTIVATE) && cd bpypolyskel-master && \
$(PYTHON) -c "from setuptools import setup; \
setup( \
name='bpypolyskel', \
version='0.0.0', \
packages=['bpypolyskel'], \
)" bdist_wheel
cp -r build/bpypolyskel-master/dist/*.whl build/wheels/
# Required for Desktop icon and file association
cp -r blenderbim/libs/desktop dist/blenderbim/libs/
cp -r blenderbim/libs/desktop build/blenderbim/libs/
# Generate translations module for BBIM build
git clone https://github.com/IfcOpenShell/blenderbim-translations.git dist/working
$(PYTHON) scripts/bbim_translations.py -i "dist/working" -o "dist/blenderbim"
rm -rf dist/working
git clone https://github.com/IfcOpenShell/blenderbim-translations.git build/working
$(PYTHON) scripts/bbim_translations.py -i "build/working" -o "build/blenderbim"
rm -rf build/working
# Remove dependencies also bundled with Blender
rm -rf dist/blenderbim/libs/site/packages/numpy
rm -rf dist/blenderbim/libs/site/packages/numpy.libs
rm -rf build/wheels/numpy*
cp pyproject.toml build/
ifeq ($(IS_STABLE), TRUE)
$(SED) "s/0.0.0/$(VERSION)/" build/blenderbim/blender_manifest.toml
$(SED) 's/version = "0.0.0"/version = "$(VERSION)"/' build/pyproject.toml
else
$(SED) "s/0.0.0/$(VERSION)-alpha$(VERSION_DATE)/" build/blenderbim/blender_manifest.toml
$(SED) "s/8888888/$(LAST_COMMIT_HASH)/" build/blenderbim/__init__.py
$(SED) 's/version = "0.0.0"/version = "$(VERSION)-alpha$(VERSION_DATE)"/' build/pyproject.toml
endif
$(SED) "s/os-arch/$(BLENDER_PLATFORM)/" build/blenderbim/blender_manifest.toml
# Provides BlenderBIM Add-on functionality
ifeq ($(IS_STABLE), TRUE)
$(SED) 's/version = "0.0.0"/version = "$(VERSION)"/' build/pyproject.toml
else
$(SED) 's/version = "0.0.0"/version = "$(VERSION)a$(VERSION_DATE)"/' build/pyproject.toml
endif
cd build && . env/$(VENV_ACTIVATE) && $(PYTHON) -m build
cp build/dist/*.whl build/wheels/
# Safeguard for non-wheel dependencies slipping in.
wheels=$$(find build/wheels/* ! -name "*.whl"); \
if [ -n "$$wheels" ]; then \
echo "Found non-wheel dependencies:"; \
echo "$$wheels"; \
echo "Error: non-wheel dependencies are not supported by Blender!"; \
exit 1; \
fi
mv build/wheels/*.whl build/blenderbim/wheels/
# Ugly patch to accomodate MacOS universal builds not being recognized by Blender.
# Blender doesn't look into the wheel contents, it just checks the name.
# So this hack works without working out some way to repack those wheels.
# See: https://projects.blender.org/blender/blender/issues/125091
ifeq ($(PLATFORM), macosm1)
# Has universal and x86_64 builds.
prev_whl_name=$$(find build/blenderbim/wheels/MarkupSafe-*.whl); \
whl_name=$$(echo $$prev_whl_name | sed "s/_universal2/_arm64/"); \
mv "$$prev_whl_name" "$$whl_name";
# Has universal and x86_64 builds.
prev_whl_name=$$(find build/blenderbim/wheels/lxml-*.whl); \
whl_name=$$(echo $$prev_whl_name | sed "s/_universal2/_arm64/"); \
mv "$$prev_whl_name" "$$whl_name";
prev_whl_name=$$(find build/blenderbim/wheels/tzfpy-*.whl); \
whl_name=$$(echo $$prev_whl_name | sed "s/macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2/macosx_10_12_arm64/"); \
mv "$$prev_whl_name" "$$whl_name";
# Has only universal build.
prev_whl_name=$$(find build/blenderbim/wheels/greenlet-*.whl); \
whl_name=$$(echo $$prev_whl_name | sed "s/_universal2/_arm64/"); \
mv "$$prev_whl_name" "$$whl_name";
endif
ifeq ($(PLATFORM), macos)
prev_whl_name=$$(find build/blenderbim/wheels/tzfpy-*.whl); \
whl_name=$$(echo $$prev_whl_name | sed "s/macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2/macosx_10_9_x86_64/"); \
mv "$$prev_whl_name" "$$whl_name";
prev_whl_name=$$(find build/blenderbim/wheels/greenlet-*.whl); \
whl_name=$$(echo $$prev_whl_name | sed "s/_universal2/_x86_64/"); \
mv "$$prev_whl_name" "$$whl_name";
# has universal and amr64 builds.
prev_whl_name=$$(find build/blenderbim/wheels/fonttools-*.whl); \
whl_name=$$(echo $$prev_whl_name | sed "s/_universal2/_x86_64/"); \
mv "$$prev_whl_name" "$$whl_name";
endif
# Safeguard for unhandled universal files.
wheels=$$(find build/blenderbim/wheels/*universal2*.whl); \
if [ -n "$$wheels" ]; then \
echo "Found universal2 wheel files:"; \
echo "$$wheels"; \
echo "Error: universal2 wheel files are not supported by Blender!"; \
exit 1; \
fi
ifneq ($(PLATFORM), linux)
# Safeguard: in case one of `pip download` will break,
# it will produce a linux wheel for non-linux build (our github action machine is using linux).
wheels=$$(find build/blenderbim/wheels/*manylinux_*.whl); \
if [ -n "$$wheels" ]; then \
echo "Found linux wheel files in non-linux build:"; \
echo "$$wheels"; \
echo "Error: linux wheels are incompatible with build $(PLATFORM)!"; \
exit 1; \
fi
endif
$(PYTHON) scripts/get_wheels.py build/blenderbim/wheels build/blenderbim/blender_manifest.toml
rm -rf build/blenderbim/bim/
rm -rf build/blenderbim/core/
rm -rf build/blenderbim/tool/
ifeq ($(IS_STABLE), TRUE)
cd dist/blenderbim && $(SED) "s/0, 0, 0/$(VERSION_MAJOR), $(VERSION_MINOR), $(VERSION_PATCH)/" __init__.py
cd dist/blenderbim && $(SED) "s/0.0.0/$(VERSION)/" blender_manifest.toml
cd dist && zip -r blenderbim-$(VERSION)-$(PYVERSION)-$(PLATFORM).zip ./*
cd build && zip -r blenderbim_$(PYVERSION)-$(VERSION)-$(BLENDER_PLATFORM).zip ./blenderbim
else
cd dist/blenderbim && $(SED) "s/0, 0, 0/$(VERSION_MAJOR), $(VERSION_MINOR), $(VERSION_PATCH), $(VERSION_DATE)/" __init__.py
cd dist/blenderbim && $(SED) "s/0.0.0/$(VERSION).$(VERSION_DATE)/" blender_manifest.toml
cd dist/blenderbim/bim && $(SED) "s/8888888/$(LAST_COMMIT_HASH)/" __init__.py
cd dist && zip -r blenderbim-$(VERSION).$(VERSION_DATE)-$(PYVERSION)-$(PLATFORM).zip ./*
cd build && zip -r blenderbim_$(PYVERSION)-$(VERSION)-alpha$(VERSION_DATE)-$(BLENDER_PLATFORM).zip ./blenderbim
endif
rm -rf dist/blenderbim
mv build/blenderbim*.zip dist/
rm -rf build
.PHONY: test
test:
make test-core
make test-tool
make test-bim
@echo "Running all tests..."
@ERROR=0; \
make test-core || ERROR=1; \
make test-tool || ERROR=1; \
make test-bim || ERROR=1; \
if [ $$ERROR -ne 0 ]; then \
echo "One or more tests failed"; \
exit 1; \
fi
.PHONY: test-core
test-core:
+221 -35
View File
@@ -27,39 +27,67 @@ import sys
IN_BLENDER = sys.modules.get("bpy", None)
if IN_BLENDER:
import bpy
import re
import platform
import traceback
import webbrowser
import addon_utils
import uuid
import shutil
from collections import deque
from pathlib import Path
from typing import Union, Any, Generator
bl_info = {
"name": "BlenderBIM",
"description": "Transforms Blender into a native Building Information Model authoring platform using IFC.",
"author": "IfcOpenShell Contributors",
"blender": (3, 1, 0),
"version": (0, 0, 0),
"location": "File Menu, Scene Properties Tab. See documentation for more.",
"doc_url": "https://docs.blenderbim.org/",
"tracker_url": "https://github.com/IfcOpenShell/IfcOpenShell/issues",
"category": "System",
}
last_commit_hash = "8888888"
def get_last_commit_hash() -> Union[str, None]:
# Using this weird way to write 8888888,
# so makefile won't accidentally replace it here
# we'll be able to distinguish commit hash from placeholder value.
if last_commit_hash == str(8_888888):
return None
return last_commit_hash[:7]
# Accessed from blenderbim extension:
bbim_semver: dict[str, Any] = {}
# Accessed from blenderbim dependency:
last_error = None
last_actions: deque = deque(maxlen=10)
FIRST_INSTALLED_BBIM_VERSION: Union[str, None] = None
REINSTALLED_BBIM_VERSION: Union[str, None] = None
def initialize_bbim_semver():
"""Initialize `bbim_semver` dictionary.
Blender doesn't seem to store a full extension version (only major-minor-patch)
in `addon_utils.modules()->bl_info['version']`,
therefore we just parse it from .toml.
"""
if sys.version_info >= (3, 11):
import tomllib as toml
else:
import tomli as toml
toml_path = Path(__file__).parent / "blender_manifest.toml"
with open(toml_path, "rb") as f:
manifest = toml.load(f)
semver_pattern = r"^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$"
version_str = manifest["version"]
re_version = re.match(semver_pattern, version_str)
assert re_version
global bbim_semver
bbim_semver = re_version.groupdict()
bbim_semver["version"] = version_str
def get_debug_info():
version = ".".join(
[
str(x)
for x in [
addon.bl_info.get("version", (-1, -1, -1))
for addon in addon_utils.modules()
if addon.bl_info["name"] == "BlenderBIM"
][0]
]
)
bbim_version = bbim_semver["version"]
return {
"os": platform.system(),
"os_version": platform.version(),
@@ -68,7 +96,8 @@ def get_debug_info():
"machine": platform.machine(),
"processor": platform.processor(),
"blender_version": bpy.app.version_string,
"blenderbim_version": version,
"blenderbim_version": bbim_version,
"blenderbim_commit_hash": get_last_commit_hash(),
"last_actions": last_actions,
"last_error": last_error,
}
@@ -85,14 +114,116 @@ def format_debug_info(info: dict):
return text.strip()
def get_binaries(path: Path) -> Generator[Path, None, None]:
yield from path.glob("**/*.pyd")
yield from path.glob("**/*.dll")
# pyradiance is using .so files on windows for some reason.
yield from path.glob("**/*.so")
def safe_link_dlls() -> None:
# Blender 4.2+ has a problem on Windows for disabling/enabling/reinstalling extensions
# with loaded binary dependencies (on Windows you can't remove a binary if it's loaded by some program).
# To avoid this issue we temporary hard link dlls to our temp directory on unregister()
# (unregister is executed before Blender will try to uninstall dependencies and the issue will arise).
# Then, Blender won't have a problem unlinking unloaded dlls as they are still linked somewhere.
# On register() we clean up our temp directory with binaries.
#
# TODO: If user uninstalls BlenderBIM to never use it again, temporary directory won't be cleared.
#
# See: https://projects.blender.org/blender/blender/issues/125049
import bpy
ext_path = Path(bpy.utils.user_resource("EXTENSIONS"))
local_path = ext_path / ".local"
# We use random hash subfolder as user may try to enable/disable addon multiple times.
random_hash = uuid.uuid4().hex[:8]
temp_local = ext_path / ".local_temp" / random_hash
temp_local.mkdir(parents=True)
for filepath in get_binaries(local_path):
dest_path = temp_local / filepath.relative_to(local_path)
dest_path.parent.mkdir(exist_ok=True, parents=True)
os.link(filepath, dest_path)
def clean_up_dlls_safe_links() -> None:
import bpy
ext_path = Path(bpy.utils.user_resource("EXTENSIONS"))
temp_path = ext_path / ".local_temp"
if not temp_path.exists():
return
for filepath in get_binaries(temp_path):
try:
os.unlink(filepath)
except PermissionError:
pass
def is_empty_directory(directory: Path) -> bool:
return not any(directory.iterdir())
def remove_empty_folders(folder: Path) -> None:
for subfolder in folder.iterdir():
if subfolder.is_dir():
remove_empty_folders(subfolder)
if is_empty_directory(folder):
folder.rmdir()
remove_empty_folders(temp_path)
if IN_BLENDER:
# Process *.pth in /libs/site/packages to setup globally importable modules
# This is 3 levels deep as required by the static RPATH of ../../ from dependencies taken from Anaconda
# site.addsitedir(os.path.join(os.path.dirname(os.path.realpath(__file__)), "libs", "site", "packages"))
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), "libs", "site", "packages"))
initialize_bbim_semver()
def get_binary_info() -> dict[str, Any]:
info = {}
py_version = sys.version_info
site_path = (
Path(bpy.utils.user_resource("EXTENSIONS"))
/ ".local"
/ "lib"
/ f"python{py_version.major}.{py_version.minor}"
/ "site-packages"
)
lib = site_path / "ifcopenshell"
binary = next((i for i in lib.glob("_ifcopenshell_wrapper.*")), None)
if binary is None:
info["binary_error"] = "Couldn't find ifcopenshell wrapper binary."
return info
# Examples:
# _ifcopenshell_wrapper.cp311-win_amd64.pyd
# _ifcopenshell_wrapper.cpython-311-darwin.so
# _ifcopenshell_wrapper.cpython-311-x86_64-linux-gnu.so
binary = binary.name
info["binary_file_name"] = binary
pattern = re.compile(r"cp(\d+)|cpython-(\d+)")
match = pattern.search(binary)
if not match:
info["binary_error"] = f"Couldn't parse binary version from '{binary}'."
return info
version = match.group(1) or match.group(2)
version = f"{version[0]}.{version[1:]}"
info["binary_python_version"] = version
return info
try:
import git
# We can't just use __file__ as blenderbim/__init__.py is typically not symlinked
# as Blender have errors symlinking main addon package file.
path = Path(__file__).resolve().parent
repo = git.Repo(str(path), search_parent_directories=True)
last_commit_hash = repo.head.object.hexsha
except:
pass
try:
import blenderbim.bim
import ifcopenshell.api
def log_api(usecase_path, ifc_file, settings):
@@ -107,12 +238,43 @@ if IN_BLENDER:
ifcopenshell.api.add_pre_listener("*", "action_logger", log_api)
def register():
if platform.system() == "Windows":
clean_up_dlls_safe_links()
import blenderbim.bim
current_version = bbim_semver["version"]
if blenderbim.FIRST_INSTALLED_BBIM_VERSION is None:
blenderbim.FIRST_INSTALLED_BBIM_VERSION = current_version
elif not blenderbim.REINSTALLED_BBIM_VERSION and blenderbim.FIRST_INSTALLED_BBIM_VERSION != current_version:
blenderbim.REINSTALLED_BBIM_VERSION = current_version
blenderbim.bim.register()
def unregister():
if platform.system() == "Windows":
safe_link_dlls()
import blenderbim.bim
blenderbim.bim.unregister()
except:
def show_scene_properties() -> None:
# By default in Blender object properties are selected.
# Or user may have some other properties selected in their startup file.
# Select scene properties to ensure user will see our error handler.
for area in bpy.context.screen.areas:
if area.type != "PROPERTIES":
continue
space = area.spaces.active
assert isinstance(space, bpy.types.SpaceProperties)
space.context = "SCENE"
# Use a timer as we're not allowed to make changes to data during register().
bpy.app.timers.register(show_scene_properties, first_interval=0.1)
last_error = traceback.format_exc()
print(last_error)
@@ -139,26 +301,48 @@ if IN_BLENDER:
box = layout.box()
py = ".".join(info["python_version"].split(".")[0:2])
b3d = ".".join(info["blender_version"].split(".")[0:2])
box.label(text="System Information:")
box.label(text=f"Blender {b3d} {info['os']} {info['machine']}", icon="BLENDER")
blenderbim_version = info["blenderbim_version"]
if commit_hash := info.get("blenderbim_commit_hash"):
blenderbim_version += f"-{commit_hash}"
box.label(text=f"Python {py} BBIM {info['blenderbim_version']}", icon="SCRIPTPLUGINS")
binary_py = get_binary_info().get("binary_python_version")
if binary_py and py != binary_py:
box.separator()
# From wrong-platform-build issues we're guarded by Blender extension installation.
# But Blender currently doesn't support separate builds for different Python version,
# so those issues might still slip in.
box.label(text="BlenderBIM installed for wrong Python version.")
box.label(text=f"Expected: {py}. Got: {binary_py}.")
# On reinstallation, dependencies versions doesn't change, so Blender will just ignore new dependencies.
# So, we need to make user will disable an extension (just uninstallation won't remove dependencies).
# Blender restart doesn't seem to be required in that case
# as dependencies failed to load due to Python version mismatch.
box.label(text="Try reinstalling with the correct Python version.")
box.label(text="Before reinstallation make sure to")
box.label(text="DISABLE BlenderBIM (uninstallation won't help).")
box.label(text="You can download correct version below.")
layout.operator("bim.copy_debug_information", text="Copy Error Message To Clipboard")
op = layout.operator("bim.open_uri", text="How Can I Fix This?")
op.uri = "https://docs.blenderbim.org/users/troubleshooting.html#installation-issues"
layout.label(text="Try Reinstalling:", icon="IMPORT")
op = layout.operator("bim.open_uri", text="Re-download Add-on")
bbim_date = info["blenderbim_version"].split(".")[-1]
bbim_version = info["blenderbim_version"]
py_tag = py.replace(".", "")
if "Linux" in info["os"]:
os = "linux"
os = "linux-x64"
elif "Darwin" in info["os"]:
if "arm64" in info["machine"]:
os = "macosm1"
os = "macos-arm64"
else:
os = "macos"
os = "macos-x64"
else:
os = "win"
op.uri = f"https://github.com/IfcOpenShell/IfcOpenShell/releases/download/blenderbim-{bbim_date}/blenderbim-{bbim_date}-py{py_tag}-{os}.zip"
os = "windows-x64"
op.uri = f"https://github.com/IfcOpenShell/IfcOpenShell/releases/download/blenderbim-{bbim_version}/blenderbim_py{py_tag}-{bbim_version}-{os}.zip"
class OpenUri(bpy.types.Operator):
bl_idname = "bim.open_uri"
@@ -175,7 +359,9 @@ if IN_BLENDER:
bl_description = "Copies debugging information to your clipboard for use in bugreports"
def execute(self, context):
info = format_debug_info(get_debug_info())
info = get_debug_info()
info.update(get_binary_info())
info = format_debug_info(info)
context.window_manager.clipboard = info
return {"FINISHED"}
+8 -20
View File
@@ -19,7 +19,6 @@
import os
import bpy
import bpy.utils.previews
import blenderbim
import importlib
from pathlib import Path
from . import handler, ui, prop, operator, helper
@@ -75,7 +74,6 @@ modules = {
"clash": None,
"csv": None,
"tester": None,
"bimtester": None,
"diff": None,
"patch": None,
"gis": None,
@@ -84,6 +82,8 @@ modules = {
"debug": None,
"ifcgit": None,
"covering": None,
"web": None,
"light": None,
# Uncomment this line to enable loading of the demo module. Happy hacking!
# The name "demo" must correlate to a folder name in `bim/module/`.
# "demo": None,
@@ -98,11 +98,12 @@ classes = [
operator.AddIfcFile,
operator.BIM_OT_add_section_plane,
operator.BIM_OT_delete_object,
operator.BIM_OT_open_webbrowser,
operator.BIM_OT_remove_section_plane,
operator.BIM_OT_select_object,
operator.BIM_OT_show_description,
operator.BIM_OT_multiple_file_selector,
operator.ClippingPlaneCutWithCappings,
operator.CloseBlendWarning,
operator.CloseError,
operator.EditBlenderCollection,
operator.FileAssociate,
@@ -121,6 +122,7 @@ classes = [
prop.StrProperty,
operator.BIM_OT_enum_property_search, # /!\ Register AFTER prop.StrProperty
prop.ObjProperty,
prop.MultipleFileSelect,
prop.Attribute,
prop.BIMAreaProperties,
prop.BIMTabProperties,
@@ -130,7 +132,6 @@ classes = [
prop.GlobalId,
prop.BIMObjectProperties,
prop.BIMCollectionProperties,
prop.BIMMaterialProperties,
prop.BIMMeshProperties,
prop.BIMFacet,
prop.BIMFilterGroup,
@@ -141,6 +142,7 @@ classes = [
# Tabs panel
ui.BIM_PT_tabs,
# Project overview
ui.BIM_PT_tab_new_project_wizard,
ui.BIM_PT_tab_project_info,
ui.BIM_PT_tab_spatial_decomposition,
ui.BIM_PT_tab_project_setup,
@@ -167,6 +169,8 @@ classes = [
# Services and systems
ui.BIM_PT_tab_services,
ui.BIM_PT_tab_zones,
ui.BIM_PT_tab_solar_analysis,
ui.BIM_PT_tab_lighting,
# Structural analysis
ui.BIM_PT_tab_structural,
# Construction scheduling
@@ -194,7 +198,6 @@ for mod in modules.values():
addon_keymaps = []
icons = None
is_registering = False
last_commit_hash = "8888888"
original_scene_panels_polls: dict[bpy.types.Panel, Union[Callable, None]] = dict()
@@ -223,8 +226,6 @@ def register():
bpy.types.Screen.BIMTabProperties = bpy.props.PointerProperty(type=prop.BIMTabProperties)
bpy.types.Collection.BIMCollectionProperties = bpy.props.PointerProperty(type=prop.BIMCollectionProperties)
bpy.types.Object.BIMObjectProperties = bpy.props.PointerProperty(type=prop.BIMObjectProperties)
bpy.types.Material.BIMObjectProperties = bpy.props.PointerProperty(type=prop.BIMObjectProperties)
bpy.types.Material.BIMMaterialProperties = bpy.props.PointerProperty(type=prop.BIMMaterialProperties)
bpy.types.Mesh.BIMMeshProperties = bpy.props.PointerProperty(type=prop.BIMMeshProperties)
bpy.types.Curve.BIMMeshProperties = bpy.props.PointerProperty(type=prop.BIMMeshProperties)
bpy.types.Camera.BIMMeshProperties = bpy.props.PointerProperty(type=prop.BIMMeshProperties)
@@ -253,17 +254,6 @@ def register():
icon_preview.load(icon_name, icon_path, "IMAGE")
icons = icon_preview
global last_commit_hash
try:
import git
path = Path(__file__).resolve().parent
repo = git.Repo(str(path), search_parent_directories=True)
last_commit_hash = repo.head.object.hexsha
except:
pass
bpy.app.translations.register("blenderbim", translations_dict)
@@ -283,8 +273,6 @@ def unregister():
del bpy.types.Scene.BIMProperties
del bpy.types.Collection.BIMCollectionProperties
del bpy.types.Object.BIMObjectProperties
del bpy.types.Material.BIMObjectProperties
del bpy.types.Material.BIMMaterialProperties
del bpy.types.Mesh.BIMMeshProperties
del bpy.types.Curve.BIMMeshProperties
del bpy.types.Camera.BIMMeshProperties
@@ -67,11 +67,11 @@ DATA;
#60=IFCMATERIALPROFILESET($,$,(#62),$);
#61=IFCRELASSOCIATESMATERIAL('09FXUZCnrFEffxBrtg16gx',$,$,$,(#59),#60);
#62=IFCMATERIALPROFILE($,$,#20,#58,$,$);
#63=IFCSLABTYPE('1Akbal7tP5DAPW0ti$Qp30',$,'FLR150',$,$,$,$,$,$,.NOTDEFINED.);
#63=IFCSLABTYPE('1Akbal7tP5DAPW0ti$Qp30',$,'FLR200',$,$,$,$,$,$,.NOTDEFINED.);
#64=IFCMATERIALLAYERSET((#66),$,$);
#65=IFCRELASSOCIATESMATERIAL('0jzkXlkBL4HhmQ_FTWW6Cj',$,$,$,(#63),#64);
#66=IFCMATERIALLAYER(#20,0.2,$,$,$,$,$);
#67=IFCSLABTYPE('0$gpYNi3T08BrxaR67CxgI',$,'FLR250',$,$,$,$,$,$,.NOTDEFINED.);
#67=IFCSLABTYPE('0$gpYNi3T08BrxaR67CxgI',$,'FLR300',$,$,$,$,$,$,.NOTDEFINED.);
#68=IFCMATERIALLAYERSET((#70),$,$);
#69=IFCRELASSOCIATESMATERIAL('3a6kjEM29DleYTlSkA8_DK',$,$,$,(#67),#68);
#70=IFCMATERIALLAYER(#20,0.3,$,$,$,$,$);
@@ -67,11 +67,11 @@ DATA;
#60=IFCMATERIALPROFILESET($,$,(#62),$);
#61=IFCRELASSOCIATESMATERIAL('09FXUZCnrFEffxBrtg16gx',$,$,$,(#59),#60);
#62=IFCMATERIALPROFILE($,$,#20,#58,$,$);
#63=IFCSLABTYPE('1Akbal7tP5DAPW0ti$Qp30',$,'FLR150',$,$,$,$,$,$,.NOTDEFINED.);
#63=IFCSLABTYPE('1Akbal7tP5DAPW0ti$Qp30',$,'FLR200',$,$,$,$,$,$,.NOTDEFINED.);
#64=IFCMATERIALLAYERSET((#66),$,$);
#65=IFCRELASSOCIATESMATERIAL('0jzkXlkBL4HhmQ_FTWW6Cj',$,$,$,(#63),#64);
#66=IFCMATERIALLAYER(#20,0.2,$,$,$,$,$);
#67=IFCSLABTYPE('0$gpYNi3T08BrxaR67CxgI',$,'FLR250',$,$,$,$,$,$,.NOTDEFINED.);
#67=IFCSLABTYPE('0$gpYNi3T08BrxaR67CxgI',$,'FLR300',$,$,$,$,$,$,.NOTDEFINED.);
#68=IFCMATERIALLAYERSET((#70),$,$);
#69=IFCRELASSOCIATESMATERIAL('3a6kjEM29DleYTlSkA8_DK',$,$,$,(#67),#68);
#70=IFCMATERIALLAYER(#20,0.3,$,$,$,$,$);
@@ -0,0 +1,181 @@
import sys
import os
import webbrowser
blenderbim_lib_path = os.environ.get("BLENDERBIM_LIB_PATH")
blenderbim_version = os.environ.get("BLENDERBIM_VERSION")
if blenderbim_lib_path:
sys.path.insert(0, blenderbim_lib_path)
import argparse
from aiohttp import web
import socketio
import pystache
import json
sio_port = 8080 # default port
sio = socketio.AsyncServer(
cors_allowed_origins="*",
async_mode="aiohttp",
)
# sio.instrument(
# auth={
# "username": "admin",
# "password": "admin",
# }
# )
app = web.Application()
sio.attach(app)
# represents a caching for blender messages
blender_messages = {}
# Web namespace
class WebNamespace(socketio.AsyncNamespace):
def __init__(self, namespace):
super().__init__(namespace)
async def on_connect(self, sid, environ):
print(f"Web client connected: {sid}")
if blender_messages:
await self.send_cached_messages(sid)
async def on_disconnect(self, sid):
print(f"Web client disconnected: {sid}")
async def on_web_operator(self, sid, data):
await sio.emit(
"web_operator",
data,
namespace="/blender",
room=data.get("blenderId", None),
)
async def on_get_svg(self, sid, data):
print("hello world!")
file_path = data["path"]
with open(file_path, "r") as file:
svg_data = file.read()
await sio.emit("svg_data", svg_data, room=sid, namespace="/web")
async def send_cached_messages(self, sid):
# Send cached messages to the connected web client
for blenderId, messages in blender_messages.items():
if "csv_data" in messages:
await self.emit("csv_data", {"blenderId": blenderId, "data": messages["csv_data"]}, room=sid)
if "gantt_data" in messages:
await self.emit("gantt_data", {"blenderId": blenderId, "data": messages["gantt_data"]}, room=sid)
# Blender namespace
class BlenderNamespace(socketio.AsyncNamespace):
def __init__(self, namespace):
super().__init__(namespace)
async def on_connect(self, sid, environ):
print(f"Blender client connected: {sid}")
# Notify web client about new connection
blender_messages[sid] = {}
await sio.emit("blender_connect", sid, namespace="/web")
async def on_disconnect(self, sid):
print(f"Blender client disconnected: {sid}")
# Remove client message and notify web client about disconnection
if sid in blender_messages:
del blender_messages[sid]
await sio.emit("blender_disconnect", sid, namespace="/web")
async def on_data(self, sid, data):
print(f"Data from Blender client {sid}")
# blender_messages[sid]["default_data"] = data
await sio.emit("default_data", {"blenderId": sid, "data": data}, namespace="/web")
async def on_csv_data(self, sid, data):
print(f"CSV data from Blender client {sid}")
# Store the message and forward it to the web client
blender_messages[sid]["csv_data"] = data
await sio.emit("csv_data", {"blenderId": sid, "data": data}, namespace="/web")
async def on_gantt_data(self, sid, data):
print(f"Gant Chart data from Blender client {sid}")
blender_messages[sid]["gantt_data"] = data
await sio.emit("gantt_data", {"blenderId": sid, "data": data}, namespace="/web")
async def on_drawings_data(self, sid, data):
print(f"Drawings directory from Blender client {sid}")
print(data)
blender_messages[sid]["drwings_data"] = data
await sio.emit("drawings_data", {"blenderId": sid, "data": data}, namespace="/web")
# Attach namespaces
sio.register_namespace(WebNamespace("/web"))
sio.register_namespace(BlenderNamespace("/blender"))
# Define a route to render the index.html template
async def index(request):
with open("templates/index.html", "r") as f:
template = f.read()
html_content = pystache.render(template, {"port": sio_port, "version": blenderbim_version})
return web.Response(text=html_content, content_type="text/html")
async def gantt(request):
with open("templates/gantt.html", "r") as f:
template = f.read()
html_content = pystache.render(template, {"port": sio_port, "version": blenderbim_version})
return web.Response(text=html_content, content_type="text/html")
async def drawings(request):
with open("templates/drawings.html", "r") as f:
template = f.read()
html_content = pystache.render(template, {"port": sio_port})
return web.Response(text=html_content, content_type="text/html")
async def on_startup(app):
pid_file = "running_pid.json"
if os.path.exists(pid_file):
with open(pid_file, "r") as f:
pids = json.load(f)
else:
pids = {}
pids[str(os.getpid())] = sio_port
with open(pid_file, "w") as f:
json.dump(pids, f, indent=4)
app.router.add_get("/", index)
app.router.add_get("/drawings", drawings)
app.router.add_get("/gantt", gantt)
app.router.add_static("/jsgantt/", path="../gantt", name="jsgantt")
app.router.add_static("/static/", path="./static", name="static")
app.on_startup.append(on_startup)
def main():
global sio_port
parser = argparse.ArgumentParser(description="SocketIO server")
parser.add_argument("--host", type=str, default="127.0.0.1", help="Host to run the server on")
parser.add_argument("--port", type=int, default=8080, help="Port to run the server on")
args = parser.parse_args()
sio_port = args.port
web.run_app(app, host=args.host, port=sio_port)
if __name__ == "__main__":
main()
# web.run_app(app, host="127.0.0.1", port=sio_port)
@@ -0,0 +1,249 @@
:root {
--font-family: Arial, sans-serif;
--base-font-size: 16px;
--margin-tiny: 0.125rem;
--margin-small: 0.625rem;
--margin-medium: 1.25rem;
--margin-large: 2.5rem;
--padding-tiny: 0.125rem;
--padding-small: 0.625rem;
--padding-medium: 1rem;
--font-size-large: 1.2rem;
--logo-height: 2.5rem;
--nav-height: 2.5rem;
}
:root.dark {
color-scheme: dark;
--bg-color: #252525;
--text-color: #e0e0e0;
--nav-bg-color: #121212;
--nav-border-color: #25682a;
--nav-link-color: #fff;
--nav-link-hover-color: #3fb449;
--warning-color: #FFDB8F;
--border-color: #464444;
}
:root.light {
color-scheme: light;
--bg-color: #ffffff;
--text-color: #000000;
--nav-bg-color: #f8f8f8;
--nav-border-color: #cccccc;
--nav-link-color: #000000;
--nav-link-hover-color: #38a63d;
--warning-color: #FF4500;
--border-color: #222;
}
html {
font-size: var(--base-font-size);
color: var(--text-color);
}
body {
background-color: var(--bg-color);
color: var(--text-color);
margin: 0;
font-family: var(--font-family);
}
#container {
margin-top: var(--margin-medium);
margin-left: var(--margin-small);
margin-right: var(--margin-small);
margin-bottom: var(--margin-medium);
height: calc(100vh - var(--nav-height));
box-sizing: border-box;
display: flex;
}
h3 {
margin-top: 0;
}
nav {
background-color: var(--nav-bg-color);
height: var(--nav-height);
padding: var(--padding-medium) 0;
display: flex;
align-items: center;
position: relative;
border-bottom: 2px solid var(--nav-border-color);
}
nav .logo {
margin-left: var(--margin-large);
height: var(--logo-height);
}
nav ul {
list-style-type: none;
margin: 0;
margin-left: 0.0625rem;
display: flex;
flex-grow: 1;
justify-content: center;
}
nav ul li {
margin-right: 3.125rem;
}
nav ul li a {
text-decoration: none;
color: var(--nav-link-color);
font-size: var(--font-size-large);
}
nav ul li a:hover,
nav ul li a.active {
color: var(--nav-link-hover-color);
}
.warning {
color: var(--warning-color);
margin-bottom: var(--margin-small);
padding: var(--padding-tiny);
display: none;
}
#toggle-theme {
border: none;
background: none;
cursor: pointer;
font-size: var(--font-size-large);
margin-right: var(--margin-medium);
}
#toggle-theme:focus {
outline: none;
}
#client-list {
position: absolute;
top: calc(0 + var(--nav-height));
overflow-y: auto;
overflow: hidden;
transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
border: 1px solid var(--table-border-color);
background-color: var(--nav-bg-color);
z-index: 1;
opacity: 0;
visibility: hidden;
width: auto;
}
#client-list.show {
opacity: 1;
visibility: visible;
}
#connected-list-div {
display: inline-block;
}
.client {
padding: var(--margin-small);
border-bottom: 1px solid var(--table-border-color);
cursor: pointer;
}
.client-details {
max-height: 0;
overflow: hidden;
padding-left: var(--padding-small);
transition: max-height 0.2s ease-out, padding 0.2s ease-out, opacity 0.1s ease-out;
background-color: var(--nav-bg-color);
margin-top: var(--margin-tiny);
opacity: 0;
}
.client-details.show {
max-height: none;
opacity: 1;
}
.client-detail {
border-bottom: 1px solid var(--table-border-color);
padding: var(--padding-small);
}
#show-connected-button {
width: auto;
background-color: var(--bg-color);
border: none;
font-size: var(--base-font-size);
}
#show-connected-button:hover,
.scroll-button:hover {
cursor: pointer;
}
.scroll-button {
font-size: var(--base-font-size);
margin-left: var(--margin-tiny);
margin-top: var(--margin-small);
}
.left {
flex: 1;
background-color: var(--bg-color);
display: flex;
flex-direction: column;
padding: 20px;
}
.right {
flex: 4;
background-color: var(--bg-color);
border: 1px solid var(--border-color);
}
#svg-container {
height: 100%;
}
.panel {
background-color: var(--nav-bg-color);
border: 1px solid var(--border-color);
padding: 10px;
flex-grow: 1;
display: flex;
flex-direction: column;
}
.card-header,
.card-body {
background-color: var(--bg-color);
border: 1px solid var(--border-color);
overflow: auto;
}
.card {
background-color: var(--nav-bg-color);
overflow: auto;
}
li.svg-name {
list-style-type: none;
}
#dropdown-menu:focus {
outline: none;
}
/* remove bootstrap css confilcts */
*,
::after,
::before {
box-sizing: unset;
}
.btn,
.btn:hover {
color: var(--nav-link-hover-color);
}
@@ -0,0 +1,410 @@
:root {
--font-family: Arial, sans-serif;
--base-font-size: 16px;
--margin-tiny: 0.125rem;
--margin-small: 0.625rem;
--margin-medium: 1.25rem;
--margin-large: 2.5rem;
--padding-tiny: 0.125rem;
--padding-small: 0.625rem;
--padding-medium: 1rem;
--font-size-small: 1rem;
--font-size-large: 1.2rem;
--logo-height: 2.5rem;
--nav-height: 2.5rem;
--folder-collapse-font-size: 0.75rem;
--folder-collapse-font-family: Courier, "Courier New", monospace;
--box-shadow: 0 0 0.7rem #5f5f5f66;
}
:root.dark {
color-scheme: dark;
--bg-color: #252525;
--primary-text-color: #e0e0e0;
--secondary-text-color: #c7c7c7;
--nav-bg-color: #121212;
--nav-border-color: #25682a;
--nav-link-color: #fff;
--nav-link-hover-color: #3fb449;
--warning-color: #FFDB8F;
--border-color: #464444;
--hover-bg-color: #3a3a3a;
--highlight-color: #009136;
--task-complete-bg-color: #777777;
--milestone-border-color: #ffffff;
--group-item-bg-color: #4b4b4b;
--input-bg-color: #3b3b3b;
--input-border-color: #000;
--details-border-color: #464444;
}
:root.light {
color-scheme: light;
--bg-color: #ffffff;
--primary-text-color: #000000;
--nav-bg-color: #f8f8f8;
--nav-border-color: #cccccc;
--nav-link-color: #000000;
--nav-link-hover-color: #38a63d;
--warning-color: #FF4500;
--details-border-color: #222;
}
html {
font-size: var(--base-font-size);
}
body {
background-color: var(--bg-color);
color: var(--primary-text-color);
margin: 0;
font-family: var(--font-family);
display: flex;
flex-direction: column;
min-height: 100vh;
}
#container {
flex: 1;
margin-top: var(--margin-medium);
margin-left: var(--margin-small);
margin-right: var(--margin-small);
margin-bottom: var(--margin-medium);
}
h3 {
margin-top: 0;
}
nav {
background-color: var(--nav-bg-color);
padding: var(--padding-medium) 0;
display: flex;
align-items: center;
position: relative;
border-bottom: 2px solid var(--nav-border-color);
}
nav .logo {
margin-left: var(--margin-large);
height: var(--logo-height);
}
nav ul {
list-style-type: none;
margin: 0;
margin-left: 0.0625rem;
display: flex;
flex-grow: 1;
justify-content: center;
}
nav ul li {
margin-right: 3.125rem;
}
nav ul li a {
text-decoration: none;
color: var(--nav-link-color);
font-size: var(--font-size-large);
}
nav ul li a:hover,
nav ul li a.active {
color: var(--nav-link-hover-color);
}
.warning {
color: var(--warning-color);
margin-bottom: var(--margin-small);
padding: var(--padding-tiny);
display: none;
}
.table-description {
margin-bottom: var(--margin-medium);
width: 50%;
background-color: transparent;
border-collapse: collapse;
border-spacing: 0;
border-color: var(--border-color);
border: 1px solid var(--border-color);
border-radius: 0.25rem;
box-shadow: var(--box-shadow);
text-align: center;
}
.table-description tr {
display: table-row;
border-bottom: 1px solid var(--border-color);
}
#toggle-theme {
border: none;
background: none;
cursor: pointer;
font-size: var(--font-size-large);
margin-right: var(--margin-medium);
}
#toggle-theme:focus {
outline: none;
}
#client-list {
position: absolute;
top: calc(0 + var(--nav-height));
overflow-y: auto;
overflow: hidden;
transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
border: 1px solid var(--table-border-color);
background-color: var(--nav-bg-color);
z-index: 1;
opacity: 0;
visibility: hidden;
width: auto;
}
#client-list.show {
opacity: 1;
visibility: visible;
}
#connected-list-div {
display: inline-block;
}
.client {
padding: var(--margin-small);
border-bottom: 1px solid var(--table-border-color);
cursor: pointer;
}
.client-details {
max-height: 0;
overflow: hidden;
padding-left: var(--padding-small);
transition: max-height 0.2s ease-out, padding 0.2s ease-out, opacity 0.1s ease-out;
background-color: var(--nav-bg-color);
margin-top: var(--margin-tiny);
opacity: 0;
}
.client-details.show {
max-height: none;
opacity: 1;
}
.client-detail {
border-bottom: 1px solid var(--table-border-color);
padding: var(--padding-small);
}
#show-connected-button {
width: auto;
background-color: var(--bg-color);
border: none;
font-size: var(--base-font-size);
}
#show-connected-button:hover,
.scroll-button:hover {
cursor: pointer;
}
.scroll-button {
font-size: var(--base-font-size);
margin-left: var(--margin-tiny);
margin-top: var(--margin-small);
}
footer {
background-color: var(--nav-bg-color);
text-align: right;
padding: var(--padding-tiny);
border-top: 1px solid var(--nav-border-color);
}
footer p {
margin: 0;
color: var(--text-color);
margin-right: var(--margin-small);
font-size: 0.8rem;
}
.gantt-info {
margin: 0.5rem;
font-size: var(--font-size-small);
font-weight: bold;
}
.btn {
margin: 0.5rem;
font-size: var(--font-size-small);
cursor: pointer;
}
@media print {
.no-print {
display: none;
}
}
/* ------------ Overwriting JSGantt CSS rules ------------ */
:root.dark div.gantt {
background-color: var(--bg-color);
color: var(--secondary-text-color);
}
:root.dark .gantt table,
:root.dark .gantt td {
border-color: var(--border-color);
}
/* Headings and cell defaults */
:root.dark .gmajorheading,
:root.dark .gminorheading,
:root.dark .gminorheadingwkend,
:root.dark .gtaskcell,
:root.dark .gtaskcellcurrent,
:root.dark .gtaskcellwkend,
:root.dark .gname,
:root.dark .ggroupitem,
:root.dark .gtaskheading {
background-color: var(--bg-color);
border-color: var(--border-color);
}
:root.dark .gtaskheading,
:root.dark .gname,
:root.dark .gtaskname,
:root.dark .gres,
:root.dark .gdur,
:root.dark .gcomp,
:root.dark .gstartdate,
:root.dark .gplanstartdate,
:root.dark .gplanenddate,
:root.dark .gcost,
:root.dark .gchartlbl,
:root.dark .gcontainercol,
:root.dark .genddate {
color: var(--secondary-text-color);
border-color: var(--border-color);
}
:root.dark .gtaskname>div {
color: var(--secondary-text-color);
}
:root.dark .gtaskbarcontainer.gplan,
:root.dark .gchartlbl.gcontainercol {
background: var(--bg-color);
border-color: var(--border-color);
}
:root.dark .gtaskname div,
:root.dark .gtaskheading div,
:root.dark .gtaskname span {
color: var(--secondary-text-color);
}
:root.dark .gtasklist,
:root.dark .gadditional {
border: var(--border-color) 1px solid;
}
:root.dark .gchartgrid {
background-color: var(--bg-color);
}
:root.dark .glistgrid,
:root.dark .glistlbl {
background-color: var(--bg-color);
border-color: var(--border-color);
}
/* .gTaskInfo {
background-color: #2e2e2e;
color: #c7c7c7;
border-color: #c7c7c7;;
} */
/* Dark mode scrollbar */
:root.dark .frame::-webkit-scrollbar-thumb,
:root.dark .frame::-webkit-scrollbar-track {
background-color: var(--bg-color);
}
/* Highlight row */
:root.dark .gitemhighlight td {
background-color: var(--highlight-color);
color: var(--nav-link-color);
}
/* Differentiate Group, Milestone and Ordinary task items (applied to row) */
:root.dark .ggroupitem {
background-color: var(--bg-color);
font-weight: bold;
border-color: var(--border-color);
}
:root.dark .gmileitem,
:root.dark .glineitem {
background-color: var(--bg-color);
}
/* Task bar caption text styles */
:root.dark .gmilecaption,
:root.dark .ggroupcaption,
:root.dark .gcaption {
color: var(--nav-link-color);
}
/* Task complete %age bar */
:root.dark .gtaskcomplete {
background-color: var(--task-complete-bg-color);
}
/* Milestones */
:root.dark .gmdtop,
:root.dark .gmdbottom {
border-bottom: 5px solid var(--milestone-border-color);
}
:root.dark .gfoldercollapse {
color: var(--secondary-text-color);
cursor: pointer;
font-weight: bold;
font-size: var(--folder-collapse-font-size);
font-family: var(--folder-collapse-font-family);
}
/* Highlight for collapsible row */
:root.dark .gname.ggroupitem {
background-color: var(--group-item-bg-color);
}
/* Form label and selected highlighting */
:root.dark .gformlabel {
background-color: var(--formlabel-bg-color);
color: var(--secondary-text-color);
border: var(--formlabel-border-color) 1px solid;
}
:root.dark span.gformlabel:hover {
background-color: var(--hover-bg-color);
border-color: var(--border-color);
}
:root.dark span.gselected {
background-color: var(--formlabel-selected-bg-color);
border-color: var(--task-complete-bg-color);
color: var(--nav-link-color);
}
:root.dark .gantt-inputtable {
background-color: var(--input-bg-color);
box-sizing: border-box;
border: 1px solid var(--input-border-color);
color: var(--secondary-text-color);
}
@@ -0,0 +1,224 @@
:root {
--font-family: Arial, sans-serif;
--base-font-size: 16px;
--margin-tiny: 0.125rem;
--margin-small: 0.625rem;
--margin-medium: 1.25rem;
--margin-large: 2.5rem;
--padding-tiny: 0.125rem;
--padding-small: 0.625rem;
--padding-medium: 1rem;
--font-size-large: 1.2rem;
--logo-height: 2.5rem;
--nav-height: 2.5rem;
}
:root.dark {
color-scheme: dark;
--bg-color: #252525;
--text-color: #e0e0e0;
--nav-bg-color: #121212;
--nav-border-color: #25682a;
--nav-link-color: #fff;
--nav-link-hover-color: #3fb449;
--warning-color: #FFDB8F;
--table-border-color: #464444;
}
:root.light {
color-scheme: light;
--bg-color: #ffffff;
--text-color: #000000;
--nav-bg-color: #f8f8f8;
--nav-border-color: #cccccc;
--nav-link-color: #000000;
--nav-link-hover-color: #38a63d;
--warning-color: #FF4500;
--table-border-color: #222;
}
html {
font-size: var(--base-font-size);
}
body {
background-color: var(--bg-color);
color: var(--text-color);
margin: 0;
font-family: var(--font-family);
display: flex;
flex-direction: column;
min-height: 100vh;
}
#container {
flex: 1;
margin-top: var(--margin-medium);
margin-left: var(--margin-small);
margin-right: var(--margin-small);
margin-bottom: var(--margin-medium);
}
h3 {
margin-top: 0;
}
nav {
background-color: var(--nav-bg-color);
height: var(--nav-height);
padding: var(--padding-medium) 0;
display: flex;
align-items: center;
position: relative;
border-bottom: 2px solid var(--nav-border-color);
}
nav .logo {
margin-left: var(--margin-large);
height: var(--logo-height);
}
nav ul {
list-style-type: none;
margin: 0;
margin-left: 0.0625rem;
display: flex;
flex-grow: 1;
justify-content: center;
}
nav ul li {
margin-right: 3.125rem;
}
nav ul li a {
text-decoration: none;
color: var(--nav-link-color);
font-size: var(--font-size-large);
}
nav ul li a:hover,
nav ul li a.active {
color: var(--nav-link-hover-color);
}
.warning {
color: var(--warning-color);
margin-bottom: var(--margin-small);
padding: var(--padding-tiny);
display: none;
}
#toggle-theme {
border: none;
background: none;
cursor: pointer;
font-size: var(--font-size-large);
margin-right: var(--margin-medium);
}
#toggle-theme:focus {
outline: none;
}
#client-list {
position: absolute;
top: calc(0 + var(--nav-height));
overflow-y: auto;
overflow: hidden;
transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
border: 1px solid var(--table-border-color);
background-color: var(--nav-bg-color);
z-index: 1;
opacity: 0;
visibility: hidden;
width: auto;
}
#client-list.show {
opacity: 1;
visibility: visible;
}
#connected-list-div {
display: inline-block;
}
.client {
padding: var(--margin-small);
border-bottom: 1px solid var(--table-border-color);
cursor: pointer;
}
.client-details {
max-height: 0;
overflow: hidden;
padding-left: var(--padding-small);
transition: max-height 0.2s ease-out, padding 0.2s ease-out, opacity 0.1s ease-out;
background-color: var(--nav-bg-color);
margin-top: var(--margin-tiny);
opacity: 0;
}
.client-details.show {
max-height: none;
opacity: 1;
}
.client-detail {
border-bottom: 1px solid var(--table-border-color);
padding: var(--padding-small);
}
#show-connected-button {
width: auto;
background-color: var(--bg-color);
border: none;
font-size: var(--base-font-size);
}
#show-connected-button:hover,
.scroll-button:hover {
cursor: pointer;
}
.scroll-button {
font-size: var(--base-font-size);
margin-left: var(--margin-tiny);
margin-top: var(--margin-small);
}
footer {
background-color: var(--nav-bg-color);
text-align: right;
padding: var(--padding-tiny);
border-top: 1px solid var(--nav-border-color);
}
footer p {
margin: 0;
color: var(--text-color);
margin-right: var(--margin-small);
font-size: 0.8rem;
}
.table-container {
margin-bottom: var(--margin-large);
}
.csv-table {
margin-top: var(--margin-small);
}
/* ------------ Overwriting Tabulator CSS rules ------------ */
:root.light .tabulator-header,
:root.light .tabulator .tabulator-header .tabulator-col {
background: var(--nav-bg-color) !important;
color: var(--text-color);
}
:root.light .tabulator {
border-top: 1px solid var(--table-border-color);
border-bottom: 2px solid var(--table-border-color);
}
@@ -0,0 +1,263 @@
// keeps track of blenders connected
const connectedClients = {};
const allDrawings = {};
let socket;
// Document ready function
$(document).ready(function () {
var systemTheme = window.matchMedia("(prefers-color-scheme: light)").matches
? "light"
: "dark";
var theme = localStorage.getItem("theme") || systemTheme;
setTheme(theme);
$("#dropdown-menu").change(function () {
const blenderId = $(this).attr("id");
const ifcFile = $(this).val();
displayDrawingsNames(blenderId, ifcFile);
});
connectSocket();
});
// Function to connect to Socket.IO server
function connectSocket() {
const url = "ws://localhost:" + SOCKET_PORT + "/web";
socket = io(url);
console.log("socket: ", socket);
// Register socket event handlers
socket.on("blender_connect", handleBlenderConnect);
socket.on("blender_disconnect", handleBlenderDisconnect);
socket.on("connect", handleWebConnect);
socket.on("drawings_data", handleDrawingsData);
socket.on("svg_data", handleSvgData);
// socket.on("default_data", handleDefaultData);
}
// function used to get drawings data from blenderbim
function handleWebConnect() {
const msg = {
sourcePage: "drawings",
operator: {
type: "getDrawings",
},
};
socket.emit("web_operator", msg);
}
// Function to handle 'blender_connect' event
function handleBlenderConnect(blenderId) {
console.log("blender_connect: ", blenderId);
if (!connectedClients.hasOwnProperty(blenderId)) {
connectedClients[blenderId] = {
shown: false,
ifc_file: "",
};
}
}
// Function to handle 'blender_disconnect' event
function handleBlenderDisconnect(blenderId) {
console.log("blender_disconnect: ", blenderId);
if (connectedClients.hasOwnProperty(blenderId)) {
delete connectedClients[blenderId];
// remove(blenderId);
}
$("#blender-count").text(function (i, text) {
return parseInt(text, 10) - 1;
});
}
function handleDrawingsData(data) {
const blenderId = data["blenderId"];
console.log(data);
const filename = data["data"]["ifc_file"];
const drawings = data["data"]["drawings_data"]["drawings"];
const sheets = data["data"]["drawings_data"]["sheets"];
allDrawings[filename] = { drawings: drawings, sheets: sheets };
console.log(connectedClients);
if (connectedClients.hasOwnProperty(blenderId)) {
if (!connectedClients[blenderId].shown) {
connectedClients[blenderId] = {
shown: true,
ifc_file: filename,
};
addSelectOption(blenderId, filename);
} else {
// update(blenderId, data, filename);
}
} else {
connectedClients[blenderId] = {
shown: true,
ifc_file: filename,
};
addSelectOption(blenderId, filename);
}
}
function handleSvgData(data) {
const svgContainer = document.getElementById("svg-container");
svgContainer.innerHTML = "";
svgContainer.style.backgroundColor = "white";
const dom = SVG(svgContainer).svg(data);
const svgElement = dom.node.children[0];
// to make the svg not grow outside the svg container
svgElement.setAttribute("width", "100%");
svgElement.setAttribute("height", "100%");
svgElement.style.maxWidth = "100%";
svgElement.style.maxHeight = "100%";
svgElement.style.width = "100%";
svgElement.style.height = "100%";
svgElement.style.boxSizing = "border-box"; // Ensure padding and borders are included in the element's total width and height
const panZoomControls = svgPanZoom(svgElement, {
zoomEnabled: true,
controlIconsEnabled: true,
fit: true,
center: true,
});
}
function addSelectOption(blenderId, filename) {
const filenameOption = $("<option></option>")
.attr("id", "blender-" + blenderId)
.val(filename)
.text(filename);
$("#dropdown-menu").append(filenameOption);
}
function displayDrawingsNames(blenderId, ifcFile) {
drawings = allDrawings[ifcFile].drawings;
sheets = allDrawings[ifcFile].sheets;
function createSvgNames(text, index, type) {
var label = $("<li></lio>")
.text(text)
.attr("id", type + "-" + index)
.addClass("svg-name")
.click(function () {
const id = $(this).attr("id").split("-");
const index = parseInt(id[1]);
const type = id[0];
const ifcFile = $("#dropdown-menu").val();
var path = "";
if (type === "drawing") {
path = allDrawings[ifcFile].drawings[index].path;
} else if (type === "sheet") {
path = allDrawings[ifcFile].sheets[index].path;
}
const msg = {
path: path,
};
console.log(msg);
socket.emit("get_svg", msg);
});
if (type === "drawing") $("#drawings-sub-panel").append(label);
else if (type === "sheet") $("#sheets-sub-panel").append(label);
}
$("#drawings-sub-panel").empty();
drawings.forEach(function (drawing, index) {
createSvgNames(drawing.name, index, "drawing");
});
$("#sheets-sub-panel").empty();
sheets.forEach(function (sheet, index) {
createSvgNames(sheet.name, index, "sheet");
});
}
function setTheme(theme) {
if (theme === "light") {
$("html").removeClass("dark").addClass("light");
$("#toggle-theme").html('<i class="fas fa-sun"></i>');
} else {
$("html").removeClass("light").addClass("dark");
$("#toggle-theme").html('<i class="fas fa-moon"></i>');
}
localStorage.setItem("theme", theme);
}
function toggleTheme() {
if ($("html").hasClass("dark")) {
setTheme("light");
} else {
setTheme("dark");
}
}
function toggleClientList() {
var clientList = $("#client-list");
if (clientList.hasClass("show")) {
clientList.removeClass("show");
return;
}
clientList.empty();
$.each(connectedClients, function (id, client) {
if (!client.shown) return;
const dropdownIcon = $("<i>")
.addClass("fas fa-chevron-down")
.css("margin-left", "0.5rem");
const clientDiv = $("<div>").addClass("client").text(client.ifc_file);
clientDiv.append(dropdownIcon);
const clientDetailsDiv = $("<div>").addClass("client-details");
if (id) {
const clientId = $("<div>")
.addClass("client-detail")
.text(`Blender ID: ${id}`);
clientDetailsDiv.append(clientId);
}
if (client.headers && client.headers.length) {
const clientHeaders = $("<div>")
.addClass("client-detail")
.text(`Table Headers: ${client.headers.join(", ")}`);
const scrollButton = $("<button>")
.addClass("scroll-button")
.text("Scroll to Table")
.on("click", function () {
$("html, body").animate(
{
scrollTop: $("#table-" + id).offset().top,
},
600
);
clientList.removeClass("show");
});
clientDetailsDiv.append(clientHeaders);
clientDetailsDiv.append(scrollButton);
}
clientDiv.append(clientDetailsDiv);
clientDiv.on("click", function () {
clientDetailsDiv.toggleClass("show");
});
clientList.append(clientDiv);
});
clientList.addClass("show");
}
@@ -0,0 +1,466 @@
// keeps track of blenders connected in form of
// shown:bool, workSchedule: {}, ganttTasks: {},
const connectedClients = {};
let socket;
// print options
const pageSizes = [
{ value: "210,297", text: "A4 Portrait" },
{ value: "297,210", text: "A4 Landscape" },
{ value: "297,420", text: "A3 Portrait" },
{ value: "420,297", text: "A3 Landscape" },
{ value: "420,594", text: "A2 Portrait" },
{ value: "594,420", text: "A2 Landscape" },
{ value: "594,841", text: "A1 Portrait" },
{ value: "841,594", text: "A1 Landscape" },
{ value: "841,1189", text: "A0 Portrait" },
{ value: "1189,841", text: "A0 Landscape" },
];
// Document ready function
$(document).ready(function () {
var systemTheme = window.matchMedia("(prefers-color-scheme: light)").matches
? "light"
: "dark";
var theme = localStorage.getItem("theme") || systemTheme;
setTheme(theme);
connectSocket();
});
// Function to connect to Socket.IO server
function connectSocket() {
const url = "ws://localhost:" + SOCKET_PORT + "/web";
socket = io(url);
console.log("socket: ", socket);
// Register socket event handlers
socket.on("blender_connect", handleBlenderConnect);
socket.on("blender_disconnect", handleBlenderDisconnect);
socket.on("gantt_data", handleGanttData);
socket.on("default_data", handleDefaultData);
}
// Function to handle 'blender_connect' event
function handleBlenderConnect(blenderId) {
console.log("blender_connect: ", blenderId);
if (!connectedClients.hasOwnProperty(blenderId)) {
connectedClients[blenderId] = {
shown: false,
workSchedule: {},
ganttTasks: {},
};
}
}
// Function to handle 'blender_disconnect' event
function handleBlenderDisconnect(blenderId) {
console.log("blender_disconnect: ", blenderId);
if (connectedClients.hasOwnProperty(blenderId)) {
delete connectedClients[blenderId];
removeGanttElement(blenderId);
}
$("#blender-count").text(function (i, text) {
return parseInt(text, 10) - 1;
});
}
// Function to handle 'gantt_data' event
function handleGanttData(data) {
const blenderId = data["blenderId"];
console.log(data);
const filename = data["data"]["ifc_file"];
const ganttTasks = data["data"]["gantt_data"]["tasks"];
const ganttWorkSched = data["data"]["gantt_data"]["work_schedule"];
// const ganttWorkSched = {};
if (connectedClients.hasOwnProperty(blenderId)) {
if (!connectedClients[blenderId].shown) {
connectedClients[blenderId] = {
shown: true,
ifc_file: filename,
ganttTasks: ganttTasks,
workSchedule: ganttWorkSched,
};
addGanttElement(blenderId, ganttTasks, ganttWorkSched, filename);
} else {
updateGanttElement(blenderId, ganttTasks, ganttWorkSched, filename);
connectedClients[blenderId].workSchedule = ganttWorkSched;
connectedClients[blenderId].ganttTasks = ganttTasks;
}
} else {
connectedClients[blenderId] = {
shown: true,
ifc_file: filename,
ganttTasks: ganttTasks,
workSchedule: ganttWorkSched,
};
addGanttElement(blenderId, ganttTasks, ganttWorkSched, filename);
}
}
function handleDefaultData(data) {
const blenderId = data["blenderId"];
const isDirty = data["data"]["is_dirty"];
showWarning(blenderId, isDirty);
console.log(data);
}
// Function to add a new gantt with data and filename
function addGanttElement(blenderId, tasks, workSched, filename) {
$("#blender-count").text(function (i, text) {
return parseInt(text, 10) + 1;
});
const ganttContainer = $("<div></div>")
.addClass("gantt-container")
.attr("id", "container-" + blenderId);
const ganttTitle = $("<h3></h3>")
.attr("id", "title-" + blenderId)
.text(filename)
.addClass("no-print")
.css("margin-bottom", "10px");
const warning = $("<div></div>")
.attr("id", "warning-" + blenderId)
.html(
"&#9888; Warning: This Gantt Chart may contain outdated data due to recent changes in Blender."
)
.addClass("warning no-print");
const workSchedDiv = $("<div></div>").attr("id", "workSched" + blenderId);
const scheduleTable = $("<table></table>")
.addClass("no-print table-description")
.attr("id", "workSchedTable-" + blenderId)
.hide();
$.each(workSched, (key, value) => {
value = value ? value : "null";
$("<tr></tr>")
.append($("<td></td>").text(key))
.append($("<td></td>").text(value))
.appendTo(scheduleTable);
});
const toggleButton = $("<button></button>")
.text("Show Schedule Info")
.addClass("btn no-print")
.on("click", function () {
scheduleTable.toggle();
const buttonText = scheduleTable.is(":visible")
? "Hide Schedule Info"
: "Show Schedule Info";
toggleButton.text(buttonText);
});
var ganttInfoDiv = $("<div></div>")
.addClass("gantt-info")
.attr("id", "gantt-info-" + blenderId);
const scheduleName = $("<span></span>").text("Schedule: " + workSched.Name);
const createdOn = $("<span></span>")
.text("Created: " + new Date(workSched.CreationDate).toLocaleDateString())
.css("float", "right");
const ganttDiv = $("<div></div>")
.addClass("gantt-chart")
.attr("id", "gantt-" + blenderId);
ganttInfoDiv.append(scheduleName);
ganttInfoDiv.append(createdOn);
workSchedDiv.append(toggleButton);
workSchedDiv.append(scheduleTable);
ganttContainer.append(ganttTitle);
ganttContainer.append(warning);
ganttContainer.append(workSchedDiv);
ganttContainer.append(ganttInfoDiv);
ganttContainer.append(ganttDiv);
$("#container").append(ganttContainer);
let g = new JSGantt.GanttChart($("#gantt-" + blenderId)[0], "week");
g.setOptions({
vCaptionType: "Caption", // Set to Show Caption : None,Caption,Resource,Duration,Complete,
vQuarterColWidth: 36,
vDateTaskDisplayFormat: "day dd month yyyy", // Shown in tool tip box
vDayMajorDateDisplayFormat: "mon yyyy - Week ww", // Set format to dates in the "Major" header of the "Day" view
vWeekMinorDateDisplayFormat: "dd mon", // Set format to display dates in the "Minor" header of the "Week" view
vLang: "en",
vShowTaskInfoLink: 1, // Show link in tool tip (0/1)
vShowEndWeekDate: 0, // Show/Hide the date for the last day of the week in header for daily
vUseSingleCell: 10000, // Set the threshold cell per table row (Helps performance for large data.
vFormatArr: ["Day", "Week", "Month", "Quarter"], // Even with setUseSingleCell using Hour format on such a large chart can cause issues in some browsers,
vShowRes: true, // Disable the resource column.
vShowComp: false, // Disable the completion column.
vShowDur: false, // Disable the duration column, because jsgantt doesn't calculate durations the way we want.
vAdditionalHeaders: {
ifcduration: { title: "Duration" },
resourceUsage: { title: "Resource Usage" },
},
vUseToolTip: true, // Disable tooltips.
vTooltipTemplate: generateTooltip,
vTotalHeight: 900,
vEventsChange: {
taskname: editValue, // if you need to use the this scope, do: editValue.bind(this)
res: editValue,
dur: editValue,
comp: editValue,
start: editValue,
end: editValue,
planstart: editValue,
planend: editValue,
cost: editValue,
additional_category: editValue,
},
});
JSGantt.addJSONTask(g, tasks);
g.setEditable(true);
g.Draw();
connectedClients[blenderId]["gantt"] = g;
let printButton = $("<button>", {
id: "print-btn-" + blenderId,
html: "Print",
class: "btn no-print",
});
let printOptions = $("<select>", {
id: "print-options-" + blenderId,
class: "no-print",
});
$.each(pageSizes, function (index, size) {
printOptions.append(
$("<option>", {
value: size.value,
text: size.text,
})
);
});
printButton.on("click", function () {
// make it only the corresponding gantt chart is printed
$(".gantt-chart").removeClass("no-print");
$(".gantt-chart")
.not("#gantt-" + blenderId)
.addClass("your-css-class");
var values = $("#print-options-" + blenderId)
.val()
.split(",");
g.setEditable(false);
g.setTotalHeight("");
g.Draw();
addEventListener("afterprint", (event) => {
g.setEditable(true);
});
let css =
"@media print {\n" +
" @page {\n" +
" size: " +
values[0] +
"mm " +
values[1] +
"mm;\n" +
" }\n" +
" /* Make all text black */\n" +
" body, p, span, h1, h2, h3, h4, h5, h6, div, a, li, td, th, * {\n" +
" color: black !important;\n" +
" }\n" +
"}";
g.printChart(values[0], values[1], css);
g.setTotalHeight(900);
g.Draw();
});
ganttContainer.append(printOptions);
ganttContainer.append(printButton);
}
// Function to update gantt and filename
function updateGanttElement(blenderId, tasks, workSched, filename) {
// update work schedule table
const table = $("#workSchedTable-" + blenderId);
table.empty();
$.each(workSched, (key, value) => {
value = value ? value : "null";
$("<tr></tr>")
.append($("<td></td>").text(key))
.append($("<td></td>").text(value))
.appendTo(table);
});
// update gantt chart with new data
let g = connectedClients[blenderId]["gantt"];
g.ClearTasks();
g.Draw();
JSGantt.addJSONTask(g, tasks);
g.Draw();
$("#title-" + blenderId).text(filename);
$("#warning-" + blenderId).css("display", "none");
}
// Function to remove gantt element
function removeGanttElement(blenderId) {
$("#container-" + blenderId).remove();
}
function showWarning(blenderId, isDirty) {
$("#warning-" + blenderId).css("display", "block");
}
// Utility function to create a tooltip for the gantt chars
function generateTooltip(task) {
var dataObject = task.getDataObject();
var numberResources = dataObject.resourceUsage
? dataObject.resourceUsage
: "NULL";
return `
<dl>
<dt>Name:</dt><dd>{{pName}}</dd>
<dt>Start:</dt><dd>{{pStart}}</dd>
<dt>End:</dt><dd>{{pEnd}}</dd>
<dt>Duration:</dt><dd>${dataObject.ifcduration}</dd>
<dt>Number of Resources:</dt><dd>${numberResources}</dd>
<dt>Resources:</dt><dd>{{pRes}}</dd>
</dl>
`;
}
// Event handlers for editing gantt table data
function editValue(list, task, event, cell, column) {
console.log("editValue function called with the following parameters:");
console.log("list:", list);
console.log("task:", task);
console.log("event:", event);
console.log("cell:", cell);
console.log("column:", column);
const ganttId = task.getGantt()["vDiv"].id;
const index = ganttId.indexOf("-") + 1;
const blenderId = ganttId.substring(index);
const workSchedId = connectedClients[blenderId].workSchedule.id;
// update data object reprsenting the task
const dataObj = task.getDataObject();
dataObj[column] = event.target.value;
task.setDataObject(dataObj);
const msg = {
sourcePage: "gantt",
blenderId: blenderId,
operator: {
type: "editTask",
workScheduleId: workSchedId,
taskId: task.getOriginalID(),
column: column,
value: event.target.value,
},
};
socket.emit("web_operator", msg);
}
function setTheme(theme) {
if (theme === "light") {
$("html").removeClass("dark").addClass("light");
$("#toggle-theme").html('<i class="fas fa-sun"></i>');
} else {
$("html").removeClass("light").addClass("dark");
$("#toggle-theme").html('<i class="fas fa-moon"></i>');
}
localStorage.setItem("theme", theme);
}
function toggleTheme() {
if ($("html").hasClass("dark")) {
setTheme("light");
} else {
setTheme("dark");
}
}
function toggleClientList() {
var clientList = $("#client-list");
if (clientList.hasClass("show")) {
clientList.removeClass("show");
return;
}
clientList.empty();
$.each(connectedClients, function (id, client) {
if (!client.shown) return;
const dropdownIcon = $("<i>")
.addClass("fas fa-chevron-down")
.css("margin-left", "0.5rem");
const clientDiv = $("<div>").addClass("client").text(client.ifc_file);
clientDiv.append(dropdownIcon);
const clientDetailsDiv = $("<div>").addClass("client-details");
if (id) {
const clientId = $("<div>")
.addClass("client-detail")
.text(`Blender ID: ${id}`);
clientDetailsDiv.append(clientId);
}
if (client.workSchedule && client.gantt) {
const clientScheduleName = $("<div>")
.addClass("client-detail")
.text(`Schedule Name: ${client.workSchedule.Name}`);
const clientScheduleDate = $("<div>")
.addClass("client-detail")
.text(
`Schedule Date: ${new Date(
client.workSchedule.CreationDate
).toLocaleDateString()}`
);
const scrollButton = $("<button>")
.addClass("scroll-button")
.text("Scroll to Gantt Chart")
.on("click", function () {
$("html, body").animate(
{
scrollTop: $("#gantt-" + id).offset().top,
},
600
);
clientList.removeClass("show");
});
clientDetailsDiv.append(clientScheduleName);
clientDetailsDiv.append(clientScheduleDate);
clientDetailsDiv.append(scrollButton);
}
clientDiv.append(clientDetailsDiv);
clientDiv.on("click", function () {
clientDetailsDiv.toggleClass("show");
});
clientList.append(clientDiv);
});
clientList.addClass("show");
}

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