Compare commits

...

1806 Commits

Author SHA1 Message Date
Dion Moult f08ed629b5 New debug feature to purge HDF5 cache in case the cache is corrupted. 2022-01-11 11:24:13 +11:00
Dion Moult ba675c0d28 Implement human readable rdfs labels in Brickschema navigator 2022-01-11 10:44:52 +11:00
Gorgious56 3a80722621 Display IFC schema in file selector right hand side panel (#1978)
* Display IFC schema in file selector right hand side panel

* Formatting

* Fix possible error when the file name or description contains the word "schema"
2022-01-11 08:52:14 +11:00
Dion Moult 9b77bb6e37 New utility to get IFC all elements that are relevant in Brickschema 2022-01-10 17:31:42 +11:00
Dion Moult 7a6df49348 Basic implementation to bulk convert relevant IFC classes to a Brick model 2022-01-10 17:30:49 +11:00
Dion Moult 666e484b2b Run black on IfcOpenShell-python. 2022-01-10 15:42:24 +11:00
Dion Moult 256f40ed44 New IFC to Brick class mapping utility 2022-01-10 15:35:37 +11:00
Dion Moult 8eccb1a5ed You can now select all system objects from the object panel for convenience. 2022-01-10 12:21:38 +11:00
Dion Moult ce3490824d Optimise all editing API functions to be 100x faster when you're dealing with proprietary BIM exports with loads of shared owner histories. See #1904 and #1905. 2022-01-10 12:12:34 +11:00
Dion Moult 43c74010a5 Schema versions are no longer locked to IFC4 and 2X3. You can now load express schemas at run time. 2022-01-10 10:45:46 +11:00
Dion Moult 6c991ed356 Purge obsolete IFC types mappings 2022-01-10 09:40:42 +11:00
Thomas Krijnen c01c2a737a test runner doesn't have dae 2022-01-09 21:26:40 +01:00
Thomas Krijnen c9c11a2905 Install to system local root 2022-01-09 21:11:47 +01:00
Thomas Krijnen e5037dc41a #1960 test cases 2022-01-09 20:52:48 +01:00
Thomas Krijnen acd9250028 Also log perf with quiet 2022-01-09 15:21:16 +01:00
Thomas Krijnen a3dc477921 Fix perf logging in convert 2022-01-09 15:15:50 +01:00
Thomas Krijnen 6246dda8d6 #1960 make configurable 2022-01-09 15:15:29 +01:00
Thomas Krijnen 2683bcba20 Fix: shift count negative or too big 2022-01-09 15:14:13 +01:00
Thomas Krijnen 97f2aa976e Merge branch 'v0.7.0' of https://github.com/IfcOpenShell/IfcOpenShell into v0.7.0 2022-01-09 14:32:23 +01:00
Thomas Krijnen 9b96073ac0 #1960 BRepBuilderAPI_MakeFace on non-overlapping 2d subtraction 2022-01-09 14:32:13 +01:00
Thomas Krijnen 7efd9cea2a Log performance aggregates as logger messages 2022-01-09 14:31:13 +01:00
Thomas Krijnen c917881a8e Logging statement for total file conversion 2022-01-09 14:30:56 +01:00
Thomas Krijnen fa46eb140f Update template.py main.schema_identifier doesn't exist 2022-01-09 11:41:24 +01:00
Thomas Krijnen b8ea42540e #1973 Performance logging 2022-01-07 15:12:32 +01:00
Thomas Krijnen 671ab78c76 #1969 take uppercase in register_schema() 2022-01-07 12:49:28 +01:00
jakob-beetz a8550cea26 build-deps.cmd typo 0.7.0 branch 2022-01-07 12:47:28 +01:00
Dion Moult 4f047274bf The IfcOpenShell API now supports automatic primitive casting for editing properties. See #1943. 2022-01-07 17:38:43 +11:00
Dion Moult eb04a7d579 Visual clean up of bulk property editing UI 2022-01-07 17:38:43 +11:00
Dion Moult 84096529e1 Primary measure type lists are now dynamically generated based on the schema. 2022-01-07 17:38:43 +11:00
Dion Moult 3350f31312 Write documentation to help developers get acquainted with testing 2022-01-07 17:38:43 +11:00
Dion Moult 0d79963ed8 Clear outdated README text which we won't maintain to prevent confusion 2022-01-07 17:38:43 +11:00
Dion Moult 43a8fa8bcb It's 2022! 2022-01-07 17:38:43 +11:00
Thomas Krijnen ca8f3cf1e6 Update README.md 2022-01-06 10:17:56 +01:00
garylzimmer 313a1c5705 Update README.md
Updated based on my personal findings. Can provide documentation if necessary.
2022-01-06 10:17:31 +01:00
Vukas Pajic 53f6454784 Fix integers in enumerations #1943 (#1946)
* first draft

* small change
2022-01-04 13:10:42 +11:00
Vukas Pajic 2c0df1d4f5 fix umlauts not showing up correctly in dynamic enums #1941 (#1945)
* first attempt

* adopted new solution for umlauts in enums

* fix typo
2022-01-04 13:09:47 +11:00
molitoris e384dbd548 Correct HeaderFile (#1942)
Rename file_name to filename (without underline)
2022-01-04 13:06:01 +11:00
Cyril Waechter d22a0c7cb8 Boundary geom creation : fix math + small ui fix (#1938)
_Neo accidentally took the red pill so I transposed the matrix to make
it blue_

* Fix how placement matrix of updated geometry is created.
* Fix ui: was throwing an error when boundary had no
`RelatedBuildingElement`
2022-01-04 13:04:06 +11:00
Gorgious56 02a62a943c Fix #1717 : Disable task editing if task was deleted as a result of deleting its parent (#1936)
* Disable task editing if task was deleted as a result of deleting its parent

* Optimize logic for bigger number of tasks

* Don't try to disable editing if not editing in the first place
2022-01-04 13:03:39 +11:00
Vukas Pajic 0625e4153c bulk property editor (#1896)
* first revision

* update incorporating review comments

* added a new feature - remove psets

* type dropdown now references ifc data types

* adopt new solution for enumerations and umlauts

* Revert "adopt new solution for enumerations and umlauts"

This reverts commit 203a31a2bf.
2022-01-04 12:59:55 +11:00
Jesusbill 03f5feca88 refactor structural module - wip - structural analysis models #1848 2022-01-02 00:34:38 +01:00
ssg 85e3c6588f Updated README.md for OCCT/IfcOpenShell7
After #1930 the 0.7 branch isn't compatible anymore with OCCT version < 7.2. That includes the liboce that's found in debian (derivatives), which is OCCT 6.9 or even less. Updated the Linux section of README.md to explain the dependency on OCCT and include instructions to build on Unix with OCCT (from the OS repository as well). Also included changes that became necessary when we moved to v0.7.0 from v0.6.0 (like recursive clone and cmake additions).
2021-12-31 13:46:13 +01:00
bosonprojets 6e913a0ff9 BlenderBIM Feature - Filter By Building Storey 2021-12-28 23:46:22 +01:00
Thomas Krijnen ff4e58a8ff Update README.md 2021-12-20 11:46:07 +01:00
Dion Moult 1db028fa7b Fix bug where IfcPatch IFC4 migration could break on Revit files 2021-12-20 16:39:14 +11:00
Thomas Krijnen 69a7efdab4 Does this make gcc happy for uint64_t enums? 2021-12-19 22:31:40 +01:00
Thomas Krijnen 20dcb68009 Invalidate the boolean result for a particular warning reported by pavefiller 2021-12-19 22:14:09 +01:00
Thomas Krijnen 6b0b64b869 Good news everyone! Option to process wall opening subtractions in 2D. 2021-12-19 22:08:16 +01:00
Thomas Krijnen 09631e9565 Remove some erroneous or wrong (hopefully) lines on mintol and prec 2021-12-19 22:01:07 +01:00
Thomas Krijnen e9bb70f56b Eliminate boolean sub operands b that only touch operand a 2021-12-19 21:59:29 +01:00
Thomas Krijnen bd008bdefe option to write boolean operands to disk for debugging 2021-12-19 21:57:47 +01:00
Thomas Krijnen 03d4782cb7 Ground work for processing opening placement up to parent wall 2021-12-19 21:55:41 +01:00
Thomas Krijnen 49c555c508 Log BRepCheck_Analyser results 2021-12-18 22:02:47 +01:00
Thomas Krijnen c51c5651b2 Small changes to iterator settings 2021-12-18 16:16:44 +01:00
Thomas Krijnen 364c2286d1 #1937 use git branch --contains instead show 2021-12-18 16:16:21 +01:00
Jesusbill 37d20eb360 changes in ifc2ca standard case 2021-12-17 17:01:18 +01:00
Jesusbill dd6912bdaa ifc2ca - possibility to exclude zero length springs in point connections 2021-12-17 16:27:41 +01:00
Jesusbill a1fe68a17e changes in ifc2ca bonded case 2021-12-17 09:58:02 +01:00
Thomas Krijnen 3ec79cac3f #1914 only proceed with 'face addition check' when first operand contains open shells 2021-12-15 13:37:12 +01:00
Thomas Krijnen dbc6f521fe #1912 apply also on types 2021-12-14 09:57:31 +01:00
Thomas Krijnen c52f851d79 #1807 method mapping proposal 2021-12-14 09:57:31 +01:00
Thomas Krijnen 3380158f55 #1692 memory leak in get_info_2() 2021-12-13 10:32:05 +01:00
Jesusbill 4e9a5f246f minor changes in ifc2ca scripts 2021-12-12 19:03:14 +01:00
Dion Moult 664c49a07d Bump IfcOpenShell. See #1906. 2021-12-11 21:10:03 +11:00
Thomas Krijnen 06b9cc6b38 CMakeLists ADD_COMMIT_SHA option 2021-12-10 10:03:41 +01:00
fichter b9ea741e5e OCC7.5 to OCC7.6 -> depracated Poly_Triangulation Nodes() 2021-12-10 08:44:42 +01:00
Thomas Krijnen 0098e38c77 Switch to libocct for yml workflows: add data-exchange libs 2021-12-10 08:08:03 +01:00
Dion Moult ece796fc2d Fix #1917. Fix warning where the relating type classes data couldn't be accessed. 2021-12-10 14:06:54 +11:00
Dion Moult de4659570a See #1917. Refactor and fix warning message when you haven't got any contexts in a project yet. 2021-12-10 13:31:23 +11:00
Dion Moult 62236c44ae Fix #1923. Fix bug where creating a new structural analysis model broke. 2021-12-10 10:58:06 +11:00
Dion Moult ce5db914db Fix #1913. Fix bug where filtering by decomposition didn't work on IFC2X3. 2021-12-10 10:14:43 +11:00
Dion Moult 12699f29b7 Minor fix 2021-12-10 09:44:23 +11:00
Dion Moult 54e326983f Fix #1921. Document issue with installing on outdated Ubuntu distributions. 2021-12-10 09:43:28 +11:00
Thomas Krijnen 5fb40a390c Switch to libocct for yml workflows: update include dir 2021-12-09 20:52:30 +01:00
Thomas Krijnen 0cb8716c6a Switch to libocct for yml workflows 2021-12-09 20:47:00 +01:00
Thomas Krijnen 099013fa05 revert #1927 for mpir 2021-12-09 20:27:55 +01:00
Ttofuuu 4a8843b6bb fix mpfr checking problem
https://github.com/BrianGladman/mpir.git 's mpfr will lead to a merge problem and make IFCOS fail to build depends on Windows. Change the link to anothms will fix this problem.
2021-12-09 20:26:19 +01:00
Thomas Krijnen 33d15b42b7 bop face addition check only for subtraction 2021-12-09 20:24:21 +01:00
Gorgious56 44581c77ac Extend ifc debug panel (#1924)
* Prevent searching for invalid ID in IFC debugger
You can still input <= 0 IDs for debugging purposes
But the field won't let you drag below ID = 1
Also changed default to 1 so it doesn't throw an error by default

* Extend ops descriptions, labels and debug output

* Use Operator property for selecting dense meshes

* Prevent error if id has no geom representation

* Use Poll operator and poll fail message

* Debug op to select highest meshes by polygon percentile
2021-12-09 13:41:15 +01:00
Bernd Hahnebach e848b249a6 bimtester: if lang argument is not set use feature file lang for output messages, improves #1910 2021-12-09 12:04:47 +01:00
Bernd Hahnebach f85c3ae24c bimtester: update log and smartview, they still are deactivated by default, fixes #1892 2021-12-09 09:06:51 +01:00
Dion Moult 7c633fab31 Fix bug where libraries didn't work in IFC2X3 2021-12-09 17:51:29 +11:00
Dion Moult f716f8a357 You can now add feed relationships in a Brick model from IFC elements 2021-12-09 17:50:57 +11:00
Dion Moult d156927e13 From an IFC element, you can now add a new Brick element in a Brick model 2021-12-09 17:48:47 +11:00
Dion Moult 2ef1f4d812 Assigning a brick reference now adds a 2-way IFC reference in the Brick model 2021-12-09 17:45:08 +11:00
Dion Moult 78a36ab429 Fix #1816. Fix bug where cameras weren't allowed to be optional in BCF 2.1. 2021-12-09 13:51:55 +11:00
Dion Moult 763a38bc9c Fix bug with missing system arrows in visualising offset models and sink/source mixed flows. 2021-12-09 13:40:23 +11:00
Dion Moult a23c88a53e Minor fix for #1902. 2021-12-09 13:38:46 +11:00
Dion Moult f6bf626349 Little utility to help printing out maintainable classes and other classes in contractual documentation. 2021-12-09 13:36:33 +11:00
Bernd Hahnebach b66792f981 bimtester: get lang from json report and use it to generate html report, fixes #1928 2021-12-08 15:53:34 +01:00
Bernd Hahnebach 195af0c850 bimtester: do not break bimtester if translation files are missing, fixes #1910 2021-12-08 15:19:36 +01:00
Bernd Hahnebach ee56e06d86 bimtester: German eleclass attributes steps, fix translation redirection 2021-12-08 08:42:21 +01:00
Bernd Hahnebach 146dd1e74d bimtester: German geometrirc detail step, fix quotation marks 2021-12-08 08:23:00 +01:00
Bernd Hahnebach 6d47cf3a51 bimtester, attributes ele class steps, use generic assert methond 2021-12-07 18:01:10 +01:00
Bernd Hahnebach 9b6d53fe38 bimtester: example steps, delete more steps which are implemented already 2021-12-07 15:51:31 +01:00
Bernd Hahnebach 6902e2e2c6 bimtester: features, move geometric detail tests from examples to implemented steps 2021-12-07 15:47:15 +01:00
Bernd Hahnebach 82d136b9b3 bimtester: util, improve generic assert method 2021-12-07 14:58:18 +01:00
Bernd Hahnebach b8dd0450d1 bimtester: features, fixes in element class attributes 2021-12-07 14:47:13 +01:00
Bernd Hahnebach 85d76c084b bimstester: features, move element class attributes tests from examples to implemented steps 2021-12-07 12:59:50 +01:00
Bernd Hahnebach c658f7610e bimstester: features, move spatial structure tests from examples to implemented steps 2021-12-07 12:16:18 +01:00
Bernd Hahnebach 3fad28572b bimstester: features, move application tests from examples to implemented steps 2021-12-07 11:44:21 +01:00
Bernd Hahnebach 455fe80497 bimtester: features import module, sort by abc 2021-12-07 11:27:42 +01:00
Bernd Hahnebach 3f46d54ad9 bimtester: features, move qset test from example steps to implemented steps 2021-12-07 09:38:22 +01:00
Bernd Hahnebach 89e3276c90 bimtester: example steps, delete the ones which are implemented already 2021-12-07 08:47:31 +01:00
aothms bb9eba07c0 build-all.py python library proposal #1884 2021-12-03 10:21:55 +01:00
aothms 6d4573fb58 build-all.py option PYTHON_USER_SITE 2021-12-03 10:21:55 +01:00
aothms 24890dd001 build-all.py option NO_CLEAN 2021-12-03 10:21:55 +01:00
Dion Moult 65d599bbd9 Fix bug where Blender name wouldn't match IFC Name when reassigning class. See #1902. 2021-12-03 11:00:54 +11:00
Dion Moult ebe5460a9f Fix segfault thanks to aothms. 2021-12-02 09:28:04 +01:00
Dion Moult 01bc29c5b2 Purge by_ref_cached_ 2021-12-02 09:28:04 +01:00
Dion Moult 5ad6d455f9 get_total_inverses now efficiently gets the full number of references to an entity 2021-12-02 09:28:04 +01:00
Dion Moult cef1c86f6d Experimental get_inverse_cardinality proposal. See #1904. 2021-12-02 09:28:04 +01:00
Cyril Waechter d1caa3242f Refactor to usecase as asked in #1881 (#1907) 2021-11-30 21:24:19 +11:00
Dion Moult 4f7bfec026 Merge branch 'v0.7.0' of github.com:IfcOpenShell/IfcOpenShell into v0.7.0 2021-11-30 21:23:16 +11:00
Dion Moult df6ad70345 Fix percentage loading implementation with the new more accurate progress number. 2021-11-30 21:23:06 +11:00
Bernd Hahnebach a7a3ccb23a bimtester: gui, initialize ifc file and feature file text 2021-11-30 10:30:41 +01:00
Cyril Waechter b65f2ca062 Allow to assign IfcRelSpaceBoundary to an object (#1902) 2021-11-30 13:35:55 +11:00
Cyril Waechter f991b053d3 Allow to manually update boundary connection geometry (#1899)
* Allow to manually update boundary geometry

Following have been created in this purpose:
* usecase in ifcopenshell.api
* blenderbim operator
* button in blenderbim manually trigger it

* Assign kwargs to object instead of settings dict

* Add forgotten helper file
2021-11-30 13:29:22 +11:00
Cyril Waechter 47a25ca8b9 Prevent crash on export for obj with no material (#1903)
During export material_checksum was always checked against a stringed
list `'[]'` for an empty material while default value
for material_checksum default was `''`. So it was trying to update
material of object which have none (eg. IfcRelSpaceBoundary).
See: https://github.com/IfcOpenShell/IfcOpenShell/blob/a3f27830c579e567218f79faa52dfc941a441241/src/blenderbim/blenderbim/bim/export_ifc.py#L147
2021-11-30 13:27:08 +11:00
Bernd Hahnebach a3f27830c5 bimtester: gui, improve prints and error handling 2021-11-29 14:59:30 +01:00
Bernd Hahnebach 1a5b5dd303 bimtester: fix gui, works with feature file now instead of feature directory 2021-11-29 10:28:49 +01:00
Dion Moult f529bc37ee Fix bug where selecting type occurrences did not work 2021-11-29 20:25:51 +11:00
Dion Moult 825ffe03b0 Converting brickschema projects to IFC libraries now works on IFC2X3 2021-11-29 20:19:58 +11:00
Dion Moult 622ff05247 Fix bug where updating owner history may not work if you were using it outside Blender. 2021-11-29 20:17:02 +11:00
Dion Moult d638405ff8 Assigning library references now works on IFC2X3. 2021-11-29 20:16:25 +11:00
Dion Moult c0f547c6e4 Test expectations for new remove_deep2 proposal. See #1812. 2021-11-29 20:14:50 +11:00
Dion Moult 3accc1dbd6 Editing object placements is now 3x faster on large files. See #1807. 2021-11-29 19:58:03 +11:00
aothms 6eab9fb593 #1785 HdfSerializer read-only option 2021-11-28 19:34:54 +00:00
Felipe Mesquita 2708133493 Added information for debugging level parameter 2021-11-27 08:53:17 +01:00
Thomas Krijnen c5e6c3e2c7 #1897 handle nesting in get_decomposing_entity_impl() 2021-11-26 14:15:51 +01:00
Thomas Krijnen d7b27c0620 ifcopenshell.ifcopenshell_wrapper.turn_on_detailed_logging() 2021-11-25 15:23:14 +01:00
Thomas Krijnen 75ffc4454d #1895 don't signal element ready when result is empty 2021-11-25 12:05:39 +01:00
Dion Moult a1817e8a61 Fix #1889. Allow explicitly overriding data types when editing psets. 2021-11-24 16:38:19 +11:00
Bernd Hahnebach b4b334145f BIMTester: steps, improve imports in the regard of rebases 2021-11-23 15:18:01 +01:00
Bernd Hahnebach 04535d27ec Bimtester, improve German attribute feature translation, get rid of umlaut since it makes problems in some circumstances 2021-11-21 21:19:10 +01:00
Thomas Krijnen 3c41f6b0f8 #1153 draw.py timing 2021-11-20 14:05:53 +01:00
Thomas Krijnen a17c44c076 #1153 update draw.py with two new options 2021-11-20 14:05:11 +01:00
Thomas Krijnen eccf72ee8a #1153 option to preprocess shape into sets of profile edges 2021-11-20 14:02:12 +01:00
Thomas Krijnen 9c9bec9c4e Some more things related to #1853 2021-11-19 15:08:24 +01:00
Thomas Krijnen 71c1cd6a9e Check for null result and handle some bop alerts 2021-11-19 10:39:14 +01:00
Thomas Krijnen 0504556e7a #1885 consider schema type when copying attribute values 2021-11-19 09:38:28 +01:00
Thomas Krijnen e9a18d030e Small cleanup and try to please gcc 2021-11-19 09:22:09 +01:00
Thomas Krijnen 6d725f60fa finish up 2021-11-19 09:22:09 +01:00
Thomas Krijnen 72206bc441 async init, crashes now on get() 2021-11-19 09:22:09 +01:00
Dion Moult c0eb9addfd Fix bug in FM utility for grabbing classes from the draft FMHEM standard 2021-11-19 19:13:21 +11:00
Dion Moult ff3a98234d Fix bug in convert length unit recipe where IFC2X3 ownership history fails. 2021-11-19 19:12:55 +11:00
Dion Moult ebf6b9fc88 Fix #1886. 2021-11-19 19:08:34 +11:00
Cyril Waechter c2e4b5f1fa [BlenderBIM] Boundaries: add relations editing (#1881)
* SelectGlobalId: set object as active

Use tool module instead of previous custom search loop.

* Boundaries: add relations editing

For entity of class IfcRelSpaceBoundary :
* Display relationship attributes
* Add button to jump to related objects
* Allow to edit relations attributes including entity filter.
UI similar to current base attributes editing.
2021-11-19 10:06:22 +11:00
Bernd Hahnebach 9728c4d345 bimtester: features psets, use quots the same way as in all other features 2021-11-18 18:16:37 +01:00
Gorgious f0d6500539 Merge branch 'v0.7.0' of https://github.com/IfcOpenShell/IfcOpenShell into v0.7.0 2021-11-18 10:38:27 +01:00
Gorgious 124ccf0404 (slightly) Optimise batch removing objects 2021-11-18 10:38:17 +01:00
Bernd Hahnebach df03f7ad29 bimtester: steps, fix undefined name 2021-11-18 10:20:50 +01:00
Bernd Hahnebach ff8fc898a1 bimtester: examples, trailing ws 2021-11-18 09:53:53 +01:00
Bernd Hahnebach 2d62d8181a bimtester: improve French translation for the provided example 2021-11-17 16:08:42 +01:00
Bernd Hahnebach 6853735bb2 bimtester: fix example feature files to work with this bimtester 2021-11-17 10:36:37 +01:00
Bernd Hahnebach 1c3980b6f0 bimtester: fix italian and dutch project setup step files 2021-11-17 10:36:37 +01:00
Dion Moult 5c224150ec More slow progress in getting annotations round-tripping. See #1153. 2021-11-17 18:25:01 +11:00
Dion Moult 18719c16df Fix bug where subelement coordinates were incorrectly calculated in non SI units 2021-11-17 16:22:23 +11:00
Dion Moult ddb8abff0f Minor fix 2021-11-17 15:32:26 +11:00
Dion Moult f9221717ff You can now associate IFC elements with Brick elements and navigate to them 2021-11-17 13:27:07 +11:00
Dion Moult da6945b352 You can now assign and unassign library references 2021-11-17 11:43:53 +11:00
Dion Moult 62cdf76a5a Fix bug where you couldn't copy quantities to other elements 2021-11-17 10:35:46 +11:00
Dion Moult fae607f8ce New UI to add / edit / remove library information and references. 2021-11-16 22:15:54 +11:00
Dion Moult 468192e849 Fix bug where unlinking a style that was invalidly linked didn't work. 2021-11-16 22:08:55 +11:00
Dion Moult edd01637e2 Minor fix 2021-11-16 21:51:23 +11:00
Bruno Postle 604fbc4bc9 Raise default section height from storey from 1.0 to 1.2 2021-11-16 09:12:42 +01:00
Dion Moult 4617d9f234 A whole bunch of new usecases for managing IFC library information and references 2021-11-16 18:30:23 +11:00
Dion Moult 41486ba08a New utility to get layers of an element. See #1869. 2021-11-16 18:07:47 +11:00
Dion Moult 2120653104 Minor fix. 2021-11-16 17:52:08 +11:00
Dion Moult 43869c33f6 Rebuild text annotations to have leaders in the same object and use text literals. See #1153. 2021-11-16 08:54:29 +11:00
Dion Moult fcfdc179df Viewport annotation decorations now scale based on paper size. See #1153. 2021-11-16 08:48:50 +11:00
Dion Moult 30c164d223 Fix minor error in console when changing drawings. See #1153. 2021-11-16 08:45:52 +11:00
Dion Moult b28d8b0cca Drawing annotations now are stored in IFC using ObjectType conventions. See #1153. 2021-11-16 08:35:49 +11:00
Dion Moult 4b5907f5dd Reimplement roundtrip of most annotation elements for drawings. See #1153. 2021-11-16 08:32:43 +11:00
Dion Moult 78a27ef44c New experimental OBJ2IFC script 2021-11-14 18:30:56 +11:00
Thomas Krijnen 528e27234c tree.protrusion_distances() 2021-11-13 15:54:42 +01:00
Dion Moult 8ac885ced1 Fix bug where annotative grids did not sync. 2021-11-12 15:16:10 +11:00
Dion Moult 63872abaef Purge old 2D element drawing system, so we don't get double the symbols on drawings. 2021-11-12 14:01:13 +11:00
Dion Moult 5ba155eb17 Fix #1857. Fix bug where deleting from the outliner was not tracked. 2021-11-11 22:27:40 +11:00
Dion Moult 2ec3c4c06b Swapping a Blender material for another is now auto synchronised. 2021-11-11 18:21:02 +11:00
Dion Moult 6f55cd5169 Optimise object placement change checking, so medium sized project exports are 5 seconds faster at minimum, but can be much higher since false positives are culled. 2021-11-11 17:31:23 +11:00
Dion Moult f5f88f4b97 Fix #1872. Bug where duplicating an object didn't duplicate its styles. 2021-11-11 17:31:23 +11:00
Dion Moult d5b92c0fea Fix bug where style colours were not auto synchronised. 2021-11-11 17:31:23 +11:00
Laurens Oostwegel 9355969110 Load CJIO on execution instead of initialisation 2021-11-10 20:08:18 +01:00
Dion Moult 6c998e0b8a Fix #1871. 2021-11-10 22:23:52 +11:00
Dion Moult 51f8d648ad Minor fix 2021-11-10 21:01:17 +11:00
Vukas Pajic a26539d6a5 show property description in pset_template ui 2021-11-10 10:18:55 +01:00
Dion Moult a9f27fcf17 Fix bug #1854. Materials are now auto replaced in Blender when you assign a new IFC material. 2021-11-10 18:04:54 +11:00
Dion Moult 28e5af853d Fix bug where an added default material was not linked and auto synced. 2021-11-10 18:01:10 +11:00
Dion Moult a7b3b5261f Fix bug in IFC2X3 where updating style colours didn't work. 2021-11-10 16:45:16 +11:00
Dion Moult 0dac56dbdf Fix bug where diffuse colour was not correctly extracted from nodes 2021-11-10 16:39:06 +11:00
Dion Moult 0992f43f11 Geometry caching is now enabled for model importing 2021-11-10 13:52:14 +11:00
Dion Moult c1c50f8868 Minor fix. 2021-11-10 12:46:07 +11:00
Dion Moult d733960068 Fix #1856. Bug where you lost your existing container or aggregation when you added a new aggregation assembly. 2021-11-09 20:50:31 +11:00
Dion Moult 66fa3f0096 Changes are now synchronised prior to switching representations. 2021-11-09 20:49:25 +11:00
Dion Moult cbf7b0a77a Minor clean up for CityJSON PR. 2021-11-09 20:46:46 +11:00
Dion Moult 91f2f9438f Fix #1764. Bug where OpenLCA UI would freeze if it couldn't connect to OpenLCA. 2021-11-09 20:43:30 +11:00
Dion Moult fcbb6e60ac Another Makefile fix :( 2021-11-09 10:05:06 +11:00
Dion Moult f33d613f9d Minor Makefile fix 2021-11-09 09:45:36 +11:00
Cyril Waechter 849dfbed28 [BlenderBIM] Tools to load IfcRelSpaceBoundary (#1864)
* Tools to load IfcRelSpaceBoundary

At scene level to load all.
At space level to load ones from a specific space or a specific one.

* Add a tool to colour boundaries

Colour is based on its related building element.
2021-11-09 09:28:44 +11:00
Dion Moult 8a4bc34fad Scale changes are now auto synchronised on export. 2021-11-09 09:22:03 +11:00
Laurens Oostwegel aa18c1b7d6 Small fix in Makefile error due to ifccityjson 2021-11-08 23:03:31 +01:00
Laurens Oostwegel ae45a9b9a5 Fix error in Makefile 2021-11-08 22:59:09 +01:00
ecke101 7aa75d98d3 Improve support for Powerproject import (#1865)
This is tested with swedish PowerProject 14.0 file
2021-11-09 08:52:24 +11:00
Laurens Oostwegel ff6db5f24d Integrate ifccityjson in BlenderBIM (#1859)
* ifccityjson-BB integration: include CJIO in makefile

* Add ifccityjson to BlenderBIM

* Make ifccityjson work like a package

* Use pip while installing CJIO dependency for ifccityjson

* revert removal of brick module

* Changes from pull request review

* Use ifccityjson as CLI and as package for BlenderBIM
2021-11-09 08:51:30 +11:00
Dion Moult de7c54b771 Fix #1855. Bug where authoring type dropdowns didn't refresh. 2021-11-08 21:12:38 +11:00
Dion Moult 7fbf317ad2 Fix representation where removing a representation left objects with an empty mesh. Now a proper empty is used. 2021-11-08 21:12:38 +11:00
Dion Moult 0471f17d9a Fix bug where removing a representation from a typed instance didn't remove all data users. 2021-11-08 21:12:38 +11:00
Dion Moult bf134eb0f4 Implement cache updating for drawings. See #1153. 2021-11-08 21:12:38 +11:00
Dion Moult 7ccb6ee110 Resolve #1836. Scaling in Blender is now auto resolved when representations are updated. 2021-11-08 21:12:38 +11:00
Dion Moult 9076043a5c Purge old dumb door and dumb window tool to prevent confusing users 2021-11-08 21:12:38 +11:00
Dion Moult 1c0fcf7b40 Add annotation symbols for doors, windows, and bunny to the demo library 2021-11-08 21:12:38 +11:00
Dion Moult 4fdcb87a28 New IfcOpenShell utility to get instances of an element type easily 2021-11-08 21:12:38 +11:00
Dion Moult 246460dec4 Fix bug where non-geometric objects caused the representations UI to not display 2021-11-08 21:12:38 +11:00
Thomas Krijnen a89a40e637 #1785 omplete stored_settings / requested_settings check 2021-11-08 10:59:49 +01:00
Thomas Krijnen c1fcf2528e swig uint64_t 2021-11-08 10:58:55 +01:00
Thomas Krijnen d4f0495caa Consistent setting type 2021-11-08 09:59:15 +01:00
Dion Moult 669295d4ac Resolve #1860. Brickschema is now optional. 2021-11-08 11:17:11 +11:00
Dion Moult e4a27d49c9 Drawing module now is in sync with latest C++ upgrades. See #1153. 2021-11-08 08:36:13 +11:00
Thomas Krijnen e0e8281a1e Allow tree.select(BRepElement) 2021-11-07 19:49:37 +01:00
Thomas Krijnen 1cdf695891 #1785 check settings in cache and upgrade to world coords 2021-11-07 19:23:48 +01:00
Thomas Krijnen 580678c2c1 Fix casts in XML serializer 2021-11-07 11:16:47 +01:00
Laurens Oostwegel a038ae434b ifccityjson: it is now easier to extract one LOD 2021-11-07 11:04:27 +01:00
Laurens Oostwegel 698ef40ada ifccityjson: prevent interior holes in faces as there is a bug in the geometry generation 2021-11-07 10:55:47 +01:00
Laurens Oostwegel 276077964d ifccityjson: refactor GeometryIO class 2021-11-07 10:51:09 +01:00
Laurens Oostwegel 45080a8a1f ifccityjson: temporary fix until CJIO can build its LOD dictionary again 2021-11-07 10:50:12 +01:00
Laurens Oostwegel dd348de0b7 ifccityjson: lazy build vertex dictionary 2021-11-07 10:40:01 +01:00
Dion Moult 61e510e45c New feature to select all objects in same container 2021-11-07 17:02:05 +11:00
Dion Moult 05068754b9 New feature to select the container of an object 2021-11-07 15:32:33 +11:00
Dion Moult de561b78e0 Resolve #1750. You can now save IFCs under a relative path to your Blend file. 2021-11-07 13:20:33 +11:00
Thomas Krijnen e6e1978584 only call expensive wstring_convert() when necessary 2021-11-06 14:36:58 +01:00
Thomas Krijnen 0b7bdc0f9d #1785 geometry caching caching 2021-11-06 13:16:13 +01:00
Dion Moult e868186897 Resolve #1749. You can now save as another IFC filename. 2021-11-06 21:41:31 +11:00
Dion Moult 5450233f8e Minor fix 2021-11-06 21:10:56 +11:00
Dion Moult 8e215382f7 Fix bug where assigning a type did not use existing representation data in the scene if the context had changed 2021-11-06 20:56:53 +11:00
Dion Moult 4149292a13 Fix bug where adding a representation to a type instance didn't share meshes 2021-11-06 18:51:00 +11:00
Dion Moult 117f663f48 Fix bug where you couldn't add a plan representation to something with no context identifier 2021-11-06 17:48:31 +11:00
Dion Moult 960610325f Fix interface bug where representations assigned directly to a context aren't shown 2021-11-06 17:36:47 +11:00
Thomas Krijnen ab50609854 Rename some files with more sensical names 2021-11-05 16:54:16 +01:00
Thomas Krijnen c203b78d34 #1153 #1852 project points to form SVG HLR cut plane 2021-11-05 13:27:27 +01:00
Thomas Krijnen 5633445008 #1153 evenodd 2021-11-05 11:21:19 +01:00
Thomas Krijnen 22ceb35f47 IfcConvert : SEW_SHELLS on svg serializer 2021-11-05 11:07:27 +01:00
Thomas Krijnen 06a988e141 #1153 boolean subtraction on parts 2021-11-05 11:04:46 +01:00
Thomas Krijnen 2dc29978f6 --cache and subtraction in draw.py 2021-11-05 11:03:44 +01:00
Thomas Krijnen 10b502512f #1853 don't blindly explode compounds but check whether there are solids inside 2021-11-05 10:09:12 +01:00
Thomas Krijnen 2d0c44e25a #1785 Set trsf form 2021-11-05 09:22:24 +01:00
Dion Moult 3e52d93db0 Fix bug where existing meshes were not deleted when switching representations. 2021-11-05 17:57:05 +11:00
Dion Moult 07bee4acfa Fix bug where adding a representation to type instances didn't ensure it was added to a geometric type 2021-11-05 15:14:10 +11:00
Dion Moult 0da5d807b8 Minor fix 2021-11-05 13:15:28 +11:00
Dion Moult 657aafbd2e Minor fix 2021-11-05 12:20:33 +11:00
Dion Moult 04449d08e8 Add schema caching to Brick schema loading. 2021-11-05 09:19:42 +11:00
Dion Moult 2b710ffbde Fix bug where pie update container didn't work. 2021-11-04 22:23:26 +11:00
Dion Moult 7fbe365599 Implement new Brickschema project browser. 2021-11-04 18:02:50 +11:00
Dion Moult f49b9f6781 Slightly more robust deletion tracking. 2021-11-03 21:39:17 +11:00
Dion Moult 901318b73b Fix bug where copying an instance did not auto link the meshes. 2021-11-03 19:04:22 +11:00
Laurens Oostwegel 8545d870c0 ifccityjson: Fix bug dependency updated CJIO
In the new CJIO module, cityjson vertices got transformed automatically when calling the object faces. Now this is not the case anymore.
2021-11-03 08:45:36 +01:00
Thomas Krijnen 3124d306d6 #1153 another small hack to get boolean projection working more generally 2021-11-02 15:52:51 +01:00
Thomas Krijnen 8e529f3f10 #1850 Process extrusions of comp profiles seperately 2021-11-02 15:11:56 +01:00
Thomas Krijnen 1ff45165d9 #1743 don't consider bbox in opening subtractions 2021-11-02 15:09:26 +01:00
Thomas Krijnen 05256fc0f4 #1785 geometry caching on multi threaded iterator 2021-11-02 11:39:49 +01:00
Thomas Krijnen be9ef33932 #1153 svg subtraction settings 2021-11-02 08:57:00 +01:00
Thomas Krijnen fc424ebd6b #1785 quick identity check to keep trsf form at identity 2021-11-01 21:47:56 +01:00
Laurens Oostwegel 030f3cf307 Add tutorial to ifccityjson 2021-11-01 18:18:46 +01:00
HassanEmam c8eb933453 Added support for Powerproject (#1849)
* implemented initial cli and support for resource parsing for ms project

* Added command line interface and resource support for MS Project XML files

* Removed the test code

* Check for output exists before writting the file to avoid failure

* Added support for Asta Powerproject files
2021-11-01 10:52:43 +11:00
Dion Moult 208132785f Minor fix 2021-10-31 10:08:41 +01:00
Dion Moult cfa435e9c8 Do the same things in 10 times less code thanks to aothms :) 2021-10-31 10:08:41 +01:00
Dion Moult 515e972906 Fix projection of origin onto camera plane. 2021-10-31 10:08:41 +01:00
Thomas Krijnen 100b0637ac submodule 2021-10-30 16:16:03 +02:00
HassanEmam 2d8ec8a6bf Command Line Interface and MS Project Resource Parsing (#1845)
* implemented initial cli and support for resource parsing for ms project

* Added command line interface and resource support for MS Project XML files

* Removed the test code

* Check for output exists before writting the file to avoid failure
2021-10-30 22:29:10 +11:00
Dion Moult 02461233a6 Reimplement drawing material classes, fix cut projection order, and auto refresh camera representation 2021-10-30 22:13:50 +11:00
Dion Moult dcac1e69ca We now support importing 3D annotations, not just 2D ones. Neat. 2021-10-30 22:13:50 +11:00
Dion Moult b118400cc6 Invalid annotation contexts coming from Revit are now accepted 2021-10-30 22:13:50 +11:00
Roch Bertucat bc430b80f6 Fix Python validate to handle Logical (see #1787) 2021-10-30 13:12:45 +02:00
Dion Moult d2d3addf10 New feature to draw system arrows showing flow direction and port connections. 2021-10-30 18:12:58 +11:00
Dion Moult 683e316088 New MEP utility to select and print debug information about connected system elements 2021-10-30 18:00:36 +11:00
HassanEmam e279fee518 Resource Parsing for P6XML (#1842)
* P6XML Parser failing on calendar type

* add work plan references a get_person which is not an attribute. modified to get_user to work

* Initial support for Primavera XER files

* IFC4D impl XER calendars exceptions and work time

* merged updats

* refactoring code for the 4D model to avoid duplicate code

* Assign process in the api module was missing an atrribute QuantityIn Process

* Merged changes from master

* refactoring

* resolved conflicts

* refactoring code for IFC4D

* refactoring code for IFC4D

* refactoring code for IFC4D

* Reverted the changes to IfcRelAssignsToProcess usecase

* Changed the class to be more discriptive from Utils to ScheduleIfcGenerator

* reverted changes to add_work_plan and Makefile

* Added resource parsing support for Primavera XER

* added relative path for importing common as it was failing in BlenderBIM

* Initial support for Primavera XER files

* merged updats

* Assign process in the api module was missing an atrribute QuantityIn Process

* Merged changes from master

* refactoring

* resolved conflicts

* refactoring code for IFC4D

* refactoring code for IFC4D

* Reverted the changes to IfcRelAssignsToProcess usecase

* Changed the class to be more discriptive from Utils to ScheduleIfcGenerator

* reverted changes to add_work_plan and Makefile

* Added resource parsing support for Primavera XER

* added relative path for importing common as it was failing in BlenderBIM

* deleted repetitive classes for P6XER import

* Resource Parsing added Primavera P6 XML module

* Initial support for Primavera XER files

* IFC4D impl XER calendars exceptions and work time

* merged updats

* refactoring code for the 4D model to avoid duplicate code

* Assign process in the api module was missing an atrribute QuantityIn Process

* Merged changes from master

* refactoring

* resolved conflicts

* refactoring code for IFC4D

* refactoring code for IFC4D

* refactoring code for IFC4D

* Reverted the changes to IfcRelAssignsToProcess usecase

* Changed the class to be more discriptive from Utils to ScheduleIfcGenerator

* reverted changes to add_work_plan and Makefile

* Added resource parsing support for Primavera XER

* added relative path for importing common as it was failing in BlenderBIM

* Initial support for Primavera XER files

* merged updats

* Assign process in the api module was missing an atrribute QuantityIn Process

* Merged changes from master

* refactoring

* resolved conflicts

* refactoring code for IFC4D

* refactoring code for IFC4D

* Reverted the changes to IfcRelAssignsToProcess usecase

* Changed the class to be more discriptive from Utils to ScheduleIfcGenerator

* reverted changes to add_work_plan and Makefile

* Added resource parsing support for Primavera XER

* deleted repetitive classes for P6XER import

* Resource Parsing added Primavera P6 XML module

* P6XML Parser failing on calendar type

* add work plan references a get_person which is not an attribute. modified to get_user to work

* Initial support for Primavera XER files

* IFC4D impl XER calendars exceptions and work time

* refactoring code for the 4D model to avoid duplicate code

* Assign process in the api module was missing an atrribute QuantityIn Process

* Merged changes from master

* refactoring

* resolved conflicts

* refactoring code for IFC4D

* refactoring code for IFC4D

* refactoring code for IFC4D

* Reverted the changes to IfcRelAssignsToProcess usecase

* Changed the class to be more discriptive from Utils to ScheduleIfcGenerator

* reverted changes to add_work_plan and Makefile

* Added resource parsing support for Primavera XER

* added relative path for importing common as it was failing in BlenderBIM

* Initial support for Primavera XER files

* merged updats

* Assign process in the api module was missing an atrribute QuantityIn Process

* Merged changes from master

* refactoring

* resolved conflicts

* refactoring code for IFC4D

* refactoring code for IFC4D

* Reverted the changes to IfcRelAssignsToProcess usecase

* Changed the class to be more discriptive from Utils to ScheduleIfcGenerator

* reverted changes to add_work_plan and Makefile

* Added resource parsing support for Primavera XER

* deleted repetitive classes for P6XER import

* Resource Parsing added Primavera P6 XML module

* Initial support for Primavera XER files

* IFC4D impl XER calendars exceptions and work time

* merged updats

* refactoring code for the 4D model to avoid duplicate code

* Assign process in the api module was missing an atrribute QuantityIn Process

* Merged changes from master

* refactoring

* resolved conflicts

* refactoring code for IFC4D

* refactoring code for IFC4D

* refactoring code for IFC4D

* Reverted the changes to IfcRelAssignsToProcess usecase

* Changed the class to be more discriptive from Utils to ScheduleIfcGenerator

* reverted changes to add_work_plan and Makefile

* Added resource parsing support for Primavera XER

* added relative path for importing common as it was failing in BlenderBIM

* Initial support for Primavera XER files

* merged updats

* Assign process in the api module was missing an atrribute QuantityIn Process

* Merged changes from master

* refactoring

* resolved conflicts

* refactoring code for IFC4D

* refactoring code for IFC4D

* Reverted the changes to IfcRelAssignsToProcess usecase

* Changed the class to be more discriptive from Utils to ScheduleIfcGenerator

* reverted changes to add_work_plan and Makefile

* Added resource parsing support for Primavera XER

* deleted repetitive classes for P6XER import

* Resource Parsing added Primavera P6 XML module

* removed the testing code

Co-authored-by: Dion Moult <dion@thinkmoult.com>
2021-10-30 10:31:18 +11:00
Thomas Krijnen 93c5906ad7 #1153 temporary y offset fix 2021-10-29 14:16:10 +02:00
HassanEmam 6a06607f3f BlenderBIM: Import Resources for XER files (#1841)
* P6XML Parser failing on calendar type

* add work plan references a get_person which is not an attribute. modified to get_user to work

* Initial support for Primavera XER files

* IFC4D impl XER calendars exceptions and work time

* merged updats

* refactoring code for the 4D model to avoid duplicate code

* Assign process in the api module was missing an atrribute QuantityIn Process

* Merged changes from master

* refactoring

* resolved conflicts

* refactoring code for IFC4D

* refactoring code for IFC4D

* refactoring code for IFC4D

* Reverted the changes to IfcRelAssignsToProcess usecase

* Changed the class to be more discriptive from Utils to ScheduleIfcGenerator

* reverted changes to add_work_plan and Makefile

* Added resource parsing support for Primavera XER

* added relative path for importing common as it was failing in BlenderBIM

* Initial support for Primavera XER files

* merged updats

* Assign process in the api module was missing an atrribute QuantityIn Process

* Merged changes from master

* refactoring

* resolved conflicts

* refactoring code for IFC4D

* refactoring code for IFC4D

* Reverted the changes to IfcRelAssignsToProcess usecase

* Changed the class to be more discriptive from Utils to ScheduleIfcGenerator

* reverted changes to add_work_plan and Makefile

* Added resource parsing support for Primavera XER

* added relative path for importing common as it was failing in BlenderBIM

* deleted repetitive classes for P6XER import

Co-authored-by: Dion Moult <dion@thinkmoult.com>
2021-10-29 21:16:47 +11:00
Thomas Krijnen 9f73bd43b4 Don't wrap HdfSerializer 2021-10-29 10:47:40 +02:00
Thomas Krijnen 5f7d92aeb0 #1153 HdfSerializer.remove() for cache eviction 2021-10-29 10:41:21 +02:00
Thomas Krijnen c754d15da8 don't create empty HdfSerializer symbol 2021-10-29 10:40:42 +02:00
Thomas Krijnen 13f5d2d5de add hdf serializer to wrapper 2021-10-29 10:40:15 +02:00
Thomas Krijnen 280eac6127 parse_ifcxml now handled by swig config 2021-10-29 10:40:03 +02:00
Thomas Krijnen ea0e70ef0d populate more serializers if available 2021-10-29 10:39:32 +02:00
Thomas Krijnen a5af8807ee pass config to swig preproc 2021-10-29 10:39:02 +02:00
Chun 0bae861b6a IfcType Filter suggestions for better User Experience (#1840)
* 1.Added Selecting/Deselecting All function
2.Suggested an idea for UI improvment
3.Fixed an UX bug

* Improve the user experience of IfcType Filter
2021-10-29 19:29:43 +11:00
Dion Moult b32bbb89a1 Optimistically track all object edits whenever you toggle edit mode, not just meshes. 2021-10-29 18:04:47 +11:00
Dion Moult 109149a0be Optimise owner check depending on your implementation and no longer create default users on IFC4. Can result in 50% faster script running on long scripted operations. 2021-10-29 18:04:17 +11:00
Dion Moult 4bf4622498 You can now manually type in start/end dates for construction sequence visualisation instead of clicking the date picker hundreds of times. 2021-10-29 17:44:57 +11:00
Dion Moult a4c054ef62 Objects now sync spatial hierarchy more robustly on export, and clean the collection tree in case the user messed it up. 2021-10-29 17:43:38 +11:00
Dion Moult 1141fd5784 Fix bug where during import sometimes aggregation collections don't match object names 2021-10-29 17:39:59 +11:00
luzpaz 0aa8a19b6d Fix various typos (#1837)
Found via `codespell`
2021-10-29 08:56:02 +11:00
Vukas Pajic b46f1647d2 BlenderBIM: Add UI Preset to Preferences (#1825)
* inital commit

* update based on comments

* incorporate suggestion from @Gorgious56

* change curly brackets to square brackets ;)

* update based on comments from @Moult

* code suggestion from @Gorgious56
2021-10-28 23:41:56 +11:00
Dion Moult 72d9bc9256 Moving grid axes are now synchronised automatically 2021-10-28 19:35:40 +11:00
Dion Moult b67d56ada1 Fix bug where imported grids were not linked and didn't auto track edits 2021-10-28 19:35:40 +11:00
Dion Moult d013d6ed09 Resize object to storey now works for a variable number of storeys 2021-10-28 19:35:40 +11:00
HassanEmam 4bb549f3e9 IFC4D code refactoring (#1834)
* P6XML Parser failing on calendar type

* add work plan references a get_person which is not an attribute. modified to get_user to work

* Initial support for Primavera XER files

* IFC4D impl XER calendars exceptions and work time

* merged updats

* refactoring code for the 4D model to avoid duplicate code

* Assign process in the api module was missing an atrribute QuantityIn Process

* Merged changes from master

* refactoring

* resolved conflicts

* refactoring code for IFC4D

* refactoring code for IFC4D

* refactoring code for IFC4D

* Reverted the changes to IfcRelAssignsToProcess usecase

* Changed the class to be more discriptive from Utils to ScheduleIfcGenerator

* reverted changes to add_work_plan and Makefile

Co-authored-by: Dion Moult <dion@thinkmoult.com>
2021-10-28 18:49:02 +11:00
Dion Moult d772299871 Fix bug where auto geolocation offset didn't occur if placements were relative 2021-10-28 11:55:11 +11:00
Dion Moult 081ca81a7e Adding annotation now auto enables viewport decoration drawing. See #1153. 2021-10-27 22:11:05 +11:00
Dion Moult 2ad2a102cb First pass at connecting to new ifcopenshell.draw. See #1153. 2021-10-27 19:42:36 +11:00
Dion Moult 52e8ac386e New hacktastic IFC patch to fix ArchiCAD spaces being loaded into Revit. 2021-10-27 12:29:40 +11:00
Dion Moult f69de3324a You can now split objects using a drawn edge, especially useful when creating slab pour breaks and fixing lazily modeled walls and columns. Thanks Gorgious56! 2021-10-27 12:06:12 +11:00
HassanEmam 04b3b9b60e Ifc4D xer calendars (#1832)
* P6XML Parser failing on calendar type

* add work plan references a get_person which is not an attribute. modified to get_user to work

* Initial support for Primavera XER files

* IFC4D impl XER calendars exceptions and work time

Co-authored-by: Dion Moult <dion@thinkmoult.com>
2021-10-27 10:13:50 +11:00
Dion Moult f64e1dbd7f New feature to calculate side formwork, such as for columns. 2021-10-27 10:09:07 +11:00
Dion Moult 341451f59b Formwork area calculation now unions objects before remeshing to account for overlapping geometry 2021-10-27 09:58:29 +11:00
Dion Moult 80b8da629d Types in type dropdowns are now sorted alphabetically for convenience. 2021-10-27 09:35:31 +11:00
Dion Moult 78e5016619 Minor fix. 2021-10-26 21:05:48 +11:00
Dion Moult 3406c23f98 Fix bug where copying a type also copied its type relations which is invalid. 2021-10-26 20:51:27 +11:00
Dion Moult ee308d294f Spatial elements in the import filter will now be sorted by elevation for convenience. 2021-10-26 17:37:17 +11:00
Dion Moult 955a9af461 Users copying and pasting via ctrl-c/v will now also copy IFC objects. 2021-10-26 17:36:58 +11:00
Dion Moult 34e8d9563d Using duplicate move linked in a BIM project now also triggers IFC copying 2021-10-26 17:17:20 +11:00
Dion Moult e5b5403eaa Minor code review for #1804. 2021-10-26 09:29:15 +11:00
Laurens Oostwegel 47cf2ea29e BlenderBIM: import IFC PointCloud Representation (#1804)
* Implemented export of point cloud representation

* Do representation geometry data no-edge check before no-polygon check

* Initial implementation import of point clouds in BlenderBIM

* create point cloud elements on the appropriate place

* Updated import_ifc.py based on review PR

* delete is_pointcloud() because it is replaced by get_pointcloud_representation()
2021-10-26 09:04:49 +11:00
HassanEmam 9d8074f1fe Initial support for importing Primavera XER files (#1829)
* P6XML Parser failing on calendar type

* add work plan references a get_person which is not an attribute. modified to get_user to work

* Initial support for Primavera XER files

Co-authored-by: Dion Moult <dion@thinkmoult.com>
2021-10-26 08:51:17 +11:00
HassanEmam 3fd944a956 Fixing bugs for Scheduling Module IFC4D (#1826)
* P6XML Parser failing on calendar type

* add work plan references a get_person which is not an attribute. modified to get_user to work

Co-authored-by: Dion Moult <dion@thinkmoult.com>
2021-10-25 20:56:45 +11:00
Thomas Krijnen 566512f7bc #1807 argument_types() on schema entity 2021-10-25 11:52:05 +02:00
Dion Moult 1a84967b1b Code review for Ifc Type filter feature. See #1823. 2021-10-25 20:12:36 +11:00
Chun 41afb26d31 Added IfcTypeFilter into BlenderBIM Search module (#1823) 2021-10-25 19:33:57 +11:00
Dion Moult 818e8010a4 Minor fix. 2021-10-25 19:32:37 +11:00
Dion Moult 58ee049a8f New feature to show inherited element type psets. 2021-10-25 16:21:40 +11:00
Dion Moult 54fa45850a Get psets utility now supports getting material and profile psets 2021-10-25 16:09:04 +11:00
Dion Moult fbadcc017b Get psets utility can now filter only psets or qtos 2021-10-25 15:36:55 +11:00
Dion Moult 6337698494 Element get_psets utility now returns the pset ID for convenience. 2021-10-25 14:21:41 +11:00
Dion Moult 2e6a70b338 New feature to copy properties from one object to all selected objects 2021-10-25 14:21:41 +11:00
Thomas Krijnen e70f675f20 Make build-all a bit friendlier for python partial install success 2021-10-24 14:56:50 +02:00
Thomas Krijnen 13d0b27ef4 Hacky way to return distances in the tree with extend>0 2021-10-24 14:40:18 +02:00
Thomas Krijnen 40b112cd48 Add back platform.machine to build-all path 2021-10-24 12:10:15 +02:00
Thomas Krijnen 14c0400f73 Fix case after #1781 2021-10-24 10:08:06 +02:00
Thomas Krijnen 4733c82b82 Separate out consume_iterator() 2021-10-23 21:34:25 +02:00
Dion Moult 7bccf10fec Fix regression bug where you couldn't add a grid. 2021-10-23 21:19:10 +11:00
Dion Moult 918915aeae Reintroduced feature to copy attributes to selected objects. 2021-10-23 19:55:22 +11:00
Dion Moult 295568453c Minor code review for module visibility feature. See #1798. 2021-10-23 19:01:43 +11:00
Vukas Pajic 56ff0e7472 BlenderBIM: added dropdown in addon preferences to toggle module visibility (#1798)
* added dropdown in addon preferences to toggle module visibility

* Update ui.py

* updated ui to allow individual toggling of modules

* working

* code cleanup and update

* fix issue where non relevant operators shown

* update based on review comments

* add contingency for intermodule panel dependancy

* removed 'magic' operators :)

* clean up some leftover lines

* updated to only register/deregister panel classes
2021-10-23 18:16:11 +11:00
Dion Moult e779a57a09 Fix bug where imported types with representations but no instances were not fully linked. 2021-10-23 18:15:23 +11:00
Dion Moult 6d817703aa Copying parametric geometry from any source now attempts to preserve parametric geometry when possible. 2021-10-22 18:07:34 +11:00
Dion Moult c551275db2 Fix bug where switching to an object with modifiers applied would double the effect of modifiers. 2021-10-22 16:23:36 +11:00
Dion Moult 9ffe92eae5 Assigning a parametric layer type (for walls for now) now attempts to switch from non parametric to parametric geometry. 2021-10-22 15:43:04 +11:00
Dion Moult f19e334cd5 Fix bug where large resizing of walls could result in broken geometry. 2021-10-22 15:21:26 +11:00
Dion Moult a5b8728aec Fix bug where copying elements didn't ensure that material usages were unique 2021-10-22 12:09:57 +11:00
Dion Moult a8c99cebaf Fix terrible bug #1819 where duplicating mapped elements didn't actually copy the geometry mapping. 2021-10-22 11:16:03 +11:00
Dion Moult 9ae2c6352a Minor fix 2021-10-21 23:06:39 +11:00
Dion Moult 0bc849be5a New feature to conveniently add a default material in a blank project when none exists. 2021-10-21 19:40:10 +11:00
Dion Moult a99df36351 The type of mapped representations is now shown in the interface, with an asterisk denoting it is mapped. 2021-10-21 19:16:15 +11:00
Dion Moult 525e6debd5 When updating representations, the existing representation type is prioritised unless you tell it otherwise. See #1748. 2021-10-21 18:39:55 +11:00
Gorgious d6cb94c6f1 Port root, bimtester and sequence to feature tests 2021-10-21 09:33:45 +02:00
Dion Moult c437ba8f9d Assigning a parametric profile type now auto switches from non parametric geometry to parametric geometry 2021-10-21 16:28:55 +11:00
Dion Moult aee7fbcc79 Only show type selection buttons when a type is available. 2021-10-21 14:10:24 +11:00
Dion Moult 456adf453d New feature to calculate the radius of a polygonal circle 2021-10-21 12:43:16 +11:00
Dion Moult d2e9194636 Adding type empties now adds it to the scene collection for convenience in case your types collection is hidden (which is most of the time) 2021-10-21 11:37:44 +11:00
Dion Moult 9907651d4a Fix bug where you could reassign class to another product type and create invalid relationships 2021-10-21 11:28:49 +11:00
Massimo Fabbro bb2f59e2f8 Add tooltips. Finished the "Authoring" section in the n-panel. (See issue #1646) (#1818)
* Add first tooltip (#1646)

* Add tooltips for new project

* Small fix

* Added more tootips

* Add other tooltip to the n-panel

* Add other tooltips in N Panel
2021-10-21 10:10:54 +11:00
Gorgious56 fec295d021 Migration (#1817) 2021-10-21 10:10:22 +11:00
Dion Moult cb08c19942 Fix bug where BCF header file info was not loaded. See #1816. 2021-10-20 23:41:43 +11:00
Thomas Krijnen b1b121ebc8 #1814 check for the succesful creation of edge curves in IfcIndexedPolyCurve 2021-10-20 11:14:35 +02:00
Alexander Nitsch ba9c2a3280 Fix initialization of local variable "data" (#1813)
Co-authored-by: Nitsch Alexander <alexander.nitsch@scs.ch>
2021-10-20 19:57:13 +11:00
Dion Moult 575de12d79 Fix bug where auto assignment in the collection hierarchy failed if you had filtered out aggregates and you were assigning a subelement of an aggregate 2021-10-20 19:56:46 +11:00
Dion Moult 503f0399ff Fix bug where you couldn't bulk copy non-geometric elements to other spatial containers 2021-10-20 18:47:55 +11:00
Vukas Pajic 871ad1ab7f Added operator to add psets to all selected objects. (#1805)
* first attempt

* Accommodate object vs non-object psets, and directly fetch applicable pset names

Co-authored-by: Dion Moult <dion@thinkmoult.com>
2021-10-20 14:49:02 +11:00
Dion Moult 58859ef8c3 Fix bug where when deleting representations it could sometimes overreach and delete geometric, style, or layer data of other elements. See #1812. 2021-10-20 14:11:49 +11:00
Dion Moult 52062bc7e8 Experimental proposed deep removal. See #1812. 2021-10-20 11:44:19 +11:00
Gorgious56 8fdbe30dc5 Ux docs test (#1808)
* First draft

* Final Update
2021-10-19 10:55:25 +02:00
Dion Moult f438c48c23 Fix bug where copying objects may sometimes result in incorrect location in the Blender collection tree 2021-10-19 19:15:01 +11:00
Dion Moult 6478601f79 Fix bug where copying objects did not necessarily retain the existing context assignment 2021-10-19 19:15:01 +11:00
Thomas Krijnen 816059eefd Reapply 869cc25061 2021-10-19 08:49:46 +02:00
Dion Moult 3daf4203d1 When assigning types, your preference of dynamic voids are now preserved. 2021-10-19 15:43:14 +11:00
Dion Moult c1b53859ee WIP refactor of geometry for stabilisation and optimisation. Switch representation now done. 2021-10-19 12:57:29 +11:00
Thomas Krijnen 63f85beb7e #1803 Update include in wrapper code as well 2021-10-18 16:10:20 +02:00
Thomas Krijnen bdc6fcb66f #1803 Use abstract GeometrySerializer as cache to eliminate cyclic dependencies 2021-10-18 11:38:01 +02:00
Dion Moult 4577b7bf60 Potentially risky refactor of add_representation in preparation of stabilisation and optimization of geometric operators. 2021-10-18 19:23:40 +11:00
Dion Moult 33f4461a87 New feature to resize / squash / stretch objects to their storey height. Useful for remodeling IFCs for construction simulations. 2021-10-18 14:15:16 +11:00
Dion Moult c78e7b3ba8 Fix minor bug where Python warnings showed up when delete operations were called 2021-10-18 14:12:07 +11:00
Dion Moult 699ccddda3 New utility function to get storey elevations with elevation attribute fallback for more compliant sorting of building storey elevations. 2021-10-18 12:39:04 +11:00
Dion Moult a9a48bdd1d Refactor misc functions into new misc module for better organisation. 2021-10-18 11:21:49 +11:00
amoki 8ed395a29f build python only if needed 2021-10-17 10:15:08 +02:00
amoki 63bfe761bf use platform.system() instead of uname, install python module directly in current python 2021-10-17 10:15:08 +02:00
amoki f8c11e3af7 rollback boost version 2021-10-17 10:15:08 +02:00
amoki 993ae71968 upgrade dependencies, remove x86 build 2021-10-17 10:15:08 +02:00
amoki 81b8f7e39b remove last TAG 2021-10-17 10:15:08 +02:00
amoki b1e897197b more cleanup 2021-10-17 10:15:08 +02:00
amoki 46cf1362f6 more f-strings, add some env variables 2021-10-17 10:15:08 +02:00
amoki f03992dcde remove old python versions and use f-strings 2021-10-17 10:15:08 +02:00
Dion Moult aedc1751b6 Resolve #1802. Unlinking an object now also unlinks materials and styles too for convenience. 2021-10-16 16:55:06 +11:00
Dion Moult 26cbd82da1 New feature to unlink Blender materials and IFC materials 2021-10-16 16:53:37 +11:00
Dion Moult 516503b9ca Fix #1801. Fix bug where importing multiple assets sharing an already imported material fails. 2021-10-16 15:46:02 +11:00
Dion Moult 23be5858b5 Fix bug where the derived placements interface didn't take into account rotations 2021-10-15 17:30:33 +11:00
Dion Moult 776842a064 Spatial containers are now shown sorted by Z index order for convenience. 2021-10-15 17:07:23 +11:00
Dion Moult bb090bd9a0 Fix deep magick bug where copying elements without having one of them active didn't actually copy them in IFC too 2021-10-15 14:42:08 +11:00
Dion Moult 0abe9f0559 Building storeys now show a derived storey height so you don't need to do math 2021-10-15 13:23:18 +11:00
Dion Moult 07bfe296dd You can now copy a representation from one object to another 2021-10-15 13:23:18 +11:00
Dion Moult d666a687dc FMHEM classes now updated to latest draft 2021-10-15 13:23:18 +11:00
Dion Moult acde4144bc You can now toggle whether element filtering also affects spatial containers 2021-10-15 13:23:18 +11:00
Laurens Oostwegel b41e90ead6 IfcOpenShell-python: Implemented point cloud export functionalities (#1799)
* Implemented export of point cloud representation

* Do representation geometry data no-edge check before no-polygon check
2021-10-15 12:15:55 +11:00
Dion Moult 68fd0c0cf5 Fix bug where you couldn't filter imported subelements without also selecting their parents 2021-10-14 18:47:48 +11:00
Dion Moult 199be3363f Fix bug where copying elements shared a placement. This fix speeds up copying parent elements in the decomposition significantly, like when copying a storey. 2021-10-14 16:13:48 +11:00
Dion Moult dd3fc79fb9 Use context filters during import when possible to optimise import times 2021-10-14 15:53:25 +11:00
Dion Moult d384b3d7df Fix bug where copying a container also copied its contents 2021-10-14 15:52:38 +11:00
Dion Moult 04209c78b9 Minor revert - until I properly refactor and test this. 2021-10-14 13:06:26 +11:00
Dion Moult a7719cc4b1 Fix #1796. Fix bug where duplicating a collection messes up the collection tree. 2021-10-14 13:04:30 +11:00
Dion Moult 3d0d2ec8fb Fix #1795. New support for conversion based units with offsets, like fahrenheit. 2021-10-14 12:46:01 +11:00
Dion Moult 1fa1a9e3d3 Support auto detection of unit type when adding imperial units 2021-10-14 12:44:13 +11:00
Dion Moult 464b0c2ebc Unassigning the last unit now cleans up empty unit assignments 2021-10-14 12:42:33 +11:00
Dion Moult 179a970974 Utility to print out all maintainable assets for FM paper documentation 2021-10-14 11:36:46 +11:00
Dion Moult 7fb77a794e Fix #1793. Whoops. 2021-10-13 19:09:30 +11:00
Dion Moult 1d74306bc2 New recipe (and essay) to fix ArchiCAD IFC4 door swings showing up in Revit 2021-10-13 16:39:16 +11:00
Dion Moult 0c6a3eafd2 IfcCSV now supports setting properties to null values. Neat. 2021-10-13 12:18:29 +11:00
Dion Moult 292cbf55ad Resolve #1773. IfcCSV now supports editing properties that were previously null. 2021-10-13 12:17:20 +11:00
Dion Moult e17ae4ef61 Fix #1792. Regression caused by other improvements in editing object placement. 2021-10-13 11:55:03 +11:00
Dion Moult dba6a8d0b4 Fix #1786. Swap out sub-operators with refactored core calls. 2021-10-13 10:49:28 +11:00
Dion Moult 13725411c9 Migrate project operator tests to pytest-bdd 2021-10-13 09:48:35 +11:00
maxfb87 b0e9f389a5 Add first tooltip (#1646) (#1791) 2021-10-13 09:03:36 +11:00
Dion Moult f6128febe9 You can now clear the active user for ownership history. See #1790. 2021-10-12 19:12:15 +11:00
Dion Moult fc2e12bff6 New usecase for adding conversion based units 2021-10-12 18:34:26 +11:00
Gorgious56 e455f87305 First batch of Pset Templates tests (#1772) 2021-10-09 13:26:23 +02:00
Vukas Pajic 84fc198bbe added new functionality and adjusted UI (#1771) 2021-10-09 10:13:10 +11:00
Thomas Krijnen d39e97f6a7 Default HDF5 dynamic libs 2021-10-08 22:01:34 +02:00
Thomas Krijnen 96d509698b Prefix namespaces for swig 2021-10-08 21:35:41 +02:00
Thomas Krijnen cefa66cdf9 Link to TKBin 2021-10-08 21:07:56 +02:00
Thomas Krijnen 8198df3fa6 header 2021-10-08 20:39:16 +02:00
Thomas Krijnen 4ebdb5e339 header 2021-10-08 15:50:51 +02:00
Thomas Krijnen 8dca84dd07 Geometry caching 2021-10-08 15:38:46 +02:00
Thomas Krijnen 4cee76ddc3 Make preprocessor defs consistent in IfcConvert.cpp and util.h 2021-10-08 15:25:28 +02:00
Gorgious56 8b34eb41fd Fix and test importing style attributes twice (#1784)
* Test importing surface attributes twice

* Fix style attributes not cleared when re-importing
2021-10-08 22:10:24 +11:00
Dion Moult 170cd3b5f5 Minor fix again 2021-10-07 18:59:41 +11:00
Dion Moult b8c4dd971c Minor fix 2021-10-07 18:55:22 +11:00
Dion Moult f26d43e0cd Prioritise editing rendering surface styles over shading surface styles 2021-10-07 18:51:50 +11:00
Dion Moult 9508858fcb New unassign aggregate feature. 2021-10-06 14:11:54 +11:00
Dion Moult 3aa36dd4b7 Changing aggregation now ensures spatial containment is mutually exclusive to prevent invalid IFC data 2021-10-06 12:52:01 +11:00
Dion Moult f21005c29e Assigning aggregations now protects against various invalid aggregation combinations 2021-10-06 12:50:46 +11:00
Dion Moult cbc0b8d5d4 When assigning containers, ensure aggregates and containers are mutually exclusive 2021-10-05 17:49:29 +11:00
Dion Moult c105b8f3a7 Fix bug where assigning a spatial container didn't work with non local placements 2021-10-05 17:49:29 +11:00
Dion Moult f284ae5753 Spatial containment now distinguishes between direct and indirect containment 2021-10-05 17:49:29 +11:00
Dion Moult 7c94d4275a Removing or changing spatial containers now supports updating more types of collection organisations 2021-10-05 17:49:29 +11:00
Dion Moult f5913baaca Maintain active object throughout complex IFC operations for a better user experience 2021-10-05 17:49:29 +11:00
Dion Moult f54a1a163d Changing spatial container now guards against invalid containment operations 2021-10-05 17:49:29 +11:00
Dion Moult 216029ea10 Unlinking elements is now a bit more stable. Also simplify core tool namespace. 2021-10-05 17:49:29 +11:00
Jesusbill e8764c58b5 minor mods in api structural data 2021-10-04 21:32:48 +02:00
Jesusbill a6d363c542 place structural items in collections for new project 2021-10-04 21:32:09 +02:00
Jesusbill df2a2edeea fix for structural surface items #1751 2021-10-04 21:31:10 +02:00
Maryanne Wachter 39fa932037 Updated readme usage links 2021-10-04 19:27:46 +02:00
Maryanne Wachter f1977643b6 Added build instructions for MacOS 2021-10-04 19:23:57 +02:00
Priit Laes 8b1a389855 build: nix: Bump minor versions of Python toolchains to latest versions
It's nice to keep it up with the latest releases.
2021-10-04 19:18:08 +02:00
Priit Laes 46d7eb5643 build: nix: Drop support for Python 3.{2,3,4} versions
Python project currently supports only 3.6+, so keep 3.5 still
on lifeline... 2.7 has also end of life status.
2021-10-04 19:18:08 +02:00
Priit Laes 6f6f89de0d build: nix: Drop unused imports
Print function has been supported since Python since 2.6, so
there's no need to use the import.
2021-10-04 19:18:08 +02:00
Thomas Krijnen cdc5d7a04e Missing semicolons (for consistency) 2021-10-04 10:43:04 +02:00
Thomas Krijnen 79f31fa4fe Unused include 2021-10-04 10:42:47 +02:00
Thomas Krijnen 666b55b3a3 Fix unref param addDrawing() 2021-10-04 10:40:19 +02:00
Dion Moult 8ff5ac974f Minor fix. 2021-10-04 18:50:03 +11:00
Dion Moult 6e6cbcef6f Test edit object placement. See #1711 2021-10-04 13:14:47 +11:00
Thomas Krijnen cd965fd4a9 todo note re #1769 2021-10-03 09:00:59 +02:00
Dion Moult 808ae37c66 Forgot to commit tests 2021-10-03 08:58:47 +02:00
Dion Moult adf784236c Upon removal, empty aggregates prioritise null if possible. 2021-10-03 08:58:47 +02:00
Dion Moult 6cc7d7963a Allow user to toggle duplicates when getting inverses. See #1747. 2021-10-03 10:20:24 +11:00
Dion Moult 4697e063af You can now add and remove users for ownership history 2021-10-01 17:32:58 +10:00
Dion Moult fe1e30702a Fix bug where removing addresses and roles could leave other elements in invalid states, "IfcPersonAndOrganization" 2021-10-01 14:48:44 +10:00
Dion Moult 291bb0cd55 Removing an organisation now properly handles references appropriately. 2021-10-01 13:29:10 +10:00
Dion Moult 915fa9f9b0 Removing a person no longer has the potential to leave files in an invalid state 2021-10-01 12:35:46 +10:00
Dion Moult 0a27308532 Optimise create owner history to not rely on a person and organisation lookup, speeding up long procedures 2021-10-01 11:05:35 +10:00
Dion Moult 8bcec29429 Application data in IFC now reflects the latest IFC version tag 2021-10-01 10:10:45 +10:00
Dion Moult 42d321d553 Removing contexts now also reassign to parent or remove references to the context. 2021-10-01 09:29:38 +10:00
Dion Moult a7a1616f9d Minor fix 2021-09-30 20:31:21 +10:00
Gorgious56 35ee1d5e96 Use pytest-bdd syntax for void tests (#1765) 2021-09-30 20:28:08 +10:00
Dion Moult d83295d3c3 Minor fix 2021-09-30 20:27:38 +10:00
Dion Moult b86b8c1b5a You can now edit attributes of contexts and subcontexts. Fix bug where 2D contexts were not created with the right dimensionality. 2021-09-30 18:28:50 +10:00
Dion Moult 9753ed07a0 Fix bug where you could accidentally add a context other than what you selected in the UI 2021-09-30 12:08:07 +10:00
Dion Moult 352a4866dd Refactor context. See #1711. 2021-09-30 08:46:02 +10:00
Dion Moult beff90cd5e Organisations now support null attributes. 2021-09-29 18:39:10 +10:00
Dion Moult 406fd158d3 Minor fix. See #1754. 2021-09-29 17:23:52 +10:00
Gorgious56 2ed30ef0a2 Improve filling operators and tests (#1754)
* Test add_filling operator

* Test Remove filling

* Update bootstrap defs for filling test

* Fix possible errors in add_filling and remove_filling

* Enable adding fillings from the opening object ui

* Typo

* Revert "Enable adding fillings from the opening object ui"

This reverts commit b217860840.

* Display a list of all fillings when an opening is selected

* Ensure an IfcOpeningElement can't be voided

* merge 0.7.0

* Add test cases for filling operators

* Test Opening operators

* Delete related fill relations on object deletion

* Remove try/except

* typo

* Minor fix

* Remove boolean modifier on previous element when voiding a new one

* Don't show ui elements when not applicable

* Test filling void b with an element that already fills void a
correctly removes the filling from void a

Co-authored-by: Dion Moult <dion@thinkmoult.com>
2021-09-29 16:27:43 +10:00
Dion Moult 24eac8ccdd Just realised pytest-bdd existed. Migrating over. See #1711. 2021-09-29 16:17:41 +10:00
Dion Moult 086d8749ec Add support for null attributes for people, roles, and addresses. New prototoype testable architecture. See #1711. 2021-09-29 14:14:10 +10:00
Gorgious 6fb4714317 Prevent using pset operators when no template available 2021-09-28 13:20:20 +02:00
Gorgious dbac865a39 Fix error when displaying a selected but inactive object's properties with the pin feature 2021-09-27 12:51:43 +02:00
Thomas Krijnen 024a306a36 #1757 opencollada and serializers 2021-09-27 09:04:38 +02:00
Thomas Krijnen 6182814845 rerun code gen 2021-09-26 19:55:04 +02:00
Thomas Krijnen d241af0c1b filter out redundant select membership with inheritance 2021-09-26 19:54:33 +02:00
Thomas Krijnen 39b1f4c477 #1705 fixes for missing object placement 2021-09-26 11:25:36 +02:00
Dion Moult 165966bc59 Decoupling of Blender from the BlenderBIM Add-on. See #1711. 2021-09-25 21:53:51 +10:00
Dion Moult cdb2a91f67 Remove need for IfcConvert since we can drawing is now part of v0.7.0. 2021-09-25 20:07:16 +10:00
Dion Moult c4f823a487 Upgrade BlenderBIM Add-on to v0.7.0. 2021-09-25 19:48:34 +10:00
Dion Moult 343f56b0cd Minor fix 2021-09-25 19:24:45 +10:00
Thomas Krijnen 7155f7ce3d Update cd.yml 2021-09-24 10:49:24 +02:00
Thomas Krijnen 9853d3d86a Update cd.yml 2021-09-24 10:46:22 +02:00
Thomas Krijnen 9dd30e8e53 Update cd.yml 2021-09-24 10:42:54 +02:00
Thomas Krijnen ce08fa9c1a Merge remote-tracking branch 'origin/v0.6.0' into v0.7.0
# Conflicts:
#	src/ifcparse/IfcParse.h
2021-09-24 10:29:10 +02:00
Thomas Krijnen b8d36a63a2 Bump to 0.6.0rc0 2021-09-24 10:25:22 +02:00
Thomas Krijnen 51e13c06ba Update ci.yml 2021-09-24 10:19:23 +02:00
Thomas Krijnen 529c007198 Update cd.yml 2021-09-24 10:06:47 +02:00
Thomas Krijnen 4334775618 #1747 retry 2021-09-24 10:02:20 +02:00
Thomas Krijnen da8e3e6288 #1753 2021-09-24 09:49:28 +02:00
Thomas Krijnen 768b754a0b Merge remote-tracking branch 'origin/v0.6.0' into v0.7.0
# Conflicts:
#	.github/workflows/ci.yml
#	src/ifcparse/IfcParse.cpp
2021-09-24 09:03:58 +02:00
Thomas Krijnen e1a5de793a #1747 2021-09-23 13:46:37 +02:00
Gorgious 4868edaa83 Fix #1745 : Test startup file contains no object 2021-09-23 12:35:05 +02:00
Gorgious56 98cc0b93ce Fetch pytest-blender dependencies (#1746)
* Fetch pytest-blender dependencies

* Fix command location
2021-09-23 12:29:28 +02:00
Thomas Krijnen fe533077f4 Regen schema code 2021-09-23 10:33:56 +02:00
Thomas Krijnen 63c2ca356e sort select supertypes 2021-09-23 09:27:14 +02:00
Dion Moult bc993c959e Improve error message when keyword not found. See #491. 2021-09-23 09:25:58 +02:00
Dion Moult b833dd1fe5 Merge commit '1187ad5feaf56ccb48c549a9e52147d2604d8601' into v0.7.0 2021-09-23 09:46:09 +10:00
Dion Moult ae5be40a3f Merge commit '28864cefb11bbbfa132' into v0.7.0 2021-09-23 09:33:05 +10:00
Dion Moult b2dd4781cf Block the user from creating sub resources under a subcontract resource. 2021-09-23 09:30:36 +10:00
Dion Moult 32f5c459c1 Fixes from code review. 2021-09-22 17:25:24 +02:00
Dion Moult bc5e33489e Implement IfcBoundingBox. 2021-09-22 17:25:24 +02:00
Dion Moult 0f73c43638 Fixes from code review. 2021-09-22 12:09:00 +02:00
Dion Moult 02fed24745 Refactor for readability. 2021-09-22 12:09:00 +02:00
Dion Moult c57daf8aed Let context_ids coexist with curves and solid settings. 2021-09-22 12:09:00 +02:00
Dion Moult 514c5eb790 Filter by context id, not using curves or solids. See #1674. 2021-09-22 12:09:00 +02:00
Gorgious d01b894734 Fix error when filling has no IFC type 2021-09-22 11:40:02 +02:00
Thomas Krijnen 37bddc25ca #1734 fix inv attr population on entity addition 2021-09-22 10:34:19 +02:00
Dion Moult b60ce80eb4 Add support for IfcAnnotationFillArea. See #1291. 2021-09-22 10:08:30 +02:00
Dion Moult ef8c82e1c9 Fix bug where you could add a filling twice or to multiple openings. 2021-09-21 17:29:28 +10:00
Dion Moult 04d64de6d0 Fix bug where you could add an opening twice to the same element. 2021-09-21 16:56:28 +10:00
Dion Moult a29d691944 Fix #1737. Bug where copying an opening didn't copy relevant boolean modifiers too. 2021-09-21 15:19:18 +10:00
Dion Moult 1abca2681e Fix bug where copying a filled opening would create an invalid relationship 2021-09-21 14:19:41 +10:00
Dion Moult a37d36e0c7 Fix #1733. Bug where structural member data was not updated correctly. 2021-09-21 11:06:29 +10:00
Dion Moult 1d1e051e0f Fix #1709. 2021-09-21 10:33:03 +10:00
Dion Moult f83d13b97c New support for specifying collection modes. Spatial elements now support 2D representations as well. 2021-09-21 10:14:07 +10:00
Dion Moult 090aae5ff6 Generated construction visibility now works in renders, not just viewport view. 2021-09-20 18:52:43 +10:00
Gorgious 500c7cdc37 (partially) Fix #1737 : Active object swaps to opening
Void operator would swap active object if opening IFC type is not set
Also changed the modifier creation/update logic
to accomodate for user potentially breaking things
2021-09-20 10:23:56 +02:00
Dion Moult 8fb218c335 Fix bug where demolition animations were not generated properly. 2021-09-20 18:03:51 +10:00
Thomas Krijnen 94c009d179 #1227 layer slicing 2021-09-20 09:27:56 +02:00
Dion Moult 132ec473ec New feature to see the current frame's real life date as text during a generated animation 2021-09-20 17:06:02 +10:00
Dion Moult 8cde074fd8 Editing psets can now accept user specified data types and auto-detect non-string data types 2021-09-20 15:37:01 +10:00
Dion Moult 92e519de9e Be more accommodating when fetching properties to allow for incomplete scripts. 2021-09-20 14:45:31 +10:00
Dion Moult 70ba681b35 Resource work duration can now be calculated based on counting produced products. 2021-09-20 13:27:26 +10:00
Dion Moult e2b5ecf0a1 Resource work durations can now be calculated either daily or hourly 2021-09-20 13:26:01 +10:00
Dion Moult 5efa65195f Fix bug where nested task resource-based durations failed to calculate 2021-09-20 11:52:31 +10:00
Dion Moult 20e731235c Fix task duration calculation bug where hourly work greater or equal to 24 hours were incorrectly parsed 2021-09-20 10:45:36 +10:00
Dion Moult 90e481ce2c Optimise update owner history to speed up complex operations 2021-09-20 10:17:16 +10:00
Gorgious56 2dac81ee8d Parametric object gizmo scale follows scene unit (#1715)
* Add missing units in si-conversions

* Fix error when using Miles or Thou-inch units

* Parametric gizmo scales with scene units

* use "thou" instead of "thousandth of an inch"
2021-09-19 10:02:34 +02:00
Thomas Krijnen 721fe4729a Fix another ommision with tree.select(extend) 2021-09-17 11:18:32 +02:00
Dion Moult 3eb7c7a6a1 Fix bug where assigning a new container would shift object placements incorrectly due to SI unit conversion 2021-09-17 17:13:20 +10:00
Dion Moult 2b82eaf019 Fix bug when shifting object placements and their children. Add support for specifying placement matrixes in project units or SI units. 2021-09-17 16:54:53 +10:00
Dion Moult 02a68f6827 New utility to get spatial and object decompositions from any IFC element 2021-09-17 15:40:27 +10:00
Dion Moult 2b4d4439ea Fix bug where IFC patch didn't work on case insensitive file extensions 2021-09-17 14:00:25 +10:00
Dion Moult e7a8780828 Create shape debugger now includes time information. 2021-09-15 12:43:12 +10:00
Thomas Krijnen 38a0c71060 #1674 use id to filter 2021-09-14 11:36:19 +02:00
Thomas Krijnen 99cd952c98 Add time stamp to logging 2021-09-13 14:52:23 +02:00
Thomas Krijnen 1058dc7099 Fix some casting logic 2021-09-13 13:19:56 +02:00
Thomas Krijnen 99a27fbfef option to disable guid map and lazy loading 2021-09-13 13:17:08 +02:00
Dion Moult 2dc6a3bcc6 You can now load, unlink, and unload links. 2021-09-13 10:48:38 +10:00
Dion Moult 5cee2fb08a New interface to view linked IFCs 2021-09-13 10:00:54 +10:00
Dion Moult 8aa790c1c1 Fix bug where filtering did not work for indirectly spatially contained elements 2021-09-13 09:12:51 +10:00
Dion Moult 2a07f7082a Deprecate auto detection of vendor workarounds as no longer necessary. 2021-09-12 19:19:53 +10:00
Dion Moult 92adeca837 Fix bug where aggregates break with filtered elements during import. 2021-09-12 17:29:11 +10:00
Dion Moult 0453db7745 You can now filter imported objects by IFC class when loading a project 2021-09-12 16:02:08 +10:00
Dion Moult 5f29379a6d You can now unload a partially loaded project 2021-09-12 15:42:59 +10:00
Dion Moult a9f76fc8c0 You can now partially load an IFC filtered by spatial containers. 2021-09-12 15:25:03 +10:00
Thomas Krijnen 7440321b30 Fix static atomic init 2021-09-11 13:31:20 +02:00
Thomas Krijnen e37c2d8aab Small character decoder fixes 2021-09-11 13:11:02 +02:00
Thomas Krijnen 7661899e9d #1732 0.7 IfcBaseClass::identity() 2021-09-11 12:59:48 +02:00
Dion Moult 48cb598975 You can now load a project from the project panel. See commit message.
This is in preparation for partial loading and unloading for scaling up to larger IFC scenes.

Similarly, there are bits in place for different collection modes instead of the hardcoded collection hierarchy which we currently have.
2021-09-11 20:29:14 +10:00
Thomas Krijnen d99caf15e6 #1705 fix nix build wrt schemas 2021-09-10 10:47:31 +02:00
Dion Moult d350a17ce5 Fix bug where editing styles didn't work if factors were stored instead of RGB colours 2021-09-10 17:43:26 +10:00
Thomas Krijnen 09d6f1130d #1730 correctly register inverse attributes on rooted types 2021-09-10 09:27:07 +02:00
Dion Moult 9b94c3ceca New recommended pylint command as part of qa target 2021-09-10 10:01:06 +10:00
Dion Moult 865c0f4895 Run black, and add black to a "qa" target to make it a standardised process. 2021-09-09 21:27:31 +10:00
Thomas Krijnen 95903c965d Fixes for annotations in SVG 2021-09-09 10:58:59 +02:00
Thomas Krijnen 3bebfcd8a7 Pass branch and sha to compiler 2021-09-09 09:43:28 +02:00
Dion Moult 5b711a23d3 Expose MaxId to Python 2021-09-09 08:44:12 +02:00
Dion Moult 99b776b10e Deleting openings or voided elements now also remove openings. 2021-09-09 14:48:40 +10:00
Dion Moult ce92aa6e00 Fix bug where openings were not unlinked or renamed if they were removed from a non-dynamic object 2021-09-09 13:45:49 +10:00
Dion Moult 33bc0be5ff Non dynamically voided objects now auto update when their opening is removed 2021-09-09 12:54:43 +10:00
Dion Moult 3004d5424c Assigning an opening now ensures it displays as a wire 2021-09-09 12:51:54 +10:00
Dion Moult d6aec719e5 Fix bug where removing an opening might remove an element twice 2021-09-09 12:38:52 +10:00
Thomas Krijnen 55a220751b Fix symbol direction 2021-09-08 14:21:25 +02:00
Thomas Krijnen f31ab80731 Fix combination --draw-storey-heights --svg-without-storeys 2021-09-08 13:50:27 +02:00
Dion Moult d0eb716738 Fix #1727. BIMTester now runs within the BlenderBIM Add-on, implement attribute checking in IDS, and fix some minor IDS bugs. 2021-09-08 20:17:16 +10:00
Thomas Krijnen b9084ad0f5 #1725 exports 2021-09-08 10:14:30 +02:00
Dion Moult 2580cd5e37 More tests. See #1711. 2021-09-08 17:25:54 +10:00
Dion Moult 177d46b7b6 Remove create project library ability, as you should create a project first 2021-09-08 13:41:36 +10:00
Dion Moult d026fcc900 Implement lightweight Gherkin testing for full stack tests 2021-09-08 13:15:48 +10:00
Thomas Krijnen 5f508e9ad8 Small fixes to advanced house 2021-09-07 15:31:18 +02:00
Thomas Krijnen 46f983b9ae Update build-all.py 2021-09-07 14:45:18 +02:00
Thomas Krijnen 41f2b11234 Virtual inheritance prototype for select 2021-09-06 18:52:37 +02:00
Thomas Krijnen f898893607 whitespace 2021-09-05 09:32:39 +02:00
Thomas Krijnen 6cc842a2ac #1721 fix mmap in ifcconvert 2021-09-04 15:38:07 +02:00
Thomas Krijnen cfc1ddee5e #1676 null handling in inverses 2021-09-04 14:27:46 +02:00
Dion Moult 89535e0b6a Manual import offsets now apply on object placements for efficiency. 2021-09-03 14:13:37 +10:00
Dion Moult b71684955d Simplify packaging, add create project smoke test. New license target. 2021-09-03 14:11:15 +10:00
Dion Moult 81b0442abe Fix licensing for code by qwiglydee. See #1082. 2021-09-02 09:46:11 +10:00
Gorgious 88f0938bd2 Fix errors introduced in #1683 2021-09-01 12:05:20 +02:00
Gorgious cdd5094d38 Immediately redraw the Library panel on load
This improves interface responsiveness.
Previously you would have to hover your mouse over the panel
After import to see the contents of the library visually update.
2021-09-01 08:46:31 +02:00
Dion Moult a1b462a83b Fix bug where project libraries were not legal. 2021-09-01 08:58:26 +10:00
Gorgious56 41db0f4705 Notify if file already contains library element (#1708)
* Notify if file already contains library element

* Minor fix. See #1711.

* Test util.element module. See #1711.

* Test IFC file module. See #1711.

* Minor fix. See #1711.

* Move logic into operators

Co-authored-by: Dion Moult <dion@thinkmoult.com>
2021-09-01 08:01:44 +10:00
Gorgious 06d3ed7d2a Addendum #1710 : Remove superfluous parameters fetching
bim.get_representation_ifc_parameters already called earlier in the code
2021-08-31 14:37:37 +02:00
Thomas Krijnen 66faea1285 HDF5 optional in code 2021-08-31 11:03:28 +02:00
Thomas Krijnen dbf6a1dda9 libxml2 no longer optional 2021-08-31 10:54:46 +02:00
Dion Moult 5485177888 Minor fix. See #1711. 2021-08-31 18:33:52 +10:00
Dion Moult 8792c6db63 Test IFC file module. See #1711. 2021-08-31 17:28:31 +10:00
Dion Moult 5990d6b66d Test util.element module. See #1711. 2021-08-31 15:44:57 +10:00
Dion Moult b1b3d7e312 Minor fix. See #1711. 2021-08-31 14:10:43 +10:00
Dion Moult 770f35fd97 Move tests outside src, as per convention. See #1711. 2021-08-31 13:58:41 +10:00
Gorgious56 829ff5e152 Improve mesh IFC Representation User Experience (#1710)
* Must be in object mode to update representation
This may prevent random CTDs due to invalidated data

* Use self.file instead of re-fetching from IfcStore

* Keep ifc parameters expanded when updating representation

* Clear previous ifc parameters when re-fetching
2021-08-31 13:45:17 +10:00
Dion Moult 4accf30626 Add transaction support for adding elements. See #1709. 2021-08-31 10:25:13 +10:00
Dion Moult 0ed38a4128 Fix #1707. Fix bug where project library browser could self reference. 2021-08-31 08:22:12 +10:00
Dion Moult 0a2afa4879 Fix bug where element replacement would sometimes fail leading to various problems. 2021-08-30 21:32:23 +10:00
Gorgious 9d4f0730e2 Fix typo in material style assignment code 2021-08-30 13:17:20 +02:00
Dion Moult 6b33b23a29 Fix bug when copying objects, don't copy their decomposition to prevent invalid IFCs. 2021-08-30 18:59:50 +10:00
Dion Moult 6addbd935f Add copyright boilerplate to BCF and OpenCDE code 2021-08-29 16:51:56 +10:00
Prabhat Singh 5782691cdb minor fix (#1704) 2021-08-29 15:48:37 +10:00
Dion Moult bcda3d8e93 Minor fix 2021-08-29 15:26:45 +10:00
Dion Moult c131b81565 New bunny rabbit furniture asset :) It's the BlenderBIM Bunny! 2021-08-28 20:16:04 +10:00
Dion Moult 99d7eaaf70 You can now insert doors, and we distribute a sample demo and site library 2021-08-28 19:00:32 +10:00
Dion Moult c726e8feb9 You can now calculate costs from direct resources and indirect task-based resources 2021-08-28 18:21:22 +10:00
Dion Moult faaeef92de You can now edit resource base quantity 2021-08-28 14:38:20 +10:00
Kristoffer Andersen 126bac462d Add basic BCF pypi upload CI action. (#1701)
* Add basic pypi upload CI action.

For now I propose a simple trigger using a commit tag "[bcf release]". I think this is just as well since we do not (yet) have an automatic versioning for the bcf package

* add correct subfolder (point to bcf) to ci recipe
2021-08-27 20:30:39 +10:00
Gorgious a4b4c7b37c Minor fix for https://github.com/IfcOpenShell/IfcOpenShell/pull/1699 2021-08-27 10:38:19 +02:00
Dion Moult 75a8e4af02 Minor fix for #1699 2021-08-27 18:21:11 +10:00
Gorgious56 8d5970f002 Display project units instead of hardcoded ones (#1699)
* Display project units instead of hardcoded ones

* Treat MapUnit as a regular attribute

* Remove left over attributes

* Refactor operator for MapUnit change

* Fix unit fetch failing because of wrong id type
2021-08-27 18:07:51 +10:00
Dion Moult dd0a3d0421 Minor fix. 2021-08-27 17:24:42 +10:00
Dion Moult b272210a97 Resource base costs are now supported with all the features coming from the cost module. 2021-08-27 17:12:21 +10:00
Dion Moult b99c5036e6 You can now edit nested arithmetic cost values by using spreadsheet-like formulas 2021-08-27 14:45:14 +10:00
krande 16b34f942a Update path to bcf package 2021-08-26 14:50:50 +02:00
Gorgious56 104e9c9ca7 Apply object operators to all selected objects (#1696)
* Remove container executes on all selected objects

* Pass silently if assigning or removing container on non-bim object

* Assign / Unassign Material executes on all selected objects

* AddRepresentation executes on all selected objects

* Assign / Unassign Constraint executes on all selected objects

* Fix error when trying to assign representation to non-mesh object

* Assign / Unassign Document executes on all selected objects

* Code Cleanup & Consistency

* Fix Attribute data type not being assigned when it makes sense

* Revert changes to geometry operator

* Revert "Fix Attribute data type not being assigned when it makes sense"

This reverts commit 1117c8670c.

* Revert changes to material operator

* Use attribute helper functions

* Filter select entities in import_attributes

* revert changes to attribute fetching

* Revert "Filter select entities in import_attributes"

This reverts commit 7f84c2ea63.

* Enforce new attribute data type to string

* Restrict import_attributes usecase

* Remove trailing spaces

* Revert changes to IfcProjectedCRS attributes
This is done prior to the planned unit refactor
2021-08-26 21:44:33 +10:00
Dion Moult 5e1fbacef7 Cost values are now serialised and shown as formulas 2021-08-26 21:37:25 +10:00
krande c96d1e6387 add lxml package as another dep to be installed before running tests 2021-08-26 09:58:37 +02:00
krande d4ace423a3 Prep BCF for pypi upload.
* Refactored the BCF dir into a "src-layout" which I am more comfortable with. We can likely change this back if it is not compatible with other development

* I added a few setup files for the bcf package (setup.cfg, pyproject.toml and a MANIFEST.in file)

* Added two __init__.py files in the v2 and v3 subfolders for them to be picked up during package compilation
2021-08-26 09:58:37 +02:00
krande 9c81418492 Add numpy as a dependency 2021-08-26 09:58:37 +02:00
Kristoffer Andersen a60c5367ee Update rel path 2021-08-26 09:58:37 +02:00
krande cb0c124745 cd into test folder before running tests 2021-08-26 09:58:37 +02:00
krande 6aea3361c1 Add proposal for CI workflow on PR and commits 2021-08-26 09:58:37 +02:00
Boris Brangeon 1ae7bd3a9a add (in() IfcGeomShapes 2021-08-26 09:47:23 +02:00
Dion Moult 00f779fc49 You can now count elements, tasks, and resources parametrically for cost items 2021-08-26 15:48:04 +10:00
Dion Moult 2cfa1d8bc0 Only equipment and labour resources can now have time-based usages 2021-08-26 11:54:15 +10:00
Gorgious56 6e3484fd46 Fix https://github.com/IfcOpenShell/IfcOpenShell/issues/1695 : (#1697)
Removing material from IfcMaterialList removes all occurences of the material
2021-08-26 09:06:27 +10:00
Thomas Krijnen 0a03632e95 #1693 get_info_2() derived and select 2021-08-25 18:44:35 +02:00
ArturTomczak 178611faa8 Finalizing Gsoc#45 ids checking (#1694) 2021-08-25 13:49:25 +02:00
Dion Moult 8c97b53bd2 You can now store productivity rates and calculate resource work parametrically based on productivity 2021-08-25 18:15:19 +10:00
Dion Moult ae42d91c5c You can now manage psets on resources 2021-08-25 17:24:18 +10:00
Dion Moult 8fa1a99864 Fix bug where the pset templates with multiple applicable entities only checked the first entity 2021-08-25 17:22:02 +10:00
Dion Moult a430d356c0 You can now parametrically derive task durations from resource utilisation 2021-08-25 16:27:23 +10:00
Gorgious56 112ce48350 Improve groups and systems interface (#1688)
* Enable Batch adding/removing objects from groups
Might hang up Blender for a few secs with a big number of object on execution

* Enable Batch adding/removing objects from systems
Might hang up Blender for a few secs with a big number of object on execution

* Add Group Panel in object properties
+ Transfer adding object(s) to group into the object properties

* Add Systems Panel in object properties
+ Transfer adding object(s) to system into the object properties

* Simplify group & systems operators

* Disabling Editing of groups/systems also disables individual edition
2021-08-24 13:58:52 +02:00
ArturTomczak 486eb4d9a0 Implement new IDS schema 0.4.1 (#1623) 2021-08-24 12:57:44 +02:00
Dion Moult cb4001b47b Detect units from project libraries, and convert nested double aggregates 2021-08-24 10:58:26 +02:00
Dion Moult 1187ad5fea Implement new ICOM-based UI for managing process inputs, outputs, and resources 2021-08-24 18:08:06 +10:00
Dion Moult a2a04cb341 Non-rooted subcontract resources are now allowed. 2021-08-24 14:44:30 +10:00
Dion Moult 28864cefb1 Block the user from creating sub resources under a subcontract resource. 2021-08-24 14:42:50 +10:00
Thomas Krijnen 88f7d307b8 Merge remote-tracking branch 'origin/v0.6.0' into v0.7.0 2021-08-23 13:13:40 +02:00
Thomas Krijnen e9ad1019a4 freetype-2.7.1 2021-08-23 13:13:16 +02:00
Prabhat Singh 9513a9ebef Minor improvements (#1682)
* Added Schema Check in bcf routes

* Basic Changes

Co-authored-by: Dion Moult <dion@thinkmoult.com>
2021-08-23 17:18:34 +10:00
Dion Moult d27d0acbc0 Simple prototype integration to run an OpenLCA analysis from Blender 2021-08-23 16:34:19 +10:00
Dion Moult 869d067c94 Project libraries are now sorted alphabetically for convenience 2021-08-23 09:38:24 +10:00
Dion Moult 268241bf5d Hide types collection when importing assets. See #1590. 2021-08-23 08:31:10 +10:00
Gorgious56 67c055579c Various tweaks and fixes (#1683)
* Use operator's poll method to ensure correct execution

* Add utilities to get active collection item

* Minor fixes
zombie code
list comprehensions
typos
cleanup
tooltips, descriptions
ensure file extension in folder operator
use custom UI List instead of generic one
ensure active object stays the same after operator execution
use passed context instead of bpy

* Jump through hoops to not display empty dynamic enums

* Group mesh calculation methods in helper module
If not using bmesh, the polygon selection status
is updated only when getting out of Edit mode.
Using bmesh we can get the values in realtime

* Remove unused arg name in dosctring
2021-08-23 08:07:29 +10:00
Dion Moult 4d7ff493a8 Minor iterator optimisation to prevent inverse check for associated materials 2021-08-22 14:32:12 +02:00
Dion Moult afb3d998c8 Rudimentary handling of purging voids and fills 2021-08-22 22:02:22 +10:00
Dion Moult 0d2d5ff16b Windows now move with openings and walls when toggled. 2021-08-22 20:57:54 +10:00
Dion Moult 3c235208de Fix #1679. Again. 2021-08-22 20:54:05 +10:00
Thomas Krijnen 37851fac9d #1674 store inverse references as tuple of (id type index) 2021-08-22 12:22:44 +02:00
Dion Moult 52f4b564b3 Minor fix. It seems as though StructRNA of type Scene may be removed during undo/redo, which results in handlers failing. 2021-08-22 19:11:17 +10:00
Thomas Krijnen 4c131b85bc Wrong OCCT patch for 7.5.3 2021-08-22 11:05:02 +02:00
Dion Moult 6db1a8a85f Minor fix 2021-08-22 11:04:39 +10:00
Dion Moult 8178dd330d Fix #1679 2021-08-22 10:53:43 +10:00
Dion Moult 616f284126 Minor fix 2021-08-21 21:53:16 +10:00
Dion Moult 5e6343885c Filtered imports is now much faster and works with omitted aggregates 2021-08-21 21:09:48 +10:00
Thomas Krijnen 54687f064c Update build-deps.cmd 2021-08-21 09:11:40 +02:00
Dion Moult fd603f7035 IfcZip and IfcXML can now be set manually, and prevent double loading when importing, which can save ~20 seconds for large file imports. 2021-08-21 16:17:06 +10:00
Gorgious 3b36029b1d Use label instead of dummy dynamic enum
And fix error in last commit...
2021-08-20 10:16:58 +02:00
Gorgious 447c07460a Disable editing operators : Change icon 2021-08-20 10:13:00 +02:00
Gorgious 5c62cb244a Create Drawing op: Add tooltip and use poll method 2021-08-20 09:55:44 +02:00
Dion Moult 7fa79a2cec Work schedule psets are now supported, so you can set work day/week/month durations 2021-08-20 09:42:03 +10:00
Dion Moult 6c6d4c047c Fix #1672. Bug where style attributes couldn't be edited. 2021-08-20 08:51:46 +10:00
Prabhat Singh a0def600e8 Added Schema Check in bcf routes (#1671) 2021-08-20 08:10:20 +10:00
Cyril Waechter a37338a6d3 Complete IfcSIUnitName exponents (#1670) 2021-08-20 08:08:49 +10:00
Dion Moult 11e36bf744 Minor fix 2021-08-20 08:01:48 +10:00
Gorgious56 511e1c8a95 Merge pull request #1673 from Gorgious56/improve-object-ux
Improve Object, Material BimProperties UX and fix a few bugs
2021-08-19 23:03:54 +02:00
Gorgious 1c9cd058c8 Fix errors if no ifc file 2021-08-19 22:46:01 +02:00
Gorgious b5ff3cd818 Fix error due to typo 2021-08-19 22:31:29 +02:00
Gorgious f904648783 Keep active object as active when creating ifc file 2021-08-19 22:29:43 +02:00
Gorgious 0f38cd712e Fix errors due to accessing empty enum 2021-08-19 22:26:00 +02:00
Gorgious 9b9326721d Fix error when trying to select type if type is not set 2021-08-19 22:06:56 +02:00
Gorgious 29cda05025 Fix error when adding opening with None object 2021-08-19 22:05:22 +02:00
Gorgious d1a39d8004 Fix possible error due to typo 2021-08-19 21:59:00 +02:00
Gorgious e0bfa8f55a Fix console error due to accessing empty dynamic enum 2021-08-19 21:58:37 +02:00
Gorgious 95f2d939e8 Fix error when filling opening with None object 2021-08-19 21:43:31 +02:00
Gorgious a14c3b181d Keep active object when removing from containers 2021-08-19 21:27:37 +02:00
Gorgious 17e61afd59 Add tooltip to CopyToContainer Operator 2021-08-19 21:26:54 +02:00
Gorgious bf6c3e40d3 Fix console error due to accessing empty dynamic enum 2021-08-19 21:06:45 +02:00
Gorgious ef557e96a7 IfcCobie : Prevent executing operator if no ifc file 2021-08-19 14:06:36 +02:00
Gorgious 59f156bae3 IFC Cobie : Fix Elements not being assigned in selector 2021-08-19 14:04:01 +02:00
Gorgious56 6eaa13b5f1 BlenderBim : Improve BCF project UX (#1669)
* Improve related topic selection UX

* Foolproof active topic access with property

* Use self when available

* Add utility method to explicitely refresh topic

* Simplify Refresh topic code

* BCF Topics can now be deleted using Blender UI

* Revert dynamic enum for related topics

* Minor fix and cleanup

* Fix bug when trying to display deleted related topic
2021-08-19 18:50:27 +10:00
Dion Moult 92f55504e9 New site project library for stuff like site sheds and cranes 2021-08-19 09:24:14 +10:00
Gorgious56 cb2995a255 BlenderBim : Improve BCF Project UX (#1668)
* Store fields on BCFProperties class rather than individual topics

* Clear input fields on active topic change

* BCF : Fix resetting comment has_related_viewpoint default value

* Prevent global function use from import

* Use dynamic enum to choose related topic

* Add newline at eof

* Show only .bcf and .bcfzip files when saving project
2021-08-19 07:42:41 +10:00
Dion Moult bbd7264a9b Improve UX of task tree by shifting buttons and changing column widths 2021-08-18 18:40:54 +10:00
Dion Moult a6b8e40829 Cost subtotals that are calculated from per X units are now supported 2021-08-18 18:05:01 +10:00
Gorgious 799fb688b5 Fix https://github.com/IfcOpenShell/IfcOpenShell/issues/1667 : Passed scene is None when creating file 2021-08-18 07:59:23 +02:00
Gorgious56 2d730fbee7 Improve drawing style save and load (#1665)
* Replace raster style save & load with enum functionality

* Rename DrawingStyleProp to RasterStyleProperty

* Minor Fix

* Correct Typo
2021-08-18 08:50:24 +10:00
LaurensJN 4b7058e22e ifccityjson: updated georeferencing & added option to split IFC files based on Level of Detail 2021-08-17 16:37:40 +02:00
Thomas Krijnen 96017bb36c Update draw.py 2021-08-17 16:00:42 +02:00
Thomas Krijnen 0483b929d7 auto elev closed to bounds to have storey heights printed 2021-08-17 15:58:35 +02:00
Thomas Krijnen 4afa6cd78b draw settings 2021-08-17 15:58:15 +02:00
Thomas Krijnen 9d6230eb16 Add ifcopenshell.draw module 2021-08-17 14:55:32 +02:00
Gorgious fb1c340664 Use passed context instead of bpy.context 2021-08-17 14:55:19 +02:00
Thomas Krijnen ba8088395b Retain elements when addDrawing() used 2021-08-17 14:50:38 +02:00
Thomas Krijnen a7d349cbac SVG addDrawing() option 2021-08-17 14:50:04 +02:00
Gorgious 4614bde8d7 Cleanup : Use clear instead of while...remove loop 2021-08-17 14:41:15 +02:00
Thomas Krijnen 9cc3810650 Initialize storey_height_display_ 2021-08-17 13:50:37 +02:00
Thomas Krijnen 707f43a1fb Correct auto EW section 2021-08-17 13:50:11 +02:00
Thomas Krijnen 5740816a37 SVG serializer check file existence 2021-08-17 13:49:49 +02:00
Thomas Krijnen 15c28a1815 Remove win build deps python2 and oce options. Bundle sections for writing of cache 2021-08-17 13:35:19 +02:00
LaurensJN 88669701b2 cityjson: Implement conversion of all LODs instead of only the most detailed 2021-08-17 11:24:21 +02:00
Gorgious f4fac9210d Fix https://github.com/IfcOpenShell/IfcOpenShell/issues/1664 : IFCPatch wouldn't correctly unpack un-hinted arguments 2021-08-17 09:46:43 +02:00
Gorgious 2c270a7315 Fix https://github.com/IfcOpenShell/IfcOpenShell/issues/1663 : Extract Docs is bundled with IfcPatch module 2021-08-17 09:36:53 +02:00
Dion Moult 912699e63c You can now assign rates from a schedule of rates to a cost plan 2021-08-17 12:22:57 +10:00
Dion Moult 899a0c6fb5 You can now browse a schedule of rates alongside a cost schedule 2021-08-17 11:01:41 +10:00
Dion Moult f2aec9440f UoM and unit rates are now shown for schedule of rates in costing 2021-08-17 09:44:43 +10:00
Dion Moult 2284f7b16e BlenderBIM Add-on licensing. See #1082. 2021-08-17 08:55:29 +10:00
Dion Moult 2dbf9665be IfcSverchok licensing. See #1082. 2021-08-17 08:39:38 +10:00
Gorgious56 06b43e7f80 Make BCF project UI (more) foolproof (#1662)
* Various code fixes and optimizations

* Prevent running operators if conditions not met
2021-08-17 07:52:55 +10:00
Prabhat Singh 1b4d0bf577 updated routes (#1661) 2021-08-17 07:48:55 +10:00
Dion Moult ee0d594f9f WIP window tool progress. 2021-08-16 20:34:28 +10:00
Dion Moult be08d0ad1b Fix #1657. 2021-08-16 19:41:30 +10:00
Dion Moult 21c975540d Fix #1658. Fix bug where changing slab layer thicknesses didn't work if it didn't have a solidify modifier already. 2021-08-16 18:45:44 +10:00
Dion Moult f040dbcb6c You can now assign / unassign cost items in a schedule of rates to type products 2021-08-16 17:46:23 +10:00
Dion Moult 6b7b81765c You can now add and edit context dependent units including dimensional exponents 2021-08-16 15:58:44 +10:00
Dion Moult 6ee0027f33 Import of CSV-based schedule of rates is now possible 2021-08-16 15:07:09 +10:00
Dion Moult 897d7a6b2d Half complete "add window" tool prototype 2021-08-16 10:42:06 +10:00
bosonprojets b4256c504f Implement metric constraints in the ifcopenshell.api 2021-08-16 01:35:14 +01:00
Dion Moult 745411ee47 Minor fix & refactor, run black, fix pset optionality. See #1655. 2021-08-16 09:15:43 +10:00
Gorgious56 296bf0387d Improve ifc patch arguments User Experience (#1655)
* Add description field to Attribute Container

* Add helper function to extract IFCPatch arguments

* Add Operator to populate Attributes with IFCPatch arguments

* Support int, float, bool and improve UX/UI

* Move all reflection logic inside helper module

* Improve UI

* Correctly unpack arguments when Patching IFC

* Refactor Attribute class to provide agnostic value access

* Take advantage of Attribute agnosticity refactor

* Use regular json if no docstring when Patching

* centralize docstring extraction in UI module

* Revert "centralize docstring extraction in UI module"

This reverts commit e7a63d2a0b.

* Place Patch description in recipe enum field

* Minor fixes

* Minor fixes

* Remove description field from Attribute

* Auto-update IFC Patch args on recipe change
2021-08-16 08:16:51 +10:00
Thomas Krijnen bee3926c7f SVG fix auto drawings 2021-08-15 20:43:55 +02:00
Thomas Krijnen cd68ce1c8f submodule 2021-08-15 20:43:40 +02:00
Thomas Krijnen 47b30aa689 tree ray intersection 2021-08-15 20:42:36 +02:00
Thomas Krijnen d79298e18d occt 7.5.3 2021-08-15 20:41:43 +02:00
Thomas Krijnen 8f1db0019b Merge remote-tracking branch 'origin/v0.6.0' into v0.7.0 2021-08-15 20:40:55 +02:00
Gorgious d22c11c200 Fix : Poll checking for file is not needed 2021-08-15 19:27:25 +02:00
Gorgious d7a76bfa11 Fix https://github.com/IfcOpenShell/IfcOpenShell/issues/1656 : Operator needs a file to execute 2021-08-15 19:19:32 +02:00
Dion Moult a6c11b7e23 Improved accuracy of boolean modifiers for dynamic voids 2021-08-15 18:32:42 +10:00
Dion Moult f280aa3a13 Demo library now includes a window type. Neat. 2021-08-15 18:08:12 +10:00
Dion Moult 1515ef98b7 Walls and slabs (or any vertical or horziontal layer) now auto recalculate origins after editing 2021-08-15 11:05:58 +10:00
Dion Moult 184081ebaf Fix #1653. Walls grow or shrink from their origin point. 2021-08-15 11:05:58 +10:00
Dion Moult 91d1f69d58 Fix #1652. Minor fix. 2021-08-15 11:05:58 +10:00
bosonprojets ca20d94d66 Fix issue #1637 Blender ID collision for bim.assign_resource and bim.unassign_resource 2021-08-14 15:04:13 +01:00
Dion Moult 0cc6ca11b1 Fix #1648. Adding openings now intelligently detect the shape of the element you are voiding. 2021-08-14 21:21:14 +10:00
Dion Moult c086104573 Fix #1640. A Blender material is now always applied even if indirectly applied through a set or usage. 2021-08-14 20:02:31 +10:00
Dion Moult b29ace296a Fix #1642. New feature to select the type's Blender object of the active object. 2021-08-14 19:12:09 +10:00
Dion Moult ac9e6cc661 New convenience button to add an empty for a type with no representation 2021-08-14 19:03:04 +10:00
Thomas Krijnen 4cb59009b4 #1649 allow profile def in create shape() 2021-08-14 09:12:11 +02:00
Dion Moult 0ce35466ff Fix #1645. Fix bug where you could accidentally have a layer set with zero thickness which caused object creation to fail. 2021-08-14 15:09:19 +10:00
Dion Moult 58921e200c Fix #1647. Bug where auto spatial containment assignment failed when you were not in a container. 2021-08-14 14:40:45 +10:00
Dion Moult 3e2b66ef2f You can now edit psets of profiles 2021-08-14 13:01:22 +10:00
Dion Moult 8300868a9b New profile browser with basic profile edit and remove feature. See #1641. 2021-08-14 12:34:18 +10:00
Dion Moult 305465a898 You can now import profile definitions from a library 2021-08-14 12:05:59 +10:00
Jesusbill c2530b7a61 added some named dimensions for units 2021-08-13 12:11:15 +02:00
Dion Moult 2f3c79a0e6 Implement cost identification numbers and big cleanup to cost schedule UI 2021-08-13 18:01:23 +10:00
Dion Moult 26f800331e New utility to get the exponential dimensions of named unit types 2021-08-13 16:20:30 +10:00
Dion Moult fd163a3d1e Implement ability to add SI units 2021-08-13 16:18:05 +10:00
Dion Moult 671f1ab9cf New feature to toggle default project unit assignment 2021-08-13 14:58:25 +10:00
Dion Moult 2a6d6cfdbf You can now edit the unit basis of a cost value for a schedule of rates 2021-08-13 11:56:33 +10:00
Thomas Krijnen 44c868caed #1531 Breadth-first search and maintain insertion order on remove_deep() 2021-08-12 13:35:45 +02:00
Thomas Krijnen 83d2548978 Validate instance attribute values by catching exceptions 2021-08-12 13:10:16 +02:00
Dion Moult 199bc86a88 Minor code review 2021-08-12 17:56:58 +10:00
Prabhat Singh 7a5b15e5a2 Added Routes to BCF (#1644) 2021-08-12 17:10:25 +10:00
Dion Moult 4b64e096a5 You can now assign resource-based parametric quantities to cost items 2021-08-12 13:59:49 +10:00
Dion Moult b92e3fcf01 Implement task-based parametric cost item quantities 2021-08-12 13:29:35 +10:00
Dion Moult acb446bfc2 Changing task scheduled dates now auto updates its related quantity take off data 2021-08-12 10:32:42 +10:00
Dion Moult 5af0d65306 You can now remove cost quantities in bulk. 2021-08-12 10:03:58 +10:00
Dion Moult f600186496 Parametric quantity breakdowns for cost items are now shown 2021-08-12 09:54:01 +10:00
Thomas Krijnen a2a606940a cgal header only in win build script 2021-08-11 21:47:18 +02:00
Thomas Krijnen 878c130924 cgal header only in win build script 2021-08-11 21:47:15 +02:00
Dion Moult e8e12a567e Assigning a product to a cost item now also assigns a quantity in one step 2021-08-11 21:22:23 +10:00
Dion Moult e21b4479b2 Minor fix. Fix #1639. 2021-08-11 21:01:56 +10:00
Dion Moult 858f48c49d New interface to view physical products assigned to a cost item 2021-08-11 20:56:07 +10:00
LaurensJN 62b8f10677 ifccityjson: support for object parent/children relationships 2021-08-11 10:02:23 +02:00
LaurensJN f42b018943 ifccityjson: more appropriate conversion of classes from cityjson to ifc 2021-08-11 09:15:57 +02:00
Dion Moult dff91e233b Distribution IFC-extended pset definitions for parametric costing and modeling 2021-08-11 17:09:51 +10:00
Dion Moult 2f49658d66 Implement resource quantity sets for parametric quantification 2021-08-11 17:08:49 +10:00
Dion Moult 0c27caf522 Implement task quantity sets for parametric quantification 2021-08-11 16:50:52 +10:00
aothms a304bc4021 Merge branch 'v0.7.0' of https://github.com/IfcOpenShell/IfcOpenShell into v0.7.0 2021-08-10 19:03:15 +00:00
aothms 92ae058f1e Build cgal/gmp/mpfr in build-all 2021-08-10 19:02:52 +00:00
Thomas Krijnen f9deaa53de submodule 2021-08-10 21:01:05 +02:00
aothms c8a357c228 Changes to build-all 2021-08-10 14:34:01 +00:00
aothms 095f1b3056 Merge branch 'v0.7.0' of https://github.com/IfcOpenShell/IfcOpenShell into v0.7.0 2021-08-10 14:32:43 +00:00
aothms ebf41592cc submodule 2021-08-10 14:32:34 +00:00
Thomas Krijnen 636c45f421 Merge remote-tracking branch 'origin/v0.6.0' into v0.7.0
# Conflicts:
#	src/ifcparse/Ifc4x3_rc4.cpp
#	src/ifcparse/Ifc4x3_rc4.h
2021-08-10 15:20:35 +02:00
Thomas Krijnen b3087e31f8 Regenerate schemas 2021-08-10 15:17:25 +02:00
Thomas Krijnen a8fbdb4c92 update RC4 schema 2021-08-10 15:14:59 +02:00
Thomas Krijnen f9c3bbb544 run blenderbim ci only on 0.6 2021-08-10 14:32:57 +02:00
Thomas Krijnen 007c5893c1 Merge branch 'v0.7.0' of https://github.com/IfcOpenShell/IfcOpenShell into v0.7.0 2021-08-10 14:30:21 +02:00
Thomas Krijnen 43f528ce04 Merge remote-tracking branch 'origin/v0.6.0' into v0.7.0
# Conflicts:
#	src/ifcgeom/IfcGeomTree.h
#	src/ifcgeom_schema_agnostic/IfcGeomIterator.h
#	src/ifcgeom_schema_agnostic/IteratorImplementation.cpp
#	src/ifcgeom_schema_agnostic/IteratorImplementation.h
#	src/ifcparse/Ifc4x3_rc3.cpp
#	src/ifcparse/Ifc4x3_rc3.h
#	src/serializers/SvgSerializer.cpp
2021-08-10 14:30:07 +02:00
Dion Moult a0f7a70419 Parametric types can how define a default layer set direction. 2021-08-10 22:16:45 +10:00
Thomas Krijnen ea9fd80998 Update ci.yml 2021-08-10 14:01:33 +02:00
Thomas Krijnen 5773c304dc Update ci.yml 2021-08-10 13:53:37 +02:00
Thomas Krijnen 5bf7aea21b Update ci.yml 2021-08-10 13:50:57 +02:00
Thomas Krijnen 83d5effb49 submodule 2021-08-10 13:47:56 +02:00
Thomas Krijnen e69b081962 cgal 2021-08-10 13:44:05 +02:00
Thomas Krijnen 443d769f62 recursive checkout 2021-08-10 12:54:55 +02:00
Dion Moult cb95c93424 You can now parametrically create profile / layer based objects of any type, no longer limited to walls, slabs, etc. 2021-08-10 18:56:24 +10:00
Dion Moult ab38e6bf7c You can now add and edit monetary units, and basic editing of other unit types. 2021-08-10 17:35:18 +10:00
Dion Moult 538029f396 Fix bug in work schedule cascading where some cascades wouldn't work and non-working dates would lead to an infinite recursion 2021-08-10 12:35:07 +10:00
Dion Moult ebd84a662e Updating model quantities now auto refreshes parametric quantities in cost schedules 2021-08-10 12:01:29 +10:00
Dion Moult f393c5f1d2 Copying an object / class now also copies pset and qtos 2021-08-10 11:48:38 +10:00
Dion Moult 1d42ce04eb Fix bug where editing a schedule finish date by itself wouldn't work 2021-08-10 10:55:01 +10:00
bosonprojets 023dd289fa BlenderBIM and ifcopenshell.api features to enable adding and editing resource time information 2021-08-10 00:59:20 +01:00
Dion Moult 869bb22830 You can now import a cost schedule from an IFC project library 2021-08-10 09:35:09 +10:00
LaurensJN 4bf074f97a ifccityjson conversion support for MultiLineString and MultiPoint 2021-08-09 13:10:26 +02:00
Dion Moult 4c67137d47 You can now create curve shapes from the debug panel too 2021-08-09 20:30:14 +10:00
Dion Moult 4bb888c862 You can now customise cost category columns in the cost schedule tree 2021-08-09 19:06:06 +10:00
Dion Moult 9a748e640e Fix bug where you couldn't delete non active task columns 2021-08-09 18:29:25 +10:00
Dion Moult efec360a00 Ifc5d can now parse cost category breakdowns in CSV form 2021-08-09 17:57:34 +10:00
Dion Moult d4fc135209 You can now import cost schedules as CSVs into IFC in Blender 2021-08-09 17:12:23 +10:00
Dion Moult 09098c1bdc New Ifc5D utility for converting and generating analysis of IFC cost data 2021-08-09 16:56:38 +10:00
bosonprojets 6899f9fa8f Feature to enable assigning Construction Resources to Tasks 2021-08-09 03:14:11 +01:00
Dion Moult a83952cec2 You can now import materials from a project library 2021-08-09 11:17:17 +10:00
Thomas Krijnen 21e064acaf fixes 2021-08-08 21:16:30 +02:00
Thomas Krijnen 83a8745959 --svg-no-css 2021-08-08 20:40:15 +02:00
Thomas Krijnen 42ae4f9a3c add `cut' to classname 2021-08-08 20:21:01 +02:00
Thomas Krijnen 3cd47cdd0f svg skip empty 2021-08-08 20:20:23 +02:00
Thomas Krijnen 92ca549b0b setNoCSS() 2021-08-08 18:10:19 +02:00
Thomas Krijnen 2213b4e212 --elevation-ref-guid setElevationRefGuid 2021-08-08 18:06:58 +02:00
Dion Moult 7abccbd713 Deleting a material set from a type now also purges usages from type instances 2021-08-08 20:56:31 +10:00
Dion Moult b696d302f9 Minor fix. See #1616. 2021-08-08 20:24:44 +10:00
Dion Moult 2c66fbf1c4 Fix #1546. New feature to copy the material of the active object to selected objects. 2021-08-08 20:13:24 +10:00
Dion Moult 18a52fd5f8 IfcClash now has logging and fix bug where exclude clash filters on large files was very slow 2021-08-08 16:54:48 +10:00
Dion Moult 2033ee1c69 Minor fix 2021-08-08 16:13:19 +10:00
Dion Moult c1ae066e76 Switching BCF viewpoints is now sigificantly faster on large projects. 2021-08-08 14:02:24 +10:00
Dion Moult 70f6857325 Fix #1357. Remove temporary workaround for broadphase tree creation. Thanks aothms! 2021-08-08 14:02:24 +10:00
Dion Moult 0d6cacdd73 BCF cameras now support global absolute coordinates with a Blender offset 2021-08-08 14:02:24 +10:00
Thomas Krijnen 17ef18cd2a submodule 2021-08-07 23:14:39 +02:00
Thomas Krijnen 2f8ff9391c #1153 work on embedding svgfill in ifcopenshell wrapper 2021-08-07 23:09:19 +02:00
Thomas Krijnen 0183cf3b31 Update FUNDING.yml 2021-08-07 15:48:50 +02:00
Dion Moult ab8fd0a6fe WIP licenses. See #1082. 2021-08-07 21:15:36 +10:00
Dion Moult 5a52f3aeea Fix #1528. Fix bug where IFC project libraries could not be imported as a file. 2021-08-07 21:06:42 +10:00
Thomas Krijnen 0087fa875b separate tree::add_element(), dynamic_cast<> for invalid settings 2021-08-07 13:01:52 +02:00
Dion Moult a874a6b673 Fix #1632. Fix bug where you couldn't load the add-on in background mode. Thanks s-leger! 2021-08-07 20:35:08 +10:00
Thomas Krijnen 872306fdd0 further optional type changes 2021-08-07 11:53:45 +02:00
Thomas Krijnen 0e6962c311 further optional type changes 2021-08-07 11:23:41 +02:00
Thomas Krijnen 49cf297eee further optional type changes 2021-08-07 10:58:20 +02:00
Thomas Krijnen 321d18990f Position() != nullptr 2021-08-07 10:44:29 +02:00
Thomas Krijnen 8a7016c135 update parse example for optional<double> 2021-08-07 10:41:00 +02:00
Thomas Krijnen 34cb672075 string literals 2021-08-07 10:40:43 +02:00
Dion Moult 176e22af8b Fix bug to prevent users from appending a project library asset twice 2021-08-07 18:37:45 +10:00
Thomas Krijnen 5d14f187b0 Position() != nullptr 2021-08-07 10:16:07 +02:00
Thomas Krijnen 85645aca28 use assignment operator 2021-08-07 10:08:19 +02:00
Thomas Krijnen ef5b41b566 specify template differently 2021-08-07 10:00:56 +02:00
Thomas Krijnen 44de9a387f reverse overload order 2021-08-07 09:44:21 +02:00
Dion Moult bcf82984ce New feature to extend columns, beams, and members to a target 2021-08-07 17:01:42 +10:00
Dion Moult cdd46066fa Fix bug where you couldn't use userdefined types for type elements 2021-08-07 14:20:07 +10:00
LaurensJN 10011436d0 Copyright statements for ifccityjson. See #1082 2021-08-06 15:47:47 +02:00
Dion Moult 00be87ff07 Fix bug where wall origin recalculations will shift openings 2021-08-06 22:25:32 +10:00
Dion Moult e22c68a842 Units for cost items are now autodetected 2021-08-06 18:19:41 +10:00
Dion Moult 07bf60819a Minor fix 2021-08-06 16:44:47 +10:00
Prabhat Singh 62c5efe591 Updated Server (#1630) 2021-08-06 15:50:05 +10:00
Dion Moult 05ef6542ef New utility to derive the unit of a property or quantity. 2021-08-06 15:48:07 +10:00
Dion Moult 326e7e591f You can now delete unit assignments 2021-08-06 14:11:08 +10:00
Dion Moult 4ccadc4f36 New unit utility to auto detect SI unit dimensional exponents 2021-08-06 12:38:34 +10:00
Dion Moult 7d087d2919 You can now view all assigned project units 2021-08-06 12:38:18 +10:00
Dion Moult 3b5bc531cb Fix bug where FM types for COBie were not selected properly 2021-08-06 11:43:57 +10:00
Dion Moult 47440edb8b Fix bug where undoing broke the IFC link for child objects 2021-08-06 10:26:18 +10:00
Dion Moult 0ee881fb32 You can now toggle whether decomposed elements are parented in blender when editing, so voids/fills etc move with you. 2021-08-05 21:14:18 +10:00
Dion Moult fee5d17f61 Fix builds to use name "blenderbim" instead of "blender28-bim" which now confuses people since 2.9 is out. 2021-08-05 14:02:11 +10:00
Dion Moult 94f0612752 WIP copyright statements. See #1082. Also IFCP6 is now IFC4D as we will expand into more 4D apps and widen the scope. 2021-08-05 13:21:55 +10:00
Thomas Krijnen b149f4f56d #1047 2021-08-04 18:24:47 +02:00
Dion Moult 00bf08c220 Walls are now dynamically voided when joining, so you can join/unjoin voided walls 2021-08-04 20:45:46 +10:00
Dion Moult 3bb3a8018a Fix bug where materials weren't created when importing assets from a library 2021-08-04 20:30:40 +10:00
Boris Brangeon d71e89f823 Update selector.py (#1627)
Add new inverse_relationship ==> boundedby

If Entity IfcRelSpaceBoundary exist then hasattr(element, "BoundedBy") is True and relationship.RelatedBuildingElement exist.

New Rule Lark :  "@@ .IfcSpace[Name *= \"Bedroom\"] & .IfcSlab"
2021-08-04 19:55:51 +10:00
Dion Moult 562b520233 Split BCF-API client and OpenCDE Foundation-API client system 2021-08-04 18:03:52 +10:00
Prabhat Singh 44f8255296 Added BCF Server (#1626) 2021-08-04 12:14:24 +10:00
Dion Moult 2c5442accc Fix #1124. Fix example and document quirk to prevent memory related bug. 2021-08-04 11:45:56 +10:00
Dion Moult 5cf07a910e Include licenses on IfcOpenShell sub-utilities. See #1082. 2021-08-04 10:51:31 +10:00
Dion Moult 4184cff1a0 Add sample docstring and type hints for IfcPatch recipe. 2021-08-04 09:33:33 +10:00
Gorgious 67740a5f79 Fix error due to trying to patch non-existent file 2021-08-03 20:30:30 +02:00
Dion Moult ecfe8c3799 IfcClash is now able to be built as an isolated Python binary. Hooray! 2021-08-03 22:44:46 +10:00
Dion Moult 7403d14001 Fix IfcPatch pyinstaller script to make it easier to distribute ifcpatch. 2021-08-03 22:35:40 +10:00
Gorgious 2b63698d7c Use module variables as dynamic enum containers
As explained in
https://devtalk.blender.org/t/can-bpy-props-be-used-for-dynamic-lists/10130/11
Dynamic enums can crash Blender if container is not set using
at least a module-level variable.
Using global keyword is not mandatory but may help debugging
2021-08-03 12:51:31 +02:00
Dion Moult e0cd74d0ad Fix #1338. Add documentation for how to use IfcClash. 2021-08-03 17:46:26 +10:00
Dion Moult 4fe427558f Minor fix. 2021-08-03 16:55:30 +10:00
Dion Moult b59a9f5264 Unbreak everything. 2021-08-03 16:09:43 +10:00
Dion Moult f25fb0db51 New hppfcl IfcClash packaged for the BlenderBIM Add-on. New MacOS support. See #1357. 2021-08-03 13:29:40 +10:00
Dion Moult bfaa89cdec Fix #1608. Fix warnings when no people or organisations existed. 2021-08-03 09:43:39 +10:00
Gorgious56 9625200a2a Improve Debug Panel UI (#1621)
* Inline parameters with their respective operator

* Restrict min number of polygons to 0

* Simplify high poly mesh operator execution

* Clear debug attributes when purging ifc

* Poll if ifc file exists in operators

* Poll if ifc filepath exists before import

* Delete leftover whitespaces
2021-08-03 09:08:35 +10:00
Gorgious56 5562c9d2b5 Fix error if no ifc file set (#1620)
* Fix error trying to access unset ifc file

* Return prematurely from operator if no file is set

* Revert "Return prematurely from operator if no file is set"

This reverts commit f876cfbcef.

* Revert "Fix error trying to access unset ifc file"

This reverts commit 6782c47d86.

* Prevent error message if ifc_types enum is empty

* Hide panel if no ifc file to avoid error
2021-08-03 09:07:56 +10:00
Gorgious56 7c0405fab0 Improve UI for multi input string fields (#1617)
* Add utility operator for CollectionProperty

* Support Multi input string fields

* Simplify people & organisation UI code

* General-purpose code cleanup

* Use more compact and user friendly UI
2021-08-03 09:07:19 +10:00
Dion Moult 557f8e6d69 New ifcopenshell.geom.tree based broadphase collision for IfcClash instead of aabbtree. Also, upgrades for new bcf.v2 namespace implemented. See #1357. 2021-08-02 20:32:31 +10:00
Chun 2137b34063 Add descriptions to IFC Search function (#1618)
* Added descriptions to IFC Search function

* change color to colour
2021-08-01 19:33:55 +10:00
Dion Moult 86a44c21ac WIP experimental hpp-fcl and aabbtree-based IfcClash 2021-08-01 10:51:11 +10:00
Long a427462646 GlobalId is string (#1615) 2021-07-31 12:39:05 +10:00
Gorgious56 b79d23b3e2 Hide panels with features unsupported in V2x3 (#1614) 2021-07-30 22:13:41 +10:00
Gorgious56 2af1ebc614 Use passed context instead of bpy when available (#1607) 2021-07-30 07:08:17 +10:00
Thomas Krijnen 0d49c89943 logical handling in python and small fixes 2021-07-29 16:32:45 +02:00
Thomas Krijnen 7c3fcc26f4 hierarchy helper ifc4 RepresentationContexts compatibility 2021-07-29 16:23:09 +02:00
Thomas Krijnen bb93545b35 actualize wrapper code 2021-07-29 15:15:51 +02:00
Thomas Krijnen 5a25f336c9 update .gitignore 2021-07-29 15:09:23 +02:00
Thomas Krijnen d1fe1117be adapt code for previous commits 2021-07-29 14:54:51 +02:00
Thomas Krijnen e529eeb540 require C++14 for string literals 2021-07-29 14:54:00 +02:00
Thomas Krijnen 995500e90b rerun codegen 2021-07-29 14:53:42 +02:00
Thomas Krijnen 2cd85234bd code generation changes boost::optional and tribool 2021-07-29 14:53:26 +02:00
Dion Moult d2e421382b Minor fix 2021-07-29 20:08:51 +10:00
Bruno Postle 7b22f9c85b BlenderBIM some data_dir / schema_dir workarounds (#1606)
* write process.log to a tempdir if data_dir is not writable

* Don't include filename returned by data_dir and schema_dir chooser
2021-07-29 20:07:04 +10:00
Gorgious56 e06591bbbd Prevent linking non-existant or non-ifc file (#1604) 2021-07-29 17:03:53 +10:00
Dion Moult 110daf4ca7 Fix #1592. Material name changes are now auto synced with style names. 2021-07-29 17:03:06 +10:00
Dion Moult 6bf692b44d Fix #1401. Modified custom psets are now immediately available without needing to restart Blender. 2021-07-29 16:16:01 +10:00
bosonprojets c257afbd1c Fix BlenderBIM bug Class assignement for predefined_type attribue 2021-07-29 00:28:04 +01:00
bosonprojets cdf18e9f20 Revert "Fix BlenderBIM bug class assignement when PredefinedType is set as USERDEFINED"
This reverts commit d1e51fb05b.
2021-07-29 00:24:38 +01:00
bosonprojets c715f41972 Fix BlenderBIM bug missing module reference for Pie Menu shortcuts 2021-07-28 23:37:06 +01:00
bosonprojets d1e51fb05b Fix BlenderBIM bug class assignement when PredefinedType is set as USERDEFINED 2021-07-28 15:27:51 +01:00
Gorgious56 99f72a8451 Fix Assign Container operator loses active object (#1601)
* Fix Assign Container operator loses active object

* Fix bad indentation for restoring active object
2021-07-28 21:40:23 +10:00
Dion Moult 2537349ec2 Object style colours are now auto synchronised upon export. See #1585. 2021-07-28 21:01:09 +10:00
Dion Moult 10b6253a36 Fix #1585. Materials are added as a potential if you assign it as an object material too, for convenience. 2021-07-28 19:55:18 +10:00
Dion Moult d88c4fd377 Fix #1597. Prevent mixing objects on project creation. 2021-07-28 18:43:20 +10:00
Dion Moult 0596e2000c New debug utility to purge all Blender IFC links. See #1599. 2021-07-28 18:21:05 +10:00
Dion Moult b685610900 Fix #1599. Bug where removing the last object in a container would have an error. 2021-07-28 18:21:05 +10:00
dedicos 5cab72deaa removed get_property in attributes_psets step file (not implemented yet) (#1596)
* removed get_property in attributes_psets step file (not implemented yet)

problem with stepmatcher remains

* Fix pattern search for properties
2021-07-28 17:51:16 +10:00
Dion Moult 52f15d27b1 Fix bug where import filters didn't properly exclude types and empty objects 2021-07-28 17:48:36 +10:00
Thomas Krijnen c694b5534a Work in progress on mapping templates 2021-07-27 15:46:38 +02:00
Dion Moult cfa0575263 Minor fix 2021-07-27 20:47:49 +10:00
Dion Moult f5e089e0fd Material based surface styles are now supported on import as a style fallback. See #1585. 2021-07-27 20:47:49 +10:00
Dion Moult 5d246a8716 Fix bug where module data was not purged correctly when a new scene was started 2021-07-27 20:47:49 +10:00
Dion Moult 1f241912f2 Make recipe name generic 2021-07-27 20:47:49 +10:00
Carmen Fan f7765c531b GeomIterator is not exposed for use if the library is built dynamically on windows (#1583) 2021-07-27 09:36:44 +02:00
Carmen Fan 3b401ec28f fix hash define logical operation 2021-07-27 09:36:16 +02:00
Dion Moult 77206cb761 Fix #1588. Profiles now auto recalculate cardinal points after editing. 2021-07-27 09:42:42 +10:00
Dion Moult f8e9f81b9b Parametric profiles now auto sync prior to depth changes. See #1588. 2021-07-26 21:13:15 +10:00
Dion Moult 186c4dd118 New experimental serialiser-based drawing generation code. See #1153. See #1564. 2021-07-26 20:24:39 +10:00
Dion Moult aa9b6b61fa Fix bug where material profile data was not purged since a profile module didn't exist. See #1588. 2021-07-26 09:45:46 +10:00
Dion Moult 6337d04efc IfcSverchok API node now actually executes API calls and has descriptive tooltips 2021-07-25 18:42:28 +10:00
Dion Moult c00bcc78e9 Editing voids or dumb walls now auto enable dynamic voids, so openings work well with them. 2021-07-25 14:06:49 +10:00
Dion Moult 07f19ad80a New patch to fix duplicate Revit types. See commit message for details.
Types in Revit are secretly duplicated (or more) if they are mirrored or hosted in another object unbeknownst to the user. So what the user thinks is a single construction type in Revit ends up being multiple IFC types. This leads to incorrect results when someone interrogates the IFC file. This is fundamentally an issue in the way Revit handles element mirroring and hosting, so there is no fix on the Revit side, so this workaround mitigates the issue by doing a shallow merge of the type objects.
2021-07-25 12:00:05 +10:00
Dion Moult 8ca6183313 Fix #169. New recipe to fix duplicate and invalid GlobalIds. 2021-07-25 11:39:11 +10:00
Ryan Schultz 492df6845b cleaned up list of hotkeys a bit (#1586) 2021-07-25 10:29:33 +10:00
Alexander Nitsch 43f8d8547d Bimtester: Fixed attributes_psets step files (#1580)
Co-authored-by: Nitsch Alexander <alexander.nitsch@scs.ch>
2021-07-25 09:57:59 +10:00
Thomas Krijnen 6e3c72707d submodule 2021-07-24 22:25:01 +02:00
Dion Moult 08d6c0a2d8 Openings are now auto dissolved when authoring for easier editing. 2021-07-24 22:08:50 +10:00
Dion Moult 8c1eff5c26 New workspace hotkey to toggle visibility of openings when authoring 2021-07-24 21:50:14 +10:00
Dion Moult fe3ffb7771 Openings are now placed in their own collection in case they accidentally get placed in the spatial tree 2021-07-24 21:35:27 +10:00
Thomas Krijnen 1375f25de9 #1564 typemap for optional string 2021-07-24 11:19:07 +02:00
Dion Moult 6660714308 New feature to add slab openings 2021-07-23 21:18:43 +10:00
Dion Moult 2420ad2fa7 New feature to add wall openings where your cursor is 2021-07-23 21:10:36 +10:00
Dion Moult 16fd06a4e9 Initial commit for half implemented IfcFM library to support new FM exchange requirements and related FM tasks. Initially just an IfcCOBie replacement but will grow. 2021-07-23 18:03:07 +10:00
Dion Moult beb5dda6dd New FM utility module for selecting maintainable assets according to different FM definitions 2021-07-23 16:10:38 +10:00
Dion Moult c04afe1a4b Minor fix. 2021-07-23 10:41:08 +10:00
Dion Moult d2a1e0193b Fix #1574. Fix #1578. Bug where deprecated functions were used in Python 3.9 for drawing generation. 2021-07-22 20:42:03 +10:00
Thomas Krijnen f2f4057c98 #1579 Fix attribute assignment to enum types 2021-07-22 11:48:27 +02:00
Thomas Krijnen 347aae9696 #1579 regenerate code 2021-07-22 11:48:02 +02:00
Thomas Krijnen 1a2d0d702b #1579 Update templates, thanks @RickBrice 2021-07-22 11:47:47 +02:00
Dion Moult e791449d3d Bump IfcOpenShell. See #1567. 2021-07-22 19:36:31 +10:00
Dion Moult 8071e079b3 New system module with UI to browse systems in an IFC. 2021-07-22 17:40:50 +10:00
Dion Moult 1c71af058f Fix bug where date conversions fail if IFC2X3 seconds have fractions 2021-07-22 13:22:23 +10:00
Dion Moult c4f3633ab8 Property and quantity sets are now shown in alphabetical order to be much less confusing. 2021-07-21 17:05:02 +10:00
Dion Moult c40fd91730 New feature where you can select related objects from an actively selected type. 2021-07-21 10:41:59 +10:00
Dion Moult a7252273b4 Fix bug where searching a GlobalId wouldn't work if you previously used the debug panel. 2021-07-21 10:41:29 +10:00
Dion Moult 6e0a443cca Fix bug where the covetool module didn't detect skylights properly. See #967. 2021-07-21 08:58:57 +10:00
Dion Moult 4574887709 Fix bug where editing multiple objects didn't synchronise changes when exporting. 2021-07-20 23:01:16 +10:00
Dion Moult f14d349be0 Fix bug where psets didn't show up for non element types like 2X3 door styles. 2021-07-20 09:50:46 +10:00
Dion Moult 023eb719f5 Added profiles of more specialised profile subtypes are now supported. 2021-07-19 21:35:20 +10:00
Dion Moult 8ba1b1c9b4 New script to generate a demo project asset library 2021-07-19 21:22:54 +10:00
Dion Moult 7cb163efef New print object placement debug feature 2021-07-19 20:16:47 +10:00
Dion Moult e68c57e9ef Fix bug where reused placements (e.g. from copied objects) were all updated which led to incorrect locations 2021-07-19 20:16:07 +10:00
Dion Moult 7d17b3170c New feature to select all of the active IFC element's class 2021-07-19 19:19:12 +10:00
Dion Moult a968f2b04d The BIM Tool can now create profiled members. 2021-07-18 17:20:16 +10:00
Dion Moult 9a14406f92 BIM tool can now add parametric profiles for beams, not just columns. 2021-07-18 14:48:30 +10:00
Dion Moult 32062e4085 Experimental WIP broken Sverchok API node. 2021-07-18 12:58:27 +10:00
Dion Moult 8da17cf4a0 New extract docs system to dynamically parse usecases. 2021-07-18 12:57:38 +10:00
Dion Moult 2d6e941c41 New documentation for project create_file usecase 2021-07-18 12:56:49 +10:00
Dion Moult 0fffbac519 Fix #1569. 2021-07-18 09:26:37 +10:00
Dion Moult db62faa5ae Fix #1570. 2021-07-18 09:21:38 +10:00
Dion Moult 02dc7b5274 The align tool now works on any generic product, not just walls. 2021-07-17 21:36:03 +10:00
Dion Moult 1bf136e93c Copying a spatial element now also automatically creates a new collection. See #1565. 2021-07-17 18:58:25 +10:00
Dion Moult cccab9e751 Minor fix. See #1567. 2021-07-17 18:38:04 +10:00
Thomas Krijnen 99e74533c3 #1567 Clear inverse cache map after entity insertion 2021-07-17 10:20:50 +02:00
Thomas Krijnen 0f39b09396 #1567 add instance after the values are set 2021-07-17 09:38:31 +02:00
Dion Moult ac2324a65f Minor fix 2021-07-17 17:28:27 +10:00
Thomas Krijnen ca85927a51 #1572 wrong serializer output temp name 2021-07-17 09:06:03 +02:00
Prabhat Singh e3786423c2 Update README.md (#1571) 2021-07-17 16:42:19 +10:00
Dion Moult 8d352ea07a Fix bug where editing a single material didn't quite work. 2021-07-17 09:13:37 +10:00
Dion Moult fd04066940 Minor fix 2021-07-15 18:21:18 +10:00
Dion Moult d34956c2c7 Add readme info on how to use new BCFAPI. Thanks TestPrab! 2021-07-15 18:02:16 +10:00
Prabhat Singh ad2585c571 Merge branch 'v0.6.0' of https://github.com/TestPrab/IfcOpenShell into prabhat_gsoc (#1566) 2021-07-15 17:41:24 +10:00
Dion Moult a08cf23d63 Fix #1562. Fix bug where all instances change meshes when changing type. 2021-07-14 09:37:29 +10:00
Dion Moult 37fe04ffd2 New recipe to downgrade indexed poly curves, often used to allow IFC4 grids to show up in viewers like Revizto / XBim Xplorer / etc. 2021-07-13 19:32:12 +10:00
Dion Moult 248b21eab3 Importing 2D elements of any arbitrary element is now supported 2021-07-13 18:58:30 +10:00
Thomas Krijnen 83049bf41a Update CMakeLists.txt 2021-07-13 10:52:45 +02:00
Dion Moult 63f578315d Add support for 3D curve / wireframe representations. 2021-07-13 18:45:07 +10:00
Dion Moult 19b6765994 Minor fix 2021-07-13 16:39:56 +10:00
Dion Moult 7456c270ff You can now extend a wall to your cursor location instead of another wall 2021-07-12 22:10:10 +10:00
Dion Moult b480b43435 BIM workspace tool is now no longer wall specific, and adapts to different element types 2021-07-12 17:34:35 +10:00
aothms b48ff530eb Tweaks to nix build and cmake 2021-07-11 19:15:20 +00:00
Thomas Krijnen b0993bb382 Update geom server 2021-07-11 15:20:06 +02:00
Thomas Krijnen b0e12023b8 conditionally install pdb 2021-07-11 15:12:27 +02:00
Thomas Krijnen 34fd959011 expose serializers in higher level module 2021-07-11 15:03:49 +02:00
Thomas Krijnen 985f4665d1 expose 2 serializers in python 2021-07-11 15:03:21 +02:00
Thomas Krijnen c949211e1b remove templates in wrapper 2021-07-11 15:03:05 +02:00
Thomas Krijnen 7c0459bc6e install pdb 2021-07-11 15:01:50 +02:00
Thomas Krijnen 975379a3a4 approach to pass stringstream to serializers 2021-07-11 15:01:31 +02:00
Thomas Krijnen eeaf04c6ea Remove templates on iterator and element 2021-07-11 15:00:59 +02:00
Thomas Krijnen ff73f82798 remove FASTER_BOOLEANS (to stay under 31 settings) 2021-07-11 14:57:49 +02:00
Thomas Krijnen 192f140960 Merge branch 'v0.7.0' of https://github.com/IfcOpenShell/IfcOpenShell into v0.7.0 2021-07-11 14:55:32 +02:00
Thomas Krijnen 38b4bb564e MSVC /MP 2021-07-11 14:55:27 +02:00
Thomas Krijnen d85b3dfba0 ifc max default to off 2021-07-11 11:03:51 +02:00
Thomas Krijnen f032378ca7 no double/float parametrization anymore 2021-07-11 11:03:35 +02:00
Thomas Krijnen a727f81844 Update ci.yml 2021-07-11 09:29:23 +02:00
Thomas Krijnen 2ede620068 Update release.yml 2021-07-11 09:29:19 +02:00
Dion Moult 3614587556 Fix #1558. New loading bar when importing an IFC. 2021-07-11 10:29:19 +10:00
Dion Moult 86ce367ba8 Fix #1561. 2021-07-11 09:28:22 +10:00
Thomas Krijnen 436bcd078f Merge remote-tracking branch 'origin/v0.6.0' into v0.7.0 2021-07-10 21:59:06 +02:00
Thomas Krijnen c7c9ebe61a Remove build-deps shortcurt 2021-07-10 21:57:40 +02:00
Thomas Krijnen e7786e83b7 Update CMakeLists.txt 2021-07-10 21:47:51 +02:00
Thomas Krijnen d320c1dac1 Some quick and dirty #1560 2021-07-10 21:43:27 +02:00
Thomas Krijnen 88af0e569a Update .travis.yml 2021-07-10 21:39:27 +02:00
Thomas Krijnen a762c980b9 Update CMakeLists.txt 2021-07-10 21:39:09 +02:00
Thomas Krijnen 5db7f52e03 Merge branch 'v0.6.0' into v0.7.0 2021-07-10 21:21:22 +02:00
Thomas Krijnen 9776cd2c99 Update .travis.yml 2021-07-10 21:19:45 +02:00
Thomas Krijnen 25f2ef8cf1 Merge branch 'v0.7.0' of https://github.com/IfcOpenShell/IfcOpenShell into v0.7.0 2021-07-10 21:16:45 +02:00
aothms 2fe0ec061a Fixes for windows build 2021-07-10 21:15:39 +02:00
Thomas Krijnen cf48661a35 limit schema versions on Travis 2021-07-10 21:10:03 +02:00
Thomas Krijnen 5e03846783 Update .travis.yml 2021-07-10 17:17:47 +02:00
Thomas Krijnen 316e0eda2f Update .travis.yml 2021-07-10 17:06:47 +02:00
Thomas Krijnen a92ade7835 Merge branch 'v0.6.0' into v0.7.0 2021-07-10 16:55:57 +02:00
Thomas Krijnen acddbfd18c Update .travis.yml 2021-07-10 16:08:23 +02:00
Thomas Krijnen 791f57072e Update .travis.yml 2021-07-10 16:05:32 +02:00
Thomas Krijnen 078f7b3dae Update .travis.yml 2021-07-10 15:58:54 +02:00
Rick Brice c02f270993 Adds support for 4x3 rc3 and rc4 for IfcParser library 2021-07-10 15:38:34 +02:00
Rick Brice a73178fe3e Adds ignore settings for vs2015 and vs2019 2021-07-10 15:38:34 +02:00
Thomas Krijnen 24808ced60 Merge pull request #1530 from atomczak/GSoC#45-IDS-checking
IDS - xmlschema, restrictions and requirements
2021-07-10 15:35:08 +02:00
Dion Moult 1d523c9636 Implement assigning material definition representation styles 2021-07-10 22:06:11 +10:00
Dion Moult 6ccb208345 Fix #1557. Surface style attributes can now be explicitly edited. 2021-07-10 12:34:25 +10:00
Dion Moult af0f0a4f6c Implement support for removing styles. See #1557. 2021-07-10 11:43:01 +10:00
Dion Moult edd737aa5d Minor fix 2021-07-10 10:32:34 +10:00
ArturTomczak 5d8f71128e add tests for parsing and authoring 2021-07-09 08:44:36 +02:00
ArturTomczak 1ea4f50d30 fix facet constructors 2021-07-09 08:35:04 +02:00
ArturTomczak 93fad2a5c3 add ids constructor, fix ids bug 2021-07-08 18:14:49 +02:00
ArturTomczak 30a03b0c51 add facet creation methods 2021-07-08 18:12:55 +02:00
ArturTomczak b0bb2cb58d add ids.to_xml() 2021-07-08 18:09:32 +02:00
ArturTomczak 3837c9d6ff add methods to specification class 2021-07-08 18:09:02 +02:00
ArturTomczak d189113b98 add asdict() to all ids classes 2021-07-08 18:06:07 +02:00
ArturTomczak 6dba96e780 add location_msg as separate param 2021-07-08 18:04:50 +02:00
ArturTomczak c2bdfa9394 fix imports and move ids_schema outside 2021-07-08 18:00:33 +02:00
Dion Moult 519a53dc61 Fix #1554. Changing Blender material name now auto updates both IFC material name and surface style name 2021-07-08 18:59:40 +10:00
Dion Moult 21c4433c75 Allow setting to toggle cascading of edited object placements 2021-07-08 18:00:41 +10:00
Dion Moult 0e24d4411f Fix #1556. Ensure that styles are always present when updating a representation. 2021-07-08 13:02:30 +10:00
Dion Moult cb6837b0ac Add Windows install docs for BlenderBIM for devs 2021-07-07 16:10:47 +10:00
Kai Zhu 5ec7f65df5 Update source installation for windows docs (#1555)
Added docs for Windows mklink syntax.
2021-07-07 16:03:11 +10:00
Dion Moult db04cc1bb5 Implement partial undo for BCF operators. Note that undo is not supported in BCF lib itself, nor BCF API. See #1475. 2021-07-07 11:57:07 +10:00
Dion Moult 1f128fd7e4 Minor BCF fix 2021-07-07 11:44:16 +10:00
bosonprojets 56633b8126 Implement undo for Costing, Sequencing, and Resources 2021-07-07 02:01:19 +01:00
Dion Moult 6706ad9bd5 Implement undo for augin, bimtester, clash, cobie, and covetool operators. See #1475. 2021-07-07 10:40:07 +10:00
Dion Moult fb6c670aa6 Fix colour by undo operators in search module. See #1475. 2021-07-07 10:25:19 +10:00
Dion Moult a87637163a Fix #1553. Bug where reloading an IFC file didn't refresh the ID map without needing to restart. 2021-07-07 09:55:42 +10:00
Jesusbill 4bc5a3ba46 small bug fix from 75d67cd719 2021-07-06 16:02:14 +02:00
Jesusbill 866df1f040 implement undo for "search" module, may need improvement for some operators #1475 2021-07-06 12:19:45 +02:00
Jesusbill 2fa2fddf46 implement undo for "owner" module, may need improvement for some operators #1475 2021-07-06 12:19:27 +02:00
Jesusbill 1aeae0bf4d use import_attributes from helper for #1549 2021-07-06 12:17:59 +02:00
Jesusbill 6a2c4aee46 implement undo for 'patch' module #1475 2021-07-06 12:15:45 +02:00
Dion Moult 5cfbcf211b Minor fix 2021-07-06 18:17:34 +10:00
Dion Moult 3dcd10b478 Implement undo in debug and diff operators. 2021-07-06 16:03:27 +10:00
Dion Moult c687e9af05 Implement undo for model operators. See #1475. 2021-07-06 15:47:53 +10:00
Dion Moult b10c228155 Implement undo for drawing operators. See #1475. 2021-07-06 15:17:55 +10:00
Dion Moult b1d731447a Implement undo for non-module operators. See #1475. 2021-07-06 15:06:21 +10:00
Dion Moult 32e7083e21 Implement undo for pset template operators. See #1475. 2021-07-06 14:21:02 +10:00
Dion Moult 597b5ffbd6 Minor fix 2021-07-06 12:33:05 +10:00
Dion Moult f7e550b926 Add documentation on georeferencing 2021-07-06 12:20:22 +10:00
Dion Moult 75d67cd719 Fix #1551. Support mixed geolocation workarounds of both object placement and cartesian point. 2021-07-06 12:20:04 +10:00
ArturTomczak 41a47f14ae add basic parsing tests 2021-07-05 13:21:36 +02:00
Dion Moult cca28231ee Implement undo for material operators. See #1475. 2021-07-05 18:59:10 +10:00
s-leger d7b3a1d95a Delete OCC.pth (#1550)
Remove no more needed OCC.pth (setup OCC as module)
2021-07-05 18:35:50 +10:00
Dion Moult 30ba45f6cb Implement undo for pset operators. See #1475. 2021-07-05 17:09:04 +10:00
Dion Moult d832c9780a Implement undo for qto operators. See #1475. 2021-07-05 16:51:26 +10:00
Dion Moult 7f3b7f4e21 Implement undo for georeference operators. See #1475. 2021-07-05 16:42:38 +10:00
Dion Moult dc7dea21ce Implement undo for spatial operators. See #1475. 2021-07-05 16:36:33 +10:00
Dion Moult d6a9b73657 Minor fix. 2021-07-05 16:35:13 +10:00
Dion Moult 97cd919a7b Improve undo redo object linking robustness. See #1475. 2021-07-05 15:59:26 +10:00
Dion Moult 41bc109556 Implement undo for type, unit, and void operators. See #1475. 2021-07-05 15:03:50 +10:00
Dion Moult 4f5d4def1e Implement batch transaction support. See #1475. 2021-07-05 14:16:19 +10:00
Jesusbill 3a24f03bed black formatting 2021-07-05 02:31:13 +02:00
Jesusbill f3ed96846e bug fix in constraint module, see #1549 2021-07-05 02:27:56 +02:00
Jesusbill cbe8165e08 add undo for "document" module #1475 2021-07-05 02:21:10 +02:00
Jesusbill 6a7a122de2 add undo for "csv" module #1475 2021-07-05 02:20:54 +02:00
Jesusbill e44db61fbd add undo for "classification" module #1475 2021-07-05 02:20:24 +02:00
Dion Moult 72b60e85d4 Minor fix 2021-07-05 09:01:10 +10:00
Dion Moult c48263ade9 Add installation instructions for IfcSverchok 2021-07-05 09:00:21 +10:00
Jesusbill 5ec081c6bc add undo for "contraint" module #1475 2021-07-04 18:33:35 +02:00
Jesusbill cc3f94097c add undo for "layer" module #1475 2021-07-04 18:32:29 +02:00
Dion Moult 253d478fdc Implement undo for style module operators. See #1475. 2021-07-04 20:28:21 +10:00
Dion Moult 549bc0e1a9 Minor fix. See #1475. 2021-07-04 20:22:20 +10:00
Dion Moult 9286de4813 Minor fix. See #1547. 2021-07-04 19:57:09 +10:00
Dion Moult b8015644e9 Implement undo for context and geometry operators. See #1475. 2021-07-04 19:45:34 +10:00
Dion Moult 8a917dc050 Fix #1529. Properly represent Blender materials as 1:1 mappings to surface styles, with support for material definition representation. 2021-07-04 12:38:41 +10:00
Dion Moult 68b6389794 Fix #1547. 2021-07-04 09:54:49 +10:00
Dion Moult 85bd616f6e Minor fix 2021-07-03 18:46:17 +10:00
Dion Moult 4ff60553cc Fix bug with inability to refresh token in bsdd api. Thanks TestPrab! 2021-07-03 17:45:29 +10:00
Dion Moult dcd6cace03 Fix bug in IfcSverchok nodes where refresh buttons didn't work 2021-07-03 14:34:15 +10:00
Dion Moult b7cfa53b4d IfcSverchok by_type node now updates to be schema dependent on the input file 2021-07-03 14:33:47 +10:00
Dion Moult e0048f7a3c Minor fix 2021-07-03 10:41:06 +10:00
Jesusbill a8dcb2f306 undo for structural - wip 2021-07-03 02:08:31 +02:00
Dion Moult a8f0a4807c Add undo support for group module operators 2021-07-03 10:03:27 +10:00
Dion Moult d5539399e8 New print IFC file debug operator 2021-07-03 10:02:26 +10:00
ArturTomczak ad8542f244 add unittest init 2021-07-02 17:27:09 +02:00
Dion Moult eb89308019 Minor fix 2021-07-02 19:16:55 +10:00
Dion Moult e7e7b22fd5 Implement undo support for all root operations. Clean up implementation, making passing transaction keys unnecessary. See #1475. 2021-07-02 19:10:51 +10:00
Dion Moult b4a422c2b8 New add application usecase, improved add_classification usecase and better defaults for owner settings. Thanks johltn 2021-07-02 16:30:57 +10:00
Carmen Fan 30f778e0a7 restore other schema versions 2021-07-01 20:42:45 +02:00
Carmen Fan 2032b361c8 fix spelling 2021-07-01 20:42:45 +02:00
Carmen Fan 529b3a9867 add necessary export definitions , add IFCParse as a dependency to IfcGeom build 2021-07-01 20:42:45 +02:00
Dion Moult cac8c64ac8 Document undo system 2021-07-01 21:05:26 +10:00
Dion Moult 3847c9bd7a Implement undo for aggregate operations, with automatic element-obj link undo/redo and improved undo syntax. See #1475. 2021-07-01 20:43:33 +10:00
Thomas Krijnen ffbaa6f0e0 #1537 implement schema enum cast 2021-07-01 11:13:50 +02:00
Thomas Krijnen b5c3812849 Missing change for 6ecedaa128 2021-07-01 11:09:15 +02:00
Dion Moult 30ad915649 Minor fix 2021-07-01 11:59:25 +10:00
Dion Moult c2cf3e8639 Minor fix 2021-07-01 11:53:56 +10:00
Dion Moult c1527b4199 Document module architecture 2021-07-01 11:53:00 +10:00
Dion Moult a1032a3bf0 Describe IfcOpenShell python architecture in the developer guide 2021-07-01 11:17:59 +10:00
Dion Moult 733b7c0e1e Add basic documentation for developer guide 2021-07-01 09:55:59 +10:00
Dion Moult 6b0a58db7d Experimental undo and redo Python prototype (#1539)
* Experimental undo and redo Python prototype

* Simplify history, use transaction jargon, use walk for more robust serialisation

* Black file, set history size, add file reference to entity_instance constructor

* Ensure that files are always passed when entities are wrapped

* Add support for undo/redo of all project module operations

* Minor fix

* Blender to IFC mappings are now managed by Blender RNA, so they don't break on undo operations. See #1475.

* Implement undo for all attribute operations. See #1475.

* Update documentation for installation of add-on

* Revert Blender RNA approach for Blender-IFC mappings, because it didn't scale, but still fix the undo/redo object memory corruption with new "reload_linked_elements" method.
2021-06-30 18:34:12 +10:00
Thomas Krijnen 10bf875e92 Remove wrong and unnecessary shape cast in derived profile 2021-06-27 20:29:47 +02:00
Thomas Krijnen 2fd2b49709 #1539 Option to specify id/instance_name in file::add() 2021-06-27 11:14:26 +02:00
Dion Moult 37a61c549f Accommmodate incorrect body representation contexts coming from Revit 2021-06-27 11:00:20 +10:00
Thomas Krijnen da10a1060e #1475 IfcFile::recalculate_id_counter() 2021-06-26 13:23:55 +02:00
Dion Moult ebfb29d6da Fix #1538. Bug when absolute coordinates are detected from a coordinate list. 2021-06-26 17:09:44 +10:00
Dion Moult 6e4e6a88a4 Add support for parametric updating of cardinal points 1-9 for profile set usages 2021-06-25 17:25:26 +10:00
Dion Moult 312de694b6 Task trees can now be sorted by any attribute independent of the WBS 2021-06-23 18:17:39 +10:00
Dion Moult 788a5a829e Tasks now auto generate identification numbers 2021-06-23 14:13:18 +10:00
Dion Moult a4391df9ca Wall tool now rebranded as BIM tool with a new icon thanks to s-leger! 2021-06-23 11:25:05 +10:00
Dion Moult 1071ac00d4 Fix validation errors in IFC2X3 with missing ownership and mandatory attributes 2021-06-23 10:35:25 +10:00
Thomas Krijnen 6ecedaa128 tree select(gp_Pnt) also with extend 2021-06-22 15:46:21 +02:00
blocovin 8f154c753c Fix xml double value is rounded #1533 2021-06-22 15:12:36 +02:00
Dion Moult e863015e85 You can now customise the data columns shown in the work task tree 2021-06-22 19:32:59 +10:00
Dion Moult 2c49b3bde8 MSProject XML to IFC conversion now supports blank IFCs or non-existent work plans 2021-06-22 13:22:48 +10:00
ArturTomczak eaa527f512 include location (type/inst/any) 2021-06-21 17:48:27 +02:00
ArturTomczak 99f0e6c93e add regex pattern validation 2021-06-21 15:23:03 +02:00
ArturTomczak f27fbecc9a Merge branch 'v0.6.0' into GSoC#45-IDS-checking 2021-06-21 08:48:46 +02:00
Dion Moult 650ebeddd6 Column profiles now update when switching type 2021-06-21 14:44:42 +10:00
Dion Moult 5d0d3aaa16 Minor fix 2021-06-21 14:13:25 +10:00
Dion Moult 54526960c8 Column profiles now auto update when you change the material profile 2021-06-21 12:21:55 +10:00
Jesusbill e0b93a70d3 black formatting 2021-06-20 20:58:36 +02:00
Jesusbill e569b97c56 Add general CRUD operations for boundary conditions (from scene properties) 2021-06-20 20:57:12 +02:00
Jesusbill a0b7fe2736 you can now filter structural loads based on name and inverse references 2021-06-20 20:53:45 +02:00
ArturTomczak 3b270a61df handle ifc2x3 and 4
handles .ItemReference or .Identification
2021-06-19 11:44:33 +02:00
ArturTomczak 5b94043cdc ids parse, restrictions
change __init__ to parse for separating those two
2021-06-18 16:50:26 +02:00
Dion Moult aadb28bb79 Fix #1456. Improve usability when a project library only has a single class type in it. 2021-06-18 16:05:58 +10:00
Dion Moult 2f1f332d31 Fix #1522. Appending from project libraries now supports material properties and styles. 2021-06-18 15:54:01 +10:00
Dion Moult 1ee2f420c8 New feature to see derived global and local elevations 2021-06-18 14:19:53 +10:00
Dion Moult 567bc7b667 Fix confusing transparency attribute in add style API usecase. See #1529. 2021-06-18 08:03:44 +10:00
Dion Moult 2a2f4d692a Fix bug where extrusion detection on voided profiles was not reliable 2021-06-17 19:24:16 +10:00
Dion Moult 1b49a10a15 Minor fix, bump readme 2021-06-17 18:30:25 +10:00
Dion Moult a08918fd22 Scheduled dates now cascade when dependencies, lag times, and calendars are modified 2021-06-17 14:59:28 +10:00
Dion Moult 50608d9459 Modifications to scheduled dates can now cascade through the task tree 2021-06-17 13:23:09 +10:00
Dion Moult 97d0286b57 Uncached schedule recalculation is now twice as fast 2021-06-17 11:05:58 +10:00
Cyril Waechter 2a7fbea9c3 Add recipe to extract only spaces (#1521)
`ExtractElements` was not allowing to extract only spaces.
It also helps to workaround revit-ifc failure in linking spaces.
See: https://github.com/Autodesk/revit-ifc/issues/15
2021-06-17 10:31:18 +10:00
Dion Moult 257997c2cb New feature to copy elements to multiple spatial containers 2021-06-16 09:21:44 +10:00
Dion Moult 2dfc35877c Generated construction animations now support animating input product consumptions, movement to/from, and multiple processes per product 2021-06-15 21:22:28 +10:00
Dion Moult 68233a8fb2 Add support for product inputs into tasks, such as for movements on site 2021-06-15 20:55:43 +10:00
Dion Moult 76e2f688e5 Level of Effort activities are now excluded from P6 import to IFC. 2021-06-15 18:28:43 +10:00
Dion Moult 4d4bedcf9a Fix #1526. Fix bug where custom pset template properties wouldn't show up. 2021-06-15 17:48:45 +10:00
Dion Moult 36a18ea0f9 You can now bulk copy task attributes to other tasks in the task tree 2021-06-15 17:29:04 +10:00
Dion Moult fa1984e89e You can now animate demolition, logistic, and renovation type processes during construction sequencing 2021-06-15 16:35:40 +10:00
Dion Moult 3be0a74316 Minor UI fix for unreadable "derived grid north" in geolocation panel 2021-06-15 15:15:49 +10:00
Dion Moult 90cb56220f Fix #1524. Fixed bug where unlinking copied Blender objects didn't work. 2021-06-15 13:05:24 +10:00
ArturTomczak 8fd4965106 add length restriction
both length and min/maxlength added
2021-06-12 22:35:37 +02:00
ArturTomczak ba26772e46 add bounds restriction 2021-06-12 21:10:50 +02:00
ArturTomczak 7e02eb923d add bounds restriction 2021-06-12 21:10:09 +02:00
ArturTomczak 459149e418 add enumeration restriction 2021-06-12 18:08:13 +02:00
ArturTomczak 768606571e fix multiple requirements at a time 2021-06-11 19:03:03 +02:00
ArturTomczak 65fa5768f2 implement material facet
added actual evaluation and extended current implementation with all possible ifc relations for materials.
2021-06-11 17:10:54 +02:00
ArturTomczak 9db01bc6cc implement classification facet 2021-06-10 15:21:51 +02:00
ArturTomczak 4e60ca01c3 improve feedback message
added counters and runtime info
2021-06-10 15:21:07 +02:00
ArturTomczak 8c9ab98697 switch from dom to xmlschema
as suggested by @Moult, xmlschema better fits the purpose than xml.dom.minidom
2021-06-10 15:19:23 +02:00
Dion Moult fc05bdf6d6 Support importing elements with no representations 2021-06-10 11:17:49 +10:00
Dion Moult 4c50b2d224 Support editing profile set usage attributes cardinal point and reference extent. Thanks Jesusbill! 2021-06-09 11:23:34 +10:00
ArturTomczak 4017097f19 Add xmlschema validation 2021-06-08 10:34:02 +02:00
Dion Moult b9472c9bae Implement free float calculation. Thanks SigmaDimensions! 2021-06-08 11:36:07 +10:00
Dion Moult 7d841c3f27 New dumb column tool. Creates a parametric solid column from profile sets. 2021-06-07 19:43:02 +10:00
Dion Moult ca0dac1353 The authoring UI now only shows available types so you don't waste your time checking what's available. 2021-06-07 16:09:56 +10:00
Dion Moult 1a962a7f60 Dumb slabs now auto calculate new quantities when edited 2021-06-07 15:58:03 +10:00
Dion Moult f3c1d1df31 Fix bug where you couldn't delete a quantity from a quantity set 2021-06-07 15:52:38 +10:00
Dion Moult 6a0562d00a Footprint and side areas are now generated for dumb wall quantities 2021-06-07 14:44:05 +10:00
Dion Moult 137a00225c Dumb slabs now auto generate footprint representations 2021-06-07 14:28:46 +10:00
Dion Moult 5a822d5e39 Slabs with voided profiles are now supported. 2021-06-07 11:20:05 +10:00
Dion Moult d844223367 Fix bug where P6 import module was not shipped 2021-06-07 10:32:26 +10:00
Dion Moult 6a29ab0d61 Fix bug where 2D or 1D objects generated an invalid box representation 2021-06-07 10:32:05 +10:00
Dion Moult e9c7b21bfc Fix bug where all meshes were cast to a solid by accident. Thanks s-leger! 2021-06-07 10:31:27 +10:00
Dion Moult ed316ba691 Fix #1382. You can now search property values agnostic of pset names. Thanks stefkeB! 2021-06-06 20:55:25 +10:00
Dion Moult cfd5742b5b Fix unnecessary error message when getting psets. 2021-06-06 20:54:40 +10:00
Dion Moult feac601340 Fix #1513. Materials now are included when importing types from a project library. 2021-06-06 10:05:24 +10:00
Dion Moult a8dc734351 Fix bugs where adding types without a material was broken. See #1513. 2021-06-06 09:57:50 +10:00
Dion Moult e0cbbf2eb7 Minor fixes to slab/wall syncing and stability in changing thicknesses. 2021-06-05 19:48:04 +10:00
Dion Moult 082ee3c95d Fix #1511. Prevent double registration of listener callbacks, and simplify listeners. 2021-06-05 19:48:04 +10:00
Thomas Krijnen ece6e6c8ca #1480 continued 2021-06-05 09:49:19 +02:00
Dion Moult 5c1d26ac91 Dumb walls and slabs now are always exported as parametric solids instead of meshes. 2021-06-04 17:30:37 +10:00
Dion Moult 153b6ee24d Total float calculation now takes into account calendar 2021-06-04 17:22:35 +10:00
Dion Moult 8b3b1eeb8e Fix #1510. Whoops :) 2021-06-04 15:29:14 +10:00
Dion Moult 8e279ea862 Improved date calculations during import and editing ensure that start / finish dates are always on working days. 2021-06-04 15:21:48 +10:00
Dion Moult 6f8861c030 ES, EF, LS, LF calculations in work schedules now are calendar based. Thanks SigmaDimensions! 2021-06-04 15:20:38 +10:00
Dion Moult 2ac6fe9eef Rewrite schedule calculation to be much faster and scale up to huge schedules. 2021-06-03 13:40:18 +10:00
Dion Moult 8338cc72db New styles on sequencing gantt chart to show dependency arrows, critical path, task groups, and milestones 2021-06-02 17:31:55 +10:00
Dion Moult 67b636f5fb New API usecase to recalculate schedule times, including:
* Critical path
* Total float
* Early start
* Early finish
* Late start
* Late finish
2021-06-02 17:30:05 +10:00
Jesusbill 3a754c8ecc fix of the fix n add_pset 2021-06-01 16:33:47 +02:00
Dion Moult d64d7cf27a Dumb slabs now roundtrip the Blender solidify modifier 2021-05-31 17:43:42 +10:00
Dion Moult 6ff4c95ac7 Dumb slabs now auto update thickness based on layer thickness and type changes. 2021-05-31 15:27:22 +10:00
Dion Moult 0b6af5f848 Experimental usecase serialisation function, in preparation for client-server systems and version control. 2021-05-31 14:18:24 +10:00
Dion Moult 3ded4dff5f Parametric engine is now registered on load, so you don't need to manually activate it 2021-05-31 14:17:33 +10:00
Dion Moult 452631b997 Updating either a duration, start, or finish date for a task now auto-updates the other attribute 2021-05-31 12:42:02 +10:00
Dion Moult c041dd13ad Fix bug where users saw a scary error message when exporting with no IFC data 2021-05-31 09:19:04 +10:00
Jesusbill 994ccb94f4 fix bug in adding psets for materials 2021-05-30 13:32:59 +02:00
Dion Moult c7ba643ef7 Fix material unassignment greedy purging bug, and auto assign usages of typed layer / profile sets. 2021-05-30 21:03:50 +10:00
Dion Moult 0b6f3113a7 Changing types of a dumb wall now auto updates their wall thicknesses 2021-05-30 21:03:50 +10:00
s-leger 730efcae49 Bugfix Set changed size during iteration (#1506)
Fix for remove  RuntimeError: Set changed size during iteration
Add docstring
2021-05-29 22:03:00 +10:00
Dion Moult 62b297757e Dumb slabs now are marked as parametric and inherit thickness from the slab type 2021-05-29 14:59:02 +10:00
s-leger 0533a00631 Allow global listeners (#1500)
* Allow global listeners

Add "global" listeners when ifc_file is None, listeners are run whatever the file.
This way allow to register listeners before a file exists, and "global" listeners.

Add listener returns the ifc_key
Remove listeners allow optional filtering by usecase_path / ifc_key.usecase_path.

* Update __init__.py

Fix was only removing the first listener found.
2021-05-29 09:06:38 +10:00
Dion Moult 7fe2e93dea Fix #1491. Bug where drawings couldn't have a slash in their names. 2021-05-28 17:26:00 +10:00
Dion Moult acc9bd736f Fix #1048. Switching drawings now works when in local view. 2021-05-28 16:09:42 +10:00
Dion Moult 478612b6ae Fix #976. Bug where project data dir was not very customisable without running into issues. 2021-05-28 15:58:19 +10:00
Dion Moult a24d683613 Fix #1396. New walls are selected when created. 2021-05-28 14:50:36 +10:00
Dion Moult 0b5d7cdbf3 Fix #1455. Bump IfcOpenShell. 2021-05-28 14:36:48 +10:00
Dion Moult b8e20ec1a5 Reimplement raster underlays when generating drawings. See #1153. 2021-05-28 14:33:46 +10:00
Dion Moult 1cd243f13c Fix #1462. Standardise IfcOpenShell API to use Pythonic argument names. 2021-05-28 10:59:39 +10:00
s-leger 0a2adbb632 Implement remove pre / pos / all listeners (#1498)
Remove listeners, passing callback method.
Will not handle file pre_load cleanup / post_load setup here to prevent any blender's dependancy.
2021-05-28 10:07:56 +10:00
Dion Moult 8882c99455 Implement editing IFC header metadata. See #747. 2021-05-28 09:50:55 +10:00
Dion Moult 7890ded698 Fix #1429. MVDs now reflect the full DesignTransferView by default. 2021-05-28 09:49:57 +10:00
bosonprojets 7d2d9b2bcf purging of cost and task inverse relationships in ifcopenshell.api, and amendement to cost item values editing UX in BlenderBIM 2021-05-28 00:24:01 +01:00
s-leger 75ae501ff9 Evaluate coplanar vertex in faces (#1489)
The idea is to only triangulate non co-planar faces when required.

Timings for evaluation with matrix based algo.
IfcRoof/Roof found 3927 of 116178 polygons: 0.366638 sec
IfcWall/Wall.012 found 0 of 6 polygons: 0.000046 sec

So should be acceptable for common use cases
But with single precision in blender we may still be over occ precision with a 1e-6 epsilon.
2021-05-28 08:57:22 +10:00
luz paz 880fbe9533 Fix misc. source comment typos
Found via `codespell`
2021-05-27 09:40:06 +02:00
Dion Moult c2684f4fbf New split wall tool 2021-05-27 16:33:34 +10:00
Dion Moult afdc1e6679 New feature to export point lights (IfcLightSourcePositional) into IFC 2021-05-27 13:55:44 +10:00
Dion Moult 8935a17844 Really barebones UI to list space boundaries. 2021-05-27 13:54:18 +10:00
Dion Moult 93c59e81c6 Minor code review for BCF XML 3.0 implementation with TestPrab 2021-05-26 18:00:21 +10:00
Dion Moult d423274e62 New wall flip tool with hotkey. Wall aligner now allows flipped walls. 2021-05-26 17:20:34 +10:00
Dion Moult 7958dd837b New wall tool with hotkeys for rapid wall editing 2021-05-26 15:45:45 +10:00
Long e42a638220 implement DatePicker, visualisation time demo (#1488) 2021-05-26 14:59:20 +10:00
Dion Moult f5f314a58f Dumb walls now auto update thicknesses if the wall layer thickness changes 2021-05-26 11:36:06 +10:00
Dion Moult 96465bed8f Code review for BCFXML v3 Markup.xsd implementation with TestPrab 2021-05-25 18:44:11 +10:00
Prabhat Singh 41bdeea981 Added Script for V3 bcfxml (#1486)
* Added Module Loader

* Added Project and Version script for v3

* Cleaning the code

* optional fix

* Added markup.xsd in v3 bcfxml

* Completed Vision.xsd and Markup.xsd

Co-authored-by: Dion Moult <dion@thinkmoult.com>
2021-05-25 17:22:01 +10:00
Dion Moult 14e0910e59 Purge old dumb wall. Bye bye! 2021-05-25 13:39:55 +10:00
Dion Moult e0ba1c2183 Total layer set thickness is now calculated and shown in the UI 2021-05-25 13:25:05 +10:00
Dion Moult a13b71abf0 Layer set usages now inherit layer sets from the type. Walls now support material layer set usages. Also minor fixes, thanks s-leger! 2021-05-25 13:10:26 +10:00
Dion Moult 32fb359ee2 Copying objects in Blender now auto copy them in IFC too. See #1360. Thanks s-leger! 2021-05-25 11:07:56 +10:00
s-leger 61661fe6f3 implement missing create curve 2d method (#1484) 2021-05-24 23:14:26 +10:00
Dion Moult 92054b1999 Fix bug where objects created with the same name fail to sync geometry on export 2021-05-24 21:22:50 +10:00
Dion Moult 22d9bce591 Dumb walls now automatically generate wall axis upon update 2021-05-24 20:56:47 +10:00
Dion Moult bfe9213f67 Dumb walls now auto calculate length, width, height, and simple volume quantities when being updated 2021-05-24 19:28:47 +10:00
Dion Moult 1abf854f01 New formwork area calculation feature 2021-05-24 18:56:20 +10:00
Dion Moult 686b2a187d New wall align tool (align exterior, interior, or centerline) 2021-05-24 17:29:32 +10:00
Dion Moult 7c2764c98a General bugfix and stability improvements to WIP wall join tool 2021-05-24 17:03:55 +10:00
Dion Moult f73a3a8f79 Fix bug where you were unable to delete certain objects. See #1483. 2021-05-24 13:51:51 +10:00
s-leger b9723c08e4 Ensure polygons are always coplanar (#1482)
* Ensure polygons are always coplanar

fix #1481
May adopt a bmesh approach instead ?

* Ensure polygons are coplanar

The bmesh version is lot faster than modifier one
2021-05-24 08:19:39 +10:00
Thomas Krijnen 1e80e67df5 #1472 various considerations for handling of non-manifold elements with openings 2021-05-23 16:26:34 +02:00
Thomas Krijnen 3e8c10b775 first rough partial draft of alignment handling in python 2021-05-23 09:48:47 +02:00
Thomas Krijnen fd9f209a19 Additional validity check with log level debug 2021-05-23 09:36:31 +02:00
Dion Moult 6b72f7322b Creating walls from cursor now auto-align perpendicular to the wall the cursor is at 2021-05-23 11:48:20 +10:00
Dion Moult 9b0d9c1f91 Stroke-generated walls now auto-join likely butt joints and t-junctions 2021-05-23 11:09:56 +10:00
Dion Moult 26b699be7c You can now join walls in bulk 2021-05-23 10:56:34 +10:00
Dion Moult 294eba24c4 You can now unjoin walls 2021-05-23 09:32:39 +10:00
Dion Moult 09094c090c New sketch wall tool, and join wall tool (T-junction, butt joint, and mitre joints) 2021-05-22 15:39:28 +10:00
ahladik a0dad0802e Fix to IfcHierarchyHelper.cpp (#1476) 2021-05-21 13:26:40 +02:00
Dion Moult 97244d1919 Revisiting dumb walls - typed dumb walls now auto derive wall thickness from the type material 2021-05-20 12:53:40 +10:00
Dion Moult 1541cbbbb8 Fix bug where sometimes active object edits would not get synced correctly. 2021-05-19 21:05:03 +10:00
Dion Moult 82692bb88d Adding a new type instance (like furniture, walls) now snaps it to the bottom of the storey you're working on. Nice. 2021-05-19 17:59:13 +10:00
Dion Moult 77a97233c5 New authoring panel for adding instances and fix bug where new cube instances were missing a face 2021-05-19 16:24:34 +10:00
Dion Moult 4214a449a8 Only show search UI if an IFC model is loaded. 2021-05-19 14:46:02 +10:00
Dion Moult b650c045f5 Simple support for API listeners for parametric IFC authoring - editing any parameter can now trigger events from a "parametric engine" which synchronises other related geometry and attributes in the IFC dataset. Implement auto box generation as a first demo. 2021-05-19 14:45:47 +10:00
Prabhat Singh 851ab07192 Added Project and Version script for v3 bcfxml.py (#1473)
* Added Project and Version script for v3

* Removed Redundant part

* Optional Element Fixes
2021-05-19 08:40:28 +10:00
civilx64 20a36c39fc finish implementing clothoid transition 2021-05-18 15:46:55 +02:00
civilx64 38544e2ba9 develop calcs for biquadratic parabola and clothoid curves 2021-05-18 15:46:55 +02:00
civilx64 41a88bcd4d create implementation of IfcTransitionCurveSegment2D 2021-05-18 15:46:55 +02:00
Dion Moult 966850c54a Minor fix 2021-05-18 20:02:56 +10:00
Dion Moult 319fe13f9e Minor refactor 2021-05-18 17:48:44 +10:00
Dion Moult 0d5110b7af Fix bug where you were unable to remove a representation 2021-05-18 16:42:41 +10:00
Dion Moult de873461e1 Fix bug where IFC2X3 files did not correctly generate 2D representations 2021-05-18 16:41:55 +10:00
Dion Moult cbce3cbec0 Assigning a representation to a product type now syncs mapped representations of all of its typed products. 2021-05-18 16:41:30 +10:00
Dion Moult 0822d1d377 Fix crash when switching representations for a type products. 2021-05-18 16:29:19 +10:00
Dion Moult e6bf32b832 Fix potential instability when assigning types and synchronising Blender geometry 2021-05-18 14:36:12 +10:00
Dion Moult 30c31d694a Purge OCC dependency and old drawing system. See #1153. 2021-05-18 10:44:33 +10:00
s-leger 65c2f9a038 Add support for rel_void / rel_fill / rel_project relative placement when editing object placements(#1471)
* Add support for rel_void / rel_fill

* Fix relationships, and add support for projection elements

Co-authored-by: Dion Moult <dion@thinkmoult.com>
2021-05-18 09:46:15 +10:00
Dion Moult 2d42846fa3 Basic reimplementation of the 2D representation support without PythonOCC. See #1153. 2021-05-17 21:52:23 +10:00
Dion Moult d3bb895c9d No new functionality. Just throwing all drawing code in the drawing module. See #1153. 2021-05-17 15:15:25 +10:00
Dion Moult aeead1c011 Purge old swept solid system. No longer relevant in the land of native IFC. 2021-05-17 14:24:10 +10:00
Dion Moult ba742d5976 Fix #1465. Bump BCF to new namespace. 2021-05-17 14:02:29 +10:00
s-leger 27750e0caf fix is_native_swept_disk_solid logick (#1469)
* Update import_ifc.py

Ensure that at least a raw representation exists before checking for type.

* Update import_ifc.py
2021-05-17 10:02:41 +10:00
s-leger 5b02d3214d Unlink only from relevant collections (#1467)
Objects may be linked to non ifc related collections, so keep those links whatever.
2021-05-17 09:35:14 +10:00
Prabhat Singh 0f55a98b2f Added Module Loader (#1468) 2021-05-17 09:34:31 +10:00
Laurens Oostwegel 13209b6d03 Create mapping to IFC for all CityJSON object types & semantic surfaces 2021-05-16 18:55:00 +02:00
Laurens Oostwegel 411855495e support for CityJSON MultiSurface, CompositeSurface & interior faces for cityjson2ifc convert 2021-05-16 18:16:59 +02:00
Laurens Oostwegel 79ebbb82ef Minor fix in previous commit regarding writing of ifc file 2021-05-16 15:46:31 +02:00
LaurensJN 647a96a655 Update README.md of ifccityjson 2021-05-16 15:36:58 +02:00
Laurens Oostwegel 66d4665498 Instead of using a template ifc file, ifccityjson now uses ifcopenshell.api to create a new file for conversion 2021-05-16 15:32:35 +02:00
Dion Moult 537efdcb53 Continue refactor, and provide user options to regenerate vector base layer / annotation layer of drawings. See #1153. 2021-05-16 23:13:27 +10:00
Dion Moult f2352e9a17 Old annotation systems now creates IFC elements again. Also text and misc annotations now work again with new system. See #1153. 2021-05-16 18:26:48 +10:00
Dion Moult e0b3a87fdb You can now select all products that are part of a group 2021-05-16 11:24:51 +10:00
s-leger ff06f452d5 disable boolean for mesh evaluation (#1466)
Disabling boolean modifier on screen instead of remove / add is enough to get proper mesh representation.
2021-05-16 10:20:56 +10:00
Dion Moult 5aec0718f4 IFC drawings are now roundtrip and are imported as Blender camera objects. See #1153. 2021-05-15 18:05:15 +10:00
Dion Moult fdcafa98b3 Continued grid bugfixing, especially related to export-time syncing. 2021-05-15 12:06:58 +10:00
bosonprojets 1776b19c07 Further fix to task_time durations editing 2021-05-15 02:04:43 +00:00
bosonprojets e1d1dca518 Minor fix to editing task durations 2021-05-14 23:25:54 +00:00
bosonprojets e8ab4dcc14 Improved UX for editing task durations 2021-05-14 23:04:51 +00:00
Dion Moult 41443d1a64 Fix bunch of bugs related to grid name syncing, axis deleting, copy axes and grid deletion 2021-05-14 20:19:30 +10:00
Dion Moult 13c642c6ab A little progress on refactoring the old drawing module into an IfcConvert based system. See #1153. 2021-05-14 17:49:24 +10:00
bosonprojets c40f07f9b5 Minor fix for editing Work Schedule Attributes 2021-05-14 07:40:54 +00:00
Dion Moult ae7d123aa2 Qto module now has various qto methods you can do to bulk populate quantities 2021-05-14 15:13:40 +10:00
Dion Moult 7c6e7996ff Improve the costing UI to format numbers properly and not take up so much space for cost components 2021-05-14 15:13:40 +10:00
ahladik 6ec23faf26 A few fixes of types and a typo (#1464) 2021-05-13 21:11:19 +02:00
Thomas Krijnen 81ad689478 #841 missing return value 2021-05-13 10:09:09 +02:00
Dion Moult b3c918f15f Implement load management and assigning activities with named loads. Thanks Jesusbill! 2021-05-13 18:04:50 +10:00
Dion Moult de7ddd9b97 You can now filter products assigned to a cost item or schedule 2021-05-13 15:54:26 +10:00
Dion Moult 66862a6cba You can now copy cost values from one cost item to another 2021-05-13 15:11:45 +10:00
Dion Moult 4e014d1a10 New utility functions for copying and deep copying IFC elements 2021-05-13 15:11:18 +10:00
Dion Moult 3b33977acc Linked cost item products now auto update cost quantities upon assignment and unassignment, with user friendly quantity type selection dropdown 2021-05-13 14:25:05 +10:00
Dion Moult 5334d2b754 Refactor pset module to follow the same design patterns as other modules, in preparation for complex property / quantity handling in the future 2021-05-13 11:55:25 +10:00
Jesusbill 75ed4dcdd8 you can now edit a structural connection coordinate system 2021-05-12 17:43:07 +02:00
Prabhat Singh 0276c8271e Prabhat gsoc (#1463)
* Added Pipfile and Pipfile.lock in gitignore

* Added File Structure for v3

* Add files via upload
2021-05-12 22:22:12 +10:00
Dion Moult beb813cb21 Fix bug where related openings are not deleted when you delete a product 2021-05-12 22:20:58 +10:00
Dion Moult 35ceba2e88 Fix #1462. 2021-05-12 19:12:46 +10:00
Thomas Krijnen 64b8eee077 #1461 only check for numbers on basename 2021-05-12 11:04:28 +02:00
Thomas Krijnen 229ba95d4b #1442 no longer create compsolids in extrusions 2021-05-12 09:58:11 +02:00
Thomas Krijnen 3f9e5ca806 respect --orient-shells for tesselated items 2021-05-11 23:09:41 +02:00
Thomas Krijnen cf68cf6f5c new_helper 2021-05-11 22:35:46 +02:00
Thomas Krijnen 34386ea27c Hacky solution to disable schemas to speedup compilation 2021-05-11 22:29:16 +02:00
ahladik ce76d27acc Update Boost download address (#1458) 2021-05-11 14:49:18 +02:00
Dion Moult 353281fa4d Updating a task duration now auto calculates the scheduled finish times based on the working calendar 2021-05-11 11:35:47 +10:00
Thomas Krijnen dd6f593e26 V7_5_2.patch 2021-05-10 21:36:38 +02:00
Dion Moult a9228c0800 Support importing lag times from P6 XML 2021-05-10 21:15:23 +10:00
Thomas Krijnen 5e52abb3cf Merge branch 'v0.6.0' of https://github.com/IfcOpenShell/IfcOpenShell into v0.6.0 2021-05-10 11:47:25 +02:00
Thomas Krijnen 8384235e10 Tree API extensions in wrapper 2021-05-10 11:47:16 +02:00
Dion Moult d98ac8ce89 Implement inherited calendars in the sequencing task tree 2021-05-10 18:40:51 +10:00
Dion Moult 1b4b2a526d Derived durations now calculate working days based on the calendar 2021-05-10 18:34:25 +10:00
Dion Moult b1ed85adda Fix incorrect P6 duration import. Now things finally make sense. 2021-05-10 18:31:49 +10:00
Dion Moult 02bfbf0144 You can now show calendars in the work schedule task tree 2021-05-10 11:34:50 +10:00
Dion Moult 3224c4fc77 New IfcPatch recipe to convert units of an IFC file. See #1247. 2021-05-10 10:39:17 +10:00
Dion Moult 19e67613db New recipe to clean up IFCs that store quantities in properties. 2021-05-10 09:27:31 +10:00
Thomas Krijnen e98771ae09 win build: boost dl dir 2021-05-08 21:51:28 +02:00
Thomas Krijnen 58663769c9 Update boost dl location
https://www.boost.org/users/news/boost_has_moved_downloads_to_jfr.html
2021-05-08 14:15:43 +02:00
Thomas Krijnen 28081f7df8 Fixes for spatial tree on iterator and positive extend param 2021-05-08 13:04:22 +02:00
Dion Moult a80fbdbc1d Implement arithmetic formulas for cost value components 2021-05-08 12:18:27 +10:00
Dion Moult 46bc688f26 Fix bug where empty material slots caused errors 2021-05-08 08:57:33 +10:00
Dion Moult f9b79b4beb Implement add / remove load groups, and half implement structural activities. Thanks Jesusbill and ihabelaghoury 2021-05-07 18:41:03 +10:00
Dion Moult 15927dd501 Refactor cost operator to use helpers 2021-05-07 15:10:45 +10:00
Dion Moult 7919c193b8 Minor improvement to deep purging for removing work schedules 2021-05-07 11:16:05 +10:00
Dion Moult 6492b93c69 Minor fix 2021-05-07 10:58:12 +10:00
Dion Moult 992474fbf2 Minor structural code review 2021-05-06 18:24:13 +10:00
Dion Moult 8a3e023408 Fix unfinished time/date/duration handling in edit task time, work plan, work schedule, and finally refactor attribute i/o like I promised 2021-05-06 17:14:28 +10:00
Jesusbill a13b257452 add point orientation - wip 2021-05-06 08:43:12 +02:00
Jesusbill 3f9842e358 extend structural api data for loads 2021-05-06 08:32:49 +02:00
bosonprojets 764b880ea8 Fix MSProject relationship_id issue at import 2021-05-06 06:19:40 +00:00
bosonprojets a10f4c070a Fix MSProject calendar day mapping at import, and add relationship type display in blenderBIM 2021-05-06 06:08:21 +00:00
Dion Moult 114214e2a1 Implement natural sorting for task trees, and support nested tasks in MS Project XML imports 2021-05-06 14:23:20 +10:00
bosonprojets d19d4fca3e FEature to import Microsoft Project .xml Schedules and convert to IFC schema 2021-05-06 02:40:04 +00:00
Jesusbill a031bffe6c you can now add, edit and remove structural load cases 2021-05-05 14:22:18 +02:00
Dion Moult 6ff792d75c Whoops 2021-05-05 18:43:12 +10:00
Dion Moult 6b3393c003 You can now generate construction sequence animations to visualise within a date range 2021-05-05 18:36:28 +10:00
Dion Moult da5a2625a9 New feature to visualise construction progress at a particular date 2021-05-05 17:07:17 +10:00
Dion Moult a1eb2a1ec3 Fix identification sorting issue of construction sequencing task trees 2021-05-05 12:49:22 +10:00
Dion Moult 403412e088 Support importing activity and calendar assignments from P6 2021-05-05 12:48:48 +10:00
Dion Moult ee46e76340 Derive start and finish dates and elapsed durations where possible in the task tree 2021-05-05 11:59:33 +10:00
Dion Moult 925c40c6ba Fix duration type when importing durations from P6 2021-05-05 11:58:36 +10:00
Dion Moult dea844dcf6 Fix purging when removing tasks 2021-05-05 11:57:47 +10:00
Dion Moult 018d754b2e Fix P6 WBS identification import 2021-05-05 10:16:25 +10:00
Dion Moult a05d017341 Implement adding, editing, and removing time lags to sequence relationships 2021-05-04 20:56:19 +10:00
Dion Moult f63479c823 Code review and use isodate library to handle durations for robustly 2021-05-04 12:52:14 +10:00
bosonprojets 8a8bdeeaa3 Update to ifcopenshell.util.date for handling of IfcDuration with python and import of Planned Durations from P6 .xml exports in blenderBIM 2021-05-04 00:27:53 +00:00
bosonprojets 6b46ff71a6 Implement feature to select all products related to a task in blenderBIM, and the ifcopenshell.api 2021-05-02 01:44:56 +00:00
bosonprojets d73a5c46ea Add support for editing sequence relationship attributes in blenderBIM 2021-05-01 21:45:27 +00:00
ArturTomczak 037261afb9 IDS Add PredefinedType support (#1447)
* fixed typos

changed all 'applicabiliy' to 'applicability'

* added boolean restriction

* Add PredefinedType support

* replace f-string with %

* skip PredefinedType if not IFC4

* code formatting

* check PredefinedType if exists not based on schema

* narrow try-except

* remove debug data
2021-05-01 09:09:35 +02:00
Dion Moult be87b17909 Support importing P6 sequence types and new view sequences UI 2021-04-30 21:34:18 +10:00
atom3 5419d72a6a remove debug data 2021-04-30 11:31:23 +02:00
atom3 9ca1e011e5 narrow try-except 2021-04-30 11:06:36 +02:00
Dion Moult 932a21309f Support assigning work calendars to tasks 2021-04-30 17:40:00 +10:00
atom3 3b806a5466 check PredefinedType if exists not based on schema 2021-04-30 08:41:33 +02:00
Dion Moult 7a1b35f7e2 Support different versions of P6 XML imports 2021-04-30 15:57:42 +10:00
Dion Moult 79dcf809ed Implement support of importing calendars from P6 2021-04-30 14:53:40 +10:00
bosonprojets 2f53e43b90 Added Usecases to assign, edit and unassign Lag Times to the ifcopenshell.api 2021-04-30 02:21:54 +00:00
Dion Moult cdc9180111 Support root-level activities when importing from P6 XML 2021-04-30 12:04:15 +10:00
atom3 a65a34cfe7 code formatting 2021-04-30 00:09:04 +02:00
atom3 2e0d5fa707 skip PredefinedType if not IFC4 2021-04-29 23:41:22 +02:00
atom3 de40049c9c Merge branch 'GSoC#45-IDS-checking' of https://github.com/atomczak/IfcOpenShell into GSoC#45-IDS-checking 2021-04-29 21:33:51 +02:00
atom3 29fa5bdffa replace f-string with % 2021-04-29 21:33:07 +02:00
ArturTomczak d55ad90319 Merge branch 'v0.6.0' into GSoC#45-IDS-checking 2021-04-29 21:05:26 +02:00
atom3 90ece8a058 Add PredefinedType support 2021-04-29 20:46:55 +02:00
Thomas Krijnen a936a5317d #1445 comment 2021-04-29 16:29:31 +02:00
Thomas Krijnen f5e5ede0fa Revert "Fixes IfcUtil::valid_binary_string so it returns false for an empty string"
This reverts commit 2514e93a8d.
2021-04-29 16:28:16 +02:00
Rick Brice 2d1ddea3d0 Fixes conditional logic 2021-04-29 16:27:57 +02:00
Rick Brice df932b90d6 Adds parsing for Ifc4x3_rc2 schema 2021-04-29 16:27:57 +02:00
Rick Brice 2514e93a8d Fixes IfcUtil::valid_binary_string so it returns false for an empty string 2021-04-29 16:27:57 +02:00
Rick Brice 64e6561828 Initalizes list_ with null points 2021-04-29 16:27:57 +02:00
Thomas Krijnen 76685d236c SVG Fixes to text positioning 2021-04-29 16:16:41 +02:00
Dion Moult fd83564af0 Sorry forgot to commit 2021-04-29 19:37:59 +10:00
Dion Moult 37e3a65ffb Decouple pset APIs from blenderbim namespace 2021-04-29 19:35:21 +10:00
Dion Moult e5cf0cde2d Improve time and date support (don't cast to datetime) and support all recurrence types and time periods in work schedules 2021-04-29 17:52:45 +10:00
Thomas Krijnen 78e4478242 Merge branch 'v0.6.0' of https://github.com/IfcOpenShell/IfcOpenShell into v0.6.0 2021-04-29 07:54:15 +02:00
Thomas Krijnen 3497022c78 SVG Also include annotations in non-floorplans 2021-04-29 07:53:05 +02:00
Dion Moult 810d36781c Add support for editing calendar work and exception times and recurring work times 2021-04-29 13:16:47 +10:00
bosonprojets f8eb1c178a Usecases to edit WorkCalendar Attributes in the ifcopenshell.api 2021-04-29 02:43:14 +00:00
Dion Moult b726ba7816 Simplify work calendar UI 2021-04-29 09:55:50 +10:00
bosonprojets 4ab23d231d Usecase to Unassign object aggregation in the ifcopenshell.api 2021-04-28 12:43:14 +00:00
Dion Moult 00694854af UI clean up for work plans and code review for assign schedules to plan 2021-04-28 17:59:57 +10:00
Dion Moult fa52ed6dbc Fix bug where you might have an activity that is not part of any WBS from P6 2021-04-28 16:54:54 +10:00
Dion Moult 319b59a266 Fix bug where sometimes migrating an IFC file schema version can explode in filesize 2021-04-28 16:53:38 +10:00
Dion Moult 357fcded71 Implement OAuth authorization in the bSDD library 2021-04-28 13:27:31 +10:00
bosonprojets c3cc5881df Aggregate WorkSchedules to WorkPlans 2021-04-28 02:17:08 +00:00
atom3 ca34c95057 added boolean restriction 2021-04-28 00:25:08 +02:00
atom3 5078db8b26 fixed typos
changed all 'applicabiliy' to 'applicability'
2021-04-28 00:10:13 +02:00
Dion Moult 56046dd6f9 Cost quantities that are counting that have controlled products now automatically count the number of products for convenience 2021-04-27 14:45:14 +10:00
Dion Moult 9164a7bcc3 Support importing predecessor and successor relationships from P6 2021-04-27 12:30:09 +10:00
Dion Moult e0a5c9c8f3 You can now assign derived quantities from products to cost items 2021-04-27 12:09:52 +10:00
Dion Moult 22e087c82a Fix #1443 bug where UI update of type name was not refreshed when you changed it 2021-04-26 19:46:27 +10:00
Dion Moult 57396e1bb9 Make cha-ching noise whenever you're checking out cost schedules 2021-04-26 18:46:35 +10:00
Dion Moult 389076bff4 Implement feature for manipulating cost values, with support for calculation of subtotals 2021-04-26 18:18:42 +10:00
Dion Moult bfcc067257 New feature to manipulate cost item quantities 2021-04-26 12:41:19 +10:00
Dion Moult f88ac5de62 Minor code review to assign / unassign resource products 2021-04-26 09:38:45 +10:00
bosonprojets cdd456bede Assign and Unassign resources to scene objects in BlenderBIM 2021-04-25 23:25:05 +00:00
bosonprojets 7041d17c16 Unassign Resources Usecase added to the ifcopenshel.api 2021-04-25 22:59:01 +00:00
Dion Moult de842f7aba Code review with myoualid for IFC resource module 2021-04-25 12:29:11 +10:00
bosonprojets 6107c39c1c Update to IfcResources panel and authoring subtypes of IfcConstructionResource with ifcopenshell.api 2021-04-24 23:34:38 +00:00
Thomas Krijnen 9584687fcf Ensure solid from tapered extrusions 2021-04-24 20:47:25 +02:00
Thomas Krijnen b231e9051b Update main.py 2021-04-24 15:23:36 +02:00
Thomas Krijnen 40f9875930 Merge branch 'v0.6.0' of https://github.com/IfcOpenShell/IfcOpenShell into v0.6.0 2021-04-24 14:19:10 +02:00
Thomas Krijnen 328773550d SVG: Text annotations in elevations 2021-04-24 14:18:53 +02:00
Dion Moult 303544dc5c Merge branch 'v0.6.0' of github.com:IfcOpenShell/IfcOpenShell into v0.6.0 2021-04-24 20:32:10 +10:00
Dion Moult 1c66f986cc Implement basebones bSDD API client library. 2021-04-24 20:31:50 +10:00
Thomas Krijnen e801629f86 Add BRepExtrema_DistShapeShape option to tree with extend keyword 2021-04-24 11:06:13 +02:00
Thomas Krijnen 74bbd6d116 Merge branch 'v0.6.0' of https://github.com/IfcOpenShell/IfcOpenShell into v0.6.0 2021-04-24 11:05:31 +02:00
Thomas Krijnen e06794ef3d #1153 SVG OBB check 2021-04-24 11:05:18 +02:00
bosonprojets cd7062c905 UX layout for IfcResources in blenderBIM 2021-04-24 05:59:17 +00:00
LaurensJN 42d476cbb0 Replace old naming of ifccityjson README.md 2021-04-23 17:12:29 +02:00
Laurens Oostwegel cd0d3908d3 Add ifccityjson to start with supporting conversions between IFC and CityJSON files 2021-04-23 17:05:59 +02:00
Thomas Krijnen cb70f97789 Update ids.py 2021-04-23 12:14:52 +02:00
Thomas Krijnen 572ed0db0f Update ids.py 2021-04-23 12:13:41 +02:00
Dion Moult 43d78af767 Fix crash when pressing undo after assigning an IFC class to an object. Baby steps to solving the "Undo Sync". 2021-04-23 17:44:50 +10:00
bosonprojets c7aa42bfd5 Feature to Add Crew Resources and SubContract Resources with the ifcopenshell.api and blenderB 2021-04-23 06:38:11 +00:00
ArturTomczak 3104743a02 Merge pull request #1 from IfcOpenShell/v0.6.0
Upstream update
2021-04-22 15:35:05 +02:00
Dion Moult 18d7193efc Fix bug where a new Blender file would remember old pset templates and libraries 2021-04-22 18:37:41 +10:00
Dion Moult 8da92557cc Fix bug where deletion syncing may fail on freshly created objects 2021-04-22 18:37:03 +10:00
Dion Moult 761b4c035f Optimisations for construction sequencing task trees where there are thousands of tasks 2021-04-22 18:34:45 +10:00
Dion Moult ee0f7f1677 You can now import an IFC work schedule from a P6 XML export 2021-04-22 15:44:58 +10:00
Dion Moult dca2e58586 Fix bug where you shouldn't be able to reassign classes of non-rooted elements 2021-04-22 14:00:18 +10:00
Dion Moult 3810255f04 Fix bug where syncing was not maintained across file saves and collection names were not synced 2021-04-22 13:56:01 +10:00
Dion Moult d3ca647cd5 Minor code review fix 2021-04-22 10:53:25 +10:00
bosonprojets 8b35a3aadd Assign control to cost items and UX Workschedules and Costchedules cleanup 2021-04-22 00:18:22 +00:00
Dion Moult 78314b1ec7 Forgot to commit append_asset usecase, also minor fixes 2021-04-21 20:49:58 +10:00
Dion Moult ef88b30639 Fix bug where import mesh cleaning would inadvertently mark meshes as edited 2021-04-21 20:40:45 +10:00
Dion Moult 5e815e7832 You can now append object types from an IFC project library to your active project 2021-04-21 16:45:11 +10:00
Dion Moult e7b153cbf6 You can now generate gantt charts from work schedules 2021-04-21 12:57:31 +10:00
Dion Moult 9b855bed2d Implement unassigning products to tasks 2021-04-21 11:53:33 +10:00
Dion Moult 3143f8c9a5 Code review for assign product with myoualid 2021-04-21 11:11:08 +10:00
Dion Moult 8dd781aea2 Fix bug where you couldn't assign objects to a fresh layer 2021-04-21 11:03:36 +10:00
bosonprojets 0506475f26 Feature to add building elements to construction scheduling tasks in blenderBIM and assign product to process with the ifcopenshell.api 2021-04-20 23:51:55 +00:00
Dion Moult ac092fb6f8 Minor fix - add dateutil as dependency 2021-04-21 09:14:57 +10:00
Dion Moult 9beddca2f7 You can now toggle showing time columns in work schedule, minor fixes and ui cleanup 2021-04-20 23:34:10 +10:00
Dion Moult 6d9770542f Fixes to editing task times 2021-04-20 17:11:06 +10:00
bosonprojets 544d6ee695 Add IfcTaskTime to IfckTask 2021-04-20 05:13:03 +00:00
Dion Moult b8963b3d6e You can now modify project context declarations for project libraries, denoting which assets are part of the library 2021-04-20 13:51:41 +10:00
Dion Moult f2bd46d699 Selecting an IFC file dialog now filters ifc files for convenience 2021-04-20 12:45:42 +10:00
Dion Moult 8ac8ad33b3 You can now load and browse a tree of project library types products 2021-04-20 12:45:20 +10:00
Dion Moult 44bbd17d97 Collection assignment is now synced on export, so you don't need to manually manage your tree 2021-04-19 16:08:57 +10:00
Dion Moult 8f0e67a35b You can now assign task successor and predecessors. Sweet. Thanks myoualid! 2021-04-19 13:09:00 +10:00
Dion Moult d2d4112724 Clean up UX to either edit a work schedule attributes or task tree but not both simultaneously 2021-04-19 11:42:39 +10:00
Dion Moult 209eea6a18 You can now edit tasks. Thanks myoualid! 2021-04-19 11:10:49 +10:00
Dion Moult 85426b3fef Minor tweak 2021-04-19 10:41:25 +10:00
Thomas Krijnen c602f0f233 Merge branch 'v0.6.0' of https://github.com/IfcOpenShell/IfcOpenShell into v0.6.0 2021-04-18 15:06:34 +02:00
Thomas Krijnen bb6312e174 #1153 --svg-without-storeys and correct positioning and scale based on annotation block 2021-04-18 15:03:28 +02:00
Dion Moult d6d70af5a0 You can now copy classes in bulk. 2021-04-18 20:24:08 +10:00
Dion Moult 8187c75183 If you are already authoring a file, exporting now no longer prompts for a file location. 2021-04-18 20:17:54 +10:00
Rick Brice 01cfcebb09 Fixes problem with dereferencing the end iterator for empty std::string objects 2021-04-18 12:00:48 +02:00
Rick Brice 75040b6ffb Fixes initialization issues in IfcEntityInstanceData constructors
attributes_ was allocated as an array of Argument pointers but the pointers were uninitialized in the construction. Initialization was done in the HeaderEntity class constructor.

offset_in_file_ is uninitialized in one constructor
2021-04-18 12:00:48 +02:00
Dion Moult 6c8858e51d Fix bug where edit mode syncing didn't work if you edited many objects at once 2021-04-18 19:58:07 +10:00
Dion Moult 6bb63817af Fix #1435. Fix bug where box reps could be duplicated upon adding a new body, and ensure all styles are created prior to adding new body geometry. 2021-04-18 19:28:05 +10:00
Dion Moult 1e299a0ddd Make remove_deep_batched the default since I'm the only guy using it so far and I'm feeling lucky! Let's battle test it! 2021-04-18 19:02:39 +10:00
bosonprojets 3201c234fa Feature to create IfcTask trees for entities of IfcWorkSchedule 2021-04-18 00:49:43 +00:00
Dion Moult f5d27621e7 Fix #1436. Bug where saving is done twice in authoring mode. 2021-04-17 20:18:01 +10:00
Dion Moult 3e1eb9648f Fix showstopper bug with editing pset templates module 2021-04-17 17:59:12 +10:00
bosonprojets 5f9474acb7 Feature to add multiple summary cost items and remove cost items 2021-04-15 23:16:32 +00:00
Dion Moult f4e6e924b1 Spaces are now always imported, and consistent with the rest of the spatial tree. Yes, I don't know why I held off for so long. Deprecate "import spaces". Spaces are important. 2021-04-15 19:56:18 +10:00
Dion Moult bcfc97037c Spatial aggregations are auto assigned when you create them. Neat. 2021-04-15 19:33:01 +10:00
Dion Moult 65d0abd072 Material profile set usages are now supported. Hooray! Thanks Jesusbill! 2021-04-15 18:38:51 +10:00
Thomas Krijnen 776c68e2b0 --svg-write-poly 2021-04-15 10:36:37 +02:00
Dion Moult dab2d5ce04 You can now toggle expansion of the cost item tree 2021-04-15 11:14:03 +10:00
Dion Moult 29b33661d7 You can now assign summary tasks to a work schedule. Thanks myoualid! 2021-04-15 10:38:45 +10:00
Sigma Dimensions 5dec636584 New Feature to add Tasks and Task Relationships in the python ifcopenshell API (#1432) 2021-04-15 09:40:29 +10:00
Dion Moult d11b91f152 Fix bug where adding a new material didn't make it immediately available 2021-04-14 18:41:13 +10:00
Dion Moult b0fc98e384 Fix bug where Blender prop enums persisted when starting new files 2021-04-14 18:41:13 +10:00
Tigran Khachatryan 56f09d2541 Broken link fixes
Links to Open Cascade were broken
2021-04-13 16:57:15 +02:00
Tigran Khachatryan 4484b77232 broken link fix
OCCT download link has changed
2021-04-13 16:57:15 +02:00
Dion Moult f6c054066b You can now assign spatial containers in bulk 2021-04-13 20:09:01 +10:00
Dion Moult d5c70e51f2 You can now edit structural member axis orientations. Thanks Jesusbill! 2021-04-13 13:04:05 +10:00
Dion Moult cab9e4d892 You can now assign aggregates in bulk 2021-04-13 08:25:43 +10:00
Dion Moult 14cd8289ea You can now create IFC project libraries 2021-04-11 21:56:45 +10:00
Dion Moult 4202c08487 You can now select stuff like doors / windows instead of having to select the opening element itself when adding voids, with some assumptions. See #1426. 2021-04-11 21:15:39 +10:00
Julien Moutinho a70fb41652 blenderbim: fix reference before assignment in PieAddOpening (#1426)
Co-authored-by: Julien Moutinho <julm+blenderbim@sourcephile.fr>
2021-04-11 20:52:42 +10:00
Dion Moult df437fd3e3 You can now add cost items into a cost schedule, and as sub items to a parent cost item. Thanks myoualid and Jesusbill! 2021-04-10 20:40:35 +10:00
Dion Moult 3102dbcd44 Fix bug where you couldn't add a presentation layer 2021-04-10 20:01:37 +10:00
Dion Moult 9d838db096 You can now edit cost schedule attributes. Thanks Jesusbill and myoualid! 2021-04-10 18:10:33 +10:00
johltn 0c9d555693 Handle more restrictions, save validation results to JSON objects, modification to classification class, and partly handle material terms 2021-04-09 10:56:52 +02:00
johltn 4b637c7049 Typo fix 2021-04-09 10:56:52 +02:00
Dion Moult fd3a873bbd Fix bug where you couldn't do a partial import when whitelisting only spatial elements 2021-04-09 15:43:41 +10:00
Dion Moult 5cea988911 You can now assign parameterized profiles to material profiles. Thanks Jesusbill! 2021-04-08 21:03:37 +10:00
Dion Moult 70fcbfa990 Fix bug where extrusion direction was incorrectly detected for some automagic mesh to parametric solid conversions 2021-04-08 17:15:05 +10:00
Dion Moult c541aa78e5 Fix bug where syncing upon export was broken 2021-04-08 12:22:59 +10:00
Dion Moult b821e62391 You can now add/remove material profiles in a profile set. Thanks Jesusbill! 2021-04-08 08:57:45 +10:00
Dion Moult 41141b8fc9 Geolocation micromvd now supports checking true north 2021-04-07 16:08:02 +10:00
Dion Moult ae0789e4ec New assign / unassign declaration usecase, minor code & formatting cleanup 2021-04-07 13:15:16 +10:00
Sigma Dimensions 13d4a99358 Feature to manipulate Work Calendars (#1420) 2021-04-07 09:51:20 +10:00
Sigma Dimensions becb375ec2 Feature work schedule (#1419)
* ifcopenshell.api modules Persons and Organisations account for IFC4 SCHEMA CHANGE

* New Feature to manpiulate Work Plans
2021-04-07 09:31:16 +10:00
Sigma Dimensions a777a558bd Feature edit work plan (#1418)
* ifcopenshell.api modules Persons and Organisations account for IFC4 SCHEMA CHANGE

* New Feature to Edit Workplans
2021-04-07 09:04:57 +10:00
Bruno Postle de37aeb515 faces in DXF polyfacemesh objects can have three or four sides (#1414) 2021-04-07 08:28:11 +10:00
Sigma Dimensions 23be1a6939 ifcopenshell.api modules Persons and Organisations account for IFC4 SCHEMA CHANGE (#1417) 2021-04-07 08:28:02 +10:00
Dion Moult 8edced5a0c Fix bug where rotation check in geolocation micromvd broke in the last release 2021-04-07 08:03:01 +10:00
Dion Moult 21937e88e8 Hotfix 2021-04-05 21:20:05 +10:00
Thomas Krijnen f7da83737a SVG fix bug in point interpolation 2021-04-04 22:34:16 +02:00
Thomas Krijnen 27663d80ba SVG sample more points for space name position check 2021-04-04 21:15:13 +02:00
Thomas Krijnen 4ec5d4fc65 Don't fail on lack of IfcAnnotation 2021-04-04 21:06:38 +02:00
Dion Moult 2b34ca9eb7 Minor fix 2021-04-04 12:59:39 +10:00
Dion Moult 2bb9810072 Bump IfcOpenShell 2021-04-04 12:54:08 +10:00
Dion Moult c7e87324de Fix bug where Blender floats lost precision for geolocation. Everything is now a string. 2021-04-04 12:43:41 +10:00
Dion Moult ec62d8fbb9 Fix bug where assigning a spatial container didn't update the object placement tree 2021-04-04 09:02:14 +10:00
Dion Moult 7b5aae9487 Implement getting and setting true north rotation independent of grid north 2021-04-04 08:58:24 +10:00
Dion Moult 12c94fafab Minor code shuffling to reflect the fact that projected CRS has a higher priority than map conversion 2021-04-03 22:05:20 +11:00
Dion Moult 09be170820 Geolocation utilities now support converting either X axis or Y axis to an angle 2021-04-03 21:58:35 +11:00
Dion Moult 966af5a757 You can now add / remove cost schedules 2021-04-03 19:46:52 +11:00
Thomas Krijnen 89557460c8 SVG text annotation descriptions 2021-04-02 21:59:49 +02:00
Thomas Krijnen 2bad6b2722 yet another todo note 2021-04-02 21:25:01 +02:00
Thomas Krijnen e5cd30c6d0 SVG dimension text offset depending on scale 2021-04-02 21:21:27 +02:00
Thomas Krijnen 6f2da2896e try catch convert_placement() 2021-04-02 21:20:53 +02:00
Dion Moult 0387c778f4 Fix bug where you couldn't add type instances for IFC4 2021-04-01 15:03:42 +11:00
Dion Moult 76568ea67c Fix bug where express has a typo that broke the ability to add ifc transformers 2021-04-01 14:55:10 +11:00
Dion Moult 8e2a1a1649 A reference graph view context is now created automatically for convenience when you create an analytical model 2021-04-01 12:06:25 +11:00
Dion Moult cb5f57d68a Point connections are now treated as regular geometry, not an edge case (get it?). See #1409. Thanks @Jesusbill! 2021-04-01 11:58:46 +11:00
Dion Moult e7c6f28312 You can now add structural connections to members 2021-04-01 11:09:44 +11:00
Jesusbill 1820f72bc4 You can now remove structural connection conditions + minor mods 2021-03-31 18:58:02 +02:00
Dion Moult 1631dc39f5 You can now add and remove work plans with a new UI. Thanks @bosonprojets and @jesusbill! 2021-03-31 11:35:40 +11:00
Dion Moult d2f19e7c28 You can now edit structural boundary conditions on member connections 2021-03-30 12:00:25 +11:00
Jesusbill 736703336c work on structural connection conditions 2021-03-30 01:12:33 +02:00
Dion Moult 44df1f676d Finish decoupling ownership history code from Blender 2021-03-29 16:53:11 +11:00
Dion Moult f1ffb81c86 See #841. Minor optimisation and fixes. Thanks @ecke101 ! 2021-03-29 13:55:05 +11:00
Thomas Krijnen 08ec3fc73f SVG --space-name-transform 2021-03-28 22:16:58 +02:00
Thomas Krijnen f1d7cf1dfb SVG --storey-height-line-length 2021-03-28 21:38:29 +02:00
Thomas Krijnen 1ee488b148 Quick solution for inline dasharray 2021-03-28 16:55:52 +02:00
Thomas Krijnen ecb9827e7f Explicit cast 2021-03-28 13:04:16 +02:00
Thomas Krijnen 88f26eaead Work towards #1153 2021-03-28 12:48:20 +02:00
Dion Moult ce03742aab New ifcopenshell.api.run syntax, and rename create_product to create_entity. See #1399. 2021-03-27 22:53:13 +11:00
Thomas Krijnen 62540f0b00 #1404 2021-03-27 10:00:41 +01:00
Dion Moult 406b8b4540 IfcOpenShell API now uses kwargs to improve user syntax. See #1399. 2021-03-27 19:14:46 +11:00
Dion Moult ca24838a3f Don't load OCC upon startup, in preparation for deprecation when IfcConvert can handle #1153. See #1400 and #1358. 2021-03-27 18:38:20 +11:00
Thomas Krijnen ff7219b557 CMake < 3.7 compatibility
See https://github.com/glfw/glfw/issues/1584
2021-03-26 20:40:01 +01:00
Jesusbill 711acfe120 revert erroneous mod from bulk change 2021-03-26 17:51:35 +01:00
Dion Moult f1acda85c9 Call the daily builds "developer testing builds" to prevent misleading users 2021-03-26 20:52:32 +11:00
Dion Moult 228f62d218 Minor fix 2021-03-26 20:49:57 +11:00
Dion Moult 6186a88568 Rename misleading "ifcblenderexport" directory to "blenderbim" 2021-03-26 20:44:14 +11:00
Dion Moult 074a8c287f Support owner histories for a bunch more usecases. About half done. 2021-03-26 10:39:07 +11:00
Dion Moult d4736710a5 Thanks @ihabelaghoury! You can now select objects in the viewport by GlobalId from the IFC inspector 2021-03-25 20:29:37 +11:00
Dion Moult 0bc86631a5 Minor fixes after the refactor mess 2021-03-25 20:19:48 +11:00
Dion Moult 9751b6af05 Deletions are now synced on export, so you don't need to delete via the UI. 2021-03-25 16:48:58 +11:00
Dion Moult 6d641aaac1 Still cleaning up related to ownership histories. See #1399. 2021-03-25 16:32:43 +11:00
Dion Moult 489a248e9a Refactor ownership history system to be simpler and just a usecase. See #1399. 2021-03-25 11:42:12 +11:00
Jesusbill 9c00872a57 replace settings=None with {} 2021-03-25 00:54:42 +01:00
Dion Moult d77bc6bdaa First attempt at ripping out agnostic code into ifcopenshell.api namespace. See #1399. 2021-03-25 10:48:48 +11:00
Priit Laes 911d703f57 build: Use -Wno-deprecated-copy for GCC 9+
OpenCascade causes a lot of warnings due to -Wdeprecated-copy on GCC 9+.
These warnings are also emitted with clang, but only once per file.
2021-03-24 09:25:13 +01:00
Dion Moult 09bf5b85aa Refactor getting primitive data type into util 2021-03-24 16:09:29 +11:00
Dion Moult 41a694d0dc Fix bug where you couldn't set logical properties in psets. See #1086. 2021-03-24 14:57:52 +11:00
Jesusbill 6232ee36f9 add structural connection connected members - wip 2021-03-24 00:15:22 +01:00
Jesusbill 5b1cc2cab5 rename connection to boundary condition + minor edits 2021-03-24 00:10:07 +01:00
Thomas Krijnen f706adfb81 OCCT pre 7 compatibility 2021-03-23 13:27:31 +01:00
Thomas Krijnen b0358a5a7b Keep a set of visited edges in sort 2021-03-23 10:43:12 +01:00
Thomas Krijnen eb09cc8af8 Costrain number of edges in sorted_edges 2021-03-22 14:03:24 +01:00
Dion Moult 7c61c7d200 You can now import and export IFCCSV to the current file in memory without writing to disk 2021-03-22 16:19:29 +11:00
Dion Moult 92d28901ac Fix bug where IFCCSV delimiter was not able to be specified on read/write properly 2021-03-22 15:35:17 +11:00
Dion Moult 32769184b0 Attempt number 4 2021-03-21 20:13:27 +11:00
Dion Moult de7f1d9d46 Attempt number 3 2021-03-21 20:10:53 +11:00
Dion Moult cbd0c8a410 Attempt number 2 2021-03-21 20:07:40 +11:00
Dion Moult f4f40c4b16 Fix fatal bug with BIMTester where languages were not bundled in installation. 2021-03-21 20:04:24 +11:00
Dion Moult f9d70fd51d Whoops 2021-03-21 12:13:42 +11:00
Dion Moult bb43405299 Fix #1294 bug where BIMTester doesn't run if you have multiple drives on Windows. Thanks @rbertucat! 2021-03-21 12:07:27 +11:00
Priit Laes 00cb3cd0db travis: Bump to Ubuntu 20.04, Python3 and use apt addon as well 2021-03-20 10:58:47 +01:00
Priit Laes 823f988536 travis: Use system JSON package 2021-03-20 10:58:47 +01:00
Priit Laes d95977a784 travis: Simplify directory "shuffling" 2021-03-20 10:58:47 +01:00
Priit Laes 4f9991fb13 travis: Use make -j $(nproc) 2021-03-20 10:58:47 +01:00
Priit Laes d8b2cc77cc travis: Enable ccache 2021-03-20 10:58:47 +01:00
Priit Laes 077f9b701d ifcgeom: Remove unneeded cast causing warning by -Wignored-qualifiers 2021-03-20 10:56:57 +01:00
Priit Laes 36ade628cf Fix grammar 2021-03-20 10:56:57 +01:00
Priit Laes 0f59f3e35a ifcgeom: Remove unused variable 2021-03-20 10:56:57 +01:00
Priit Laes 31e7bad056 ifcgeom: Reorder the members in constructors to avoid side effects (Wreorder) 2021-03-20 10:56:57 +01:00
TestPrab eee693dfcb Added requirements file (#1397) 2021-03-20 20:31:36 +11:00
Dion Moult 4a8e03862b Improve usability that you can run a patch recipe without providing arguments. See #1393. 2021-03-20 20:04:10 +11:00
Dion Moult 04f7fc0bdb Minor fix 2021-03-20 20:02:53 +11:00
Dion Moult fbe9bb1ee2 Fix bcf bug for optional project.bcfp and optional project data 2021-03-20 17:56:43 +11:00
Jesusbill ca59b3220b small fix and mod in ifc2ca 2021-03-19 23:39:25 +01:00
Jesusbill 39c8c8db37 small fix and mods 2021-03-19 23:38:28 +01:00
Dion Moult f49de02ab7 Minor purge 2021-03-19 11:04:27 +11:00
Dion Moult 8b0a7821b1 You can now view / add / edit / remove structural boundary conditions 2021-03-19 10:55:52 +11:00
Dion Moult 0f365cadbd Experimental code for (currently slow) native faceted brep handling. See #841. 2021-03-18 19:02:54 +11:00
Dion Moult 0bc76b1af7 Reimplement lost feature from refactor - native handling of swept disks (mostly rebar) in Blender during import 2021-03-17 12:39:35 +11:00
Cyril Waechter efce28c053 Fix: get_applicable return empty generator (#1390)
`PsetQto.get_applicable` was returning an empty generator when called
multiple times. Combination on lru_cache and generator seems to lead to
this unwanted behavior.
It now returns a list to keep gains of lru_cache performance.
2021-03-17 09:23:06 +11:00
Dion Moult 071505038d Fix #1388. Extract elements IfcPatch recipe now retains aggregation relationships. 2021-03-16 21:48:17 +11:00
Dion Moult 98938acb26 Fix bug where nested aggregates were not nested in the Blender scene during import 2021-03-16 20:48:12 +11:00
Jesusbill 4817360ecd place structural elements in dedicated collections 2021-03-16 01:05:25 +01:00
Dion Moult b8e3fbba8c You can now import structural point connections. 2021-03-15 21:02:25 +11:00
Dion Moult 49ea774851 Export auto syncs edited meshes if authoring mode enabled. See #1360. 2021-03-15 20:32:47 +11:00
Dion Moult f4f2a3d24e Object placements are now updated on export in case you forgot to sync them in authoring mode. See #1360. 2021-03-15 18:58:32 +11:00
Dion Moult a25ca91ba6 Fix fundamental coordinate placement resolution utility bug. See #688. 2021-03-15 18:58:32 +11:00
Jesusbill fded9b3523 avoid warning for structural analysis entities
regarding spatial hierarchy
2021-03-15 01:41:29 +01:00
Jesusbill 9257f275af Import structural curve connections + small fixes 2021-03-15 01:39:35 +01:00
Priit Laes 40039e65df Ivccsv fixes (#1385)
* ifccsv: Fix reference to invalid variable

* ifccsv: Remove unused import
2021-03-15 08:20:51 +11:00
Priit Laes dbce9ec049 actions: ci: Skip installing recommended packages
Not much, but still small improvement:
6 upgraded, 138 newly installed, 0 to remove and 43 not upgraded.
6 upgraded, 135 newly installed, 0 to remove and 43 not upgraded.
2021-03-14 16:42:09 +01:00
Priit Laes b9c5c28c54 actions: ci: Use single apt install call
Reduces time for this step ~10%
2021-03-14 16:42:09 +01:00
Priit Laes 184a189f2a actions: ci: Enable ccache
Reduces build time with full cache from 20 to ~3 minutes.
2021-03-14 16:42:09 +01:00
Thomas Krijnen 37f549927d Update ci.yml 2021-03-14 12:29:05 +01:00
Thomas Krijnen a5fe3e77e7 Update ci.yml 2021-03-14 11:59:36 +01:00
Dion Moult 708da97bbd New IFC authoring mode - when enabled, exporting the IFC auto saves the Blender file too. See #1360. 2021-03-14 20:38:25 +11:00
Thomas Krijnen f80792091f #1290 Consider dimensionality in geometricset processing 2021-03-14 10:22:43 +01:00
Dion Moult a1e34b0acb Fix bug on Windows where sometimes, the body representation wouldn't be loaded by default. See #1290. 2021-03-14 19:34:18 +11:00
Thomas Krijnen e618232e70 clone --recursive in build-all.py 2021-03-14 09:32:38 +01:00
Dion Moult 922fc2beda Build fix 2021-03-14 18:04:57 +11:00
Dion Moult 4564ee3476 Fix bug where you couldn't add layers to a fresh project 2021-03-14 10:27:12 +11:00
Priit Laes 510dca1aca build: actions: Don't hardcode parallel builds to 10 in release workflow
And convert from deprecated `backtick` syntax to POSIX-compatible $(...)
2021-03-13 15:00:46 +01:00
Dion Moult 5604db8072 The IFC Debug inspector now also shows inverse references, great for debugging IFC2X3 or style relationships 2021-03-13 22:21:44 +11:00
Thomas Krijnen 5961253c29 #1376 remove_deep_batched() 2021-03-13 12:16:40 +01:00
Thomas Krijnen 624e296d24 #1368 fix layerset folding: check length thichkness ratio 2021-03-13 10:05:33 +01:00
Dion Moult 6ad605fbeb Minor fix 2021-03-13 10:11:17 +11:00
Dion Moult 797a5ec1a0 You can now delete objects in bulk 2021-03-13 09:58:22 +11:00
Dion Moult d56869d341 Create build on every commit to see what happens 2021-03-12 10:15:01 +11:00
Dion Moult 405e8bc5aa You can now automagically create arbitrary polygonal profiles with voids from meshes 2021-03-11 21:57:47 +11:00
Dion Moult b607242339 You can now add/edit/remove/assign/unassign structural analysis models 2021-03-11 10:46:55 +11:00
Dion Moult f57aa77ac2 You can now import structural curve members (again) 2021-03-10 21:18:55 +11:00
Dion Moult 01cc1887e0 Readd support for creating structural curves representations (vertex still WIP) 2021-03-10 21:10:00 +11:00
Dion Moult 003441a451 Add support for nano and micro meter units 2021-03-10 20:59:18 +11:00
Dion Moult 4b64f09aaa Fix #1370. Bug where loading pset templates makes it unable to install on Windows. 2021-03-10 20:28:08 +11:00
Dion Moult 4afcca8550 Adding drawings now creates groups and psets. Also very basic operator added to call IfcConvert from UI. See #1153. 2021-03-10 17:48:06 +11:00
Dion Moult 1a7ea1ea05 Provide upgrade / uninstall instructions to prevent users hitting that remove error message 2021-03-10 17:48:06 +11:00
Thomas Krijnen 5616a6ede5 SVG Ugh, fix transform syntax 2021-03-09 20:40:18 +01:00
Thomas Krijnen 28fa774a9a SVG --draw-storey-heights=left option 2021-03-09 16:11:42 +01:00
Thomas Krijnen 52d4fa4781 #1363 todo note 2021-03-09 09:57:18 +01:00
Thomas Krijnen 9258dc3104 IFC2X3 IfcAsymmetricIShapeProfileDef fillet radii 2021-03-09 09:55:40 +01:00
Thomas Krijnen 469fb9c204 SVG small fix 2021-03-09 09:52:47 +01:00
ahladik f7175a67c8 Shorten Boost pathnames and fix IfcParse::IfcSIPrefixToValue() (#1364) 2021-03-09 09:11:06 +01:00
Dion Moult ebfaeafeee You can now bulk assign / unassign construction types 2021-03-09 14:25:04 +11:00
Dion Moult 1f68c3f612 Fix bug where you could not assign a related window or door type. 2021-03-09 12:51:18 +11:00
Dion Moult aceb2140ad Fix #1361. You can now unlink objects and styles of elements that you've lost the IFC of to recover them. 2021-03-09 12:50:50 +11:00
Dion Moult 310d13ac75 Unbreak macos builds 2021-03-09 08:36:15 +11:00
Krande bc2ac6b31a Automated Blenderbim releases using github actions ci (#1354)
* Initial commit for suggested blenderbim github actions setup

* Changed the github repo address from fork to main repo for clarity

* Include python version info to appear on asset name. Consider using additional matrix loop on python versions 37 and 39. Currently hardcoded py37 for testing

* Cleanup of "python_fcl" files in dist/working before compiling BIMTester

* Loop over python 3.7 and 3.9 for all platforms and build 6 releases

* Set the correct repository name in the trigger. Also make the trigger only run when "[release]" is added in the commit message.
2021-03-09 08:11:47 +11:00
Thomas Krijnen 059c405652 Github actions nproc 2021-03-08 15:20:59 +01:00
Priit Laes 28d168b96c build: cmake: Improve OCC_LIBRARY_DIR detection 2021-03-08 14:53:07 +01:00
Priit Laes e4640df6f0 build: cmake: Rework OpenCascade header directory lookup 2021-03-08 14:53:07 +01:00
Thomas Krijnen 5c3642e1d1 Use BUILD_PACKAGE option 2021-03-08 14:52:57 +01:00
Thomas Krijnen 615f567ebf username 2021-03-08 14:52:57 +01:00
Thomas Krijnen a56ca661e8 BUILD_PACKAGE option 2021-03-08 14:52:57 +01:00
Thomas Krijnen 8ee9835e27 Change repo name 2021-03-08 14:52:57 +01:00
Christophe Prud'homme b26147c1c7 Release V 0.6.0 alpha 3 2021-03-08 14:52:57 +01:00
Christophe Prud'homme c3847ff38a add runtime depends 2021-03-08 14:52:57 +01:00
Christophe Prud'homme 8299505672 Release V 0.6.0 alpha.2 2021-03-08 14:52:57 +01:00
Christophe Prud'homme 0db743d3f7 Release V0.6.0 alpha 2
install in standard python dir
bump up version
2021-03-08 14:52:57 +01:00
Christophe Prud'homme e7558d0008 Release v0.6.0 alpha.1
add EXTRA_VERSION to set prerelease (to be set to null string for final release)

add release workflow
2021-03-08 14:52:57 +01:00
Christophe Prud'homme c9f40126c3 fix python package dir
@aothms the selection of the directory needs to fixed but the current choice is reasonnable
2021-03-08 14:52:57 +01:00
Christophe Prud'homme b0554e71d5 use GNUInstallDirs to define properly the installation directories
fix typo in name LIBARY -> LIBRARY
2021-03-08 14:52:57 +01:00
Christophe Prud'homme 1bed25408f up ci 2021-03-08 14:52:57 +01:00
Christophe Prud'homme 603a034ac6 use host ubuntu 20.04 2021-03-08 14:52:57 +01:00
Christophe Prud'homme 6f802ed770 prepare for docker image of ifcopenshell 2021-03-08 14:52:57 +01:00
Christophe Prud'homme c1b9062fa4 add package using cpack and install properly 2021-03-08 14:52:57 +01:00
Christophe Prud'homme e4f591babf add gh action 2021-03-08 14:52:57 +01:00
Thomas Krijnen e9c84d1c11 SVG Rotate dimension text 2021-03-08 14:19:07 +01:00
Dion Moult e62b7e94a4 Fix #1339. You can now search case insensitively for pset, prop and attribute names 2021-03-08 16:42:47 +11:00
Dion Moult e89d540236 Fix bug where assigning a new constituent or profile was borked. Also you can now reorder material lists and constituent set items. 2021-03-08 16:19:26 +11:00
Dion Moult fa23f64e9f Fix #1344. You can now reorder items in a material layer set 2021-03-08 14:20:43 +11:00
Dion Moult cfaa90b1fb Fix bug where material / style UI was showing without a loaded IFC 2021-03-08 12:11:29 +11:00
Dion Moult dc909f1fc6 Add support for adding material layer set usages to elements 2021-03-08 08:41:06 +11:00
Thomas Krijnen 30fc2ad580 SVG: Fix storey elevations 2021-03-07 12:07:40 +01:00
Thomas Krijnen c542fb2480 explicit cast 2021-03-07 10:22:22 +01:00
Dion Moult 25717d002f Fix bug where nested aggregates failed to import 2021-03-07 14:16:08 +11:00
Dion Moult 0181bd7e56 Add support for square and cubic decimetre units 2021-03-07 10:51:30 +11:00
Dion Moult 71c6bba36d Third time lucky. 2021-03-06 14:42:30 +11:00
Dion Moult eb539666d9 Second time lucky. 2021-03-06 14:02:22 +11:00
Dion Moult e43eec6203 Add support for Python 3.9 2021-03-06 09:36:42 +11:00
Thomas Krijnen 4ca64ac42e SVG: preliminary --draw-storey-heights 2021-03-05 21:50:32 +01:00
Priit Laes f51e0db7fe build: Check for libxml2
Fixes issue #1298

Signed-off-by: Priit Laes <plaes@plaes.org>
2021-03-05 21:36:18 +01:00
Thomas Krijnen b1e8e0a968 Update vs-cfg.cmd 2021-03-05 20:58:34 +01:00
Dion Moult be66a98cfa Implement support for showing IfcMaterialLayerSetUsage material types 2021-03-05 18:27:19 +11:00
Dion Moult 76487ea3bf Deprecate the "allow non-element aggregates" workaround for prostructures as the new aggregate system should make it obsolete. 2021-03-05 16:42:39 +11:00
Dion Moult 13fe011c75 Fix bug where sometimes cartesian point offsets wouldn't get detected correctly for poorly geolocated files 2021-03-05 16:38:51 +11:00
Dion Moult 266a341c6b You can now assign/unassign products to groups. Part of #1153 roadmap. 2021-03-05 15:37:40 +11:00
Dion Moult a5bcbe046f You can now view, add, edit, and remove IFC groups. Useful, but also needed for #1153. 2021-03-05 14:06:51 +11:00
Dion Moult ab057e3eff Fix bug where you couldn't do import profiling on Windows. Thanks erab! 2021-03-05 10:02:29 +11:00
Thomas Krijnen 6aa0651190 #1153 support IfcAnnotation with Box as drawing view 2021-03-04 14:39:32 +01:00
Thomas Krijnen 0f296c486f todo note 2021-03-04 14:38:36 +01:00
Dion Moult 29f64f7c11 Drawing cameras now save IfcBlock representations in IFC. See #1153. 2021-03-04 22:04:40 +11:00
Dion Moult d2d4a1b976 Bundle IfcConvert with the BlenderBIM Add-on. See #1153. 2021-03-04 20:54:31 +11:00
Dion Moult 249ff95920 Minor fix 2021-03-04 17:26:39 +11:00
Dion Moult 4c8d12d978 Fix bug where you could add psets of the same name multiple times 2021-03-04 17:02:05 +11:00
Dion Moult 04d02feb86 Null automatically toggles when you set a property in a pset now 2021-03-04 14:58:26 +11:00
Dion Moult e6700ea29b Fix bug where existing blender offsets weren't used when importing two offset models consecutively 2021-03-04 11:58:07 +11:00
Dion Moult 9c7c3d7078 Users can now toggle hiding of null / empty properties in case they are powerusers 2021-03-03 21:50:13 +11:00
Dion Moult 0d3175c6ef Improve pset UI to show if no properties are set 2021-03-03 21:42:00 +11:00
Dion Moult 04abadac22 You can now reassign classes in bulk 2021-03-03 21:16:51 +11:00
Jesusbill 0b39226869 update readme and changelog 2021-03-01 23:39:13 +01:00
Jesusbill 9e31991e75 add "bonded" case for mesh and run 2021-03-01 23:22:55 +01:00
QwiglyDee b40bd681b1 fixed disappearing extrusion gizmo 2021-03-01 23:46:52 +07:00
QwiglyDee 63384a730b WIP gizmo for parametreic extrusion, see #1324 2021-03-01 18:42:28 +07:00
Dion Moult b9f81b8014 Minor packaging fix 2021-03-01 10:57:48 +11:00
Dion Moult c34f357301 Minor fix 2021-03-01 10:52:21 +11:00
Dion Moult beb58b89fe Basic module for integration with Augin. Nice. 2021-03-01 10:52:09 +11:00
Thomas Krijnen 97df037c93 Reformat ids.py 2021-02-28 09:34:35 +01:00
Thomas Krijnen a7d8bffca5 Merge branch 'v0.6.0' of https://github.com/IfcOpenShell/IfcOpenShell into v0.6.0 2021-02-28 09:31:38 +01:00
Thomas Krijnen b5f58dc113 #1349 result formatting 2021-02-28 09:31:21 +01:00
Dion Moult 4e889b75d7 BIMTester can now accept both IDS .xml as well as Gherkin .feature files and generate HTML reports 2021-02-28 14:35:21 +11:00
Dion Moult 36cfb0d3f5 Meshes can now be automagically converted into circular and arbitrary profile extrusions (swept solids) 2021-02-28 12:04:30 +11:00
Dion Moult 5921bcb63d You can now automagically convert meshes into rectangular solid extrusions 2021-02-27 21:15:18 +11:00
Thomas Krijnen 23ad1a8005 Preliminary bSI IDS implementation 2021-02-27 11:04:45 +01:00
Thomas Krijnen f257aef8f4 #1348 special case profiledefwithvoids, needs more work 2021-02-27 10:58:22 +01:00
Thomas Krijnen 3eacd809b0 validate() docstring 2021-02-24 14:06:48 +01:00
Dion Moult e1b90ed3b2 Rebuild pset template UI to be less confusing and match the UX paradigm of other modules 2021-02-24 21:07:27 +11:00
Dion Moult 28c2d7248e Fix bug in where IfcCountMeasure and similar properties were not editable 2021-02-24 16:21:27 +11:00
Dion Moult 3bee746f49 Optimise aggregate creation on large file imports 2021-02-24 13:49:06 +11:00
Dion Moult eeb27bb1c7 Fix regression in last release where the file was loaded twice during import, which led to increased import times 2021-02-24 12:51:50 +11:00
Dion Moult d50c89abee Fix #1337. Changing the name of a Blender object now also auto changes its IFC name. 2021-02-23 21:15:27 +11:00
Dion Moult 15cf3f5afd Fix bug where undo operations may invalidate an ID map and break everything 2021-02-23 20:01:00 +11:00
Dion Moult 1e22dbca1e Meshes are auto updated in the IFC as well when edit mode is toggled now. 2021-02-23 19:19:06 +11:00
Dion Moult 28fbf0ea99 Minor fix 2021-02-23 18:55:42 +11:00
Dion Moult d874a0089d Add documentation for ifcpatch. 2021-02-22 22:04:23 +11:00
Dion Moult 441d842f67 You can now easily get and set the cursor location for local<->global coordinate conversions 2021-02-22 18:27:57 +11:00
Dion Moult 667ac307c3 Fix bug where cursor was not placed in the correct unit after a global->local coordinate conversion 2021-02-22 18:16:09 +11:00
Dion Moult c81031819c Fix bug where blender offsets were not considered in local<->global coordinate conversion 2021-02-22 18:15:22 +11:00
Dion Moult 7cbb87284c Fix bug where selecting high polygon meshes for debugging fails 2021-02-22 16:52:10 +11:00
RobinVanTol d0a9edd186 Update occ_utils.py 2021-02-21 16:04:42 +01:00
Dion Moult 425379aaad Bump IfcOpenShell build 2021-02-21 22:11:05 +11:00
johltn a1f740bd81 Don't use pointers for Representation elements 2021-02-21 11:41:04 +01:00
Dion Moult 25d86a50c5 Minor fix for previous commit 2021-02-21 11:55:04 +11:00
Dion Moult 0286cd370d Improve UI to change spatial container to prevent accidentally selecting incorrect objects 2021-02-21 11:24:27 +11:00
johltn 5be6954fd7 Made changes accordign to PR review 2021-02-20 15:35:33 +01:00
Dion Moult 0178804feb Fix bug where removing mapped representations leaving you with nothing was a poor user experience 2021-02-20 18:03:03 +11:00
Dion Moult 1892e9cc86 Fix bug where copying a class did not enforce mapped representations 2021-02-20 17:23:58 +11:00
Dion Moult 1b46f5c83a Fix bug where you couldn't edit the geometry of a grid axis 2021-02-20 17:13:36 +11:00
Dion Moult 3a0edab8c1 Blender now helps prevent saving Blender without having an exported IFC. See #1323. 2021-02-20 15:15:44 +11:00
Dion Moult 7032ee9f11 STEP IDs are now shown for non-rooted elements, like grid axes. 2021-02-20 13:53:11 +11:00
Dion Moult fd19b2d730 Fix #1312. Allow null ownership histories in IFC4. 2021-02-20 10:26:58 +11:00
Dion Moult a65b9f2ba7 You can now add type instances, and mapped representations are enforced. 2021-02-20 10:11:27 +11:00
Dion Moult 2db4a6f89f Fix bug where you couldn't copy classes without representations. 2021-02-20 09:21:18 +11:00
johltn 415203e9c2 Add HDF description in IfcConvert 2021-02-19 17:12:58 +01:00
johltn 029c2cc33d Cleaning 2021-02-19 17:05:32 +01:00
johltn 40266e7bf2 Fix constructor arguments names 2021-02-19 17:03:41 +01:00
johltn 9816e96a34 Add OCCT data to output file 2021-02-19 12:05:29 +01:00
johltn f4fc8914b8 Get BrepElement to triangulate + serialize from it 2021-02-19 11:52:32 +01:00
Thomas Krijnen 517b819504 .bat script typo 2021-02-19 10:43:47 +01:00
johltn aa9fd1de21 Get OCCT data 2021-02-18 20:54:22 +01:00
johltn 17bb42faab Add IFC entity type as element group attribute 2021-02-18 11:19:03 +01:00
johltn c7a0003ef4 Handle isyup 2021-02-18 10:41:54 +01:00
johltn 12983ea4fe Move HDF compound type definitions to constructor 2021-02-18 10:35:51 +01:00
johltn 0882bfaf3e Add faces existence condition and keep cleaning 2021-02-18 10:12:29 +01:00
Dion Moult a0f79cc0db Fix #1318 - unable to install add-on due to clash with Blender-OSM. 2021-02-18 17:45:06 +11:00
johltn bf24f46806 Change file extension and start cleaning 2021-02-17 17:20:03 +01:00
Thomas Krijnen 67666ed70e Attempt at https://github.com/IfcOpenShell/IfcOpenBot/issues/1 2021-02-17 16:06:50 +01:00
Dion Moult 6bcfa5946f New basic UI to view tasks in an IFC file 2021-02-17 22:54:11 +11:00
Dion Moult 52691b7ee5 You can now edit parameters of parametric profile definitions in geometry. 2021-02-17 22:03:41 +11:00
Dion Moult 780ea707b0 Highly experimental script to convert from IFC task trees into a Gantt chart JSON for jsgantt-improved 2021-02-17 21:17:02 +11:00
Dion Moult 7e7cfbdd5f Highly experimental script to convert from P6 XML into an IFC task tree. 2021-02-17 21:16:21 +11:00
Dion Moult ab102176cc IfcOpenShell date util now supports converting to IFC2X3 date entities 2021-02-17 21:12:04 +11:00
johltn b69b2fb960 Use compound types for the 3 datasets 2021-02-17 10:38:27 +01:00
Thomas Krijnen d7f289bc8a Update stylesheet 2021-02-16 20:23:36 +01:00
johltn ba5751e535 Create Positions, Normals, and Indices datasets 2021-02-16 13:13:00 +01:00
Thomas Krijnen 95a34cb8d0 Update stylesheet 2021-02-16 12:13:59 +01:00
Dion Moult 8369818b88 Fix bug where geolocation was lost if you tried to edit an absolutely positioned file 2021-02-16 20:27:37 +11:00
Dion Moult 5251bdabc6 Fix bug #1315 - regression in the absolute coordinate offset feature where I forgot to convert non-meter units. 2021-02-16 18:50:04 +11:00
Dion Moult 83c33dd5b0 Fix bug where only a light removal occured when removing elements. Now, a full geometry purge is done as well. 2021-02-16 11:12:42 +11:00
johltn 13cda38e0c Change datatype type and arg 2021-02-15 22:26:04 +01:00
johltn fbf1ad14b2 Change file extension 2021-02-15 21:23:08 +01:00
johltn 08f7008cb5 Create first groups and datasets 2021-02-15 21:17:35 +01:00
Thomas Krijnen bfc695c756 #1311 better error handling during parse for schema and header 2021-02-15 11:11:14 +01:00
Thomas Krijnen 459faec01a #1311 normalize schema name case 2021-02-14 17:39:15 +01:00
Thomas Krijnen 4fb65199b8 Validate: better handling of boxed enum 2021-02-14 17:32:08 +01:00
Thomas Krijnen 08576e28d6 fixed boxed enum validation 2021-02-14 17:23:16 +01:00
Thomas Krijnen b3f581d78d Handle boxed enum creation in Python 2021-02-14 17:22:15 +01:00
Thomas Krijnen 89d6b3d21a Fixes for RC2 changes re IfcPoint and IfcSegment 2021-02-14 17:21:58 +01:00
Thomas Krijnen d2bf2cf46e Pick RC2 definitions where required 2021-02-14 17:21:34 +01:00
Thomas Krijnen 43b2982dbb fix char encoding issue in source 2021-02-14 17:20:55 +01:00
Thomas Krijnen e750a134d0 Add generated rc2 schemas 2021-02-14 17:20:34 +01:00
Thomas Krijnen 6bbbc528fe prep for 4x3_rc2 2021-02-14 12:43:27 +01:00
Thomas Krijnen 7f4a436708 regen schema 2021-02-14 12:43:09 +01:00
johltn 274235ebea Initialize file 2021-02-14 12:23:43 +01:00
Thomas Krijnen e6592ca706 conversion rules for first citizin enum types #1276 2021-02-14 12:19:06 +01:00
Thomas Krijnen cc2138463e Merge branch 'v0.6.0' of https://github.com/IfcOpenShell/IfcOpenShell into v0.6.0 2021-02-14 09:49:03 +01:00
Thomas Krijnen 6de3e55d19 make wrapper import in schema_class optional 2021-02-14 09:43:10 +01:00
Dion Moult 595131e6e8 Fix #1313. Fix bug where you couldn't import two different IFC files in succession in the same Blender file. 2021-02-14 17:27:10 +11:00
Dion Moult 6966da3bdf Switching construction type now has an option to map representations 2021-02-14 16:50:27 +11:00
Thomas Krijnen 4e897a0c21 surface style ids on serialization 2021-02-13 16:03:57 +01:00
Long 73a9015801 ifcpatch make.py (#1319) 2021-02-13 20:23:59 +11:00
Dion Moult 1b2bebecb0 You can now assign types with a smart type filter, without needing to first import types into Blender 2021-02-13 18:29:52 +11:00
Dion Moult e4dee2258d Fix #1300. New IfcOpenShell.util.type module for checking applicable type classes. 2021-02-13 18:27:02 +11:00
Long 7de3eec1b1 make ifcpatch callable from command line (#1317) 2021-02-13 10:06:15 +11:00
johltn addef5dfa3 Create HdfSerializer based on ObjSerializer 2021-02-12 17:32:43 +01:00
johltn 84550fddcb Clean CMakeLists.txt 2021-02-12 15:34:07 +01:00
johltn 6a3390dbb6 Fix compilation 2021-02-12 15:30:10 +01:00
rbertucat 20fe48bd6a BuildingSmart IFCRail changes to BIMTester (#1309)
* Add a way to validate the IFC file in BIMTester

* Fix an issue in Report where only the first error was shown

* Fix the usage of Schema in BIMTester

* Add Aggreation steps to BIMTester
2021-02-12 09:34:10 +11:00
johltn ec04644c54 Building process changes 2021-02-11 11:41:15 +01:00
johltn 84b37af72d Merge branch 'v0.6.0' into hdf5 2021-02-10 16:04:56 +01:00
Thomas Krijnen 1d6b2dcb37 SVG: IfcAnnotation objectype handling 2021-02-09 14:04:01 +01:00
Thomas Krijnen 45f3e677df Also process wires as part of geometric sets 2021-02-09 14:03:35 +01:00
Jesse Vander Does 65160f9bb4 Removed new line 2021-02-09 13:43:29 +01:00
Jesse Vander Does 333ba08841 Added '--no-wire-intersection-tolerance' option 2021-02-09 13:43:29 +01:00
Jesse Vander Does 2cb3b0817f Updated description 2021-02-09 13:43:29 +01:00
Jesse Vander Does 4ea95960a2 Added '--strict-tolerance' option 2021-02-09 13:43:29 +01:00
Jesse Vander Does 10f4bca5d2 Moved no wire flag inside of wire_intersections method 2021-02-09 13:43:29 +01:00
Jesse Vander Does d4a01618cd Fixed white space 2021-02-09 13:43:29 +01:00
Jesse Vander Does c9c6529978 Added '--no-wire-intersection-check' 2021-02-09 13:43:29 +01:00
Jesse Vander Does 2829a0764b Remove wire intersection check to preserve faces 2021-02-09 13:43:29 +01:00
Dion Moult 76d61cb4d4 Minor fix - map representation now only does that, and nothing more 2021-02-07 22:15:21 +11:00
Dion Moult e9d2a39166 Only IFC files are now shown in the export file dialog for a less confusing user experience 2021-02-07 20:00:26 +11:00
Dion Moult d08f4171e3 Type representations are now always imported (better for authoring), and also import super fast compared to before (before, enabling types being imported would significantly slow down import times) 2021-02-07 19:57:32 +11:00
Dion Moult 23483eafb3 Fix bug where removing a mapped representation did not properly considered all mapped usages 2021-02-07 19:13:36 +11:00
Dion Moult 686ba2536b Fix bug where you could create mapped representations without having a type product 2021-02-07 19:08:34 +11:00
Dion Moult 7d5ac99f34 Fix bug where representations wouldn't be purged correctly if they were part of a layer with many items 2021-02-07 19:05:56 +11:00
Dion Moult 9b8d224aca Minor fix 2021-02-07 13:27:23 +11:00
Dion Moult 8939d93333 Fix bug where product and type representations wouldn't be linked in Blender when importing 2021-02-07 12:53:41 +11:00
Dion Moult 04aad216ba Type representation maps are now shown in the IFC Representations UI panel 2021-02-07 11:44:14 +11:00
aothms 27eb9d340a sphinx theme 2021-02-06 15:24:17 +00:00
aothms fbb53f93d8 Merge branch 'v0.6.0' of https://github.com/IfcOpenshell/IfcOpenShell into v0.6.0 2021-02-06 15:11:00 +00:00
aothms af6aed80da Documentation changes 2021-02-06 15:10:41 +00:00
Dion Moult 92ba412c95 Fix bug where add grids didn't work. See #1284. 2021-02-06 15:24:53 +11:00
Dion Moult 110c382973 Fix ability to create grids which was totally broken 2021-02-06 15:14:38 +11:00
Dion Moult 977df60f05 Fix #1283 - dumb objects now have an assigned class 2021-02-06 08:01:29 +11:00
Thomas Krijnen 22067992cb Update HDF5 version 2021-02-05 21:33:58 +01:00
Thomas Krijnen 539d77b5ad #1247 Boost_NO_BOOST_CMAKE=On 2021-02-05 17:04:37 +01:00
Thomas Krijnen 70f109ce09 Initial setup 2021-02-05 13:47:54 +01:00
aothms ea34c3de85 Changes to docs 2021-02-05 12:01:57 +00:00
Thomas Krijnen 9374594920 Merge pull request #1297 from IfcOpenShell/docs
Documentation generation by @johltn
2021-02-05 11:57:14 +01:00
1443 changed files with 484481 additions and 80561 deletions
+1
View File
@@ -1,3 +1,4 @@
# These are supported funding model platforms
github: [aothms]
open_collective: opensourcebim
+116
View File
@@ -0,0 +1,116 @@
name: CD
on:
push:
jobs:
activate:
runs-on: ubuntu-latest
if: |
github.repository == 'IfcOpenShell/IfcOpenShell' &&
!startsWith(github.event.head_commit.message, 'Release ') &&
!contains(github.event.head_commit.message, 'ci skip')
steps:
- run: echo ok go
build:
runs-on: ubuntu-20.04
needs: activate
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt update
sudo apt-get install --no-install-recommends \
git cmake gcc g++ libboost-all-dev python3-all-dev swig libpcre3-dev libxml2-dev \
libocct-foundation-dev libocct-modeling-algorithms-dev libocct-modeling-data-dev libocct-ocaf-dev libocct-visualization-dev libocct-data-exchange-dev \
libhdf5-dev libcgal-dev
-
name: ccache
uses: hendrikmuhs/ccache-action@v1
-
name: Build ifcopenshell
run: |
mkdir build && cd build
cmake \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_INSTALL_PREFIX=$PWD/install/ \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=/usr \
-DCMAKE_SYSTEM_PREFIX_PATH=/usr \
-DBUILD_PACKAGE=On \
-DOCC_INCLUDE_DIR=/usr/include/opencascade \
-DOCC_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
-DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 \
-DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.8 \
-DPYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.8.so \
-DCOLLADA_SUPPORT=Off \
-DLIBXML2_INCLUDE_DIR=/usr/include/libxml2 \
-DLIBXML2_LIBRARIES=/usr/lib/x86_64-linux-gnu/libxml2.so \
-DCGAL_INCLUDE_DIR=/usr/include \
-DGMP_INCLUDE_DIR=/usr/include \
-DMPFR_INCLUDE_DIR=/usr/include \
-DGMP_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
-DMPFR_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
-DHDF5_INCLUDE_DIR=/usr/include/hdf5/serial \
../cmake
make -j $(nproc)
make install
-
name: Package
run: |
make package
working-directory: build
- name: Upload
uses: actions/upload-artifact@v2
with:
# Artifact name
name: ifcos-artifacts
# Directory containing files to upload
path: build/assets/Ifc*
deliver:
runs-on: ubuntu-20.04
needs: build
name: Docker Build, Tag, Push
steps:
- uses: actions/checkout@v2
with:
lfs: true
- name: Download
uses: actions/download-artifact@v2
with:
# Artifact name
name: ifcos-artifacts
path: artifacts/
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to Dockerhub
uses: docker/login-action@v1
with:
username: aecgeeks
password: ${{ secrets.DOCKER_HUB_TOKEN }}
-
name: Build container image
uses: docker/build-push-action@v2
with:
context: artifacts
repository: aecgeeks/ifcopenshell
tags: aecgeeks/ifcopenshell:latest
file: ./Dockerfile
push: true
+38
View File
@@ -0,0 +1,38 @@
name: ci-bcf
on:
push:
jobs:
activate:
runs-on: ubuntu-latest
if: |
github.repository == 'IfcOpenShell/IfcOpenShell' &&
contains(github.event.head_commit.message, '[bcf release]')
steps:
- run: echo ok go
upload:
needs: activate
name: Upload BCF package to Pypi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Build package
run: |
cd src/bcf
pip install build
python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
packages_dir: src/bcf/dist
@@ -0,0 +1,68 @@
name: Publish-blenderbim-multiplatform
on:
push:
paths:
- 'src/blenderbim/**'
- '.github/workflows/ci-blenderbim-matrix.yml'
branches:
- v0.7.0
env:
major: 0
minor: 0
name: blenderbim
jobs:
activate:
runs-on: ubuntu-latest
if: |
github.repository == 'IfcOpenShell/IfcOpenShell'
steps:
- name: Set env
run: echo ok go
build:
name: ${{ matrix.config.name }}-${{ matrix.pyver }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pyver: [py37, py39]
config:
- {
name: "Windows Build",
short_name: win,
}
- {
name: "Linux Build",
short_name: linux
}
- {
name: "MacOS Build",
short_name: macos
}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
with:
python-version: '3.7.7' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- run: echo ${{ env.DATE }}
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%y%m%d')"
- 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 }}
- 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.date.outputs.date}}-${{ matrix.pyver }}-${{ matrix.config.short_name }}.zip
asset_name: blenderbim-${{steps.date.outputs.date}}-${{ matrix.pyver }}-${{ matrix.config.short_name }}.zip
tag: "blenderbim-${{steps.date.outputs.date}}"
overwrite: true
body: "Daily developer testing build blenderbim-${{steps.date.outputs.date}}"
+92
View File
@@ -0,0 +1,92 @@
name: ci
on:
push:
paths:
- 'src/**'
- 'test/**'
- 'conda/**'
- 'cmake/**'
- '.github/workflows/ci.yml'
pull_request:
jobs:
activate:
runs-on: ubuntu-latest
if: |
github.repository == 'IfcOpenShell/IfcOpenShell' &&
!contains(github.event.head_commit.message, 'skip ci')
steps:
- run: echo ok go
build:
runs-on: ubuntu-20.04
needs: activate
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install C++ dependencies
run: |
sudo apt update
sudo apt-get install --no-install-recommends \
git cmake gcc g++ \
libboost-date-time-dev \
libboost-filesystem-dev \
libboost-iostreams-dev \
libboost-program-options-dev \
libboost-regex-dev \
libboost-system-dev \
libboost-thread-dev \
python3-all-dev python3-pip \
swig libpcre3-dev libxml2-dev \
libtbb-dev nlohmann-json3-dev \
libocct-foundation-dev libocct-modeling-algorithms-dev libocct-modeling-data-dev libocct-ocaf-dev libocct-visualization-dev libocct-data-exchange-dev \
libhdf5-dev libcgal-dev
- name: ccache
uses: hendrikmuhs/ccache-action@v1
- name: Build ifcopenshell
run: |
mkdir build && cd build
cmake \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=/usr \
-DCMAKE_SYSTEM_PREFIX_PATH=/usr \
-DOCC_INCLUDE_DIR=/usr/include/opencascade \
-DOCC_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
-DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 \
-DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.8 \
-DPYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.8.so \
-DCOLLADA_SUPPORT=Off \
"-DSCHEMA_VERSIONS=2x3;4" \
-DGLTF_SUPPORT=On \
-DJSON_INCLUDE_DIR=/usr/include \
-DCGAL_INCLUDE_DIR=/usr/include \
-DGMP_INCLUDE_DIR=/usr/include \
-DMPFR_INCLUDE_DIR=/usr/include \
-DGMP_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
-DMPFR_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
-DHDF5_INCLUDE_DIR=/usr/include/hdf5/serial \
../cmake
sudo make -j $(nproc)
sudo make install
- name: Install Python dependencies
run: |
sudo /usr/bin/python -m pip install -U pip
sudo /usr/bin/python -m pip install xmlschema numpy lxml
sudo /usr/bin/python -m pip install src/bcf
sudo /usr/bin/python -m pip install pytest
sudo /usr/bin/python -m pip install isodate
- name: Test
run: |
cd test
sudo /usr/bin/python tests.py
cd ../src/ifcopenshell-python
mv ifcopenshell ifcopenshell-local # Force testing on installed module
make test
+99
View File
@@ -0,0 +1,99 @@
name: Release
on:
push:
tags:
- 'v[0-9].[0-9].[0-9]*'
jobs:
activate:
if: github.repository == 'IfcOpenShell/IfcOpenShell'
runs-on: ubuntu-latest
steps:
- run: echo ok go
build:
needs: activate
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
lfs: true
-
name: Update ubuntu
run: |
sudo apt update
sudo apt-get install git cmake gcc g++ libboost1.67-all-dev python3-all-dev swig libpcre3-dev libxml2-dev
sudo apt-get install libocct-foundation-dev libocct-modeling-algorithms-dev libocct-modeling-data-dev libocct-ocaf-dev libocct-visualization-dev libocct-data-exchange-dev \
libhdf5-dev
- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mkdir build && cd build
cmake \
-DCMAKE_INSTALL_PREFIX=$PWD/install/ \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=/usr \
-DCMAKE_SYSTEM_PREFIX_PATH=/usr \
-DBUILD_PACKAGE=On \
-DOCC_INCLUDE_DIR=/usr/include/opencascade \
-DOCC_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
-DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 \
-DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.8 \
-DPYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.8.so \
-DCOLLADA_SUPPORT=Off \
-DLIBXML2_INCLUDE_DIR=/usr/include/libxml2 \
-DLIBXML2_LIBRARIES=/usr/lib/x86_64-linux-gnu/libxml2.so \
-DHDF5_INCLUDE_DIR=/usr/include/hdf5/serial \
../cmake
make -j $(nproc)
make install
- name: Package
id: package
run: |
make package
echo ::set-output name=tgz::$( ls assets/*.tar.gz | head -n 1 | xargs basename )
echo ::set-output name=deb::$( ls assets/*.deb | head -n 1 | xargs basename )
working-directory: build
env:
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release
id: release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: true
body: |
Changes to this release
- add github actions support #1306
- add boost depends to ifcopenshell deb packaging
- <add more changes here>
See more details in the documentation
# body_path: build/CHANGELOG.md
- name: Upload TGZ
id: upload-tgz
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: build/assets/${{ steps.package.outputs.tgz }}
asset_name: ${{ steps.package.outputs.tgz }}
asset_content_type: application/x-gzip
- name: Upload DEB
id: upload-deb
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: build/assets/${{ steps.package.outputs.deb }}
asset_name: ${{ steps.package.outputs.deb }}
asset_content_type: application/vnd.debian.binary-package
+37 -3
View File
@@ -1,7 +1,10 @@
# Dependency and build folders created by the build scripts
/deps*/
/build*/
/install*/
/_deps/
/_build-vs*-x*/
/_deps-vs*-x*-installed/
/_installed-vs*-x*/
/build/
/win/BuildDepsCache*.txt
# IfcExpressParser residue
/src/ifcexpressparser/express_parser.py
@@ -13,6 +16,10 @@ __pycache__
# PyCharm files
.idea
#Virtual Env Files
Pipfile
Pipfile.lock
# Docs
/docs/output
/docs/rst_files
@@ -21,5 +28,32 @@ __pycache__
# gettext binary translation files
*.mo
# Vim
*.swp
*.swo
# Flask
instance/*
!instance/.gitignore
.webassets-cache
.env
*.db
# Byte-compiled / optimized / DLL files
*.py[cod]
*$py.class
# pipenv
Pipfile
Pipfile.lock
# Database
*.db
# PyTest
htmlcov
.coverage
# Blender
*.blend1
+3
View File
@@ -5,3 +5,6 @@
[submodule "src/ifcopenshell-python/ifcopenshell/mvd"]
path = src/ifcopenshell-python/ifcopenshell/mvd
url = https://github.com/opensourceBIM/python-mvdxml/
[submodule "src/svgfill"]
path = src/svgfill
url = https://github.com/IfcOpenShell/svgfill
+53 -38
View File
@@ -1,57 +1,69 @@
language: cpp
compiler: gcc
cache: ccache
os: linux
dist: bionic
sudo: required
before_install:
- "sudo add-apt-repository -y ppa:freecad-community/ppa"
- sudo apt-get update -qq
dist: focal
addons:
apt:
update: true
packages:
- libboost-date-time-dev
- libboost-filesystem-dev
- libboost-iostreams-dev
- libboost-program-options-dev
- libboost-regex-dev
- libboost-system-dev
- libboost-thread-dev
- libocct-data-exchange-dev
- libocct-foundation-dev
- libocct-modeling-algorithms-dev
- libocct-modeling-data-dev
- libxml2-dev
- nlohmann-json3-dev
- opencollada-dev
- python3-all-dev
- python3-pip
- swig
- libhdf5-dev
before_script:
- if [ $TRAVIS_OS_NAME == "linux" ]; then ccache -z; fi
install:
- |
sudo apt-get install -y \
libocct-data-exchange-dev libocct-foundation-dev libocct-modeling-algorithms-dev libocct-modeling-data-dev \
libboost-system-dev libboost-program-options-dev libboost-regex-dev libboost-thread-dev libboost-date-time-dev libboost-iostreams-dev libboost-filesystem-dev \
build-essential cmake python2.7 libpython2.7-dev swig zlib1g liblzma5 opencollada-dev wget apt-transport-https
- sudo mkdir -p /usr/include/json/nlohmann/
- sudo wget https://github.com/nlohmann/json/releases/download/v3.6.1/json.hpp -O /usr/include/json/nlohmann/json.hpp
# - sudo sh -c 'curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
# - sudo sh -c 'curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
# - sudo apt-get update -qq && sudo apt-get install -y dart
# - export PATH=$PATH:/usr/lib/dart/bin:$HOME/.pub-cache/bin
# - git clone https://github.com/KhronosGroup/glTF-Validator && pushd glTF-Validator && pub get && pub global activate --source path ./ && popd
# for IDS
- python3 -m pip install xmlschema
script:
- pwd
- cd cmake
- mkdir build
- cd build
- mkdir build && cd build
- |
cmake \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DOCC_INCLUDE_DIR=/usr/include/opencascade \
-DOCC_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
-DPYTHON_LIBRARY=/usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so \
-DPYTHON_INCLUDE_DIR=/usr/include/python2.7 \
-DPYTHON_EXECUTABLE=/usr/bin/python2.7 \
-DLIBXML2_INCLUDE_DIR=/usr/include/libxml2 \
-DLIBXML2_LIBRARIES="/usr/lib/x86_64-linux-gnu/libxml2.so;/lib/x86_64-linux-gnu/libz.so.1;/lib/x86_64-linux-gnu/liblzma.so.5;/usr/lib/x86_64-linux-gnu/libicuuc.so.60;/usr/lib/x86_64-linux-gnu/libicudata.so.60" \
-DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 \
-DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.8 \
-DPYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.8.so \
"-DSCHEMA_VERSIONS=2x3;4" \
-DGLTF_SUPPORT=On \
-DJSON_INCLUDE_DIR=/usr/include/json \
..
- sudo make -j2 install
- cd ../../test
- /usr/bin/python2.7 tests.py
-DJSON_INCLUDE_DIR=/usr/include \
-DHDF5_INCLUDE_DIR=/usr/include/hdf5/serial \
../cmake
# TODO: Drop sudo
- sudo make -j $(nproc) install
- cd ../test
- /usr/bin/python tests.py
- /usr/bin/python ../src/ifcopenshell-python/ifcopenshell/test_ids.py
- cd input
- /usr/local/bin/IfcConvert -yv acad2010_walls.ifc acad2010_walls.glb
# - gltf_validator acad2010_walls.glb
- /usr/bin/python2.7 -c "from __future__ import print_function; from io import open; import ifcopenshell; f = ifcopenshell.open('encoding.ifc'); assert list(map(ord, f[1][0])) == [39, 97, 39, 32, 49, 109, 179, 32, 8804, 32, 53, 109, 179, 32, 8805, 32, 49, 48, 109, 179]"
- /usr/bin/python -c "from io import open; import ifcopenshell; f = ifcopenshell.open('encoding.ifc'); assert list(map(ord, f[1][0])) == [39, 97, 39, 32, 49, 109, 179, 32, 8804, 32, 53, 109, 179, 32, 8805, 32, 49, 48, 109, 179]"
- |
(for i in *.ifc; do \
echo $i | tee -a log; \
@@ -64,3 +76,6 @@ script:
- echo Succeeded
- grep 0$ statuses
- grep 0$ statuses | wc -l
after_script:
- if [ $TRAVIS_OS_NAME == "linux" ]; then ccache -s; fi
+2 -2
View File
@@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -618,4 +618,4 @@ an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
END OF TERMS AND CONDITIONS
+1 -1
View File
@@ -1,7 +1,7 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
+37
View File
@@ -0,0 +1,37 @@
# -*- mode: Dockerfile -*-
FROM ubuntu:focal
ARG CHANNEL
ENV CHANNEL=${CHANNEL:-latest}
RUN apt-get update \
&& apt-get install -y \
vim \
ssh \
sudo \
wget \
software-properties-common ;\
rm -rf /var/lib/apt/lists/*
RUN useradd --user-group --create-home --shell /bin/bash IfcOpenShell ;\
echo "IfcOpenShell ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
ENV DEBIAN_FRONTEND=noninteractive
RUN echo "deb http://archive.ubuntu.com/ubuntu focal-proposed main restricted" | tee -a /etc/apt/sources.list; \
echo "deb http://archive.ubuntu.com/ubuntu focal-proposed universe" | tee -a /etc/apt/sources.list; \
echo "deb http://archive.ubuntu.com/ubuntu focal-proposed multiverse" | tee -a /etc/apt/sources.list; \
apt-get -qq update; \
apt-get -y install tzdata dos2unix rsync; \
apt-get -y install python3 libxml2 liboce-foundation11 liboce-modeling11 liboce-ocaf11 liboce-visualization11 \
liboce-ocaf-lite11 libpython3.8 libboost-system1.67.0 libboost-program-options1.67.0 \
libboost-regex1.67.0 libboost-thread1.67.0 libboost-date-time1.67.0; \
rm -rf /var/lib/apt/lists/* ;
COPY . /home/IfcOpenShell/
RUN ls -lrtR /home/IfcOpenShell
RUN dpkg -i /home/IfcOpenShell/*.deb
USER IfcOpenShell
+100 -18
View File
@@ -1,7 +1,9 @@
IfcOpenShell
============
IfcOpenShell is an open source ([LGPL]) software library for working with the Industry Foundation Classes ([IFC])
file format. Currently supported IFC releases are [IFC2x3 TC1] and [IFC4 Add2 TC1].
file format. Extensive geometric support is implemented for the IFC releases [IFC2x3 TC1] and [IFC4 Add2 TC1].
Support for parsing is provided for IFC4x1, IFC4x2, and the IFC4x3 release candidates. Extending with support for
arbitrary IFC schemas is possible at compile-time when using C++ and at run-time when using Python.
For more information, see
* [http://ifcopenshell.org](http://ifcopenshell.org)
@@ -13,14 +15,14 @@ Prerequisites
-------------
* Git
* CMake (2.6 or newer)
* Windows: [Visual Studio] 2008 or newer with C++ toolset (or [Visual C++ Build Tools]) or [MSYS2] + MinGW
* Windows: [Visual Studio] 2008 to 2019 (2022 not yet supported by dependency CMake) with C++ toolset (or [Visual C++ Build Tools]) or [MSYS2] + MinGW
* *nix: GCC 4.7 or newer, or Clang (any version)
Dependencies
-------------
* [Boost](http://www.boost.org/)
* [Open Cascade](http://opencascade.org) - *optional*, but required for building IfcGeom
([official](http://www.opencascade.org/getocc/download/loadocc/), "OCCT", or [community edition](https://github.com/tpaviot/oce), "OCE")
* [Open Cascade](https://dev.opencascade.org/) - *optional*, but required for building IfcGeom
([official](https://dev.opencascade.org/release), "OCCT", or [community edition](https://github.com/tpaviot/oce), "OCE")
For converting IFC representation items into BRep solids and tesselated meshes
* [OpenCOLLADA](https://github.com/khronosGroup/OpenCOLLADA/) - *optional*
For IfcConvert to be able to write tessellated Collada (.dae) files
@@ -33,7 +35,9 @@ Dependencies
Building IfcOpenShell
---------------------
**Note:** The path where the source code is cloned to can contain spaces but non-ASCII characters are very likely to cause problems with the build.
Note 1: The path where the source code is cloned to can contain spaces but non-ASCII characters are very likely to cause problems with the build.
Note 2: If you had not used `git clone --recursive https://github.com/IfcOpenShell/IfcOpenshell.git`, update the submodules by running `git submodule init & git submodule update`.
### Compiling on Windows
The preferred way to fetch and build this project's dependencies is to use the build scripts
@@ -81,17 +85,26 @@ The following instructions are for Ubuntu, modify as required for other operatin
can be experimented with and studied for pointers for other operating systems, but note that this script is not currently
meant to be used for a typical IfcOpenShell workspace setup.
Note: where `make -j` is written, add a number roughly equal to the amount of CPU cores + 1.
Note 1: It is recommeded to use OCCT for IfcOpenShell. You could use OCE as well, but sometimes it may lag behind OCCT and
therefore not compile with the latest IfcOpenShell.
Note 2: where `make -j` is written, add a number roughly equal to the amount of CPU cores + 1.
**1)** Install most of the prerequisites and dependencies:
$ sudo apt-get install git cmake gcc g++ libboost-all-dev
$ sudo apt-get install git cmake gcc g++ libboost-all-dev libcgal-dev
**2a)** Either use an OCE package from your operating system's software repository
**2a)** Either use an OCCT package from your operating system's software repository
$ sudo apt-get install libocct-data-exchange-dev libocct-draw-dev libocct-foundation-dev libocct-modeling-algorithms-dev libocct-modeling-data-dev libocct-ocaf-dev libocct-visualization-dev
**2b)** or, if OCCT is not available or the latest code is wanted, obtain and compile OCCT from https://dev.opencascade.org/release
**2c)** or, if you'd like to try using OCE, use the package from your operating system's software repository
$ sudo apt-get install liboce-foundation-dev liboce-modeling-dev liboce-ocaf-dev liboce-visualization-dev liboce-ocaf-lite-dev
**2b)** or (if not available, or the latest code is wanted) compile OCE yourself (note that the build takes a long time):
**2d)** or if OCE is not available, or the latest code is wanted, compile OCE yourself (note that the build takes a long time)
$ sudo apt-get install libftgl-dev libtbb2 libtbb-dev libgl1-mesa-dev libfreetype6-dev
$ git clone https://github.com/tpaviot/oce.git
@@ -101,8 +114,6 @@ Note: where `make -j` is written, add a number roughly equal to the amount of CP
$ make -j
$ sudo make install
**2c)** or obtain and compile OCCT from http://www.opencascade.org/getocc/download/loadocc/
**3)** For building IfcConvert with COLLADA (.dae) support (on by default), OpenCOLLADA is needed:
$ sudo apt-get install libpcre3-dev libxml2-dev
@@ -128,7 +139,13 @@ dependencies' paths. `OCC_INCLUDE_DIR` might be needed to set also. `OPENCOLLADA
$ cmake ../cmake -DOCC_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu/ \
-DOPENCOLLADA_INCLUDE_DIR="/usr/local/include/opencollada" \
-DOPENCOLLADA_LIBRARY_DIR="/usr/local/lib/opencollada" \
-DPCRE_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu/
-DPCRE_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu/ \
-DCGAL_INCLUDE_DIR=/usr/include \
-DGMP_INCLUDE_DIR=/usr/include \
-DMPFR_INCLUDE_DIR=/usr/include \
-DGMP_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
-DMPFR_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
-DHDF5_SUPPORT=Off
$ make -j
If all worked out correctly you can now use IfcOpenShell. See the examples below.
@@ -136,6 +153,34 @@ If all worked out correctly you can now use IfcOpenShell. See the examples below
**6)** Install the project if wanted:
$ sudo make install
### Installing on MacOS Using Homebrew
**1)** Install all dependencies using [Homebrew](https://brew.sh/)
```{shell}
$ brew install boost swig cmake ftgl cgal gmp libaec opencascade
```
**2)** Clone the git repo and its submodules
```{shell}
$ git clone --recurse-submodules https://github.com/IfcOpenShell/IfcOpenShell.git
```
**3)** Build IfcOpenShell with flags for Homebrew dependencies (```/usr/local/```)
```{shell}
$ cd /path/to/IfcOpenShell
$ mkdir build && cd build
$ cmake ../cmake -DOCC_LIBRARY_DIR=/usr/local/lib/ \
-DOCC_INCLUDE_DIR=/usr/local/include/opencascade/ \
-DCOLLADA_SUPPORT=0 \
-DCGAL_INCLUDE_DIR=/usr/local/include/ \
-DGMP_LIBRARY_DIR=/usr/local/lib/ \
-DMPFR_LIBRARY_DIR=/usr/local/lib/
$ make -j -lboost_options
```
Note: Make sure to compile using XCode, rather than a ```brew``` installed C/C++ compiler.
Installing IfcOpenShell with Conda
----------------------------------
@@ -151,14 +196,14 @@ Usage examples
**Invoking IfcConvert from the command line**
$ wget ftp://ftp.dds.no/pub/ifc/Munkerud/Munkerud_hus6_BE.zip
$ unzip Munkerud_hus6_BE.zip
$ ./IfcConvert Munkerud_hus6_BE.ifc
$ less Munkerud_hus6_BE.obj
$ wget -O duplex.zip https://portal.nibs.org/files/wl/\?id=4DsTgHFQAcOXzFetxbpRCECPbbfUqpgo
$ unzip duplex.zip
$ ./IfcConvert Duplex_A_20110907_optimized.ifc
$ less Duplex_A_20110907_optimized.obj
**Using the IfcOpenShell Python interface**
$ wget -O duplex.zip https://portal.nibs.org/files/wl/?id=4DsTgHFQAcOXzFetxbpRCECPbbfUqpgo
$ wget -O duplex.zip https://portal.nibs.org/files/wl/\?id=4DsTgHFQAcOXzFetxbpRCECPbbfUqpgo
$ unzip duplex.zip
$ python
>>> import ifcopenshell
@@ -217,7 +262,44 @@ Usage examples
>>> # Writing IFC-SPF files to disk:
>>> f.write("out.ifc")
[LGPL]: https://github.com/IfcOpenShell/IfcOpenShell/tree/master/COPYING "LGPL"
Extra tools
-----------
Also available are a series of utilities that are based on or related to IfcOpenShell.
Those marked with an asterisk are part of IfcOpenShell.
Name | License
--- | ---
bcf | LGPL-3.0-or-later
blenderbim | GPL-3.0-or-later
bsdd | LGPL-3.0-or-later
ifc2ca | LGPL-3.0-or-later
ifc4d | LGPL-3.0-or-later
ifc5d | LGPL-3.0-or-later
ifcbimtester | LGPL-3.0-or-later
ifcblender | LGPL-3.0-or-later\*
ifccityjson | LGPL-3.0-or-later
ifcclash | LGPL-3.0-or-later
ifccobie | LGPL-3.0-or-later
ifcconvert | LGPL-3.0-or-later\*
ifccsv | LGPL-3.0-or-later
ifcdiff | LGPL-3.0-or-later
ifcfm | LGPL-3.0-or-later
ifcgeom | LGPL-3.0-or-later\*
ifcgeom\_schema\_agnostic | LGPL-3.0-or-later\*
ifcgeomserver | LGPL-3.0-or-later\*
ifcjni | LGPL-3.0-or-later\*
ifcmax | LGPL-3.0-or-later\*
ifcopenshell-python | LGPL-3.0-or-later\*
ifcparse | LGPL-3.0-or-later\*
ifcpatch | LGPL-3.0-or-later
ifcsverchok | GPL-3.0-or-later
ifcwrap | LGPL-3.0-or-later\*
qtviewer | LGPL-3.0-or-later\*
serializers | LGPL-3.0-or-later\*
[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"
+283 -79
View File
@@ -18,10 +18,18 @@
################################################################################
cmake_minimum_required(VERSION 3.1.3)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON) # not necessary, but encouraged
project (IfcOpenShell)
project (IfcOpenShell VERSION 0.7.0)
cmake_policy(SET CMP0048 NEW)
cmake_policy(SET CMP0074 NEW)
cmake_policy(SET CMP0078 OLD)
cmake_policy(SET CMP0086 NEW)
# use extra version to make pre-release using eg semver
set( EXTRA_VERSION "-alpha.3")
foreach(max_year RANGE 2014 2030)
set(max_sdk "$ENV{ADSK_3DSMAX_SDK_${max_year}}")
@@ -34,27 +42,29 @@ endforeach()
OPTION(COLLADA_SUPPORT "Build IfcConvert with COLLADA support (requires OpenCOLLADA)." ON)
OPTION(IFCXML_SUPPORT "Build IfcParse with ifcXML support (requires libxml2)." ON)
OPTION(ENABLE_BUILD_OPTIMIZATIONS "Enable certain compiler and linker optimizations on RelWithDebInfo and Release builds." OFF)
OPTION(IFCCONVERT_DOUBLE_PRECISION "IfcConvert: Use double precision floating-point numbers." ON)
OPTION(BUILD_PACKAGE "" OFF)
OPTION(BUILD_IFCGEOM "Build IfcGeom." ON)
OPTION(BUILD_DOCUMENTATION "Build IfcOpenShell Documentation." OFF)
OPTION(BUILD_IFCPYTHON "Build IfcPython." ON)
OPTION(BUILD_EXAMPLES "Build example applications." ON)
OPTION(BUILD_GEOMSERVER "Build IfcGeomServer executable." ON)
OPTION(BUILD_CONVERT "Build IfcConvert executable." ON)
OPTION(HDF5_SUPPORT "Enable HDF5 support (requires HDF5, zlib)" ON)
OPTION(USE_VLD "Use Visual Leak Detector for debugging memory leaks, MSVC-only." OFF)
OPTION(USE_MMAP "Adds a command line options to parse IFC files from memory mapped files using Boost.Iostreams" OFF)
OPTION(BUILD_SHARED_LIBS "Build IfcParse and IfcGeom as shared libs (SO/DLL)." OFF)
if (${HAS_MAX})
OPTION(BUILD_IFCMAX "Build IfcMax, a 3ds Max plug-in, Windows-only." ON)
OPTION(BUILD_IFCMAX "Build IfcMax, a 3ds Max plug-in, Windows-only." OFF)
endif()
if (${BUILD_CONVERT})
OPTION(GLTF_SUPPORT "Build IfcConvert with glTF support (requires json.hpp)." OFF)
endif()
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)
# TODO QtViewer is deprecated ATM as it uses the 0.4 API
# OPTION(BUILD_QTVIEWER "Build IfcOpenShell Qt GUI Viewer (requires Qt 4 framework)." OFF)
include(GNUInstallDirs)
if((BUILD_CONVERT OR BUILD_GEOMSERVER OR BUILD_IFCPYTHON) AND (NOT BUILD_IFCGEOM))
message(STATUS "'IfcGeom' is required with current outputs")
set(BUILD_IFCGEOM ON)
@@ -65,7 +75,7 @@ IF(NOT BINDIR)
set(BINDIR bin)
ENDIF()
IF(NOT IS_ABSOLUTE ${BINDIR})
set(BINDIR ${CMAKE_INSTALL_PREFIX}/${BINDIR})
set(BINDIR ${CMAKE_INSTALL_BINDIR})
ENDIF()
MESSAGE(STATUS "BINDIR: ${BINDIR}")
@@ -73,7 +83,7 @@ IF(NOT INCLUDEDIR)
set(INCLUDEDIR include)
ENDIF()
IF(NOT IS_ABSOLUTE ${INCLUDEDIR})
set(INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/${INCLUDEDIR})
set(INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR})
ENDIF()
MESSAGE(STATUS "INCLUDEDIR: ${INCLUDEDIR}")
@@ -81,11 +91,11 @@ IF(NOT LIBDIR)
set(LIBDIR lib)
ENDIF()
IF(NOT IS_ABSOLUTE ${LIBDIR})
set(LIBDIR ${CMAKE_INSTALL_PREFIX}/${LIBDIR})
set(LIBDIR ${CMAKE_INSTALL_LIBDIR})
ENDIF()
MESSAGE(STATUS "LIBDIR: ${LIBDIR}")
set(IFCOPENSHELL_LIBARY_DIR "") # for *nix rpaths
set(IFCOPENSHELL_LIBRARY_DIR "") # for *nix rpaths
if (BUILD_SHARED_LIBS)
add_definitions(-DIFC_SHARED_BUILD)
@@ -95,7 +105,7 @@ if (BUILD_SHARED_LIBS)
# There will be couple hundreds of these so suppress them away, https://msdn.microsoft.com/en-us/library/esew7y1w.aspx
add_definitions(-wd4251)
endif()
set(IFCOPENSHELL_LIBARY_DIR "${LIBDIR}")
set(IFCOPENSHELL_LIBRARY_DIR "${LIBDIR}")
endif()
# Create cache entries if absent for environment variables
@@ -113,6 +123,18 @@ UNIFY_ENVVARS_AND_CACHE(LIBXML2_INCLUDE_DIR)
UNIFY_ENVVARS_AND_CACHE(LIBXML2_LIBRARIES)
UNIFY_ENVVARS_AND_CACHE(PCRE_LIBRARY_DIR)
UNIFY_ENVVARS_AND_CACHE(PYTHON_EXECUTABLE)
UNIFY_ENVVARS_AND_CACHE(HDF5_INCLUDE_DIR)
UNIFY_ENVVARS_AND_CACHE(HDF5_LIBRARY_DIR)
UNIFY_ENVVARS_AND_CACHE(HDF5_LIBRARIES)
UNIFY_ENVVARS_AND_CACHE(BOOST_ROOT)
UNIFY_ENVVARS_AND_CACHE(BOOST_LIBRARYDIR)
UNIFY_ENVVARS_AND_CACHE(CGAL_INCLUDE_DIR)
UNIFY_ENVVARS_AND_CACHE(CGAL_LIBRARY_DIR)
UNIFY_ENVVARS_AND_CACHE(GMP_INCLUDE_DIR)
UNIFY_ENVVARS_AND_CACHE(GMP_LIBRARY_DIR)
UNIFY_ENVVARS_AND_CACHE(MPFR_INCLUDE_DIR)
UNIFY_ENVVARS_AND_CACHE(MPFR_LIBRARY_DIR)
if (GLTF_SUPPORT AND BUILD_CONVERT)
UNIFY_ENVVARS_AND_CACHE(JSON_INCLUDE_DIR)
@@ -123,6 +145,7 @@ ELSE()
MESSAGE(FATAL_ERROR "Unable to find JSON for Modern C++ header file, aborting")
ENDIF()
add_definitions(-DWITH_GLTF)
set(SWIG_DEFINES ${SWIG_DEFINES} -DWITH_GLTF)
endif()
# Set INSTALL_RPATH for target
@@ -142,7 +165,7 @@ ENDMACRO()
# runtime, when doing running conda-build we pick what conda prepared for us.
IF(WIN32 AND ("$ENV{CONDA_BUILD}" STREQUAL ""))
SET(Boost_USE_STATIC_LIBS ON)
SET(Boost_USE_STATIC_RUNTIME ON)
SET(Boost_USE_STATIC_RUNTIME OFF)
SET(Boost_USE_MULTITHREADED ON)
# Disable Boost's autolinking as the libraries to be linked to are supplied
# already by CMake, and wrong libraries would be asked for when code is
@@ -174,14 +197,19 @@ if(USE_MMAP)
add_definitions(-DUSE_MMAP)
endif()
# libxml2 is required for IFCXML (optional) and SVGFILL (mandatory)
find_package(LibXml2 REQUIRED)
if (IFCXML_SUPPORT)
add_definitions(-DWITH_IFCXML)
set(SWIG_DEFINES ${SWIG_DEFINES} -DWITH_IFCXML)
endif()
FIND_PACKAGE(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
MESSAGE(STATUS "Boost include files found in ${Boost_INCLUDE_DIRS}")
MESSAGE(STATUS "Boost libraries found in ${Boost_LIBRARY_DIRS}")
# Usage:
# set(SOME_LIRARIES foo bar)
# add_debug_variants(SOME_LIRARIES "${SOME_LIRARIES}" d)
@@ -219,51 +247,66 @@ endfunction()
if(BUILD_IFCGEOM)
IF(MSVC)
add_debug_variants(LIBXML2_LIBRARIES "${LIBXML2_LIBRARIES}" d)
add_debug_variants(LIBXML2_LIBRARIES "${LIBXML2_LIBRARIES}" d)
ENDIF()
# Find Open CASCADE
# Open CASCADE
IF("${OCC_INCLUDE_DIR}" STREQUAL "")
SET(OCC_INCLUDE_DIR "/usr/include/oce/" CACHE FILEPATH "Open CASCADE header files")
MESSAGE(STATUS "Looking for Open CASCADE include files in: ${OCC_INCLUDE_DIR}")
MESSAGE(STATUS "Use OCC_INCLUDE_DIR to specify another directory")
FIND_PATH(OCC_INCLUDE_DIR Standard_Version.hxx
[PATHS
/usr/include/occt
/usr/include/oce
/usr/include/opencascade
]
REQUIRED
)
IF(OCC_INCLUDE_DIR)
MESSAGE(STATUS "Found Open CASCADE include files in: ${OCC_INCLUDE_DIR}")
ELSE()
MESSAGE(FATAL_ERROR "Unable to find Open CASCADE include directory, specify OCC_INCLUDE_DIR manually.")
ENDIF()
ELSE()
SET(OCC_INCLUDE_DIR ${OCC_INCLUDE_DIR} CACHE FILEPATH "Open CASCADE header files")
MESSAGE(STATUS "Looking for Open CASCADE include files in: ${OCC_INCLUDE_DIR}")
ENDIF()
FIND_FILE(gp_Pnt_hxx "gp_Pnt.hxx" ${OCC_INCLUDE_DIR})
IF(gp_Pnt_hxx)
MESSAGE(STATUS "Header files found")
ELSE()
MESSAGE(FATAL_ERROR "Unable to find header files, aborting")
SET(OCC_INCLUDE_DIR ${OCC_INCLUDE_DIR} CACHE FILEPATH "Open CASCADE header files")
MESSAGE(STATUS "Looking for Open CASCADE include files in: ${OCC_INCLUDE_DIR}")
ENDIF()
SET(OPENCASCADE_LIBRARY_NAMES
TKernel TKMath TKBRep TKGeomBase TKGeomAlgo TKG3d TKG2d TKShHealing TKTopAlgo TKMesh TKPrim TKBool TKBO
TKFillet TKSTEP TKSTEPBase TKSTEPAttr TKXSBase TKSTEP209 TKIGES TKOffset TKHLR
TKernel TKMath TKBRep TKGeomBase TKGeomAlgo TKG3d TKG2d TKShHealing TKTopAlgo TKMesh TKPrim TKBool TKBO
TKFillet TKSTEP TKSTEPBase TKSTEPAttr TKXSBase TKSTEP209 TKIGES TKOffset TKHLR
# @todo investigate the exact conditions when this is necessary
TKBin
)
IF("${OCC_LIBRARY_DIR}" STREQUAL "")
SET(OCC_LIBRARY_DIR "/usr/lib/" CACHE FILEPATH "Open CASCADE library files")
MESSAGE(STATUS "Looking for Open CASCADE library files in: ${OCC_LIBRARY_DIR}")
MESSAGE(STATUS "Use OCC_LIBRARY_DIR to specify another directory")
find_library(OCC_LIBRARY TKernel
[PATHS
/usr/lib
]
REQUIRED
)
IF(OCC_LIBRARY)
GET_FILENAME_COMPONENT(OCC_LIBRARY_DIR ${OCC_LIBRARY} PATH)
MESSAGE(STATUS "Found Open CASCADE library files in: ${OCC_LIBRARY_DIR}")
ELSE()
MESSAGE(FATAL_ERROR "Unable find Open CASCADE library directory, specify OCC_LIBRARY_DIR manually.")
ENDIF()
ELSE()
SET(OCC_LIBRARY_DIR ${OCC_LIBRARY_DIR} CACHE FILEPATH "Open CASCADE library files")
MESSAGE(STATUS "Looking for Open CASCADE library files in: ${OCC_LIBRARY_DIR}")
SET(OCC_LIBRARY_DIR ${OCC_LIBRARY_DIR} CACHE FILEPATH "Open CASCADE library files")
MESSAGE(STATUS "Looking for Open CASCADE library files in: ${OCC_LIBRARY_DIR}")
ENDIF()
FIND_LIBRARY(libTKernel NAMES TKernel TKerneld PATHS ${OCC_LIBRARY_DIR} NO_DEFAULT_PATH)
IF(libTKernel)
MESSAGE(STATUS "Library files found")
MESSAGE(STATUS "Required Open Cascade Library files found")
ELSE()
MESSAGE(FATAL_ERROR "Unable to find library files, aborting")
MESSAGE(FATAL_ERROR "Unable to find Open Cascade library files, aborting")
ENDIF()
# Use the found libTKernel as a template for all other OCC libraries
# TODO Extract this into macro/function
foreach(lib ${OPENCASCADE_LIBRARY_NAMES})
# Make sure we'll handle the Windows/MSVC debug postfix convetion too.
# Make sure we'll handle the Windows/MSVC debug postfix convention too.
string(REPLACE TKerneld "${lib}" lib_path "${libTKernel}")
string(REPLACE TKernel "${lib}" lib_path "${lib_path}")
list(APPEND OPENCASCADE_LIBRARIES "${lib_path}")
@@ -299,7 +342,7 @@ endif()
endif(BUILD_IFCGEOM)
IF(COLLADA_SUPPORT AND BUILD_CONVERT)
IF(COLLADA_SUPPORT)
# Find OpenCOLLADA
IF("${OPENCOLLADA_INCLUDE_DIR}" STREQUAL "")
MESSAGE(STATUS "No OpenCOLLADA include directory specified")
@@ -331,6 +374,8 @@ IF(COLLADA_SUPPORT AND BUILD_CONVERT)
IF(COLLADASWStreamWriter_h)
MESSAGE(STATUS "OpenCOLLADA header files found")
ADD_DEFINITIONS(-DWITH_OPENCOLLADA)
set(SWIG_DEFINES ${SWIG_DEFINES} -DWITH_OPENCOLLADA)
SET(OPENCOLLADA_LIBRARY_NAMES
GeneratedSaxParser MathMLSolver OpenCOLLADABaseUtils OpenCOLLADAFramework OpenCOLLADASaxFrameworkLoader
OpenCOLLADAStreamWriter UTF buffer ftoa
@@ -338,7 +383,7 @@ IF(COLLADA_SUPPORT AND BUILD_CONVERT)
# Use the found OpenCOLLADAFramework as a template for all other OpenCOLLADA libraries
foreach(lib ${OPENCOLLADA_LIBRARY_NAMES})
# Make sure we'll handle the Windows/MSVC debug postfix convetion too.
# Make sure we'll handle the Windows/MSVC debug postfix convention too.
string(REPLACE OpenCOLLADAFrameworkd "${lib}" lib_path "${OpenCOLLADAFramework}")
string(REPLACE OpenCOLLADAFramework "${lib}" lib_path "${lib_path}")
list(APPEND OPENCOLLADA_LIBRARIES "${lib_path}")
@@ -377,6 +422,54 @@ IF(COLLADA_SUPPORT AND BUILD_CONVERT)
ENDIF()
ENDIF()
if(HDF5_SUPPORT)
IF("${HDF5_INCLUDE_DIR}" STREQUAL "")
MESSAGE(STATUS "No HDF5 include directory specified")
ElSE()
SET(HDF5_INCLUDE_DIR "${HDF5_INCLUDE_DIR}" CACHE FILEPATH "HDF5 header files")
ENDIF()
IF("${HDF5_LIBRARY_DIR}" STREQUAL "")
MESSAGE(STATUS "No HDF5 library directory specified")
ElSE()
SET(HDF5_LIBRARY_DIR "${HDF5_LIBRARY_DIR}" CACHE FILEPATH "HDF5 library files")
ENDIF()
if (HDF5_LIBRARY_DIR)
# result of the HDF5 ctest package
if (WIN32)
set(zlib_post lib)
set(lib_ext lib)
else()
set(lib_ext a)
endif()
SET(HDF5_LIBRARIES
"${HDF5_LIBRARY_DIR}/libhdf5_cpp.${lib_ext}"
"${HDF5_LIBRARY_DIR}/libhdf5.${lib_ext}"
"${HDF5_LIBRARY_DIR}/libz${zlib_post}.${lib_ext}"
"${HDF5_LIBRARY_DIR}/libsz.${lib_ext}"
"${HDF5_LIBRARY_DIR}/libaec.${lib_ext}"
)
endif()
if (NOT HDF5_LIBRARIES)
# debian default
SET(HDF5_LIBRARIES
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5_cpp.so
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.so
/usr/lib/x86_64-linux-gnu/libsz.so
/usr/lib/x86_64-linux-gnu/libaec.so
z dl
)
endif()
add_definitions(-DWITH_HDF5)
set(SWIG_DEFINES ${SWIG_DEFINES} -DWITH_HDF5)
endif()
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE "Release")
ENDIF()
@@ -405,6 +498,14 @@ if(ENABLE_BUILD_OPTIMIZATIONS)
endif()
IF(MSVC)
# warning due to virtual inheritance
ADD_DEFINITIONS(-wd4250)
# warning due to select definitions in the schema being redundant
ADD_DEFINITIONS(-wd4584)
# didn't work well on ifcopenbot, @todo make configurable
# add_definitions(/MP)
# Enable solution folders (free VS versions prior to 2012 don't support solution folders)
if (MSVC_VERSION GREATER 1600)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
@@ -424,24 +525,24 @@ IF(MSVC)
# Disable overeager and false positives causing C4458 ("declaration of 'indentifier' hides class member"), at least for now.
ADD_DEFINITIONS(-wd4458)
ENDIF()
# Enforce standards-conformance on VS > 2015, older Boost versions fail to compile with this
# Enforce standards-conformance on VS > 2015, older Boost versions fail to compile with this
if (MSVC_VERSION GREATER 1900 AND (Boost_MAJOR_VERSION GREATER 1 OR Boost_MINOR_VERSION GREATER 66))
add_definitions(-permissive-)
endif()
# Link against the static VC runtime
# TODO Make this configurable
IF("$ENV{CONDA_BUILD}" STREQUAL "")
FOREACH(flag CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
IF(${flag} MATCHES "/MD")
STRING(REGEX REPLACE "/MD" "/MT" ${flag} "${${flag}}")
ENDIF()
IF(${flag} MATCHES "/MDd")
STRING(REGEX REPLACE "/MDd" "/MTd" ${flag} "${${flag}}")
ENDIF()
ENDFOREACH()
ENDIF()
# IF("$ENV{CONDA_BUILD}" STREQUAL "")
# FOREACH(flag CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL
# CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
# CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
# IF(${flag} MATCHES "/MD")
# STRING(REGEX REPLACE "/MD" "/MT" ${flag} "${${flag}}")
# ENDIF()
# IF(${flag} MATCHES "/MDd")
# STRING(REGEX REPLACE "/MDd" "/MTd" ${flag} "${${flag}}")
# ENDIF()
# ENDFOREACH()
# ENDIF()
ElSE()
add_definitions(-Wall -Wextra)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
@@ -449,43 +550,49 @@ ElSE()
else()
add_definitions(-Wno-maybe-uninitialized)
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 9.0))
# OpenCascade spews a lot of deprecated-copy warnings
add_definitions(-Wno-deprecated-copy)
endif()
# -fPIC is not relevant on Windows and creates pointless warnings
if (UNIX)
add_definitions(-fPIC)
endif()
ENDIF()
if (IFCCONVERT_DOUBLE_PRECISION)
SET(CONVERT_PRECISION "-DIFCCONVERT_DOUBLE_PRECISION")
endif()
INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES} ${OCC_INCLUDE_DIR} ${OPENCOLLADA_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS} ${LIBXML2_INCLUDE_DIR} ${JSON_INCLUDE_DIR}
${Boost_INCLUDE_DIRS} ${LIBXML2_INCLUDE_DIR} ${JSON_INCLUDE_DIR} ${HDF5_INCLUDE_DIR}
)
function(files_for_ifc_version IFC_VERSION RESULT_NAME)
set(IFC_PARSE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../src/ifcparse)
set(${RESULT_NAME}
${IFC_PARSE_DIR}/Ifc${IFC_VERSION}.h
set(${RESULT_NAME}
${IFC_PARSE_DIR}/Ifc${IFC_VERSION}.h
${IFC_PARSE_DIR}/Ifc${IFC_VERSION}enum.h
${IFC_PARSE_DIR}/Ifc${IFC_VERSION}.cpp
PARENT_SCOPE
)
endfunction()
set(SCHEMA_VERSIONS "2x3" "4" "4x1" "4x2" "4x3_rc1")
if(NOT SCHEMA_VERSIONS)
set(SCHEMA_VERSIONS "2x3" "4" "4x1" "4x2" "4x3_rc1" "4x3_rc2" "4x3_rc3" "4x3_rc4")
endif()
foreach(s ${SCHEMA_VERSIONS})
add_definitions(-DHAS_SCHEMA_${s})
endforeach()
if(COMPILE_SCHEMA)
# @todo, this appears to be untested at the moment
find_package(PythonInterp)
IF(NOT PYTHONINTERP_FOUND)
MESSAGE(FATAL_ERROR "A Python interpreter is necessary when COMPILE_SCHEMA is enabled. Disable COMPILE_SCHEMA or fix Python paths to proceed.")
ENDIF()
set(IFC_RELEASE_NOT_USED ${SCHEMA_VERSIONS})
# Install pyparsing if necessary
execute_process(COMMAND ${PYTHON_EXECUTABLE} -m pip freeze OUTPUT_VARIABLE PYTHON_PACKAGE_LIST)
if ("${PYTHON_PACKAGE_LIST}" STREQUAL "")
@@ -507,23 +614,23 @@ if(COMPILE_SCHEMA)
else()
message(STATUS "Python interpreter with pyparsing found")
endif()
# Bootstrap the parser
message(STATUS "Compiling schema, this will take a while...")
execute_process(COMMAND ${PYTHON_EXECUTABLE} bootstrap.py express.bnf
WORKING_DIRECTORY ../src/ifcexpressparser
execute_process(COMMAND ${PYTHON_EXECUTABLE} bootstrap.py express.bnf
WORKING_DIRECTORY ../src/ifcexpressparser
OUTPUT_FILE express_parser.py
RESULT_VARIABLE SUCCESS)
if (NOT "${SUCCESS}" STREQUAL "0")
MESSAGE(FATAL_ERROR "Failed to bootstrap parser. Make sure pyparsing is installed")
endif()
# Generate code
execute_process(COMMAND ${PYTHON_EXECUTABLE} ../ifcexpressparser/express_parser.py ../../${COMPILE_SCHEMA}
WORKING_DIRECTORY ../src/ifcparse
OUTPUT_VARIABLE COMPILED_SCHEMA_NAME)
# Prevent the schema that had just been compiled from being excluded
foreach(s ${SCHEMA_VERSIONS})
if("${COMPILED_SCHEMA_NAME}" STREQUAL "${s}")
@@ -552,8 +659,35 @@ if (BUILD_CONVERT)
endif()
# IfcParse
file(GLOB IFCPARSE_H_FILES ../src/ifcparse/*.h)
file(GLOB IFCPARSE_CPP_FILES ../src/ifcparse/*.cpp)
file(GLOB IFCPARSE_H_FILES_ALL ../src/ifcparse/*.h)
file(GLOB IFCPARSE_CPP_FILES_ALL ../src/ifcparse/*.cpp)
foreach(s ${IFCPARSE_H_FILES_ALL})
get_filename_component(p "${s}" NAME)
if (NOT "${p}" MATCHES "[0-9]")
list(APPEND IFCPARSE_H_FILES "${s}")
endif()
endforeach()
foreach(s ${IFCPARSE_CPP_FILES_ALL})
get_filename_component(p "${s}" NAME)
if (NOT "${p}" MATCHES "[0-9]")
list(APPEND IFCPARSE_CPP_FILES "${s}")
endif()
endforeach()
foreach(s ${SCHEMA_VERSIONS})
list(APPEND IFCPARSE_H_FILES
../src/ifcparse/Ifc${s}.h
../src/ifcparse/Ifc${s}-definitions.h
)
list(APPEND IFCPARSE_CPP_FILES
../src/ifcparse/Ifc${s}.cpp
../src/ifcparse/Ifc${s}-schema.cpp
)
endforeach()
set(IFCPARSE_FILES ${IFCPARSE_CPP_FILES} ${IFCPARSE_H_FILES})
add_library(IfcParse ${IFCPARSE_FILES})
@@ -564,7 +698,7 @@ TARGET_LINK_LIBRARIES(IfcParse ${Boost_LIBRARIES} ${BCRYPT_LIBRARIES} ${LIBXML2_
if (BUILD_IFCGEOM)
# IfcGeom
file(GLOB IFCGEOM_H_FILES ../src/ifcgeom/*.h)
file(GLOB IFCGEOM_H_FILES ../src/ifcgeom/*.h ../src/ifcgeom/*.i)
file(GLOB IFCGEOM_CPP_FILES ../src/ifcgeom/*.cpp)
set(IFCGEOM_FILES ${IFCGEOM_CPP_FILES} ${IFCGEOM_H_FILES})
@@ -586,7 +720,7 @@ if (UNIX)
find_package(Threads)
endif()
TARGET_LINK_LIBRARIES(IfcGeom ${IFCGEOM_SCHEMA_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
TARGET_LINK_LIBRARIES(IfcGeom IfcParse ${IFCGEOM_SCHEMA_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
endif(BUILD_IFCGEOM)
@@ -603,13 +737,13 @@ set(SERIALIZERS_S_FILES ${SERIALIZERS_S_H_FILES} ${SERIALIZERS_S_CPP_FILES})
foreach(s ${SCHEMA_VERSIONS})
add_library(Serializers_ifc${s} STATIC ${SERIALIZERS_S_FILES})
set_target_properties(Serializers_ifc${s} PROPERTIES COMPILE_FLAGS "-DIFC_GEOM_EXPORTS -DIfcSchema=Ifc${s} ${CONVERT_PRECISION}")
TARGET_LINK_LIBRARIES(Serializers_ifc${s} IfcGeom ${OPENCASCADE_LIBRARIES})
TARGET_LINK_LIBRARIES(Serializers_ifc${s} IfcGeom ${OPENCASCADE_LIBRARIES} ${HDF5_LIBRARIES})
endforeach()
add_library(Serializers ${SERIALIZERS_FILES})
set_target_properties(Serializers PROPERTIES COMPILE_FLAGS "-DIFC_GEOM_EXPORTS ${CONVERT_PRECISION}" VERSION "0.6.0" SOVERSION "0.6")
TARGET_LINK_LIBRARIES(Serializers ${SERIALIZER_SCHEMA_LIBRARIES})
TARGET_LINK_LIBRARIES(Serializers ${SERIALIZER_SCHEMA_LIBRARIES} ${OPENCOLLADA_LIBRARIES})
# IfcConvert
file(GLOB IFCCONVERT_CPP_FILES ../src/ifcconvert/*.cpp)
@@ -618,13 +752,13 @@ set(IFCCONVERT_FILES ${IFCCONVERT_CPP_FILES} ${IFCCONVERT_H_FILES})
ADD_EXECUTABLE(IfcConvert ${IFCCONVERT_FILES})
set_target_properties(IfcConvert PROPERTIES COMPILE_FLAGS "${CONVERT_PRECISION}")
TARGET_LINK_LIBRARIES(IfcConvert ${IFCOPENSHELL_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${Boost_LIBRARIES} ${OPENCOLLADA_LIBRARIES})
TARGET_LINK_LIBRARIES(IfcConvert ${IFCOPENSHELL_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${Boost_LIBRARIES} ${HDF5_LIBRARIES})
if ((NOT WIN32) AND BUILD_SHARED_LIBS)
# Only set RPATHs when building shared libraries (i.e. IfcParse and
# IfcGeom are dynamically linked). Not necessarily a perfect solution
# but probably a good indication of whether RPATHs are necessary.
SET_INSTALL_RPATHS(IfcConvert "${IFCOPENSHELL_LIBARY_DIR};${OCC_LIBRARY_DIR};${Boost_LIBRARY_DIRS};${OPENCOLLADA_LIBRARY_DIR}")
SET_INSTALL_RPATHS(IfcConvert "${IFCOPENSHELL_LIBRARY_DIR};${OCC_LIBRARY_DIR};${Boost_LIBRARY_DIRS};${OPENCOLLADA_LIBRARY_DIR}")
endif()
INSTALL(TARGETS IfcConvert
@@ -645,7 +779,7 @@ ADD_EXECUTABLE(IfcGeomServer ${SOURCE_FILES})
TARGET_LINK_LIBRARIES(IfcGeomServer ${IFCOPENSHELL_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${Boost_LIBRARIES})
if ((NOT WIN32) AND BUILD_SHARED_LIBS)
SET_INSTALL_RPATHS(IfcGeomServer "${IFCOPENSHELL_LIBARY_DIR};${OCC_LIBRARY_DIR};${Boost_LIBRARY_DIRS}")
SET_INSTALL_RPATHS(IfcGeomServer "${IFCOPENSHELL_LIBRARY_DIR};${OCC_LIBRARY_DIR};${Boost_LIBRARY_DIRS}")
endif()
INSTALL(TARGETS IfcGeomServer
@@ -656,7 +790,35 @@ INSTALL(TARGETS IfcGeomServer
endif()
# Documentation
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 --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(STRIP "${git_branch_candidate}" git_branch_candidate_2)
if (NOT git_branch_candidate_2 MATCHES "^HEAD$")
set(git_branch ${git_branch_candidate_2})
endif()
endforeach()
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
OUTPUT_VARIABLE git_sha
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message(STATUS "IfcOpenShell branch: \"${git_branch}\"")
message(STATUS "IfcOpenShell commit: \"${git_sha}\"")
add_definitions(-DIFCOPENSHELL_BRANCH=${git_branch})
add_definitions(-DIFCOPENSHELL_COMMIT=${git_sha})
endif()
endif()
# Documentation
IF(BUILD_DOCUMENTATION)
set(CMAKE_MODULE_PATH "../docs/cmake")
ADD_SUBDIRECTORY(../docs docs)
@@ -674,8 +836,10 @@ IF(BUILD_IFCMAX)
ADD_SUBDIRECTORY(../src/ifcmax ifcmax)
ENDIF()
ADD_SUBDIRECTORY(../src/svgfill svgfill)
# CMake installation targets
INSTALL(FILES ${IFCPARSE_H_FILES}
INSTALL(FILES ${IFCPARSE_H_FILES}
DESTINATION ${INCLUDEDIR}/ifcparse
)
@@ -686,11 +850,11 @@ INSTALL(TARGETS IfcParse
)
if(BUILD_IFCGEOM)
INSTALL(FILES ${IFCGEOM_H_FILES}
INSTALL(FILES ${IFCGEOM_H_FILES}
DESTINATION ${INCLUDEDIR}/ifcgeom
)
INSTALL(FILES ${SCHEMA_AGNOSTIC_H_FILES}
INSTALL(FILES ${SCHEMA_AGNOSTIC_H_FILES}
DESTINATION ${INCLUDEDIR}/ifcgeom_schema_agnostic
)
@@ -716,3 +880,43 @@ INSTALL(FILES ${SERIALIZERS_S_FILES}
DESTINATION ${INCLUDEDIR}/serializers/schema_dependent
)
endif()
list(APPEND CPACK_SOURCE_IGNORE_FILES
.git
.gitignore
)
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${EXTRA_VERSION}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}${EXTRA_VERSION}")
SET(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${EXTRA_VERSION}-${CMAKE_SYSTEM_NAME}")
set(CPACK_PACKAGE_DIRECTORY "${PROJECT_BINARY_DIR}/assets")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "IfcOpenShell")
set(CPACK_PACKAGE_DESCRIPTION "IfcOpenShell.")
set(CPACK_PACKAGE_VENDOR "Cemosis")
set(CPACK_PACKAGE_CONTACT "Christophe Prud'homme <christophe.prudhomme@cemosis.fr>")
set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
set(CPACK_GENERATOR "TGZ;DEB")
set(CPACK_SOURCE_GENERATOR "TGZ")
FOREACH(COMPONENT IN ITEMS ${BOOST_COMPONENTS})
string(REPLACE "_" "-" COMP ${COMPONENT})
set(BOOST_DEPS "${BOOST_DEPS}, libboost-${COMP}1.67.0")
endforeach(COMPONENT)
set(CPACK_DEBIAN_PACKAGE_NAME "${PROJECT_NAME}")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_PACKAGE_CONTACT}")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "python3, libxml2, liboce-foundation11, liboce-modeling11, liboce-ocaf11, liboce-visualization11, liboce-ocaf-lite11, libpython3.8 ${BOOST_DEPS}")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION_SUMMARY "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION}")
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
set(CPACK_DEBIAN_PACKAGE_SECTION "science")
set(CPACK_DEBIAN_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}${EXTRA_VERSION}")
set(CPACK_DEBIAN_ARCHITECTURE "${CMAKE_SYSTEM_PROCESSOR}")
#set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_SOURCE_DIR}/cmake/debian/postinst")
include(CPack)
+2 -2
View File
@@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places.
# The default value is: My Project.
PROJECT_NAME = "My Project"
PROJECT_NAME = "IfcOpenShell"
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
@@ -829,7 +829,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
INPUT = ../src/ifcgeom ../src/serializers
INPUT = ../src/ifcgeom ../src/serializers ../src/ifcgeom_schema_agnostic ../src/ifcparse
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
+2 -13
View File
@@ -22,7 +22,7 @@ exhale_args = {
# These arguments are required
"containmentFolder": "./rst_files",
"rootFileName": "library_root.rst",
"rootFileTitle": "IfcOpenShell",
"rootFileTitle": "IfcOpenShell C++",
"doxygenStripFromPath": "..",
# Suggested optional arguments
"createTreeView": True,
@@ -34,15 +34,4 @@ exhale_args = {
}
# html_theme = 'sphinx_rtd_theme'
# # Tell sphinx what the primary language being documented is.
# primary_domain = 'cpp'
# # Tell sphinx what the pygments highlight language should be.
# highlight_language = 'cpp'
cpp_id_attributes = ['IFC_PARSE_API', 'IFC_GEOM_API']
+1 -1
View File
@@ -7,4 +7,4 @@ IfcOpenShell
rst_files/library_root
`ifcopenshell-python documentation <_build/html/index.html>`_
* `ifcopenshell-python documentation <python/html/index.html>`_
+26 -39
View File
@@ -1,52 +1,39 @@
# This program requires doxygen, sphinx, breathe and exhale.
import os
import os.path
import sys
import shutil
import subprocess
import multiprocessing
from sys import platform
def copy_content(content, container):
with open(content) as f:
with open(container, "w") as f1:
for line in f:
f1.write(line)
conf_path = "./conf.py"
index_path = "./index.rst"
# some extra check to see if we can find sphinx in pypy bin dir
sphinx_build = os.path.join(os.path.dirname(sys.executable), 'sphinx-build')
if not os.path.exists(sphinx_build):
sphinx_build = "sphinx-build"
# else:
# os.environ['PATH'] = os.pathsep + os.path.dirname(sys.executable)
# not used, -j caused issues in my sphinx install
j = str(multiprocessing.cpu_count())
if not os.path.isdir("./output/doxygen/xml"):
os.makedirs("output/doxygen/xml")
if os.path.isfile(conf_path) and not os.path.isfile(index_path):
os.remove(conf_path)
if os.path.isfile(index_path) and not os.path.isfile(conf_path):
os.remove(index_path)
subprocess.check_call([sphinx_build, "-b", "html", ".", "output"])
if not (os.path.isfile(conf_path) and os.path.isfile(index_path)):
subprocess.run(["sphinx-quickstart", "-q", "-p", "IfcOpenShell"])
conf_copy = ["./conf_to_copy.py", "./conf.py"]
index_copy = ["./index_to_copy.rst", "./index.rst"]
copy_content(conf_copy[0], conf_copy[1])
copy_content(index_copy[0], index_copy[1])
if platform == "linux" or platform == "linux2":
subprocess.run(["make", "html"])
if not os.path.isdir("/output/_build"):
subprocess.run(["cd","../src/ifcblenderexport/docs"])
subprocess.run(["make", "html"])
subprocess.run(["cd", "../../../docs"])
subprocess.run(["mv" "../src/ifcblenderexport/docs/_build", "./output"])
if sys.platform == "linux" or sys.platform == "linux2":
if os.path.isdir("output/python"):
shutil.rmtree("output/python")
if not os.path.exists(os.path.join("../src/ifcblenderexport/docs", "contents.rst")):
subprocess.check_call(["ln", "index.rst", "contents.rst"], cwd="../src/ifcblenderexport/docs")
subprocess.check_call(["sed", "-i", "s/html_theme/# html_theme/g", "conf.py"], cwd="../src/ifcblenderexport/docs")
subprocess.check_call(["make", "html"], cwd="../src/ifcblenderexport/docs")
subprocess.check_call(["git", "checkout", "conf.py"], cwd="../src/ifcblenderexport/docs")
shutil.move("../src/ifcblenderexport/docs/_build", "./output")
os.rename("./output/_build", "./output/python")
elif platform == "win32" or platform == "win64":
subprocess.run(["make.bat", "html"])
elif sys.platform == "win32" or sys.platform == "win64":
subprocess.check_call(["make.bat", "html"])
+1 -1
View File
@@ -7,4 +7,4 @@ IfcOpenShell
rst_files/library_root
`ifcopenshell-python documentation <_build/html/index.html>`_
* `ifcopenshell-python documentation <python/html/index.html>`_
+331 -298
View File
@@ -49,27 +49,17 @@
# $ brew install git bison autoconf automake freetype libffi cmake #
# #
###############################################################################
from __future__ import print_function
import logging
import os
import sys
import subprocess as sp
import shutil
import time
import tarfile
import multiprocessing
import platform
import sysconfig
PYTHON_MAJOR = sys.version_info[0]
if PYTHON_MAJOR >= 3:
from urllib.request import urlretrieve
else:
# Not Python 3 - today, it is most likely to be Python 2
# But note that this might need an update when Python 4
# might be around one day
from urllib import urlretrieve
from urllib.request import urlretrieve
logger = logging.getLogger(__name__)
@@ -78,164 +68,129 @@ ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
logger.addHandler(ch)
PROJECT_NAME="IfcOpenShell"
PYTHON_VERSIONS=["2.7.16", "3.2.6", "3.3.6", "3.4.6", "3.5.3", "3.6.2", "3.7.3", "3.8.6", "3.9.1"]
JSON_VERSION="v3.6.1"
OCE_VERSION="0.18"
# OCCT_VERSION="7.1.0"
# OCCT_HASH="89aebde"
# OCCT_VERSION="7.2.0"
# OCCT_HASH="88af392"
OCCT_VERSION="7.3.0p3"
BOOST_VERSION="1.71.0"
#PCRE_VERSION="8.39"
PCRE_VERSION="8.41"
#LIBXML2_VERSION="2.9.3"
LIBXML2_VERSION="2.9.9"
SWIG_VERSION="3.0.12"
#SWIG_VERSION="4.0.0"
#OPENCOLLADA_VERSION="v1.6.63"
OPENCOLLADA_VERSION="v1.6.68"
PROJECT_NAME = "IfcOpenShell"
USE_CURRENT_PYTHON_VERSION = os.getenv("USE_CURRENT_PYTHON_VERSION")
PYTHON_VERSIONS = ["3.6.14", "3.7.12", "3.8.12", "3.9.7", "3.10.0"]
JSON_VERSION = "v3.6.1"
OCE_VERSION = "0.18.3"
OCCT_VERSION = "7.5.3"
BOOST_VERSION = "1.71.0"
PCRE_VERSION = "8.41"
LIBXML2_VERSION = "2.9.11"
SWIG_VERSION = "4.0.2"
OPENCOLLADA_VERSION = "v1.6.68"
HDF5_VERSION = "1.12.1"
GMP_VERSION = "6.1.2"
MPFR_VERSION = "3.1.5" # latest is 4.1.0
CGAL_VERSION = "5.3"
# binaries
cp="cp"
bash="bash"
uname="uname"
git="git"
bunzip2="bunzip2"
tar="tar"
cc="cc"
cplusplus="c++"
autoconf="autoconf"
automake="automake"
yacc="yacc"
make="make"
cp = "cp"
bash = "bash"
git = "git"
bunzip2 = "bunzip2"
tar = "tar"
cc = "cc"
cplusplus = "c++"
autoconf = "autoconf"
automake = "automake"
yacc = "yacc"
make = "make"
date = "date"
curl="curl"
wget="wget"
strip="strip"
curl = "curl"
wget = "wget"
strip = "strip"
# Helper function for coloured printing
NO_COLOR="\033[0m" # <ref>http://stackoverflow.com/questions/5947742/how-to-change-the-output-color-of-echo-in-linux</ref>
BLACK_ON_WHITE="\033[0;30;107m"
RED="\033[31m"
GREEN="\033[32m"
YELLOW="\033[33m"
MAGENTA="\033[35m"
NO_COLOR = "\033[0m" # <ref>http://stackoverflow.com/questions/5947742/how-to-change-the-output-color-of-echo-in-linux</ref>
BLACK_ON_WHITE = "\033[0;30;107m"
RED = "\033[31m"
GREEN = "\033[32m"
YELLOW = "\033[33m"
MAGENTA = "\033[35m"
def cecho(message, color=NO_COLOR):
"""Logs message `message` in color `color`."""
logger.info("%s%s\033[0m" % (color, message))
logger.info(f"{color}{message}\033[0m")
def which(cmd):
for path in os.environ["PATH"].split(":"):
for path in os.getenv("PATH").split(":"):
if os.path.exists(path) and cmd in os.listdir(path):
return cmd
return None
def get_os():
ret_value = sp.check_output([uname, "-s"]).strip()
return ret_value
def to_pystring(x):
""" Python 2 & 3 compatibility function for strings handling
(to solve TypeError "Can't mix strings and bytes in path components" for Python 3).
Reference https://github.com/hugsy/gef/issues/382 """
res = str(x, encoding="utf-8") if PYTHON_MAJOR == 3 else x
substs = [("\n","\\n"), ("\r","\\r"), ("\t","\\t"), ("\v","\\v"), ("\b","\\b"), ]
for x,y in substs: res = res.replace(x,y)
return res
# Set defaults for missing empty environment variables
USE_OCCT = os.environ.get("USE_OCCT", "true").lower() == "true"
TOOLSET = None
if get_os() == "Darwin":
if platform.system() == "Darwin":
# C++11 features used in OCCT 7+ need a more recent stdlib
TOOLSET = "10.9" if USE_OCCT else "10.6"
# python 3.4 doesn't seem to build anymore on recent versions of clang
if get_os() == "Darwin":
try:
PYTHON_VERSIONS.remove("3.4.6")
except ValueError as e:
pass
try:
IFCOS_NUM_BUILD_PROCS = os.environ["IFCOS_NUM_BUILD_PROCS"]
except KeyError:
IFCOS_NUM_BUILD_PROCS=multiprocessing.cpu_count() + 1
try:
TARGET_ARCH = os.environ["TARGET_ARCH"]
except KeyError:
TARGET_ARCH = sp.check_output([uname, "-m"]).strip()
IFCOS_NUM_BUILD_PROCS = os.getenv("IFCOS_NUM_BUILD_PROCS", multiprocessing.cpu_count() + 1)
CMAKE_DIR=os.path.realpath(os.path.join("..", "cmake"))
CMAKE_DIR = os.path.realpath(os.path.join("..", "cmake"))
try:
DEPS_DIR = os.environ["DEPS_DIR"]
except KeyError:
path = [b"..", b"build", sp.check_output(uname).strip(), TARGET_ARCH]
if TOOLSET:
path.append(TOOLSET)
DEPS_DIR = to_pystring(os.path.realpath(os.path.join(*path)))
path = ["..", "build", platform.system(), platform.machine()]
if TOOLSET:
path.append(TOOLSET)
DEFAULT_DEPS_DIR = os.path.realpath(os.path.join(*path))
DEPS_DIR = os.getenv("DEPS_DIR", DEFAULT_DEPS_DIR)
if not os.path.exists(DEPS_DIR):
os.makedirs(DEPS_DIR)
try:
BUILD_CFG=os.environ["BUILD_CFG"]
except KeyError:
BUILD_CFG="RelWithDebInfo"
BUILD_CFG = os.getenv("BUILD_CFG", "RelWithDebInfo")
# Print build configuration information
cecho ("""This script fetches and builds %s and its dependencies
""" % (PROJECT_NAME,), BLACK_ON_WHITE)
cecho (f"""This script fetches and builds {PROJECT_NAME} and its dependencies
""", BLACK_ON_WHITE)
cecho("""Script configuration:
""", GREEN)
cecho("""* Target Architecture = %s""" % (TARGET_ARCH,), MAGENTA)
cecho(" - Whether 32-bit (i686) or 64-bit (x86_64) will be built.")
cecho("""* USE_OCCT = %r""" % (USE_OCCT,), MAGENTA)
cecho(f"""* USE_OCCT = {USE_OCCT}""", MAGENTA)
if USE_OCCT:
cecho(" - Compiling against official Open Cascade")
else:
cecho(" - Compiling against Open Cascade Community Edition")
cecho("* Dependency Directory = %s" % (DEPS_DIR,), MAGENTA)
cecho(" - The directory where %s dependencies are installed." % (PROJECT_NAME,))
cecho("* Build Config Type = %s" % (BUILD_CFG,), MAGENTA)
cecho(f"* Dependency Directory = {DEPS_DIR}", MAGENTA)
cecho(f" - The directory where {PROJECT_NAME} dependencies are installed.")
cecho(f"* Build Config Type = {BUILD_CFG}", MAGENTA)
cecho(""" - The used build configuration type for the dependencies.
Defaults to RelWithDebInfo if not specified.""")
if BUILD_CFG == "MinSizeRel":
cecho(" WARNING: MinSizeRel build can suffer from a significant performance loss.", RED)
cecho("* IFCOS_NUM_BUILD_PROCS = %s" % (IFCOS_NUM_BUILD_PROCS,), MAGENTA)
cecho(f"* IFCOS_NUM_BUILD_PROCS = {IFCOS_NUM_BUILD_PROCS}", MAGENTA)
cecho(""" - How many compiler processes may be run in parallel.
""")
dependency_tree = {
'IfcParse': ('boost', 'libxml2'),
'IfcGeom': ('IfcParse', 'occ'),
'IfcConvert': ('IfcGeom', 'OpenCOLLADA', 'json'),
'OpenCOLLADA': ('libxml2', 'pcre'),
'IfcParse': ('boost', 'libxml2', 'hdf5'),
'IfcGeom': ('IfcParse', 'occ', 'json', 'cgal'),
'IfcConvert': ('IfcGeom',),
'OpenCOLLADA': ('libxml2', 'pcre'),
'IfcGeomServer': ('IfcGeom',),
'IfcOpenShell-Python': ('python', 'swig', 'IfcGeom'),
'IfcOpenShell-Python': ('python', 'swig', 'IfcGeom'),
'swig': ('pcre',),
'boost': (),
'libxml2': (),
'python': (),
'occ': (),
'pcre': (),
'json': ()
'json': (),
'hdf5': (),
'cgal': ()
}
def v(dep):
@@ -266,7 +221,7 @@ print("Building:", *sorted(targets, key=lambda t: len(list(v(t)))))
for cmd in [git, bunzip2, tar, cc, cplusplus, autoconf, automake, yacc, make, "patch", "cmake"]:
if which(cmd) is None:
raise ValueError("Required tool '%s' not installed or not added to PATH" % (cmd,))
raise ValueError(f"Required tool '{cmd}' not installed or not added to PATH")
# identifiers for the download tool (could be less memory consuming as ints, but are more verbose as strings)
download_tool_default = download_tool_py = "py"
@@ -277,10 +232,10 @@ download_tool_git = "git"
log_dir = os.path.join(DEPS_DIR, "logs")
if not os.path.exists(log_dir):
os.makedirs(log_dir)
LOG_FILE="%s.log" % (os.path.join(log_dir, to_pystring(sp.check_output([date, "+%Y%m%d"]).strip())),)
LOG_FILE = os.path.join(log_dir, sp.check_output([date, "+%Y%m%d"], encoding="utf-8").strip()) + ".log"
if not os.path.exists(LOG_FILE):
open(LOG_FILE, "w").close()
logger.info("using command log file '%s'" % (LOG_FILE,))
logger.info(f"using command log file '{LOG_FILE}'")
def run(cmds, cwd=None):
@@ -290,43 +245,47 @@ def run(cmds, cwd=None):
with leading and trailing whitespace removed.
"""
logger.debug("running command %r in directory %r" % (" ".join(cmds), cwd))
log_file_handle = open(LOG_FILE, "ab")
proc = sp.Popen(cmds, cwd=cwd, stdout=sp.PIPE, stderr=sp.PIPE)
logger.debug(f"running command {' '.join(cmds)} in directory {cwd}")
log_file_handle = open(LOG_FILE, "a")
proc = sp.Popen(cmds, cwd=cwd, stdout=sp.PIPE, stderr=sp.PIPE, encoding="utf-8")
stdout, stderr = proc.communicate()
log_file_handle.write(stdout)
log_file_handle.write(stderr)
log_file_handle.close()
logger.debug("command returned %r" % proc.returncode)
logger.debug(f"command returned {proc.returncode}")
if proc.returncode != 0:
print("-" * 70)
print(stderr)
print("-" * 70)
raise Exception("Command `%s` returned exit code %d" % (" ".join(cmds), proc.returncode))
raise RuntimeError(f"Command `{' '.join(cmds)}` returned exit code {proc.returncode}")
return stdout.strip()
BOOST_VERSION_UNDERSCORE=BOOST_VERSION.replace(".", "_")
BOOST_VERSION_UNDERSCORE = BOOST_VERSION.replace(".", "_")
OCE_LOCATION="https://github.com/tpaviot/oce/archive/OCE-%s.tar.gz" % (OCE_VERSION,)
BOOST_LOCATION="https://dl.bintray.com/boostorg/release/%s/source/" % (BOOST_VERSION,)
OCE_LOCATION = f"https://github.com/tpaviot/oce/archive/OCE-{OCE_VERSION}.tar.gz"
BOOST_LOCATION = f"https://boostorg.jfrog.io/artifactory/main/release/{BOOST_VERSION}/source/"
# Helper functions
def run_autoconf(arg1, configure_args, cwd):
configure_path = os.path.realpath(os.path.join(cwd, "..", "configure"))
if not os.path.exists(configure_path):
run([bash, "./autogen.sh"], cwd=os.path.realpath(os.path.join(cwd, ".."))) # only run autogen.sh in the directory it is located and use cwd to achieve that in order to not mess up things
# Using `sh` over `bash` fixes issues with building swig
run(["/bin/sh", "../configure"]+configure_args+["--prefix=%s" % (os.path.realpath("%s/install/%s" % (DEPS_DIR, arg1)),)], cwd=cwd)
prefix = os.path.realpath(f"{DEPS_DIR}/install/{arg1}")
run(["/bin/sh", "../configure"] + configure_args + [f"--prefix={prefix}"], cwd=cwd)
def run_cmake(arg1, cmake_args, cmake_dir=None, cwd=None):
if cmake_dir is None:
P=".."
P = ".."
else:
P=cmake_dir
run(["cmake", P]+cmake_args+["-DCMAKE_BUILD_TYPE=%s" % (BUILD_CFG,)], cwd=cwd)
P = cmake_dir
run(["cmake", P] + cmake_args + [f"-DCMAKE_BUILD_TYPE={BUILD_CFG}"], cwd=cwd)
def git_clone_or_pull_repository(clone_url, target_dir, revision=None):
"""Lazily clones the `git` repository denoted by `clone_url` into
@@ -335,10 +294,10 @@ def git_clone_or_pull_repository(clone_url, target_dir, revision=None):
`revision` after cloning or in the existing clone if `revision` is not
`None`."""
if not os.path.exists(target_dir):
logger.info("cloning '%s' into '%s'" % (clone_url, target_dir))
run([git, "clone", clone_url, target_dir])
logger.info(f"cloning '{clone_url}' into '{target_dir}'")
run([git, "clone", "--recursive", clone_url, target_dir])
else:
logger.info("directory '%s' already cloned. Pulling latest changes." % (target_dir,))
logger.info(f"directory '{target_dir}' already cloned. Pulling latest changes.")
# detect whether we are on a branch and pull
if run([git, "rev-parse", "--abbrev-ref", "HEAD"], cwd=target_dir) != "HEAD":
@@ -348,20 +307,20 @@ def git_clone_or_pull_repository(clone_url, target_dir, revision=None):
run([git, "checkout", revision], cwd=target_dir)
def build_dependency(name, mode, build_tool_args, download_url, download_name, download_tool=download_tool_default, revision=None, patch=None, additional_files={}, no_append_name=False):
def build_dependency(name, mode, build_tool_args, download_url, download_name, download_tool=download_tool_default, revision=None, patch=None, additional_files={}, no_append_name=False, **kwargs):
"""Handles building of dependencies with different tools (which are
distinguished with the `mode` argument. `build_tool_args` is expected to be
a list which is necessary in order to not mess up quoting of compiler and
linker flags."""
check_dir = os.path.join(DEPS_DIR, "install", name)
if os.path.exists(check_dir):
logger.info( "Found existing %s, skipping" % (name,))
logger.info(f"Found existing {name}, skipping")
return
build_dir = os.path.join(DEPS_DIR, "build")
if not os.path.exists(build_dir):
os.makedirs(build_dir)
logger.info("\rFetching %s... " % (name,))
logger.info(f"\rFetching {name}... ")
if download_tool == download_tool_py:
if no_append_name:
@@ -373,16 +332,16 @@ def build_dependency(name, mode, build_tool_args, download_url, download_name, d
if not os.path.exists(download_path):
urlretrieve(url, os.path.join(build_dir, download_path))
else:
logger.info("Download '%s' already exists, assuming it's an undamaged download and that it has been extracted if possible, skipping" % (download_path,))
logger.info(f"Download '{download_path}' already exists, assuming it's an undamaged download and that it has been extracted if possible, skipping")
elif download_tool == download_tool_git:
logger.info("\rChecking %s... " % (name,))
logger.info(f"\rChecking {name}... ")
git_clone_or_pull_repository(download_url, target_dir=os.path.join(build_dir, download_name), revision=revision)
else:
raise ValueError("download tool '%s' is not supported" % (download_tool,))
raise ValueError(f"download tool '{download_tool}' is not supported")
download_dir = os.path.join(build_dir, download_name)
if os.path.isdir(download_dir):
extract_dir_name=download_name
extract_dir_name = download_name
extract_dir = os.path.join(build_dir, extract_dir_name)
else:
download_tarfile_path = os.path.join(build_dir, download_name)
@@ -392,11 +351,12 @@ def build_dependency(name, mode, build_tool_args, download_url, download_name, d
compr = "bz2"
else:
raise RuntimeError("fix source for new download type")
download_tarfile = tarfile.open(name=download_tarfile_path, mode="r:%s" % (compr,))
extract_dir_name= os.path.commonprefix(download_tarfile.getnames()) # tarfile seriously doesn't have a function to retrieve the root directory more easily
download_tarfile = tarfile.open(name=download_tarfile_path, mode=f"r:{compr}")
# tarfile seriously doesn't have a function to retrieve the root directory more easily
extract_dir_name = os.path.commonprefix([x for x in download_tarfile.getnames() if x != "."])
#run([tar, "--exclude=\"*/*\"", "-tf", download_name], cwd=build_dir).strip() no longer works
if extract_dir_name is None:
extract_dir_name= run([bash, "-c", "tar -tf %s 2> /dev/null | head -n 1 | cut -f1 -d /" % (download_name,)], cwd=build_dir)
extract_dir_name = run([bash, "-c", f"tar -tf {download_name} 2> /dev/null | head -n 1 | cut -f1 -d /"], cwd=build_dir)
extract_dir = os.path.join(build_dir, extract_dir_name)
if not os.path.exists(extract_dir):
run([tar, "-xf", download_name], cwd=build_dir)
@@ -412,78 +372,80 @@ def build_dependency(name, mode, build_tool_args, download_url, download_name, d
except Exception as e:
# Assert that the patch has already been applied
run(["patch", "-p1", "--batch", "--reverse", "--dry-run", "-i", patch_abs], cwd=extract_dir)
if mode != "bjam":
if mode == "ctest":
run(["ctest", "-S", "HDF5config.cmake,BUILD_GENERATOR=Unix", "-C", BUILD_CFG, "-V", "-O", "hdf5.log"], cwd=extract_dir)
run([tar, "-xf", kwargs["ctest_result"] + ".tar.gz"], cwd=os.path.join(extract_dir, 'build'))
shutil.copytree(
os.path.join(extract_dir, "build", kwargs["ctest_result"], kwargs["ctest_result_path"]),
os.path.join(DEPS_DIR, "install", name)
)
elif mode != "bjam":
extract_build_dir = os.path.join(extract_dir, "build")
if os.path.exists(extract_build_dir):
shutil.rmtree(extract_build_dir)
os.makedirs(extract_build_dir)
logger.info("\rConfiguring %s..." % (name,))
logger.info(f"\rConfiguring {name}...")
if mode == "autoconf":
run_autoconf(name, build_tool_args, cwd=extract_build_dir)
elif mode == "cmake":
run_cmake(name, build_tool_args, cwd=extract_build_dir)
else:
raise ValueError()
logger.info("\rBuilding %s... " % (name,))
run([make, "-j%s" % (IFCOS_NUM_BUILD_PROCS,), "VERBOSE=1"], cwd=extract_build_dir)
logger.info( "\rInstalling %s... " % (name,))
logger.info(f"\rBuilding {name}... ")
run([make, f"-j{IFCOS_NUM_BUILD_PROCS}", "VERBOSE=1"], cwd=extract_build_dir)
logger.info(f"\rInstalling {name}... ")
run([make, "install"], cwd=extract_build_dir)
logger.info( "\rInstalled %s \n" % (name,))
logger.info(f"\rInstalled {name} \n")
else:
logger.info( "\rConfiguring %s..." % (name,))
logger.info(f"\rConfiguring {name}...")
run([bash, "./bootstrap.sh"], cwd=extract_dir)
logger.info("\rBuilding %s... " % (name,))
run(["./b2", "-j%s" % (IFCOS_NUM_BUILD_PROCS,)]+build_tool_args, cwd=extract_dir)
logger.info("\rInstalling %s... " % (name,))
shutil.copytree(os.path.join(extract_dir, "boost"), os.path.join(DEPS_DIR, "install", "boost-%s" % BOOST_VERSION, "boost"))
logger.info("\rInstalled %s \n" % (name,))
logger.info(f"\rBuilding {name}... ")
run(["./b2", f"-j{IFCOS_NUM_BUILD_PROCS}"] + build_tool_args, cwd=extract_dir)
logger.info(f"\rInstalling {name}... ")
shutil.copytree(os.path.join(extract_dir, "boost"), os.path.join(DEPS_DIR, "install", f"boost-{BOOST_VERSION}", "boost"))
logger.info(f"\rInstalled {name} \n")
cecho("Collecting dependencies:", GREEN)
# Set compiler flags for 32bit builds on 64bit system
# TODO: This is untested
ADDITIONAL_ARGS=[]
BOOST_ADDRESS_MODEL=[]
if TARGET_ARCH == "i686" and run([uname, "-m"]).strip() == "x86_64":
if get_os() == "Darwin":
ADDITIONAL_ARGS=["-m32", "-arch i386"]
else:
ADDITIONAL_ARGS=["-m32"]
BOOST_ADDRESS_MODEL=["architecture=x86", "address-model=32"]
ADDITIONAL_ARGS = []
BOOST_ADDRESS_MODEL = []
if get_os() == "Darwin":
ADDITIONAL_ARGS=["-mmacosx-version-min=%s" % TOOLSET]+ADDITIONAL_ARGS
if platform.system() == "Darwin":
ADDITIONAL_ARGS = [f"-mmacosx-version-min={TOOLSET}"] + ADDITIONAL_ARGS
# If the linker supports GC sections, set it up to reduce binary file size
# -fPIC is required for the shared libraries to work
CXXFLAGS=os.environ.get("CXXFLAGS", "")
CFLAGS=os.environ.get("CFLAGS", "")
LDFLAGS=os.environ.get("LDFLAGS", "")
CXXFLAGS = os.environ.get("CXXFLAGS", "")
CFLAGS = os.environ.get("CFLAGS", "")
LDFLAGS = os.environ.get("LDFLAGS", "")
ADDITIONAL_ARGS_STR = " ".join(ADDITIONAL_ARGS)
if sp.call([bash, "-c", "ld --gc-sections 2>&1 | grep -- --gc-sections &> /dev/null"]) != 0:
CXXFLAGS_MINIMAL="%s %s %s" % (CXXFLAGS, PIC, str.join(" ", ADDITIONAL_ARGS))
CFLAGS_MINIMAL="%s %s %s" % (CFLAGS, PIC, str.join(" ", ADDITIONAL_ARGS))
CXXFLAGS_MINIMAL = f"{CXXFLAGS} {PIC} {ADDITIONAL_ARGS_STR}"
CFLAGS_MINIMAL = f"{CFLAGS} {PIC} {ADDITIONAL_ARGS_STR}"
if BUILD_STATIC:
CXXFLAGS="%s %s -fdata-sections -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden %s" % (CXXFLAGS, PIC, str.join(" ", ADDITIONAL_ARGS))
CFLAGS="%s %s -fdata-sections -ffunction-sections -fvisibility=hidden %s"% (CFLAGS, PIC, str.join(" ", ADDITIONAL_ARGS))
CXXFLAGS = f"{CXXFLAGS} {PIC} -fdata-sections -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden {ADDITIONAL_ARGS_STR}"
CFLAGS = f"{CFLAGS} {PIC} -fdata-sections -ffunction-sections -fvisibility=hidden {ADDITIONAL_ARGS_STR}"
else:
CXXFLAGS=CXXFLAGS_MINIMAL
CFLAGS=CFLAGS_MINIMAL
LDFLAGS="%s -Wl,--gc-sections %s" % (LDFLAGS, str.join(" ", ADDITIONAL_ARGS))
CXXFLAGS = CXXFLAGS_MINIMAL
CFLAGS = CFLAGS_MINIMAL
LDFLAGS = f"{LDFLAGS} -Wl,--gc-sections {ADDITIONAL_ARGS_STR}"
else:
CXXFLAGS_MINIMAL="%s %s %s" % (CXXFLAGS, PIC, str.join(" ", ADDITIONAL_ARGS))
CFLAGS_MINIMAL="%s %s %s" % (CFLAGS, PIC, str.join(" ", ADDITIONAL_ARGS))
CXXFLAGS_MINIMAL = f"{CXXFLAGS} {PIC} {ADDITIONAL_ARGS_STR}"
CFLAGS_MINIMAL = f"{CFLAGS} {PIC} {ADDITIONAL_ARGS_STR}"
if BUILD_STATIC:
CXXFLAGS="%s %s -fvisibility=hidden -fvisibility-inlines-hidden %s" % (CXXFLAGS, PIC, str.join(" ", ADDITIONAL_ARGS))
CFLAGS="%s %s -fvisibility=hidden -fvisibility-inlines-hidden %s" % (CFLAGS, PIC, str.join(" ", ADDITIONAL_ARGS))
CXXFLAGS = f"{CXXFLAGS} {PIC} -fvisibility=hidden -fvisibility-inlines-hidden {ADDITIONAL_ARGS_STR}"
CFLAGS = f"{CFLAGS} {PIC} -fvisibility=hidden -fvisibility-inlines-hidden {ADDITIONAL_ARGS_STR}"
else:
CXXFLAGS=CXXFLAGS_MINIMAL
CFLAGS=CFLAGS_MINIMAL
LDFLAGS="%s %s" % (LDFLAGS, str.join(" ", ADDITIONAL_ARGS))
LDFLAGS = f"{LDFLAGS} {ADDITIONAL_ARGS_STR}"
os.environ["CXXFLAGS"] = CXXFLAGS
os.environ["CFLAGS"] = CFLAGS
@@ -493,9 +455,21 @@ os.environ["LDFLAGS"] = LDFLAGS
# @tfk: this is no longer needed
# build_dependency(name="cmake-%s" % (CMAKE_VERSION,), mode="autoconf", build_tool_args=[], download_url="https://cmake.org/files/v%s" % (CMAKE_VERSION_2,), download_name="cmake-%s.tar.gz" % (CMAKE_VERSION,))
if 'hdf5' in targets:
HDF5_MAJOR = ".".join(HDF5_VERSION.split(".")[:-1])
build_dependency(
name=f"hdf5-{HDF5_VERSION}",
mode="ctest",
build_tool_args=[],
download_url=f"https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-{HDF5_MAJOR}/hdf5-{HDF5_VERSION}/src/",
download_name=f"CMake-hdf5-{HDF5_VERSION}.tar.gz",
ctest_result=f"HDF5-{HDF5_VERSION}-{platform.system()}",
ctest_result_path=f"HDF_Group/HDF5/{HDF5_VERSION}"
)
if "json" in targets:
json_url = "https://github.com/nlohmann/json/releases/download/{JSON_VERSION}/json.hpp".format(**locals())
json_install_path = "{DEPS_DIR}/install/json/nlohmann/json.hpp".format(**locals())
json_url = f"https://github.com/nlohmann/json/releases/download/{JSON_VERSION}/json.hpp"
json_install_path = f"{DEPS_DIR}/install/json/nlohmann/json.hpp"
if not os.path.exists(os.path.dirname(json_install_path)):
os.makedirs(os.path.dirname(json_install_path))
if not os.path.exists(json_install_path):
@@ -503,11 +477,11 @@ if "json" in targets:
if "pcre" in targets:
build_dependency(
name="pcre-{PCRE_VERSION}".format(**locals()),
name=f"pcre-{PCRE_VERSION}",
mode="autoconf",
build_tool_args=[DISABLE_FLAG],
download_url="https://downloads.sourceforge.net/project/pcre/pcre/{PCRE_VERSION}/".format(**locals()),
download_name="pcre-{PCRE_VERSION}.tar.bz2".format(**locals())
download_url=f"https://downloads.sourceforge.net/project/pcre/pcre/{PCRE_VERSION}/",
download_name=f"pcre-{PCRE_VERSION}.tar.bz2"
)
# An issue exists with swig-1.3 and python >= 3.2
@@ -516,20 +490,20 @@ if "swig" in targets:
build_dependency(
name="swig",
mode="autoconf",
build_tool_args=["--disable-ccache", "--with-pcre-prefix={DEPS_DIR}/install/pcre-{PCRE_VERSION}".format(**locals())],
build_tool_args=["--disable-ccache", f"--with-pcre-prefix={DEPS_DIR}/install/pcre-{PCRE_VERSION}"],
download_url="https://github.com/swig/swig.git",
download_name="swig",
download_tool=download_tool_git,
revision="rel-{SWIG_VERSION}".format(**locals())
revision=f"rel-{SWIG_VERSION}"
)
if USE_OCCT and "occ" in targets:
build_dependency(
name="occt-{OCCT_VERSION}".format(**locals()),
name=f"occt-{OCCT_VERSION}",
mode="cmake",
build_tool_args=[
"-DINSTALL_DIR={DEPS_DIR}/install/occt-{OCCT_VERSION}".format(**locals()),
"-DBUILD_LIBRARY_TYPE={LINK_TYPE_UCFIRST}".format(**locals()),
f"-DINSTALL_DIR={DEPS_DIR}/install/occt-{OCCT_VERSION}",
f"-DBUILD_LIBRARY_TYPE={LINK_TYPE_UCFIRST}",
"-DBUILD_MODULE_Draw=0",
"-DBUILD_RELEASE_DISABLE_EXCEPTIONS=Off"
],
@@ -541,7 +515,7 @@ if USE_OCCT and "occ" in targets:
)
elif "occ" in targets:
build_dependency(
name="oce-{OCE_VERSION}".format(**locals()),
name=f"oce-{OCE_VERSION}",
mode="cmake",
build_tool_args=[
"-DOCE_DISABLE_TKSERVICE_FONT=ON",
@@ -550,15 +524,15 @@ elif "occ" in targets:
"-DOCE_DISABLE_X11=ON",
"-DOCE_VISUALISATION=OFF",
"-DOCE_OCAF=OFF",
"-DOCE_INSTALL_PREFIX={DEPS_DIR}/install/oce-{OCE_VERSION}".format(**locals())
f"-DOCE_INSTALL_PREFIX={DEPS_DIR}/install/oce-{OCE_VERSION}"
],
download_url="https://github.com/tpaviot/oce/archive/",
download_name="OCE-{OCE_VERSION}.tar.gz".format(**locals())
download_name=f"OCE-{OCE_VERSION}.tar.gz"
)
if "libxml2" in targets:
build_dependency(
"libxml2-{LIBXML2_VERSION}".format(**locals()),
f"libxml2-{LIBXML2_VERSION}",
"autoconf",
build_tool_args=[
"--without-python",
@@ -569,7 +543,7 @@ if "libxml2" in targets:
"--without-lzma"
],
download_url="ftp://xmlsoft.org/libxml2/",
download_name="libxml2-{LIBXML2_VERSION}.tar.gz".format(**locals())
download_name=f"libxml2-{LIBXML2_VERSION}.tar.gz"
)
if "OpenCOLLADA" in targets:
@@ -577,12 +551,12 @@ if "OpenCOLLADA" in targets:
"OpenCOLLADA",
"cmake",
build_tool_args=[
"-DLIBXML2_INCLUDE_DIR={DEPS_DIR}/install/libxml2-{LIBXML2_VERSION}/include/libxml2".format(**locals()),
"-DLIBXML2_LIBRARIES={DEPS_DIR}/install/libxml2-{LIBXML2_VERSION}/lib/libxml2.{LIBRARY_EXT}".format(**locals()),
"-DPCRE_INCLUDE_DIR={DEPS_DIR}/install/pcre-{PCRE_VERSION}/include".format(**locals()),
"-DPCRE_PCREPOSIX_LIBRARY={DEPS_DIR}/install/pcre-{PCRE_VERSION}/lib/libpcreposix.{LIBRARY_EXT}".format(**locals()),
"-DPCRE_PCRE_LIBRARY={DEPS_DIR}/install/pcre-{PCRE_VERSION}/lib/libpcre.{LIBRARY_EXT}".format(**locals()),
"-DCMAKE_INSTALL_PREFIX={DEPS_DIR}/install/OpenCOLLADA/".format(**locals())
f"-DLIBXML2_INCLUDE_DIR={DEPS_DIR}/install/libxml2-{LIBXML2_VERSION}/include/libxml2",
f"-DLIBXML2_LIBRARIES={DEPS_DIR}/install/libxml2-{LIBXML2_VERSION}/lib/libxml2.{LIBRARY_EXT}",
f"-DPCRE_INCLUDE_DIR={DEPS_DIR}/install/pcre-{PCRE_VERSION}/include",
f"-DPCRE_PCREPOSIX_LIBRARY={DEPS_DIR}/install/pcre-{PCRE_VERSION}/lib/libpcreposix.{LIBRARY_EXT}",
f"-DPCRE_PCRE_LIBRARY={DEPS_DIR}/install/pcre-{PCRE_VERSION}/lib/libpcre.{LIBRARY_EXT}",
f"-DCMAKE_INSTALL_PREFIX={DEPS_DIR}/install/OpenCOLLADA/"
],
download_url="https://github.com/KhronosGroup/OpenCOLLADA.git",
download_name="OpenCOLLADA",
@@ -591,110 +565,154 @@ if "OpenCOLLADA" in targets:
revision=OPENCOLLADA_VERSION
)
if "python" in targets:
if "python" in targets and not USE_CURRENT_PYTHON_VERSION:
# Python should not be built with -fvisibility=hidden, from experience that introduces segfaults
OLD_CXX_FLAGS=os.environ["CXXFLAGS"]
OLD_C_FLAGS=os.environ["CFLAGS"]
os.environ["CXXFLAGS"]=CXXFLAGS_MINIMAL
os.environ["CFLAGS"]=CFLAGS_MINIMAL
OLD_CXX_FLAGS = os.environ["CXXFLAGS"]
OLD_C_FLAGS = os.environ["CFLAGS"]
os.environ["CXXFLAGS"] = CXXFLAGS_MINIMAL
os.environ["CFLAGS"] = CFLAGS_MINIMAL
# On OSX a dynamic python library is built or it would not be compatible
# with the system python because of some threading initialization
PYTHON_CONFIGURE_ARGS=[]
if get_os() == "Darwin":
PYTHON_CONFIGURE_ARGS=["--disable-static", "--enable-shared"]
PYTHON_CONFIGURE_ARGS = []
if platform.system() == "Darwin":
PYTHON_CONFIGURE_ARGS = ["--disable-static", "--enable-shared"]
def get_python_unicode_confs(py_ver):
if py_ver < "3.3":
return [("--enable-unicode=ucs2",""), ("--enable-unicode=ucs4","u")]
else: return [("","")]
def PYTHON_VERSION_CONFS():
for v in PYTHON_VERSIONS:
for unicode_conf, abi_tag in get_python_unicode_confs(v):
yield v, unicode_conf, abi_tag
for PYTHON_VERSION, unicode_conf, abi_tag in PYTHON_VERSION_CONFS():
for PYTHON_VERSION in PYTHON_VERSIONS:
try:
build_dependency(
"python-{PYTHON_VERSION}{abi_tag}".format(**locals()),
f"python-{PYTHON_VERSION}",
"autoconf",
PYTHON_CONFIGURE_ARGS + [unicode_conf],
"http://www.python.org/ftp/python/{PYTHON_VERSION}/".format(**locals()),
"Python-{PYTHON_VERSION}.tgz".format(**locals())
PYTHON_CONFIGURE_ARGS,
f"http://www.python.org/ftp/python/{PYTHON_VERSION}/",
f"Python-{PYTHON_VERSION}.tgz"
)
except Exception as e:
pyver2 = PYTHON_VERSION[:PYTHON_VERSION.rfind('.')]
if os.path.exists("{DEPS_DIR}/install/python-{PYTHON_VERSION}{abi_tag}/bin/python{pyver2}".format(**locals())):
print("Installation partially failed")
else: raise e
except RuntimeError as e:
# Sometimes setting up modules such as pip/lzma can cause
# the python installer script to return a non zero exit
# code where actually the headers and dynamic libraries
# are installed correctly. This is all we need so we catch
# the exception and only reraise if a partially successful
# install is not detected.
if not os.path.exists(
os.path.join(DEPS_DIR, "install", f"python-{PYTHON_VERSION}")
):
raise e
os.environ["CXXFLAGS"]=OLD_CXX_FLAGS
os.environ["CFLAGS"]=OLD_C_FLAGS
os.environ["CXXFLAGS"] = OLD_CXX_FLAGS
os.environ["CFLAGS"] = OLD_C_FLAGS
if "boost" in targets:
str_concat = lambda prefix: lambda postfix: "" if postfix.strip() == "" else "=".join((prefix, postfix.strip()))
build_dependency(
"boost-{BOOST_VERSION}".format(**locals()),
f"boost-{BOOST_VERSION}",
mode="bjam",
build_tool_args=[
"--stagedir={DEPS_DIR}/install/boost-{BOOST_VERSION}".format(**locals()),
f"--stagedir={DEPS_DIR}/install/boost-{BOOST_VERSION}",
"--with-system",
"--with-program_options",
"--with-regex",
"--with-thread",
"--with-date_time",
"--with-iostreams",
"link={LINK_TYPE}".format(**locals())
f"link={LINK_TYPE}"
] + \
BOOST_ADDRESS_MODEL + \
list(map(str_concat("cxxflags"), CXXFLAGS.strip().split(' '))) + \
list(map(str_concat("linkflags"), LDFLAGS.strip().split(' '))) + \
["stage", "-s", "NO_BZIP2=1"],
download_url=BOOST_LOCATION,
download_name="boost_{BOOST_VERSION_UNDERSCORE}.tar.bz2".format(**locals())
download_name=f"boost_{BOOST_VERSION_UNDERSCORE}.tar.bz2"
)
if "cgal" in targets:
build_dependency(
name=f"gmp-{GMP_VERSION}",
mode="autoconf",
build_tool_args=["--disable-shared", "--with-pic"],
download_url="https://ftp.gnu.org/gnu/gmp/",
download_name=f"gmp-{GMP_VERSION}.tar.bz2"
)
build_dependency(
name=f"mpfr-{MPFR_VERSION}",
mode="autoconf",
build_tool_args=["--disable-shared", f"--with-gmp={DEPS_DIR}/install/gmp-{GMP_VERSION}"],
download_url=f"http://www.mpfr.org/mpfr-{MPFR_VERSION}/",
download_name=f"mpfr-{MPFR_VERSION}.tar.bz2"
)
build_dependency(
name=f"cgal-{CGAL_VERSION}",
mode="cmake",
build_tool_args=[
f"-DGMP_LIBRARIES={DEPS_DIR}/install/gmp-{GMP_VERSION}/lib/libgmp.a",
f"-DGMP_INCLUDE_DIR={DEPS_DIR}/install/gmp-{GMP_VERSION}/include",
f"-DMPFR_LIBRARIES={DEPS_DIR}/install/mpfr-{MPFR_VERSION}/lib/libmpfr.a" ,
f"-DMPFR_INCLUDE_DIR={DEPS_DIR}/install/mpfr-{MPFR_VERSION}/include",
f"-DBoost_INCLUDE_DIR={DEPS_DIR}/install/boost-{BOOST_VERSION}",
f"-DCMAKE_INSTALL_PREFIX={DEPS_DIR}/install/cgal-{CGAL_VERSION}/",
"-DCGAL_HEADER_ONLY=On",
"-DBUILD_SHARED_LIBS=Off"
],
download_url="https://github.com/CGAL/cgal.git",
download_name="cgal",
download_tool=download_tool_git,
revision=f"v{CGAL_VERSION}"
)
cecho("Building IfcOpenShell:", GREEN)
IFCOS_DIR=os.path.join(DEPS_DIR, "build", "ifcopenshell")
if os.path.exists(IFCOS_DIR):
shutil.rmtree(IFCOS_DIR)
os.makedirs(IFCOS_DIR)
IFCOS_DIR = os.path.join(DEPS_DIR, "build", "ifcopenshell")
if os.environ.get("NO_CLEAN", "").lower() not in {"1", "on", "true"}:
if os.path.exists(IFCOS_DIR):
shutil.rmtree(IFCOS_DIR)
os.makedirs(IFCOS_DIR, exist_ok=True)
executables_dir = os.path.join(IFCOS_DIR, "executables")
if not os.path.exists(executables_dir):
os.makedirs(executables_dir)
os.makedirs(executables_dir, exist_ok=True)
logger.info("\rConfiguring executables...")
OFF_ON = ["OFF", "ON"]
cmake_args=[
"-DUSE_MMAP=" "OFF",
"-DBUILD_EXAMPLES=" "OFF",
exec_args = [
"-DBUILD_IFCGEOM=" +OFF_ON["IfcGeom" in targets],
"-DBUILD_GEOMSERVER=" +OFF_ON["IfcGeomServer" in targets],
"-DBUILD_CONVERT=" +OFF_ON["IfcConvert" in targets],
"-DBUILD_IFCPYTHON=" "OFF",
"-DBUILD_SHARED_LIBS=" +OFF_ON[not BUILD_STATIC],
"-DBUILD_IFCGEOM=" +OFF_ON["IfcGeom" in targets],
"-DBUILD_GEOMSERVER=" +OFF_ON["IfcGeomServer" in targets],
"-DBUILD_CONVERT=" +OFF_ON["IfcConvert" in targets],
"-DCMAKE_INSTALL_PREFIX=" "{DEPS_DIR}/install/ifcopenshell".format(**locals()),
"-DBOOST_ROOT=" "{DEPS_DIR}/install/boost-{BOOST_VERSION}".format(**locals()),
"-DGLTF_SUPPORT=" "ON",
"-DJSON_INCLUDE_DIR=" "{DEPS_DIR}/install/json".format(**locals()),
"-DBoost_NO_BOOST_CMAKE=" "On"
"-DCMAKE_INSTALL_PREFIX=" f"{DEPS_DIR}/install/ifcopenshell",
]
cmake_args = [
"-DUSE_MMAP=" "OFF",
"-DBUILD_EXAMPLES=" "OFF",
"-DBUILD_SHARED_LIBS=" +OFF_ON[not BUILD_STATIC],
"-DBOOST_ROOT=" f"{DEPS_DIR}/install/boost-{BOOST_VERSION}",
"-DGLTF_SUPPORT=" "ON",
"-DJSON_INCLUDE_DIR=" f"{DEPS_DIR}/install/json",
"-DBoost_NO_BOOST_CMAKE=" "On",
]
if "cgal" in targets:
cmake_args.extend([
"-DCGAL_INCLUDE_DIR=" f"{DEPS_DIR}/install/cgal-{CGAL_VERSION}/include",
"-DGMP_INCLUDE_DIR=" f"{DEPS_DIR}/install/gmp-{GMP_VERSION}/include",
"-DGMP_LIBRARY_DIR=" f"{DEPS_DIR}/install/gmp-{GMP_VERSION}/lib",
"-DMPFR_INCLUDE_DIR=" f"{DEPS_DIR}/install/mpfr-{MPFR_VERSION}/include",
"-DMPFR_LIBRARY_DIR=" f"{DEPS_DIR}/install/mpfr-{MPFR_VERSION}/lib",
])
if "occ" in targets and USE_OCCT:
occ_include_dir = "{DEPS_DIR}/install/occt-{OCCT_VERSION}/include/opencascade".format(**locals())
occ_library_dir = "{DEPS_DIR}/install/occt-{OCCT_VERSION}/lib".format(**locals())
occ_include_dir = f"{DEPS_DIR}/install/occt-{OCCT_VERSION}/include/opencascade"
occ_library_dir = f"{DEPS_DIR}/install/occt-{OCCT_VERSION}/lib"
cmake_args.extend([
"-DOCC_INCLUDE_DIR=" +occ_include_dir,
"-DOCC_LIBRARY_DIR=" +occ_library_dir
])
elif "occ" in targets:
occ_include_dir = "{DEPS_DIR}/install/oce-{OCE_VERSION}/include/oce".format(**locals())
occ_library_dir = "{DEPS_DIR}/install/oce-{OCE_VERSION}/lib"
occ_include_dir = f"{DEPS_DIR}/install/oce-{OCE_VERSION}/include/oce"
occ_library_dir = f"{DEPS_DIR}/install/oce-{OCE_VERSION}/lib"
cmake_args.extend([
"-DOCC_INCLUDE_DIR=" +occ_include_dir,
"-DOCC_LIBRARY_DIR=" +occ_library_dir
@@ -702,83 +720,98 @@ elif "occ" in targets:
if "OpenCOLLADA" in targets:
cmake_args.extend([
"-DOPENCOLLADA_INCLUDE_DIR=" "{DEPS_DIR}/install/OpenCOLLADA/include/opencollada".format(**locals()),
"-DOPENCOLLADA_LIBRARY_DIR=" "{DEPS_DIR}/install/OpenCOLLADA/lib/opencollada".format(**locals())
"-DOPENCOLLADA_INCLUDE_DIR=" f"{DEPS_DIR}/install/OpenCOLLADA/include/opencollada",
"-DOPENCOLLADA_LIBRARY_DIR=" f"{DEPS_DIR}/install/OpenCOLLADA/lib/opencollada"
])
else:
cmake_args.extend([
"-DCOLLADA_SUPPORT=" "Off",
])
if "pcre" in targets:
cmake_args.append(
"-DPCRE_LIBRARY_DIR=" "{DEPS_DIR}/install/pcre-{PCRE_VERSION}/lib".format(**locals())
"-DPCRE_LIBRARY_DIR=" f"{DEPS_DIR}/install/pcre-{PCRE_VERSION}/lib"
)
if "libxml2" in targets:
cmake_args.extend([
"-DLIBXML2_INCLUDE_DIR=" "{DEPS_DIR}/install/libxml2-{LIBXML2_VERSION}/include/libxml2".format(**locals()),
"-DLIBXML2_LIBRARIES=" "{DEPS_DIR}/install/libxml2-{LIBXML2_VERSION}/lib/libxml2.{LIBRARY_EXT}".format(**locals())
"-DLIBXML2_INCLUDE_DIR=" f"{DEPS_DIR}/install/libxml2-{LIBXML2_VERSION}/include/libxml2",
"-DLIBXML2_LIBRARIES=" f"{DEPS_DIR}/install/libxml2-{LIBXML2_VERSION}/lib/libxml2.{LIBRARY_EXT}"
])
run_cmake("", cmake_args, cmake_dir=CMAKE_DIR, cwd=executables_dir)
if "hdf5" in targets:
cmake_args.extend([
"-DHDF5_INCLUDE_DIR=" f"{DEPS_DIR}/install/hdf5-{HDF5_VERSION}/include",
"-DHDF5_LIBRARY_DIR=" f"{DEPS_DIR}/install/hdf5-{HDF5_VERSION}/lib"
])
run_cmake("", exec_args + cmake_args, cmake_dir=CMAKE_DIR, cwd=executables_dir)
logger.info("\rBuilding executables... ")
run([make, "-j{IFCOS_NUM_BUILD_PROCS}".format(**locals())], cwd=executables_dir)
run([make, f"-j{IFCOS_NUM_BUILD_PROCS}"], cwd=executables_dir)
run([make, "install/strip" if BUILD_CFG == "Release" else "install"], cwd=executables_dir)
if "IfcOpenShell-Python" in targets:
# On OSX the actual Python library is not linked against.
ADDITIONAL_ARGS=""
if get_os() == "Darwin":
ADDITIONAL_ARGS="-Wl,-flat_namespace,-undefined,suppress"
ADDITIONAL_ARGS = ""
if platform.system() == "Darwin":
ADDITIONAL_ARGS = "-Wl,-flat_namespace,-undefined,suppress"
os.environ["CXXFLAGS"]="%s %s" % (CXXFLAGS_MINIMAL, ADDITIONAL_ARGS)
os.environ["CFLAGS"]="%s %s" % (CFLAGS_MINIMAL, ADDITIONAL_ARGS)
os.environ["LDFLAGS"]="%s %s" % (LDFLAGS, ADDITIONAL_ARGS)
os.environ["CXXFLAGS"] = f"{CXXFLAGS_MINIMAL} {ADDITIONAL_ARGS}"
os.environ["CFLAGS"] = f"{CFLAGS_MINIMAL} {ADDITIONAL_ARGS}"
os.environ["LDFLAGS"] = f"{LDFLAGS} {ADDITIONAL_ARGS}"
for PYTHON_VERSION, _, TAG in PYTHON_VERSION_CONFS():
logger.info("\rConfiguring python {PYTHON_VERSION}{TAG} wrapper...".format(**locals()))
python_dir = os.path.join(IFCOS_DIR, "pythonwrapper")
os.makedirs(python_dir, exist_ok=True)
# python_dir = os.path.join(IFCOS_DIR, "python-{PYTHON_VERSION}{TAG}".format(**locals()))
python_dir = os.path.join(IFCOS_DIR, "pythonwrapper")
if not os.path.exists(python_dir):
os.makedirs(python_dir)
def compile_python_wrapper(python_version, python_library, python_include, python_executable):
logger.info(f"\rConfiguring python {python_version} wrapper...")
cache_path = os.path.join(python_dir, "CMakeCache.txt")
if os.path.exists(cache_path):
os.unlink(cache_path)
os.remove(cache_path)
PYTHON_LIBRARY=run([bash, "-c", "ls {DEPS_DIR}/install/python-{PYTHON_VERSION}{TAG}/lib/libpython*.*".format(**locals())])
PYTHON_INCLUDE=run([bash, "-c", "ls -d {DEPS_DIR}/install/python-{PYTHON_VERSION}{TAG}/include/python*".format(**locals())])
PYTHON_EXECUTABLE=os.path.join(DEPS_DIR, "install", "python-{PYTHON_VERSION}{TAG}".format(**locals()), "bin", "python{PYTHON_VERSION[0]}".format(**locals()))
os.environ["PYTHON_LIBRARY_BASENAME"]=os.path.basename(PYTHON_LIBRARY)
os.environ["PYTHON_LIBRARY_BASENAME"] = os.path.basename(python_library)
run_cmake("",
cmake_args=[
"-DBUILD_SHARED_LIBS=" "OFF" if BUILD_STATIC else "ON",
"-DBOOST_ROOT=" "{DEPS_DIR}/install/boost-{BOOST_VERSION}".format(**locals()),
"-DOCC_INCLUDE_DIR=" +occ_include_dir,
"-DOCC_LIBRARY_DIR=" +occ_library_dir,
"-DPYTHON_LIBRARY=" +PYTHON_LIBRARY,
"-DPYTHON_EXECUTABLE=" +PYTHON_EXECUTABLE,
"-DPYTHON_INCLUDE_DIR=" +PYTHON_INCLUDE,
"-DSWIG_EXECUTABLE=" "{DEPS_DIR}/install/swig/bin/swig".format(**locals()),
"-DCMAKE_INSTALL_PREFIX=" "{DEPS_DIR}/install/ifcopenshell/tmp".format(**locals()),
"-DLIBXML2_INCLUDE_DIR=" "{DEPS_DIR}/install/libxml2-{LIBXML2_VERSION}/include/libxml2".format(**locals()),
"-DLIBXML2_LIBRARIES=" "{DEPS_DIR}/install/libxml2-{LIBXML2_VERSION}/lib/libxml2.{LIBRARY_EXT}".format(**locals()),
"-DCOLLADA_SUPPORT=OFF"
cmake_args + [
"-DPYTHON_LIBRARY=" +python_library,
"-DPYTHON_EXECUTABLE=" +python_executable,
"-DPYTHON_INCLUDE_DIR=" +python_include,
"-DSWIG_EXECUTABLE=" f"{DEPS_DIR}/install/swig/bin/swig",
"-DCMAKE_INSTALL_PREFIX=" f"{DEPS_DIR}/install/ifcopenshell/tmp",
"-DUSERSPACE_PYTHON_PREFIX=" +["Off", "On"][os.environ.get("PYTHON_USER_SITE", "").lower() in {"1", "on", "true"}]
], cmake_dir=CMAKE_DIR, cwd=python_dir)
logger.info("\rBuilding python %s%s wrapper... " % (PYTHON_VERSION, TAG))
run([make, "-j%s" % (IFCOS_NUM_BUILD_PROCS,), "_ifcopenshell_wrapper"], cwd=python_dir)
logger.info(f"\rBuilding python {python_version} wrapper... ")
run([make, f"-j{IFCOS_NUM_BUILD_PROCS}", "_ifcopenshell_wrapper"], cwd=python_dir)
run([make, "install/local"], cwd=os.path.join(python_dir, "ifcwrap"))
module_dir = os.path.dirname(run([PYTHON_EXECUTABLE, "-c", "from __future__ import print_function; import inspect, ifcopenshell; print(inspect.getfile(ifcopenshell))"]))
module_dir = os.path.dirname(run([python_executable, "-c", "import inspect, ifcopenshell; print(inspect.getfile(ifcopenshell))"]))
if get_os() != "Darwin":
if platform.system() != "Darwin":
# TODO: This symbol name depends on the Python version?
run([strip, "-s", "-K", "PyInit__ifcopenshell_wrapper", "_ifcopenshell_wrapper.so"], cwd=module_dir)
return module_dir
run([cp, "-R", module_dir, os.path.join(DEPS_DIR, "install", "ifcopenshell", "python-%s%s" % (PYTHON_VERSION, TAG))])
if USE_CURRENT_PYTHON_VERSION:
python_info = sysconfig.get_paths()
python_lib = os.path.join(
sysconfig.get_config_var('LIBDIR'),
sysconfig.get_config_var('multiarchsubdir').replace("/", ""),
sysconfig.get_config_var("INSTSONAME")
)
compile_python_wrapper(platform.python_version(), python_lib, python_info["include"], sys.executable)
else:
for python_version in PYTHON_VERSIONS:
python_library = run([bash, "-c", f"ls {DEPS_DIR}/install/python-{python_version}/lib/libpython*.*"])
python_include = run([bash, "-c", f"ls -d {DEPS_DIR}/install/python-{python_version}/include/python*"])
python_executable = os.path.join(DEPS_DIR, "install", f"python-{python_version}", "bin", f"python{python_version[0]}")
module_dir = compile_python_wrapper(python_version, python_library, python_include, python_executable)
run([cp, "-R", module_dir, os.path.join(DEPS_DIR, "install", "ifcopenshell", f"python-{python_version}")])
logger.info("\rBuilt IfcOpenShell...\n\n")
+621
View File
@@ -0,0 +1,621 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
+165
View File
@@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
+2
View File
@@ -0,0 +1,2 @@
include src/bcf/v2/xsd/*.xsd
include src/bcf/v3/xsd/*.xsd
+48 -6
View File
@@ -4,23 +4,26 @@ A simple Python implementation of BCF. The data model is described in `data.py`.
Manipulation of BCF-XML is available via `bcfxml.py` and manipulation of BCF-API
is available via `bcfapi.py`.
Currently supports BCF version 2.1.
- BCF-XML version 2.1: Fully supported
- BCF-API version 2.1: Not supported, will probably tackle this after BCF-API v3.0
- BCF-XML version 3.0: Almost fully supported, except for the documents module
- BCF-API version 3.0: Almost fully supported, except for two requests.
## bcfxml
The `bcfxml` module lets you interact with the BCF-XML standard.
```
from bcf.bcfxml import BcfXml
```python
from bcf import bcfxml
bcfxml = BcfXml()
# Load a project
project = bcfxml.get_project("/path/to/file.bcf")
bcfxml = bcfxml.load("/path/to/file.bcf")
# The project is also stored in the module
# project == bcfxml.project
project=bcfxml.get_project()
print(project.name)
# To edit a project, just modify the object directly
@@ -57,3 +60,42 @@ topic = bcfxml.get_topic(guid)
topic.title = "New title"
bcfxml.edit_topic(topic)
```
## bcfapi
The `bcfapi` module lets you interact with the BCF-API standard.
```python
from bcf.v3.bcfapi import FoundationClient, BcfClient
foundation_client = FoundationClient("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET", "OPENCDE_BASEURL")
auth_methods = foundation_client.get_auth_methods()
# Our library currently only implements the authorization_code flow
if "authorization_code" in auth_methods:
foundation_client.login()
bcf_client = BcfClient(foundation_client)
versions = foundation_client.get_versions()
for version in versions:
if "3.0" in versions:
if version["api_id"] == "bcf" and version["version_id"] == "3.0":
bcf_client.set_version(version)
data = bcf_client.get_projects()
print(data)
project_id = data[0]["project_id"]
print(project_id)
data = bcf_client.get_project(project_id)
print(data)
data = bcf_client.get_extensions(project_id)
print(data)
```
## Todo List
The remaining work that needs to be completed in `bcfxml.py` and `bcfapi.py`.
- For `bcfxml.py` two xsds support is remaining namely 'documents.xsd`and`extensions.xsd`.
- For `bcfapi.py` two requests that are `get_topics` and `get_comments` are remaining.
+12
View File
@@ -0,0 +1,12 @@
[build-system]
requires = [
"setuptools>=42",
"wheel"
]
build-backend = "setuptools.build_meta"
[tool.black]
line-length = 120
[tool.isort]
profile = "black"
+1
View File
@@ -0,0 +1 @@
xmlschema
+37
View File
@@ -0,0 +1,37 @@
[metadata]
name=bcf-client
version=0.0.1
author = Ifcopenshell
description = A simple Python implementation of BCF
url = https://github.com/IfcOpenShell/IfcOpenShell
project_urls =
Code=https://github.com/IfcOpenShell/IfcOpenShell
Issues=https://github.com/IfcOpenShell/IfcOpenShell/issues
long_description = file: README.md
long_description_content_type = text/markdown
classifiers =
License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Operating System :: OS Independent
Programming Language :: Python :: 3
Topic :: Scientific/Engineering
Topic :: Utilities
keywords =
Python
file formats
engineering
[options]
package_dir =
= src
packages = find:
python_requires = >=3
install_requires=
xmlschema
include_package_data = True
[options.packages.find]
where = src
[flake8]
max-line-length = 120
ignore = E24, E121, E123, E126, E203, E226, E704, E741, W503, W504
+17
View File
@@ -0,0 +1,17 @@
# 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/>.
+61
View File
@@ -0,0 +1,61 @@
# 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/>.
import os.path
import zipfile
import tempfile
from xml.dom import minidom
def load(filepath):
filepath = extract_project(filepath)
if os.path.isfile(os.path.join(filepath, "bcf.version")):
version_path = os.path.join(filepath, "bcf.version")
version_id = get_version(version_path)
# TODO: we actually coded it for 2.1, let's check the difference between 2.0 and 2.1
if version_id == "2.1" or version_id == "2.0":
from bcf.v2.bcfxml import BcfXml
bcfxml = BcfXml()
bcfxml.filepath = filepath
return bcfxml
elif version_id == "3.0":
from bcf.v3.bcfxml import BcfXml
bcfxml = BcfXml()
bcfxml.filepath = filepath
return bcfxml
else:
raise Exception(f"Version {version_id} not supported.")
def get_version(version_path):
xmlparse = minidom.parse(version_path)
version_el = xmlparse.getElementsByTagName("Version")[0]
version = version_el.getAttribute("VersionId")
return version
def extract_project(filepath):
if not filepath:
return
zip_file = zipfile.ZipFile(filepath)
filepath = tempfile.mkdtemp()
zip_file.extractall(filepath)
return filepath
+19
View File
@@ -0,0 +1,19 @@
# BCF - BCF Python library
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BCF.
#
# BCF is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BCF is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with BCF. If not, see <http://www.gnu.org/licenses/>.
@@ -1,10 +1,29 @@
# BCF - BCF Python library
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BCF.
#
# BCF is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BCF is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with BCF. If not, see <http://www.gnu.org/licenses/>.
import os
import uuid
import shutil
import zipfile
import logging
import tempfile
import bcf.data
import bcf.v2.data
from datetime import datetime
from xml.dom import minidom
from xmlschema import XMLSchema
@@ -30,7 +49,7 @@ class BcfXml:
self.filepath = None
self.logger = logging.getLogger("bcfxml")
self.author = "john@doe.com"
self.project = bcf.data.Project()
self.project = bcf.v2.data.Project()
self.version = "2.1"
self.topics = {}
@@ -47,12 +66,12 @@ class BcfXml:
def get_project(self, filepath=None):
if not filepath:
return self.project
zip_file = zipfile.ZipFile(filepath)
self.filepath = tempfile.mkdtemp()
zip_file.extractall(self.filepath)
data = self._read_xml("project.bcfp", "project.xsd")
self.project.project_id = data["Project"]["@ProjectId"]
self.project.name = data["Project"]["Name"]
if os.path.isfile(os.path.join(self.filepath, "project.bcfp")):
data = self._read_xml("project.bcfp", "project.xsd")
self.project.extension_schema = data["ExtensionSchema"]
if "Project" in data:
self.project.project_id = data["Project"]["@ProjectId"]
self.project.name = data["Project"].get("Name")
return self.project
def edit_project(self):
@@ -92,6 +111,12 @@ class BcfXml:
subdirs = dirnames
break
for subdir in subdirs:
try:
uuid.UUID(subdir)
except ValueError:
continue
if not os.path.exists(os.path.join(self.filepath, subdir, "markup.bcf")):
continue
self.topics[subdir] = self.get_topic(subdir)
return self.topics
@@ -99,9 +124,9 @@ class BcfXml:
data = self._read_xml(os.path.join(guid, "markup.bcf"), "markup.xsd")
if "Header" not in data:
return
header = bcf.data.Header()
header = bcf.v2.data.Header()
for item in data["Header"]["File"]:
header_file = bcf.data.HeaderFile()
header_file = bcf.v2.data.HeaderFile()
optional_keys = {
"filename": "Filename",
"date": "Date",
@@ -121,7 +146,7 @@ class BcfXml:
if guid in self.topics:
return self.topics[guid]
data = self._read_xml(os.path.join(guid, "markup.bcf"), "markup.xsd")
topic = bcf.data.Topic()
topic = bcf.v2.data.Topic()
self.topics[guid] = topic
mandatory_keys = {
@@ -152,7 +177,7 @@ class BcfXml:
setattr(topic, key, data["Topic"][value])
if "BimSnippet" in data["Topic"]:
bim_snippet = bcf.data.BimSnippet()
bim_snippet = bcf.v2.data.BimSnippet()
keys = {
"snippet_type": "@SnippetType",
"is_external": "@IsExternal",
@@ -166,7 +191,7 @@ class BcfXml:
if "DocumentReference" in data["Topic"]:
for item in data["Topic"]["DocumentReference"]:
document_reference = bcf.data.DocumentReference()
document_reference = bcf.v2.data.DocumentReference()
keys = {
"referenced_document": "ReferencedDocument",
"is_external": "@IsExternal",
@@ -180,14 +205,14 @@ class BcfXml:
if "RelatedTopic" in data["Topic"]:
for item in data["Topic"]["RelatedTopic"]:
related_topic = bcf.data.RelatedTopic()
related_topic = bcf.v2.data.RelatedTopic()
related_topic.guid = item["@Guid"]
topic.related_topics.append(related_topic)
return topic
def add_topic(self, topic=None):
if topic is None:
topic = bcf.data.Topic()
topic = bcf.v2.data.Topic()
if not topic.guid:
topic.guid = str(uuid.uuid4())
if not topic.title:
@@ -285,9 +310,12 @@ class BcfXml:
"isExternal": f.is_external,
},
)
self._create_element(file_el, "Filename", text=f.filename)
self._create_element(file_el, "Date", text=f.date)
self._create_element(file_el, "Reference", text=f.reference)
if f.filename:
self._create_element(file_el, "Filename", text=f.filename)
if f.date:
self._create_element(file_el, "Date", text=f.date)
if f.reference:
self._create_element(file_el, "Reference", text=f.reference)
def write_comments(self, comments, root):
for comment in comments.values():
@@ -307,7 +335,7 @@ class BcfXml:
def add_comment(self, topic, comment=None):
if comment is None:
comment = bcf.data.Comment()
comment = bcf.v2.data.Comment()
if not comment.guid:
comment.guid = str(uuid.uuid4())
if not comment.comment:
@@ -441,7 +469,7 @@ class BcfXml:
for bitmap in viewpoint.bitmaps:
bitmap_el = self._create_element(parent, "Bitmap")
text_map = {"Bitmap": bitmap.bitmap_type, "Reference": bitmap.reference}
text_map = {"Bitmap": bitmap.bitmap_format, "Reference": bitmap.reference}
for key, value in text_map.items():
self._create_element(bitmap_el, key, text=value)
@@ -468,7 +496,7 @@ class BcfXml:
def add_viewpoint(self, topic, viewpoint=None):
if not viewpoint:
viewpoint = bcf.data.Viewpoint()
viewpoint = bcf.v2.data.Viewpoint()
if not viewpoint.guid:
viewpoint.guid = str(uuid.uuid4())
if not viewpoint.viewpoint:
@@ -569,7 +597,7 @@ class BcfXml:
header_file.is_external = False
header_file.date = datetime.utcnow().isoformat()
if not topic.header:
topic.header = bcf.data.Header()
topic.header = bcf.v2.data.Header()
topic.header.files.append(header_file)
self.edit_topic(topic)
@@ -579,7 +607,7 @@ class BcfXml:
if "Comment" not in data:
return comments
for item in data["Comment"]:
comment = bcf.data.Comment()
comment = bcf.v2.data.Comment()
mandatory_keys = {"guid": "@Guid", "date": "Date", "author": "Author", "comment": "Comment"}
for key, value in mandatory_keys.items():
setattr(comment, key, item[value])
@@ -588,7 +616,7 @@ class BcfXml:
if value in item:
setattr(comment, key, item[value])
if "Viewpoint" in item:
viewpoint = bcf.data.Viewpoint()
viewpoint = bcf.v2.data.Viewpoint()
viewpoint.guid = item["Viewpoint"]["@Guid"]
comment.viewpoint = viewpoint
comments[comment.guid] = comment
@@ -607,7 +635,7 @@ class BcfXml:
return viewpoints
def get_viewpoint(self, data, topic_guid):
viewpoint = bcf.data.Viewpoint()
viewpoint = bcf.v2.data.Viewpoint()
viewpoint.guid = data["@Guid"]
optional_keys = {"viewpoint": "Viewpoint", "snapshot": "Snapshot", "index": "Index"}
for key, value in optional_keys.items():
@@ -625,10 +653,10 @@ class BcfXml:
def get_viewpoint_components(self, visinfo):
if "Components" not in visinfo:
return None
components = bcf.data.Components()
components = bcf.v2.data.Components()
data = visinfo["Components"]
if "ViewSetupHints" in data:
view_setup_hints = bcf.data.ViewSetupHints()
view_setup_hints = bcf.v2.data.ViewSetupHints()
optional_keys = {
"spaces_visible": "@SpacesVisible",
"space_boundaries_visible": "@SpaceBoundariesVisible",
@@ -642,7 +670,7 @@ class BcfXml:
for item in data["Selection"]["Component"]:
components.selection.append(self.get_component(item))
if "Visibility" in data:
component_visibility = bcf.data.ComponentVisibility()
component_visibility = bcf.v2.data.ComponentVisibility()
if "@DefaultVisibility" in data["Visibility"]:
component_visibility.default_visibility = data["Visibility"]["@DefaultVisibility"]
if "Exceptions" in data["Visibility"] and "Component" in data["Visibility"]["Exceptions"]:
@@ -651,7 +679,7 @@ class BcfXml:
components.visibility = component_visibility
if "Coloring" in data and "Color" in data["Coloring"]:
for item in data["Coloring"]["Color"]:
color = bcf.data.Color()
color = bcf.v2.data.Color()
color.color = item["@Color"]
for item2 in item["Component"]:
color.components.append(self.get_component(item2))
@@ -661,7 +689,7 @@ class BcfXml:
def get_viewpoint_orthogonal_camera(self, visinfo):
if "OrthogonalCamera" not in visinfo:
return None
camera = bcf.data.OrthogonalCamera()
camera = bcf.v2.data.OrthogonalCamera()
data = visinfo["OrthogonalCamera"]
self.set_vector(camera.camera_view_point, data["CameraViewPoint"])
self.set_vector(camera.camera_direction, data["CameraDirection"])
@@ -672,7 +700,7 @@ class BcfXml:
def get_viewpoint_perspective_camera(self, visinfo):
if "PerspectiveCamera" not in visinfo:
return None
camera = bcf.data.PerspectiveCamera()
camera = bcf.v2.data.PerspectiveCamera()
data = visinfo["PerspectiveCamera"]
self.set_vector(camera.camera_view_point, data["CameraViewPoint"])
self.set_vector(camera.camera_direction, data["CameraDirection"])
@@ -685,7 +713,7 @@ class BcfXml:
return []
lines = []
for item in visinfo["Lines"]["Line"]:
line = bcf.data.Line()
line = bcf.v2.data.Line()
self.set_vector(line.start_point, item["StartPoint"])
self.set_vector(line.end_point, item["EndPoint"])
lines.append(line)
@@ -696,7 +724,7 @@ class BcfXml:
return []
planes = []
for item in visinfo["ClippingPlanes"]["ClippingPlane"]:
plane = bcf.data.ClippingPlane()
plane = bcf.v2.data.ClippingPlane()
self.set_vector(plane.location, item["Location"])
self.set_vector(plane.direction, item["Direction"])
planes.append(plane)
@@ -707,9 +735,9 @@ class BcfXml:
return []
bitmaps = []
for item in visinfo["Bitmap"]:
bitmap = bcf.data.Bitmap()
bitmap = bcf.v2.data.Bitmap()
bitmap.reference = item["Reference"]
bitmap.bitmap_type = item["Bitmap"].upper()
bitmap.bitmap_format = item["Bitmap"].upper()
self.set_vector(bitmap.location, item["Location"])
self.set_vector(bitmap.normal, item["Normal"])
self.set_vector(bitmap.up, item["Up"])
@@ -723,7 +751,7 @@ class BcfXml:
to_obj.z = from_xml["Z"]
def get_component(self, data):
component = bcf.data.Component()
component = bcf.v2.data.Component()
optional_keys = {
"originating_system": "OriginatingSystem",
"authoring_tool_id": "AuthoringToolId",
@@ -1,7 +1,27 @@
# BCF - BCF Python library
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BCF.
#
# BCF is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BCF is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with BCF. If not, see <http://www.gnu.org/licenses/>.
class Project:
def __init__(self):
self.project_id = ""
self.name = ""
self.extension_schema = ""
class BimSnippet:
@@ -156,7 +176,7 @@ class Bitmap:
def __init__(self):
self.reference = "" # Only in BCF-XML
self.bitmap_data = None # Only in BCF-API
self.bitmap_type = "PNG" # Enum of png or jpg
self.bitmap_format = "PNG" # Enum of png or jpg
self.location = Point()
self.normal = Direction()
self.up = Direction()
+19
View File
@@ -0,0 +1,19 @@
# 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/>.
+603
View File
@@ -0,0 +1,603 @@
# 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/>.
import uuid
import time
import json
import urllib
import requests
import webbrowser
import http.server
import base64
import tempfile
import os
client_id, client_secret = "", ""
class OAuthReceiver(http.server.BaseHTTPRequestHandler):
def do_GET(self):
query = urllib.parse.parse_qs(urllib.parse.urlparse(self.path).query)
self.server.auth_code = query.get("code", [""])[0]
self.server.auth_state = query.get("state", [""])[0]
self.send_response(200)
self.send_header("Content-type", "text/plain")
self.end_headers()
self.wfile.write("You have now authenticated :) You may now close this browser window.".encode("utf-8"))
class FoundationClient:
def __init__(self, client_id, client_secret, base_url=None, redirect_subdir=None):
self.baseurl = base_url
self.access_token = ""
self.refresh_token = ""
self.access_token_expires_on = time.time()
self.refresh_token_expires_on = float("inf")
self.auth_endpoint = None
self.token_endpoint = None
self.client_id = client_id
self.client_secret = client_secret
self.auth_method = None
self.redirect_subdir = redirect_subdir
def get_access_token(self):
if self.access_token and self.access_token_expires_on > time.time():
return self.access_token
elif self.refresh_token and self.refresh_token_expires_on > time.time():
self.get_refresh_token()
else:
self.login()
return self.access_token
def get_auth_methods(self):
resp = requests.get(f"{self.baseurl}foundation/1.0/auth")
return resp.json()["supported_oauth2_flows"]
def get_versions(self):
resp = requests.get(f"{self.baseurl}foundation/versions")
return resp.json()["versions"]
def login(self):
resp = requests.get(f"{self.baseurl}foundation/1.0/auth")
values = resp.json()
self.auth_endpoint = values["oauth2_auth_url"]
self.token_endpoint = values["oauth2_token_url"]
with http.server.HTTPServer(("", 8080), OAuthReceiver) as server:
state = str(uuid.uuid4())
query = urllib.parse.urlencode(
{
"client_id": self.client_id,
"response_type": "code",
"state": state,
"redirect_uri": f"http://localhost:{server.server_address[1]}/{self.redirect_subdir}",
}
)
if "?" in self.auth_endpoint:
webbrowser.open(f"{self.auth_endpoint}&{query}")
else:
webbrowser.open(f"{self.auth_endpoint}?{query}")
server.timeout = 100
server.state = state
server.handle_request()
if server.auth_code and server.auth_state == state:
data = {
"grant_type": "authorization_code",
"code": server.auth_code,
"redirect_uri": f"http://localhost:{server.server_address[1]}/{self.redirect_subdir}",
}
auth_string = f"{self.client_id}:{self.client_secret}"
header_string = base64.b64encode(auth_string.encode("utf-8")).decode("utf-8")
headers = {"Authorization": f"Basic {header_string}"}
self.set_tokens_from_response(requests.post(self.token_endpoint, data=data, headers=headers))
def get_refresh_token(self):
self.set_tokens_from_response(
requests.post(
self.token_endpoint,
params={
"grant_type": "refresh_token",
"refresh_token": self.refresh_token,
},
).json()
)
def get_new_access_token(self):
auth_string = f"{self.client_id}:{self.client_secret}"
header_string = base64.b64encode(auth_string.encode("utf-8")).decode("utf-8")
headers = {"Authorization": f"Basic {header_string}"}
self.set_tokens_from_response(
requests.post(
self.token_endpoint,
data={
"grant_type": "refresh_token",
"refresh_token": self.refresh_token,
},
headers=headers,
).json()
)
def set_auth_method(self, method="authorization_code_grant"):
if method != "authorization_code_grant":
raise NotImplementedError(f"{method} not supported")
else:
self.auth_method = method
def set_tokens_from_response(self, response):
response = response.json()
self.access_token = response["access_token"]
self.refresh_token = response["refresh_token"]
self.access_token_expires_on = time.time() + response["expires_in"]
if "refresh_token_expires_in" in response:
self.refresh_token_expires_on = time.time() + response["refresh_token_expires_in"]
class BcfClient:
def __init__(self, foundation_client):
self.foundation_client = foundation_client
self.version_id = None
self.baseurl = None
self.filepath = tempfile.mkdtemp()
def set_version(self, version):
self.version_id = version["version_id"]
self.baseurl = version["api_base_url"]
def get(self, endpoint, params=None, is_auth_required=False):
# TODO: handle error http status codes and raise exception. Follow error.json standard.
headers = {"Authorization": "Bearer " + self.foundation_client.get_access_token()}
response = requests.get(f"{self.baseurl}{endpoint}", headers=headers, params=params or None)
try:
response = requests.get(f"{self.baseurl}{endpoint}", headers=headers, params=params or None)
if response.status_code == 200:
return response.json()
response.raise_for_status()
except requests.exceptions.HTTPError as e:
print(f"message: {response.reason}' '{response.status_code}' '{ e }")
def post(self, endpoint, data=None, params=None):
headers = {
"Authorization": "Bearer " + self.foundation_client.get_access_token(),
"Content-type": "application/json",
}
try:
response = requests.post(
f"{self.baseurl}{endpoint}",
headers=headers,
params=params or None,
data=data or None,
)
if response.status_code == 201:
return response.status_code, response.text
response.raise_for_status()
except requests.exceptions.HTTPError as errh:
print(f"message: {response.reason}' '{response.status_code}, {errh}")
def put(self, endpoint, data=None, params=None):
headers = {
"Authorization": "Bearer " + self.foundation_client.get_access_token(),
"Content-type": "application/json",
}
try:
response = requests.put(
f"{self.baseurl}{endpoint}",
headers=headers,
params=params or None,
data=data or None,
)
if response.status_code == 200:
return response.status_code, response.text
response.raise_for_status()
except requests.exceptions.HTTPError as errh:
print(f"message: {response.reason}' '{response.status_code}, {errh}")
def delete(self, endpoint, params=None):
headers = {
"Authorization": "Bearer " + self.foundation_client.get_access_token(),
"Content-type": "application/json",
}
try:
response = requests.delete(
f"{self.baseurl}{endpoint}",
headers=headers,
params=params or None,
)
if response.status_code == 200:
return response.status_code, response.text
response.raise_for_status()
except requests.exceptions.HTTPError as errh:
print(f"message: {response.reason}' '{response.status_code}, {errh}")
def get_projects(self) -> list:
return self.get(
f"/projects",
)
def get_project(
self,
project_id="",
) -> dict:
return self.get(
f"/projects/{project_id}",
{
"project_id": project_id,
},
)
def update_project(self, project_id="", data=None) -> dict:
url = f"{self.baseurl}/projects/{project_id}"
headers = {"Authorization": "Bearer " + self.foundation_client.get_access_token()}
resp = requests.put(url, headers=headers, data=data)
return resp.status_code, resp.text
def get_extensions(
self,
project_id="",
) -> dict:
return self.get(
f"/projects/{project_id}/extensions",
{
"project_id": project_id,
},
)
def get_topics(
self,
project_id="",
topics="",
query_string=None,
) -> list:
# return self.get(
# f"/projects/{project_id}/topics",
# {
# "project_id": project_id,
# "topics": topics,
# "query_string": query_string,
# },
# )
pass
def get_topic(self, project_id="", topic_id="") -> dict:
return self.get(
f"/projects/{project_id}/topics/{topic_id}",
{
"project_id": project_id,
"topic_id": topic_id,
},
)
def create_topic(self, project_id="", data=None):
return self.post(f"/projects/{project_id}/topics", data=data)
def update_topic(self, project_id="", topic_id="", data=None) -> dict:
return self.put(f"/projects/{project_id}/topics/{topic_id}", data=data)
def delete_topic(self, project_id="", topic_id=""):
return self.delete(f"/projects/{project_id}/topics/{topic_id}")
def get_snippet(self, project_id="", topic_id="") -> str:
headers = {
"Authorization": "Bearer " + self.foundation_client.get_access_token(),
"Content-type": "application/octet-stream",
}
response = requests.get(
f"{self.baseurl}/projects/{project_id}/topics/{topic_id}/snippet",
headers=headers,
)
# TODO: write to tmpdir
with open(os.path.join(self.filepath, f"{project_id}_{topic_id}_snippet.txt"), "wb") as f:
f.write(response.content.decode("utf-8"))
return response.status_code, response.content
def update_snippet(self, project_id="", topic_id="", files=None, data=None):
headers = {
"Authorization": "Bearer " + self.foundation_client.get_access_token(),
"Content-type": "application/octet-stream",
}
response = requests.put(
f"{self.baseurl}/projects/{project_id}/topics/{topic_id}/snippet",
headers=headers,
files=files,
)
return response.status_code
def get_files_information(self, project_id="") -> list:
return self.get(
f"/projects/{project_id}/files_information",
{
"project_id": project_id,
},
)
def get_files(self, project_id="", topic_id="") -> list:
return self.get(
f"/projects/{project_id}/topics/{topic_id}/files",
{
"project_id": project_id,
"topic_id": topic_id,
},
)
def update_files(
self,
project_id="",
topic_id="",
data=None,
params=None,
):
return self.put(
f"/projects/{project_id}/topics/{topic_id}/files",
data=data,
)
def get_comments(self, project_id="", topic_id="") -> list:
pass
def create_comments(
self,
project_id="",
topic_id="",
data=None,
params=None,
):
return self.post(
f"/projects/{project_id}/topics/{topic_id}/comments",
data=data,
)
def get_comment(self, project_id="", topic_id="", comment_id="") -> dict:
return self.get(
f"/projects/{project_id}/topics/{topic_id}/comments/{comment_id}",
{
"project_id": project_id,
"topic_id": topic_id,
"comment_id": comment_id,
},
)
def delete_comment(self, project_id="", topic_id="", comment_id=""):
return self.delete(f"/projects/{project_id}/topics/{topic_id}/comments/{comment_id}")
def update_comment(
self,
project_id="",
topic_id="",
comment_id="",
data=None,
):
return self.put(
f"/projects/{project_id}/topics/{topic_id}/comments/{comment_id}",
data=data,
)
def get_viewpoints(self, project_id="", topic_id="") -> list:
return self.get(
f"/projects/{project_id}/topics/{topic_id}/viewpoints",
{
"project_id": project_id,
"topic_id": topic_id,
},
)
def create_viewpoints(self, project_id="", topic_id="", data=None):
return self.post(
f"/projects/{project_id}/topics/{topic_id}/viewpoints",
data=data,
)
def get_viewpoint(self, project_id="", topic_id="", viewpoint_id="") -> dict:
return self.get(
f"/projects/{project_id}/topics/{topic_id}/viewpoints/{viewpoint_id}",
{
"project_id": project_id,
"topic_id": topic_id,
"viewpoint_id": viewpoint_id,
},
)
def delete_viewpoint(
self,
project_id="",
topic_id="",
viewpoint_id="",
):
return self.delete(
f"/projects/{project_id}/topics/{topic_id}/viewpoints/{viewpoint_id}",
)
def get_snapshot(self, project_id="", topic_id="", viewpoint_id="") -> str:
return self.get(
f"/projects/{project_id}/topics/{topic_id}/viewpoints/{viewpoint_id}/snapshot",
{
"project_id": project_id,
"topic_id": topic_id,
"viewpoint_id": viewpoint_id,
},
)
def get_bitmap(self, project_id="", topic_id="", viewpoint_id="", bitmap_id="") -> str:
return self.get(
f"/projects/{project_id}/topics/{topic_id}/viewpoints/{viewpoint_id}/bitmaps/{bitmap_id}",
{
"project_id": project_id,
"topic_id": topic_id,
"viewpoint_id": viewpoint_id,
"bitmap_id": bitmap_id,
},
)
def get_selection(self, project_id="", topic_id="", viewpoint_id="") -> dict:
return self.get(
f"/projects/{project_id}/topics/{topic_id}/viewpoints/{viewpoint_id}/selection",
{
"project_id": project_id,
"topic_id": topic_id,
"viewpoint_id": viewpoint_id,
},
)
def get_coloring(self, project_id="", topic_id="", viewpoint_id="") -> dict:
return self.get(
f"/projects/{project_id}/topics/{topic_id}/viewpoints/{viewpoint_id}/coloring",
{
"project_id": project_id,
"topic_id": topic_id,
"viewpoint_id": viewpoint_id,
},
)
def get_visibility(self, project_id="", topic_id="", viewpoint_id="") -> dict:
return self.get(
f"/projects/{project_id}/topics/{topic_id}/viewpoints/{viewpoint_id}/visibility",
{
"project_id": project_id,
"topic_id": topic_id,
"viewpoint_id": viewpoint_id,
},
)
def get_related_topics(self, project_id="", topic_id="") -> list:
return self.get(
f"/projects/{project_id}/topics/{topic_id}/related_topics",
{
"project_id": project_id,
"topic_id": topic_id,
},
)
def update_related_topics(
self,
project_id="",
topic_id="",
data=None,
):
return self.put(
f"/projects/{project_id}/topics/{topic_id}/related_topics",
data=data,
)
def get_document_references(self, project_id="", topic_id="") -> list:
return self.get(
f"/projects/{project_id}/topics/{topic_id}/document_references",
{
"project_id": project_id,
"topic_id": topic_id,
},
)
def create_document_reference(
self,
project_id="",
topic_id="",
data=None,
):
return self.post(
f"/projects/{project_id}/topics/{topic_id}/document_references",
data=data,
)
def update_document_references(
self,
project_id="",
topic_id="",
document_reference_id="",
data=None,
):
return self.put(
f"/projects/{project_id}/topics/{topic_id}/document_references/{document_reference_id}",
data=data,
)
def get_documents(self, project_id="", topic_id="") -> list:
return self.get(
f"/projects/{project_id}/topics/{topic_id}/documents",
{
"project_id": project_id,
"topic_id": topic_id,
},
)
def create_document(
self,
project_id="",
topic_id="",
guid=None,
files=None,
data=None,
):
headers = {
"Authorization": "Bearer " + self.foundation_client.get_access_token(),
"Content-type": "application/octet-stream",
}
response = requests.post(
f"/projects/{project_id}/topics/{topic_id}/documents",
data=data,
params={guid},
files=files,
headers=headers,
)
return response.status_code
def get_document(self, project_id="", topic_id="", document_id="") -> str:
headers = {
"Authorization": "Bearer " + self.foundation_client.get_access_token(),
"Content-type": "application/octet-stream",
}
response = requests.get(
f"{self.baseurl}/projects/{project_id}/topics/documents/{document_id}",
headers=headers,
)
with open(os.path.join(self.filepath, f"{project_id}_{topic_id}_{document_id}_document.txt"), "wb") as f:
f.write(response.content.decode("utf-8"))
return response.status_code, response.content
def get_topics_events(self, project_id="") -> list:
return self.get(
f"/projects/{project_id}/topics/events",
{
"project_id": project_id,
},
)
def get_topic_events(self, project_id="", topic_id="") -> list:
return self.get(
f"/projects/{project_id}/topics/{topic_id}/events",
{
"project_id": project_id,
"topic_id": topic_id,
},
)
def get_comments_events(self, project_id="") -> list:
return self.get(
f"/projects/{project_id}/topics/comments/events",
{
"project_id": project_id,
},
)
def get_comment_events(self, project_id="", topic_id="", comment_id="") -> list:
return self.get(
f"/projects/{project_id}/topics/{topic_id}/comments/{comment_id}/events",
{
"project_id": project_id,
"topic_id": topic_id,
"comment_id": comment_id,
},
)
+847
View File
@@ -0,0 +1,847 @@
# 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/>.
import os
import uuid
import shutil
import zipfile
import logging
import tempfile
import bcf.v3.data
from datetime import datetime
from xml.dom import minidom
from xmlschema import XMLSchema
from contextlib import contextmanager
from shutil import copyfile
cwd = os.path.dirname(os.path.realpath(__file__))
@contextmanager
def cd(newdir):
prevdir = os.getcwd()
os.chdir(os.path.expanduser(newdir))
try:
yield
finally:
os.chdir(prevdir)
class BcfXml:
def __init__(self):
self.filepath = None
self.logger = logging.getLogger("bcfxml")
self.author = "john@doe.com"
self.project = bcf.v3.data.Project()
self.version = "3.0"
self.topics = {}
def new_project(self):
self.project.project_id = str(uuid.uuid4())
self.project.name = "New Project"
self.topics = {}
if self.filepath:
self.close_project()
self.filepath = tempfile.mkdtemp()
self.edit_project()
self.edit_version()
def get_project(self, filepath=None):
if os.path.isfile(os.path.join(self.filepath, "project.bcfp")):
data = self._read_xml("project.bcfp", "project.xsd")
self.project.project_id = data["Project"]["@ProjectId"]
self.project.name = data["Project"].get("Name")
return self.project
def edit_project(self):
self.document = minidom.Document()
root = self._create_element(self.document, "ProjectInfo")
project = self._create_element(root, "Project", {"ProjectId": self.project.project_id})
if self.project.name:
self._create_element(project, "Name", text=self.project.name)
with open(os.path.join(self.filepath, "project.bcfp"), "wb") as f:
f.write(self.document.toprettyxml(encoding="utf-8"))
def save_project(self, filepath):
with cd(self.filepath):
zip_file = zipfile.ZipFile(filepath, "w", zipfile.ZIP_DEFLATED)
for root, dirs, files in os.walk("./"):
for file in files:
zip_file.write(os.path.join(root, file))
zip_file.close()
def get_version(self):
data = self._read_xml("bcf.version", "version.xsd")
self.version = data["@VersionId"]
return self.version
def edit_version(self):
self.document = minidom.Document()
root = self._create_element(self.document, "Version", {"VersionId": self.version})
with open(os.path.join(self.filepath, "bcf.version"), "wb") as f:
f.write(self.document.toprettyxml(encoding="utf-8"))
def get_topics(self):
self.topics = {}
topics = []
subdirs = []
for (dirpath, dirnames, filenames) in os.walk(self.filepath):
subdirs = dirnames
break
for subdir in subdirs:
try:
uuid.UUID(subdir)
except ValueError:
continue
if not os.path.exists(os.path.join(self.filepath, subdir, "markup.bcf")):
continue
self.topics[subdir] = self.get_topic(subdir)
return self.topics
def get_header(self, guid):
data = self._read_xml(os.path.join(guid, "markup.bcf"), "markup.xsd")
if "Header" not in data:
return
header = bcf.v3.data.Header()
if data["Header"].get("Files"):
for item in data["Header"]["Files"].get("File", []):
header_file = bcf.v3.data.HeaderFile()
optional_keys = {
"filename": "Filename",
"date": "Date",
"reference": "Reference",
"ifc_project": "@IfcProject",
"ifc_spatial_structure_element": "@IfcSpatialStructureElement",
"is_external": "@IsExternal",
}
for key, value in optional_keys.items():
if value in item:
setattr(header_file, key, item[value])
header.files.append(header_file)
self.topics[guid].header = header
return header
def get_topic(self, guid):
if guid in self.topics:
return self.topics[guid]
data = self._read_xml(os.path.join(guid, "markup.bcf"), "markup.xsd")
topic = bcf.v3.data.Topic()
self.topics[guid] = topic
mandatory_keys = {
"guid": "@Guid",
"title": "Title",
"creation_date": "CreationDate",
"creation_author": "CreationAuthor",
"topic_status": "@TopicStatus",
"topic_type": "@TopicType",
}
for key, value in mandatory_keys.items():
setattr(topic, key, data["Topic"][value])
optional_keys = {
"priority": "Priority",
"index": "Index",
"modified_date": "ModifiedDate",
"modified_author": "ModifiedAuthor",
"due_date": "DueDate",
"assigned_to": "AssignedTo",
"stage": "Stage",
"description": "Description",
"server_assigned_id": "@ServerAssignedId",
}
for key, value in optional_keys.items():
if value in data["Topic"]:
setattr(topic, key, data["Topic"][value])
if data["Topic"].get("ReferenceLinks"):
topic.reference_links.extend(data["Topic"]["ReferenceLinks"].get("ReferenceLink", []))
if data["Topic"].get("Labels"):
topic.labels.extend(data["Topic"]["Labels"].get("Label", []))
if "BimSnippet" in data["Topic"]:
bim_snippet = bcf.v3.data.BimSnippet()
keys = {
"snippet_type": "@SnippetType",
"is_external": "@IsExternal",
"reference": "Reference",
"reference_schema": "ReferenceSchema",
}
for key, value in keys.items():
if value in data["Topic"]["BimSnippet"]:
setattr(bim_snippet, key, data["Topic"]["BimSnippet"][value])
topic.bim_snippet = bim_snippet
if data["Topic"].get("DocumentReferences"):
for item in data["Topic"]["DocumentReferences"].get("DocumentReference", []):
document_reference = bcf.v3.data.DocumentReference()
keys = {
"document_guid": "DocumentGuid",
"url": "Url",
"guid": "@Guid",
"description": "Description",
}
for key, value in keys.items():
if value in item:
setattr(document_reference, key, item[value])
topic.document_references.append(document_reference)
if data["Topic"].get("RelatedTopics"):
for item in data["Topic"]["RelatedTopics"].get("RelatedTopic", []):
related_topic = bcf.v3.data.RelatedTopic()
related_topic.guid = item["@Guid"]
topic.related_topics.append(related_topic)
return topic
def add_topic(self, topic=None):
if topic is None:
topic = bcf.v3.data.Topic()
if not topic.guid:
topic.guid = str(uuid.uuid4())
if not topic.title:
topic.title = "New Topic"
os.mkdir(os.path.join(self.filepath, topic.guid))
self.edit_topic(topic)
return topic
def edit_topic(self, topic):
if not topic.creation_date:
topic.creation_date = datetime.utcnow().isoformat()
topic.creation_author = self.author
else:
topic.modified_date = datetime.utcnow().isoformat()
topic.modified_author = self.author
self.document = minidom.Document()
root = self._create_element(self.document, "Markup")
if topic.header:
self.write_header(topic.header, root)
topic_el = self._create_element(
root,
"Topic",
{
"Guid": topic.guid,
"ServerAssignedId": topic.server_assigned_id,
"TopicType": topic.topic_type,
"TopicStatus": topic.topic_status,
},
)
if topic.reference_links:
reference_Links_el = self._create_element(topic_el, "ReferenceLinks")
for reference_link in topic.reference_links:
self._create_element(reference_Links_el, "ReferenceLink", text=reference_link)
text_map = {
"Title": topic.title,
"Priority": topic.priority,
"Index": topic.index,
}
for key, value in text_map.items():
if value:
self._create_element(topic_el, key, text=value)
if topic.labels:
label_el = self._create_element(topic_el, "Labels")
for label in topic.labels:
self._create_element(label_el, "Label", text=label)
text_map = {
"CreationDate": topic.creation_date,
"CreationAuthor": topic.creation_author,
"ModifiedDate": topic.modified_date,
"ModifiedAuthor": topic.modified_author,
"DueDate": topic.due_date,
"AssignedTo": topic.assigned_to,
"Stage": topic.stage,
"Description": topic.description,
}
for key, value in text_map.items():
if value:
self._create_element(topic_el, key, text=value)
if topic.bim_snippet:
bim_snippet = self._create_element(
topic_el,
"BimSnippet",
{
"SnippetType": topic.bim_snippet.snippet_type,
"IsExternal": topic.bim_snippet.is_external,
},
)
self._create_element(bim_snippet, "Reference", text=topic.bim_snippet.reference)
self._create_element(
bim_snippet,
"ReferenceSchema",
text=topic.bim_snippet.reference_schema,
)
if topic.document_references:
reference_el = self._create_element(topic_el, "DocumentReferences")
self.write_document_references(topic.document_references, reference_el)
if topic.related_topics:
related_topic_el = self._create_element(topic_el, "RelatedTopics")
for related_topic in topic.related_topics:
self._create_element(related_topic_el, "RelatedTopic", {"Guid": related_topic.guid})
if topic.comments:
comment_el = self._create_element(topic_el, "Comments")
self.write_comments(topic.comments, comment_el)
if topic.viewpoints:
viewpoint_el = self._create_element(topic_el, "Viewpoints")
self.write_viewpoints(topic.viewpoints, viewpoint_el, topic)
with open(os.path.join(self.filepath, topic.guid, "markup.bcf"), "wb") as f:
f.write(self.document.toprettyxml(encoding="utf-8"))
def write_document_references(self, references, root):
for reference in references:
document_reference_el = self._create_element(root, "DocumentReference", {"Guid": reference.guid})
if reference.document_guid:
self._create_element(document_reference_el, "DocumentGuid", text=reference.document_guid)
elif reference.url:
self._create_element(document_reference_el, "Url", text=reference.url)
if reference.description:
self._create_element(document_reference_el, "Description", text=reference.description)
def write_header(self, header, root):
if not header or not header.files:
return
header_el = self._create_element(root, "Header")
files_el = self._create_element(header_el, "Files")
for f in header.files:
file_el = self._create_element(
files_el,
"File",
{
"IfcProject": f.ifc_project,
"IfcSpatialStructureElement": f.ifc_spatial_structure_element,
"IsExternal": f.is_external,
},
)
if f.filename:
self._create_element(file_el, "Filename", text=f.filename)
if f.date:
self._create_element(file_el, "Date", text=f.date)
if f.reference:
self._create_element(file_el, "Reference", text=f.reference)
def write_comments(self, comments, root):
for comment in comments.values():
comment_el = self._create_element(root, "Comment", {"Guid": comment.guid})
text_map = {
"Date": comment.date,
"Author": comment.author,
"Comment": comment.comment,
"ModifiedDate": comment.modified_date,
"ModifiedAuthor": comment.modified_author,
}
for key, value in text_map.items():
if value:
self._create_element(comment_el, key, text=value)
if comment.viewpoint:
self._create_element(comment_el, "Viewpoint", {"Guid": comment.viewpoint.guid})
def add_comment(self, topic, comment=None):
if comment is None:
comment = bcf.v3.data.Comment()
if not comment.guid:
comment.guid = str(uuid.uuid4())
if not comment.comment:
comment.comment = "'Free software' is a matter of liberty, not price. To understand the concept, you should think of 'free' as in 'free speech,' not as in 'free beer'."
topic.comments[comment.guid] = comment
self.edit_comment(comment, topic)
def edit_comment(self, comment, topic):
if not comment.date:
comment.date = datetime.utcnow().isoformat()
comment.author = self.author
else:
comment.modified_date = datetime.utcnow().isoformat()
comment.modified_author = self.author
self.edit_topic(topic)
def delete_comment(self, guid, topic):
if guid in topic.comments:
del topic.comments[guid]
self.edit_topic(topic)
def delete_topic(self, guid):
if guid in self.topics:
del self.topics[guid]
shutil.rmtree(os.path.join(self.filepath, guid))
def write_viewpoints(self, viewpoints, root, topic):
for viewpoint in viewpoints.values():
viewpoint_el = self._create_element(root, "ViewPoint", {"Guid": viewpoint.guid})
text_map = {
"Viewpoint": viewpoint.viewpoint,
"Snapshot": viewpoint.snapshot,
"Index": viewpoint.index,
}
for key, value in text_map.items():
if value:
self._create_element(viewpoint_el, key, text=value)
self.write_viewpoint(viewpoint, topic)
def write_viewpoint(self, viewpoint, topic):
document = minidom.Document()
root = self._create_element(document, "VisualizationInfo", {"Guid": viewpoint.guid})
self.write_viewpoint_components(viewpoint, root)
self.write_viewpoint_orthogonal_camera(viewpoint, root)
self.write_viewpoint_perspective_camera(viewpoint, root)
self.write_viewpoint_lines(viewpoint, root)
self.write_viewpoint_clipping_planes(viewpoint, root)
self.write_viewpoint_bitmaps(viewpoint, root)
with open(os.path.join(self.filepath, topic.guid, viewpoint.viewpoint), "wb") as f:
f.write(document.toprettyxml(encoding="utf-8"))
def write_viewpoint_components(self, viewpoint, parent):
if not viewpoint.components:
return
components_el = self._create_element(parent, "Components")
if viewpoint.components.selection:
selection_el = self._create_element(components_el, "Selection")
for selection in viewpoint.components.selection:
self.write_component(selection, selection_el)
if viewpoint.components.visibility:
visibility = self._create_element(
components_el,
"Visibility",
{"DefaultVisibility": viewpoint.components.visibility.default_visibility},
)
if viewpoint.components.visibility.view_setup_hints:
view_setup_hints = self._create_element(
visibility,
"ViewSetupHints",
{
"SpacesVisible": viewpoint.components.visibility.view_setup_hints.spaces_visible,
"SpaceBoundariesVisible": viewpoint.components.visibility.view_setup_hints.space_boundaries_visible,
"OpeningsVisible": viewpoint.components.visibility.view_setup_hints.openings_visible,
},
)
if viewpoint.components.visibility.exceptions:
exceptions_el = self._create_element(visibility, "Exceptions")
for exception in viewpoint.components.visibility.exceptions:
self.write_component(exception, exceptions_el)
if viewpoint.components.coloring:
coloring_el = self._create_element(components_el, "Coloring")
for color in viewpoint.components.coloring:
color_el = self._create_element(coloring_el, "Color", {"Color": color.color})
component_el = self._create_element(color_el, "Components")
for component in color.components:
self.write_component(component, component_el)
def write_viewpoint_orthogonal_camera(self, viewpoint, parent):
if not viewpoint.orthogonal_camera:
return
camera = viewpoint.orthogonal_camera
camera_el = self._create_element(parent, "OrthogonalCamera")
camera_view_point = self._create_element(camera_el, "CameraViewPoint")
self.write_vector(camera_view_point, camera.camera_view_point)
camera_direction = self._create_element(camera_el, "CameraDirection")
self.write_vector(camera_direction, camera.camera_direction)
camera_up_vector = self._create_element(camera_el, "CameraUpVector")
self.write_vector(camera_up_vector, camera.camera_up_vector)
self._create_element(camera_el, "ViewToWorldScale", text=camera.view_to_world_scale)
self._create_element(camera_el, "AspectRatio", text=camera.aspect_ratio)
def write_viewpoint_perspective_camera(self, viewpoint, parent):
if not viewpoint.perspective_camera:
return
camera = viewpoint.perspective_camera
camera_el = self._create_element(parent, "PerspectiveCamera")
camera_view_point = self._create_element(camera_el, "CameraViewPoint")
self.write_vector(camera_view_point, camera.camera_view_point)
camera_direction = self._create_element(camera_el, "CameraDirection")
self.write_vector(camera_direction, camera.camera_direction)
camera_up_vector = self._create_element(camera_el, "CameraUpVector")
self.write_vector(camera_up_vector, camera.camera_up_vector)
self._create_element(camera_el, "FieldOfView", text=camera.field_of_view)
self._create_element(camera_el, "AspectRatio", text=camera.aspect_ratio)
def write_viewpoint_lines(self, viewpoint, parent):
if not viewpoint.lines:
return
lines_el = self._create_element(parent, "Lines")
for line in viewpoint.lines:
line_el = self._create_element(lines_el, "Line")
start_point_el = self._create_element(line_el, "StartPoint")
self.write_vector(start_point_el, line.start_point)
end_point_el = self._create_element(line_el, "EndPoint")
self.write_vector(end_point_el, line.end_point)
def write_viewpoint_clipping_planes(self, viewpoint, parent):
if not viewpoint.clipping_planes:
return
planes_el = self._create_element(parent, "ClippingPlanes")
for plane in viewpoint.clipping_planes:
plane_el = self._create_element(planes_el, "ClippingPlane")
location_el = self._create_element(plane_el, "Location")
self.write_vector(location_el, plane.location)
direction_el = self._create_element(plane_el, "Direction")
self.write_vector(direction_el, plane.direction)
def write_viewpoint_bitmaps(self, viewpoint, parent):
if not viewpoint.bitmaps:
return
bitmaps_el = self._create_element(parent, "Bitmaps")
for bitmap in viewpoint.bitmaps:
bitmap_el = self._create_element(bitmaps_el, "Bitmap")
text_map = {"Format": bitmap.bitmap_format, "Reference": bitmap.reference}
for key, value in text_map.items():
self._create_element(bitmap_el, key, text=value)
location_el = self._create_element(bitmap_el, "Location")
self.write_vector(location_el, bitmap.location)
normal_el = self._create_element(bitmap_el, "Normal")
self.write_vector(normal_el, bitmap.normal)
up_el = self._create_element(bitmap_el, "Up")
self.write_vector(up_el, bitmap.up)
self._create_element(bitmap_el, "Height", text=bitmap.height)
def write_vector(self, parent, from_obj):
self._create_element(parent, "X", text=from_obj.x)
self._create_element(parent, "Y", text=from_obj.y)
self._create_element(parent, "Z", text=from_obj.z)
def write_component(self, data, parent):
component_el = self._create_element(parent, "Component", {"IfcGuid": data.ifc_guid})
text_map = {
"OriginatingSystem": data.originating_system,
"AuthoringToolId": data.authoring_tool_id,
}
for key, value in text_map.items():
if value:
self._create_element(component_el, key, text=value)
def add_viewpoint(self, topic, viewpoint=None):
if not viewpoint:
viewpoint = bcf.v3.data.Viewpoint()
if not viewpoint.guid:
viewpoint.guid = str(uuid.uuid4())
if not viewpoint.viewpoint:
viewpoint.viewpoint = f"{viewpoint.guid}.bcfv"
if viewpoint.snapshot:
topic_filepath = os.path.join(self.filepath, topic.guid)
filepath = os.path.join(topic_filepath, viewpoint.snapshot)
if not os.path.exists(filepath):
filename = viewpoint.guid + os.path.splitext(viewpoint.snapshot)[-1]
copyfile(viewpoint.snapshot, os.path.join(topic_filepath, filename))
viewpoint.snapshot = filename
topic.viewpoints[viewpoint.guid] = viewpoint
self.edit_topic(topic)
def delete_viewpoint(self, guid, topic):
if guid not in topic.viewpoints:
return
viewpoint = topic.viewpoints[guid]
if viewpoint.snapshot:
filepath = os.path.join(self.filepath, topic.guid, viewpoint.snapshot)
if os.path.exists(filepath):
os.remove(filepath)
if viewpoint.viewpoint:
filepath = os.path.join(self.filepath, topic.guid, viewpoint.viewpoint)
if os.path.exists(filepath):
os.remove(filepath)
for bitmap in viewpoint.bitmaps:
if not bitmap.reference:
continue
filepath = os.path.join(self.filepath, topic.guid, bitmap.reference)
if os.path.exists(filepath):
os.remove(filepath)
del topic.viewpoints[guid]
self.edit_topic(topic)
def delete_file(self, topic, index):
if not topic.header:
return
f = topic.header.files.pop(index)
filepath = os.path.join(self.filepath, topic.guid, f.reference)
if not f.is_external and os.path.exists(filepath):
os.remove(filepath)
self.edit_topic(topic)
def delete_bim_snippet(self, topic):
if not topic.bim_snippet:
return
if topic.bim_snippet.reference and not topic.bim_snippet.is_external:
filepath = os.path.join(self.filepath, topic.guid, topic.bim_snippet.reference)
if os.path.exists(filepath):
os.remove(filepath)
topic.bim_snippet = None
self.edit_topic(topic)
def delete_document_reference(self, topic, index):
document_reference = topic.document_references[index]
if document_reference.referenced_document and not document_reference.is_external:
filepath = os.path.join(self.filepath, topic.guid, document_reference.referenced_document)
if os.path.exists(filepath):
os.remove(filepath)
del topic.document_references[index]
self.edit_topic(topic)
def add_document_reference(self, topic, document_reference):
if os.path.exists(document_reference.referenced_document):
topic_filepath = os.path.join(self.filepath, topic.guid)
filename = os.path.basename(document_reference.referenced_document)
copyfile(
document_reference.referenced_document,
os.path.join(topic_filepath, filename),
)
document_reference.referenced_document = filename
document_reference.is_external = False
else:
document_reference.is_external = True
if not document_reference.guid:
document_reference.guid = str(uuid.uuid4())
topic.document_references.append(document_reference)
self.edit_topic(topic)
def add_bim_snippet(self, topic, bim_snippet):
if topic.bim_snippet:
self.delete_bim_snippet(topic)
if os.path.exists(bim_snippet.reference):
topic_filepath = os.path.join(self.filepath, topic.guid)
filename = os.path.basename(bim_snippet.reference)
copyfile(bim_snippet.reference, os.path.join(topic_filepath, filename))
bim_snippet.reference = filename
bim_snippet.is_external = False
else:
bim_snippet.is_external = True
topic.bim_snippet = bim_snippet
self.edit_topic(topic)
def add_file(self, topic, header_file):
if os.path.exists(header_file.reference):
topic_filepath = os.path.join(self.filepath, topic.guid)
header_file.filename = os.path.basename(header_file.reference)
copyfile(
header_file.reference,
os.path.join(topic_filepath, header_file.filename),
)
header_file.reference = header_file.filename
header_file.is_external = False
header_file.date = datetime.utcnow().isoformat()
if not topic.header:
topic.header = bcf.v3.data.Header()
topic.header.files.append(header_file)
self.edit_topic(topic)
def get_comments(self, guid):
comments = {}
data = self._read_xml(os.path.join(guid, "markup.bcf"), "markup.xsd")
if "Comments" not in data["Topics"]:
return comments
for item in data["Topic"]["Comments"].get("Comment", []):
comment = bcf.v3.data.Comment()
mandatory_keys = {
"guid": "@Guid",
"date": "Date",
"author": "Author",
}
for key, value in mandatory_keys.items():
setattr(comment, key, item[value])
optional_keys = {
"comment": "Comment",
"modified_date": "ModifiedDate",
"modified_author": "ModifiedAuthor",
}
for key, value in optional_keys.items():
if value in item:
setattr(comment, key, item[value])
if "Viewpoint" in item:
viewpoint = bcf.v3.data.Viewpoint()
viewpoint.guid = item["Viewpoint"]["@Guid"]
comment.viewpoint = viewpoint
comments[comment.guid] = comment
self.topics[guid].comments = comments
return comments
def get_viewpoints(self, guid):
viewpoints = {}
data = self._read_xml(os.path.join(guid, "markup.bcf"), "markup.xsd")
if "Viewpoints" not in data["Topic"]:
return viewpoints
for item in data["Topic"]["Viewpoints"]:
viewpoint = self.get_viewpoint(item, guid)
viewpoints[viewpoint.guid] = viewpoint
self.topics[guid].viewpoints = viewpoints
return viewpoints
def get_viewpoint(self, data, topic_guid):
viewpoint = bcf.v3.data.Viewpoint()
viewpoint.guid = data["@Guid"]
optional_keys = {
"viewpoint": "Viewpoint",
"snapshot": "Snapshot",
"index": "Index",
}
for key, value in optional_keys.items():
if value in data:
setattr(viewpoint, key, data[value])
visinfo = self._read_xml(os.path.join(topic_guid, viewpoint.viewpoint), "visinfo.xsd")
viewpoint.components = self.get_viewpoint_components(visinfo)
viewpoint.orthogonal_camera = self.get_viewpoint_orthogonal_camera(visinfo)
viewpoint.perspective_camera = self.get_viewpoint_perspective_camera(visinfo)
viewpoint.lines = self.get_viewpoint_lines(visinfo)
viewpoint.clipping_planes = self.get_viewpoint_clipping_planes(visinfo)
viewpoint.bitmaps = self.get_viewpoint_bitmaps(visinfo)
return viewpoint
def get_viewpoint_components(self, visinfo):
if "Components" not in visinfo:
return None
components = bcf.v3.data.Components()
data = visinfo["Components"]
if "Selection" in data and "Component" in data["Selection"]:
for item in data["Selection"].get("Component", []):
components.selection.append(self.get_component(item))
if "Visibility" in data:
component_visibility = bcf.v3.data.ComponentVisibility()
if "@DefaultVisibility" in data["Visibility"]:
component_visibility.default_visibility = data["Visibility"]["@DefaultVisibility"]
if "Exceptions" in data["Visibility"] and "Component" in data["Visibility"]["Exceptions"]:
for item in data["Visibility"]["Exceptions"]["Component"]:
component_visibility.exceptions.append(self.get_component(item))
if "ViewSetupHints" in data["Visibility"]:
view_setup_hints = bcf.v3.data.ViewSetupHints()
optional_keys = {
"spaces_visible": "@SpacesVisible",
"space_boundaries_visible": "@SpaceBoundariesVisible",
"openings_visible": "@OpeningsVisible",
}
for key, value in optional_keys.items():
if value in data["Visibility"]["ViewSetupHints"]:
setattr(view_setup_hints, key, data["Visibility"]["ViewSetupHints"][value])
component_visibility.view_setup_hints = view_setup_hints
components.visibility = component_visibility
if "Coloring" in data and "Color" in data["Coloring"]:
for item in data["Coloring"]["Color"]:
color = bcf.v3.data.Color()
color.color = item["@Color"]
for item2 in item["Components"]["Component"]:
color.components.append(self.get_component(item2))
components.coloring.append(color)
return components
def get_viewpoint_orthogonal_camera(self, visinfo):
if "OrthogonalCamera" not in visinfo:
return None
camera = bcf.v3.data.OrthogonalCamera()
data = visinfo["OrthogonalCamera"]
self.set_vector(camera.camera_view_point, data["CameraViewPoint"])
self.set_vector(camera.camera_direction, data["CameraDirection"])
self.set_vector(camera.camera_up_vector, data["CameraUpVector"])
camera.view_to_world_scale = data["ViewToWorldScale"]
camera.aspect_ratio = data["AspectRatio"]
return camera
def get_viewpoint_perspective_camera(self, visinfo):
if "PerspectiveCamera" not in visinfo:
return None
camera = bcf.v3.data.PerspectiveCamera()
data = visinfo["PerspectiveCamera"]
self.set_vector(camera.camera_view_point, data["CameraViewPoint"])
self.set_vector(camera.camera_direction, data["CameraDirection"])
self.set_vector(camera.camera_up_vector, data["CameraUpVector"])
camera.field_of_view = data["FieldOfView"]
camera.aspect_ratio = data["AspectRatio"]
return camera
def get_viewpoint_lines(self, visinfo):
if "Lines" not in visinfo:
return []
lines = []
for item in visinfo["Lines"].get("Line", []):
line = bcf.v3.data.Line()
self.set_vector(line.start_point, item["StartPoint"])
self.set_vector(line.end_point, item["EndPoint"])
lines.append(line)
return lines
def get_viewpoint_clipping_planes(self, visinfo):
if "ClippingPlanes" not in visinfo:
return []
planes = []
for item in visinfo["ClippingPlanes"]["ClippingPlane"]:
plane = bcf.v3.data.ClippingPlane()
self.set_vector(plane.location, item["Location"])
self.set_vector(plane.direction, item["Direction"])
planes.append(plane)
return planes
def get_viewpoint_bitmaps(self, visinfo):
if "Bitmaps" not in visinfo:
return []
bitmaps = []
for item in visinfo["Bitmaps"].get("Bitmap"):
bitmap = bcf.v3.data.Bitmap()
bitmap.reference = item["Reference"]
bitmap.bitmap_format = item["Format"].upper()
self.set_vector(bitmap.location, item["Location"])
self.set_vector(bitmap.normal, item["Normal"])
self.set_vector(bitmap.up, item["Up"])
bitmap.height = item["Height"]
bitmaps.append(bitmap)
return bitmaps
def set_vector(self, to_obj, from_xml):
to_obj.x = from_xml["X"]
to_obj.y = from_xml["Y"]
to_obj.z = from_xml["Z"]
def get_component(self, data):
component = bcf.v3.data.Component()
optional_keys = {
"originating_system": "OriginatingSystem",
"authoring_tool_id": "AuthoringToolId",
"ifc_guid": "@IfcGuid",
}
for key, value in optional_keys.items():
if value in data:
setattr(component, key, data[value])
return component
def close_project(self):
shutil.rmtree(self.filepath)
def _read_xml(self, filename, xsd):
schema = XMLSchema(os.path.join(cwd, "xsd", xsd))
filepath = os.path.join(self.filepath, filename)
(data, errors) = schema.to_dict(filepath, validation="lax")
for error in errors:
self.logger.error(error)
return data
def _create_element(self, parent, name, attributes={}, text=None):
element = self.document.createElement(name)
for key, value in attributes.items():
if isinstance(value, bool):
element.setAttribute(key, str(value).lower())
elif value:
element.setAttribute(key, value)
if text is not None:
text = self.document.createTextNode(str(text))
element.appendChild(text)
parent.appendChild(element)
return element
def __del__(self):
self.close_project()
+200
View File
@@ -0,0 +1,200 @@
# BCF - BCF Python library
# Copyright (C) 2021 Prabhat Singh <singh01prabhat@gmail.com>
#
# This file is part of BCF.
#
# BCF is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BCF is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with BCF. If not, see <http://www.gnu.org/licenses/>.
class Project:
def __init__(self):
self.project_id = ""
self.name = ""
class BimSnippet:
def __init__(self):
self.snippet_type = None
self.is_external = False
self.reference = None
self.reference_schema = None
class DocumentReference:
def __init__(self):
self.description = None
self.document_guid = None
self.url = None
self.guid = None
class RelatedTopic:
def __init__(self):
self.guid = None
class HeaderFile:
def __init__(self):
self.filename = ""
self.date = None
self.reference = ""
self.ifc_project = None
self.ifc_spatial_structure_element = None
self.is_external = True
class Header:
def __init__(self):
self.files = []
class Topic:
def __init__(self):
self.reference_links = []
self.title = ""
self.priority = None
self.index = None # Deprecated, stored, but ignored
self.labels = []
self.creation_date = None
self.creation_author = None
self.modified_date = None
self.modified_author = None
self.due_date = None
self.assigned_to = None
self.stage = None
self.description = None
self.bim_snippet = None
self.document_references = []
self.related_topics = []
self.topic_status = None
self.topic_type = None
self.guid = None
self.header = None
self.comments = {}
self.viewpoints = {}
self.server_assigned_id = ""
class Comment:
def __init__(self):
self.guid = None
self.date = None
self.author = ""
self.comment = ""
self.viewpoint = None
self.modified_date = None
self.modified_author = ""
class ViewSetupHints:
def __init__(self):
self.spaces_visible = False
self.space_boundaries_visible = False
self.openings_visible = False
class Component:
def __init__(self):
self.originating_system = None
self.authoring_tool_id = None
self.ifc_guid = None
class ComponentVisibility:
def __init__(self):
self.exceptions = []
self.default_visibility = False
self.view_setup_hints = None
class Color:
def __init__(self):
self.color = None
self.components = []
class Components:
def __init__(self):
self.selection = []
self.visibility = None
self.coloring = []
class Point:
def __init__(self):
self.x = 0
self.y = 0
self.z = 0
class Direction(Point):
pass
class OrthogonalCamera:
def __init__(self):
self.camera_view_point = Point()
self.camera_direction = Direction()
self.camera_up_vector = Direction()
self.view_to_world_scale = 1.0
self.aspect_ratio = 1.0
class PerspectiveCamera:
def __init__(self):
self.camera_view_point = Point()
self.camera_direction = Direction()
self.camera_up_vector = Direction()
self.field_of_view = 60.0
self.aspect_ratio = 1.0
class Line:
def __init__(self):
self.start_point = Point()
self.end_point = Point()
class ClippingPlane:
def __init__(self):
self.location = Point()
self.direction = Direction()
class Bitmap:
def __init__(self):
self.reference = "" # Only in BCF-XML
self.bitmap_data = None # Only in BCF-API
self.bitmap_format = "PNG" # Enum of png or jpg
self.location = Point()
self.normal = Direction()
self.up = Direction()
self.height = 1.0
class Viewpoint:
def __init__(self):
self.guid = None
self.viewpoint = None
self.snapshot = None
self.index = None
self.components = None # It's not a list, despite the plural name
self.orthogonal_camera = None
self.perspective_camera = None
self.lines = []
self.clipping_planes = []
self.bitmaps = []
+31
View File
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:include schemaLocation="shared-types.xsd"/>
<xs:element name="DocumentInfo">
<xs:complexType>
<xs:sequence>
<xs:element name="Documents" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="Document" type="Document" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="Document">
<xs:sequence>
<!-- Filename of the document with the file extension. Not used to store the file in the BCF -->
<xs:element name="Filename" type="NonEmptyOrBlankString"/>
<!-- Human readable description of the document -->
<xs:element name="Description" type="NonEmptyOrBlankString" minOccurs="0"/>
</xs:sequence>
<xs:attributeGroup ref="DocumentAttributes"/>
</xs:complexType>
<xs:attributeGroup name="DocumentAttributes">
<!-- Guid of the document. Must match the filename in the BCF -->
<xs:attribute name="Guid" type="Guid" use="required"/>
</xs:attributeGroup>
</xs:schema>
+60
View File
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:include schemaLocation="shared-types.xsd"/>
<xs:element name="Extensions">
<xs:complexType>
<xs:sequence>
<xs:element name="TopicTypes" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="TopicType" type="NonEmptyOrBlankString" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TopicStatuses" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="TopicStatus" type="NonEmptyOrBlankString" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Priorities" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="Priority" type="NonEmptyOrBlankString" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TopicLabels" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="TopicLabel" type="NonEmptyOrBlankString" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Users" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="User" type="NonEmptyOrBlankString" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SnippetTypes" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="SnippetType" type="NonEmptyOrBlankString" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Stages" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="Stage" type="NonEmptyOrBlankString" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
+174
View File
@@ -0,0 +1,174 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:include schemaLocation="shared-types.xsd"/>
<xs:element name="Markup">
<xs:complexType>
<xs:sequence>
<xs:element name="Header" type="Header" minOccurs="0"/>
<xs:element name="Topic" type="Topic"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="Header">
<xs:sequence>
<xs:element name="Files" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="File" type="File" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<!-- ISG Jira issue BCF-9. Add support for several viewpoints and snapshots per issue -->
<xs:complexType name="ViewPoint">
<xs:sequence>
<!-- viewpoint file (xml) -->
<xs:element name="Viewpoint" type="NonEmptyOrBlankString" minOccurs="0"/>
<!-- the snapshot png -->
<xs:element name="Snapshot" type="NonEmptyOrBlankString" minOccurs="0"/>
<!-- the viewpoint index (sort order) -->
<xs:element name="Index" type="xs:int" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="Guid" type="Guid" use="required"/>
<!-- Guid of the viewpoint -->
</xs:complexType>
<!-- BimSnippet -->
<xs:complexType name="BimSnippet">
<xs:sequence>
<!--
Name of the file in the topic folder containing the snippet or a URL.
E.G.- Expresscode containing p.e Issue, Request
// Maybe some header infos ?? // IfcEntites // Geometry
-->
<!-- Reference (name) to the snippet file -->
<xs:element name="Reference" type="NonEmptyOrBlankString"/>
<xs:element name="ReferenceSchema" type="NonEmptyOrBlankString"/>
</xs:sequence>
<xs:attribute name="SnippetType" type="NonEmptyOrBlankString" use="required"/>
<xs:attribute name="IsExternal" type="xs:boolean" default="false"/>
<!-- This flag is true when the reference is a URL pointing outside of the BCF file-->
</xs:complexType>
<xs:complexType name="Topic">
<xs:sequence>
<xs:element name="ReferenceLinks" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="ReferenceLink" type="NonEmptyOrBlankString" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Title" type="NonEmptyOrBlankString"/>
<xs:element name="Priority" type="NonEmptyOrBlankString" minOccurs="0"/>
<!-- ISG Jira issue BCF-8 Add a way save order the topics -->
<!-- This property is deprecated and will be removed in a future release -->
<xs:element name="Index" type="xs:int" minOccurs="0"/>
<xs:element name="Labels" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="Label" type="NonEmptyOrBlankString" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="CreationDate" type="xs:dateTime"/>
<xs:element name="CreationAuthor" type="NonEmptyOrBlankString"/>
<xs:element name="ModifiedDate" type="xs:dateTime" minOccurs="0"/>
<xs:element name="ModifiedAuthor" type="NonEmptyOrBlankString" minOccurs="0"/>
<xs:element name="DueDate" type="xs:dateTime" minOccurs="0"/>
<xs:element name="AssignedTo" type="NonEmptyOrBlankString" minOccurs="0"/>
<xs:element name="Stage" type="NonEmptyOrBlankString" minOccurs="0"/>
<xs:element name="Description" type="NonEmptyOrBlankString" minOccurs="0"/>
<xs:element name="BimSnippet" type="BimSnippet" minOccurs="0"/>
<xs:element name="DocumentReferences" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="DocumentReference" type="DocumentReference" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="RelatedTopics" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="RelatedTopic" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="Guid" type="Guid" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Comments" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="Comment" type="Comment" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- ISG Jira issue BCF-9. Add support for several viewpoints and snapshots per issue -->
<xs:element name="Viewpoints" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="ViewPoint" type="ViewPoint" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="Guid" type="Guid" use="required"/>
<xs:attribute name="ServerAssignedId" type="NonEmptyOrBlankString" use="optional"/>
<xs:attribute name="TopicType" type="NonEmptyOrBlankString" use="required"/>
<xs:attribute name="TopicStatus" type="NonEmptyOrBlankString" use="required"/>
</xs:complexType>
<xs:complexType name="File">
<xs:sequence>
<xs:element name="Filename" type="NonEmptyOrBlankString" minOccurs="0"/>
<xs:element name="Date" type="xs:dateTime" minOccurs="0"/>
<!-- Reference (URL) of the file -->
<xs:element name="Reference" type="NonEmptyOrBlankString" minOccurs="0"/>
</xs:sequence>
<xs:attributeGroup ref="FileAttributes"/>
</xs:complexType>
<xs:attributeGroup name="FileAttributes">
<xs:attribute name="IfcProject" type="IfcGuid" use="optional"/>
<xs:attribute name="IfcSpatialStructureElement" type="IfcGuid" use="optional"/>
<xs:attribute name="IsExternal" type="xs:boolean" default="true"/>
</xs:attributeGroup>
<!-- Reference to a document inside of the topic folder or a url pointing to the web -->
<xs:complexType name="DocumentReference">
<xs:sequence>
<xs:choice>
<!-- Guid of the document: If pointing to an internal document -->
<xs:element name="DocumentGuid" type="Guid" minOccurs="0"/>
<!-- Url of the reference. If pointing to an external document -->
<xs:element name="Url" type="NonEmptyOrBlankString" minOccurs="0"/>
</xs:choice>
<!-- Human readable description of the document reference -->
<xs:element name="Description" type="NonEmptyOrBlankString" minOccurs="0"/>
</xs:sequence>
<xs:attributeGroup ref="DocumentReferenceAttributes"/>
</xs:complexType>
<xs:attributeGroup name="DocumentReferenceAttributes">
<!-- Guid of the document reference -->
<xs:attribute name="Guid" type="Guid" use="required"/>
</xs:attributeGroup>
<xs:complexType name="Comment">
<xs:sequence>
<xs:element name="Date" type="xs:dateTime"/>
<xs:element name="Author" type="NonEmptyOrBlankString"/>
<xs:element name="Comment" minOccurs="0" type="NonEmptyOrBlankString"/>
<xs:element name="Viewpoint" minOccurs="0">
<xs:complexType>
<xs:attribute name="Guid" type="Guid" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="ModifiedDate" type="xs:dateTime" minOccurs="0"/>
<xs:element name="ModifiedAuthor" type="NonEmptyOrBlankString" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="Guid" type="Guid" use="required"/>
</xs:complexType>
<xs:simpleType name="IfcGuid">
<xs:restriction base="xs:string">
<xs:length value="22"/>
<xs:pattern value="[0-9A-Za-z_$]*"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
+17
View File
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:include schemaLocation="shared-types.xsd"/>
<xs:element name="ProjectInfo">
<xs:complexType>
<xs:sequence>
<xs:element name="Project" type="Project"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="Project">
<xs:sequence>
<xs:element name="Name" type="NonEmptyOrBlankString" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="ProjectId" type="NonEmptyOrBlankString" use="required"/>
</xs:complexType>
</xs:schema>
+14
View File
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:simpleType name="Guid">
<xs:restriction base="xs:string">
<xs:pattern value="[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="NonEmptyOrBlankString">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:whiteSpace value="collapse"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Version">
<xs:complexType>
<xs:attribute name="VersionId" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
</xs:schema>
+220
View File
@@ -0,0 +1,220 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:include schemaLocation="shared-types.xsd"/>
<xs:element name="VisualizationInfo">
<xs:annotation>
<xs:documentation>VisualizationInfo documentation</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<!--
Although plural, 'Components' is not a collection
-->
<xs:element name="Components" type="Components" minOccurs="0"/>
<xs:choice>
<xs:element name="OrthogonalCamera" type="OrthogonalCamera"/>
<xs:element name="PerspectiveCamera" type="PerspectiveCamera"/>
</xs:choice>
<xs:element name="Lines" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="Line" type="Line" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ClippingPlanes" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="ClippingPlane" type="ClippingPlane" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Bitmaps" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="Bitmap" type="Bitmap" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<!-- Guid of the viewpoint -->
<xs:attribute name="Guid" type="Guid" use="required"/>
</xs:complexType>
</xs:element>
<xs:complexType name="OrthogonalCamera">
<xs:sequence>
<xs:element name="CameraViewPoint" type="Point"/>
<xs:element name="CameraDirection" type="Direction"/>
<xs:element name="CameraUpVector" type="Direction"/>
<xs:element name="ViewToWorldScale" type="xs:double">
<xs:annotation>
<xs:documentation>view's visible vertical size in meters</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="AspectRatio" type="PositiveDouble">
<xs:annotation>
<xs:documentation>
Proportional relationship between the width and the height of the view (w/h).
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="PerspectiveCamera">
<xs:sequence>
<xs:element name="CameraViewPoint" type="Point"/>
<xs:element name="CameraDirection" type="Direction"/>
<xs:element name="CameraUpVector" type="Direction"/>
<xs:element name="FieldOfView" type="FieldOfView">
<xs:annotation>
<xs:documentation>
Vertical field of view, in degrees.
It is currently limited to a value between 45 and 60 degrees.
This limitation will be dropped in the next release and viewers
should be expect values outside this range in current implementations.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="AspectRatio" type="PositiveDouble">
<xs:annotation>
<xs:documentation>
Proportional relationship between the width and the height of the view (w/h).
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Point">
<xs:sequence>
<xs:element name="X" type="xs:double"/>
<xs:element name="Y" type="xs:double"/>
<xs:element name="Z" type="xs:double"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Direction">
<xs:sequence>
<xs:element name="X" type="xs:double"/>
<xs:element name="Y" type="xs:double"/>
<xs:element name="Z" type="xs:double"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="PositiveDouble">
<xs:restriction base="xs:double">
<xs:minExclusive value="0"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="FieldOfView">
<xs:restriction base="xs:double">
<xs:minExclusive value="0"/>
<xs:maxExclusive value="180"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="Components">
<xs:sequence>
<!-- Components with relevance to the viewpoint. They should be displayed highlighted or selected in a viewer -->
<xs:element name="Selection" type="ComponentSelection" minOccurs="0"/>
<xs:element name="Visibility" type="ComponentVisibility" minOccurs="0"/>
<xs:element name="Coloring" type="ComponentColoring" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ComponentSelection">
<xs:sequence>
<xs:element name="Component" type="Component" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ComponentVisibility">
<xs:sequence>
<xs:element name="ViewSetupHints" type="ViewSetupHints" minOccurs="0"/>
<xs:element name="Exceptions" minOccurs="0">
<!-- List Components that are different than the DefaultVisibility. E.g. if DefaultVisibility = false then list
Components that should be visible -->
<xs:complexType>
<xs:sequence>
<xs:element name="Component" type="Component" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="DefaultVisibility" type="xs:boolean" default="false"/>
</xs:complexType>
<xs:complexType name="ViewSetupHints">
<xs:attribute name="SpacesVisible" type="xs:boolean" default="false"/>
<xs:attribute name="SpaceBoundariesVisible" type="xs:boolean" default="false"/>
<xs:attribute name="OpeningsVisible" type="xs:boolean" default="false"/>
</xs:complexType>
<xs:complexType name="ComponentColoring">
<xs:sequence>
<xs:element name="Color" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<!-- At least one component is required for a Color. -->
<xs:element name="Components">
<xs:complexType>
<xs:sequence>
<xs:element name="Component" type="Component" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute ref="Color" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Component">
<xs:sequence>
<xs:element name="OriginatingSystem" type="NonEmptyOrBlankString" minOccurs="0"/>
<xs:element name="AuthoringToolId" type="NonEmptyOrBlankString" minOccurs="0"/>
</xs:sequence>
<xs:attribute ref="IfcGuid"/>
</xs:complexType>
<xs:attribute name="Color">
<xs:simpleType>
<xs:restriction base="xs:normalizedString">
<!-- Should either match 3 or 4 hex bytes , e.g. "FF00FF" or "FF00FF99" -->
<xs:pattern value="[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="IfcGuid">
<xs:simpleType>
<xs:restriction base="xs:normalizedString">
<xs:length value="22"/>
<xs:pattern value="[0-9A-Za-z_$]*"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:complexType name="Line">
<xs:sequence>
<xs:element name="StartPoint" type="Point"/>
<xs:element name="EndPoint" type="Point"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ClippingPlane">
<xs:sequence>
<xs:element name="Location" type="Point"/>
<xs:element name="Direction" type="Direction"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Bitmap">
<xs:sequence>
<xs:element name="Format" type="BitmapFormat"/>
<!-- Name of the bitmap file in the topic folder -->
<xs:element name="Reference" type="NonEmptyOrBlankString"/>
<!-- Location of the center of the bitmap -->
<xs:element name="Location" type="Point"/>
<!-- Normal of the bitmap -->
<xs:element name="Normal" type="Direction"/>
<!-- Upvector of the bitmap -->
<xs:element name="Up" type="Direction"/>
<!-- Height of the bitmap -->
<xs:element name="Height" type="xs:double"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="BitmapFormat">
<xs:restriction base="xs:string">
<xs:enumeration value="png"/>
<xs:enumeration value="jpg"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
+621
View File
@@ -0,0 +1,621 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
+535
View File
@@ -0,0 +1,535 @@
# BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BlenderBIM Add-on 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
VERSION:=`date '+%y%m%d'`
PYVERSION:=py37
ifeq ($(PYVERSION), py37)
PYLIBDIR:=python3.7
PYNUMBER:=37
endif
ifeq ($(PYVERSION), py39)
PYLIBDIR:=python3.9
PYNUMBER:=39
endif
ifeq ($(PLATFORM), linux)
ifeq ($(PYVERSION), py37)
HPPFCL_URL:=https://anaconda.org/conda-forge/hpp-fcl/1.7.5/download/linux-64/hpp-fcl-1.7.5-py37h5f1835d_0.tar.bz2
EIGENPY_URL:=https://anaconda.org/conda-forge/eigenpy/2.6.5/download/linux-64/eigenpy-2.6.5-py37h95e2c48_0.tar.bz2
BOOST_URL:=https://anaconda.org/conda-forge/boost/1.74.0/download/linux-64/boost-1.74.0-py37h0379df6_3.tar.bz2
LXML_URL:=https://files.pythonhosted.org/packages/30/c0/d0526314971fc661b083ab135747dc68446a3022686da8c16d25fcf6ef07/lxml-4.6.3-cp37-cp37m-manylinux2014_x86_64.whl
endif
ifeq ($(PYVERSION), py39)
HPPFCL_URL:=https://anaconda.org/conda-forge/hpp-fcl/1.7.5/download/linux-64/hpp-fcl-1.7.5-py39hbcdfc36_0.tar.bz2
EIGENPY_URL:=https://anaconda.org/conda-forge/eigenpy/2.6.5/download/linux-64/eigenpy-2.6.5-py39h5aed9d1_0.tar.bz2
BOOST_URL:=https://anaconda.org/conda-forge/boost/1.74.0/download/linux-64/boost-1.74.0-py39h5472131_3.tar.bz2
LXML_URL:=https://files.pythonhosted.org/packages/19/d9/a69c6aff5673554df48120565a14a50eaa41d29ae03b02faa0b023666318/lxml-4.6.3-cp39-cp39-manylinux2014_x86_64.whl
endif
ASSIMP_URL:=https://anaconda.org/conda-forge/assimp/5.0.1/download/linux-64/assimp-5.0.1-hedfc422_6.tar.bz2
OCTOMAP_URL:=https://anaconda.org/conda-forge/octomap/1.9.7/download/linux-64/octomap-1.9.7-h4bd325d_0.tar.bz2
ZLIB_URL:=https://anaconda.org/conda-forge/zlib/1.2.11/download/linux-64/zlib-1.2.11-h516909a_1010.tar.bz2
endif
ifeq ($(PLATFORM), macos)
ifeq ($(PYVERSION), py37)
HPPFCL_URL:=https://anaconda.org/conda-forge/hpp-fcl/1.7.5/download/osx-64/hpp-fcl-1.7.5-py37h2d7f23a_0.tar.bz2
EIGENPY_URL:=https://anaconda.org/conda-forge/eigenpy/2.6.5/download/osx-64/eigenpy-2.6.5-py37h0695097_0.tar.bz2
BOOST_URL:=https://anaconda.org/conda-forge/boost/1.74.0/download/osx-64/boost-1.74.0-py37hd79e0ac_3.tar.bz2
LXML_URL:=https://files.pythonhosted.org/packages/1e/3e/f0abc15d5dac50939bccc589aae336d5ead4c72e7ad1039a2e0f3630ea92/lxml-4.6.3-cp37-cp37m-macosx_10_9_x86_64.whl
endif
ifeq ($(PYVERSION), py39)
HPPFCL_URL:=https://anaconda.org/conda-forge/hpp-fcl/1.7.5/download/osx-64/hpp-fcl-1.7.5-py39h1e32b98_0.tar.bz2
EIGENPY_URL:=https://anaconda.org/conda-forge/eigenpy/2.6.5/download/osx-64/eigenpy-2.6.5-py39h5405915_0.tar.bz2
BOOST_URL:=https://anaconda.org/conda-forge/boost/1.74.0/download/osx-64/boost-1.74.0-py39ha641261_3.tar.bz2
LXML_URL:=https://files.pythonhosted.org/packages/b8/74/a71f7ad72e8db54ce899efab84507b801660750cbbfa6a39e6717557d36a/lxml-4.6.3-cp39-cp39-macosx_10_9_x86_64.whl
endif
ASSIMP_URL:=https://anaconda.org/conda-forge/assimp/5.0.1/download/osx-64/assimp-5.0.1-h1224e73_6.tar.bz2
OCTOMAP_URL:=https://anaconda.org/conda-forge/octomap/1.9.7/download/osx-64/octomap-1.9.7-h940c156_0.tar.bz2
ZLIB_URL:=https://anaconda.org/conda-forge/zlib/1.2.11/download/osx-64/zlib-1.2.11-h7795811_1010.tar.bz2
endif
ifeq ($(PLATFORM), win)
ifeq ($(PYVERSION), py37)
HPPFCL_URL:=https://anaconda.org/conda-forge/hpp-fcl/1.7.5/download/win-64/hpp-fcl-1.7.5-py37h839d6b1_0.tar.bz2
EIGENPY_URL:=https://anaconda.org/conda-forge/eigenpy/2.6.5/download/win-64/eigenpy-2.6.5-py37h2c32e34_0.tar.bz2
BOOST_URL:=https://anaconda.org/conda-forge/boost/1.74.0/download/win-64/boost-1.74.0-py37h3b38789_3.tar.bz2
LXML_URL:=https://files.pythonhosted.org/packages/9e/5e/171ee9d40a600f565fe691ec5bf7596247ec62cfb2edc00c91afe8ea837b/lxml-4.6.3-cp37-cp37m-win_amd64.whl
endif
ifeq ($(PYVERSION), py39)
HPPFCL_URL:=https://anaconda.org/conda-forge/hpp-fcl/1.7.5/download/win-64/hpp-fcl-1.7.5-py39h2e7c763_0.tar.bz2
EIGENPY_URL:=https://anaconda.org/conda-forge/eigenpy/2.6.5/download/win-64/eigenpy-2.6.5-py39h3ce40e6_0.tar.bz2
BOOST_URL:=https://anaconda.org/conda-forge/boost/1.74.0/download/win-64/boost-1.74.0-py39hefe7e4c_3.tar.bz2
LXML_URL:=https://files.pythonhosted.org/packages/72/d4/426ecb8849c47c3e370c87aa0ac05d85768df917ffea27fcd6686a5e6495/lxml-4.6.3-cp39-cp39-win_amd64.whl
endif
ASSIMP_URL:=https://anaconda.org/conda-forge/assimp/5.0.1/download/win-64/assimp-5.0.1-hc2aa0de_6.tar.bz2
OCTOMAP_URL:=https://anaconda.org/conda-forge/octomap/1.9.7/download/win-64/octomap-1.9.7-h5362a0b_0.tar.bz2
ZLIB_URL:=https://anaconda.org/conda-forge/zlib/1.2.11/download/win-64/zlib-1.2.11-h62dcd97_1010.tar.bz2
endif
.PHONY: 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/
# Provides IfcOpenShell Python functionality
cd dist/working && wget https://s3.amazonaws.com/ifcopenshell-builds/ifcblender-python-$(PYNUMBER)-v0.7.0-b9ea741-$(PLATFORM)64.zip
cd dist/working && unzip ifcblender*
cp -r dist/working/io_import_scene_ifc/ifcopenshell dist/blenderbim/libs/site/packages/
# See bug #812
cd dist/working && wget https://raw.githubusercontent.com/IfcOpenShell/IfcOpenShell/v0.7.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/v0.7.0.zip
cd dist/working && unzip v0.7.0.zip
# IfcOpenBot sometimes lags behind, so we hotfix the Python utilities
cp -r dist/working/IfcOpenShell-0.7.0/src/ifcopenshell-python/ifcopenshell/util/* dist/blenderbim/libs/site/packages/ifcopenshell/util/
cp -r dist/working/IfcOpenShell-0.7.0/src/ifcopenshell-python/ifcopenshell/api/* dist/blenderbim/libs/site/packages/ifcopenshell/api/
cp dist/working/IfcOpenShell-0.7.0/src/ifcopenshell-python/ifcopenshell/entity_instance.py dist/blenderbim/libs/site/packages/ifcopenshell/
cp dist/working/IfcOpenShell-0.7.0/src/ifcopenshell-python/ifcopenshell/file.py dist/blenderbim/libs/site/packages/ifcopenshell/
# Provides bcf functionality
cp -r dist/working/IfcOpenShell-0.7.0/src/bcf/src/bcf dist/blenderbim/libs/site/packages/
# Provides IFCClash functionality
cp -r dist/working/IfcOpenShell-0.7.0/src/ifcclash/ifcclash dist/blenderbim/libs/site/packages/
# Provides BIMTester functionality
cd dist/working && python -m venv env
cd dist/working && . env/bin/activate && pip install pybabel
cd dist/working && . env/bin/activate && pip install babel
cd dist/working && . env/bin/activate && ./env/bin/pybabel compile -d ./IfcOpenShell-0.7.0/src/ifcbimtester/bimtester/locale/
cp -r dist/working/IfcOpenShell-0.7.0/src/ifcbimtester/bimtester dist/blenderbim/libs/site/packages/
# Provides IFCCOBie functionality
cp -r dist/working/IfcOpenShell-0.7.0/src/ifccobie/* dist/blenderbim/libs/site/packages/
# Provides IFCDiff functionality
cp -r dist/working/IfcOpenShell-0.7.0/src/ifcdiff/* dist/blenderbim/libs/site/packages/
# Provides IFCCSV functionality
cp -r dist/working/IfcOpenShell-0.7.0/src/ifccsv/* dist/blenderbim/libs/site/packages/
# Provides IFCPatch functionality
cp -r dist/working/IfcOpenShell-0.7.0/src/ifcpatch/ifcpatch dist/blenderbim/libs/site/packages/
# Provides IFC4D functionality
cp -r dist/working/IfcOpenShell-0.7.0/src/ifc4d/ifc4d dist/blenderbim/libs/site/packages/
# Provides IFC5D functionality
cp -r dist/working/IfcOpenShell-0.7.0/src/ifc5d/ifc5d dist/blenderbim/libs/site/packages/
# Provides IFCCityJSON functionality
cp -r dist/working/IfcOpenShell-0.7.0/src/ifccityjson dist/blenderbim/libs/site/packages/
rm -rf dist/working
# Provides Mustache templating in construction documentation
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/d6/fd/eb8c212053addd941cc90baac307c00ac246ac3fce7166b86434c6eae963/pystache-0.5.4.tar.gz
cd dist/working && tar -xzvf pystache*
cd dist/working/pystache-0.5.4/ && python setup.py build && cp -r build/lib/pystache ../../blenderbim/libs/site/packages/
rm -rf dist/working
# Provides SVG export in construction documentation
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/79/e8/7eb2ba188eda14a4b47e33b51f3b4978985f4116655c699bcd18c79279b5/svgwrite-1.3.1.zip
cd dist/working && unzip svgwrite*
cp -r dist/working/svgwrite-1.3.1/svgwrite dist/blenderbim/libs/site/packages/
rm -rf dist/working
# Provides fuzzy date parsing for construction sequencing
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/be/ed/5bbc91f03fa4c839c4c7360375da77f9659af5f7086b7a7bdda65771c8e0/python-dateutil-2.8.1.tar.gz
cd dist/working && tar -xzvf python-dateutil*
cp -r dist/working/python-dateutil-2.8.1/dateutil dist/blenderbim/libs/site/packages/
rm -rf dist/working
# Provides duration parsing for construction sequencing
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/b1/80/fb8c13a4cd38eb5021dc3741a9e588e4d1de88d895c1910c6fc8a08b7a70/isodate-0.6.0.tar.gz
cd dist/working && tar -xzvf isodate*
cp -r dist/working/isodate-0.6.0/src/isodate dist/blenderbim/libs/site/packages/
rm -rf dist/working
# Provides networkx graph analysis for project dependency calculations
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/b0/21/adfbf6168631e28577e4af9eb9f26d75fe72b2bb1d33762a5f2c425e6c2a/networkx-2.5.1.tar.gz
cd dist/working && tar -xzvf networkx*
cp -r dist/working/networkx-2.5.1/networkx dist/blenderbim/libs/site/packages/
rm -rf dist/working
# Required by networkx
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/4f/51/15a4f6b8154d292e130e5e566c730d8ec6c9802563d58760666f1818ba58/decorator-5.0.9.tar.gz
cd dist/working && tar -xzvf decorator*
cp -r dist/working/decorator-5.0.9/src/decorator.py dist/blenderbim/libs/site/packages/
rm -rf dist/working
# Provides jsgantt-improved supports for web-based construction sequencing gantt charts
mkdir dist/working
cd dist/working && wget https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.js
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
# Required by IFCDiff
mkdir dist/working
cd dist/working && wget https://github.com/Moult/deepdiff/archive/master.zip
cd dist/working && unzip master.zip
cp -r dist/working/deepdiff-master/deepdiff dist/blenderbim/libs/site/packages/
rm -rf dist/working
# Required by deepdiff
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/00/55/ce2cbc6d64034b30cad81a29ba61bdba456f190f5e83c09831304bf68d6b/jsonpickle-1.2.tar.gz
cd dist/working && tar -xzvf jsonpickle*
cp -r dist/working/jsonpickle-1.2/jsonpickle dist/blenderbim/libs/site/packages/
rm -rf dist/working
# Required by deepdiff
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/a3/b7/d4d69641cbe707a45c23b190f2d717466ba5accc4c70b5f7a8a450387895/ordered-set-3.1.1.tar.gz
cd dist/working && tar -xzvf ordered-set*
cp -r dist/working/ordered-set-3.1.1/ordered_set.py dist/blenderbim/libs/site/packages/
rm -rf dist/working
# Required by lark
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/00/32/8076fa13e832bb4dcff379f18f228e5a53412be0631808b9ca2610c0f566/pyparsing-2.4.5.tar.gz
cd dist/working && tar -xzvf pyparsing*
cp -r dist/working/pyparsing-2.4.5/pyparsing.py dist/blenderbim/libs/site/packages/
rm -rf dist/working
# Required by bcf
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/bb/41/ad9ce53bb978b68af8ae415293cafc89b165b8ad55a593725299dca76729/xmlschema-1.1.1.tar.gz
cd dist/working && tar -xzvf xmlschema*
cp -r dist/working/xmlschema-1.1.1/xmlschema dist/blenderbim/libs/site/packages/
rm -rf dist/working
# Required by bcf
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/12/f9/f9960222d5274944b01391749e55e4dcdf28d8f0c108b64ac931ceff6fdb/elementpath-1.4.3.tar.gz
cd dist/working && tar -xzvf elementpath*
cp -r dist/working/elementpath-1.4.3/elementpath dist/blenderbim/libs/site/packages/
rm -rf dist/working
# Required by bcf
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/21/9f/b251f7f8a76dec1d6651be194dfba8fb8d7781d10ab3987190de8391d08e/six-1.14.0.tar.gz
cd dist/working && tar -xzvf six*
cp -r dist/working/six-1.14.0/six.py dist/blenderbim/libs/site/packages/
rm -rf dist/working
# Required by IFCCSV and ifcopenshell.util.selector
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/18/4d/8d522136c37d9e1ea74062b41b8d5e1318ebf45063ae46ce72ed60af223b/lark-parser-0.8.5.tar.gz
cd dist/working && tar -xzvf lark-parser*
cp -r dist/working/lark-parser-0.8.5/lark dist/blenderbim/libs/site/packages/
rm -rf dist/working
# Required by IFC4D
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/b0/bb/9c4dddd3ca173cb56241cfb2eddfae24690dc676d357ac4cab17d0a36d9d/PyP6Xer-1.13.0.tar.gz
cd dist/working && tar -xzvf PyP6Xer*
cp -r dist/working/PyP6Xer-1.13.0/xerparser dist/blenderbim/libs/site/packages/
rm -rf dist/working
# Required by xerparser and IFC4D
# TODO: remove this dependency. It's only used to show a progress bar.
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/9f/7b/76c4e5ef1a1b528fcaada4133f972e77d33c252831676cf414119ca6093d/tqdm-4.50.0.tar.gz
cd dist/working && tar -xzvf tqdm*
cp -r dist/working/tqdm-4.50.0/tqdm dist/blenderbim/libs/site/packages/
rm -rf dist/working
# Required by IFCCityJSON
mkdir dist/working
cd dist/working && python -m venv env
cd dist/working && mkdir site-packages
cd dist/working && . env/bin/activate && pip install cjio --target=./site-packages
cd dist/working/site-packages/ && rm -r *dist-info*
cp -r dist/working/site-packages/* dist/blenderbim/libs/site/packages/
rm -rf dist/working
# Required by IFCClash
mkdir dist/working
cd dist/working && wget $(HPPFCL_URL)
cd dist/working && tar -xf hpp-fcl*
ifeq ($(PLATFORM), linux)
cp -r dist/working/lib/$(PYLIBDIR)/site-packages/hppfcl dist/blenderbim/libs/site/packages/
cp -r dist/working/lib/*.so* dist/blenderbim/libs/
endif
ifeq ($(PLATFORM), macos)
cp -r dist/working/lib/$(PYLIBDIR)/site-packages/hppfcl dist/blenderbim/libs/site/packages/
cp -r dist/working/lib/*.dylib dist/blenderbim/libs/
endif
ifeq ($(PLATFORM), win)
cp -r dist/working/Lib/site-packages/hppfcl dist/blenderbim/libs/site/packages/
cp -r dist/working/Library/bin/*.dll dist/blenderbim/libs/site/packages/hppfcl/
endif
rm -rf dist/working
# Required by hpp-fcl
mkdir dist/working
cd dist/working && wget $(ASSIMP_URL)
cd dist/working && tar -xf assimp*
ifeq ($(PLATFORM), linux)
cp -r dist/working/lib/*.so* dist/blenderbim/libs/
endif
ifeq ($(PLATFORM), macos)
cp -r dist/working/lib/*.dylib dist/blenderbim/libs/
endif
ifeq ($(PLATFORM), win)
cp -r dist/working/Library/bin/*.dll dist/blenderbim/libs/site/packages/hppfcl/
endif
rm -rf dist/working
# Required by hpp-fcl
mkdir dist/working
cd dist/working && wget $(EIGENPY_URL)
cd dist/working && tar -xf eigenpy*
ifeq ($(PLATFORM), linux)
cp -r dist/working/lib/*.so* dist/blenderbim/libs/
endif
ifeq ($(PLATFORM), macos)
cp -r dist/working/lib/*.dylib dist/blenderbim/libs/
endif
ifeq ($(PLATFORM), win)
cp -r dist/working/Library/bin/*.dll dist/blenderbim/libs/site/packages/hppfcl/
endif
rm -rf dist/working
# Required by hpp-fcl
mkdir dist/working
cd dist/working && wget $(OCTOMAP_URL)
cd dist/working && tar -xf octomap*
ifeq ($(PLATFORM), linux)
cp -r dist/working/lib/*.so* dist/blenderbim/libs/
endif
ifeq ($(PLATFORM), macos)
cp -r dist/working/lib/*.dylib dist/blenderbim/libs/
endif
ifeq ($(PLATFORM), win)
# Uh, do nothing, apparently? No DLLs are shipped.
endif
rm -rf dist/working
# Required by hpp-fcl
mkdir dist/working
cd dist/working && wget $(BOOST_URL)
cd dist/working && tar -xf boost*
ifeq ($(PLATFORM), linux)
cp -r dist/working/lib/*.so* dist/blenderbim/libs/
endif
ifeq ($(PLATFORM), macos)
cp -r dist/working/lib/*.dylib dist/blenderbim/libs/
endif
ifeq ($(PLATFORM), win)
cp -r dist/working/Library/bin/*.dll dist/blenderbim/libs/site/packages/hppfcl/
endif
rm -rf dist/working
# Required by hpp-fcl
mkdir dist/working
cd dist/working && wget $(ZLIB_URL)
cd dist/working && tar -xf zlib*
ifeq ($(PLATFORM), linux)
cp -r dist/working/lib/*.so* dist/blenderbim/libs/
endif
ifeq ($(PLATFORM), macos)
cp -r dist/working/lib/*.dylib dist/blenderbim/libs/
endif
ifeq ($(PLATFORM), win)
cp -r dist/working/Library/bin/*.dll dist/blenderbim/libs/site/packages/hppfcl/
endif
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.7.0/src/ifcbimtester/patch/model_core.patch
cd dist/working/ && wget https://raw.githubusercontent.com/IfcOpenShell/IfcOpenShell/v0.7.0/src/ifcbimtester/patch/runner_util.patch
cd dist/working/ && patch ../blenderbim/libs/site/packages/behave/model_core.py < model_core.patch
cd dist/working/ && patch ../blenderbim/libs/site/packages/behave/runner_util.py < runner_util.patch
rm -rf dist/working
# Required by ids - uh, not any more, but I'm trying it out in the drawing module
mkdir dist/working
cd dist/working && wget $(LXML_URL)
cd dist/working && cp *.whl lxml.zip && unzip lxml.zip
cp -r dist/working/lxml dist/blenderbim/libs/site/packages/
rm -rf dist/working
# 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
# Required by IFCCOBie for XLSX support
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/0c/bc/82d6783f83f65f56d8b77d052773c4a2f952fa86385f0cd54e1e006658d7/XlsxWriter-1.2.9.tar.gz
cd dist/working && tar -xzvf XlsxWriter*
cd dist/working/XlsxWriter-1.2.9/ && cp -r xlsxwriter ../../blenderbim/libs/site/packages/
rm -rf dist/working
# Required by IFCCOBie for ODS support
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/97/73/8ade73f6749177003f7ce3304f524774adda96e6aaab30ea79fd8fda7934/odfpy-1.4.1.tar.gz
cd dist/working && tar -xzvf odfpy*
cd dist/working/odfpy-1.4.1/ && cp -r odf ../../blenderbim/libs/site/packages/
rm -rf dist/working
# Required by odfpy
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/a4/5f/f8aa58ca0cf01cbcee728abc9d88bfeb74e95e6cb4334cfd5bed5673ea77/defusedxml-0.6.0.tar.gz
cd dist/working && tar -xzvf defusedxml*
cd dist/working/defusedxml-0.6.0/ && cp -r defusedxml ../../blenderbim/libs/site/packages/
rm -rf dist/working
# Required by augin
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/76/b4/b7baffbda025efd5dc8fcd8d2e953e3aa939c236a484084fa8f4c3588ee9/boto3-1.17.17.tar.gz
cd dist/working && tar -xzvf boto3*
cd dist/working/boto3-1.17.17/ && cp -r boto3 ../../blenderbim/libs/site/packages/
rm -rf dist/working
# Required by boto3
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/7f/2e/e02fdfd0f0377c4e44e61de27b05d5cfe93575770661ef9ded80ed90fa88/botocore-1.20.17.tar.gz
cd dist/working && tar -xzvf botocore*
cd dist/working/botocore-1.20.17/ && cp -r botocore ../../blenderbim/libs/site/packages/
rm -rf dist/working
# Required by boto3
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/3c/56/3f325b1eef9791759784aa5046a8f6a1aff8f7c898a2e34506771d3b99d8/jmespath-0.10.0.tar.gz
cd dist/working && tar -xzvf jmespath*
cd dist/working/jmespath-0.10.0/ && cp -r jmespath ../../blenderbim/libs/site/packages/
rm -rf dist/working
# Required by boto3
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/08/e1/3ee2096ebaeeb8c186d20ed16c8faf4a503913e5c9a0e14cd6b8ffc405a3/s3transfer-0.3.4.tar.gz
cd dist/working && tar -xzvf s3transfer*
cd dist/working/s3transfer-0.3.4/ && cp -r s3transfer ../../blenderbim/libs/site/packages/
rm -rf dist/working
# 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
# Provides OpenLCA fucntionality
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/85/33/f91b96e9e8608ff65a003b692e8a9cdd60f2178f60617e5b1d21334c009c/olca-ipc-0.0.10.tar.gz
cd dist/working && tar -xzvf olca-ipc*
cd dist/working/olca-ipc-0.0.10/ && cp -r olca ../../blenderbim/libs/site/packages/
rm -rf dist/working
# Provides Brickschema fucntionality
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/ca/37/8309da9a72407d2f5eb5489c197ac3cfe96ee3ccba1902d2a0ecc7843f92/brickschema-0.5.1.tar.gz
cd dist/working && tar -xzvf brickschema*
# This is an evil hack because we don't want to bundle flask
echo "" > dist/working/brickschema-0.5.1/brickschema/web.py
cd dist/working/brickschema-0.5.1/ && cp -r brickschema ../../blenderbim/libs/site/packages/
# For now lets bundle the latest nightly schema
cd dist/working && wget https://github.com/BrickSchema/Brick/releases/download/nightly/Brick.ttl
cd dist/working && cp Brick.ttl ../../blenderbim/bim/schema/Brick.ttl
rm -rf dist/working
# Required by brickschema
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/c7/22/37bb938be8e5c20d443b0c9ba0a243573b671b01739efb0a19f81bc5b470/pyshacl-0.17.2.tar.gz
cd dist/working && tar -xzvf pyshacl*
cd dist/working/pyshacl-0.17.2/ && cp -r pyshacl ../../blenderbim/libs/site/packages/
rm -rf dist/working
# Required by brickschema
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/d2/a7/be8244688bfcee37c23733ab4fe8e6afa6d4403bd2674a3ae7bd2cecc77b/rdflib-6.0.2.tar.gz
cd dist/working && tar -xzvf rdflib*
cd dist/working/rdflib-6.0.2/ && cp -r rdflib ../../blenderbim/libs/site/packages/
rm -rf dist/working
# Required by brickschema
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/7d/c7/208aece36279e4f1236e437119358786e39530ecc1719d4e1afeddba5288/owlrl-6.0.2.tar.gz
cd dist/working && tar -xzvf owlrl*
cd dist/working/owlrl-6.0.2/ && cp -r owlrl ../../blenderbim/libs/site/packages/
rm -rf dist/working
cd dist/blenderbim && sed -i "s/999999/$(VERSION)/" __init__.py
cd dist && zip -r blenderbim-$(VERSION)-$(PYVERSION)-$(PLATFORM).zip ./*
rm -rf dist/blenderbim
.PHONY: test
test:
make test-core
make test-tool
make test-bim
.PHONY: test-core
test-core:
pytest -p no:pytest-blender test/core
.PHONY: test-bim
test-bim:
pytest test/bim
.PHONY: test-tool
test-tool:
pytest test/tool
.PHONY: qa
qa:
black .
pylint ./* --output-format=colorized --disable all --enable E --disable import-error
.PHONY: coverage
coverage:
coverage run --source blenderbim.core -m pytest -p no:pytest-blender test/core
coverage html
xdg-open htmlcov/index.html
.PHONY: license
license:
copyright-header --license GPL3 --copyright-holder "Dion Moult <dion@thinkmoult.com>" --copyright-year "2022" --copyright-software "BlenderBIM Add-on" --copyright-software-description "OpenBIM Blender Add-on" -a ./ -o ./
.PHONY: clean
clean:
rm -rf dist
rm -rf htmlcov
.PHONY: dev
dev:
blender -p setup_pytest.py
+5
View File
@@ -0,0 +1,5 @@
# BlenderBIM Add-on
An add-on to Blender to allow BIM functionality.
More information on the [BlenderBIM Add-on website](https://blenderbim.org).
+45
View File
@@ -0,0 +1,45 @@
# BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BlenderBIM Add-on 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
import os
import sys
import site
bl_info = {
"name": "BlenderBIM",
"description": "Author, import, and export data using the Industry Foundation Classes schema",
"author": "IfcOpenShell Contributors",
"blender": (2, 80, 0),
"version": (0, 0, 999999),
"location": "File > Export, File > Import, Scene / Object / Material / Mesh Properties",
"tracker_url": "https://github.com/IfcOpenShell/IfcOpenShell/issues",
"category": "Import-Export",
}
if sys.modules.get("bpy", None):
# 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"))
import blenderbim.bim
def register():
blenderbim.bim.register()
def unregister():
blenderbim.bim.unregister()
+158
View File
@@ -0,0 +1,158 @@
# BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BlenderBIM Add-on 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
import bpy
import importlib
from . import handler, ui, prop, operator, helper
modules = {
"project": None,
"search": None,
"bcf": None,
"root": None,
"unit": None,
"model": None,
"georeference": None,
"context": None,
"drawing": None,
"misc": None,
"attribute": None,
"type": None,
"spatial": None,
"void": None,
"aggregate": None,
"geometry": None,
"cobie": None,
"resource": None,
"cost": None,
"sequence": None,
"group": None,
"system": None,
"brick": None,
"structural": None,
"boundary": None,
"profile": None,
"material": None,
"style": None,
"layer": None,
"owner": None,
"pset": None,
"qto": None,
"classification": None,
"library": None,
"constraint": None,
"document": None,
"pset_template": None,
"clash": None,
"lca": None,
"csv": None,
"bimtester": None,
"diff": None,
"patch": None,
"gis": None,
"covetool": None,
"augin": None,
"debug": None,
}
for name in modules.keys():
modules[name] = importlib.import_module(f"blenderbim.bim.module.{name}")
classes = [
operator.OpenUri,
operator.SelectDataDir,
operator.SelectSchemaDir,
operator.SelectIfcFile,
operator.OpenUpstream,
operator.AddSectionPlane,
operator.RemoveSectionPlane,
operator.ReloadIfcFile,
operator.AddIfcFile,
operator.RemoveIfcFile,
operator.ConfigureVisibility,
prop.StrProperty,
prop.ObjProperty,
prop.Attribute,
prop.ModuleVisibility,
prop.BIMProperties,
prop.IfcParameter,
prop.PsetQto,
prop.GlobalId,
prop.BIMObjectProperties,
prop.BIMMaterialProperties,
prop.BIMMeshProperties,
ui.BIM_PT_section_plane,
ui.BIM_UL_generic,
ui.BIM_UL_topics,
ui.BIM_ADDON_preferences,
]
for mod in modules.values():
classes.extend(mod.classes)
def on_register(scene):
handler.setDefaultProperties(scene)
bpy.app.handlers.depsgraph_update_post.remove(on_register)
def register():
for cls in classes:
bpy.utils.register_class(cls)
bpy.app.handlers.depsgraph_update_post.append(on_register)
bpy.app.handlers.undo_pre.append(handler.undo_pre)
bpy.app.handlers.undo_post.append(handler.undo_post)
bpy.app.handlers.redo_pre.append(handler.redo_pre)
bpy.app.handlers.redo_post.append(handler.redo_post)
bpy.app.handlers.load_post.append(handler.setDefaultProperties)
bpy.app.handlers.load_post.append(handler.loadIfcStore)
bpy.app.handlers.save_pre.append(handler.ensureIfcExported)
bpy.types.Scene.BIMProperties = bpy.props.PointerProperty(type=prop.BIMProperties)
bpy.types.Object.BIMObjectProperties = bpy.props.PointerProperty(type=prop.BIMObjectProperties)
bpy.types.Material.BIMObjectProperties = bpy.props.PointerProperty(type=prop.BIMObjectProperties)
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)
bpy.types.PointLight.BIMMeshProperties = bpy.props.PointerProperty(type=prop.BIMMeshProperties)
bpy.types.SCENE_PT_unit.append(ui.ifc_units)
for mod in modules.values():
mod.register()
def unregister():
for cls in reversed(classes):
bpy.utils.unregister_class(cls)
bpy.app.handlers.load_post.remove(handler.setDefaultProperties)
bpy.app.handlers.load_post.remove(handler.loadIfcStore)
bpy.app.handlers.save_pre.remove(handler.ensureIfcExported)
del bpy.types.Scene.BIMProperties
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
del bpy.types.PointLight.BIMMeshProperties
bpy.types.SCENE_PT_unit.remove(ui.ifc_units)
for mod in reversed(list(modules.values())):
mod.unregister()
Binary file not shown.
@@ -0,0 +1,24 @@
<link href="jsgantt.css" rel="stylesheet" type="text/css"/>
<script src="jsgantt.js" type="text/javascript"></script>
<div style="position:relative" class="gantt" id="GanttChartDIV"></div>
<script type="text/javascript">
var g = new JSGantt.GanttChart(document.getElementById('GanttChartDIV'), 'day');
g.setOptions({
vCaptionType: 'Complete', // 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,
vTotalHeight: 1000,
});
var json_data = `
{{{json_data}}}
`;
JSGantt.parseJSONString(json_data, g);
g.Draw();
</script>
@@ -0,0 +1,12 @@
ISO-10303-21;
HEADER;
FILE_DESCRIPTION((),'2;1');
FILE_NAME('EPset_Parametric.ifc','2020-01-01T00:00:00',(),(),'EPset_Parametric','EPset_Parametric',$);
FILE_SCHEMA(('IFC4'));
ENDSEC;
DATA;
#1=IFCPROPERTYSETTEMPLATE('1Ja6GlovjFoeonRLXJwyyl',$,'EPset_Parametric','',.PSET_TYPEDRIVENOVERRIDE.,'IfcTypeObject',(#2,#3));
#2=IFCSIMPLEPROPERTYTEMPLATE('2ZxSvp00j5hxrWv$Q8ajzx',$,'Engine','',.P_SINGLEVALUE.,'IfcLabel',$,$,$,$,$,.READWRITE.);
#3=IFCSIMPLEPROPERTYTEMPLATE('2AN6WomqXCjRkP0g2iwEjp',$,'LayerSetDirection','',.P_SINGLEVALUE.,'IfcLabel',$,$,$,$,$,.READWRITE.);
ENDSEC;
END-ISO-10303-21;
@@ -0,0 +1,13 @@
ISO-10303-21;
HEADER;
FILE_DESCRIPTION((),'2;1');
FILE_NAME('EPset_Productivity.ifc','2020-01-01T00:00:00',(),(),'EPset_Productivity','EPset_Productivity',$);
FILE_SCHEMA(('IFC4'));
ENDSEC;
DATA;
#1=IFCPROPERTYSETTEMPLATE('24XxTA2ED4o83uiZBG59D_',$,'EPset_Productivity','',.PSET_TYPEDRIVENOVERRIDE.,'IfcConstructionEquipmentResource,IfcLaborResource',(#2,#3,#4));
#2=IFCSIMPLEPROPERTYTEMPLATE('3mL27FQ4X4MQn5fiGqIt8x',$,'BaseQuantityConsumed','',.P_SINGLEVALUE.,'IfcDuration',$,$,$,$,$,.READWRITE.);
#3=IFCSIMPLEPROPERTYTEMPLATE('1DdJt5_Ar2mR4UDpO$98Ws',$,'BaseQuantityProducedName','',.P_SINGLEVALUE.,'IfcLabel',$,$,$,$,$,.READWRITE.);
#4=IFCSIMPLEPROPERTYTEMPLATE('2OZPZ$Onb2gOvW20q7gacH',$,'BaseQuantityProducedValue','',.P_SINGLEVALUE.,'IfcReal',$,$,$,$,$,.READWRITE.);
ENDSEC;
END-ISO-10303-21;
@@ -0,0 +1,12 @@
ISO-10303-21;
HEADER;
FILE_DESCRIPTION((),'2;1');
FILE_NAME('Qto_TaskBaseQuantities.ifc','2020-01-01T00:00:00',(),(),'Qto_TaskBaseQuantities','Qto_TaskBaseQuantities',$);
FILE_SCHEMA(('IFC4'));
ENDSEC;
DATA;
#1=IFCPROPERTYSETTEMPLATE('3uZCoCxrr8MA2yVRLzH6P4',$,'Qto_TaskBaseQuantities','',.QTO_OCCURRENCEDRIVEN.,'IfcTask',(#2,#3));
#2=IFCSIMPLEPROPERTYTEMPLATE('0q8nByVuP4cv46Pm4wfGpf',$,'StandardWork','',.Q_TIME.,$,$,$,$,$,$,.READWRITE.);
#3=IFCSIMPLEPROPERTYTEMPLATE('2uf5oHjAz4pRmtn9ihJiAs',$,'OvertimeWork','',.Q_TIME.,$,$,$,$,$,$,.READWRITE.);
ENDSEC;
END-ISO-10303-21;
@@ -1,6 +1,27 @@
* { stroke-linecap: round; }
.cut { fill: black; stroke: black; stroke-linecap: 'round'; stroke-width: 0.35; }
.background { fill: white; stroke: black; stroke-linecap: 'round'; stroke-width: 0.25; }
/*
* BlenderBIM Add-on - OpenBIM Blender Add-on
* Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
*
* This file is part of BlenderBIM Add-on.
*
* BlenderBIM Add-on is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BlenderBIM Add-on 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
*/
* { stroke-linecap: round; stroke-linejoin: round; }
text { fill: black; stroke: none; }
.cut { fill: black; stroke: black; stroke-linecap: 'round'; stroke-width: 0.35; fill-rule: evenodd; }
.projection { fill: white; stroke: black; stroke-linecap: 'round'; stroke-width: 0.25; }
.annotation { fill: none; stroke: black; stroke-linecap: 'round'; stroke-width: 0.25; }
.hidden { stroke-dasharray: 3, 2; }
.solid {}
@@ -0,0 +1,30 @@
/*
* BlenderBIM Add-on - OpenBIM Blender Add-on
* Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
*
* This file is part of BlenderBIM Add-on.
*
* BlenderBIM Add-on is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BlenderBIM Add-on 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
*/
.cut { fill: white; stroke: black; stroke-linecap: 'round'; stroke-width: 0.35; }
.background { fill: white; stroke: black; stroke-linecap: 'round'; stroke-width: 0.25; }
.annotation { fill: none; stroke: black; stroke-linecap: 'round'; stroke-width: 0.25; }
.hidden { stroke-dasharray: 3, 2; }
.solid {}
.leader { marker-end: url(#leader-marker); }
.stair { marker-start: url(#stair-marker-start); marker-end: url(#stair-marker-end); }
.break { fill: white; }
.breakline { fill: none; stroke: black; stroke-linecap: 'round'; stroke-width: 0.25; marker-mid: url(#breakline-marker); }
.IfcSpace { fill: none; stroke: none; }

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Before

Width:  |  Height:  |  Size: 572 B

After

Width:  |  Height:  |  Size: 572 B

@@ -25,7 +25,7 @@
</rdf:RDF>
</metadata>
<desc
id="desc89610">/home/dion/Projects/IfcOpenShell/src/ifcblenderexport/titleblock.dxf - scale = 1.000000, origin = (0.000000, 0.000000), method = manual</desc>
id="desc89610">/home/dion/Projects/IfcOpenShell/src/blenderbim/titleblock.dxf - scale = 1.000000, origin = (0.000000, 0.000000), method = manual</desc>
<rect
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2.07874;stroke-linecap:round;stroke-linejoin:round;stop-color:#000000"
id="rect1036"

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

@@ -25,7 +25,7 @@
</rdf:RDF>
</metadata>
<desc
id="desc89610">/home/dion/Projects/IfcOpenShell/src/ifcblenderexport/titleblock.dxf - scale = 1.000000, origin = (0.000000, 0.000000), method = manual</desc>
id="desc89610">/home/dion/Projects/IfcOpenShell/src/blenderbim/titleblock.dxf - scale = 1.000000, origin = (0.000000, 0.000000), method = manual</desc>
<rect
y="3.1753578e-05"
x="-4.3300333e-05"

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

@@ -25,7 +25,7 @@
</rdf:RDF>
</metadata>
<desc
id="desc89610">/home/dion/Projects/IfcOpenShell/src/ifcblenderexport/titleblock.dxf - scale = 1.000000, origin = (0.000000, 0.000000), method = manual</desc>
id="desc89610">/home/dion/Projects/IfcOpenShell/src/blenderbim/titleblock.dxf - scale = 1.000000, origin = (0.000000, 0.000000), method = manual</desc>
<rect
y="3.1753578e-05"
x="-4.3300333e-05"

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

@@ -0,0 +1,214 @@
# BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BlenderBIM Add-on 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
presets = {
"Basic": ["project", "search", "bcf", "attribute", "spatial", "pset", "qto"],
"Admin": [
"project",
"search",
"bcf",
"root",
"unit",
"model",
"georeference",
"context",
"drawing",
"misc",
"attribute",
"type",
"spatial",
"void",
"aggregate",
"geometry",
"cobie",
"resource",
"cost",
"sequence",
"group",
"system",
"structural",
"boundary",
"profile",
"material",
"style",
"layer",
"owner",
"pset",
"qto",
"classification",
"constraint",
"document",
"pset_template",
"clash",
"lca",
"csv",
"bimtester",
"diff",
"patch",
"covetool",
"augin",
"debug",
],
"BIM Coordination": [
"project",
"search",
"bcf",
"root",
"unit",
"georeference",
"attribute",
"type",
"spatial",
"void",
"aggregate",
"owner",
"pset",
"qto",
"clash",
"csv",
"bimtester",
"diff",
"patch",
"debug",
],
"Architecture": [
"project",
"search",
"bcf",
"root",
"unit",
"model",
"georeference",
"context",
"drawing",
"misc",
"attribute",
"type",
"spatial",
"void",
"aggregate",
"geometry",
"group",
"system",
"boundary",
"profile",
"material",
"style",
"layer",
"owner",
"pset",
"qto",
"classification",
"pset_template",
"clash",
"csv",
],
"Structural Engineering": [
"project",
"search",
"bcf",
"root",
"unit",
"model",
"georeference",
"context",
"drawing",
"misc",
"attribute",
"type",
"spatial",
"void",
"aggregate",
"geometry",
"group",
"system",
"structural",
"boundary",
"profile",
"material",
"style",
"layer",
"owner",
"pset",
"qto",
"classification",
"pset_template",
"clash",
"csv",
],
"MEP": [
"project",
"search",
"bcf",
"root",
"unit",
"model",
"georeference",
"context",
"drawing",
"misc",
"attribute",
"type",
"spatial",
"void",
"aggregate",
"geometry",
"group",
"system",
"boundary",
"profile",
"material",
"style",
"layer",
"owner",
"pset",
"qto",
"classification",
"pset_template",
"clash",
"csv",
],
"Quantity Surveying": ["project", "search", "attribute", "spatial", "void", "pset", "qto", "classification", "csv"],
"Model Enrichment": [
"project",
"search",
"root",
"attribute",
"spatial",
"pset",
"qto",
"pset_template",
"csv",
"patch",
],
"3D Visualisation": ["project", "search", "bcf", "attribute", "spatial", "pset", "qto"],
"4D Scheduling": ["project", "search", "attribute", "spatial", "resource", "cost", "sequence", "pset", "qto"],
"5D Cost Management": [
"project",
"search",
"attribute",
"spatial",
"resource",
"cost",
"sequence",
"pset",
"qto",
"lca",
],
"Facility Management": ["project", "search", "attribute", "spatial", "cobie", "pset", "qto", "lca"],
}
+209
View File
@@ -0,0 +1,209 @@
# BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BlenderBIM Add-on 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
import os
import bpy
import json
import numpy as np
import datetime
import zipfile
import tempfile
import addon_utils
import ifcopenshell
import ifcopenshell.api
import ifcopenshell.util.placement
import blenderbim.tool as tool
import blenderbim.core.aggregate
import blenderbim.core.spatial
import blenderbim.core.style
from blenderbim.bim.ifc import IfcStore
from mathutils import Vector
class IfcExporter:
def __init__(self, ifc_export_settings):
self.ifc_export_settings = ifc_export_settings
def export(self):
self.file = IfcStore.get_file()
self.set_header()
IfcStore.update_cache()
if bpy.context.scene.BIMProjectProperties.is_authoring:
self.sync_deletions()
self.sync_all_objects()
self.sync_edited_objects()
extension = self.ifc_export_settings.output_file.split(".")[-1]
if extension == "ifczip":
with tempfile.TemporaryDirectory() as unzipped_path:
filename, ext = os.path.splitext(os.path.basename(self.ifc_export_settings.output_file))
tmp_name = "{}.ifc".format(filename)
tmp_file = os.path.join(unzipped_path, tmp_name)
self.file.write(tmp_file)
with zipfile.ZipFile(
self.ifc_export_settings.output_file, mode="w", compression=zipfile.ZIP_DEFLATED, compresslevel=9
) as zf:
zf.write(tmp_file)
elif extension == "ifc":
self.file.write(self.ifc_export_settings.output_file)
elif extension == "ifcjson":
import ifcjson
if self.ifc_export_settings.json_version == "4":
jsonData = ifcjson.IFC2JSON4(self.file, self.ifc_export_settings.json_compact).spf2Json()
with open(self.ifc_export_settings.output_file, "w") as outfile:
json.dump(jsonData, outfile, indent=None if self.ifc_export_settings.json_compact else 4)
elif self.ifc_export_settings.json_version == "5a":
jsonData = ifcjson.IFC2JSON5a(self.file, self.ifc_export_settings.json_compact).spf2Json()
with open(self.ifc_export_settings.output_file, "w") as outfile:
json.dump(jsonData, outfile, indent=None if self.ifc_export_settings.json_compact else 4)
def set_header(self):
self.file.wrapped_data.header.file_name.name = os.path.basename(self.ifc_export_settings.output_file)
self.file.wrapped_data.header.file_name.time_stamp = (
datetime.datetime.utcnow()
.replace(tzinfo=datetime.timezone.utc)
.astimezone()
.replace(microsecond=0)
.isoformat()
)
self.file.wrapped_data.header.file_name.preprocessor_version = "IfcOpenShell {}".format(ifcopenshell.version)
self.file.wrapped_data.header.file_name.originating_system = "{} {}".format(
self.get_application_name(), self.get_application_version()
)
def sync_deletions(self):
results = []
for ifc_definition_id in IfcStore.deleted_ids:
try:
product = self.file.by_id(ifc_definition_id)
if hasattr(product, "GlobalId"):
results.append(product.GlobalId)
except:
continue
ifcopenshell.api.run("root.remove_product", self.file, **{"product": product})
return results
def sync_all_objects(self):
results = []
self.unit_scale = ifcopenshell.util.unit.calculate_unit_scale(self.file)
for ifc_definition_id in list(IfcStore.id_map.keys()):
obj = IfcStore.id_map[ifc_definition_id]
try:
if isinstance(obj, bpy.types.Material):
continue
tool.Collector.sync(obj)
result = self.sync_object_placement(obj)
if result:
results.append(result)
result = self.sync_object_material(obj)
if result:
results.append(result)
except ReferenceError:
pass # The object is likely deleted
return results
def sync_edited_objects(self):
results = []
for obj in IfcStore.edited_objs.copy():
if not obj:
continue
try:
if isinstance(obj, bpy.types.Material):
blenderbim.core.style.update_style_colours(tool.Ifc, tool.Style, obj=obj)
else:
element = tool.Ifc.get_entity(obj)
if element:
results.append(element)
bpy.ops.bim.update_representation(obj=obj.name)
except ReferenceError:
pass # The object is likely deleted
IfcStore.edited_objs.clear()
return results
def sync_object_material(self, obj):
if not obj.data or not isinstance(obj.data, bpy.types.Mesh):
return
if not self.has_changed_materials(obj):
return
bpy.ops.bim.update_representation(obj=obj.name)
def has_changed_materials(self, obj):
checksum = obj.data.BIMMeshProperties.material_checksum
return checksum != str([s.id() for s in tool.Geometry.get_styles(obj) if s])
def sync_object_placement(self, obj):
if not self.has_object_moved(obj):
return
blender_matrix = np.array(obj.matrix_world)
element = self.file.by_id(obj.BIMObjectProperties.ifc_definition_id)
if (obj.scale - Vector((1.0, 1.0, 1.0))).length > 1e-4:
bpy.ops.bim.update_representation(obj=obj.name)
return element
if element.is_a("IfcGridAxis"):
return self.sync_grid_axis_object_placement(obj, element)
if not hasattr(element, "ObjectPlacement"):
return
blenderbim.core.geometry.edit_object_placement(tool.Ifc, tool.Geometry, tool.Surveyor, obj=obj)
return element
def has_object_moved(self, obj):
if not obj.BIMObjectProperties.location_checksum:
return True # Let's be conservative
loc_check = np.frombuffer(eval(obj.BIMObjectProperties.location_checksum))
rot_check = np.frombuffer(eval(obj.BIMObjectProperties.rotation_checksum))
loc_real = np.array(obj.matrix_world.translation).flatten()
rot_real = np.array(obj.matrix_world.to_3x3()).flatten()
if np.allclose(loc_check, loc_real, atol=1e-4) and np.allclose(rot_check, rot_real, atol=1e-2):
return False
return True
def sync_grid_axis_object_placement(self, obj, element):
grid = (element.PartOfU or element.PartOfV or element.PartOfW)[0]
grid_obj = tool.Ifc.get_object(grid)
if grid_obj:
self.sync_object_placement(grid_obj)
if grid_obj.matrix_world != obj.matrix_world:
bpy.ops.bim.update_representation(obj=obj.name)
def get_application_name(self):
return "BlenderBIM"
def get_application_version(self):
return ".".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]
]
)
class IfcExportSettings:
def __init__(self):
self.logger = None
self.output_file = None
@staticmethod
def factory(context, output_file, logger):
settings = IfcExportSettings()
settings.output_file = output_file
settings.logger = logger
return settings
+306
View File
@@ -0,0 +1,306 @@
# BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BlenderBIM Add-on 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
import bpy
import json
import addon_utils
import ifcopenshell.api.owner.settings
import blenderbim.tool as tool
import blenderbim.core.owner as core_owner
from blenderbim.bim.module.drawing.prop import RasterStyleProperty
from bpy.app.handlers import persistent
from blenderbim.bim.ifc import IfcStore
from blenderbim.bim.module.owner.prop import get_user_person, get_user_organisation
from ifcopenshell.api.attribute.data import Data as AttributeData
from ifcopenshell.api.material.data import Data as MaterialData
from ifcopenshell.api.style.data import Data as StyleData
from ifcopenshell.api.type.data import Data as TypeData
global_subscription_owner = object()
def mode_callback(obj, data):
if not bpy.context.scene.BIMProjectProperties.is_authoring:
return
objects = bpy.context.selected_objects
if bpy.context.active_object:
objects += [bpy.context.active_object]
for obj in objects:
if (
obj.mode != "EDIT"
or not obj.data
or not isinstance(obj.data, (bpy.types.Mesh, bpy.types.Curve, bpy.types.TextCurve))
or not obj.BIMObjectProperties.ifc_definition_id
):
continue
if obj.data.BIMMeshProperties.ifc_definition_id:
IfcStore.edited_objs.add(obj)
elif IfcStore.get_file().by_id(obj.BIMObjectProperties.ifc_definition_id).is_a("IfcGridAxis"):
IfcStore.edited_objs.add(obj)
def name_callback(obj, data):
# TODO Do we still need this, now that we are monitoring the undo redo objects?
try:
obj.name
except:
return # In case the object RNA is gone during an undo / redo operation
# Blender names are up to 63 UTF-8 bytes
if len(bytes(obj.name, "utf-8")) >= 63:
return
if isinstance(obj, bpy.types.Material):
if obj.BIMObjectProperties.ifc_definition_id:
IfcStore.get_file().by_id(obj.BIMObjectProperties.ifc_definition_id).Name = obj.name
AttributeData.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id)
MaterialData.load_materials()
if obj.BIMMaterialProperties.ifc_style_id:
IfcStore.get_file().by_id(obj.BIMMaterialProperties.ifc_style_id).Name = obj.name
StyleData.load(IfcStore.get_file(), obj.BIMMaterialProperties.ifc_style_id)
return
if not obj.BIMObjectProperties.ifc_definition_id or "/" not in obj.name:
return
element = IfcStore.get_file().by_id(obj.BIMObjectProperties.ifc_definition_id)
if not element.is_a("IfcRoot"):
return
if element.is_a("IfcSpatialStructureElement") or (hasattr(element, "IsDecomposedBy") and element.IsDecomposedBy):
collection = obj.users_collection[0]
collection.name = obj.name
if element.is_a("IfcGrid"):
axis_obj = IfcStore.get_element(element.UAxes[0].id())
axis_collection = axis_obj.users_collection[0]
grid_collection = None
for collection in bpy.data.collections:
if axis_collection.name in collection.children.keys():
grid_collection = collection
break
if grid_collection:
grid_collection.name = obj.name
if element.is_a("IfcTypeProduct"):
TypeData.purge()
element.Name = "/".join(obj.name.split("/")[1:])
AttributeData.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id)
def color_callback(obj, data):
if obj.BIMMaterialProperties.ifc_style_id:
IfcStore.edited_objs.add(obj)
def active_object_callback():
refresh_ui_data()
def subscribe_to(object, data_path, callback):
try:
subscribe_to = object.path_resolve(data_path, False)
except:
return
bpy.msgbus.subscribe_rna(
key=subscribe_to,
owner=object,
args=(
object,
data_path,
),
notify=callback,
options={
"PERSISTENT",
},
)
def refresh_ui_data():
from blenderbim.bim import modules
for name, value in modules.items():
try:
getattr(value, "data").refresh()
except AttributeError:
pass
def purge_module_data():
from blenderbim.bim import modules
refresh_ui_data()
for name, value in modules.items():
try:
getattr(getattr(getattr(ifcopenshell.api, name), "data"), "Data").purge()
except AttributeError:
pass
try:
getattr(value, "prop").purge()
except AttributeError:
pass
@persistent
def loadIfcStore(scene):
IfcStore.purge()
purge_module_data()
if not IfcStore.get_file():
return
IfcStore.get_schema()
IfcStore.reload_linked_elements()
@persistent
def undo_pre(scene):
IfcStore.update_undo_redo_stack_objects()
@persistent
def undo_post(scene):
if IfcStore.last_transaction != bpy.context.scene.BIMProperties.last_transaction:
IfcStore.last_transaction = bpy.context.scene.BIMProperties.last_transaction
IfcStore.undo()
purge_module_data()
IfcStore.update_undo_redo_stack_objects()
IfcStore.reload_linked_elements(objects=[bpy.data.objects.get(o) for o in IfcStore.undo_redo_stack_objects])
@persistent
def redo_pre(scene):
IfcStore.update_undo_redo_stack_objects()
@persistent
def redo_post(scene):
if IfcStore.last_transaction != bpy.context.scene.BIMProperties.last_transaction:
IfcStore.last_transaction = bpy.context.scene.BIMProperties.last_transaction
IfcStore.redo()
purge_module_data()
IfcStore.update_undo_redo_stack_objects()
IfcStore.reload_linked_elements(objects=[bpy.data.objects.get(o) for o in IfcStore.undo_redo_stack_objects])
@persistent
def ensureIfcExported(scene):
if IfcStore.get_file() and not bpy.context.scene.BIMProperties.ifc_file:
bpy.ops.export_ifc.bim("INVOKE_DEFAULT")
def get_application(ifc):
# TODO: cache this for even faster application retrieval. It honestly makes a difference on long scripts.
version = get_application_version()
for element in ifc.by_type("IfcApplication"):
if element.ApplicationIdentifier == "BlenderBIM" and element.Version == version:
return element
return ifcopenshell.api.run(
"owner.add_application",
ifc,
version=version,
application_full_name="BlenderBIM Add-on",
application_identifier="BlenderBIM",
)
def get_application_version():
return ".".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]
]
)
@persistent
def setDefaultProperties(scene):
global global_subscription_owner
active_object_key = bpy.types.LayerObjects, "active"
bpy.msgbus.subscribe_rna(
key=active_object_key, owner=global_subscription_owner, args=(), notify=active_object_callback
)
ifcopenshell.api.owner.settings.get_user = lambda ifc: core_owner.get_user(tool.Owner)
ifcopenshell.api.owner.settings.get_application = get_application
# TODO: Move to drawing module
if len(bpy.context.scene.DocProperties.drawing_styles) == 0:
drawing_style = bpy.context.scene.DocProperties.drawing_styles.add()
drawing_style.name = "Technical"
drawing_style.render_type = "VIEWPORT"
drawing_style.raster_style = json.dumps(
{
RasterStyleProperty.WORLD_COLOR.value: (1, 1, 1),
RasterStyleProperty.RENDER_ENGINE.value: "BLENDER_WORKBENCH",
RasterStyleProperty.RENDER_TRANSPARENT.value: False,
RasterStyleProperty.SHADING_SHOW_OBJECT_OUTLINE.value: True,
RasterStyleProperty.SHADING_SHOW_CAVITY.value: False,
RasterStyleProperty.SHADING_CAVITY_TYPE.value: "BOTH",
RasterStyleProperty.SHADING_CURVATURE_RIDGE_FACTOR.value: 1,
RasterStyleProperty.SHADING_CURVATURE_VALLEY_FACTOR.value: 1,
RasterStyleProperty.VIEW_TRANSFORM.value: "Standard",
RasterStyleProperty.SHADING_LIGHT.value: "FLAT",
RasterStyleProperty.SHADING_COLOR_TYPE.value: "SINGLE",
RasterStyleProperty.SHADING_SINGLE_COLOR.value: (1, 1, 1),
RasterStyleProperty.SHADING_SHOW_SHADOWS.value: False,
RasterStyleProperty.SHADING_SHADOW_INTENSITY.value: 0.5,
RasterStyleProperty.DISPLAY_LIGHT_DIRECTION.value: (0.5, 0.5, 0.5),
RasterStyleProperty.VIEW_USE_CURVE_MAPPING.value: False,
RasterStyleProperty.OVERLAY_SHOW_WIREFRAMES.value: True,
RasterStyleProperty.OVERLAY_WIREFRAME_THRESHOLD.value: 0,
RasterStyleProperty.OVERLAY_SHOW_FLOOR.value: False,
RasterStyleProperty.OVERLAY_SHOW_AXIS_X.value: False,
RasterStyleProperty.OVERLAY_SHOW_AXIS_Y.value: False,
RasterStyleProperty.OVERLAY_SHOW_AXIS_Z.value: False,
RasterStyleProperty.OVERLAY_SHOW_OBJECT_ORIGINS.value: False,
RasterStyleProperty.OVERLAY_SHOW_RELATIONSHIP_LINES.value: False,
}
)
drawing_style = bpy.context.scene.DocProperties.drawing_styles.add()
drawing_style.name = "Shaded"
drawing_style.render_type = "VIEWPORT"
drawing_style.raster_style = json.dumps(
{
RasterStyleProperty.WORLD_COLOR.value: (1, 1, 1),
RasterStyleProperty.RENDER_ENGINE.value: "BLENDER_WORKBENCH",
RasterStyleProperty.RENDER_TRANSPARENT.value: False,
RasterStyleProperty.SHADING_SHOW_OBJECT_OUTLINE.value: True,
RasterStyleProperty.SHADING_SHOW_CAVITY.value: True,
RasterStyleProperty.SHADING_CAVITY_TYPE.value: "BOTH",
RasterStyleProperty.SHADING_CURVATURE_RIDGE_FACTOR.value: 1,
RasterStyleProperty.SHADING_CURVATURE_VALLEY_FACTOR.value: 1,
RasterStyleProperty.VIEW_TRANSFORM.value: "Standard",
RasterStyleProperty.SHADING_LIGHT.value: "STUDIO",
RasterStyleProperty.SHADING_COLOR_TYPE.value: "MATERIAL",
RasterStyleProperty.SHADING_SINGLE_COLOR.value: (1, 1, 1),
RasterStyleProperty.SHADING_SHOW_SHADOWS.value: True,
RasterStyleProperty.SHADING_SHADOW_INTENSITY.value: 0.5,
RasterStyleProperty.DISPLAY_LIGHT_DIRECTION.value: (0.5, 0.5, 0.5),
RasterStyleProperty.VIEW_USE_CURVE_MAPPING.value: False,
RasterStyleProperty.OVERLAY_SHOW_WIREFRAMES.value: False,
RasterStyleProperty.OVERLAY_WIREFRAME_THRESHOLD.value: 0,
RasterStyleProperty.OVERLAY_SHOW_FLOOR.value: False,
RasterStyleProperty.OVERLAY_SHOW_AXIS_X.value: False,
RasterStyleProperty.OVERLAY_SHOW_AXIS_Y.value: False,
RasterStyleProperty.OVERLAY_SHOW_AXIS_Z.value: False,
RasterStyleProperty.OVERLAY_SHOW_OBJECT_ORIGINS.value: False,
RasterStyleProperty.OVERLAY_SHOW_RELATIONSHIP_LINES.value: False,
}
)
drawing_style = bpy.context.scene.DocProperties.drawing_styles.add()
drawing_style.name = "Blender Default"
drawing_style.render_type = "DEFAULT"
bpy.ops.bim.save_drawing_style(index="2")
+99
View File
@@ -0,0 +1,99 @@
# BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BlenderBIM Add-on 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
import bpy
import json
import math
import ifcopenshell
import ifcopenshell.util.attribute
from mathutils import geometry
from mathutils import Vector
from blenderbim.bim.ifc import IfcStore
def draw_attributes(props, layout, copy_operator=None):
for attribute in props:
row = layout.row(align=True)
draw_attribute(attribute, row, copy_operator)
def draw_attribute(attribute, layout, copy_operator=None):
value_name = attribute.get_value_name()
if not value_name:
layout.label(text=attribute.name)
return
layout.prop(
attribute,
value_name,
text=attribute.name,
)
if attribute.is_optional:
layout.prop(attribute, "is_null", icon="RADIOBUT_OFF" if attribute.is_null else "RADIOBUT_ON", text="")
if copy_operator:
op = layout.operator(f"{copy_operator}", text="", icon="COPYDOWN")
op.name = attribute.name
def import_attributes(ifc_class, props, data, callback=None):
for attribute in IfcStore.get_schema().declaration_by_name(ifc_class).all_attributes():
import_attribute(attribute, props, data, callback=callback)
# A more elegant attribute importer signature, intended to supersede import_attributes
def import_attributes2(element, props, callback=None):
for attribute in element.wrapped_data.declaration().as_entity().all_attributes():
import_attribute(attribute, props, element.get_info(), callback=callback)
def import_attribute(attribute, props, data, callback=None):
data_type = ifcopenshell.util.attribute.get_primitive_type(attribute)
if isinstance(data_type, tuple) or data_type == "entity":
callback(attribute.name(), None, data) if callback else None
return
new = props.add()
new.name = attribute.name()
new.is_null = data[attribute.name()] is None
new.is_optional = attribute.optional()
new.data_type = data_type if isinstance(data_type, str) else ""
is_handled_by_callback = callback(attribute.name(), new, data) if callback else None
if is_handled_by_callback:
pass # Our job is done
elif is_handled_by_callback is False:
props.remove(len(props) - 1)
elif data_type == "string":
new.string_value = "" if new.is_null else data[attribute.name()]
elif data_type == "boolean":
new.bool_value = False if new.is_null else data[attribute.name()]
elif data_type == "integer":
new.int_value = 0 if new.is_null else data[attribute.name()]
elif data_type == "float":
new.float_value = 0.0 if new.is_null else data[attribute.name()]
elif data_type == "enum":
new.enum_items = json.dumps(ifcopenshell.util.attribute.get_enum_items(attribute))
if data[attribute.name()]:
new.enum_value = data[attribute.name()]
def export_attributes(props, callback=None):
attributes = {}
for prop in props:
is_handled_by_callback = callback(attributes, prop) if callback else False
if is_handled_by_callback:
continue # Our job is done
attributes[prop.name] = prop.get_value()
return attributes
+337
View File
@@ -0,0 +1,337 @@
# BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2020, 2021, 2022 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BlenderBIM Add-on 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
import os
import bpy
import uuid
import hashlib
import zipfile
import tempfile
import ifcopenshell
import blenderbim.bim.handler
from pathlib import Path
class IfcStore:
path = ""
file = None
schema = None
cache = None
cache_path = None
id_map = {}
guid_map = {}
deleted_ids = set()
edited_objs = set()
pset_template_path = ""
pset_template_file = None
library_path = ""
library_file = None
element_listeners = set()
undo_redo_stack_objects = set()
current_transaction = ""
last_transaction = ""
history = []
future = []
schema_identifiers = ["IFC4", "IFC2X3"]
@staticmethod
def purge():
IfcStore.path = ""
IfcStore.file = None
IfcStore.schema = None
IfcStore.cache = None
IfcStore.cache_path = None
IfcStore.id_map = {}
IfcStore.guid_map = {}
IfcStore.deleted_ids = set()
IfcStore.edited_objs = set()
IfcStore.pset_template_path = ""
IfcStore.pset_template_file = None
IfcStore.library_path = ""
IfcStore.library_file = None
IfcStore.schema_identifiers = ["IFC4", "IFC2X3"]
@staticmethod
def get_file():
if IfcStore.file is None:
IfcStore.path = bpy.context.scene.BIMProperties.ifc_file
if not os.path.isabs(IfcStore.path):
IfcStore.path = os.path.abspath(os.path.join(bpy.path.abspath("//"), IfcStore.path))
if IfcStore.path:
try:
IfcStore.load_file(IfcStore.path)
except:
pass
return IfcStore.file
@staticmethod
def get_cache():
if IfcStore.cache is None and IfcStore.path:
ifc_key = IfcStore.path + IfcStore.file.wrapped_data.header.file_name.time_stamp
ifc_hash = hashlib.md5(ifc_key.encode("utf-8")).hexdigest()
IfcStore.cache_path = os.path.join(bpy.context.scene.BIMProperties.data_dir, "cache", f"{ifc_hash}.h5")
cache_settings = ifcopenshell.geom.settings()
try:
IfcStore.cache = ifcopenshell.geom.serializers.hdf5(IfcStore.cache_path, cache_settings)
except:
return
return IfcStore.cache
@staticmethod
def update_cache():
if not IfcStore.cache:
return
ifc_key = IfcStore.path + IfcStore.file.wrapped_data.header.file_name.time_stamp
ifc_hash = hashlib.md5(ifc_key.encode("utf-8")).hexdigest()
new_cache_path = os.path.join(bpy.context.scene.BIMProperties.data_dir, "cache", f"{ifc_hash}.h5")
IfcStore.cache = None
os.replace(IfcStore.cache_path, new_cache_path)
IfcStore.get_cache()
@staticmethod
def load_file(path):
extension = path.split(".")[-1]
if extension.lower() == "ifczip":
with tempfile.TemporaryDirectory() as unzipped_path:
with zipfile.ZipFile(path, "r") as zip_ref:
zip_ref.extractall(unzipped_path)
for filename in Path(unzipped_path).glob("**/*.ifc"):
IfcStore.file = ifcopenshell.open(filename)
return
elif extension.lower() == "ifcxml":
IfcStore.file = ifcopenshell.file(ifcopenshell.ifcopenshell_wrapper.parse_ifcxml(path))
elif extension.lower() == "ifc":
IfcStore.file = ifcopenshell.open(path)
@staticmethod
def get_schema():
if IfcStore.file is None:
IfcStore.schema = ifcopenshell.ifcopenshell_wrapper.schema_by_name(
bpy.context.scene.BIMProjectProperties.export_schema
)
elif IfcStore.schema is None:
IfcStore.schema = ifcopenshell.ifcopenshell_wrapper.schema_by_name(IfcStore.file.schema)
return IfcStore.schema
@staticmethod
def get_element(id_or_guid):
if isinstance(id_or_guid, int):
map_object = IfcStore.id_map
else:
map_object = IfcStore.guid_map
try:
obj = map_object[id_or_guid]
obj.name # In case the object has been deleted, this triggers an exception
except:
return
return obj
@staticmethod
def add_element_listener(callback):
IfcStore.element_listeners.add(callback)
@staticmethod
def update_undo_redo_stack_objects():
"""Keeps track of selected object names, typically during undo and redo
When any Blender object is stored outside a Blender PointerProperty, such as
in a regular Python list, there is the likely probability that the object
will be invalidated when undo or redo occurs. Object invalidation seems to
only occur for selected objects either pre/post undo/redo event, including
selected objects for consecutive undo/redos, and all children.
So if I first select o1, then o2, then o3, then press undo, o3 will be
invalidated. If instead I press undo twice, o3 and o2 will be invalidated.
"""
if bpy.context.active_object:
objects = set([o.name for o in bpy.context.selected_objects + [bpy.context.active_object]])
objects.update([o.name for o in bpy.context.active_object.children])
else:
objects = set([o.name for o in bpy.context.selected_objects])
for obj in bpy.context.selected_objects:
objects.update([o.name for o in obj.children])
IfcStore.undo_redo_stack_objects |= objects
@staticmethod
def reload_linked_elements(objects=None):
file = IfcStore.get_file()
if not file:
return
if objects is None:
objects = bpy.data.objects
for obj in objects:
if not obj:
continue
if not obj.BIMObjectProperties.ifc_definition_id:
continue
element = file.by_id(obj.BIMObjectProperties.ifc_definition_id)
data = {"id": element.id(), "obj": obj.name}
if hasattr(element, "GlobalId"):
data["guid"] = element.GlobalId
IfcStore.commit_link_element(data)
@staticmethod
def link_element(element, obj):
IfcStore.id_map[element.id()] = obj
if hasattr(element, "GlobalId"):
IfcStore.guid_map[element.GlobalId] = obj
if element.is_a("IfcSurfaceStyle"):
obj.BIMMaterialProperties.ifc_style_id = element.id()
else:
obj.BIMObjectProperties.ifc_definition_id = element.id()
blenderbim.bim.handler.subscribe_to(obj, "name", blenderbim.bim.handler.name_callback)
if isinstance(obj, bpy.types.Material):
blenderbim.bim.handler.subscribe_to(obj, "diffuse_color", blenderbim.bim.handler.color_callback)
elif isinstance(obj, bpy.types.Object):
blenderbim.bim.handler.subscribe_to(obj, "mode", blenderbim.bim.handler.mode_callback)
for listener in IfcStore.element_listeners:
listener(element, obj)
if IfcStore.history:
data = {"id": element.id(), "guid": getattr(element, "GlobalId", None), "obj": obj.name}
IfcStore.history[-1]["operations"].append(
{"rollback": IfcStore.rollback_link_element, "commit": IfcStore.commit_link_element, "data": data}
)
@staticmethod
def rollback_link_element(data):
del IfcStore.id_map[data["id"]]
if data["guid"]:
del IfcStore.guid_map[data["guid"]]
@staticmethod
def commit_link_element(data):
obj = bpy.data.objects.get(data["obj"])
IfcStore.id_map[data["id"]] = obj
if "guid" in data:
IfcStore.guid_map[data["guid"]] = obj
blenderbim.bim.handler.subscribe_to(obj, "mode", blenderbim.bim.handler.mode_callback)
blenderbim.bim.handler.subscribe_to(obj, "name", blenderbim.bim.handler.name_callback)
if isinstance(obj, bpy.types.Material):
blenderbim.bim.handler.subscribe_to(obj, "diffuse_color", blenderbim.bim.handler.color_callback)
# TODO Listeners are not re-registered. Does this cause nasty problems to debug later on?
# TODO We're handling id_map and guid_map, but what about edited_objs? This might cause big problems.
@staticmethod
def unlink_element(element=None, obj=None):
if element is None:
try:
element = IfcStore.get_file().by_id(obj.BIMObjectProperties.ifc_definition_id)
except:
pass
if obj is None:
try:
potential_obj = IfcStore.id_map[element.id()]
potential_obj.name
obj = potential_obj
except:
pass
try:
if element:
del IfcStore.id_map[element.id()]
else:
del IfcStore.id_map[obj.BIMObjectProperties.ifc_definition_id]
except:
pass
try:
if element and hasattr(element, "GlobalId"):
del IfcStore.guid_map[element.GlobalId]
except:
pass
if element and element.is_a("IfcSurfaceStyle"):
obj.BIMMaterialProperties.ifc_style_id = 0
elif obj:
obj.BIMObjectProperties.ifc_definition_id = 0
@staticmethod
def execute_ifc_operator(operator, context):
is_top_level_operator = not bool(IfcStore.current_transaction)
if is_top_level_operator:
IfcStore.begin_transaction(operator)
IfcStore.get_file().begin_transaction()
# This empty transaction ensures that each operator has at least one transaction
IfcStore.add_transaction_operation(operator, rollback=lambda data: True, commit=lambda data: True)
else:
operator.transaction_key = IfcStore.current_transaction
result = getattr(operator, "_execute")(context)
if is_top_level_operator:
IfcStore.get_file().end_transaction()
IfcStore.add_transaction_operation(
operator, rollback=lambda d: IfcStore.get_file().undo(), commit=lambda d: IfcStore.get_file().redo()
)
IfcStore.end_transaction(operator)
blenderbim.bim.handler.refresh_ui_data()
return result
@staticmethod
def begin_transaction(operator):
IfcStore.undo_redo_stack_objects = set()
IfcStore.current_transaction = str(uuid.uuid4())
operator.transaction_key = IfcStore.current_transaction
@staticmethod
def end_transaction(operator):
IfcStore.current_transaction = ""
operator.transaction_key = ""
@staticmethod
def add_transaction_operation(operator, rollback=None, commit=None):
key = getattr(operator, "transaction_key", None)
data = getattr(operator, "transaction_data", None)
bpy.context.scene.BIMProperties.last_transaction = key
IfcStore.last_transaction = key
rollback = rollback or getattr(operator, "rollback", lambda data: True)
commit = commit or getattr(operator, "commit", lambda data: True)
if IfcStore.history and IfcStore.history[-1]["key"] == key:
IfcStore.history[-1]["operations"].append({"rollback": rollback, "commit": commit, "data": data})
else:
IfcStore.history.append(
{"key": key, "operations": [{"rollback": rollback, "commit": commit, "data": data}]}
)
IfcStore.future = []
@staticmethod
def undo():
if not IfcStore.history:
return
event = IfcStore.history.pop()
for transaction in event["operations"][::-1]:
transaction["rollback"](transaction["data"])
IfcStore.future.append(event)
@staticmethod
def redo():
if not IfcStore.future:
return
event = IfcStore.future.pop()
for transaction in event["operations"]:
transaction["commit"](transaction["data"])
IfcStore.history.append(event)
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,17 @@
# BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BlenderBIM Add-on 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
@@ -0,0 +1,38 @@
# BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BlenderBIM Add-on 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
import bpy
from . import ui, prop, operator
classes = (
operator.AssignObject,
operator.UnassignObject,
operator.EnableEditingAggregate,
operator.DisableEditingAggregate,
operator.AddAggregate,
prop.BIMObjectAggregateProperties,
ui.BIM_PT_aggregate,
)
def register():
bpy.types.Object.BIMObjectAggregateProperties = bpy.props.PointerProperty(type=prop.BIMObjectAggregateProperties)
def unregister():
del bpy.types.Object.BIMObjectAggregateProperties
@@ -0,0 +1,55 @@
# BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BlenderBIM Add-on 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
import bpy
import blenderbim.tool as tool
import ifcopenshell.util.element
def refresh():
AggregateData.is_loaded = False
class AggregateData:
data = {}
is_loaded = False
@classmethod
def load(cls):
cls.data = {
"has_aggregate": cls.has_aggregate(),
"label": cls.get_label(),
"relating_object_id": cls.get_relating_object_id(),
}
cls.is_loaded = True
@classmethod
def has_aggregate(cls):
return ifcopenshell.util.element.get_aggregate(tool.Ifc.get_entity(bpy.context.active_object))
@classmethod
def get_label(cls):
aggregate = ifcopenshell.util.element.get_aggregate(tool.Ifc.get_entity(bpy.context.active_object))
if aggregate:
return f"{aggregate.is_a()}/{aggregate.Name or ''}"
@classmethod
def get_relating_object_id(cls):
aggregate = ifcopenshell.util.element.get_aggregate(tool.Ifc.get_entity(bpy.context.active_object))
if aggregate:
return aggregate.id()
@@ -0,0 +1,128 @@
# BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BlenderBIM Add-on 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
import bpy
import ifcopenshell
import ifcopenshell.util.element
import blenderbim.tool as tool
import blenderbim.core.aggregate as core
import blenderbim.core.spatial
import blenderbim.bim.handler
from blenderbim.bim.ifc import IfcStore
class Operator:
def execute(self, context):
IfcStore.execute_ifc_operator(self, context)
blenderbim.bim.handler.refresh_ui_data()
return {"FINISHED"}
class AssignObject(bpy.types.Operator, Operator):
bl_idname = "bim.assign_object"
bl_label = "Assign Object"
bl_options = {"REGISTER", "UNDO"}
relating_object: bpy.props.IntProperty()
related_object: bpy.props.IntProperty()
def _execute(self, context):
core.assign_object(
tool.Ifc,
tool.Aggregate,
tool.Collector,
relating_obj=tool.Ifc.get_object(tool.Ifc.get().by_id(self.relating_object)),
related_obj=tool.Ifc.get_object(tool.Ifc.get().by_id(self.related_object)),
)
class UnassignObject(bpy.types.Operator, Operator):
bl_idname = "bim.unassign_object"
bl_label = "Unassign Object"
bl_options = {"REGISTER", "UNDO"}
relating_object: bpy.props.IntProperty()
related_object: bpy.props.IntProperty()
def _execute(self, context):
core.unassign_object(
tool.Ifc,
tool.Collector,
relating_obj=tool.Ifc.get_object(tool.Ifc.get().by_id(self.relating_object)),
related_obj=tool.Ifc.get_object(tool.Ifc.get().by_id(self.related_object)),
)
class EnableEditingAggregate(bpy.types.Operator, Operator):
bl_idname = "bim.enable_editing_aggregate"
bl_label = "Enable Editing Aggregate"
bl_options = {"REGISTER", "UNDO"}
def _execute(self, context):
core.enable_editing_aggregate(tool.Aggregate, obj=context.active_object)
class DisableEditingAggregate(bpy.types.Operator, Operator):
bl_idname = "bim.disable_editing_aggregate"
bl_label = "Disable Editing Aggregate"
bl_options = {"REGISTER", "UNDO"}
def _execute(self, context):
core.disable_editing_aggregate(tool.Aggregate, obj=context.active_object)
class AddAggregate(bpy.types.Operator):
bl_idname = "bim.add_aggregate"
bl_label = "Add Aggregate"
bl_options = {"REGISTER", "UNDO"}
obj: bpy.props.StringProperty()
def execute(self, context):
return IfcStore.execute_ifc_operator(self, context)
def _execute(self, context):
obj = bpy.data.objects.get(self.obj) if self.obj else context.active_object
element = tool.Ifc.get_entity(obj)
if not element:
return {"FINISHED"}
aggregate_collection = bpy.data.collections.new("IfcElementAssembly/Assembly")
context.scene.collection.children.link(aggregate_collection)
aggregate = bpy.data.objects.new("Assembly", None)
aggregate_collection.objects.link(aggregate)
bpy.ops.bim.assign_class(obj=aggregate.name, ifc_class="IfcElementAssembly")
tool.Collector.sync(obj)
current_aggregate = ifcopenshell.util.element.get_aggregate(element)
current_container = ifcopenshell.util.element.get_container(element)
if current_aggregate:
core.assign_object(
tool.Ifc,
tool.Aggregate,
tool.Collector,
relating_obj=tool.Ifc.get_object(current_aggregate),
related_obj=aggregate,
)
elif current_container:
blenderbim.core.spatial.assign_container(
tool.Ifc,
tool.Collector,
tool.Spatial,
structure_obj=tool.Ifc.get_object(current_container),
element_obj=aggregate,
)
core.assign_object(tool.Ifc, tool.Aggregate, tool.Collector, relating_obj=aggregate, related_obj=obj)
return {"FINISHED"}
@@ -0,0 +1,37 @@
# BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BlenderBIM Add-on 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
import bpy
from blenderbim.bim.prop import StrProperty, Attribute
from blenderbim.bim.module.spatial.data import SpatialData
from bpy.types import PropertyGroup
from bpy.props import (
PointerProperty,
StringProperty,
EnumProperty,
BoolProperty,
IntProperty,
FloatProperty,
FloatVectorProperty,
CollectionProperty,
)
class BIMObjectAggregateProperties(PropertyGroup):
is_editing: BoolProperty(name="Is Editing")
relating_object: PointerProperty(name="Aggregate", type=bpy.types.Object)
@@ -0,0 +1,71 @@
# BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BlenderBIM Add-on 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
from bpy.types import Panel
from blenderbim.bim.module.aggregate.data import AggregateData
from blenderbim.bim.ifc import IfcStore
class BIM_PT_aggregate(Panel):
bl_label = "IFC Aggregates"
bl_idname = "BIM_PT_aggregate"
bl_options = {"DEFAULT_CLOSED"}
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "object"
@classmethod
def poll(cls, context):
if not context.active_object:
return False
props = context.active_object.BIMObjectProperties
if not props.ifc_definition_id:
return False
if not IfcStore.get_element(props.ifc_definition_id):
return False
if not IfcStore.get_file().by_id(props.ifc_definition_id).is_a("IfcObjectDefinition"):
return False
return True
def draw(self, context):
if not AggregateData.is_loaded:
AggregateData.load()
props = context.active_object.BIMObjectAggregateProperties
if props.is_editing:
row = self.layout.row(align=True)
row.prop(props, "relating_object", text="")
if props.relating_object:
op = row.operator("bim.assign_object", icon="CHECKMARK", text="")
op.relating_object = props.relating_object.BIMObjectProperties.ifc_definition_id
op.related_object = context.active_object.BIMObjectProperties.ifc_definition_id
row.operator("bim.disable_editing_aggregate", icon="CANCEL", text="")
else:
row = self.layout.row(align=True)
if AggregateData.data["has_aggregate"]:
row.label(text=AggregateData.data["label"])
row.operator("bim.enable_editing_aggregate", icon="GREASEPENCIL", text="")
row.operator("bim.add_aggregate", icon="ADD", text="")
op = row.operator("bim.unassign_object", icon="X", text="")
op.relating_object = AggregateData.data["relating_object_id"]
op.related_object = context.active_object.BIMObjectProperties.ifc_definition_id
else:
row.label(text="No Aggregate Found")
row.operator("bim.enable_editing_aggregate", icon="GREASEPENCIL", text="")
row.operator("bim.add_aggregate", icon="ADD", text="")
@@ -0,0 +1,41 @@
# BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BlenderBIM Add-on 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
import bpy
from . import ui, prop, operator
classes = (
operator.EnableEditingAttributes,
operator.DisableEditingAttributes,
operator.EditAttributes,
operator.GenerateGlobalId,
operator.CopyAttributeToSelection,
prop.BIMAttributeProperties,
ui.BIM_PT_object_attributes,
ui.BIM_PT_material_attributes,
)
def register():
bpy.types.Object.BIMAttributeProperties = bpy.props.PointerProperty(type=prop.BIMAttributeProperties)
bpy.types.Material.BIMAttributeProperties = bpy.props.PointerProperty(type=prop.BIMAttributeProperties)
def unregister():
del bpy.types.Object.BIMAttributeProperties
del bpy.types.Material.BIMAttributeProperties
@@ -0,0 +1,74 @@
# BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BlenderBIM Add-on 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
import bpy
import ifcopenshell
import blenderbim.tool as tool
def refresh():
AttributesData.is_loaded = False
MaterialAttributesData.is_loaded = False
class AttributesData:
data = {}
is_loaded = False
@classmethod
def load(cls):
cls.data = {"attributes": cls.attributes()}
cls.is_loaded = True
@classmethod
def attributes(cls):
results = []
element = tool.Ifc.get_entity(bpy.context.active_object)
data = element.get_info()
if hasattr(element, "GlobalId"):
excluded_keys = ["id", "type"]
else:
excluded_keys = ["type"]
for key, value in data.items():
if value is None or isinstance(value, ifcopenshell.entity_instance) or key in excluded_keys:
continue
if key == "id":
key = "STEP ID"
results.append({"name": key, "value": str(value)})
return results
class MaterialAttributesData:
data = {}
is_loaded = False
@classmethod
def load(cls):
cls.data = {"attributes": cls.attributes()}
cls.is_loaded = True
@classmethod
def attributes(cls):
results = []
element = tool.Ifc.get_entity(bpy.context.active_object.active_material)
data = element.get_info()
for key, value in data.items():
if value is None or isinstance(value, ifcopenshell.entity_instance) or key in ["id", "type"]:
continue
results.append({"name": key, "value": str(value)})
return results
@@ -1,14 +1,44 @@
# BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BlenderBIM Add-on 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
import bpy
import json
import ifcopenshell
import blenderbim.bim.module.attribute.edit_attributes as edit_attributes
import ifcopenshell.api
import blenderbim.bim.helper
import blenderbim.bim.handler
import blenderbim.tool as tool
import blenderbim.core.attribute as core
from blenderbim.bim.ifc import IfcStore
from blenderbim.bim.module.attribute.data import Data
from ifcopenshell.api.attribute.data import Data
class Operator:
def execute(self, context):
IfcStore.execute_ifc_operator(self, context)
blenderbim.bim.handler.refresh_ui_data()
return {"FINISHED"}
class EnableEditingAttributes(bpy.types.Operator):
bl_idname = "bim.enable_editing_attributes"
bl_label = "Enable Editing Attributes"
bl_options = {"REGISTER", "UNDO"}
obj: bpy.props.StringProperty()
obj_type: bpy.props.StringProperty()
@@ -20,24 +50,10 @@ class EnableEditingAttributes(bpy.types.Operator):
obj = bpy.data.materials.get(self.obj)
oprops = obj.BIMObjectProperties
props = obj.BIMAttributeProperties
while len(props.attributes) > 0:
props.attributes.remove(0)
for attribute in Data.products[oprops.ifc_definition_id]:
new = props.attributes.add()
if attribute["type"] == "entity":
continue
new.name = attribute["name"]
new.is_null = attribute["is_null"]
if attribute["type"] == "string" or attribute["type"] == "list":
new.string_value = attribute["value"] or ""
elif attribute["type"] == "integer":
new.int_value = attribute["value"] or 0
elif attribute["type"] == "float":
new.float_value = attribute["value"] or 0.
elif attribute["type"] == "enum":
new.enum_items = json.dumps(attribute["enum_items"])
if attribute["value"]:
new.enum_value = attribute["value"]
props.attributes.clear()
if oprops.ifc_definition_id not in Data.products:
Data.load(IfcStore.get_file(), oprops.ifc_definition_id)
blenderbim.bim.helper.import_attributes2(tool.Ifc.get().by_id(oprops.ifc_definition_id), props.attributes)
props.is_editing_attributes = True
return {"FINISHED"}
@@ -45,6 +61,7 @@ class EnableEditingAttributes(bpy.types.Operator):
class DisableEditingAttributes(bpy.types.Operator):
bl_idname = "bim.disable_editing_attributes"
bl_label = "Disable Editing Attributes"
bl_options = {"REGISTER", "UNDO"}
obj: bpy.props.StringProperty()
obj_type: bpy.props.StringProperty()
@@ -58,13 +75,14 @@ class DisableEditingAttributes(bpy.types.Operator):
return {"FINISHED"}
class EditAttributes(bpy.types.Operator):
class EditAttributes(bpy.types.Operator, Operator):
bl_idname = "bim.edit_attributes"
bl_label = "Edit Attributes"
bl_options = {"REGISTER", "UNDO"}
obj: bpy.props.StringProperty()
obj_type: bpy.props.StringProperty()
def execute(self, context):
def _execute(self, context):
self.file = IfcStore.get_file()
if self.obj_type == "Object":
obj = bpy.data.objects.get(self.obj)
@@ -95,17 +113,8 @@ class EditAttributes(bpy.types.Operator):
elif attribute["type"] == "enum":
attributes[attribute["name"]] = blender_attribute.enum_value
product = self.file.by_id(oprops.ifc_definition_id)
edit_attributes.Usecase(self.file, {
"product": product,
"attributes": attributes
}).execute()
if "Name" in attributes:
new_name = "{}/{}".format(product.is_a(), product.Name or "Unnamed")
collection = bpy.data.collections.get(obj.name)
if collection:
collection.name = new_name
obj.name = new_name
Data.load(oprops.ifc_definition_id)
ifcopenshell.api.run("attribute.edit_attributes", self.file, **{"product": product, "attributes": attributes})
Data.load(IfcStore.get_file(), oprops.ifc_definition_id)
bpy.ops.bim.disable_editing_attributes(obj=obj.name, obj_type=self.obj_type)
return {"FINISHED"}
@@ -113,14 +122,26 @@ class EditAttributes(bpy.types.Operator):
class GenerateGlobalId(bpy.types.Operator):
bl_idname = "bim.generate_global_id"
bl_label = "Regenerate GlobalId"
bl_options = {"REGISTER", "UNDO"}
def execute(self, context):
index = bpy.context.active_object.BIMAttributeProperties.attributes.find("GlobalId")
index = context.active_object.BIMAttributeProperties.attributes.find("GlobalId")
if index >= 0:
global_id = bpy.context.active_object.BIMAttributeProperties.attributes[index]
global_id = context.active_object.BIMAttributeProperties.attributes[index]
else:
global_id = bpy.context.active_object.BIMAttributeProperties.attributes.add()
global_id = context.active_object.BIMAttributeProperties.attributes.add()
global_id.name = "GlobalId"
global_id.data_type = "string"
global_id.string_value = ifcopenshell.guid.new()
return {"FINISHED"}
class CopyAttributeToSelection(bpy.types.Operator, Operator):
bl_idname = "bim.copy_attribute_to_selection"
bl_label = "Copy Attribute To Selection"
name: bpy.props.StringProperty()
def _execute(self, context):
value = context.active_object.BIMAttributeProperties.attributes.get(self.name).get_value()
for obj in context.selected_objects:
core.copy_attribute_to_selection(tool.Ifc, name=self.name, value=value, obj=obj)
@@ -0,0 +1,37 @@
# BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BlenderBIM Add-on 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
import bpy
from blenderbim.bim.ifc import IfcStore
from blenderbim.bim.prop import StrProperty, Attribute
from bpy.types import PropertyGroup
from bpy.props import (
PointerProperty,
StringProperty,
EnumProperty,
BoolProperty,
IntProperty,
FloatProperty,
FloatVectorProperty,
CollectionProperty,
)
class BIMAttributeProperties(PropertyGroup):
attributes: CollectionProperty(name="Attributes", type=Attribute)
is_editing_attributes: BoolProperty(name="Is Editing Attributes")
@@ -0,0 +1,96 @@
# BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BlenderBIM Add-on 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
import blenderbim.bim.helper
from bpy.types import Panel
from blenderbim.bim.ifc import IfcStore
from blenderbim.bim.module.attribute.data import AttributesData, MaterialAttributesData
def draw_ui(context, layout, obj_type, attributes):
obj = context.active_object if obj_type == "Object" else context.active_object.active_material
oprops = obj.BIMObjectProperties
props = obj.BIMAttributeProperties
if props.is_editing_attributes:
row = layout.row(align=True)
op = row.operator("bim.edit_attributes", icon="CHECKMARK", text="Save Attributes")
op.obj_type = obj_type
op.obj = obj.name
op = row.operator("bim.disable_editing_attributes", icon="CANCEL", text="")
op.obj_type = obj_type
op.obj = obj.name
blenderbim.bim.helper.draw_attributes(props.attributes, layout, copy_operator="bim.copy_attribute_to_selection")
else:
row = layout.row()
op = row.operator("bim.enable_editing_attributes", icon="GREASEPENCIL", text="Edit")
op.obj_type = obj_type
op.obj = obj.name
for attribute in attributes:
row = layout.row(align=True)
row.label(text=attribute["name"])
row.label(text=attribute["value"])
# TODO: reimplement, see #1222
# if "IfcSite/" in context.active_object.name or "IfcBuilding/" in context.active_object.name:
# self.draw_addresses_ui()
class BIM_PT_object_attributes(Panel):
bl_label = "IFC Attributes"
bl_idname = "BIM_PT_object_attributes"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "object"
@classmethod
def poll(cls, context):
if not context.active_object:
return False
if not IfcStore.get_element(context.active_object.BIMObjectProperties.ifc_definition_id):
return False
return bool(context.active_object.BIMObjectProperties.ifc_definition_id)
def draw(self, context):
if not AttributesData.is_loaded:
AttributesData.load()
draw_ui(context, self.layout, "Object", AttributesData.data["attributes"])
class BIM_PT_material_attributes(Panel):
bl_label = "IFC Material Attributes"
bl_idname = "BIM_PT_material_attributes"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "material"
@classmethod
def poll(cls, context):
if not IfcStore.get_file():
return False
try:
return bool(context.active_object.active_material.BIMObjectProperties.ifc_definition_id)
except:
return False
def draw(self, context):
if not MaterialAttributesData.is_loaded:
MaterialAttributesData.load()
draw_ui(context, self.layout, "Material", MaterialAttributesData.data["attributes"])
@@ -0,0 +1,36 @@
# BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BlenderBIM Add-on 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
import bpy
from . import ui, prop, operator
classes = (
prop.AuginProperties,
ui.BIM_PT_augin,
operator.AuginLogin,
operator.AuginCreateNewModel,
operator.AuginReset,
)
def register():
bpy.types.Scene.AuginProperties = bpy.props.PointerProperty(type=prop.AuginProperties)
def unregister():
del bpy.types.Scene.AuginProperties
@@ -0,0 +1,154 @@
# BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BlenderBIM Add-on 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
import os
import bpy
import json
import string
import random
import shutil
import requests
import tempfile
import datetime
import addon_utils
class AuginLogin(bpy.types.Operator):
bl_idname = "bim.augin_login"
bl_label = "Login to Augin"
bl_options = {"REGISTER", "UNDO"}
def execute(self, context):
props = context.scene.AuginProperties
url = "https://server.auge.pro.br/API/v3/augin_rest.php/user_login"
payload = {"email": props.username, "password": props.password}
response = requests.request("POST", url, data=payload)
result = response.json()
if result["success_feedback"]["success"]:
props.token = result["token"]
else:
self.report({"ERROR"}, "Login failed :(")
return {"FINISHED"}
class AuginReset(bpy.types.Operator):
bl_idname = "bim.augin_reset"
bl_label = "Upload Another Project"
bl_options = {"REGISTER", "UNDO"}
def execute(self, context):
props = context.scene.AuginProperties
props.is_success = False
return {"FINISHED"}
class AuginCreateNewModel(bpy.types.Operator):
bl_idname = "bim.augin_create_new_model"
bl_label = "Create New Augin Model"
bl_options = {"REGISTER", "UNDO"}
def execute(self, context):
import boto3
from botocore.config import Config
props = context.scene.AuginProperties
# Create project
url = "https://server.auge.pro.br/API/v3/augin_rest.php/new_model"
chars = string.ascii_uppercase + string.ascii_lowercase + string.digits
props.project_filename = "BBM{}{}".format(
datetime.datetime.now().strftime("%Y%m%d%H%M%S"), "".join(random.choice(chars) for _ in range(6))
)
addon_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]
]
)
payload = {
"user_token": props.token,
"partner_token": "Mmf2zpxdgrkHaUNRm6Cv7GLJdBAeb7Rn",
"project_name": props.project_name,
"model_filename": props.project_filename + ".ifc",
"thumb_filename": props.project_filename + ".png",
"app_name": "BlenderBIM",
"sw_version": bpy.app.version_string,
"plugin_version": addon_version,
}
response = requests.request("POST", url, data=payload)
result = response.json()
# Upload to S3
my_config = Config(
region_name=result["s3_region"],
)
client = boto3.client(
"s3",
aws_access_key_id=result["s3_key"],
aws_secret_access_key=result["s3_secret"],
aws_session_token=result["s3_token"],
config=my_config,
)
# Generate thumb
old_file_format = context.scene.render.image_settings.file_format
old_filepath = context.scene.render.filepath
cam = bpy.data.cameras.new("Camera")
cam_obj = bpy.data.objects.new("Camera", cam)
context.scene.collection.objects.link(cam_obj)
context.scene.camera = cam_obj
tmpdir = tempfile.mkdtemp()
thumb_path = os.path.join(tmpdir, "thumb.png")
context.scene.render.image_settings.file_format = "PNG"
context.scene.render.filepath = thumb_path
bpy.ops.render.opengl(write_still=True)
context.scene.render.image_settings.file_format = old_file_format
context.scene.render.filepath = old_filepath
client.upload_file(context.scene.BIMProperties.ifc_file, result["s3_bucket"], result["model_path"])
client.upload_file(thumb_path, result["s3_bucket"], result["thumb_path"])
# Notify done
url = "https://server.auge.pro.br/API/v3/augin_rest.php/files_uploaded"
payload = {
"user_token": props.token,
"ifc_filesize": os.path.getsize(context.scene.BIMProperties.ifc_file),
"model_filesize": os.path.getsize(context.scene.BIMProperties.ifc_file),
"thumb_filesize": os.path.getsize(thumb_path),
"model_upload_path": result["model_path"],
"thumb_upload_path": result["thumb_path"],
"model_id": result["model_id"],
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.request("POST", url, headers=headers, data=payload)
shutil.rmtree(tmpdir)
props.is_success = True
return {"FINISHED"}
@@ -0,0 +1,29 @@
# BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BlenderBIM Add-on 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
import bpy.props
import bpy.types
class AuginProperties(bpy.types.PropertyGroup):
username: bpy.props.StringProperty(name="Username")
password: bpy.props.StringProperty(name="Password")
token: bpy.props.StringProperty(name="Token")
project_name: bpy.props.StringProperty(name="Project Name")
project_filename: bpy.props.StringProperty(name="IFC Filename")
is_success: bpy.props.BoolProperty(name="Is Successful Upload", default=False)
@@ -0,0 +1,63 @@
# BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BlenderBIM Add-on 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
import bpy.types
class BIM_PT_augin(bpy.types.Panel):
bl_label = "Augin"
bl_idname = "BIM_PT_augin"
bl_options = {"DEFAULT_CLOSED"}
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "scene"
def draw(self, context):
layout = self.layout
layout.use_property_split = True
scene = context.scene
props = scene.AuginProperties
if not props.token:
row = layout.row()
row.prop(props, "username")
row = layout.row()
row.prop(props, "password")
row = layout.row()
row.operator("bim.augin_login")
return
row = layout.row()
row.label(text="Logged in as " + props.username)
if not context.scene.BIMProperties.ifc_file:
row = layout.row()
row.label(text="No IFC Found")
return
if props.is_success:
row = layout.row()
row.label(text="Upload Successful")
row = layout.row()
row.operator("bim.augin_reset")
else:
row = layout.row()
row.prop(props, "project_name")
row = layout.row()
row.operator("bim.augin_create_new_model")
@@ -1,3 +1,21 @@
# BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BlenderBIM Add-on 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
import bpy
from . import ui, prop, operator
@@ -20,6 +38,7 @@ classes = (
operator.AddBcfLabel,
operator.AddBcfRelatedTopic,
operator.ViewBcfTopic,
operator.RemoveBcfTopic,
operator.RemoveBcfComment,
operator.RemoveBcfBimSnippet,
operator.RemoveBcfReferenceLink,
@@ -0,0 +1,30 @@
# BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BlenderBIM Add-on 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
import bcf
import bcf.v2.bcfxml
class BcfStore:
bcfxml = None
@staticmethod
def get_bcfxml():
if not BcfStore.bcfxml:
BcfStore.bcfxml = bcf.v2.bcfxml.BcfXml()
return BcfStore.bcfxml

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