Compare commits

...

2093 Commits

Author SHA1 Message Date
Ryan Schultz cc90340b3b tweaked active operator 2024-10-26 14:22:18 -05:00
Ryan Schultz db075c7160 display the sum of all selected objects 2024-10-26 13:26:11 -05:00
Thomas Krijnen ea48996f0d Double check for relationship subtype when processing openings on aggregate parent #5639 2024-10-26 14:53:36 +02:00
Andrej730 6b55e5e6ee Fix find_openings for ifc2x3 #5639 2024-10-25 17:43:41 +05:00
Richard Brice e270583451 Fixes unit conversion on clothoid constant 2024-10-24 08:43:47 -07:00
Andrej730 99dc4795c7 Reset not applied objects scales during project save
We try to apply scales using bim.update_representation and if didn't worked (presumably because object has openings) we reset the scales.
It was confusing for users that they scaled an object, saved IFC and they would know that scaling didn't worked only after they reopen the IFC project.
2024-10-24 18:38:17 +05:00
Andrej730 1642f231fb typing 2024-10-24 18:38:17 +05:00
Andrej730 9998442eb4 Use common method for checking if object is scaled 2024-10-24 18:38:16 +05:00
Andrej730 4040c31583 Lock scale for objects with openings
Currently there is an UX problem that it's not clear for users when it's possible to use scale or not. We definitely won't be able to safely apply scales for objects with openings, so will try to lock them from the start.
2024-10-24 18:38:16 +05:00
Andrej730 6614245fc1 Fix unnamed button for editing openings 2024-10-24 18:38:16 +05:00
Andrej730 c7a41b46fd More complete fix for breaking styles ui e85043ae3
Now it also doesn't break if user will undo style rename.
2024-10-24 18:38:16 +05:00
Andrej730 dfd11fb723 black . 2024-10-24 18:38:16 +05:00
Manu Varkey 8d3aa98b58 Implement rounding of elevation (#5532)
* Implement rounding of elevation

Implement rounding of elevation based on precision stored in IfcGeometricRepresentationContext

* Move formating function to tool
2024-10-24 15:17:47 +05:00
Andrej730 b08acd1625 Fix incorrect error message for bim.link_ifc when linking using 'files' argument
self.filepath is empty if bim.link_ifc was executed using 'files' argument
2024-10-24 14:25:26 +05:00
Andrej730 181b0cefc3 Fix linking ifc from shared folder on Windows #5386
The problem was that shared folders names are starting with `\\`, e.g. `\\SERVERNAME\shared_folder`. When we pass path strings we usually sanitize them and save them as posix, so it's saved as `//SERVERNAME/shared_folder` and Blender has a convention that paths starting with `//` it interprets as filepaths relative to the current .blend file, therefore it was giving some weird error that `C:\Users\xxxx\SERVERNAME\shared_folder\test.blend` is missing instead of `\\SERVERNAME\shared_folder`.

So need to be careful passing strings to Blender operators and use str instead of as_posix for those operators, so  \\` wouldn't be misinterpreted.
2024-10-24 14:25:25 +05:00
Andrej730 e85043ae31 Fix styles UI breaking on undo
Turn out storing bpy.types.PropetyGroups was not very reliable idea as they get invalidated, just as Objects.
It's still breaking if you'd try to rename the style and then undo.
2024-10-23 18:34:03 +05:00
Andrej730 ca0e4f9cd6 Fix error duplicating type when current tool doesn't match the type #5591 2024-10-23 18:34:03 +05:00
Andrej730 3ff0ff66a4 Try to ensure undo will still work in case of an error
Previously transaction was never finished and therefore is_top_level_operator would never be triggered (without restarting project) making any IFC undo useless.
Previously it wsan't finishing transaction therefore:
- it was possible to undo ifc changes in the last step that had an error

- since transaction was never finished, IfcStore.current_transaction was never cleared and therefore is_top_level_operator will be never be triggered for the next operators, so new transactions are never created breaking undo for any further ifc changes.

Now user can try to undo the last action to save the file.
2024-10-23 18:34:02 +05:00
Andrej730 0ea71b0795 Ifc.Operator - remove second refresh_ui_data
Seems to be already covered by refresh_ui_data in IfcStore.execute_ifc_operator.
2024-10-23 18:34:02 +05:00
Andrej730 932a718d2d limit active_material_index handler callback 2024-10-23 18:34:02 +05:00
Andrej730 106b6f74e1 Handle listeners on unlink commit/rollback 2024-10-23 18:34:02 +05:00
Andrej730 88de650660 Simplify IfcStore.relink_object 2024-10-23 18:34:02 +05:00
Andrej730 72ea93bc0f Prevent adding None to guid_map
OperationData was always including guid key, so guid_map[None] was pointing to some object (typically a style). Also covered by rebuild_element_maps in the most cases.
2024-10-23 18:34:02 +05:00
Andrej730 6f347bcb81 Undo to clear listeners for linked objects
Typically it's already covered by rebuild_element_maps after undo but just to be consistent with commit_link_element.
2024-10-23 18:34:01 +05:00
Andrej730 fa29c42887 common method for setting up Blender listeners for objects 2024-10-23 18:34:01 +05:00
Andrej730 86edd52894 Unlinking elements to clear Blender listeners
to prevent unnecessary callbacks
2024-10-23 18:34:01 +05:00
Andrej730 db0a72c794 Add min/max values for roof angle/percentage
That way those props should be easier to edit, previously dragging "percentage" would go to infinity very quickly.
2024-10-23 18:34:01 +05:00
Andrej730 d68dee148b Fix infinite recursion with angle/percentage roof properties in 2597827
Probably was harmless, it was just flooding the console with errors such as:

object address  : 000002485A776380
object refcount : 2
object type     : 00007FFBD1249050
object type name: RecursionError
object repr     :
lost sys.stderr
File "\bonsai\bim\module\model\prop.py", line 707, in <lambda>
object address  : 000002485A774520
object refcount : 2
object type     : 00007FFBD1249050
object type name: RecursionError
object repr     :
lost sys.stderr
File "\bonsai\bim\module\model\prop.py", line 713, in <lambda>
2024-10-23 18:34:01 +05:00
Andrej730 a1134e83a4 Fix test after 8372e12f8 2024-10-23 18:34:00 +05:00
Andrej730 b61927b460 deprecate Style.get_style
In favor of Ifc.get_entity
2024-10-23 18:34:00 +05:00
Andrej730 863633f2dc Prevent adding name callback to non-ifc blender materials
Also removing one more artifact from #4843
2024-10-23 18:34:00 +05:00
Andrej730 b7dfeaee37 typing 2024-10-23 18:34:00 +05:00
Andrej730 2771465996 black . 2024-10-23 18:34:00 +05:00
Ryan Schultz f62b1ed326 Have svg tags with IfcColumn/IfcBeam classes always on top.
discussion: https://community.osarch.org/discussion/2572/a-clever-way-to-get-a-column-buried-in-a-wall-to-still-read-when-you-print-a-drawing
2024-10-22 18:45:19 -05:00
Bruno Perdigão 0c0225543b Add polyline tool for slabs.
No preview yet.
2024-10-22 17:39:19 -03:00
Bruno Perdigão ffe8d4fad2 Make wall preview decorator work only with IfcWallType. 2024-10-22 17:32:48 -03:00
Andrej730 c18d2e8c17 ifcopenshell.file - store default history_size in class instead of instance 2024-10-22 18:20:29 +05:00
Andrej730 70521b1020 IfcStore.edited_objs - document issues 2024-10-22 18:20:29 +05:00
Andrej730 a777d67252 bim.generate_space - add a test 2024-10-22 18:20:29 +05:00
Andrej730 7544053f0b bim.generate_space not to fail silently 2024-10-22 18:20:29 +05:00
Andrej730 7bebd2f7ce bim.generate_space - fix missing undo step 2024-10-22 18:20:29 +05:00
Andrej730 64fe2240e6 bim.generate_space - not to produce orphaned ifc mesh
Orphaned mesh was also linked to IFC which could have lead to some hard to debug issues.
2024-10-22 18:20:28 +05:00
Andrej730 54b104b822 fix not working bim.generate_space because of the units mismatch
Not sure when this occurred but get_bmesh_from_polygon was expecting Polygon in project units but it was SI. Since it's probably better to move everything to SI, added an option to specify whether polygon is in SI or not.
2024-10-22 18:20:28 +05:00
Andrej730 abd7c93c35 bim.generate_space - document 2024-10-22 18:20:28 +05:00
Andrej730 5c56ea6343 spatial tool ui - sync shift-a hotkey UI with hotkey_S_A
Previously it was always showing two S_A operators
2024-10-22 18:20:28 +05:00
Andrej730 e8a2f3aed2 remove recalculate_dumb_wall_origin and don't mark aligned walls as edited
Since 5677768 recalculate_dumb_wall_origin is never used and bim.align_wall is either just changing the location (align_centerline) or might change object's representation but it's already saved to ifc (exterior/interior).
2024-10-22 18:20:27 +05:00
Andrej730 931e945044 Fix broken centerline alignment hotkey after e8f66ab
Ping @trhyder just in case
2024-10-22 18:20:27 +05:00
Andrej730 5eeea23774 bim.align_product - document 2024-10-22 18:20:27 +05:00
Andrej730 2a44af57d2 bim.align_product.align_type to use enum
to make it less error prone
2024-10-22 18:20:27 +05:00
Andrej730 035b6d00c5 bim.align_wall.align_type - use enum 2024-10-22 18:20:27 +05:00
Andrej730 8372e12f88 deprecate geometry.is_edited
in favor of ifc.is_edited
2024-10-22 18:20:26 +05:00
Andrej730 76869b0b02 deprecate misc.mark_object_as_edited
in favor of ifc.edit
2024-10-22 18:20:26 +05:00
Andrej730 5c08b8f22d bim.resize_to_storey - document 2024-10-22 18:20:26 +05:00
Andrej730 bcf54b643d Hide scale warning for non ifc objects 2024-10-22 18:20:26 +05:00
Andrej730 71c5e83fa0 typing 2024-10-22 18:20:25 +05:00
Andrej730 9eaecdb0a4 black . 2024-10-22 18:20:25 +05:00
Bruno Perdigão 3077687c59 Move product preview logic to its own decorator. 2024-10-22 10:01:50 -03:00
Bruno Perdigão 71997d37c0 Add support for cardinal point in beam and column preview. 2024-10-21 21:51:27 -03:00
Bruno Perdigão acc9e7f706 Adds beam and columns to insertion point product preview. 2024-10-21 16:29:23 -03:00
Bruno Perdigão 5fa5b28484 Allow AddOccurence to use default container elevation value. 2024-10-21 11:10:10 -03:00
Bruno Perdigão 745c8e173a Small fix after 14917d2c3 2024-10-21 10:46:26 -03:00
Bruno Perdigão 14917d2c31 Windows and Doors preview now get the wall rotation. 2024-10-21 10:34:42 -03:00
Bruno Perdigão 340916a5a4 Refactor snapping point selection to add the object name. 2024-10-21 10:34:42 -03:00
Bruno Perdigão 734ac2ba70 Fix issue with using shift + mousewheel while polyline is active. 2024-10-21 10:34:42 -03:00
Andrej730 dbfe3ea3c4 bim.update_representation - error message for objects with openings 2024-10-21 18:05:27 +05:00
Andrej730 c581946fa8 railing, roof - save representation to ifc instead of marking it as edited #5610 2024-10-21 18:05:27 +05:00
Andrej730 492df2310d parametric stair - don't mark object as edited
As representation already saved to IFC and edited_objs seems to be getting less reliable because of the openings.
2024-10-21 18:05:27 +05:00
Andrej730 e8eb3972a1 Support styles without shading styles after 189bcd5
Noticed that after 189bcd5 some representations were missing styles - the ones that are using IfcSurfaceStyle with just IfcExternallyDefinedSurfaceStyle.

Ping @aothms just in case
2024-10-21 16:45:50 +05:00
Andrej730 45b3008b99 bim.edit_style to update representations if Side was edited
Mentioned in #5604. Since IfcSurfaceStyle.Side is used during representation generation, we need to regenerate them if the value was changed. Previously it would require manual update / project reload.
2024-10-21 16:45:50 +05:00
Andrej730 ce6c56cab4 model.workspace - cache is_representation_item
To avoid accessing IFC on every draw call
2024-10-21 14:40:39 +05:00
Andrej730 1d90665c3a split_by_loose_parts to preserve the objects selection
Noticed that bim.assign_class started to loose the objects selection after 29d6d2b
2024-10-21 14:40:39 +05:00
Andrej730 6bfbcb8f92 typing 2024-10-21 14:40:38 +05:00
Andrej730 4acdd7c960 Fix assigning cost item to resource after 97393eb #5601
fyi @myoualid
2024-10-21 11:26:09 +05:00
Richard Brice 647e379c69 Fixes problem with evaluating point on vertical alignment
Fixes evaluation of IfcLine parent curve for IfcGradientCurve. See https://github.com/IfcOpenShell/IfcOpenShell/discussions/5587
2024-10-20 08:19:49 -07:00
Thomas Krijnen 18d5957424 Defensiveness against invalid syntax #5608 2024-10-20 14:17:13 +02:00
Chris Mayo 65ecb92c03 python: Fix ifcopenshell.guid.new()
pyException:

<class 'AttributeError'>: module 'ifcopenshell' has no attribute 'guid'
2024-10-20 14:01:34 +02:00
Bruno Perdigão b8d98b7512 Black format 2024-10-19 11:15:30 -03:00
Bruno Perdigão 97ed3bb0d5 Add product preview for mesh type objects when insertion point is active.
Currently works with doors, windows and furnitures.
2024-10-19 10:57:06 -03:00
Bruno Perdigão 217ada0993 Refactor wall preview for polyline tool. 2024-10-19 10:25:03 -03:00
Chris Mayo dcd6acb1f4 Install cityjson_converter lib and exe
Fixes:

$ IfcConvert
IfcConvert: error while loading shared libraries: libcityjson_converter.so: cannot open shared object file: No such file or directory
2024-10-19 13:48:17 +02:00
Andrej730 122ec6fb0a Use clever Blender length props for editing representation item extrusion depth
Example - https://imgchest.com/p/ljyqzpmwoy2
2024-10-18 18:12:00 +05:00
Andrej730 60837b9512 Operator to save pset as a template
Mentioned in #5596

Example - https://imgchest.com/p/5xy235xvj4l

Adds 2 things:
1) UI indicator whether pset is based on template or not
2) When pset is not based on a template, indicator becomes clickable and works as a shortcut for creating pset template based on the current pset.
2024-10-18 18:11:59 +05:00
Andrej730 ada4a8884b tool.PsetTemplate 2024-10-18 18:11:59 +05:00
Andrej730 a27bdc4e3e Add description to pset template props
As name doesn't seem to be displayed in the enum tooltip
2024-10-18 18:11:59 +05:00
Andrej730 43cecf6c5e Hide 'remove pset template/file' operator when there are no templates/files 2024-10-18 18:11:59 +05:00
Andrej730 4666589fcd bim.add_pset_template to add psets with unique names for convenience 2024-10-18 18:11:59 +05:00
Andrej730 e3ef64d0b3 Fix UI error switching between pset template files 2024-10-18 18:11:59 +05:00
Andrej730 828160c1b1 Fix UI errors if there are no pset template files 2024-10-18 18:11:59 +05:00
Andrej730 832ccff139 fix broken enum after removing pset template/file 2024-10-18 18:11:59 +05:00
Andrej730 17e67fbdaa bim.remove_pset_template_file - note 2024-10-18 18:11:58 +05:00
Andrej730 01b28fde6f remove BIMPsetTemplateProperties.new_template_filename
- as it was only used inside bim.add_pset_template_file operator
- also remove second unnecessary ":" in the prop label (":" is automatically added by Blender)
2024-10-18 18:11:58 +05:00
Andrej730 9130659f71 ifcopenshell.open - readable error if file doesn't exist
Previously it would show obscure error like:

RuntimeError: Type held at index 0 is class Blank and not class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >
2024-10-18 18:11:58 +05:00
Andrej730 e073f11e25 typing 2024-10-18 18:11:58 +05:00
Andrej730 dbd64ebb0e black . 2024-10-18 18:11:58 +05:00
Thomas Krijnen ecba1c3e7b Fix for UVs in python binding #5592 2024-10-18 10:37:53 +02:00
Andrej730 5837a143da bump IOS #5583 2024-10-18 11:55:38 +05:00
Bruno Perdigão 01c67eea48 Fix issue with joining walls with negative direction sense. 2024-10-18 07:49:46 +11:00
Andrej730 0e5008d21e Bonsai daily build tag to include hours and minutes
The problem is index.json is using urls pointing to zip files from the releases and it's possible that installation from unstable repo will be broken (user will get error message like '"Archive size mismatch "bonsai", expected 87417726, was 87418259"') in 2 cases:

1) during 5 minutes after commit while builds are still uploaded to the releases but index.json is not yet updated
2) if some builds were uploaded and some builds failed to upload, then for platforms that were uploaded successfully unstable installation will be broken until we fix the builds

When we add hours and minutes to the tag, that should be enough to make urls unique for each build avoiding this problem. If needed we can came up with some mechanism to clean up all builds besides the last one.
2024-10-17 18:25:08 +05:00
Andrej730 b17eacfa6a typing 2024-10-17 18:25:08 +05:00
Thomas Krijnen a04912e174 Assure edges are emitted in some topological order 2024-10-17 14:35:17 +02:00
Andrej730 ee7fd0cadf Fix issues with unsanitized cache names #5589
Underlay filename wasn't sanitized when saved to 'cache' and when added to .svg but later when it's moved from 'cache' to 'drawings' folder the filename was regenerated using sanitized main .svg filename leading to issues.
2024-10-17 15:10:29 +05:00
Andrej730 5ae75d32bd fix bug in a0e660583 #5585 2024-10-16 21:23:56 +05:00
Andrej730 a0e6605834 support adding parametric roof to object without representations 2024-10-16 18:00:43 +05:00
Andrej730 903e673984 Fix adding parametric geometry operators missing undo step
This also seems to by accident resolve #5565 🤨🤨🤨
2024-10-16 18:00:43 +05:00
Andrej730 a7efdb0bff support adding parametric stair to object without representations 2024-10-16 18:00:43 +05:00
Andrej730 695ab0bfab bump ifc sverchok #5546 #5178 2024-10-16 18:00:43 +05:00
Andrej730 e9e89c1280 remove unnecessary second style reload when disabling style editing 2024-10-16 18:00:43 +05:00
Andrej730 e29f8ce18a clear collections properties for styles when not editing 2024-10-16 18:00:43 +05:00
Andrej730 ee892f63bf Fix bug loading wrong external style #5576
By mistake it was always using currently edited external style, even if external style was not edited anymore and even if it was different style currently edited.
2024-10-16 18:00:43 +05:00
Andrej730 bb8e1866b0 Subscribe to viewport shading changes for appended BIM workspace too 2024-10-16 18:00:42 +05:00
Andrej730 3a5856511d bim.update_current_style - optimization for updating styles for multiple objects 2024-10-16 18:00:42 +05:00
Andrej730 725df97ac0 bim.save_project to preserve relative ifc path #5407 2024-10-16 18:00:42 +05:00
Andrej730 98888d5096 bim.load_project - use_relative_path to override should_start_fresh_session 2024-10-16 18:00:42 +05:00
Andrej730 14d44dcd3e remove ExportIFCBase as it's unused 2024-10-16 18:00:42 +05:00
Andrej730 7f1f249759 typing 2024-10-16 18:00:42 +05:00
Andrej730 3113d62c85 black . 2024-10-16 18:00:35 +05:00
Gorgious56 58b46da04d Fix SHIFT+D shortcut for duplication not working for vanilla non-meshlike objects (eg lights) 2024-10-16 11:56:04 +02:00
Bruno Perdigão db77d06a8a Fix error introduced by b9c6508aa 2024-10-15 23:21:38 -03:00
Dion Moult 4684aa4a55 Fix bug where you couldn't add conditional material psets 2024-10-16 12:26:33 +11:00
Bruno Perdigão b9c6508aa7 Polyline wall ability to switch axis while drawing.
While drawing the polyline the user can press:
- F to flip the wall. Changes the direction sense.
- O to change the offset type between Exterior, Center and Interior. This will change the offset from reference line.

Those attributes can be verified in the Object Materials panels of each wall after they are created.
2024-10-15 21:58:34 -03:00
Bruno Perdigão d7bf8eba02 Fix small issue with the area decorator for the measure tool. 2024-10-15 21:47:42 -03:00
Bruno Perdigão e7a725dca3 Fix #5562 2024-10-15 21:25:16 -03:00
Bruno Perdigão f763e4b0a7 Remove increment snap from the measure tool. 2024-10-15 10:01:25 -03:00
Andrej730 12742bd08c bim.load_project to support relative paths #5407 2024-10-15 17:57:00 +05:00
Andrej730 8940ec7b80 hide non-ifc objects from relating product dropdown 2024-10-15 17:57:00 +05:00
Andrej730 cb2895cc41 util.shape for materials and material_ids 2024-10-15 17:57:00 +05:00
Andrej730 1facba797d aggregate data - small optimization
check for first BBIM_Linked_Aggregate instead of iterating over all rels
2024-10-15 14:30:49 +05:00
Andrej730 a76e802ab4 aggregate module - remove unnecessary ifc operators 2024-10-15 14:30:49 +05:00
Andrej730 afeec29261 Document bim.aggregate_assign_object 2024-10-15 12:34:07 +05:00
Andrej730 6c573445dd More clever object selection for assigning aggregates #5560
Basically those two properties (Relating Whole and Related Part) are now showing only objects that are valid for the assigning an aggregate - https://i.imgur.com/bqQsXhG.png
2024-10-15 12:34:07 +05:00
Andrej730 f17c2eb80e bim.query_linked_element - close db connection manually
otherwise it seems it was never closed (even if you open some other ifc project in current blender session) and .sqlite file is locked from being deleted (at least on Windows)
2024-10-15 11:28:37 +05:00
Andrej730 0888cbb675 small fix 2aeb87b5f 2024-10-14 17:53:12 +05:00
Andrej730 2aeb87b5fe reuse ifcopenshell.util.shape 2024-10-14 17:37:34 +05:00
Andrej730 79c09ae225 Error appending inspected linked element for detailed meshes #5415
Was resulting in error below for meshes with > 1000 face indices (>~333 tris)

last_error: Traceback (most recent call last):
  File "C:\Users\Ryan Schultz\AppData\Roaming\Blender Foundation\Blender\4.2\extensions\.local\lib\python3.11\site-packages\bonsai\bim\ifc.py", line 408, in execute_ifc_operator
    result = getattr(operator, "_execute")(context)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Ryan Schultz\AppData\Roaming\Blender Foundation\Blender\4.2\extensions\.local\lib\python3.11\site-packages\bonsai\bim\module\project\operator.py", line 1858, in _execute
    ifc_file = ifcopenshell.open(queried_obj["ifc_filepath"])
                                 ~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: 'bpy_struct[key]: key "ifc_filepath" not found'
2024-10-14 17:37:29 +05:00
Andrej730 686514b88a fix toggling link visibility after be68a8f #5524 2024-10-14 17:37:29 +05:00
Andrej730 a014cd58e3 fix toggling link selectibility after be68a8f #5524 2024-10-14 17:37:29 +05:00
Andrej730 090c670f04 avoid reimport representation meshes having .001 suffixes 2024-10-14 17:37:29 +05:00
Andrej730 d1b9d9697e document.operator - remove unnecessary ifc operators 2024-10-14 17:37:28 +05:00
Andrej730 fe316e2741 documents ui - hide Name attribute from editing for document references #5542
To avoid invalid ifc.
2024-10-14 17:37:28 +05:00
Andrej730 16553417c1 document.import_references - note about not using Name #5542 2024-10-14 17:37:28 +05:00
Andrej730 fac9444cfd ifc5d - use utf-8 encoding for reading csv files #5561
Same encoding as we use in Ifc5DCsvWriter.
2024-10-14 17:37:28 +05:00
Andrej730 cd8f6e2c78 typing 2024-10-14 17:37:28 +05:00
Andrej730 9e2189fea4 prop_with_search for external styles enum #5569
Ping @Gorgious56 as perhaps you might be interested in this weird case - it seems passing Operator with context_pointer_set makes it OperatorProperties which doesn't have original __annotations__.
2024-10-14 12:23:31 +05:00
Andrej730 5ffef568f7 black . 2024-10-14 12:23:31 +05:00
tim 9ccbd332cf Type Manager fixes
- Corrected the alignment of the Type Manager preview in tool header
- Improved click-ability of the thumbnail icon in the Type Manger preview in the side bar
2024-10-14 11:47:23 +11:00
Ryan Schultz a1fb4d6b81 fix #4051: filter to only show IfcProfileDefs that are attached to IfcMaterialProfiles 2024-10-13 11:24:41 -05:00
Ryan Schultz 2f0500a14b have dimensions like 0 7/8" read like 7/8" 2024-10-13 08:48:21 -05:00
Bruno Perdigão 6f6700db06 Fix bug with mixed snap. 2024-10-11 10:38:15 -03:00
Bruno Perdigão 0235d84f25 Fix small issue with area and length measurement text in polyline tool. 2024-10-11 09:43:23 -03:00
Bruno Perdigão 1225073bef Remove debug print statement 2024-10-11 08:47:39 -03:00
Dion Moult fb714e8fd8 Fix #5482. Reimplement handling of arc detection to allow consecutive arcs. 2024-10-11 21:33:10 +11:00
Dion Moult a0aa5396c9 Purge option for native meshes 2024-10-11 20:18:47 +11:00
Bruno Perdigão 017de3bd59 Fix measurement area text showing in wall polyline 2024-10-10 22:08:19 -03:00
Bruno Perdigão fe5dada256 Fix measurement area text position. 2024-10-10 21:48:11 -03:00
Bruno Perdigão fe0aa4b5b7 Change angle increment for axis snap. 2024-10-10 20:59:57 -03:00
Bruno Perdigão 3a2f29aefc Fix bug in measurement area decorator.
Make input validation accept "m²" and "mm²"
2024-10-10 20:59:57 -03:00
Bruno Perdigão cdaa782c18 Poyline tool - Adds more layers to increment snap base on viewport zoom. 2024-10-10 20:59:57 -03:00
Bruno Perdigão b4d652d12e Fix small issue with snap axis when using measure tool with different planes 2024-10-10 20:59:57 -03:00
Bruno Perdigão 014edcdadc Fix X, Y and Z axis snapping after e673226ea1249a2432ff7b00a7581d750825b544 2024-10-10 20:59:57 -03:00
Bruno Perdigão 3f2efcc846 Fix small issue with increment snap 2024-10-10 20:59:57 -03:00
Bruno Perdigão 095c854d41 Improves angle snapping 2024-10-10 20:59:57 -03:00
Bruno Perdigão dd646d2763 Increment snap now works only for plane and axis snapping. 2024-10-10 20:59:57 -03:00
Dion Moult a32c4ae694 CGAL-Hybrid is now the default. Let's see what happens! 2024-10-11 08:49:42 +11:00
Dion Moult 2e21ec749b Fix #5538. Purge native mesh handling in Blender. This is now obsolete with CGAL-Hybrid. 2024-10-11 08:40:22 +11:00
Thomas Krijnen 189bcd5ad6 Maintain identity and cache styles based on surface-style-shading not styled-item #5486 2024-10-10 16:48:30 +02:00
Dion Moult dc1842dbe8 Fix #5520. Incorrect double calculation of daylight savings and UTC zone. 2024-10-10 22:02:50 +11:00
Dion Moult c75e2e3fc0 Fix failing core tests 2024-10-10 21:36:48 +11:00
Dion Moult 10e76a09de Fix failing MacOS builds 2024-10-10 21:12:35 +11:00
Thomas Krijnen 766f8adce7 nix/build-all propagate BUILD_SHARED_LIBS for -shared build 2024-10-10 09:16:28 +00:00
Dion Moult 47f013fc18 Add support for adding curvelike items 2024-10-10 18:34:20 +11:00
Dion Moult bd42fc9cef Add support for editing curves 2024-10-10 14:45:05 +11:00
Bruno Perdigão 0eb713a7ff Fix #5545 2024-10-09 14:37:04 -03:00
Bruno Perdigão 50c6cbcb2d Polyline tool now shows dimensions for meters and centimeters. 2024-10-09 12:04:45 -03:00
Bruno Perdigão 304db50692 Improved snap hierarchy to allow better face snapping. 2024-10-09 10:41:53 -03:00
Bruno Perdigão 1a55212099 Revert snap stickiness value after changes in increment snap. 2024-10-09 10:28:40 -03:00
Bruno Perdigão ddd17d519e Fix error that was preventing 3d panning while polyline tool is active.
This error was introduced by 48784ba
2024-10-09 10:19:51 -03:00
Bruno Perdigão 481e6b8a8d New implementation for increment snap.
The first implementation was based directly on Blender increment snap.
The new one works just by rounding distance and angle to a better number.
The rounding is still contextual to the window zoom.
2024-10-09 10:14:07 -03:00
Thomas Krijnen d01438e7f1 Retain transform when doing unification in kernel 2024-10-09 13:16:58 +02:00
Thomas Krijnen da0d383666 Distinction between general exception / not supported / not implemented #5484 2024-10-09 13:14:49 +02:00
Thomas Krijnen a38a3ad2fb Fix funky mep geometry #5255 2024-10-09 09:34:52 +02:00
Dion Moult bba862e3ae Fix #5544. Assign / add of objects with styles are now supported. 2024-10-09 18:27:36 +11:00
Dion Moult 11eb1c26f0 Fix #3120. You can now assign styles to individual items. 2024-10-09 18:17:12 +11:00
Dion Moult d09ab54869 Allow reloading of camera geometric representations 2024-10-09 12:26:03 +11:00
Dion Moult aeb00e518b Run black 2024-10-09 12:25:34 +11:00
Dion Moult 844be6bd1c Fix #5231. Remove workaround for missing model-offset in v0.8. 2024-10-09 12:24:25 +11:00
Dion Moult 4f6ca68195 Bump IOS 2024-10-09 11:24:30 +11:00
Bruno Perdigão c33c0b7780 Fix snap to exclude objects that are in a hidden collection. 2024-10-08 18:37:36 -03:00
Bruno Perdigão 7137d95c63 Fix - Mixed snap now gives two snapping points options.
The function was only passing the closest option, but this is not always
the best option. It still defaults to the shortest, but now the user can
select the other option by cycling through snapping points with the "M"
key.
2024-10-08 18:13:24 -03:00
Bruno Perdigão 48784ba834 Polyline tool - user can now change the angle of the snap axis.
- Press "L" while the tool is active to lock axis to the current angle.
- Press "Shift" + "Mouse Wheel" up or down to adjust the angle.

If using with the measure tool it will only work if you have a plane method selected.
2024-10-08 18:13:24 -03:00
Bruno Perdigão fa642e6203 Lower snap axis stickiness. 2024-10-08 18:13:24 -03:00
Bruno Perdigão ee54b3a6f4 Increment snap now works with x, y, z axis snap. 2024-10-08 18:13:24 -03:00
Thomas Krijnen e3223db059 More includes to make gcc happy 2024-10-08 21:04:11 +02:00
Thomas Krijnen b34157e257 Allow returning nativeelement in create_shape() 2024-10-08 20:58:02 +02:00
Thomas Krijnen bfe3601fd1 wkt-use-section option for svg-like occt section cuts instead of polyhedral topology 2024-10-08 20:57:27 +02:00
Kristoffer Andersen cc6249d6cc Add bcf conda-forge badge 2024-10-08 18:26:28 +02:00
Thomas Krijnen 4c2fc55cfe Bring back some v0.7 logic for sweeps over continuous wires #5473 2024-10-08 15:44:51 +02:00
Thomas Krijnen 36a0a0f2dd Work-around for tiny radii sweeps #5474 2024-10-08 14:53:56 +02:00
Dion Moult 89b1f9c2d7 Fix #5527. Unlinking an object should never share its mesh data with IFC elements. 2024-10-08 22:47:22 +11:00
Dion Moult 3c51c6325c Fix #5515. Spaces are now special and have their own collection. Elements in a space don't go inside a space collection anymore.
There can be hundreds of spaces in a building, and generally we use collections for bulk selections (i.e. at the floor level) not for spaces.
2024-10-08 22:35:21 +11:00
Thomas Krijnen fdf4749dd7 Missing include for OSX build 2024-10-08 09:19:29 +02:00
krande 742b3ca120 add ifdef for cgal 6 2024-10-08 09:12:04 +02:00
Dion Moult c85eb79c50 Remove deprecated copy class operator 2024-10-08 17:48:53 +11:00
Dion Moult 1d6b0f781b Fix #5533. Duplicating objects now updates item ids for new item editing workflow. 2024-10-08 17:48:42 +11:00
Dion Moult 32899ebffb Fix #5543. Updating a representation reloads the representation. 2024-10-08 15:45:03 +11:00
Dion Moult 1b321f0747 Fix #5512. Minor fix of console errors in workspace. 2024-10-08 14:32:48 +11:00
Bruno Perdigão 774791cf97 Polyline tool - increment snap now works for imperial units. 2024-10-07 22:28:03 -03:00
Bruno Perdigão c5f27e908a Polyline tool - increment snap implementation. 2024-10-07 22:28:03 -03:00
tim 0f4e4730e2 Progress on Selected Type Preview (#5535)
* Remove length from wall tool

No longer relevant with the new draw method

* Selected Type Preview and Launch Type Manager

Redesign of thumbnail preview

* Update to Type Manager

Moved Create new type to end of paginated loop
Added Predefined type label under thumbnail

* No Types Found

Modified to match Types Manager tiles
Quick Default icon added

* No Types Found

Modified to match Types Manager tiles
Quick Default icon added

* Description in thumbnail linked to value

---------

Co-authored-by: tim <tjrhyder@gmail.com>
2024-10-08 12:24:56 +11:00
Dion Moult 6fb4ce202e Loading shapes now uses the selected geometry library 2024-10-08 12:16:56 +11:00
Dion Moult f66d1bed73 Conveniently preselect object representation template if an object is selected 2024-10-08 12:16:32 +11:00
Dion Moult af3fb78e1b Fix #5526. Fix bug where reloading a representation used by filtered / unloaded elements would fail. 2024-10-08 11:59:04 +11:00
Dion Moult 29d6d2ba97 Fix #5541. Creating an object from a mesh now separates by loose parts to prevent unwanted vertex fusing. 2024-10-08 11:30:40 +11:00
Thomas Krijnen a4226369bd Update type literal 2024-10-07 20:48:58 +02:00
Thomas Krijnen 250fad696e --unify-shapes setting 2024-10-07 20:47:01 +02:00
Thomas Krijnen 461e3d478a Store lowest_z in WKT footprint generation 2024-10-07 20:45:52 +02:00
Thomas Krijnen f3df7b8475 Rerun codegen 2024-10-07 20:43:19 +02:00
Thomas Krijnen aa9b2d7428 populate_derived() upon instance creation, don't only rely on serialization 'hack' #5364 2024-10-07 20:41:34 +02:00
Bruno Perdigão 8e8136ffb6 Fix issue when using "C" to close polyline. 2024-10-07 14:15:42 -03:00
Bruno Perdigão b595eb043e Reverting a change in insert_polyline_point. 2024-10-07 14:07:34 -03:00
Bruno Perdigão 2e6ea4fffb Small fix in polyline input ui decorator. 2024-10-07 14:07:34 -03:00
Bruno Perdigão eef0eb5d43 Bug fix on polyline model decorator when there is no polyline yet. 2024-10-07 14:07:34 -03:00
Bruno Perdigão 9cad7269fd Measure tool - allow for pan, orbit and zoom while tool is active. 2024-10-07 14:07:34 -03:00
Bruno Perdigão 0979c37ba8 Measure tool - center area text horizontally 2024-10-07 14:07:34 -03:00
Bruno Perdigão f9fc563de9 Bug fixes for measure tool in area type with imperial units. 2024-10-07 14:07:34 -03:00
Bruno Perdigão ad74d02165 Measure tool - Removed "Area" from the input UI.
Area is now shows as text decorator since be3354ece063c2c2abcb6f6904df7cd6865dee47
2024-10-07 14:07:34 -03:00
Bruno Perdigão 93457051da Measure tool - show text decorator for polyline area and length. 2024-10-07 14:07:34 -03:00
Bruno Perdigão ce1f1bc394 Bug fix in polyline wall after 95202364a86c8c56f54dde2873b703ac0cc548b4 2024-10-07 14:07:34 -03:00
Bruno Perdigão 0068023c6f Refactor - moved tool/Snap functions that should be in tool/Polyline 2024-10-07 14:07:34 -03:00
Bruno Perdigão 2ea4fc6491 Polyline tool - properties refactor.
Better separation of insertion polyline and measurement polyline
2024-10-07 14:07:34 -03:00
Bruno Perdigão b057f89459 Measure tool - single and area measurement now persist on screen.
Also, the measure polyline properties now stores the area and the total length that will be used by the decorator in later development.
2024-10-07 14:07:33 -03:00
Bruno Perdigão 1a8c11c715 Measure tool - added measurement type to each measurement properties. 2024-10-07 14:07:33 -03:00
Bruno Perdigão cf2a156872 Small refactor. Variable renaming. 2024-10-07 14:07:33 -03:00
Bruno Perdigão 79a8fb1f7f Single measure tool now show x,y and z formatted values. 2024-10-07 14:07:33 -03:00
Bruno Perdigão d4848f26f6 Small refactor 2024-10-07 14:07:33 -03:00
Bruno Perdigão 9b5f20e1dc Initial implementation of measure tool modes: single, polyline and area.
- Single: draws a single measurement that shows the lines and dimensions for x, y and z.
- Polyline: it's how it was already working
- Area: show the area value in the input panel and creates the polygon shape that represents the area. Only works for coplanar points.

The mode can be chosen by clicking the option icon in the workspace menu.
2024-10-07 14:07:33 -03:00
Dion Moult 864cc10b24 Fix #5529. Escape now switches back from item mode to object mode. 2024-10-06 17:34:59 +11:00
Dion Moult 2e7e2d24e4 Fix #5536. Trigger advanced mode by default on large models. Default to unlimited loading, but show warning.
This is a very common complaint: missing elements on large models. It seems as better default is to warn the user that the model is large, but give them the option to filter prior to loading the model.
2024-10-06 17:16:23 +11:00
Dion Moult c10056611b Bump IOS. 2024-10-06 16:13:26 +11:00
Thomas Krijnen 89a078bc50 Test case #5485 2024-10-04 19:12:18 +02:00
Thomas Krijnen 07fda60794 Return edges as planar-component boundaries in CGAL #5485 2024-10-04 19:11:02 +02:00
Andrej730 0935159c42 Restore IFC element menu removed in 23db38d
Example - https://i.imgur.com/1FRgYiQ.png
Restored it until we find some other place for it.
2024-10-04 18:45:40 +05:00
Andrej730 ca9681568c Fix error editing curves based representations #5499
KeyError: 'bpy_struct[key]: key "ios_edges_item_ids" not found'

It's still not possible to edit curve representations, just fixing an error trying to import representation items.
2024-10-04 18:45:40 +05:00
Andrej730 13a6d5b64a Materials UI - suggest MODEL_VIEW context for assigning material style by default
Probably makes more sense than just "Model".
2024-10-04 18:45:39 +05:00
Andrej730 8aa1b68d3e Bonsai - fix issues with default ifcpatch recipe is not loading properly #5540 2024-10-04 18:45:39 +05:00
Andrej730 dc63e989d6 remove try except for ifcpatch import as it's not optional 2024-10-04 18:45:39 +05:00
Andrej730 0cef788a09 Fix console errors after c96c661 (failed to register selection_mode)
Apparently Blender is strict that items should be tuples, not lists. Interestingly enough, though it did failed to register, operator still was working fine.

Example error:
TypeError: EnumProperty(...): expected a tuple containing (identifier, name, description) and optionally an icon name and unique number
ValueError: bpy_struct "BIM_OT_select_container" registration error: 'selection_mode' EnumProperty could not register (see previous error)
2024-10-04 18:45:39 +05:00
Andrej730 38d450e111 Show templates based on selected IFC schema #5530 2024-10-04 18:45:39 +05:00
Andrej730 e5c83b1538 same as 3b71d0050 #5537 2024-10-04 18:45:39 +05:00
Andrej730 9177e19efa Reset proposed property fields after adding custom property #5539 2024-10-04 18:45:38 +05:00
Andrej730 bf9d84e738 typing 2024-10-04 18:45:38 +05:00
Andrej730 2994f5c170 Add a warning if not all project elements were loaded #5536
Example - https://i.imgur.com/Tu3OOIm.png
2024-10-04 18:45:38 +05:00
Andrej730 3107fd91ee Fix issues adding roof and railing representation #5534
Apparently after recent changes with how types are added, it's now required to add a representation for them explicitly instead of just marking them as edited
2024-10-04 18:45:38 +05:00
Andrej730 69781daa6b Materials UI - update material styles data on expanding categories
otherwise style data was missing for materials that were previously hidden
2024-10-04 18:45:38 +05:00
Andrej730 e810dc76e0 Materials UI - support showing styles assigned with IfcPresentationStyleAssignment 2024-10-04 18:45:37 +05:00
Andrej730 cab3fd266d Materials UI - display other styles assigned to material besides IfcSurfaceStyle 2024-10-04 18:45:37 +05:00
Andrej730 62aef09bc7 Fix UI issue when material styles were not reflecting active material #5447
It was reflecting active material but it was only updated when ifc UI data was refreshed (usually after some IFC operators), now it should be always up to date.
2024-10-04 18:45:37 +05:00
Andrej730 2626968a05 materials ui - reuse Material.get_active_material_item 2024-10-04 18:45:37 +05:00
Andrej730 0e6479b090 Show all available styles editing material styles #5525
Previously it would fail e.g. if IfcFillAreaStyle was already assigned to the material but UI was showing errors because enum items contained only surface styles.
2024-10-04 18:45:37 +05:00
Andrej730 7b0a792ff7 bim.merge_identical_objects to support merging IfcMaterials 2024-10-04 18:45:36 +05:00
Andrej730 944e9c45ac black . 2024-10-04 18:45:36 +05:00
tim 99b1f5ec45 Tool header and side panel improvements (#5500)
* Conditions added to show Edit vs Create for each Tool

* Void conditions revised

Apply Voids now only show when number of selected objects ==2, and one of them is a void

* Conditions added to show create vs edit for each tool

example: to edit a wall -> the wall tool must be the active tool and a wall must be selected, to add a wall -> the wall tool must be the active tool and a wall must not be selected

* Extend wall to slab icons added

dark and light mode versions added

* Reset vertex icons added

dark and light mode version added

* Type Manager Preview added

---------

Co-authored-by: tim <tjrhyder@gmail.com>
Co-authored-by: Dion Moult <dion@thinkmoult.com>
2024-10-04 11:02:39 +10:00
Andrej730 3b71d00508 merge_identical_objects - temporarily replace get_info_2 with get_info 2024-10-03 18:37:56 +05:00
Andrej730 c3e4ebd996 bim.merge_identical_objects for merging identical styles
Button location - https://i.imgur.com/3O8gHUn.png

Could also be used as a temporary workaround for #5446
2024-10-03 17:15:34 +05:00
Andrej730 be9c9b2caa fix missing assert statements 2024-10-03 17:15:34 +05:00
Andrej730 306a269061 bim.unlink_style - make it more safe
Even if user decide not to delete style during unlinking, we will create a material copy and relink style to it, so it will be safe to assume that each surface style is always linked to blender material.
2024-10-03 17:15:34 +05:00
Andrej730 392b458563 ifcopenshell.util.element.replace_element 2024-10-03 17:15:34 +05:00
Andrej730 8ae951d27a get_info_2 to support excluding identifier 2024-10-03 17:15:33 +05:00
Andrej730 770e25dbc2 typing 2024-10-03 17:15:33 +05:00
Thomas Krijnen 2c08cff67b Make sure $ chars in TTL are only enclosed in <IRI> not shortened postfixes" 2024-10-03 10:30:53 +02:00
Thomas Krijnen 83c40c7fb4 Don't try to install directories as files (some change in recent cmake?) 2024-10-03 10:30:53 +02:00
Thomas Krijnen 3b9c1d88c8 Handle missing placement location gracefully #5528 2024-10-03 10:30:53 +02:00
Tyler Kvochick 040aec3e52 Derive docker tags from git refs 2024-10-02 17:28:12 +02:00
Thomas Krijnen 8f443a79f3 Merge pull request #5184 from csritter/v0.8.0
Adding --surface-colour in conversion settings to force the use of surface color instead of diffuse color. Issue #5075
2024-10-02 17:24:34 +02:00
Andrej730 3a9598a9d9 bonsai - bim.append_library_element option to skip reusing materials by name
Example - https://imgur.com/PsAPugJ
2024-10-02 18:33:31 +05:00
Andrej730 104b6f5564 append_asset option to avoid assuming unique names for assets #5391 2024-10-02 18:33:31 +05:00
smr02 d5fddd5f1b https://github.com/IfcOpenShell/IfcOpenShell/issues/5511#issuecomment-2388073735 2024-10-02 15:28:58 +02:00
Thomas Krijnen 99ae69f1e4 Don't estimate normal from collinear edges in TTL serializer 2024-10-02 11:12:23 +02:00
Thomas Krijnen b700c5e448 Don't escape $ in TTL output 2024-10-02 11:12:23 +02:00
Andrej730 2a9301ead2 project.append_asset - slight optimization for existing elements search 2024-10-01 18:08:03 +05:00
Andrej730 315d3c6437 ifcopenshell.file.to_string 2024-10-01 18:08:03 +05:00
Andrej730 35f53232b6 typing 2024-10-01 18:08:03 +05:00
Gorgious56 3978226b65 #5514 : Add information as to where to unlock elements in the error tooltip when trying to edit, delelete or move a locked object. Also fix active object / selection discrepancies 2024-10-01 14:14:48 +02:00
Andrej730 c3a6d28927 avoid writing to ifc loading ui elements 2024-10-01 16:50:17 +05:00
Andrej730 0ca3837fc2 update object name changing name from spatial manager #5449 2024-10-01 16:50:13 +05:00
Gorgious56 c96c661394 By default the "Select container" button in the spatial decomposition panel clears current selection before selecting the container. Shift + Click adds the container to selection, ALT + Click removes the container from selection. Added tooltip to the button for keypresses. 2024-10-01 13:38:20 +02:00
Andrej730 a4ac71f9f7 Replace freestyle extension warning with poll message #5472 2024-10-01 16:23:13 +05:00
Andrej730 f63a7d420e style.remove_style to handle IfcFillAreaStyles 2024-10-01 15:38:46 +05:00
Andrej730 19f1c87437 style.remove_style to handle IfcFillAreaStyleHatching 2024-10-01 15:38:46 +05:00
Andrej730 4b39631b98 get_element_by_style to support IfcFillAreaStyleTiles 2024-10-01 15:38:46 +05:00
Andrej730 e040dc4562 get_elements_by_style to support curve styles used in IfcFillAreaStyleHatching 2024-10-01 15:38:45 +05:00
Andrej730 55726b3d50 bonsai - fix breaking ui after style is removed
not sure when this one occurred but ui was breaking since ui blender items were still referring to the deleted ids
2024-10-01 15:38:45 +05:00
Andrej730 f4165d4149 bonsai - fix error removing non-linked styles
including non-ifcsurfacestyle ifcpresentationstyles
2024-10-01 15:38:45 +05:00
Andrej730 b7c390585b ios - fix error removing other IfcPresentationStyles
besides IfcSurfaceStyle
2024-10-01 15:38:45 +05:00
Andrej730 7133b01b76 Count styles based on the current stype type #5462
Previously it was showing number of all IfcPresentationStyles
2024-10-01 15:38:45 +05:00
Andrej730 616a8882d9 bim.load_style - avoid writing to ifc every time 2024-10-01 15:38:45 +05:00
Andrej730 e6e6bd841c project.operator - use pathlib 2024-10-01 15:38:45 +05:00
Andrej730 45ae7634a8 select linked model object when it's loaded 2024-10-01 15:38:45 +05:00
Andrej730 b67be01590 Operator to select link handle
Example - https://imgchest.com/p/md7oxbze97p
2024-10-01 15:38:44 +05:00
Andrej730 06a2c5bf0b Fix linked model decorator not moving for moved linked models (be68a8fdde) 2024-10-01 15:38:44 +05:00
Dion Moult 79b1388e44 Remove Shift-P hotkey 2024-10-01 19:11:40 +10:00
Dion Moult 53765222d6 See #4915. Experimental code for polyhedron without holes 2024-10-01 19:11:08 +10:00
Bruno Perdigão 665afc0375 Wall preview decorator now show tris. 2024-09-30 18:25:09 -03:00
Bruno Perdigão 5129d2016e Fix rebase conflicts 2024-09-30 13:15:19 -03:00
Andrej730 5d83c49fe0 fix saving clash results to bcf #5377 2024-09-30 16:02:52 +05:00
Andrej730 3ad58aba7a ifcclash typing 2024-09-30 16:02:52 +05:00
Andrej730 9131804e4e black . 2024-09-30 16:02:52 +05:00
Thomas Krijnen 6e2e01b460 Fix incomplete swept surface mapping #5484 2024-09-30 12:30:34 +02:00
Thomas Krijnen 5d1dee4480 Apply transformation to swept surfaces in occt advanced brep impl #5484 2024-09-30 12:29:14 +02:00
Thomas Krijnen 62f696da51 Don't handle bspline-edges on planar faces in cgal-kernel #5484 2024-09-30 12:28:28 +02:00
Dion Moult af7bdf6b9f Deprecate type_class in favour of new simpler type manager workflow 2024-09-30 14:04:03 +10:00
Thomas Krijnen 2c22421889 Don't consume token on invalid entity typename #5504 2024-09-29 19:15:29 +02:00
Dion Moult 8a0e87b8f8 Start cleaning up type manager to serve its new purpose as a fancy dropdown 2024-09-29 22:39:21 +10:00
Dion Moult 1bcc7199f6 Redesign BIM tool to have mutually exclusive add/edit modes. 2024-09-29 21:20:17 +10:00
Dion Moult 275d615d42 Shift-A now triggers the wall polyline tool for all LAYER2 elements 2024-09-29 18:11:08 +10:00
Dion Moult 905044f0d7 Shift-A in BIM tools now lets you pick a point interactively. No more 3D cursor requirement.
Still incomplete, but the goal is to not require a "huh?" moment for new users who have no idea what a 3D cursor is.
2024-09-29 17:11:32 +10:00
Thomas Krijnen e2ae2a4a89 Fix negative modelo #5509 2024-09-28 19:44:19 +02:00
Richard Brice abe3d7e5db Fixes problem normalizing IfcDirection direction ratios 2024-09-28 06:19:41 -07:00
Thomas Krijnen dd01cb0e51 BaseUri setting for TTL+WKT 2024-09-28 14:47:08 +02:00
Daniel Bo Olesen 2eecda17e4 Minor updates
Added a debug and run script to the documentation section.  Added a tip and clarifies how to roll back to a previous version, when running unstable release.
2024-09-28 21:48:56 +10:00
Daniel Bo Olesen c45b4372a8 Update writing_docs.rst
Some additions on how to get the local server up and running
2024-09-28 21:48:56 +10:00
Dion Moult 5bb40111c1 Pop up add menu in item mode 2024-09-28 21:22:57 +10:00
Dion Moult faa94eb636 Fix #5466. Support duplicating representation items 2024-09-28 19:39:29 +10:00
Dion Moult 2a6616707c Remove random debug print statements 2024-09-28 17:45:32 +10:00
Dion Moult d1c430cd4d Show clipping plane in front to make it easy to select 2024-09-28 17:35:06 +10:00
Dion Moult a5e6539ddf Support joining representation items 2024-09-28 17:35:06 +10:00
Dion Moult 7bc4b5100b Support separating representation items 2024-09-28 17:35:06 +10:00
Bruno Perdigão 8d08d358af Measure tool persists on screen and can be snapped.
The user has an option to clean previous measurements polylines by pressing "E" while using the measure tool.
2024-09-27 16:48:28 -03:00
Thomas Krijnen 314534436d Add .ttl + Well Known Text geometry serializer 2024-09-27 16:32:47 +02:00
Andrej730 be68a8fdde Support for moving/rotating/scaling for linked models
Example - https://imgchest.com/p/lqye6da2z4d
2024-09-27 19:06:31 +05:00
Andrej730 400ebf2efb bim.append_inspected_linked_element to ensure linked file schema is compatible 2024-09-27 19:06:31 +05:00
Andrej730 0dff19ba6a Project library dropdown - show only libraries compatible with the current schema
To prevent errors trying to append elements from the wrong schema library
2024-09-27 19:06:31 +05:00
Andrej730 24a6ed0e5c Show an error if library file schema is not compatible with the current file
Example - https://i.imgur.com/t1gxBJ4.png ("Schema of library file (IFC4X3_ADD2) is not compatible with the current IFC file (IFC4).")
2024-09-27 19:06:31 +05:00
Andrej730 63ffa1aadb Add upgrade to ifc4/ifc4x3 button to libraries file browser
Example - https://i.imgur.com/cTdwCvt.png
2024-09-27 19:06:31 +05:00
Andrej730 f7bf440848 AbstractKernel::dispatch_curve_creation - use static cast
Similar to 93c4749
2024-09-27 19:06:31 +05:00
Dion Moult 82fd49e4c4 Fix bug when tabbing into empties 2024-09-27 23:14:22 +10:00
Dion Moult 4261fdbed6 Rewrite coordinate offset to use np.array not Vector() for precision 2024-09-27 23:09:00 +10:00
Andrej730 9f02737a2e Fix segfault trying to create IfcSweptDiskSolid with invalid curve #5474
In my case it was IfcIndexedPolyCurve with just 1 vertex. Though kernel->convert does return a boolean value to indicate if conversion was successful, we never used it - so it failed silently leading to segfault later on.
Now we also stop processing those polycurves during mapping stage but checking kernel->convert result still might be useful in some other cases.
2024-09-27 17:00:33 +05:00
Andrej730 fe3b66c044 Stop processing IfcIndexedPolyCurve with < 2 verts at mapping stage #5474
as they're invalid and would't be able to create a curve
2024-09-27 17:00:33 +05:00
Andrej730 14cea7453b Skip failed to load IfcSweptDiskSolid shapes
Noticed in the file attached in #5474 (note that it's not the issue that's causing the segfault), it was failing due IFCSWEPTDISKSOLID's IFCINDEXEDPOLYCURVE having just 1 point, resulting in something like '[Error] [ 14:07:00]  No segment successfully converted: 80=IfcIndexedPolyCurve(79,$)'.

Not sure if this kind of polyline is considered valid in IFC but it doesn't trigger any validation errors, so I guess it shouldn't stop IFC project from loading in BBIM.
2024-09-27 17:00:33 +05:00
Andrej730 cfa2dc5d97 Contexts UI - import Precision as string due problems with Blender UI
Btw this is where you can edit model geometry precision - https://i.imgur.com/CLln0oK.png
Related Blender issue - https://projects.blender.org/blender/blender/issues/128238
2024-09-27 17:00:33 +05:00
Andrej730 123d023bb3 context.operator - remove unnecessary ifc operators 2024-09-27 17:00:33 +05:00
Andrej730 8ff94d3f61 context.data - skip passing unnecessary attributes 2024-09-27 17:00:33 +05:00
Andrej730 3b64350a3f bim.create_shape_from_step_id to include ifc class and id to object name 2024-09-27 17:00:33 +05:00
Andrej730 78302d1583 typing 2024-09-27 17:00:33 +05:00
Dion Moult d93ffb1fe6 See #5491. Clean up orphaned meshes when editing. 2024-09-27 21:59:42 +10:00
Bruno Postle ceeba53c18 Fix linux Associate Bonsai with *.ifc files #5494
The package configuration only included files with extensions, so the
`bonsai` wrapper script was not packaged in the wheel
2024-09-26 22:23:38 +01:00
Andrej730 ecd147675e Ooops, revert wip commit c80c52c248 commited by accident 2024-09-26 22:02:42 +05:00
Andrej730 1cf7f65902 Hide non-simple property types to avoid breaking UI #5496
Property types that are now skipped (at least in IFC4):
<type IfcArcIndex: <list [3:3] of <type IfcPositiveInteger: <type IfcInteger: <integer>>>>> ('list', 'integer')
<type IfcBinary: <binary>> binary
<type IfcComplexNumber: <array [1:2] of <real>>> ('array', 'float')
<type IfcCompoundPlaneAngleMeasure: <list [3:4] of <integer>>> ('list', 'integer')
<type IfcLineIndex: <list [2:?] of <type IfcPositiveInteger: <type IfcInteger: <integer>>>>> ('list', 'integer')
<type IfcPropertySetDefinitionSet: <set [1:?] of <entity IfcPropertySetDefinition>>> ('set', 'entity')
2024-09-26 18:40:52 +05:00
Andrej730 7d8ef3ffd0 Fix invalid IfcRevolvedAreaSolid representations with angle <360 deg
It was always assuming angle is 360 deg
2024-09-26 18:40:52 +05:00
Andrej730 ca5f083481 Fix error trying to tab into IfcRevolvedAreaSolid
by temporary not recognizing reprs with IfcRevolvedAreaSolid as a profile usage
2024-09-26 18:40:52 +05:00
Andrej730 a35304f1d5 lock_object to also lock scales and additional rotations
to indicate that they won't have an effect (or might break things)
2024-09-26 18:40:52 +05:00
Andrej730 c80c52c248 Allow editing poly curve representation items 2024-09-26 18:40:52 +05:00
Andrej730 dd516fb873 Support moving IfcConic representation items
Example - https://imgur.com/a/UDWxXWX
2024-09-26 18:40:52 +05:00
Andrej730 f8680503ef Add default values for IfcEllipseProfileDef 2024-09-26 18:40:51 +05:00
Andrej730 23389dcac0 Update ellipse profile just for consistency with 11deb95 2024-09-26 18:40:51 +05:00
Andrej730 8814d3a22b Lock all representation items that are not movable
Otherwise it was confusing that user can move item but when they exit item mode position was lost
2024-09-26 18:40:51 +05:00
Andrej730 340e8515f5 Fix error switching mode for multiple objects 2024-09-26 18:40:51 +05:00
Andrej730 22b9a8804d notes for loading indexed maps 2024-09-26 18:40:51 +05:00
Andrej730 341b97bce2 typing 2024-09-26 18:40:51 +05:00
Andrej730 24f66bbcb4 black . 2024-09-26 18:40:51 +05:00
Dion Moult a273c87e41 Fix #5416. Optimise item decorator and make decoration more subtle to make it easier to see the mesh. 2024-09-26 23:30:12 +10:00
Dion Moult b01471aa55 See #5491. Don't show items in front. 2024-09-26 23:28:47 +10:00
Dion Moult ebb7f0c8a9 Less in-your-face grid decorations that are easily selectable due to show in front 2024-09-26 23:21:44 +10:00
Ryan Schultz d581174513 Fix #5493: Bonsai, error when using , in drawing names and clicking on the drawing in the sheet part of UI. 2024-09-25 18:36:39 -05:00
Bruno Perdigão 41d5c391e1 Polyline wall - added top and bottom division lines to product preview. 2024-09-25 16:38:33 -03:00
csritter a8157e7dd6 Merge branch 'v0.8.0' into v0.8.0 2024-09-25 11:20:47 -03:00
Andrej730 4e33569851 ifc join to support joining 3d polyline curves 2024-09-25 19:09:15 +05:00
Andrej730 761795ccbf ifc join to show error message if joining is not supported
Example - https://i.imgur.com/5vsmJN8.png
2024-09-25 19:09:15 +05:00
Andrej730 95e9b8aeef Import representation items for curve representations too
https://i.imgur.com/TeITxa0.png
2024-09-25 19:09:14 +05:00
Andrej730 dd9de98290 Store edges representation item ids in Triangulation 2024-09-25 19:09:14 +05:00
Andrej730 aad66f94a3 rename addEdge overload to registerEdgeCount
So it won't be confused with addEdge that actually does add an edge to edges_.
2024-09-25 19:09:14 +05:00
Andrej730 6ac40b4ab3 typing 2024-09-25 19:09:14 +05:00
Dion Moult fce7b4416e Forgot to handle cases where no object is selected when adding a new element 2024-09-25 23:56:18 +10:00
Dion Moult 42f32e3418 Fix #5460. Assigning a class now uses the new add element mode internally. 2024-09-25 23:48:44 +10:00
Dion Moult 47581f2316 Hooray! New add element means we no longer do this silly "add cube" and delete when adding occurrences. 2024-09-25 23:47:18 +10:00
Dion Moult c68c621400 Loading and saving extrusion items now take into account georef cartesian point offsets 2024-09-25 23:03:06 +10:00
Andrej730 61151442cf Merge branch 'bonsai-bump-macos' into v0.8.0 2024-09-25 14:00:17 +05:00
Andrej730 7b36f93973 remove debug logging 2024-09-25 13:59:55 +05:00
Andrej730 5952ce8ed3 disable_item_mode - to set previously edited object as active
It seems very natural that after exiting item mode the edited item should become active (similar to how it works in edit mode).
2024-09-25 13:59:55 +05:00
Andrej730 3c309bbac8 load_indexed_colour_map - to support loading colors for rep items
Enter item mode for simple faceset cube was failing because this wasn't supported.
2024-09-25 13:59:55 +05:00
Andrej730 3e3b133c7b black . 2024-09-25 13:59:55 +05:00
Andrej730 0af2ab53a0 bonsai makefile update regex to keep track of x86_64 version automatically 2024-09-25 13:45:37 +05:00
Andrej730 700a453501 fix breaking bonsai builds - bump macos to 10.13 for python 3.12
Recently released Python 3.12.6 dropped support for Mac OS 10.9-10.12 - https://www.python.org/downloads/release/python-3126/

And Python 3.12.6 is the one that's used by compiled builds from now - in our case it was fonttools (used by ezdxf) that compiled binaries and it's using cibuildwheel which is also started using Python 3.12.6 as it's released.
2024-09-25 13:45:32 +05:00
Jason Hilton e45b41c04b fix: compile errors qt app
I was able to hardcode load an ifc file, by uncommenting the hard
coded parse ifcfile, but I was unable to open and load files with the
qt menu.
2024-09-25 10:22:14 +02:00
Dion Moult 86367e9c1f Loading and saving meshlike items now take into account georef cartesian point offsets 2024-09-25 17:46:59 +10:00
Dion Moult 9af9120dff Fix bug where switching representations didn't take into account georef cartesian point offsets 2024-09-25 17:46:15 +10:00
Dion Moult dc5e3d86b4 Lazy optimisation to prioritise styledbyitem instead of indexed maps. Allow blank data_index in case we have multiple rep items. 2024-09-25 13:00:14 +10:00
Daniel Bo Olesen 4472578915 Changed tools tips for commands. 2024-09-25 11:59:01 +10:00
Dion Moult 9ede6a693d See #5475. Fix quoting in dev script and default to Github repo. 2024-09-25 11:26:43 +10:00
Dion Moult 7584a40219 Fix #5483. Units is optional when loading. 2024-09-25 11:13:09 +10:00
Dion Moult 1d4f5de4a0 Fix #5475. Quote paths to accommodate spaces in dev setup. 2024-09-25 10:39:12 +10:00
dylcos fa92d3bd59 Update code_examples.rst
Replaced "product=wall" with "products=[wall]" in:
# Place our wall in the ground floor
ifcopenshell.api.spatial.assign_container(model, relating_structure=storey, products=[wall])
As code example fails otherwise
2024-09-25 09:36:25 +10:00
Bruno Perdigão d868eeb77d Updates on polyline decorator to match standard colors. 2024-09-24 17:30:34 -03:00
Bruno Perdigão 083a1e4074 Small fix in polyline decorator. 2024-09-24 13:55:14 -03:00
Bruno Perdigão ef5dc58b91 Fix some cases where wall joining were not working after they were created by polyline tool. 2024-09-24 13:47:21 -03:00
Bruno Perdigão c4232e7407 small fix on 36b4225b1 2024-09-24 11:40:47 -03:00
Andrej730 209c0fef57 restore lost code after a1d99b5 2024-09-24 19:30:17 +05:00
Andrej730 d4bc34dea7 ifc2sql - remove debug print statements 2024-09-24 19:30:08 +05:00
Andrej730 0ce92587bf ifc2sql - add test 2024-09-24 19:30:08 +05:00
Andrej730 56de208470 ifcopenshell.sql - add simple test 2024-09-24 19:30:08 +05:00
Andrej730 266416226b ifcopenshell.sql - repr for entities 2024-09-24 19:30:08 +05:00
Andrej730 810f42ea24 ifc2sql - clarify how output works in docs, add a suffix to temp file 2024-09-24 19:30:08 +05:00
Andrej730 21dd5054e6 ifcopenshell.sql - fix error in by_id method
it was fetching some random row from id_map instead of using ifc_id filter
2024-09-24 19:30:07 +05:00
Andrej730 08e221fe93 ifcopenshell.sql - garbage collection errors (same as fe1dff0191) 2024-09-24 19:30:07 +05:00
Andrej730 c7e97d06bd ifcopenshell.sql - fix error opening files similar to #5457 2024-09-24 19:30:07 +05:00
Andrej730 46cc3a449a ifcopenshell.sql - handle non existing files
previously it would create an empty database and give a confusing error "AssertionError: SQLite schema not supported."
2024-09-24 19:30:07 +05:00
Andrej730 9e86d83616 ifcopenshell.sql - typing 2024-09-24 19:30:07 +05:00
Andrej730 2829b7daf6 ifcopenshell.stream - remove unrelated code from ifcopenshell.sql 2024-09-24 19:30:07 +05:00
Andrej730 86ec618327 ifcopenshell.stream - add simple test 2024-09-24 19:30:07 +05:00
Andrej730 9a23daf7b3 stream - add support of crlf files 2024-09-24 19:30:07 +05:00
Andrej730 4e3d6f1773 typing 2024-09-24 19:30:07 +05:00
Andrej730 7045fba9c0 black . 2024-09-24 19:30:00 +05:00
Bruno Perdigão 36b4225b18 Warning messages for prohibit cases when inserting polyline points 2024-09-24 10:55:59 -03:00
Bruno Perdigão b05e6cf71a Small fix 2024-09-24 10:55:54 -03:00
myoualid 7692b910f4 loading multiple cost schedules in the web ui is now more responsive, clean up and organise css code #5369 2024-09-24 12:13:18 +01:00
Thomas Krijnen 0c70d4c828 Manually detect facet boundary intersections before triangulation #5470 2024-09-24 13:09:30 +02:00
Thomas Krijnen 11deb955f8 Fix ellipse major < minor workaround #5470 2024-09-24 13:09:30 +02:00
Dion Moult 036754ea20 Bump IOS to OCC 7.8.1 2024-09-24 18:50:07 +10:00
Thomas Krijnen 2557fcf628 Do let cgal handle planar adv brep #4915 2024-09-24 08:54:52 +02:00
Dion Moult 4bee80edc5 Optimise array setup during load 2024-09-24 15:31:55 +10:00
Dion Moult d1c4a0a415 Check walls first for false origin guessing for speed, checking one object seems to be enough 2024-09-24 15:31:37 +10:00
Dion Moult f92a02cfcb Fix regression in speed in collection assignment
As hinted in the TODO note for linking collections safely, try-catch is actually much faster. This brings it to 10% faster than 0.7 speeds. Previously the regression made it 10x slower.
2024-09-24 14:54:25 +10:00
Dion Moult ff5c402750 Optimisation for not iterating through things with no representations
Iterator initialise can take a few seconds on large models even though you're just doing a few elements which have no representations.
2024-09-24 14:54:25 +10:00
Bruno Perdigão 2151035afd Small fix in Raycast function ray_cast_by_proximity. 2024-09-23 22:46:36 -03:00
Bruno Perdigão cc11c43240 Fix raycast to detect objects with partial visibility in the scene. 2024-09-23 22:37:37 -03:00
Bruno Perdigão 7339325cc9 Fix #5464 2024-09-23 22:25:28 -03:00
Bruno Perdigão 3c2a0c9bf3 Fixed issue with polyline inserting point at world origin (0, 0, 0). 2024-09-23 17:13:57 -03:00
Bruno Perdigão 98d767988e Added support to snap on empty objects. 2024-09-23 17:04:42 -03:00
myoualid 7b2a30e5b7 web-ui: fix classifications file navigation 2024-09-23 20:41:26 +01:00
myoualid 455012de4c cost web ui:
- add "Linked rate" column,
- assign a cost rate to multiple cost items by selecting linked rate cells & clicking the "assign" button on the chosen cost rate
#5369
2024-09-23 20:19:06 +01:00
Andrej730 ab8a6b80e4 debug module - remove unnecessary ifc operators 2024-09-23 19:33:36 +05:00
Andrej730 acd1b165f8 bim.create_shape_from_step_id to support different geometric libraries 2024-09-23 19:33:29 +05:00
Andrej730 fe1dff0191 ifcopenshell.stream - fix garbage collection errors
Mentioined in #5457

Errors such as:
Exception ignored in: <function file.__del__ at 0x7f4cfcc9f920>
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/ifcopenshell/file.py", line 284, in __del__
    del file_dict[self.file_pointer()]
                  ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/ifcopenshell/file.py", line 444, in __getattr__
    return getattr(self.wrapped_data, attr)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'file_pointer'
2024-09-23 19:33:28 +05:00
Andrej730 08bba92b2e fix opening ifc files with streaming #5457 2024-09-23 19:33:28 +05:00
Andrej730 7e6be53237 Improve error messages for shapes failed to process
Example error messages now:

RuntimeError: Failed to process shape. Product: #3855=IfcSite('3ZGD7y6S5209$mGLi_sPll',#20,'Surface:411452',$,$,#3854,#3850,$,.ELEMENT.,(42,12,46,799999),(-71,-2,0,-599999),0.,$,$), representation: #3849=IfcShapeRepresentation(#93,'FootPrint','Curve2D',(#3841,#31427,#31471,#45600,#45628))

RuntimeError: Failed to process shape. Instance: #3841=IfcPolyline((#3800,#3801,#3802,#3803,#3804,#3805,#3806,#3807,#3808,#3809,#3810,#3811,#3812,#3813,#3814,#3815,#3816,#3817,#3818,#3819,#3820,#3821,#3822,#3823,#3824,#3825,#3826,#3827,#3828,#3829,#3830,#3831,#3832,#3833,#3834,#3835,#3836,#3837,#3838,#3839,#3840,#3800))
2024-09-23 19:33:28 +05:00
Andrej730 c6c9f400d3 BBIM Parametric psets - show warning when user edits them manually
as they are not intended to be edited manually but through the special ui

example - https://i.imgur.com/nsuy0I0.png
2024-09-23 19:33:28 +05:00
Andrej730 2b35e5fb91 Make parametric doors/windows available for ifc2x3 2024-09-23 19:33:28 +05:00
Andrej730 e7dd186349 Fix roof tooltip in templates 2024-09-23 19:33:27 +05:00
Andrej730 0091f5c09b Simplify spatial elements sorting 2024-09-23 19:33:27 +05:00
Andrej730 c33e2fc689 Fix #5320 2024-09-23 19:33:27 +05:00
Andrej730 df055cefd4 typing 2024-09-23 19:33:27 +05:00
Andrej730 65f9a745a3 black . 2024-09-23 19:33:27 +05:00
Thomas Krijnen a51ed6e6b3 Fixes for using hybrid kernel on non-products #5443 2024-09-23 16:18:00 +02:00
Gorgious56 aaf5fde92e Fix error when the "Add Parametric Window" button is drawn 2024-09-23 16:03:34 +02:00
Thomas Krijnen 0389f1e984 Make cgal implementation a little bit less confident #5453 2024-09-23 16:03:10 +02:00
Dion Moult 84ceb11584 Minor fix 2024-09-23 23:55:15 +10:00
Dion Moult 0426c8e115 Adding an occurrence of a non-geometric type now lets you choose the type of geometry to add 2024-09-23 23:49:34 +10:00
Thomas Krijnen a9ca4e7366 Mark status when parsing is terminated 2024-09-23 15:24:28 +02:00
Thomas Krijnen e4d1118124 Manually write out if-statements instead of visit with if-constexpr #5444 2024-09-23 15:10:37 +02:00
Gorgious56 f2efa53fdf Fix #5456 : Unbound variable error when no snap decorator is drawn 2024-09-23 11:34:35 +02:00
Dion Moult 23db38d0e9 Finally, a way to actually add an IFC element directly
Previously, the way to add an IFC element would be to 1) create a blender element then assign or 2) activate bim tool, launch type manager, click create type, fill out field, or 3) using various menus for parametric stuff like stairs. This is now the new proposed way to do things and everything will consolidate to here - and it allows you to directly create non-mesh geometry immediately too!
2024-09-23 18:21:44 +10:00
Dion Moult 194acb078c See #3707. See #5445. Type now launches type manager, and type manager icons are clickable.
Previously you could either use the dropdown, or launch the type manager, but now they are one and the same, and more inuitive to click icons.
2024-09-23 18:18:44 +10:00
Dion Moult c30ac2d061 Slightly more accurate loading time to include initialisation time 2024-09-23 18:14:52 +10:00
tim 621393e67a Toggle openings typo 2024-09-23 18:13:24 +10:00
tim 2386b935aa Toggle openings icons
renamed png files to match operator name
2024-09-23 18:13:24 +10:00
tim 0071fa515a Apply void icons
This is a temporary fix
2024-09-23 18:13:24 +10:00
Thomas Krijnen 154059126c Update build-all.py - reset --hard before checkout 2024-09-23 09:16:24 +02:00
Thomas Krijnen 4c048e4695 Update face.cpp - snail artefact on 7.8 as well #4924 2024-09-23 09:12:10 +02:00
Thomas Krijnen 4ce3413cdf Update build-all.py - fetch before checkout 2024-09-23 06:52:49 +02:00
myoualid 33d8ecdc8b smart copy paste option for cost schedules in web ui - #5369 2024-09-23 03:21:15 +01:00
myoualid 193daff617 web-ui: enable assigning parametric quantities from queries #5369 2024-09-23 02:21:15 +01:00
myoualid 9f542c30b3 cost module web ui:
- add setting options to hide/show columns
- Cost classification column
- New Cost Classification Form to display active classification library, add/delete classification references
2024-09-22 20:00:09 +01:00
Manu Varkey a053472558 Fixes #5320 2024-09-22 22:19:49 +10:00
Dion Moult 14fe3e6150 Rewrite mode switching from object to item to edit modes 2024-09-22 22:17:07 +10:00
mrfcoelho df494a3def Update create_model.rst
Fix minor typo
2024-09-22 08:32:20 +10:00
mrfcoelho ff7c7932e1 Update installation.rst
Fix broken link
2024-09-22 08:32:06 +10:00
Dion Moult 9ea44f0a89 You can now add new swept area solid items 2024-09-21 21:27:17 +10:00
Dion Moult ce010f1e56 You can now add new mesh representation items 2024-09-21 16:34:41 +10:00
Dion Moult 2a8d43c42c Basic editing of item attributes implemented 2024-09-21 14:27:17 +10:00
tim ef412c36c6 Cancel and Apply buttons (#5435)
* Cancel button added back in, Green apply replaced with CHECKMARK

* 2-point arc icon added

---------

Co-authored-by: tim <tjrhyder@gmail.com>
2024-09-21 13:48:33 +10:00
myoualid 8c4ab5bf03 enable displaying schedule of rates - web ui ref #5369 2024-09-21 00:16:11 +01:00
Thomas Krijnen e0095cd446 occt 7.8.1 #4924 2024-09-20 20:49:22 +02:00
Gorgious56 ea3f5cea1f Fix parametric stairs not appearing in the type manager templates 2024-09-20 20:26:03 +02:00
Andrej730 a3c0523fbd Fix #5432 2024-09-20 22:56:59 +05:00
Andrej730 c819368445 code_style.rst - some notes on black formatting 2024-09-20 22:11:15 +05:00
Andrej730 287f08dc7b bim.print_unused_elements_stats to ignore IfcIndexedTextureMap 2024-09-20 22:03:20 +05:00
Andrej730 5ce9d21dff Purging styles to also purge associated blender materials #3914 2024-09-20 22:03:19 +05:00
Andrej730 d4df21c4be ifcopenshell.util.shape.get_normals 2024-09-20 22:03:19 +05:00
Andrej730 95e76c3ab9 bsdd classes - typing for not required attributes 2024-09-20 22:03:19 +05:00
Andrej730 18476ec7f3 bsdd - update classes according to the latest API
Also added yml_to_classes.py script that can extract the classes automatically
2024-09-20 22:03:19 +05:00
Andrej730 aeeae7365f load bsdd classes recursively if query fetches more than 100 items
previously it would just hit the limit 100 and stop
2024-09-20 22:03:19 +05:00
Andrej730 9953ce1b39 typing 2024-09-20 22:03:19 +05:00
Andrej730 d7adec3d54 black . 2024-09-20 22:03:19 +05:00
myoualid e0e9892ff0 cost module web-ui:
- remove Blender operators in favor of ifc.api functions
- replace BonsaiBIM Data class dependency with new ifc5D2json script
- enable viewing multiple cost schedules
- add Identifaction column
ref #5369
2024-09-20 16:26:40 +01:00
tim e8f66abf17 New and updated icons for CAD and BIM workspace
* Updates to some icons, new icons added for CAD tools, and new layout for CAD tools

* updates to icons

* WIP changes to BIM Tool UI

* Separated BimToolUI,  added Draw wall icon

Separated BimToolUI into AddElementUI and ModifySelectedUI classes, added Draw wall icon

* Voids back in UI

* WIP UI tools and icons

partial support for draw wall tool added

* 40d95c294 WIP UI tools and icons

Minor tweaks

* WIP on profile-axis-ui

* WIP on profile-axis-ui

* Added Merge, Split, Rotate, and Flip back into wall edit tools

* Separators added

* Restore commented out code in CAD workspace.py

---------

Co-authored-by: tim <tjrhyder@gmail.com>
Co-authored-by: Dion Moult <dion@thinkmoult.com>
2024-09-20 22:16:40 +10:00
mrfcoelho 560983c6b8 Update interface.rst
Add minor tip to be able to see all the workspaces when the screen size is small.
2024-09-20 21:55:06 +10:00
Gorgious56 07291022b4 Fix purging types in the type manager not working. The purge button is now in a menu for a cleaner interface and avoiding accidentally clicking on it when opening the type manager. 2024-09-20 12:09:55 +02:00
Andrej730 6d94871683 Attribute.data_type -> EnumProperty (+typing) 2024-09-20 13:17:41 +05:00
Andrej730 774db8e997 sort wheel files list in manifest 2024-09-20 13:17:27 +05:00
Manu Varkey 31d49a7bbc Update drawing shadow settings for consistentency 2024-09-20 18:10:26 +10:00
Dion Moult 542ae6b44a Basic support for editing swept profiles and positions 2024-09-20 18:08:16 +10:00
Gorgious56 c1a92bf1f3 Fix #5398 : Only show relevant parametric templates in the type manager. Also fix forgotten line in previous commit. 2024-09-20 09:58:26 +02:00
Gorgious56 a8abc8e379 Fix #5333 : Searching for the class name using the looking glass button doesn't close the type manager anymore. 2024-09-20 09:53:00 +02:00
Andrej730 4f64d044ac Option to assign non-ifc bsdd properties #5404
Example - https://imgur.com/a/cPtEkX2

Also Attribute now has additional field "metadata" for storing some case specific data
2024-09-20 12:34:27 +05:00
Andrej730 1f4d973a79 black . 2024-09-20 12:34:26 +05:00
Dion Moult bfd5b3c1c7 Increase websocket server limit from 1MB to 10MB to allow for larger datasets like large work schedules. 2024-09-20 17:03:46 +10:00
Dion Moult 8866a34f22 Fix #5408. Use an angular tolerance of 0.1 degrees to determine if something has moved and need resyncing. 2024-09-20 17:03:00 +10:00
Andrej730 669d88fbb1 sequence - fix all import operators missing Ifc operator #5423 2024-09-20 11:14:34 +05:00
Andrej730 7470fb0786 sequence - remove unnecessary Ifc operators 2024-09-20 11:14:34 +05:00
Andrej730 b6fca3916e assigning process to control - add an error message 2024-09-20 11:14:34 +05:00
Andrej730 5373c7ee9e sequence import/export - add info message when operator finished 2024-09-20 11:14:34 +05:00
Manu Varkey f708d9cb4d Support natural sorting of types closes #5050 2024-09-20 09:20:03 +10:00
Andrej730 f1f055d19d Restore missing dev docs after 53d7624 2024-09-19 18:56:45 +05:00
Andrej730 e175de5365 Fix misleading docs urls after 53d7624 2024-09-19 18:56:45 +05:00
Andrej730 31befd424b Fix documentation missing dev env scripts
Mentioned in #5398
2024-09-19 18:56:45 +05:00
Andrej730 394b24ddfe More realistic test for ca8577a8dd 2024-09-19 18:24:37 +05:00
Andrej730 f184ce5386 Support de08d3726e for ifc2x3 #5420 2024-09-19 18:13:14 +05:00
Andrej730 b7d725254d Temporarily revert 51211dc527 to fix broken bonsai builds #4924
Need to not to forget to revert a revert later...
2024-09-19 17:30:10 +05:00
Andrej730 c9f9cf89e8 file -> import/export - add poll messages in case ifc is not loaded 2024-09-19 17:21:51 +05:00
Andrej730 fb6d2b8de2 pp2ifc - preserve original ids
Now we're going to use bar ids instead their detalization ids (e.g. expanded task ids, task ids, milestone ids) because it is the way how it works in the software pp file originates from.
2024-09-19 17:21:51 +05:00
Andrej730 ddca950f65 pp2ifc - save calendar identification for pp file to ifc 2024-09-19 17:21:51 +05:00
Andrej730 96756d63d4 pp2ifc refactor and add support for more languages #5417 2024-09-19 17:21:50 +05:00
Andrej730 a5b3c9beb4 black . 2024-09-19 17:21:50 +05:00
Gorgious56 1974974071 Fix #5410 : bim.enable_adding_presentation_style no longer throws an error in a file with no ifc project when launching the search operator (F3) 2024-09-19 14:03:56 +02:00
Manu Varkey 4225643bc0 Disable blf shadow setting after use. Fixes #5387 2024-09-19 21:49:58 +10:00
Dion Moult 4b7bb1533e Fix #5394. Fix bug when switching fillings where the current representation was not the body representation. 2024-09-19 16:25:33 +10:00
Dion Moult d3fdbf4dae (Un)Bump IOS - downgrade due to critical bugs with OCC 7.7 2024-09-19 11:12:11 +10:00
Dion Moult 5d0fb18ea1 Fix #5395. Apparently wheels exclude directories with no files in them, so the cache folder wasn't shipped. 2024-09-19 10:59:32 +10:00
myoualid 45708ee287 Cost module web UI:
- quick button to add a SUM cost value
- style improvements
2024-09-18 20:34:31 +01:00
Thomas Krijnen 116a0f1a02 Add test 2024-09-18 19:28:55 +02:00
Thomas Krijnen 2554280e50 triangulation-type setting for non-triangulated polyhedral from iterator 2024-09-18 19:28:07 +02:00
Andrej730 748fcce3f5 Adding classification reference tests 2024-09-18 18:44:34 +05:00
Andrej730 5b2733bb3c add classification reference from bsdd - support ObjectType
it seems in bsdd some ObjectType is also provided using "undefined_set" pset
example - https://identifier.buildingsmart.org/uri/ifcairport/ifcairport/1.0/class/ifcairport0000000004
2024-09-18 18:44:34 +05:00
Andrej730 115a48fc1a bsdd - fix bug when loading pset would set properties in incorrect way
It was using name instead of propertyCode which was leading to assigning incorrect properties...
2024-09-18 18:44:34 +05:00
Andrej730 06d927f8bb bsdd operators descriptions and naming 2024-09-18 18:44:34 +05:00
Andrej730 de08d3726e Bonsai - set active bsdd when loading project
When loading an ifc project it will search it for bsdd ifcclassifications and will set one as active if finds it, so now it will be a bit more convenient working with bsdd classification assignment as it active bsdd previously was always getting reset when you reload ifc file.

Example - https://imgur.com/a/stlJqwm
2024-09-18 18:44:34 +05:00
Andrej730 4dbfeefe53 Fix UI errors getting elements using qset in IFC2X3
In IFC2X3 IfcQuantitySet didn't existed yet
Mentioned in #5404
2024-09-18 18:44:33 +05:00
Andrej730 eb823a5ecd bsdd search to check whether query is long enough
It's an API requirement and using shorter queries was giving confusing results.
https://github.com/buildingSMART/bSDD/blob/master/Documentation/bSDD%20OpenAPI.yaml
2024-09-18 18:44:33 +05:00
Andrej730 8f7949808a Move id to IfcGeom::Representation::Representation and document it
as it's a common attribute for all 3 Representation subclasses we have
2024-09-18 18:44:33 +05:00
Andrej730 5860c3fe50 black . 2024-09-18 18:44:33 +05:00
Dion Moult dbfa4ecf65 Fix minor regression in fe0be0c 2024-09-18 22:58:22 +10:00
Dion Moult 1320eac800 Switch representation now cleans up orphaned meshes itself so callers don't need that responsibility 2024-09-18 22:58:22 +10:00
ArturTomczak 81e4ad2ce2 handle numeric simpleValue (#5376)
The input value can be a string or number, but 1.0 schema only accepts strings. The processing of int and float was missing. The casting to string might no longer be needed in IDS 1.1. https://github.com/buildingSMART/IDS/issues/342
2024-09-18 21:42:31 +10:00
Dion Moult 736d91f38e Shape builder now supportes meshy things and faceted breps 2024-09-18 21:35:40 +10:00
Dion Moult a1d99b544a Basic support for deleting items, and editing meshlike items 2024-09-18 21:35:40 +10:00
Dion Moult ed530f737c Remove deprecated code for fixed bug #2002. 2024-09-18 21:35:40 +10:00
Dion Moult 0899a2a87b Fix bug where switching geometry may not correctly share representations 2024-09-18 21:35:40 +10:00
Thomas Krijnen 3bdbb3d513 Don't import cwd ifcopenshell folder when running tests 2024-09-18 11:35:24 +02:00
Andrej730 e22ec57e16 Fix #5409 2024-09-18 13:56:06 +05:00
Dion Moult 9b06797efa Fix crash when removing representation item with removed inverses 2024-09-18 17:35:51 +10:00
Dion Moult 96ba8e8e29 Fix bug where dissolving edges created corrupted geometry for advanced breps with curved surfaces 2024-09-18 17:34:41 +10:00
Bruno Postle 6e9e270683 IfcGit don't switch colouring so much closes #5402
Viewing changes necessarily sets object colours and switches the
viewport to object colouring.  Previously most other operations switched
the viewport 'back' to material colouring. This was an annoyance for
users whose workflow makes use of manual object colouring.

Now only operators that reload the model (revert, switch and merge), the
refresh button, and attempting to view changes with the current revision
switch to material colouring.
2024-09-17 23:34:04 +01:00
Andrej730 53a6192858 Skip loading mappings if representation has openings #5405
To avoid errors
2024-09-17 18:25:59 +05:00
Andrej730 2a2efefac3 IfcSchema declaration_by_name to be safe
Couldn't find if we actually use it anywhere in the code but better to keep it safe, especially because it's exposed to Python and by accident user might provide some too bit integer instead of a string.
2024-09-17 16:28:02 +05:00
Andrej730 a7cac5c77b IfcWrap cmake - regenerate .py and .cxx on changes in ifcopenshell libs
Previously they wouldn't be regenerated unless you edit .i files or manually remove .py/.cxx.
2024-09-17 16:28:01 +05:00
Andrej730 1575696a8b ifcwrap cmake - use default CMP0078 policy
Something weird happened during merge in 7d90c31 and changes from 0055a5d were not applied
2024-09-17 16:28:01 +05:00
Thomas Krijnen 555eb44f00 Add IfcAlignmentSegments to XML output 2024-09-17 13:07:33 +02:00
Thomas Krijnen 0b555b30d2 Add IfcAlignmentSegments to XML output 2024-09-17 13:03:25 +02:00
Andrej730 06f14774f7 Avoid more unnecessary calls to docs api
Noticed that prop_value could be other types besides str (e.g. int when using context menu on UIList item) and we can skip them to avoid redundant api calls.
2024-09-16 18:54:13 +05:00
Andrej730 11ddcb0256 IfcSchema declaration_by_name to use size_t instead of int
By accident noticed that `declaration_by_name(-1)` crashes python. If we use size_t it will just throw an error like below

NotImplementedError: Wrong number or type of arguments for overloaded function 'schema_definition_declaration_by_name'.
  Possible C/C++ prototypes are:
    IfcParse::schema_definition::declaration_by_name(std::string const &) const
    IfcParse::schema_definition::declaration_by_name(size_t) const
2024-09-16 18:54:13 +05:00
Andrej730 0d77ff5270 remove debug code 2024-09-16 18:54:13 +05:00
Andrej730 c75fa70d23 Support for loading face colors from ifc (IfcIndexedColourMap)
example - https://imgur.com/a/l8Yn4Rr
2024-09-16 18:54:13 +05:00
Andrej730 6d8ffc27cc ifcopenshell.util.shape.get_material_colors 2024-09-16 18:54:13 +05:00
Andrej730 531327578f bim.print_unused_elements_stats - to skip colour map 2024-09-16 18:54:12 +05:00
Andrej730 6a47e68b78 fix typo 2024-09-16 18:54:12 +05:00
Andrej730 5ec10018d9 bim.purge_unused_elements_by_class - skip IfcRepresentationContext 2024-09-16 18:54:12 +05:00
Andrej730 ec0094ef33 bim.purge_unused_elements_by_class - keep list sorted 2024-09-16 18:54:12 +05:00
Andrej730 a2c2cf65a1 bim.purge_unused_elements_by_class - make filepath argument optional 2024-09-16 18:54:12 +05:00
Andrej730 cfd63392e7 Add to recent projects when project is saved 2024-09-16 18:54:12 +05:00
Andrej730 0891df5d6c typing 2024-09-16 18:54:12 +05:00
Bruno Postle cf95c9151c black formatting after 71de39e 2024-09-15 17:34:44 +01:00
Bruno Postle 71de39ea7c Recover external git repo changes, fixes #5311
IfcGit didn't cope gracefully when commits and/or repositories vanished
unexpectedly
2024-09-15 17:24:36 +01:00
Andrej730 c487643d76 ifcgit - fix errors if paths are mixing up slashes and backslashes
`repo.path` is always setup using current platform type of slashes since it's normalized by get_path_dir but when we pass a path to index.add it's not normalized leading to errors
2024-09-14 11:41:58 +05:00
Andrej730 6dbfb3afb3 black format 2024-09-14 11:41:58 +05:00
Bruno Perdigão aa3a362391 Fixed issue in polyline tools where orbit and pan where not updating the ray cast. 2024-09-13 17:35:08 -03:00
Bruno Perdigão a2cf95038a Custom snap symbols #5325. 2024-09-13 17:34:08 -03:00
Bruno Perdigão 96f3ee2f3a Added text background to polyline measurements. 2024-09-13 15:38:05 -03:00
Bruno Perdigão 1659498c88 Fix 'C' to trigger wall preview 2024-09-13 14:08:18 -03:00
Bruno Perdigão a992844e93 Fix enter to trigger wall preview 2024-09-13 13:50:27 -03:00
Bruno Perdigão 59b665758d Colors update in polyline decorators. 2024-09-13 12:38:35 -03:00
Bruno Perdigão 4dc8a27e82 Fix on polyline wall preview when dealing with closed loops. 2024-09-13 12:38:35 -03:00
Bruno Perdigão e83bdcc820 Polyline tool - Wall preview is now working for angled walls. 2024-09-13 12:38:35 -03:00
Bruno Perdigão 7ea3d63aa0 Small fix to clear wall preview when deleting all polyline points. 2024-09-13 12:38:35 -03:00
Bruno Perdigão bd51363532 Small fix related to trying to use polyline wall without wall type. 2024-09-13 12:38:35 -03:00
Bruno Perdigão d4ccc0dff9 More fixes related to d5b20397a 2024-09-13 12:38:35 -03:00
Bruno Perdigão 66fe2331ef fix rebase conflict 2024-09-13 12:38:31 -03:00
Bruno Perdigão b7c4f1a1f0 Minor fix in polyline decorator variables initialization. 2024-09-13 12:37:45 -03:00
Bruno Perdigão c2cf8cd7dd Fix bug in polyline tool when "=" were pressed before "TAB". 2024-09-13 12:37:45 -03:00
Bruno Perdigão efcaf14fbb fix rebase conflict 2024-09-13 12:37:39 -03:00
Bruno Perdigão bc884c9dc4 fix rebase conflict 2024-09-13 12:35:50 -03:00
Andrej730 c340f496f2 swizzle material and style purging operators
purging material should come first as it may unlock purging more styles
2024-09-13 18:50:54 +05:00
Andrej730 b8aefe7df0 geometry.unassign_representation - fix missing ifc2x3 tests 2024-09-13 18:50:54 +05:00
Andrej730 8061e22480 geometry.unassign_representation to remove shape aspects
previously it was leaving unused shape aspects unconnected to any other elements, now it will purge them
2024-09-13 18:50:54 +05:00
Andrej730 aa289fd796 purge unused materials to consider IfcMaterialLists #3914
and IFC2X3 material sets and layers
2024-09-13 18:50:54 +05:00
Andrej730 b911b68aec typing 2024-09-13 18:50:54 +05:00
Andrej730 80af847f99 purge unused material to try to purge materials recursively #3914
As on first iteration it may remove only unused material sets and on the next iteration it will be able to remove IfcMaterials that were not used anywhere else besides those material sets.
2024-09-13 15:15:51 +05:00
Andrej730 4d149e8a78 Purge unused materials to consider materials with styles and psets #3914
If material has a style or a pset it creates an inverse that shouldn't prevent material from being purged.
2024-09-13 15:15:51 +05:00
Andrej730 c41a4607d1 Fix missing return values in e5a59d0bea 2024-09-13 15:15:50 +05:00
Andrej730 148f8361be make bump - show an error for incorrect use 2024-09-13 15:15:50 +05:00
Thomas Krijnen d879bf9f89 Reintroduce --model-offset/-rotation MODEL_OFFSET/_ROTATION setting #5231 2024-09-13 11:38:24 +02:00
Andrej730 81399ffd19 Support loading project without clearing Blender session
It wasn't working anymore after 27a2c94. Importing IFC file as just geometry should be a separate option from 'should_start_fresh_session' and I've added it as 'import_without_ifc_data' property during project load (now both options are also available for users in project load dialog - https://i.imgur.com/Fvbv4Dy.png)
2024-09-13 11:47:49 +05:00
Thomas Krijnen 21cfd03301 Merge pull request #5362 from IfcOpenShell/fix-ifccircle-ifcellipse-processing
Fix error processing IfcCircle/IfcEllipse #5352
2024-09-12 20:19:17 +02:00
Thomas Krijnen 1697e49e65 Merge branch 'v0.8.0' into fix-ifccircle-ifcellipse-processing 2024-09-12 20:18:57 +02:00
Andrej730 51211dc527 ifcopenshell makefile - use VERSION 2024-09-12 19:19:11 +05:00
Andrej730 806975c4b9 bump ifcopenshell build for bonsai 2024-09-12 19:07:20 +05:00
Andrej730 e3c23072a5 Hide edit mode for locked elements #5371 2024-09-12 18:40:22 +05:00
Andrej730 d34d3312ba Add messages for operations with locked elements
Otherwise they just silently failing leaving user confused
2024-09-12 18:40:21 +05:00
Andrej730 845402ea9c Replace grids/space elements visibility two toggles with one
See - https://i.imgur.com/5GssIDp.png (same for grids)
2024-09-12 18:40:21 +05:00
Andrej730 e5a59d0bea remove unnecessary ifc operators 2024-09-12 18:40:21 +05:00
Andrej730 3bb4243850 Purge unused styles and materials #3914
Example - https://imgur.com/a/JXEofa1
2024-09-12 18:40:21 +05:00
Andrej730 094bbe6913 bim.override_origin_set to reuse descriptions from blender operator 2024-09-12 18:40:20 +05:00
Andrej730 0f6cc7326c bim.add_proposed_prop - document possible property types 2024-09-12 18:40:20 +05:00
Andrej730 cc90c92dec bim.add_proposed_prop to show error message if property already exists 2024-09-12 18:40:20 +05:00
Andrej730 e81fe60218 CMakeLists - fix issue on msvc >= 14.40 #5158 2024-09-12 18:40:20 +05:00
Andrej730 aa97ff7f16 typing 2024-09-12 18:40:20 +05:00
Andrej730 2168b3b7bd black format 2024-09-12 18:40:20 +05:00
Andrej730 cb21f9bc07 taxonomy::cast - order upgrades in the same order as in taxonomy::dcast for consistency 2024-09-12 16:30:06 +05:00
Andrej730 f930897240 taxonomy::dcast - add missing curve_to_loop_upgrade 2024-09-12 16:30:05 +05:00
Andrej730 93c47498ef AbstractKernel::dispatch_conversion - use static cast
Previously it was using taxonomy::cast that was also trying to upgrade current item - due to the strictness of dispatch_conversion (it works only if type matches exactly because of `N == item_kind`) upgrades will never succeed so we may just skip them.
2024-09-12 16:30:05 +05:00
Thomas Krijnen 2545769f67 Add support for IfcSectionedSurface 2024-09-12 11:20:48 +02:00
Ryan Schultz 35a4d87a65 give schedules a css style called 'schedule' to help with styling 2024-09-11 23:06:43 -05:00
Thomas Krijnen c7183a58ea aggregate of int/real compatibility in parsing #5302 2024-09-11 20:15:14 +02:00
Thomas Krijnen 5a44a8e325 Defensiveness against invalid data 2024-09-11 20:13:50 +02:00
myoualid f5e02d1413 Merge branch 'v0.8.0' of https://github.com/IfcOpenShell/IfcOpenShell into v0.8.0 2024-09-11 19:00:27 +01:00
myoualid 1964def3ca web ui cost module features:
- improve UI for editing cost quantites
- add, edit, delete manual quantities
2024-09-11 19:00:15 +01:00
Thomas Krijnen cc2017518b Update build-all.py : _ifcopenshell_wrapper now called ifcopenshell_wrapper? 2024-09-11 19:58:52 +02:00
myoualid 97393eb173 prevent spatial elements selection from being assigned to cost control 2024-09-11 18:48:59 +01:00
Andrej730 4c04bc7cb5 fix test_create_IfcBSplineCurve 2024-09-11 19:42:47 +05:00
Andrej730 005c17084b dispatch_with_upgrade to use only upgrade types for optimization 2024-09-11 19:42:47 +05:00
Andrej730 858e57351e AbstractKernel::convert - more generic approach 2024-09-11 19:42:47 +05:00
Andrej730 9be392e2f1 test TesselateElements #5199 2024-09-11 16:02:48 +05:00
Andrej730 f4c3ceb693 black format 2024-09-11 16:02:48 +05:00
Andrej730 32c6ea9363 shapebuilder.profile - fix bug in ifc2x3 assigning non existing Position attr
confused arbitrary profiles with parametric profiles in 640320f
2024-09-11 16:02:48 +05:00
Andrej730 ad8131114d IfcLine, IfcBSplineCurve geometry tests 2024-09-11 15:53:04 +05:00
Andrej730 fe0be0cdae shape_builder.create_axis2_placement_2d 2024-09-11 15:53:04 +05:00
Andrej730 35221ed772 AbstractKernel::convert to use upgrade to edge as a fallback 2024-09-11 15:53:04 +05:00
Andrej730 37315e941a taxonomy.h - move upgrades code to cpp 2024-09-11 15:53:04 +05:00
Andrej730 11f017e715 revert manual upgrade to edges for ellipses and circles 2024-09-11 15:53:04 +05:00
Thomas Krijnen c63f1cfa88 Iterator: Don't crash on calling get() before initialize() 2024-09-11 11:18:09 +02:00
Dion Moult 5fe85e71bb Work in progress example to import multiple representation items as an object-based breakdown 2024-09-11 18:04:03 +10:00
Dion Moult f8f3519a68 Minor bugfix to allow unaggregation of hidden elements 2024-09-11 13:45:11 +10:00
Dion Moult bad6931a84 Fix bug in tessellate elements 2024-09-11 12:26:39 +10:00
myoualid 158f11d58c Cost web ui improvements:
- hovering cost item row displays quick actions
- clicking the quantity cells and cost cells prompts form to edit values
- further style improvements & refactoring
2024-09-10 22:48:22 +01:00
Bruno Perdigão 794154f6f5 Instructions in polyline tools were moved to the status bar.
Previously the instructions were shown on screen with decorators. Now it is handled by the modal function of the polyline tools.
2024-09-10 15:41:02 -03:00
Bruno Perdigão c06929e1c7 Major refactor in polyline tool to use a base class for other operators.
Polyline Wall and Measure tool now share most of the logic by inheriting from a base class PolylineOperator.
This should facilitate the implementation of other tools that use polyline.
2024-09-10 15:37:57 -03:00
Bruno Perdigão 1a587dea7d Minor refactor of tool/polyline 2024-09-10 15:37:57 -03:00
Bruno Perdigão 55df9a42e6 WIP - More refactor 2024-09-10 15:37:57 -03:00
Bruno Perdigão be8b325a83 WIP - Polyline tool refactor 2024-09-10 15:37:57 -03:00
Bruno Perdigão 2e192034f8 Small tweak in 8032e4851 2024-09-10 15:37:57 -03:00
Bruno Perdigão ce8e104b0b Change snap axis to 15 angles increments. 2024-09-10 15:37:57 -03:00
Bruno Perdigão e48050af4b Fix #5336 2024-09-10 15:37:57 -03:00
Bruno Perdigão d63961d840 Small fix on previous commit 2024-09-10 15:37:57 -03:00
Bruno Perdigão edf0804b0e Small fix on how the input UI rounds numbers 2024-09-10 15:37:57 -03:00
Bruno Perdigão aaa3d5c443 Small fix on previos commit 2024-09-10 15:37:57 -03:00
Bruno Perdigão 2008081d9a Implementation of #5317.
The number in the input UI will be replaced if the user presses a number.
This behavior will be different if the user press "=" or backspace.
2024-09-10 15:37:57 -03:00
Bruno Perdigão e546971ada Changed input validation to tool/polyline.py 2024-09-10 15:37:57 -03:00
Bruno Perdigão 8dc77735a5 fix rebase conflict 2024-09-10 15:37:57 -03:00
Richard Brice cc7171060f Decouples evaluation of a piecewise_function from the function itself (#5344) 2024-09-10 10:11:17 -07:00
myoualid 67a7e713b2 fix util.get_elements_by_pset to account for quantity sets 2024-09-10 17:17:42 +01:00
myoualid 3abe5edd21 Fix generating 3D view drawing when IFC elements don't exist in the Blender scene ( such as IfcDistributionPort) 2024-09-10 17:16:09 +01:00
Andrej730 34aed93b7b Fix 2 segfaults creating IfcEllipseProfileDef
1) taxonomy::ellipse was missing matrix so create_shape was segfaulting either was if Position was set or was not (segfaulting on line - https://github.com/IfcOpenShell/IfcOpenShell/blob/5616367a03ea397885e93523e55788da82238742/src/ifcgeom/kernels/opencascade/loop.cpp#L92)
2) was segfaulting when there was no default matrix

Removed fc->matrix assignment as matrix is already assigned to the curve.
2024-09-10 18:28:18 +05:00
Andrej730 6fd4d8b1ba Fix sequence.get_related_products bug after 845d772 2024-09-10 18:28:18 +05:00
Andrej730 2d0b262351 get_nested_tasks to discard non-ifctask elements #4911 2024-09-10 18:28:18 +05:00
Andrej730 a4f669e549 ifc5d.qto - some clarifications for arguments 2024-09-10 18:28:18 +05:00
Andrej730 dc92a8fd27 Bonsai - setup default values for new patametric profiles
So there will be less invalid IFC and user will get a preview right away after creating a new profile.
Example - https://imgur.com/a/GjkCql4
2024-09-10 18:28:18 +05:00
Andrej730 3bb0901e3e Profiles UI - better handling for invalid profiles
Previously it would be just console errors possibly breaking UI, now there will be UI error message - https://imgur.com/1o9teJ0
2024-09-10 18:28:17 +05:00
Andrej730 2d68d344bd Profiles UI - update displayed psets when user is changing active profile
previously it would get stuck until some other operator would refresh ui
2024-09-10 18:28:17 +05:00
Andrej730 ddf92ab8fb typing 2024-09-10 18:28:02 +05:00
Andrej730 9a6fc58949 Fix typo 2024-09-10 18:28:02 +05:00
Andrej730 765b5c2f5c black format 2024-09-10 18:28:01 +05:00
Andrej730 5616367a03 don't deep copy psets for optimization
Related to #5291

pset.edit_pset should cover it since it does support unsharing shared properties
2024-09-10 14:21:14 +05:00
Andrej730 6cf9875472 Fix error processing IfcCircle/IfcEllipse #5352 2024-09-10 12:54:44 +05:00
Dion Moult 5f8fdf233f Fix #5358. Easy way to toggle visibility of spatial elements and grids. 2024-09-10 14:29:55 +10:00
Manu Varkey be090a3a81 Fixes #5353 (#5354)
* Fixes #5353

* Change logic to use natsorted
2024-09-10 14:14:27 +10:00
Takayuki Kato 1da47d9271 Add support for editing IfcPhysicalComplexQuantity in edit_qto (#5335) (#5356)
* Add support for editing IfcPhysicalComplexQuantity in edit_qto (#5335)

* Fix lint-formatting issues
2024-09-10 14:13:57 +10:00
Ryan Schultz 4917cd19a2 addresses https://github.com/IfcOpenShell/IfcOpenShell/commit/3ceeaa739fb20125b7195dbd69e5e8606a3d5ed8#r146061329 2024-09-09 20:01:32 -05:00
Andrej730 e7ad71b51d black format 2024-09-09 18:01:23 +05:00
Andrej730 e87faa167c typing
also small optimization in MaterialCreator.create to address ifc a couple times less
2024-09-09 17:28:24 +05:00
Andrej730 13ed4d3a6c ifcopenshell to support styles assigned to IfcFaces #4038 2024-09-09 17:28:23 +05:00
Andrej730 27b9709b78 style.assign_representation_styles to support topology reprensentations #4038 2024-09-09 17:28:23 +05:00
Andrej730 2d988ac445 Representation UI - show IfcTopologyRepresentation #4038
Now it will show representation items count and will load representation items for IfcTopologyRepresentations.
2024-09-09 17:28:23 +05:00
Andrej730 6da7e18f50 Fix error adding typed text annotations #5300
Apparently it's part of #4832, previously creating a shape for IfcTypeProduct with literals would error, we ignored the error and type product end up being an empty. After 0.8.0 create_shape for literals creates an empty shape (0 verts) and we need to skip it, otherwise there would be an empty mesh representaiton.
2024-09-09 17:28:23 +05:00
Andrej730 a3c5c334f1 Show info message using annotation tool hotkeys without drawing loaded 2024-09-09 17:28:23 +05:00
Manu Varkey 09b8c4482f Update tooltips for UI elements (#5348)
* Update documentation

* Add further documentation

* Update tooltip after discussion

1. Change void to opening
2. Add blank bl_label fields

* Make missed out correction
2024-09-09 19:38:10 +10:00
Thomas Krijnen 680c73f15b Less noisy faceset helper messages 2024-09-09 09:58:02 +02:00
Thomas Krijnen 89e3650d77 No need to check for manifoldness when processing boolean ops in 2d 2024-09-09 09:57:43 +02:00
Thomas Krijnen bcc3b43dc1 --element-hierarchy matrix transpose #5191 2024-09-09 09:57:09 +02:00
Dion Moult 5cfcba5272 Fix #3333. Fix #5290. Fix bugs where Shift-Click or Alt-Click drawing activation modes didn't quite do what was advertised. 2024-09-09 17:43:40 +10:00
Andrej730 2416d91748 black format 2024-09-09 10:37:44 +05:00
Andrej730 7d90c319f0 Merge branch 'test-cmake-policy-fix' into v0.8.0 2024-09-09 10:34:15 +05:00
Dion Moult b71034765c Black 2024-09-09 12:43:22 +10:00
Dion Moult f82b97e97b Fix #5329. Fix #5267. Add support for composite profile definitions and nested closed profiles. 2024-09-09 12:43:13 +10:00
Dion Moult ba5b27d03c Support getting 2D coordinates in util.shape.get_vertices 2024-09-09 12:41:40 +10:00
myoualid 98ab5399f2 web ui cost module:
- double click cost cell to enable editing cost values.
- fix tables' height / scrollbar behaviour
2024-09-09 01:08:29 +01:00
myoualid 2d7614622f fix table styles for cost schedule module 2024-09-08 20:37:46 +01:00
Bruno Perdigão 1c7b36f233 Polyline tool - changed decorator order to show Input UI in front. 2024-09-08 12:04:38 -03:00
Bruno Perdigão d42890f214 Fix bug when trying to calculate the angle from vectors too close to each other. 2024-09-08 12:01:04 -03:00
myoualid c607cbc9d7 cost module web ui improvements:
-add ribbon bar,
- improve settings menu with ability to change font size for tables.
- Improve cost schedule spreadsheet layout
2024-09-08 15:29:46 +01:00
myoualid 83be26e196 fix loading cost schedule webui from blender operator 2024-09-08 15:25:56 +01:00
Dion Moult 2f026218ff Purge deprecated dumb wall / slab qto listener in favour of Ifc5D 2024-09-08 17:31:33 +10:00
Dion Moult 7615173924 Minor fix to sync IFC mode and Blender mode when editing profiles 2024-09-08 17:31:33 +10:00
myoualid 171c3083da Cost module web-ui can now:
- assign cost item products from Blender selection
- display list of selected products ( with available quantities, subtotals, and highlighting already assigned products)
- display and refresh assigned products
- highlight loaded cost schedule
2024-09-08 01:16:48 +01:00
Ryan Schultz fe317f9231 fix #3959 - drawing boundary changes are reflected on bim.create_sheets as well.
and only updates drawings that have been changed
2024-09-07 15:35:05 -05:00
Ryan Schultz 5363c33888 fix #5290: to fix error after shift and click bim.activate_drawing 2024-09-07 13:01:09 -05:00
Dion Moult 795d2c371e Fix #5340. Fix cosmetic console bug when adding a spatial subelement and selecting it. 2024-09-07 22:12:54 +10:00
Manu Varkey 1dfa3f8d79 Implement sorting of spacial containers by elevation and name 2024-09-07 21:46:35 +10:00
Dion Moult 2626165629 Fix #5334. Bug where the wrong type would be added if you added a new type then switched tool. 2024-09-07 21:13:56 +10:00
Dion Moult 0a17588db8 Fix #5346. 2024-09-07 17:05:19 +10:00
Andrej730 33001e6c6d profile.copy_profile
Fixes issue duplicated profile missing it's psets.
2024-09-07 11:22:43 +05:00
Andrej730 e224bfd19f Fix error showing material/profile psets in bbim after 691815fd41 2024-09-07 11:22:43 +05:00
Andrej730 c1d5c18724 fix black format 2024-09-07 11:22:43 +05:00
Dion Moult 557a120178 Fix #5341. Editing elevations in spatial decomposition panel is now a string and has an immediate effect. 2024-09-07 15:37:01 +10:00
Dion Moult cea4c0c01d Fix #5345. Bug when adding a new representation using "full representation". No temp data is used, so deletion not required. 2024-09-07 14:50:09 +10:00
Dion Moult 8b1d3a0c5d Fix #4769. Bug where editing grids didn't work with non-SI units.
I really don't know how this mistake lasted this long.
2024-09-07 13:48:42 +10:00
Dion Moult c5fc86d148 Fix #5337. You can now delete grids, which recursively delete all axes. Edit mode now also respects locking. 2024-09-07 13:18:36 +10:00
Ryan Schultz 8cec717315 fix #5304: Have demo project have Plan/Annotation/REFLECTED_PLAN_VIEW context 2024-09-06 19:49:38 -05:00
Dion Moult 7905cd8bd3 See #5337. Grid decorators now turn off when editing an axis. 2024-09-07 10:01:57 +10:00
Dion Moult 0337034d28 Fix #4881. Fix bug where editing grid axes didn't work. 2024-09-07 10:01:57 +10:00
myoualid 88a40e0052 improve cost table responsiveness and highlight currently loaded cost schedule 2024-09-06 20:51:46 +01:00
Richard Brice c9d2390d9a Implements cant geometry 2024-09-06 10:02:08 -07:00
Andrej730 0055a5dd82 ifcwrap cmake - use default CMP0078 policy 2024-09-06 19:58:52 +05:00
Andrej730 4ff0893a8b ifcwrap cmake - fix CMP0078 warning 2024-09-06 18:28:50 +05:00
Andrej730 791d098800 ifcwrap cmake - fix CMP0078 warning 2024-09-06 18:12:00 +05:00
Andrej730 8e87d0e303 typing 2024-09-06 18:11:25 +05:00
Andrej730 eaaa18468a Reuse tool.Ifc.Operator 2024-09-06 18:11:25 +05:00
Andrej730 871cd45f53 selector.set_element_value to support 'predefined_type' keyword
See more details in https://community.osarch.org/discussion/comment/22134/#Comment_22134
2024-09-06 18:11:24 +05:00
Andrej730 39fd9ce462 attribute.edit_attributes - small optimizations
remove settings dictionary and remove some ifc calls
2024-09-06 18:11:24 +05:00
Dion Moult 4c68ec6f82 Fix bug where editing AxisTag didn't change the grid axis name 2024-09-06 23:10:43 +10:00
myoualid be71eb274b display cost schedule predefined type in web ui 2024-09-06 12:08:45 +01:00
Andrej730 008e2c01c3 selector.set_element_value - temporarily skip 'predefined_type'
to avoid issues importing csvs that used it to extract correct predefined type

Example warning:
WARNING. Assigning 'predefined_type' is not yet supported. Skipping value 'ELECTRICACTUATOR' for element: '#89=IfcActuator('1RjCen6XL6WAdhz7HumLFU',$,'Actuator.002',$,$,#179,$,$,.ELECTRICACTUATOR.)'.
2024-09-06 15:18:15 +05:00
Andrej730 a1e51757b1 attribute.edit_attributes - document behaviour for PredefinedType 2024-09-06 15:18:15 +05:00
Andrej730 d5169e85fa bim.import_ifccsv to support undo (missing Ifc Operator)
Previously it wasn't possible to undo changes in the currently loaded IFC model after bim.import_ifccsv
2024-09-06 15:18:15 +05:00
Andrej730 cfc243949d Fix error unassigning type from element without representation
Traceback
Traceback (most recent call last):
  File "\bonsai\bim\module\type\operator.py", line 63, in execute
    return IfcStore.execute_ifc_operator(self, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "\bonsai\bim\ifc.py", line 408, in execute_ifc_operator
    result = getattr(operator, "_execute")(context)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "\bonsai\bim\module\type\operator.py", line 78, in _execute
    active_context = active_representation.ContextOfItems
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'ContextOfItems'
Error: Python: Traceback (most recent call last):
  File "\bonsai\bim\ifc.py", line 408, in execute_ifc_operator
    result = getattr(operator, "_execute")(context)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "\bonsai\bim\module\type\operator.py", line 78, in _execute
    active_context = active_representation.ContextOfItems
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'ContextOfItems'
2024-09-06 15:18:15 +05:00
Andrej730 a3ff0a61a6 ifccsv to web - fix Tabulator dropping columns with non-unique names 2024-09-06 15:18:15 +05:00
`myoualid` 456ad2af8e remove annoying console logs 2024-09-06 10:14:21 +01:00
Dion Moult 7b8e234683 Remove add grid in add menu, and run black 2024-09-06 18:18:32 +10:00
Dion Moult 95b7a79c64 Locked elements are now blocked from being duplicated too 2024-09-06 18:07:09 +10:00
Dion Moult 4a5e180479 You can now lock and unlock spatial / grid elements, which affects your ability to delete or move them 2024-09-06 17:58:52 +10:00
`myoualid` d6098a0b6d - web ui features to add a new cost schedules, and root cost items
- improved ui for cost schedules
- sharing more css across files
- refactor get_predefined_types(cost_schedule)
2024-09-06 08:55:10 +01:00
Dion Moult 541a6e18e6 Fix broken ifcconvert table in docs 2024-09-06 16:55:56 +10:00
Dion Moult 11497f9b37 Add decorator for grids outside drawing view 2024-09-06 16:40:56 +10:00
Dion Moult 6b14111b24 More grid panel to spatial subpanel 2024-09-06 16:40:56 +10:00
Andrej730 f27bb6effe black format 2024-09-06 11:13:09 +05:00
Andrej730 6ebec7e0e5 pset.unshare_pset - fix bug where it would leaving an orphaned pset
It was leaving an orphaned pset if 'products' was a list of all elements pset is assigned to. Then it would create a new pset for each element leaving original pset orphaned.
2024-09-06 11:04:05 +05:00
Andrej730 ffb2ea2be3 bim.unshare_pset - move implementation to core 2024-09-06 11:04:04 +05:00
Andrej730 89bb7c76de bim.unshare_pset - to work for all selected objects #5291 2024-09-06 11:04:04 +05:00
Andrej730 a867e72fd3 rename get_elements_using_pset -> get_elements_by_pset for consistency
To be consistent with other get_elements_by_xxx methods.
2024-09-06 11:04:04 +05:00
Andrej730 a03c55d15f fix poll breaking with no active object 2024-09-06 11:04:04 +05:00
Richard Brice 1a75d95d47 Updates dependencies for boost 1.86.0 2024-09-05 20:34:49 -07:00
Dion Moult fe5f48c655 Positional elements, project, and spatial elements are now locked. Remove user option to change behaviour. 2024-09-06 12:09:06 +10:00
Dion Moult a4396ee766 See #5318. Prevent deletion of project or spatial structures. 2024-09-06 11:44:30 +10:00
Dion Moult 977f3c7dcc Fix #5243. Remove usage of types_with_super which is no longer available. 2024-09-06 10:38:19 +10:00
Bruno Perdigão 8ba52a2b1c Scale the text for polyline tool decorators. 2024-09-05 14:18:12 -03:00
Bruno Perdigão 214c278fc5 Added a function to scale the font size according to preferences.
The scale will be calculated in relation to the system dpi and Blender's interface resolution scale.
2024-09-05 14:18:12 -03:00
Ryan Schultz f521945766 Have bim.select_assigned_product make selected object active, so it's easier to change its Object Information 2024-09-05 10:09:35 -05:00
Thomas Krijnen 12318fbfc2 Handle storage of nullptr as a proper Blank type in variant #5308 2024-09-05 14:38:57 +02:00
Andrej730 56428eb605 Ooops, fix black formatter ignoring bonsai folder #5178 2024-09-05 17:19:15 +05:00
Andrej730 88319bfa57 Fix missing ifc2x3 tests for pset.edit_pset 2024-09-05 17:13:41 +05:00
Andrej730 cce4e426c3 util.get_pset to support ifc2x3 material props 2024-09-05 17:13:41 +05:00
Andrej730 7782ab5479 should_load_from_memory related poll messages 2024-09-05 15:38:32 +05:00
Andrej730 7e5bd0ca83 ifcwrap cmake - rebuild if .i files changed 2024-09-05 15:08:36 +05:00
Andrej730 051d5479fb Strip redundant newline in repr() for taxonomy items
E.g.
print([m.diffuse for m in shape.geometry.materials])

would print
[colour 0.7 0.7 0.7
]

Instead of:
[colour 0.7 0.7 0.7]
2024-09-05 15:08:36 +05:00
Andrej730 deb41d2158 Geometry settings documentation fixes #5312 2024-09-05 15:08:35 +05:00
Andrej730 ea6df7f617 Use latest syntax for setting geometry settings #5299
Also fixed:
- old include_curves use
- missing use of 'include_curves' in ifcopenshell.draw
2024-09-05 15:08:35 +05:00
Andrej730 fcf41bf00c fix typing issue
Overloads were breaking because type checker is confused what default value should it use for the argument.
Made it keyword-only to resolve the issue.
2024-09-05 15:04:17 +05:00
tim 7c3fbda01e Updated icons
- new master svg file for storing icons bonsai_icons.svg
script for exporting png files and generating light mode versions
support for light mode
2024-09-05 09:21:15 +10:00
`myoualid` d0712c7186 1/ WEB UI Cost Schedule features to :
- delete cost items
- duplicate cost items
- delete individual cost values
- update cost values on the fly
- Shitf + LMB to recursively hide or show nested rows

2/ Improved UI for cost schedules
3/ Reuse css styles across pages with import statements
4/ Remove console/print statements
2024-09-04 23:39:46 +01:00
Andrej730 e1a5e73106 black format 2024-09-04 18:52:09 +05:00
Andrej730 1282f5c308 geom.Iterate - fix incorrect typing, document some arguments #5299 2024-09-04 18:51:07 +05:00
Andrej730 b0eaf23d2c Fix missing serializer_settings argument #5299 2024-09-04 18:51:07 +05:00
Andrej730 0ab70827e5 pset.assign_pset, pset.unassign_pset 2024-09-04 18:51:07 +05:00
Andrej730 691815fd41 Tools for handling shared psets #5291
In IFC it's possible for a property set to be assigned to multiple elements and which may lead to confusing behaviour when you edit a pset on one element and other element seems to get edited too.

Which makes it worse is that that it is possible that some software is might be doing this unintentionally when exporting IFC (as some sort of optimization as storing 1 is more optimal than n copies of it).

So now there are some tools in Bonsai and in IfcOpenShell to handle the shared psest:

1) Indication that property is shared - https://imgur.com/a/9dd3jST (similar to how Blender indicates ID data-block users). You can click on it to "unshare" the pset - a new copy for the pset will be created and it's going to be linked only to the active object.

2) api pset.unshare_pset method that does the same. And util.element.get_elements_using_pset method that encapsulates schema differences and different approaches for occurrences/types.

3) ifcpatch recipe 'UnsharePsets' that's making all property sets in the IFC file to have just 1 element that's using them. You can limit the affected elements by providing query.

ifcpatch recipe is also available in Bonsai - https://i.imgur.com/aOCx7HI.png
2024-09-04 18:51:06 +05:00
dependabot[bot] 3c3b56d1ae Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 2 to 4.1.7.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v2...v4.1.7)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-04 10:43:04 +10:00
htlcnn 116192befd fix last point coincides with first point 2024-09-03 16:36:45 -03:00
Bruno Perdigão b6a96828ec Fix #5277 2024-09-03 16:23:32 -03:00
Ryan Schultz c4c611d778 whoops 2024-09-03 13:21:48 -05:00
Ryan Schultz 290c08d6d5 updated links in docs 2024-09-03 13:18:55 -05:00
Thomas Krijnen eb7411b310 ifcopenshell.file.assign_header_from() to copy header 2024-09-03 18:49:05 +02:00
Andrej730 bea837299e root.reassign_class to handle switching occurrence class <-> type class #5260
Kind of experimental. The idea is that it will reassign class e.g. from IfcWindow to IfcWindowType (or vice versa) and will keep the IFC representations and property sets.

Example - https://imgur.com/a/X7MHR0s
2024-09-03 18:53:25 +05:00
Andrej730 acbdc0ed4c typing 2024-09-03 18:53:25 +05:00
Andrej730 bec1d913c5 util.representation.get_representations_iter 2024-09-03 18:38:22 +05:00
Andrej730 b957505bfc bim.add_xxxx descriptions 2024-09-03 18:38:22 +05:00
Andrej730 3c69fffb19 ifcopenshell.validate fix missing space in indentation 😅 2024-09-03 18:38:22 +05:00
Andrej730 1c7e7c5269 prohibit user from removing a profile that still has inverses #5101
To avoid creating invalid material profile sets, representation items. Currently the only inverse that is allowed before removal is profile properties.

Example - https://i.imgur.com/UobI4pL.png
2024-09-03 18:38:21 +05:00
Andrej730 92525db14f profile.remove_profile - tests 2024-09-03 18:38:21 +05:00
Andrej730 01d965fe25 profile.remove_profile - clean up removing profile psets 2024-09-03 18:38:21 +05:00
Andrej730 d2bc6f9509 pset.add_pset - support ifc2x3 material/profile psets
1) For psets there was an issue - it was instantiating abstract IfcProfileProperties
2) For materials it was only able to instantiate IfcExtendedMaterialProperties though there are other pset types too in ifc2x3.
2024-09-03 18:38:21 +05:00
krande 88b861737c if boost >= 1.86 append newline to json logger 2024-09-03 11:56:15 +02:00
Kristoffer Andersen 0f87bd8206 use a macro to change for boost > 1.86 2024-09-03 11:09:22 +02:00
Kristoffer Andersen 1fe168d331 Update IfcGlobalId.cpp to support boost 1.86
It looks like mt19937 is no longer a member of boost in boost 1.86. I propose we use to std::mt19937 (which is already how it is used by svgfill.cpp)

see failure log from conda forge libboost 1.86 test here:
https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=1008654&view=logs&j=4f922444-fdfe-5dcf-b824-02f86439ef14&t=b2a8456a-fb11-5506-ca32-5ccd32538dc0&l=880
2024-09-03 11:09:22 +02:00
Thomas Krijnen a7925622ed Handle nix patches for V7_7_2 #5285 2024-09-03 08:52:39 +00:00
Dion Moult 3675429385 Fix #2437. You can now see the spatial hierarchy decomposed by classification. 2024-09-03 18:42:52 +10:00
Thomas Krijnen 44ab38cb24 Add V7_7_2.patch #5285 2024-09-03 10:01:44 +02:00
Thomas Krijnen 1a146ada48 Add V7_7_2.patch #5285 2024-09-03 09:57:02 +02:00
Dion Moult 2ed2b4fe71 Fix #5230. Reimplement spatial decomposition hierarchy. 2024-09-03 14:36:01 +10:00
Dion Moult 4ce30b3153 See #5269. Minor tweak to show warning if object scaling detected. 2024-09-03 12:52:57 +10:00
Dion Moult 4ce2251717 See #5269. Minor tweak to show warning if manual mode changes detected. 2024-09-03 10:19:35 +10:00
Andrej730 c6e8d2a585 bim.add_material_set to ensure adding valid material sets 2024-09-02 18:41:15 +05:00
Andrej730 90e9c21320 material.add_profile note 2024-09-02 18:40:12 +05:00
Andrej730 236fbc7864 remove unused add_empty_type_button ui function 2024-09-02 17:25:04 +05:00
Andrej730 ae75acb0b9 Fix test after 521b0ab58d 2024-09-02 17:24:59 +05:00
Andrej730 11068fe338 bim.add_drawing_to_sheet - poll message 2024-09-02 17:24:59 +05:00
Andrej730 3c333c6b59 typing 2024-09-02 17:24:58 +05:00
Andrej730 ccbb253d2c Fix new sheets having non-unique identification
It was checking for the wrong scope "DOCUMENTATION".
Scope "DOCUMENTATION" was left from the old times, now we use scope "SHEET".
2024-09-02 17:04:55 +05:00
Andrej730 7c542418e6 fix create sheet test failing if bonsai and tests are on different disks
It was failing on Windows with something like "ValueError: path is on mount 'L:', start on mount 'C:'".
I guess it doesn't really occur in bonsai as sheets are typically stored next to the titleblocks (we used to use absolute paths awhile ago and now everything is relative to the ifc project)
2024-09-02 17:04:55 +05:00
Andrej730 d77f57c68e ifc.resolve_uri - remove redundant second check
os.path.isabs(uri) is already checked at the beginning of the function
2024-09-02 17:04:55 +05:00
Andrej730 151244ae79 ifcopenshell.file() to create valid ifc header by default #5246
Valid type for author and organization is 'LIST [ 1 : ? ] OF STRING (256)'
2024-09-02 17:04:55 +05:00
Andrej730 e50a90cc9f ifcopenshell.validate return code 1 in case of some file is invalid 2024-09-02 17:04:54 +05:00
Andrej730 5f5ab10b35 ifcopenshell.validate to validate ifc header #4119 2024-09-02 17:04:54 +05:00
Andrej730 0e791c7dfd Fix ifcopenshell.validate missing output in some cases after 07a0b4f
Apparently adding LogDetectionHandler disabled default handler that prints the output.
2024-09-02 17:04:54 +05:00
Dion Moult 07be50b365 See #5261. Fix bug when editing parametric stairs (not stair flights) which sets an inapplicable predefined type 2024-09-02 21:23:06 +10:00
Dion Moult fb422692c8 You can now make the selected element in the spatial decomposition panel active 2024-09-02 20:37:04 +10:00
Dion Moult 1a8be005cf Fix bug where toggled openings didn't properly appear in the dedicated opening collection 2024-09-02 20:14:43 +10:00
Dion Moult 9dcb5b103c Fix #5237. Fix bug where flipping or splitting walls didn't take into account project units and voids were misplaced. 2024-09-02 20:14:30 +10:00
Dion Moult 091824910b Increase debug log limit to 20 2024-09-02 19:42:26 +10:00
Dion Moult ea6d5918ba Fix bug where openings were invalidly contained in a container 2024-09-02 19:42:26 +10:00
Manu Varkey a452d29bab Fix bug: Add type instance button duplicated (#5281) 2024-09-02 19:37:08 +10:00
Dion Moult fb803ac35d Fix #5256. Use layer collection visibility, not collection visibility to hide types. 2024-09-02 18:48:09 +10:00
Dion Moult eec4b37827 See #5256. Fix bug where old "Types" collection was still being created and unused. 2024-09-02 18:47:09 +10:00
Dion Moult d1565ec1e6 Fix #5273. Bug where Shift-E allowed you to edit non-roof/railing elements if you also had them selected. 2024-09-02 17:46:44 +10:00
Dion Moult 521b0ab58d Fix #5271. Prevent duplicate entries when getting a decomposition. 2024-09-02 17:35:49 +10:00
Thomas Krijnen 04bbfc04ad Try 7.7.2 for HLR poly/edge behaviour 2024-09-02 09:20:38 +02:00
Thomas Krijnen f0167b812a Try 7.7.2 for HLR poly/edge behaviour 2024-09-02 09:19:46 +02:00
Dion Moult 0b8a701423 Fix #5275. Fix bug where orthographic sections would appear over freestyle linework in perspective views. 2024-09-02 16:51:25 +10:00
Dion Moult aa7e80fc8c Fix #5276. Fix inaccurate tooltip for assign container operator. 2024-09-02 16:40:51 +10:00
Bruno Perdigão f48c7d6af5 Fix polytool issue with distance input while snapping above the xy plane. 2024-09-01 11:20:14 -03:00
Bruno Perdigão 977014b86a Fix #5274 2024-09-01 10:48:16 -03:00
Bruno Perdigão 43e13ef8f3 Fix polytool issue when backspacing the whole input. 2024-09-01 10:38:03 -03:00
Thomas Krijnen daba504981 Update draw.py - test for --drawing-guid existance 2024-09-01 15:33:52 +02:00
Thomas Krijnen f8a2cce202 Use polygon_from_points() and handle Position for CSG Pyramid #5241 2024-09-01 15:14:22 +02:00
Thomas Krijnen b786e129bd Fix faceset helper stats 2024-09-01 15:12:43 +02:00
sukanka b82073dd57 fix-py-syntax-warning 2024-09-01 14:02:24 +02:00
Thomas Krijnen d4d9fdff1a Fix and augment v0.8 taxonomy wrapper 2024-09-01 10:40:23 +02:00
Dion Moult b3b14e87ec Next release cycle! 2024-09-01 18:00:31 +10:00
Andrej730 6bc31105bf Mention common error in troubleshooting docs 2024-09-01 11:10:13 +05:00
Dion Moult 73e3ebd1f0 Update README.md with new doc links 2024-09-01 16:08:45 +10:00
Dion Moult 32f216a594 Minor fix to bonsai-stable build 2024-09-01 14:23:29 +10:00
Dion Moult 296ebf5253 Fix failing tests in Bonsai 2024-09-01 14:08:52 +10:00
Dion Moult e072870fd3 Fix bcf pypi build 2024-09-01 13:35:57 +10:00
Dion Moult af4475fe46 Run black 2024-09-01 13:26:58 +10:00
Dion Moult eb3104367a Bump version to v0.8.0 2024-09-01 13:23:54 +10:00
Dion Moult 90f9ebd25e Add dev install instructins to official docs 2024-09-01 13:23:31 +10:00
Yassine Oualid f2554bc968 - Add button to generate cost schedule
- Feature to view, edit and add cost item values. ( Right Click - Edit ).
2024-09-01 01:40:53 +01:00
Dion Moult 53a78f38e5 You can now assign objects to the selected container in the spatial decomposition panel 2024-09-01 08:13:29 +10:00
Dion Moult b476cb825c Fix #5265. Accommodate invalid material sets. 2024-09-01 07:53:49 +10:00
Bruno Perdigão ec21574be5 Fix measure tool to now show the angle for the first point. 2024-08-31 14:39:58 -03:00
Bruno Perdigão b552665dd9 Round angle in polytool input numbers calculations. 2024-08-31 14:39:58 -03:00
Bruno Perdigão 48b630696f Fix 3ceeaa7 2024-08-31 14:39:58 -03:00
Bruno Perdigão 8c94ef6e54 A better fix for dabb85c. 2024-08-31 14:39:58 -03:00
Bruno Perdigão bdcadfd100 Refactor tool.Cad.angle_3_vectors
This functions was built to work with the input calculations for the polytool.
Part of its code was being duplicated in another part of the code. The refactor
keeps most of the calculation in the same place.
2024-08-31 14:39:58 -03:00
Bruno Perdigão 90e83d77a7 more improvement on distance and angle calculations 2024-08-31 14:39:58 -03:00
Bruno Perdigão 2e80363bac improved general input calculations 2024-08-31 14:39:58 -03:00
Bruno Perdigão b6f80eabb4 Fix input calculation and conversion for measure tool 2024-08-31 14:39:58 -03:00
Bruno Perdigão c93e52089b Fix input calculation and conversion for wall polytool 2024-08-31 14:39:58 -03:00
Andrej730 76ba3947f5 Expose header properties with invalid values #5246 2024-08-31 14:31:41 +02:00
Dion Moult 50cb09aac2 See #3880. Freestyle support for perspective vector linework. 2024-08-31 20:56:10 +10:00
Andrej730 dac1aaa7f3 Errors adding roof, stair, railing types #5261
It wasn't considering that type object can be hidden and can't be active.
Removed obj property since it can be covered with just temp_override.
2024-08-31 13:30:12 +05:00
Dion Moult eed603bbcd Bump IOS 2024-08-31 18:09:54 +10:00
Dion Moult 1d62f6f736 Support experimental freestyle linework generation 2024-08-31 18:09:14 +10:00
Andrej730 799cf47316 Fix error removing a cost schedule (after 7a44f9e) #5264
It wasn't really leaving orphaned data and interrupting the process of the ifc object deletion but it was leading to confusing errors
2024-08-31 13:00:11 +05:00
Dion Moult 03935a91da Fix bug where linework merging may create polygons where there should be interior holes instead. 2024-08-30 23:53:02 +10:00
Dion Moult 37baa9235a Fix bug where a voided element by OCC will be considered non-manifold. Remove doubles with a very small distance fixes it. 2024-08-30 23:51:47 +10:00
Dion Moult b4b2b60935 New bisect-based drawing cut mode. This replaces OCC's cut (but keeps the projection HLR) with a blender bisect based cut 2024-08-30 20:33:09 +10:00
Dion Moult a11c7535d8 Turn fill modes (shapely / svgfill) into a dropdown to prevent selecting both and crashing 2024-08-30 20:33:09 +10:00
Andrej730 e8d6dd333c Fix failing import if 'sun position' extension (9633d92)
ping @chiragsingh1711
2024-08-30 12:15:00 +05:00
Chirag Singh 9633d92c17 Light/radiance (#5252)
* Cam fix, Sun Fix, import-export as json

* Ran black formatting
2024-08-30 08:32:45 +10:00
Andrej730 afd5a5b23e Fix get_info_2 #5248 after d80bcd1 2024-08-29 18:57:47 +05:00
Dion Moult 15481c0a59 Bump docs to use spatial panel. Format menuselection. 2024-08-29 23:30:53 +10:00
Dion Moult 32b37b8823 Implement recursive toggling for elements in spatial panel 2024-08-29 23:30:53 +10:00
Andrej730 f3ab214752 Use first layer/profile from the set to pick up the material #5238
As currently we do not support multilayer/profile geometry and therefore we can't correctly represent them when they have multiple styles. As a workaround we'll use the material/style from the first layer and apply it to the entire object.
2024-08-29 17:21:21 +05:00
Dion Moult 4a59b30f1b Fix #5244. Prioritise collection of drawing groups over containment groups 2024-08-29 18:42:42 +10:00
Andrej730 87d6960356 Fix #5249 after acf135a 2024-08-29 13:42:08 +05:00
Andrej730 aff893e690 bim.create_drawing - poll message 2024-08-29 13:42:08 +05:00
Dion Moult 486eb259ea Fix #5245. Consider situation where object may not be loaded due to partial loading. 2024-08-29 18:09:31 +10:00
Ziad-I 8164b496f8 fix #5219 underlay links are now base64 encoded in the svg before sending it to web UI
this is not really the best solution and might need to look for better ones
2024-08-29 10:50:50 +03:00
Dion Moult fda23f350a Fix #5247. Fix typo when opening drawing web UI. 2024-08-29 17:19:28 +10:00
Dion Moult 711c597065 See #5231. Workaround for missing offset. 2024-08-29 16:22:42 +10:00
Dion Moult 80a396dc12 You can now select geometry library in advanced settings 2024-08-29 16:22:42 +10:00
Dion Moult 2b70f12d44 More bonsai name fixes 2024-08-29 15:17:52 +10:00
Dion Moult c3bcc2d90c See #5243. types_with_super() is no longer available. Also maybe overkill in this scenario. 2024-08-29 10:11:01 +10:00
Dion Moult 88e5a51f01 Merge pull request #5236 from IfcOpenShell/webui_updates
Add RMB context menu to web UI spreadsheets and small updates
2024-08-29 09:55:55 +10:00
Dion Moult 8b8af680bc Merge branch 'v0.8.0' into webui_updates 2024-08-29 09:55:41 +10:00
Dion Moult 8a57a52949 Bump IOS 2024-08-29 09:20:32 +10:00
Jean-Marc Couffin 720eda51c3 Update README.md with new blenderBMI branding - BONSAI 2024-08-29 08:35:24 +10:00
Bruno Perdigão 01a701007e Fix b74811b3f 2024-08-28 19:02:06 -03:00
Bruno Perdigão ec5368224f Fix after fbcb19fdb 2024-08-28 18:58:11 -03:00
Bruno Perdigão 56e9488d3e A few updates on Snap and Raycast to improve the snap feel. 2024-08-28 16:52:35 -03:00
Bruno Perdigão 23ec2fc48e Adds intersect_edges_v2 to Cad tools.
This function uses another method to calculate the closest points in two edges that are not parallel.
The `intersect_line_line` from mathutils were not getting good results when using orthogonal view.
2024-08-28 16:52:35 -03:00
Bruno Perdigão fbcb19fdbb Improved snap "stickiness".
Added more control on how the snapping system selects the snapping point, and "M" key now updates the input panel.

Added `intersect_edge_2` to Cad tool

Revert "Improved snap "stickiness"."

This reverts commit 85e67d3996ab8002b4cef7c0b859e9da251d39bf.

A few snap and raycast changes to improve the snap feel
2024-08-28 16:52:35 -03:00
Andrej730 d9f3c9d012 bim.activate_model to hide all annotations #5232 2024-08-28 23:54:17 +05:00
Yassine Oualid 91e236c42c Display and Load Work Schedules from webUI 2024-08-28 18:57:40 +01:00
Yassine Oualid 03ab88b5bb First Draft Cost Schedule Web UI:
- display cost schedules
	- load cost items
	- Add cost items
	- Edit cost item names
2024-08-28 18:54:18 +01:00
Andrej730 42ef06aae1 typing 2024-08-28 18:47:23 +05:00
Andrej730 691dfb45f0 bim.activate_model to unhide all objects #5232
Restore old behaviour (new behaviour was introduced by accident in 786b796) where it would unhide all objects instead of keeping only objects in the current drawing.
2024-08-28 18:42:10 +05:00
Andrej730 760816b7f0 Show occurrences in spatial manager decomposed elements
Example - https://imgur.com/a/PNFUbv0
2024-08-28 17:57:19 +05:00
Andrej730 fc04c6e41e Remove unused property 2024-08-28 17:53:13 +05:00
Andrej730 99e67d528f Remove duplicated then decorator from b9855b2
'then the object name is selected' were already defined in then_the_object_name_is_selected
2024-08-28 16:42:55 +05:00
Andrej730 c113061742 Preserve visibility status for non-ifc objects when drawing is activated
Mentioned in #3402
2024-08-28 16:37:26 +05:00
Andrej730 174ff00a6d Fix errors trying to setup decorations running tests 2024-08-28 16:37:26 +05:00
Andrej730 84a2d4266d Autodocument hotkeys in the BIM tool hotkeys descriptions
Addition to #5223

Example - https://i.imgur.com/vGVHNPL.png
2024-08-28 15:41:50 +05:00
Andrej730 64cba98c3d Fix #5235 2024-08-28 14:37:58 +05:00
Andrej730 1aed2a6b3c Fix error not excluding annotations from other drawings after 3848a21
Mentioned in #5233

Also some refactor:
- checking IfcProduct instead of IfcProject. Not sure when this issue occur in general but if it occurs then it might fail for other non-IfcProducts too, not just IfcProject
- small performance optimization
2024-08-28 12:35:47 +05:00
Andrej730 4e1a956830 Fix #5233 2024-08-28 12:35:47 +05:00
Andrej730 747a39b440 48f0dc6a00 to pass on unix too 2024-08-28 11:29:39 +05:00
Andrej730 1b49515d9f Replace ordered_set with orderly_set
deepdiff deprecated use of ordered_set and switched to orderly_set (ordered_set fork), so we switch too
see https://github.com/seperman/deepdiff/releases/tag/8.0.0
2024-08-28 11:14:52 +05:00
Bruno Perdigão dabb85c466 Fix polytool input for distance zero 2024-08-27 19:59:55 -03:00
Bruno Perdigão b74811b3f4 Polytool, changed decorator order to show created polyline first. 2024-08-27 19:53:03 -03:00
Bruno Perdigão 79eaf895f7 Fix polyline to work only with walls.
This is temporary until we enable polyline to work with other tools.
2024-08-27 19:05:30 -03:00
Bruno Perdigão 994c85a05a black format 2024-08-27 18:22:43 -03:00
Bruno Perdigão 0faacccf6d Raycast now filters objects that are not in the active local view. 2024-08-27 18:20:06 -03:00
Bruno Perdigão 89d27bdf5f Fixed edge snap.
The `intersect_line_line` were returning points that were outside
the object edges, so it was added a function to check if the point
return is on the object edge.
2024-08-27 18:20:06 -03:00
Bruno Perdigão 76853db32c Fix mixed snap for Polytool 2024-08-27 18:20:06 -03:00
Andrej730 002c50e29d black format 2024-08-27 18:25:30 +05:00
Andrej730 d2efb2ab78 operator to toggle container elements
Example - https://imgur.com/a/Sy83Tnz
2024-08-27 18:25:30 +05:00
Andrej730 8bb78959ef h5 cache - improve logs
Now there are logs when cache was successfully loaded/created/failed to load.
2024-08-27 18:25:30 +05:00
Andrej730 48f0dc6a00 bim.purge_hdf5_cache to skip currently loaded cache
Previously it would fail with:
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'bonsai\\bim\\data\\cache\\988c190483ae6bab7cf6b00cee78694d.h5'
2024-08-27 18:25:30 +05:00
Andrej730 27aee31adf typing 2024-08-27 18:25:29 +05:00
Bruno Perdigão 24aaefb927 Polytool, fixed error with setting the plane method 2024-08-27 10:03:02 -03:00
Bruno Perdigão 7daec25454 Polytool, fixed decorator to show the mouse snapping point on top. 2024-08-27 10:03:02 -03:00
Andrej730 8309b13db0 reveal element filters and drawing underlay panels just if drawing is active
Those two panels were requiring drawing's camera to be active object which was a bit confusing since "Active Drawing" section above worked fine without selecting camera explicitly.

https://i.imgur.com/wcmA73Z.png
2024-08-27 17:55:44 +05:00
Andrej730 5e95985d19 Fix error setting integer properties in bim tests 2024-08-27 11:33:58 +05:00
Andrej730 fefe325ece Fix workflow for tests requiring Sun Position extension 2024-08-27 11:33:21 +05:00
Bruno Perdigão b717abf639 Polytool: small fix for Z axis line decorator 2024-08-26 17:11:20 -03:00
Bruno Perdigão 32ae12b45a Polytool: added on screen snap information. 2024-08-26 17:11:19 -03:00
Bruno Perdigão 48b74ebb76 Polytool: creates a decorator to show instructions on the screen. 2024-08-26 17:11:19 -03:00
Bruno Perdigão 197d0b3258 Fixed issue with X, Y and Z input for polytool.
This issue was caused by the change to X, Y, Z keys for lock axis.
2024-08-26 17:11:19 -03:00
Bruno Perdigão 2a1bc30f19 Polytool improved axis lock and mixed snapping
You can now lock into an axis while snapping to an object.
The result will be to closer point. In the future, there should
be a way for the user to select between different points.
2024-08-26 17:11:19 -03:00
Bruno Perdigão 6dcbd98769 Fixed error for measure tool when working with top or side view. 2024-08-26 17:11:19 -03:00
Bruno Perdigão 1be025ed86 Fixed typo 2024-08-26 17:11:19 -03:00
Bruno Perdigão 6fa87a16ab Polytool refactor for selecting plane and axis snap.
User can now select X, Y, Z to lock to an axis, and
S-X, S-Y and S-Z to lock to a plane.
2024-08-26 17:11:19 -03:00
Cristian Ritter a450c24739 Merge branch 'v0.8.0' of https://github.com/csritter/IfcOpenShell into v0.8.0 2024-08-26 15:34:55 -03:00
Cristian Ritter 56d19039e3 always apply in diffuse color, if doens't have surface color
Signed-off-by: Cristian Ritter <cristian_ritter@hotmail.com>
2024-08-26 15:34:50 -03:00
Ziad-I 8c19b695ea fix drawings and sheets paths not being normalized
which lead to the paths sometimes having both / and \\
2024-08-26 20:07:50 +03:00
Ziad-I 5831c56380 remove left over print :) 2024-08-26 16:29:09 +03:00
csritter 2b8124071a Merge branch 'v0.8.0' into v0.8.0 2024-08-26 10:26:10 -03:00
Cristian Ritter 9fceec35cc add diffuse on surface, if has no surface color
Signed-off-by: Cristian Ritter <cristian_ritter@hotmail.com>
2024-08-26 10:17:50 -03:00
Andrej730 3dde1b80b9 Fix errors initializing hdf5 cache #4832 2024-08-26 17:33:23 +05:00
Andrej730 08dd8f87ff Operator to select document related objects
https://i.imgur.com/4gXAram.png
2024-08-26 17:15:44 +05:00
Andrej730 1c3cf44122 get_referenced_elements to support IfcExternalInformation 2024-08-26 17:15:44 +05:00
Andrej730 868454c011 delete brick.ttl (added in d1d9db3) 2024-08-26 17:15:44 +05:00
Andrej730 edcfcd8850 Fix error if user hit shift-a in Annotation Tool without any drawing active 2024-08-26 15:47:00 +05:00
Andrej730 33bbf9fc53 remove debug print in collector.assign 2024-08-26 15:47:00 +05:00
Andrej730 286e90e299 Add annotation by default to the active drawing #5216
Approach in 358c834 didn't worked out because annotations are assigned to the drawing after assign_class and we can't check in assign_class whether it's going to be part of the drawing.
2024-08-26 15:46:59 +05:00
csritter ae2933eea5 prevent a copy
Co-authored-by: Thomas Krijnen <t.krijnen@gmail.com>
2024-08-26 01:08:06 -03:00
Bruno Perdigão 5aa7758795 Small fix in angle input for polytool 2024-08-25 21:36:11 -03:00
Bruno Perdigão 6c47baf0de Small fix in polytool with angle input when working with millimeters units 2024-08-25 19:13:27 -03:00
Bruno Perdigão 51018177cd Added option for wall_from_to_points not round the length and angle.
This function was hard coded to round length angle, now it has an option.
I assume it was originally built like this because it was supposed to
work only with Grease Pencil.
2024-08-25 19:07:50 -03:00
Bruno Perdigão be9719f5ca Fixed issue with creating duplicated points in polytool 2024-08-25 18:53:53 -03:00
Bruno Perdigão 9193ff7252 Fixed error with raycast in orthogonal view 2024-08-25 18:42:00 -03:00
Bruno Perdigão 53c3019b73 Small fix 2024-08-25 18:36:20 -03:00
Bruno Perdigão 6bbf3d3917 Refactor snapping functions and allow to choose snapping point.
By pressing "M", the user can now cycle through active snapping points when
there are many options close to each other. Still lacks a text to give
information about the active point.
2024-08-25 18:27:10 -03:00
Ziad-I 47a15011f6 add button to drawings panel to open documentation web ui page
might need a different icon since the URL icon is used by the open_drawing button
2024-08-25 21:38:15 +03:00
Ziad-I f26f6dfe5e fix broken display for multiple spreadsheets due to absolute position
removed absolute positioning as it made spreadsheets on top of each other
and made the spreadsheet's width and height as full screen as possible. also, add a separating margin between two spreadsheets.
2024-08-25 20:30:20 +03:00
Ziad-I 1745a4fd39 fix theme data not being sent when all Bonsai's are disconnected 2024-08-25 17:50:26 +03:00
Dion Moult fcaac3787b Continuing work to update docs 2024-08-25 22:15:12 +10:00
Thomas Krijnen 2d3adce59e Compatibility fix for v0.8 wrapper instances 2024-08-25 10:51:10 +02:00
Thomas Krijnen 7e6607adcf black 2024-08-25 10:39:57 +02:00
Thomas Krijnen 46c62d7cdb Add no-parallel-mapping setting to type literal 2024-08-25 10:33:54 +02:00
Thomas Krijnen c521892ca2 ::impl to make msvc17 a bit happier 2024-08-25 09:54:44 +02:00
Dion Moult d4a0dd1527 Split header and panel tool UI into two functions. Align related tool buttons together. 2024-08-25 15:43:55 +10:00
Dion Moult 527cdd3304 General interface docs 2024-08-25 14:55:21 +10:00
tim 31e836cfb4 png icons added 2024-08-25 14:54:30 +10:00
tim 86f123b6b0 Icons to header & sidebar 2024-08-25 14:54:30 +10:00
Thomas Krijnen fea8e3a5c9 Perform similar face bound lenciency in cgal kernel 2024-08-24 20:03:44 +02:00
Thomas Krijnen 3137904055 Perform mapping in parallel (or --no-parallel-mapping) 2024-08-24 20:03:44 +02:00
Bruno Perdigão f89dee7668 Fixed angle input for imperial units in polyline wall and measure tool. 2024-08-24 15:02:22 -03:00
Ziad-I c042d1afe5 make container padding/margin consistent over all pages 2024-08-24 18:48:58 +03:00
Ziad-I 42fc72bd4f add favicon to web UI 2024-08-24 18:12:13 +03:00
Bruno Perdigão f72c128ba6 Improved validation for inputs in polyline wall and measure tool. 2024-08-24 11:48:39 -03:00
Bruno Perdigão 3ceeaa739f Small fix on format_distance to show zero like 0'. 2024-08-24 11:48:39 -03:00
Thomas Krijnen 7a2e58944e clang (rightfully) complains about missing include 2024-08-24 15:00:49 +02:00
Dion Moult b9855b289f More qto and spatial tests. Tests can now select items in a UIList. 2024-08-24 22:48:37 +10:00
Dion Moult c7a8fd9309 More Qto tests and you can now spy on UILists and enum items 2024-08-24 21:39:46 +10:00
Thomas Krijnen daa6b31c5d msvc17 workaround 2024-08-24 13:24:23 +02:00
Dion Moult cd411e1f14 Add smoke tests for colour by property feature 2024-08-24 14:20:13 +10:00
Dion Moult 7a168069f7 Add solar analysis panel UI tests 2024-08-24 13:34:40 +10:00
Bruno Perdigão 97d2e08286 Initial implementation of unit handling for wall polyline tool.
The input panel now works with meters, millimeters and imperial units.
2024-08-23 17:33:34 -03:00
Thomas Krijnen f440a3ca17 Revert OCCT version to 7.5.3 due to HLR poly/edge behaviour 2024-08-23 20:54:06 +02:00
Thomas Krijnen 81bdb551ab SvgSerializer fix: Z == 2 2024-08-23 20:43:27 +02:00
Thomas Krijnen 5fdad744d3 Cgal kernel: Fail boolean op altogether when part conversion to Nef fails 2024-08-23 20:42:32 +02:00
Thomas Krijnen ab6f408db4 Unify edge orientation logic among kernels 2024-08-23 20:41:42 +02:00
Thomas Krijnen cdf8b9c038 Cgal kernel: taxonomy::line is intended to run along local Z 2024-08-23 20:41:17 +02:00
Thomas Krijnen 918fb41a7e Unify face bound counting logic among kernels 2024-08-23 20:39:20 +02:00
Thomas Krijnen 1d8e39e55f NB! For now let's use Epick for cgal-simple instead of actually Simple_cartesian 2024-08-23 20:38:38 +02:00
Thomas Krijnen b0b65e550c dispatch_curve_creation based on template magic instead of dynamic casting 2024-08-23 20:36:47 +02:00
Thomas Krijnen a1527a7e31 --use-material-names no longer in serializer_settings 2024-08-23 20:35:01 +02:00
Ziad-I 2ca3f86fc9 add RMB context menu to tables to set top calc type 2024-08-23 21:30:21 +03:00
Thomas Krijnen d80bcd1a94 Unify variant storage (#5118) 2024-08-23 20:29:07 +02:00
Ziad-I 60a06138d2 edit index.css for color consistency 2024-08-23 19:34:15 +03:00
Andrej730 e2001e82dd fix (hopefully) last failing test in github workflow 2024-08-23 17:25:10 +05:00
Andrej730 92f4cb0ffa fix error reloading camera representation
After 4b4ede7 it was leading to non-existing code
2024-08-23 17:25:10 +05:00
Andrej730 9f00e8aef0 Use Point RepresentationType for point clouds in ifc4x3
PointCloud representation type marked as deprecated in ifc4x3, see https://ifc43-docs.standards.buildingsmart.org/IFC/RELEASE/IFC4x3/HTML/lexical/IfcShapeRepresentation.htm
2024-08-23 17:25:10 +05:00
Andrej730 638d200a27 fix error switching to point cloud representation
Previously it wasn't handled and would always result in errors. It seems the only way to load point cloud representation to BBIM was by loading IFC file and only if this is the only representation of the element.
2024-08-23 17:25:10 +05:00
Andrej730 59717d6e92 fix tests after a4a2497f33 2024-08-23 17:25:10 +05:00
Andrej730 009795f7dc More reliable way to get bbim package name #5214
See #5214 for details, can't rely on 'bpy.context.preferences.addons' as it may contain a missing addons too (if addon was manually uninstalled and it won't be able to load but it will still appear in 'addons').
2024-08-23 17:25:10 +05:00
Andrej730 a0792a4b93 typing 2024-08-23 17:25:09 +05:00
Ziad-I 8534b6e154 fix first demo message not showing 2024-08-23 19:34:35 +10:00
Ziad-I 7910a68028 add more details in demo page 2024-08-23 19:34:35 +10:00
Ziad-I d44ee9874b Bonsai web ui templates 2024-08-23 19:34:35 +10:00
Ziad-I 8cd86581ff handle operators from demo page 2024-08-23 19:34:35 +10:00
Ziad-I 0a5b6a41b0 add demo html/css/js 2024-08-23 19:34:35 +10:00
Ziad-I 7bac468151 add demo endpoint and event listener 2024-08-23 19:34:35 +10:00
Ziad-I b375579dcd add new webui demo panel in demo module 2024-08-23 19:34:35 +10:00
Dion Moult d3d1ca0169 Fix bug where select similar property didn't work 2024-08-23 15:29:19 +10:00
Dion Moult 2b0572af10 New feature to filter pset / qto quickly in the panel
Ever work regularly with models that have 30 or more properties per element?
2024-08-23 15:20:47 +10:00
Dion Moult ed6365b292 You can now filter spatial containers by name, long name, or class 2024-08-23 14:27:22 +10:00
Dion Moult e3b1e0773f Show grouping panel by default 2024-08-23 14:20:37 +10:00
Dion Moult 3d38068b90 Unindent project in spatial tree to save space 2024-08-23 14:20:32 +10:00
Dion Moult a4a2497f33 You can now filter and search in the spatial decomposition panel 2024-08-23 13:49:45 +10:00
Dion Moult 1ef2fb89af Show annotations and hide openings in spatial decomposition element filter 2024-08-23 13:48:19 +10:00
Bruno Perdigão 902d777574 Fix removing the dimension decorator in measure tool. 2024-08-22 17:44:48 -03:00
Bruno Perdigão 3bd0caade1 Fixed Polyline Wall after changes in Measure tool input 2024-08-22 16:11:22 -03:00
Bruno Perdigão 301cb4bbdc Small fix in TAB behavior for measure and polyline tool 2024-08-22 15:55:05 -03:00
Bruno Perdigão f0338ffdda Measure tools now shows decorator for the dimension of every line and the angles between them. Area calculation was removed and will be introduced in another operator 2024-08-22 15:54:11 -03:00
Dion Moult 2100528cbe Rebrand to Bonsai in IOS-Python docs 2024-08-23 00:12:11 +10:00
Dion Moult ae4f681f73 Remove superseded test 2024-08-22 23:58:15 +10:00
Dion Moult 53d7624fc4 Work in progress starting to restructure docs in preparation for next release 2024-08-22 23:56:59 +10:00
Andrej730 951b2b76a6 small fix for 94f5137684 2024-08-22 18:34:13 +05:00
Andrej730 e9b4b6560e drawing.create_camera not to assign camera to the scene collection
Noticed that added drawing camera was linked to the scene collection and after collector.assign it was linked to the 2 collections instead of just 1 - it's own drawing collection and the scene collection.
2024-08-22 18:34:13 +05:00
Andrej730 cabffdc549 fix tests after 4e48c35425 2024-08-22 18:33:21 +05:00
Andrej730 7ea60742d6 fix typo 2024-08-22 18:28:50 +05:00
Andrej730 358c834427 fix bim tests after 143e094
drawings and annotations that are part of some drawing don't need to be added to the spatial hierarchy
2024-08-22 18:28:50 +05:00
Andrej730 5d6655cbc7 fix issue adding drawing representation after ef04402ed8 2024-08-22 18:28:50 +05:00
Andrej730 4d122d77dc load_from_memory prop - add description 2024-08-22 17:20:48 +05:00
Dion Moult d4e863ed3b Replace BlenderBIM branding with Bonsai in docs 2024-08-22 21:02:19 +10:00
Dion Moult b6ccf505e7 Fix #5177. Refresh georeferencing viz data after data purged. 2024-08-22 20:18:13 +10:00
Dion Moult ce9842983b Fix #5037. Remove deprecated pie menu. 2024-08-22 19:59:55 +10:00
Dion Moult eb19b26a6e Revert xlsx feature, just csv for now
Don't want another dep
2024-08-22 17:24:43 +10:00
Dion Moult 06602d0e39 Download CSV/XLSX from web 2024-08-22 17:22:38 +10:00
Dion Moult 00279b63de Show sum of columns on web spreadsheet, really useful for qto 2024-08-22 17:22:29 +10:00
Dion Moult 6418353119 You can now filter headers in web spreadsheets 2024-08-22 17:22:09 +10:00
Dion Moult 3afbbe51d2 Make spreadsheets fullscreen
Spreadsheets from multiple sessions need to be redesigned to perhaps use tabs or split windows or something else
2024-08-22 17:21:48 +10:00
Dion Moult ddb767674b Fix bug where there would be missing data in web spreadsheets
See https://github.com/olifolkerd/tabulator/issues/3135
2024-08-22 15:37:04 +10:00
Bruno Perdigão 5575ea8296 Polyline and Measure tool now use right-click to confirm input 2024-08-21 23:01:06 -03:00
Bruno Perdigão e8a7a032aa Changed the order of the input panel for Polyline and Measure tool. Distance and Angle now come first. 2024-08-21 22:56:12 -03:00
Bruno Perdigão f23e419685 Fixed bug in Polyline and Measure tool. The input calculation was wrong when you had only one point in the polyline 2024-08-21 22:56:12 -03:00
Bruno Perdigão b87e8136af Raycast and Snap refactor. Snap now works with objects with no faces 2024-08-21 22:56:12 -03:00
Bruno Postle 473d0ae888 Remove Association op cleans blenderbim & bonsai
The remove *.ifc Association removes any stale Linux BlenderBIM
associations as well as Bonsai associations, this should now give a
clean upgrade path. Closes #5212
2024-08-21 21:11:11 +01:00
Andrej730 94f5137684 fix poll error messages addressing empty enum 2024-08-21 18:36:12 +05:00
Andrej730 4e75945435 add surface styles preview (based on their blender materials)
Example - https://i.imgur.com/jH9q7iF.png
2024-08-21 18:36:11 +05:00
Andrej730 e31019eb67 fix issue adding bcf topic viewpoints
missed the set statement which is requirement to make it work for all cases
2024-08-21 18:36:11 +05:00
Andrej730 c505630a20 fix error removing bcf topic comment 2024-08-21 18:36:11 +05:00
Andrej730 860fa81f73 bonsai bcf - activate comment's viewpoint
Example - https://imgur.com/a/iUMgpVm
2024-08-21 18:36:11 +05:00
Andrej730 847b5d226e bim.add_bcf_comment - poll message 2024-08-21 18:36:11 +05:00
Andrej730 ad77d09916 fix bug in bonsai bcf v3 api
it wasn't setting reference links / document references / labels if Topic container for them wasn't created before
2024-08-21 18:36:11 +05:00
Andrej730 9b12cae8b4 bcf bonsai - create bcf v3 projects and display loaded bcf version
Example - https://imgur.com/a/3ZSGtw7
2024-08-21 18:36:11 +05:00
Andrej730 84a8c5dfeb bim.convert_to_blender to ignore linked files 2024-08-21 18:36:11 +05:00
Andrej730 12a7b8a79e bim.convert_to_blender to avoid types without mesh properties 2024-08-21 18:36:11 +05:00
Andrej730 ef04402ed8 Fix Image empty interpreted as Mesh #5194
Apparently we can't trust `obj.data == None` to identify empties since in Blender there are empties that can use `bpy.types.Image` as their `obj.data`.
2024-08-21 18:36:10 +05:00
Andrej730 45fed747c2 fix failing test in model module
it was failing because type object was hidden in viewport and was unselectable
2024-08-21 18:36:10 +05:00
Dion Moult 85229fc865 Fix #5204. Bug where you could attempt to add IFC objects in edit mode which isn't allowed. 2024-08-21 22:22:46 +10:00
tim 916f854905 Update ifccsv.rst
BlenderBIM to Bonsai changes
2024-08-21 22:06:08 +10:00
tim 1915541d20 Update ifcconvert.rst
Changed BlenderBIM Add-on to Bonsai
2024-08-21 22:05:48 +10:00
tim e37b84a95a Update introduction.rst
Replaced BlenderBIM with Bonsai
2024-08-21 22:05:34 +10:00
tim bcb2a37ce0 Removed Linux defaults to not confuse mac users 2024-08-21 22:05:14 +10:00
tim 018d6847a0 Update blenderbim.rst
replaced BlenderBim text with Bonsai
2024-08-21 22:04:44 +10:00
Dion Moult 35918265d0 Fix bug on Linux where INBETWEEN_MOUSEMOVE is fired for measure tool 2024-08-21 21:47:41 +10:00
Dion Moult 4e48c35425 Remove old dumb stair, superseded by new clever stair (now just called stair) 2024-08-21 21:19:27 +10:00
Dion Moult d985fe9240 Fix #5205. Regression in creating walls / slabs / profiles / products with potentially no default container. 2024-08-21 21:09:29 +10:00
Dion Moult 7c00021aaa You can now toggle flat shading when showing colourschemes 2024-08-21 20:55:35 +10:00
Andrej730 d2dc8b519f fix for ef835e43b8 2024-08-21 15:14:15 +05:00
Andrej730 25fe025354 bonsai file association files #5212 2024-08-21 15:13:59 +05:00
Andrej730 1aae710286 Restore file association files removed by accident #5212 2024-08-21 15:13:59 +05:00
Andrej730 38e8130793 stop ignoring src/bonsai/bonsai/libs
After #4373 with new folder structure 'libs' is no longer used to store dependencies and there is no need to ignore it.
2024-08-21 15:13:58 +05:00
Dion Moult 7e94388074 You can select a colourscheme key via search / dropdown now rather than typing a query 2024-08-21 18:50:55 +10:00
Andrej730 ef835e43b8 bim.save_uv_to_style - support saving uv to objects without a style
There was a problem with assigning uv workflow if object wasn't originally from IFC - saving uv requires object to have IfcSurfaceStyle but assigning IfcSurfaceStyle would reload representation discarding UV.

So, the current workflow for saving non-ifc objects uv to ifc:
1) Assign class to ifc object
2) Create IfcSurfaceStyle with a texture (currently also requires a rendering style)
3) Use "Save UV To Style"

Example - https://imgur.com/a/GZqo38M
2024-08-21 12:33:25 +05:00
Andrej730 e5d0eb13bf Show in UI if representation item has UV mapping / colour map
Example - https://i.imgur.com/bWV4dRj.png
2024-08-21 12:33:25 +05:00
Andrej730 4fcf23319f Show in UI an operator for saving UV
It was lost when we deprecated style UI in materials tab.
Button location - https://i.imgur.com/V57MKU2.png

Also added some minor tweaks.
2024-08-21 12:33:25 +05:00
Dion Moult 99154afdb1 You can now specify custom min/max for quantitative legends 2024-08-21 16:34:10 +10:00
Dion Moult e83eb68fe1 Add seaborn colour palletes for tab10, paired, rocket, mako, spectral, and coolwarm
This covers three usecases: qualitative, quantitative min->max, and quantitative middle with low/high
2024-08-21 15:27:21 +10:00
Dion Moult e4a4a33920 Add support for colouring by quantitative colour legend, not just qualitative categories 2024-08-21 14:02:41 +10:00
Dion Moult e8848c9701 Natsort is now a dependency. We'll be using it to do better sorting everywhere. 2024-08-21 14:01:32 +10:00
Bruno Perdigão cfd8044cb3 Fixed bug related to pressing shift for plane selection 2024-08-20 17:47:02 -03:00
Bruno Perdigão 2d7866570e Fixed bug for x, y, z calculation 2024-08-20 17:47:02 -03:00
Bruno Perdigão eb0ed7fe6b Fixed bugs related to shift and added Z as input option 2024-08-20 17:47:02 -03:00
Bruno Perdigão 67733c4449 Improved calculation for coordinates from distance and angle 2024-08-20 17:47:02 -03:00
Bruno Perdigão b3940cdc45 Minor refactor and clean up 2024-08-20 17:47:02 -03:00
Bruno Perdigão 94e75aebb0 Added area calculation to the input panel 2024-08-20 17:47:02 -03:00
Bruno Perdigão ff203b2a13 Changed decorator name to PolylineDecorator 2024-08-20 17:47:02 -03:00
Bruno Perdigão 10616df494 black format 2024-08-20 17:47:02 -03:00
Bruno Perdigão 1dc6d4935e Polyline tool: improved plane selection method and decorators 2024-08-20 17:47:02 -03:00
Bruno Perdigão 04088af2b6 small fix 2024-08-20 17:47:02 -03:00
Bruno Perdigão c477173096 Improved plane selection for Measure tool 2024-08-20 17:47:02 -03:00
Bruno Perdigão 2f4093f958 Fixed decorator for mixed snaping 2024-08-20 17:47:02 -03:00
Bruno Perdigão 95fc51da76 Created function to mix snap point with axis lock in polyline tool 2024-08-20 17:47:02 -03:00
Bruno Perdigão 50e629c02c Removed code after refactor 2024-08-20 17:47:02 -03:00
Bruno Perdigão 4a178fca58 Fixed error in polyline tool, when two points where add at the same location sequentially 2024-08-20 17:47:02 -03:00
Bruno Perdigão aff5b238d9 WIP: Added possibility to change plane intersection method 2024-08-20 17:47:02 -03:00
Bruno Perdigão 315b6060b0 WIP: Changed coordinates, distance and angles calculations to allow for 3d vectors 2024-08-20 17:47:02 -03:00
Bruno Perdigão b137197586 Changed input validantion to Snap tool 2024-08-20 17:47:02 -03:00
Bruno Perdigão d1d9db3ed8 WIP: started refactoring to develop the measure tool with most of the logic from polyline wall 2024-08-20 17:47:02 -03:00
Cristian Ritter 7d50491a99 checking if diffuse has value, if not, use surface
Signed-off-by: Cristian Ritter <cristian_ritter@hotmail.com>
2024-08-20 12:16:19 -03:00
Cristian Ritter 371b4b6079 removing unnecessary use_surface_color on calc_hash 2024-08-20 11:45:29 -03:00
Cristian Ritter d714eca4ee replacing diffuse to get_color method 2024-08-20 11:44:20 -03:00
Andrej730 736b50c6fa bonsai bcf - fix issue when viewpoints were not reloaded
when new bcf file was loaded
2024-08-20 18:39:09 +05:00
Andrej730 64b96633c2 bonsai bcf v3 - support working with viewpoints #2790
Also fixed a bug when removing viewpoint always removed the last viewpoint
2024-08-20 18:39:09 +05:00
Andrej730 8eae997053 bcf v3, bonsai bcf v3 - support extracting files #2790
extracting files in general is also improved - now it's possible to extract a file that was just added to bcf in memory and not yet saved to the disk.

Update model.py
2024-08-20 18:39:09 +05:00
Andrej730 fee56fc120 bonsai bcf - remove "bim.edit_bcf_author"
bcfxml doesn't actually have "author" field - this field is not stored in bcf, it's just needed as an UI for author for newly added comments and topics.
2024-08-20 18:39:09 +05:00
Andrej730 d1f87d5467 fix bug in 71ddc6384a 2024-08-20 18:39:09 +05:00
Andrej730 7539404c27 bcf v3 & bonsai bcf v3 - support adding/removing header files #2790
Also removed unnecessary read in AddBcfDocumentReference.
2024-08-20 18:39:08 +05:00
Cristian Ritter cd3df94a4b add surface and use_surface_color on style class 2024-08-19 18:44:43 -03:00
Cristian Ritter 0efafada1d fixed missing SurfaceColour on SettingsContainer 2024-08-19 18:41:45 -03:00
Andrej730 71ddc6384a bonsai bcf v3 - support adding/removing related topics #2790
Not entirely sure about TopicHandler.guid typing, just made it consistent with v2 for now.
2024-08-19 18:44:33 +05:00
Andrej730 4b402f8ea5 bonsai bcf - dropdown for related topics
Previously you had to type in exactly manually.
Besides the dropdown it should also show now a topic description in the dropdown items tooltips.
Removed "bim.add_bcf_related_topic" poll as it should be now covered by the enum.

Example - https://imgur.com/a/xhgcGWI
2024-08-19 18:44:33 +05:00
Andrej730 c39fa80e09 bonsai bcf v3 - support working with topics #2790 2024-08-19 18:44:33 +05:00
Andrej730 c89ad8c7da related topic - poll message set 2024-08-19 18:44:33 +05:00
Andrej730 6dfe46d9bd bonsai bcf - add default project for bcf v3, fix small possible issue with bcf v2
In theory in bcf v2 there could be a project with project info but without project.
2024-08-19 18:44:33 +05:00
Andrej730 1de51ecf77 bonsai bcf - fix bim snippet ui issue
schema is optional field in bcf v2 and it was unreliable to use it to detect whether bim snippet is present or not
2024-08-19 18:44:33 +05:00
Andrej730 8a55f18c95 bonsai bcf - poll message for adding bim snippet 2024-08-19 18:44:32 +05:00
Andrej730 7a1976cfc1 bonsai bcf - show info message when project is saved/loaded
to make ui more responsive
2024-08-19 18:44:32 +05:00
Andrej730 78c6401453 bonsai bcf v3 - support working with bim snippets 2024-08-19 18:44:32 +05:00
Andrej730 e12838d93e bonsai bcf v3 - support working with comments #2790 2024-08-19 18:44:32 +05:00
Andrej730 7aa5b71a6a bcf - comments setter api 2024-08-19 18:44:32 +05:00
Andrej730 2ef3af5e1b bonsai bcf - make document reference uneditable
as this data is not really editable and won't be saved
2024-08-19 18:44:32 +05:00
Andrej730 d399f7c6b7 bonsai bcf - add save current project button
Now there are two separate buttons - "save project" and "save project as".
Example - https://i.imgur.com/1vuVfgi.png
2024-08-19 18:44:32 +05:00
Andrej730 beb7f75368 bonsai - bcf v3 document references #2790 2024-08-19 18:44:32 +05:00
Andrej730 dc6fdc2a98 typing 2024-08-19 12:26:49 +05:00
Thomas Krijnen 45be17c25a Remove duplicate UseMaterialNames setting binding #5191 2024-08-19 09:15:49 +02:00
Dion Moult 4f11b19b3d Update install instructions for Bonsai 2024-08-18 22:22:21 +10:00
Ryan Schultz f646cf4372 Removes the style from all selected objects 2024-08-17 13:36:10 -05:00
Ziad-I 538859f60a make has_started check for both pid and port
this solves the issue when a user has not killed a previous server so the port of that server wasn't removed from the pid file, which would make has_started return true even if server hasn't started yet.
2024-08-16 20:52:39 +10:00
Ziad-I 75da994faf fix gantt display when there are no dependencies 2024-08-16 20:52:39 +10:00
Ziad-I 99827df89a fix setting color-scheme css property 2024-08-16 20:52:39 +10:00
Ziad-I 054a900779 edit names of pages and paths for them 2024-08-16 20:52:39 +10:00
Ziad-I e800f8b93d docstrings and formating 2024-08-16 20:52:39 +10:00
Ziad-I 7163697362 add open different web UI pages on starting it up 2024-08-16 20:52:39 +10:00
Ziad-I 29600711ae make webui default for work schedules and simplfy condition 2024-08-16 20:52:39 +10:00
Ziad-I 1d0ee61ba7 fix dependency display bug
dependency was not being displayed correctly due to calling draw on Gantt before appending it to the DOM, I think?
2024-08-16 20:52:39 +10:00
Ziad-I fb909ace1a edit condition if user tries to export to web with no server
previously it was just checking if there was a server running but not if blender was connected to a server, this was being handled in the operator itself which isn't the best.
2024-08-16 20:52:39 +10:00
Ziad-I 6ae5dbacf4 make web default format when exporting 2024-08-16 20:52:39 +10:00
Ziad-I 52bffa7f9c handle edge case not covered by last commit 2024-08-16 20:52:39 +10:00
Ziad-I e9a502ccec fix error when exporting an empty csv 2024-08-16 20:52:39 +10:00
Ziad-I f3d4eed19e split addGanttElement function into smaller functions
for code organization and readability
2024-08-16 20:52:39 +10:00
Ziad-I d260298ab2 fix printing when there is multiple gantt charts 2024-08-16 20:52:39 +10:00
Ziad-I c7d0cff300 edit or commented left over console.log 2024-08-16 20:52:39 +10:00
Ziad-I 631deeb094 fix connected list appearing in printing 2024-08-16 20:52:39 +10:00
Ziad-I 953a49f9ae add different bg color for work schedule table rows 2024-08-16 20:52:39 +10:00
Ziad-I 2e94a7c3f1 move outdated gantt warning into connected list 2024-08-16 20:52:39 +10:00
Ziad-I 68f10e1502 move outdated data warning into connected list for csv page 2024-08-16 20:52:39 +10:00
Ziad-I 625a57c6de change used text color for warnings 2024-08-16 20:52:39 +10:00
Cristian Ritter 876f059459 remove surface white if doesn't have surface colour
Signed-off-by: Cristian Ritter <cristian_ritter@hotmail.com>
2024-08-15 14:18:13 -03:00
Cristian Ritter b5a61753a5 Adding --surface-color in conversion settings to force the use of surface color instead of diffuse color. Issue #5075 2024-08-15 13:56:31 -03:00
Andrej730 4348b9bff9 bonsai - bcf v3 referenced links support #2790 2024-08-15 18:18:11 +05:00
Andrej730 28ee1a7781 bonsai - dropdown for new bcf topic labels (same as f1db51df1a) 2024-08-15 18:18:11 +05:00
Andrej730 d40119d617 bonsai - more bcf v3 support and lots of todos #2790 2024-08-15 18:18:11 +05:00
Andrej730 774533911c bonsai - fix issues loading bcf v3 #2790 2024-08-15 18:18:10 +05:00
Andrej730 7597b1b29c bonsai, ifcopenshell - append IfcSurfaceStyles from other projects
And other IfcPresentationStyles, though they are not currently supported by bonsai.

Example - https://imgur.com/a/AHlvowp
2024-08-15 18:18:05 +05:00
Andrej730 bd8a2736d4 typing 2024-08-15 18:18:05 +05:00
Andrej730 aafb4b6147 fix missing import in 2066ebcc11 2024-08-14 19:54:45 +05:00
Andrej730 2066ebcc11 bbim, bcf - add simple operator to quickly load ifc file from bcf header
Example - https://imgur.com/a/rieFwNI
2024-08-14 18:44:53 +05:00
Andrej730 795ebc0ac1 remove uninstall/update instructions from preferences
Since 06c8a9e there's no longer issue with loaded binaries preventing to reload the addon on Windows, which works for 4.2.0 and in 4.2.1 we'll have https://projects.blender.org/blender/blender/issues/125049 which essentially does the same, moves the binaries out of the way.

Upgrade also works fine and we have a warning from 3d4c85c to indicate that user should restart Blender after upgrade.
2024-08-14 17:16:25 +05:00
Andrej730 7612cf92c0 remove donate button from bonsai preferences #4373
As per Blender request, see https://extensions.blender.org/approval-queue/bonsai/#activity-2480
2024-08-14 17:03:43 +05:00
Andrej730 db1f4d126a bonsai web module #5178
Ping @Ziad-I just in case
2024-08-14 16:49:34 +05:00
Andrej730 b15820dd10 bonsai libs/desktop #5178 2024-08-14 16:49:34 +05:00
Andrej730 f8f7884278 bonsai other scripts #5178 2024-08-14 16:49:34 +05:00
Andrej730 3318de7f6d bonsai main extension files #5178 2024-08-14 16:49:34 +05:00
Andrej730 726bf40d58 bonsai core module imports #5178 2024-08-14 16:49:34 +05:00
Andrej730 3860884db3 bonsai other ifcopenshell packages #5178 2024-08-14 16:49:34 +05:00
Andrej730 5784e3103d bonsai assets #5178 2024-08-14 16:49:34 +05:00
Andrej730 2a1d1d6e10 bonsaibim urls #5178 2024-08-14 16:49:34 +05:00
Andrej730 485643863f bonsai bim module imports #5178 2024-08-14 16:49:34 +05:00
Andrej730 c03777cfe6 bonsai tool module imports #5178 2024-08-14 16:49:34 +05:00
Andrej730 be442ff1be bonsai copyrights #5178 2024-08-14 16:49:34 +05:00
Andrej730 95e7910f69 bonsai .gitignore #5178 2024-08-14 16:49:34 +05:00
Andrej730 d5592ed2eb fix ifc4d copyright license 2024-08-14 16:49:34 +05:00
Andrej730 a29806ef9e bonsai dev_environment scripts #5178 2024-08-14 16:49:34 +05:00
Andrej730 3a9d79dcd3 bonsai makefile #5178 2024-08-14 16:49:34 +05:00
Andrej730 b9c2e312e3 black format 2024-08-14 16:49:34 +05:00
Andrej730 f1db51df1a blenderbim, bcf - add tooltips for topic attributes based on extensions
Example - https://imgur.com/a/mYiXqXn
2024-08-13 18:53:11 +05:00
Andrej730 312a58ddce bcf - readme note about code structure 2024-08-13 18:53:11 +05:00
Andrej730 1e71708aba bcf v2 - extensions support #3220
The api is the same as for bcf v3 though for bcf v2 they are currently available only in read-only mode.
2024-08-13 18:53:11 +05:00
Andrej730 ad6e00571e bcf v3 - add extensions tests 2024-08-13 18:53:11 +05:00
Dion Moult c8d05951b0 Rename choco dir 2024-08-13 23:47:26 +10:00
Dion Moult 0f8c3b3c83 Name change in workflows dir 2024-08-13 23:21:30 +10:00
Dion Moult 25071dfec6 Rename source dir 2024-08-13 23:09:50 +10:00
Dion Moult cc28f5a92b Search replace in test dir 2024-08-13 15:47:27 +10:00
Dion Moult a57a7041ac Search replace BlenderBIM with Bonsai 2024-08-13 15:45:33 +10:00
Dion Moult 17b90c3241 Search replace BlenderBIM Add-on with Bonsai 2024-08-13 15:40:54 +10:00
Dion Moult 90089f91c6 Minor fix 2024-08-13 15:28:03 +10:00
Dion Moult 37dd2a5607 G'day Bonsai! 2024-08-13 13:38:10 +10:00
Bruno Perdigão bc70130123 Polyline wall - you now can press 'C' to close the polyline 2024-08-12 16:01:25 -03:00
Bruno Perdigão 8d53141d5a Fix polyline wall generator for open polylines 2024-08-12 15:53:42 -03:00
Bruno Perdigão 0ffc62fbf3 lowered the threshold for the polyline snap to axis 2024-08-12 15:39:38 -03:00
Bruno Perdigão 4350e3df82 added shadow to polyline input panel text 2024-08-12 15:38:27 -03:00
Andrej730 2ad601ed34 bcf - fix make models after 237cd99 2024-08-12 18:04:45 +05:00
Andrej730 f9e8d6d478 bcf - fix issues with unexpected reloads from zip
It wasn't considering that self._topics could be an empty dict because there are no topics and it would also reload it. Now we have None value to distinguish when it actually wasn't loaded before.

Same for viewpoints, reference files and document references.

I've also imade mplementations identical/more similar between v2 and v3.
2024-08-12 17:31:52 +05:00
Andrej730 65cc5bf4c1 bbim bcf - fix issues setting visibility exceptions
1) bpy.ops.object.hide_view_set doesn't actually work with context provided selected objects - it's checking whether they're actually selected
2) bpy.ops.object.hide_view_clear wasn't using select=False, selecting revealed objects which might get in the way later.
3) used new api for getting visibility settings
2024-08-12 16:29:10 +05:00
Andrej730 73e5985777 bcf + bbim - set/get selected/visible elements #4857
1) added more high level api for getting/setting selected/visible elements in bcf
2) in bbim when you add a new viewpoint it will remember currently selected and visible objects:
https://imgur.com/a/2pZ79Z2
2024-08-12 16:29:10 +05:00
Andrej730 de14e92720 poll message 2024-08-12 16:29:10 +05:00
Andrej730 09ad47d11b remove debug prints 2024-08-12 16:29:10 +05:00
Andrej730 debe63c1af fix typo 2024-08-12 16:29:10 +05:00
Andrej730 6f2eb6c54a typing 2024-08-12 16:29:10 +05:00
Andrej730 56ca431965 bbim - load bcf files using drag'n'drop
Example - https://imgur.com/a/aK62slh
2024-08-12 16:29:10 +05:00
Andrej730 74e8b80fb4 bbim, bcf - expose topic attributes to edit from bbim #3026
Previously they weren't editable if they were not defined in .bcf already, so previously it was kind of requiring them to be defined by some other software, not BBIM.

Also changed couple prop names to make them more clear to users.
2024-08-12 16:25:41 +05:00
Andrej730 7ecfe372ad fix #5175 after 1626dd8 2024-08-12 15:19:02 +05:00
Andrej730 b017ab7596 black format after #5172 2024-08-12 15:19:01 +05:00
Junzhe Ren bd3905fe76 Update supported VS version installation.rst (#5174)
* Update installation.rst

2022 is now supported by dependency CMake

* Update installation.rst

Updates on Compiling on Windows (Visual Studio)
2024-08-12 15:17:08 +05:00
Bruno Perdigão 0c8048c14d Walls from polyline are now joined when generated 2024-08-11 21:57:16 -03:00
Bruno Perdigão 77f72ecdfa renamed the tools to Snap and Raycast 2024-08-11 21:57:16 -03:00
Bruno Perdigão 723701f1b8 Points are now added relative to default container Z value. 2024-08-11 21:57:16 -03:00
Bruno Perdigão bf96c63f7d moved raycasting functions to Raycasting module 2024-08-11 21:57:16 -03:00
Bruno Perdigão cef8251458 minor refactors 2024-08-11 21:57:16 -03:00
Bruno Perdigão 547981f32c Temporary solution for wall generation with polyline 2024-08-11 21:57:16 -03:00
Bruno Perdigão a3cc0245ca Started a system to lock on axis 2024-08-11 21:57:16 -03:00
Bruno Perdigão 5d934a2baa Improvements on how it handles the numbers input 2024-08-11 21:57:16 -03:00
Bruno Perdigão 4409a35441 small fix related to polyline decorator 2024-08-11 21:57:16 -03:00
Bruno Perdigão f637ef8016 black format 2024-08-11 21:57:16 -03:00
Bruno Perdigão 5e2cefee12 small change on input from keyboard 2024-08-11 21:57:16 -03:00
Bruno Perdigão 67b01dcd0f black format 2024-08-11 21:57:16 -03:00
Bruno Perdigão bc0efd7389 Added snaping to polyline points 2024-08-11 21:57:16 -03:00
Bruno Perdigão 4b4e6fa7e2 adds decorator to angle snap axis 2024-08-11 21:57:16 -03:00
Bruno Perdigão 17a0face6e Now the mouse snaps in angle axis in 30 degree intervals 2024-08-11 21:57:16 -03:00
Bruno Perdigão a3b2860789 added highlight color to the input panel 2024-08-11 21:57:16 -03:00
Bruno Perdigão f8f22257b4 fixed backspace for number input 2024-08-11 21:57:16 -03:00
Bruno Perdigão 8284ed0cdb Fix to allow calculations to work when no point was added yet 2024-08-11 21:57:16 -03:00
Bruno Perdigão d995e010cf WIP: calculates x and y based on distance and angle. Accepts negative input 2024-08-11 21:57:16 -03:00
Bruno Perdigão fcfc070825 WIP: Input panel receives x and y inputs from the keyboard 2024-08-11 21:57:16 -03:00
Bruno Perdigão 55552770a6 Input panel now shows coordinates, distance and angle 2024-08-11 21:57:16 -03:00
Bruno Perdigão 350df4eee5 WIP: Started the input system 2024-08-11 21:57:16 -03:00
Bruno Perdigão 04a273c720 Fixed problem with event type by using event value 2024-08-11 21:57:16 -03:00
Bruno Perdigão 61641acf56 Added 'Backspace' event to remove last polyline point 2024-08-11 21:57:16 -03:00
Bruno Perdigão 10035662dd Basic polyline implementation 2024-08-11 21:57:16 -03:00
Bruno Perdigão 056df7758b Improved performance. Objects are first select by their 2d bounding box related to the view. Then, just the objects close to the mouse use ray cast. 2024-08-11 21:57:16 -03:00
Bruno Perdigão 0522adac63 Added simple snap decorator 2024-08-11 21:57:16 -03:00
Bruno Perdigão 1f781e5cab added mouse offset for raycast 2024-08-11 21:57:16 -03:00
Bruno Perdigão a30fd7cab4 enabled snaping to ground plane 2024-08-11 21:57:16 -03:00
Bruno Perdigão 94ca2423e9 First implementation. Two types of raycast and basic snaping for faces,
edges and edge center.
2024-08-11 21:57:16 -03:00
Ryan Schultz 2938c1fd0b small tweak to the previous commits 2024-08-11 18:32:07 -05:00
Ryan Schultz ab8710bd1e schedule's background fill driven by .ods/xlsx, if it exists.
also added `.border` class to default schedule css.
2024-08-11 12:14:55 -05:00
Ryan Schultz a791abe23e fixes #4780: added preference for default location for schedule's css.
Also added a `border` class to style the schedule's border with css.  That is `fill`, `stroke-width`, and `stroke` are no longer hard-coded.
2024-08-11 11:53:58 -05:00
Chirag Singh e70122f354 Ran Black Formatting 2024-08-11 10:40:10 +10:00
Chirag Singh 96fdced471 1. Added a Json File having SpectralDB Materials. 2. Implemented UIList: Lists down the materials to be mapped with. 3. By default Not mapped material is white. 4. Added a Drop down for category and Subcategory from where the user can select the material from spectralDB 5. Corrected hardcoded render123.hdr as highlighted by Manu in #5033 2024-08-11 10:40:10 +10:00
Andrej730 1c95f6cc3f bcf - remove lru_cache in build_viewpoint #4857
disabling it as it currently won't allows users to create a different viewpoint for the same IFC element (in the same or other bcf file) and also entity position can change between `build_viewpoint` calls
2024-08-09 19:00:10 +05:00
Andrej730 0f03e412c3 bcf - port 3c17718 to v3
According to docs bcf is using meters as their length unit - https://github.com/BuildingSMART/BCF-XML/tree/release_3_0/Documentation

We should create some kind of common code folder to keep this sane...
2024-08-09 19:00:10 +05:00
Thomas Krijnen 6ca3e2a6db Attempt fix #5168 - Update release.yml 2024-08-09 15:54:41 +02:00
Thomas Krijnen 079446a4b6 Attempt fix #5168 - Update Dockerfile 2024-08-09 15:54:32 +02:00
Andrej730 e706e568bd bcf - option to provide snapshot filename + save warnings #4453
Example warning:
WARNING. Snapshot with viewpoint guid '6aff8c6e-216c-48c9-8120-3101816def3e' won't be saved to bcf. Only snapshot data (VisualizationInfoHandler.snapshot) is provided and snapshot filename (ViewPoint.snapshot) is missing.
2024-08-09 16:42:33 +05:00
Andrej730 526a2a6a80 bcf - return added viewpoint in add_visinfo_handler #4453 2024-08-09 16:42:33 +05:00
Andrej730 3e7a2c1b83 bcf - fix inconsistent return types in add_viewpoint #4887 2024-08-09 15:12:41 +05:00
Andrej730 9bb04d3ffc small fix for bcf docs
bcfxml.get_topic actually returns topichandler, not topic
2024-08-09 14:58:10 +05:00
Andrej730 7c4d45ab32 ci - fix ifcdiff dependencies 2024-08-09 14:29:38 +05:00
Andrej730 dafec70097 black format 2024-08-08 18:13:31 +05:00
Andrej730 eca1d47d06 typing 2024-08-08 18:12:45 +05:00
Andrej730 9671be1734 add a couple poll messages 2024-08-08 18:11:00 +05:00
Andrej730 644f32d11c Fix errors appending assets when projects are using georeferencing #5110 2024-08-08 18:11:00 +05:00
Andrej730 1626dd85f4 fix opening recent project showing file browser 2024-08-08 15:43:19 +05:00
Andrej730 3c0103b4da fix issues toggling EDIT mode
1) it was throwing errors if object was linked

2) bim.override_mode_set_edit wasn't considering that toggle_edit_mode might not work out and was changing BIMGeometryProperties.mode though it wasn't needed.
2024-08-08 15:12:57 +05:00
Dion Moult f9c4b6a98f Improve QTO of segment lengths
Previous method uses bounding box which could be wrong if the app (Revit) doesn't extrude in +Z and has a slope (e.g. most pipes). Also Revit tends to use rectangle profiles not for the cross section, but instead for the footprint which is crazy.
2024-08-08 15:13:34 +10:00
Dion Moult b01e93161e Use vertex buffer for more efficient centroids 2024-08-08 08:24:12 +10:00
Andrej730 ffbd3e50c5 typing 2024-08-07 20:27:21 +05:00
Andrej730 98c4a1d110 ifcdiff - add simple tests 2024-08-07 17:33:10 +05:00
Andrej730 e2c4bcb217 blenderbim - hide json output file and some operators if current ifc file is not used
It was misleading since those operators only worked with the current model and had no effect if it wasn't used in ifcdiff.
2024-08-07 17:33:10 +05:00
Andrej730 7e60b6888e ifcopenshell v0.8 fixes #5156 #4832 2024-08-07 17:33:10 +05:00
ArturTomczak bbf8ebcb52 add user-agent header to bSDD calls
As explained in: https://github.com/buildingSMART/bSDD/blob/master/Documentation/bSDD%20API.md#http-header-x-user-agent
2024-08-07 21:12:49 +10:00
Tim c1936b871e Renamed tools #3527 2024-08-07 21:12:29 +10:00
Ziad-I 31d67b5e62 fix bootstrap css conflict by adding dummy class in navbar a tags 2024-08-07 21:11:44 +10:00
Ziad-I 683e168ca1 add border radius to all pages 2024-08-07 21:11:44 +10:00
Ziad-I cbc0b4837f add icons to navbar and make it smaller 2024-08-07 21:11:44 +10:00
Ziad-I 02ff6c00ef add button colors 2024-08-07 21:11:44 +10:00
Ziad-I 78f664e892 fix CSS inconsistency and small errors 2024-08-07 21:11:44 +10:00
Ziad-I d745265048 fix footer for drawings page 2024-08-07 21:11:44 +10:00
Ziad-I 917991feab only ask for updates from specific blender using blender ID 2024-08-07 21:11:44 +10:00
Ziad-I 4877ab4426 add updating and removing of drawings/sheets 2024-08-07 21:11:44 +10:00
Ziad-I 48c5100d3b add blender generated theme for drawings page 2024-08-07 21:11:44 +10:00
Ziad-I 72caf7525e fix highlighting for better visibility 2024-08-07 21:11:44 +10:00
Ziad-I 242d91bc17 small css change 2024-08-07 21:11:44 +10:00
Ziad-I afb22ce7d5 add blender generated theme to gantt page
and some small edits in extracted colors and index page
2024-08-07 21:11:44 +10:00
Ziad-I e45a670ff5 add csv page uses blender theme css variables 2024-08-07 21:11:44 +10:00
Ziad-I 45042aa5e0 index.css uses blender css variables if they are defined 2024-08-07 21:11:44 +10:00
Ziad-I 07aec0730f update title in all pages 2024-08-07 21:11:44 +10:00
Ziad-I 7e6da3edb3 add mix colors function as blender mixes two colors...
blender mixes two colors to get the panel background final color :)
2024-08-07 21:11:44 +10:00
Ziad-I 4f0eafa92d fix blender css variables names 2024-08-07 21:11:44 +10:00
Ziad-I de75eded09 add theme_data listeners in web ui 2024-08-07 21:11:44 +10:00
Ziad-I f2b4bea4de add getting and sending theme data from blender 2024-08-07 21:11:44 +10:00
Ziad-I 4f28b2506d add theme data listeners in sioserver 2024-08-07 21:11:44 +10:00
Ziad-I 281da8ed77 add docstring to has_started and indentation edits 2024-08-07 21:11:44 +10:00
Ziad-I bdf4258895 add footer to drawings page 2024-08-07 21:11:44 +10:00
Ziad-I 385d9b9df7 connected clients list now works correctly with all pages 2024-08-07 21:11:44 +10:00
Ziad-I 0e40df4fa3 now correctly gets drawings and sheets data to send to web ui 2024-08-07 21:11:44 +10:00
Ziad-I b0c132f73a fix when sending csv or gantt data it is saved in the WebData
due to load not always being called as sometimes WebData is loaded before
2024-08-07 21:11:44 +10:00
Dion Moult 4fd802bf3d More efficient shape bbox and average vertex centroid function 2024-08-07 17:21:49 +10:00
Andrej730 e461040e17 bim.pip_install - fix for Blender 4.2 2024-08-06 18:22:35 +05:00
Andrej730 43b574011e fix choco releases 2024-08-06 17:14:43 +05:00
Andrej730 9bae914b51 ci-blenderbim-choco - rename for consistency, add workflow_dispatch
workflow_dispatch allows running workflow manually if needed
2024-08-06 16:52:30 +05:00
Andrej730 945070bdff blenderbim daily releases - add a note about autoupdates 2024-08-06 15:13:50 +05:00
Andrej730 d2b4afe1be blenderbim tests github action 2024-08-06 15:09:47 +05:00
Andrej730 3760f8fafe setup daily builds extensions repo 2024-08-06 15:09:47 +05:00
Andrej730 b9e5cefddf Another fix for #5134 2024-08-06 10:56:36 +05:00
Andrej730 9f5f757ccf Fix #5134 2024-08-05 18:33:03 +05:00
Andrej730 3a147d7f62 Remove Python 3.10 build from bbim builds
Reverts 8514a42, removes python 3.10 from bbim builds as it's not suppored by Blender 4.2+ (https://github.com/gentoo/gentoo/pull/37671)
2024-08-05 16:37:16 +05:00
Andrej730 9f1d14e5a7 black format 2024-08-05 13:59:33 +05:00
Dion Moult bce71f3797 See #5087. See #5114. Skip trying to test shapes that obviously don't have a representation to prevent false positives 2024-08-05 14:18:54 +10:00
Bruno Postle 253dca730d Fix misplaced section/elevation symbols
Looks like a simple typo, closes #5131
2024-08-04 17:30:30 +01:00
Ryan Schultz e0f33a56ec shift+click, to quickly switch the drawing view without turning anything on or off in the scene. as discussed: https://community.osarch.org/discussion/2196/quick-way-to-switch-between-drawing-views#latest
shift+click, to quickly switch the drawing view without turning anything on or off in the scene.
as discussed: https://community.osarch.org/discussion/2196/quick-way-to-switch-between-drawing-views#latest
2024-08-04 10:02:31 -05:00
Dion Moult 2287931e9c Rewrite georeference tests actually test UI effects 2024-08-04 21:23:02 +10:00
Dion Moult 1f7a498606 Fix #4958. Add UI spy class in feature tests to allow more natural BDD tests 2024-08-04 21:23:02 +10:00
Ryan Schultz a9e366b238 Assure text 'wraps' in CloseError 2024-08-03 14:30:06 -05:00
Ryan Schultz 1ca0dfb1e0 Make sure drawings are loaded when calling bim.activate_drawing from sheets UI.
related: c11ba23a3d
2024-08-03 14:09:15 -05:00
Ryan Schultz c11ba23a3d Fix #3728 - Be able to bim.activate_drawing a drawing listed in the sheets UI, as well. 2024-08-03 11:01:31 -05:00
Dion Moult 556c769b40 Sun position add-on is now detected in the current session instead of needing to restart Blender 2024-08-03 23:21:31 +10:00
Dion Moult 78173dd546 Add basic tests for new web module 2024-08-03 23:12:21 +10:00
Dion Moult 2196c16097 Fix failing georeference and spatial core/tool/bim tests and clean dead code 2024-08-03 23:08:35 +10:00
Dion Moult 7af5db7cd4 Collector now unassigns from old ifc collections 2024-08-03 22:04:38 +10:00
Dion Moult c58672cc25 Allow selecting a container object when changing spatial container 2024-08-03 19:29:06 +10:00
Dion Moult 85e022d76e IfcTester now groups results by types to make long failure lists more useful 2024-08-02 23:58:01 +10:00
Andrej730 872f40933f remove Python 3.9 from bbim makefile since a31051a93 2024-08-02 18:54:37 +05:00
Andrej730 4491018f5e fix tool surveyor test 2024-08-02 18:54:37 +05:00
Andrej730 a21c440b5b fix tool geometry tests 2024-08-02 18:54:37 +05:00
Andrej730 143e094db8 assign default container on assigning IfcAnnotation class
Currently if you create a IfcAnnotation it might just get lost as it's not assigned anywhere. Also noticed this since previously we allowed using bim.add_reference_image without any specific drawings.
2024-08-02 18:54:37 +05:00
Andrej730 94e9e945d7 fix system/qto tool tests after e6ac012 2024-08-02 18:54:36 +05:00
Andrej730 5e56115050 typing 2024-08-02 18:54:36 +05:00
Andrej730 1ad654aab3 Fix Ifc tool tests after #4843 and unlinking changes 2024-08-02 18:54:36 +05:00
Andrej730 596ffb093b dev environment script - keep it possible to run the script without any changes
by default it assumes it's executed from ifcopenshell repo directory
2024-08-02 18:54:36 +05:00
Andrej730 3576362fd8 blenderbim make test - run all tests but return error code at the end 2024-08-02 18:11:25 +05:00
Andrej730 2c949bb39a blenderbim "make test" - run tool and bim tests even if some core tests failed 2024-08-02 17:20:29 +05:00
Andrej730 34faa0617b fix running core tests on python 3.10 2024-08-02 17:05:28 +05:00
Dion Moult 15f6b3803f Fix #4986. IfcTester now determines whether a spec is relevant to the ifc version 2024-08-02 22:02:56 +10:00
Andrej730 8514a426bb fix potential blenderbim issues for python 3.10
tomllib was added to python 3.11, tomli can be used for the previous versions.

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

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

* Apply suggestions from code review

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

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

* Missed out two dynamic casts

* Using preprocessor macros instead of chaining if-else

---------

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

* fix choco action env vars

* fix choco action env vars

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

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

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

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

Simple way to trigger those recursions was:

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

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

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

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

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

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

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

* Add project overview screenshots

* Update property-editor.rst

* Add BlenderBIM project info screenshots

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

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

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

Option to provide either element or obj was more of a convenience feature but now they have a different meaning to clearly distinguish between unlinking ifc element and unlinking some blender object without touching any ifc elements.
2024-06-11 18:26:19 +05:00
Andrej730 6630db21ee Set apply default materials to False #4833
Since it's now True by default in v0.8.0, resetting it to False as it was in v0.7.0
2024-06-11 18:26:19 +05:00
Andrej730 f54f45a051 geom.settings - add a tooltip for available settings #4832
example - https://i.imgur.com/eTdqv5J.png
added a test so we won't miss if some setting will be added/removed
2024-06-11 18:26:18 +05:00
Thomas Krijnen acd4274136 Don't blindly assumes openings have representations for the selected contexts. #4832 2024-06-11 15:25:03 +02:00
Thomas Krijnen d400a48a9d Remember your own conventions: lines run along positive Z 2024-06-11 14:14:47 +02:00
Thomas Krijnen 4331f4f785 Don't stall threads on occt failures 2024-06-11 14:14:11 +02:00
Thomas Krijnen 95e36979d5 Don't link against svgfill from python when building without cgal #4832 2024-06-11 12:32:11 +02:00
Thomas Krijnen 07827940cc Some defensiveness against null shapes (should look into this better) 2024-06-11 11:20:55 +02:00
Thomas Krijnen c2efcda7bb Don't use cached items in multi-threaded mode for now until we have proper immutability 2024-06-11 11:20:40 +02:00
Thomas Krijnen aa0fbd434e Add geometry library install targets #4842 2024-06-11 10:33:19 +02:00
Dion Moult 8cff046a46 Doc download links now point to explicitly versioned releases, not bot builds
This ensures that IOS-Python always 1) has the appropriate version and 2) contains exactly the same content as PyPI (i.e. with the latest Python files that might be outdated from the bot builds)
2024-06-11 17:32:30 +10:00
Dion Moult ff4154c2bd Forgot to distribution Windows 32 bit IfcOpenShell-Python 2024-06-11 16:09:00 +10:00
Dion Moult d7e497727c More build fixes. 2024-06-11 16:01:14 +10:00
2230 changed files with 204108 additions and 209590 deletions
+3 -19
View File
@@ -1,24 +1,8 @@
name: ci-bcf-pypi
on:
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# * * * * *
- cron: "0 0 18 * *"
push:
paths:
- '.github/workflows/ci-bcf-pypi.yml'
workflow_dispatch:
env:
major: 0
minor: 0
name: ifcopenshell
jobs:
activate:
runs-on: ubuntu-latest
@@ -38,7 +22,7 @@ jobs:
- uses: actions/checkout@v2 # https://github.com/actions/checkout
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
with:
python-version: '3.10' # Version range or exact version of a Python version to use, using SemVer's version range syntax
python-version: '3.11' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- run: echo ${{ env.DATE }}
- name: Get current date
@@ -48,10 +32,10 @@ jobs:
run: |
pip install build
cd src/bcf &&
make dist
make dist IS_STABLE=TRUE
- name: Publish a Python distribution to PyPI
uses: ortega2247/pypi-upload-action@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: src/bcf/dist
packages_dir: src/bcf/dist
+12
View File
@@ -0,0 +1,12 @@
name: ci-black-formatting
on:
push:
pull_request:
jobs:
lint-formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: psf/black@stable
-92
View File
@@ -1,92 +0,0 @@
name: Publish-blenderbim-chocolatey package
on:
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# * * * * *
- cron: "30 0 * * *" # 30min past utc midnight
env:
major: 0
minor: 0
name: blenderbim
choco_version: 1.1.0
CHOCO_TOKEN: ${{ secrets.CHOCO_TOKEN }}
jobs:
activate:
runs-on: ubuntu-latest
if: |
github.repository == 'IfcOpenShell/IfcOpenShell'
steps:
- name: Set env
run: echo ok go
build:
needs: activate
name: ${{ matrix.config.name }}-${{ matrix.pyver }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pyver: [py310]
config:
- {
name: "Windows Build",
short_name: win,
}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
with:
python-version: '3.10.9' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- run: echo ${{ env.DATE }}
- name: Check in published releases if we should do a choco release
id: do_choco
run: |
echo "::set-output name=choco_release::$(python3 /home/runner/work/IfcOpenShell/IfcOpenShell/choco/blenderbim/check_repo_infos.py --do_choco_release?)"
- name: Fill chocolatey scripts on win with latest blender python
if: ${{steps.do_choco.outputs.choco_release}} == 'do_choco_release'
run: |
yesterday_non_iso="$(date --date='yesterday' +'%y%m%d' | tr -d '\n')" &&
target_os=${{ matrix.config.short_name }} &&
latest_blender_python_version_maj_min=$(python3 /home/runner/work/IfcOpenShell/IfcOpenShell/choco/blenderbim/check_repo_infos.py --latest_blender_python_version_maj_min?) &&
echo "latest_blender_python_version_maj_min?: $latest_blender_python_version_maj_min" &&
pyver=$(python3 /home/runner/work/IfcOpenShell/IfcOpenShell/choco/blenderbim/check_repo_infos.py --pyver?) &&
export latest_blender_version_maj_min=$(python3 /home/runner/work/IfcOpenShell/IfcOpenShell/choco/blenderbim/check_repo_infos.py --latest_blender_release_maj_min?) &&
export latest_blender_version_maj_min_pat=$(python3 /home/runner/work/IfcOpenShell/IfcOpenShell/choco/blenderbim/check_repo_infos.py --latest_blender_release_maj_min_pat?) &&
echo latest_blender_version_maj_min_pat?: $latest_blender_version_maj_min_pat &&
export blenderbim_build_version="${{ env.major }}.${{ env.minor }}.$yesterday_non_iso" &&
export url_blenderbim_py310_win_zip="https://github.com/IfcOpenShell/IfcOpenShell/releases/download/blenderbim-$yesterday_non_iso/blenderbim-$yesterday_non_iso-$pyver-$target_os.zip" &&
wget $url_blenderbim_py310_win_zip --no-verbose &&
export sha256sum_blenderbim_py310_win_zip=$( sha256sum blenderbim-$yesterday_non_iso-$pyver-$target_os.zip --tag | cut -d ' ' -f 4 | tr -d '\n') &&
echo sha256sum_blenderbim_py310_win_zip: $sha256sum_blenderbim_py310_win_zip &&
python3 choco/blenderbim/fill_dynamic_parameters.py &&
echo __build choco with mono &&
wget "https://github.com/chocolatey/choco/archive/refs/tags/$choco_version.tar.gz" --quiet &&
tar -xzf "$choco_version.tar.gz" &&
cd choco-$choco_version &&
chmod +x build.sh zip.sh &&
./build.sh &&
cp -r build_output/chocolatey /opt/chocolatey &&
cd /home/runner/work/IfcOpenShell/IfcOpenShell/choco/blenderbim/ &&
echo __choco pack &&
mono /opt/chocolatey/choco.exe --version &&
mono /opt/chocolatey/choco.exe pack --allow-unofficial &&
echo __choco set apiKey &&
mono /opt/chocolatey/choco.exe setapikey --key="$CHOCO_TOKEN" --source="https://push.chocolatey.org/" --allow-unofficial # &&
echo __choco push &&
mono /opt/chocolatey/choco.exe push --source="https://push.chocolatey.org/" --key="$CHOCO_TOKEN" --allow-unofficial --verbose
- name: Inform user about not packaging
if: ${{steps.do_choco.outputs.choco_release}} != 'do_choco_release'
run: |
echo "no releases found today ${{ env.DATE }}, therefore choco packaging is skipped."
-81
View File
@@ -1,81 +0,0 @@
name: ci-blenderbim-daily
on:
push:
paths:
- '.github/workflows/ci-blenderbim-matrix.yml'
- 'src/blenderbim/**'
- 'src/ifcopenshell-python/ifcopenshell/**'
- 'src/bcf/src/bcf/**'
- 'src/ifcclash/ifcclash/**'
- 'src/ifccobie/**'
- 'src/ifcdiff/**'
- 'src/ifccsv/**'
- 'src/ifcpatch/ifcpatch/**'
- 'src/ifc4d/ifc4d/**'
- 'src/ifc5d/ifc5d/**'
- 'src/ifccityjson/**'
branches:
- v0.8.0
workflow_dispatch:
jobs:
activate:
runs-on: ubuntu-latest
if: |
github.repository == 'IfcOpenShell/IfcOpenShell'
steps:
- name: Set env
run: echo ok go
build:
needs: activate
name: ${{ matrix.config.name }}-${{ matrix.pyver }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pyver: [py39, py310, py311, py312]
config:
- {
name: "Windows Build",
short_name: win,
}
- {
name: "Linux Build",
short_name: linux
}
- {
name: "MacOS Build",
short_name: macos
}
- {
name: "MacOS ARM Build",
short_name: macosm1
}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
with:
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
python-version: '3.11'
- name: Get current version
id: version
run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
- name: Get current date
id: date
run: echo "date=$(date +'%y%m%d')" >> $GITHUB_OUTPUT
- name: 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.version.outputs.version}}.${{steps.date.outputs.date}}-${{ matrix.pyver }}-${{ matrix.config.short_name }}.zip
asset_name: blenderbim-${{steps.version.outputs.version}}.${{steps.date.outputs.date}}-${{ matrix.pyver }}-${{ matrix.config.short_name }}.zip
release_name: "blenderbim-${{steps.version.outputs.version}}.${{steps.date.outputs.date}} (unstable)"
tag: "blenderbim-${{steps.version.outputs.version}}.${{steps.date.outputs.date}}"
overwrite: true
+47
View File
@@ -0,0 +1,47 @@
name: ci-bonsai-choco
on:
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# * * * * *
- cron: "30 0 * * *" # 30min past utc midnight
workflow_dispatch:
env:
major: 0
minor: 0
name: bonsai
choco_version: 1.1.0
CHOCO_TOKEN: ${{ secrets.CHOCO_TOKEN }}
jobs:
activate:
runs-on: ubuntu-latest
if: |
github.repository == 'IfcOpenShell/IfcOpenShell'
steps:
- name: Set env
run: echo ok go
build:
needs: activate
name: "choco_release"
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0
- run: echo ${{ env.DATE }}
- name: Check in release tags if we should do a choco release and perform the release if needed
id: do_choco_release
run: |
pip install pygithub
cd /home/runner/work/IfcOpenShell/IfcOpenShell/choco/bonsai/ &&
python3 choco_release.py
+158
View File
@@ -0,0 +1,158 @@
name: ci-bonsai-daily
on:
push:
paths:
- '.github/workflows/ci-bonsai-daily.yml'
- 'src/bonsai/**'
- 'src/ifcopenshell-python/ifcopenshell/**'
- 'src/bcf/bcf/**'
- 'src/ifcclash/ifcclash/**'
- 'src/ifccobie/**'
- 'src/ifcdiff/**'
- 'src/ifccsv/**'
- 'src/ifcpatch/ifcpatch/**'
- 'src/ifc4d/ifc4d/**'
- 'src/ifc5d/ifc5d/**'
- 'src/ifccityjson/**'
branches:
- v0.8.0
workflow_dispatch:
jobs:
activate:
runs-on: ubuntu-latest
if: |
github.repository == 'IfcOpenShell/IfcOpenShell'
steps:
- name: Set env
run: echo ok go
build:
needs: activate
name: ${{ matrix.config.name }}-${{ matrix.pyver }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pyver: [py311, py312]
config:
- {
name: "Windows Build",
short_name: win,
}
- {
name: "Linux Build",
short_name: linux,
}
- {
name: "MacOS Build",
short_name: macos,
}
- {
name: "MacOS ARM Build",
short_name: macosm1,
}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
with:
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
python-version: '3.11'
- name: Get current version
id: version
run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
- name: Get current date
id: date
# Include hours and minutes to release tag
# to avoid possibility of unstable repo's index.json
# pointing to the new file when index.json itself wasn't yet updated.
run: echo "date=$(date +'%y%m%d%H%M')" >> $GITHUB_OUTPUT
- name: Compile
run: |
cd src/bonsai && make dist PLATFORM=${{ matrix.config.short_name }} PYVERSION=${{ matrix.pyver }}
- name: Find zip file name
id: find_zip
run: |
filepath=$(ls src/bonsai/dist/bonsai_*.zip)
echo "filepath=$filepath" >> $GITHUB_OUTPUT
echo "filename=$(basename $filepath)" >> $GITHUB_OUTPUT
- name: Upload zip file to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ steps.find_zip.outputs.filepath }}
asset_name: ${{ steps.find_zip.outputs.filename }}
release_name: "bonsai-${{steps.version.outputs.version}}-alpha${{steps.date.outputs.date}} (unstable)"
tag: "bonsai-${{steps.version.outputs.version}}-alpha${{steps.date.outputs.date}}"
overwrite: true
body: "See README in https://github.com/IfcOpenShell/bonsai_unstable_repo/ on how to setup autoupdates for daily Bonsai builds."
update-extensions-repo-and-run-tests:
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout bonsai_unstable_repo repository
uses: actions/checkout@v2
with:
repository: IfcOpenShell/bonsai_unstable_repo
token: ${{ secrets.IOS_TO_BLENDER_REPO }}
path: bonsai_unstable_repo
- name: Update index.json on extensions repo
run: |
set -x -e
# Download Blender.
wget -q -O blender.tar.xz https://ftp.nluug.nl/pub/graphics/blender/release/Blender4.2/blender-4.2.0-linux-x64.tar.xz
tar -xf blender.tar.xz
# Setup Blender.
BLENDER_PATH=$(find blender-*/ -maxdepth 0 -exec readlink -f {} \;)
export PATH="$PATH:$BLENDER_PATH"
blender --version
cd bonsai_unstable_repo
pip install -r requirements.txt
python setup_extensions_repo.py --last-tag
git config --global user.name 'IfcOpenBot'
git config --global user.email 'IfcOpenBot@users.noreply.github.com'
git add index.json
git add readme.md
git commit -m "Update index.json"
git push
- name: Run bonsai tests
run: |
set -x -e
BLENDER_PATH=$(find blender-*/ -maxdepth 0 -exec readlink -f {} \;)
export PATH="$PATH:$BLENDER_PATH"
bonsai_zip="$(pwd)/$(ls bonsai_unstable_repo/bonsai_py311*-linux-x64.zip)"
blender --version
blender --command extension install-file -r user_default -e $bonsai_zip
blender --command extension list
wget -q -O sverchok.zip https://github.com/nortikin/sverchok/archive/refs/heads/master.zip
# ifcsverchok expecting sverchok to be named "sverchok" and not "sverchok-master".
unzip -q sverchok.zip
mv sverchok-master sverchok
zip -q -r sverchok.zip sverchok
rm -r sverchok
blender --command extension install-file -r user_default sverchok.zip
git clone https://github.com/IfcOpenShell/IfcOpenShell.git IfcOpenShell
cd IfcOpenShell/src/ifcsverchok
make dist
sverchok_zip="$(pwd)/dist/$(ls dist)"
blender --command extension install-file -r user_default $sverchok_zip
# Install Sun Position extension.
blender --online-mode --command extension sync
blender --online-mode --background --python-expr "import bpy; \
bpy.ops.extensions.package_install(repo_index=0, pkg_id='sun_position'); \
bpy.ops.preferences.addon_enable(module='bl_ext.blender_org.sun_position'); bpy.ops.wm.save_userpref()"
cd ../bonsai
pip install pytest-blender
blender --background --python scripts/setup_pytest.py
blender --python-expr "import bonsai; print(bonsai.bbim_semver); import ifcopenshell; print(ifcopenshell.version)" --background
make test
@@ -1,4 +1,9 @@
name: ci-blenderbim
name: ci-bonsai
# Differences from ci-bonsai-daily.yml:
# - make has IS_STABLE=TRUE
# - action is never triggered and executed only manually
# - doesn't add a current date to the release and tag
on:
workflow_dispatch:
@@ -19,7 +24,7 @@ jobs:
strategy:
fail-fast: false
matrix:
pyver: [py39, py310, py311, py312]
pyver: [py311, py312]
config:
- {
name: "Windows Build",
@@ -27,15 +32,15 @@ jobs:
}
- {
name: "Linux Build",
short_name: linux
short_name: linux,
}
- {
name: "MacOS Build",
short_name: macos
short_name: macos,
}
- {
name: "MacOS ARM Build",
short_name: macosm1
short_name: macosm1,
}
steps:
- uses: actions/checkout@v2
@@ -48,15 +53,19 @@ jobs:
run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
- name: Compile
run: |
cp -r src/blenderbim src/blenderbim_${{ matrix.config.short_name }}_${{ matrix.pyver }} &&
cd src/blenderbim_${{ matrix.config.short_name }}_${{ matrix.pyver }} &&
make dist PLATFORM=${{ matrix.config.short_name }} PYVERSION=${{ matrix.pyver }} IS_STABLE=TRUE
cd src/bonsai && make dist PLATFORM=${{ matrix.config.short_name }} PYVERSION=${{ matrix.pyver }} IS_STABLE=TRUE
- name: Find zip file name
id: find_zip
run: |
filepath=$(ls src/bonsai/dist/bonsai_*.zip)
echo "filepath=$filepath" >> $GITHUB_OUTPUT
echo "filename=$(basename $filepath)" >> $GITHUB_OUTPUT
- name: Upload zip file to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: src/blenderbim_${{ matrix.config.short_name }}_${{ matrix.pyver }}/dist/blenderbim-${{steps.version.outputs.version}}-${{ matrix.pyver }}-${{ matrix.config.short_name }}.zip
asset_name: blenderbim-${{steps.version.outputs.version}}-${{ matrix.pyver }}-${{ matrix.config.short_name }}.zip
release_name: "blenderbim-${{steps.version.outputs.version}}"
tag: "blenderbim-${{steps.version.outputs.version}}"
file: ${{ steps.find_zip.outputs.filepath }}
asset_name: ${{ steps.find_zip.outputs.filename }}
release_name: "bonsai-${{steps.version.outputs.version}}"
tag: "bonsai-${{steps.version.outputs.version}}"
overwrite: true
+1 -14
View File
@@ -1,21 +1,8 @@
name: ci-bsdd-pypi
on:
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# * * * * *
- cron: "0 0 18 * *"
workflow_dispatch:
env:
major: 0
minor: 0
name: ifcopenshell
jobs:
activate:
runs-on: ubuntu-latest
@@ -39,7 +26,7 @@ jobs:
run: |
pip install build
cd src/bsdd &&
make dist
make dist IS_STABLE=TRUE
- name: Publish a Python distribution to PyPI
uses: ortega2247/pypi-upload-action@master
with:
+35
View File
@@ -0,0 +1,35 @@
name: ci-ifc4d-pypi
on:
workflow_dispatch:
jobs:
activate:
runs-on: ubuntu-latest
if: |
github.repository == 'IfcOpenShell/IfcOpenShell'
steps:
- name: Set env
run: echo ok go
build:
needs: activate
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
with:
python-version: '3.11' # Version range or exact version of a Python version to use, using SemVer's version range syntax
- name: Compile
run: |
pip install build
cd src/ifc4d &&
make dist IS_STABLE=TRUE
- name: Publish a Python distribution to PyPI
uses: ortega2247/pypi-upload-action@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: src/ifc4d/dist
+35
View File
@@ -0,0 +1,35 @@
name: ci-ifc5d-pypi
on:
workflow_dispatch:
jobs:
activate:
runs-on: ubuntu-latest
if: |
github.repository == 'IfcOpenShell/IfcOpenShell'
steps:
- name: Set env
run: echo ok go
build:
needs: activate
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
with:
python-version: '3.11' # Version range or exact version of a Python version to use, using SemVer's version range syntax
- name: Compile
run: |
pip install build
cd src/ifc5d &&
make dist IS_STABLE=TRUE
- name: Publish a Python distribution to PyPI
uses: ortega2247/pypi-upload-action@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: src/ifc5d/dist
@@ -0,0 +1,35 @@
name: ci-ifccityjson-pypi
on:
workflow_dispatch:
jobs:
activate:
runs-on: ubuntu-latest
if: |
github.repository == 'IfcOpenShell/IfcOpenShell'
steps:
- name: Set env
run: echo ok go
build:
needs: activate
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
with:
python-version: '3.11' # Version range or exact version of a Python version to use, using SemVer's version range syntax
- name: Compile
run: |
pip install build
cd src/ifccityjson &&
make dist IS_STABLE=TRUE
- name: Publish a Python distribution to PyPI
uses: ortega2247/pypi-upload-action@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: src/ifccityjson/dist
+1 -14
View File
@@ -1,21 +1,8 @@
name: ci-ifcclash-pypi
on:
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# * * * * *
- cron: "0 0 18 * *"
workflow_dispatch:
env:
major: 0
minor: 0
name: ifcopenshell
jobs:
activate:
runs-on: ubuntu-latest
@@ -39,7 +26,7 @@ jobs:
run: |
pip install build
cd src/ifcclash &&
make dist
make dist IS_STABLE=TRUE
- name: Publish a Python distribution to PyPI
uses: ortega2247/pypi-upload-action@master
with:
+65
View File
@@ -0,0 +1,65 @@
name: ci-ifcconvert
on:
workflow_dispatch:
jobs:
activate:
runs-on: ubuntu-latest
if: |
github.repository == 'IfcOpenShell/IfcOpenShell'
steps:
- name: Set env
run: echo ok go
build:
needs: activate
name: ${{ matrix.config.name }}-${{ matrix.pyver }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- {
name: "Windows 64bit",
short_name: win64,
}
- {
name: "Windows 32bit",
short_name: win32,
}
- {
name: "Linux 64bit",
short_name: linux64
}
- {
name: "MacOS Intel 64bit",
short_name: macos64
}
- {
name: "MacOS Silicon 64bit",
short_name: macosm164
}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
with:
python-version: '3.11' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- run: echo ${{ env.DATE }}
- name: Get current version
id: version
run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
- name: Compile
run: |
cd src/ifcopenshell-python &&
make zip-ifcconvert PLATFORM=${{ matrix.config.short_name }}
- name: Upload zip file to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: src/ifcopenshell-python/dist/ifcconvert-${{ steps.version.outputs.version }}-${{ matrix.config.short_name }}.zip
asset_name: ifcconvert-${{ steps.version.outputs.version }}-${{ matrix.config.short_name }}.zip
release_name: "ifcconvert-${{steps.version.outputs.version}}"
tag: "ifcconvert-${{steps.version.outputs.version}}"
overwrite: true
+1 -14
View File
@@ -1,21 +1,8 @@
name: ci-ifccsv-pypi
on:
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# * * * * *
- cron: "0 0 18 * *"
workflow_dispatch:
env:
major: 0
minor: 0
name: ifcopenshell
jobs:
activate:
runs-on: ubuntu-latest
@@ -39,7 +26,7 @@ jobs:
run: |
pip install build
cd src/ifccsv &&
make dist
make dist IS_STABLE=TRUE
- name: Publish a Python distribution to PyPI
uses: ortega2247/pypi-upload-action@master
with:
+35
View File
@@ -0,0 +1,35 @@
name: ci-ifcdiff-pypi
on:
workflow_dispatch:
jobs:
activate:
runs-on: ubuntu-latest
if: |
github.repository == 'IfcOpenShell/IfcOpenShell'
steps:
- name: Set env
run: echo ok go
build:
needs: activate
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
with:
python-version: '3.11' # Version range or exact version of a Python version to use, using SemVer's version range syntax
- name: Compile
run: |
pip install build
cd src/ifcdiff &&
make dist IS_STABLE=TRUE
- name: Publish a Python distribution to PyPI
uses: ortega2247/pypi-upload-action@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: src/ifcdiff/dist
+35
View File
@@ -0,0 +1,35 @@
name: ci-ifcfm-pypi
on:
workflow_dispatch:
jobs:
activate:
runs-on: ubuntu-latest
if: |
github.repository == 'IfcOpenShell/IfcOpenShell'
steps:
- name: Set env
run: echo ok go
build:
needs: activate
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
with:
python-version: '3.11' # Version range or exact version of a Python version to use, using SemVer's version range syntax
- name: Compile
run: |
pip install build
cd src/ifcfm &&
make dist IS_STABLE=TRUE
- name: Publish a Python distribution to PyPI
uses: ortega2247/pypi-upload-action@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: src/ifcfm/dist
@@ -0,0 +1,104 @@
name: ci-ifcopenshell-conda-daily-cleaner
on:
workflow_dispatch:
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# * * * * *
- cron: "00 23 * * *" # 11min before utc midnight every day
env:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
NUM_SUPPORTED_VERSIONS: 5
jobs:
activate:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
if: |
github.repository == 'IfcOpenShell/IfcOpenShell'
steps:
- uses: mamba-org/setup-micromamba@v1 # https://github.com/mamba-org/setup-micromamba
with:
environment-name: test-env
create-args: >-
python=3.11
anaconda-client=1.12.3
- name: Run conda cleaner
run: |
python - << EOF
import os
from datetime import datetime, timedelta
from binstar_client.utils import get_server_api
from binstar_client.errors import BinstarError
# Configuration
api_token = os.environ.get('ANACONDA_TOKEN')
pkg_name = 'ifcopenshell'
channel_name = 'ifcopenshell'
# Authenticate with Anaconda
aserver_api = get_server_api(token=api_token)
# Get the list of packages in the channel
def get_package(filter_package_name: str = None):
try:
user_packages = aserver_api.user_packages(channel_name)
if filter_package_name:
user_packages = [pkg for pkg in user_packages if pkg['name'] == filter_package_name]
if len(user_packages) == 0:
print(f"No packages found for {filter_package_name}.")
if len(user_packages) > 1:
raise ValueError(f"Found {len(user_packages)} package for {filter_package_name}. Will only support 1 package.")
return user_packages[0]
except BinstarError as err:
raise ValueError(f"Failed to fetch packages: {err}")
# Delete a package version
def delete_package(package_name, version):
try:
aserver_api.remove_release(channel_name, package_name, version)
print(f"Deleted {package_name} version {version}")
except BinstarError as err:
print(f"Failed to delete {package_name} version {version}: {err}")
# Main logic
def main():
package = get_package(pkg_name)
if not package:
print("No packages found.")
return
number_of_supported_versions = ${{ env.NUM_SUPPORTED_VERSIONS }}
package_name = package['name']
versions = package["versions"]
if len(versions) <= number_of_supported_versions:
print(f"Number of versions {len(versions)} is less than or equal to {number_of_supported_versions}.")
return
# sort the versions in descending order
print(f"Before reversal: {versions=}")
versions.reverse()
print(f"After reversal: {versions=}")
releases = versions[number_of_supported_versions:]
for release in releases:
delete_package(package_name, release)
main()
EOF
@@ -2,21 +2,44 @@ name: ci-ifcopenshell-conda-daily-v0.8.0
on:
workflow_dispatch:
push:
branches:
- v0.8.0
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# * * * * *
- cron: "49 23 * * *" # 11min before utc midnight every day
jobs:
activate:
runs-on: ubuntu-latest
if: |
github.repository == 'IfcOpenShell/IfcOpenShell'
outputs:
version: ${{ steps.version.outputs.version }}
date: ${{ steps.date.outputs.date }}
verdate: ${{ steps.verdate.outputs.verdate }}
steps:
- uses: actions/checkout@v4
- name: Set env
run: echo ok go
- name: Get current version
id: version
run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
- name: Get current date
id: date
run: echo "date=$(date +'%y%m%d')" >> $GITHUB_OUTPUT
- name: Version + date str
id: verdate
run: echo "verdate='${{ steps.version.outputs.version }}alpha${{ steps.date.outputs.date }}'" >> $GITHUB_OUTPUT
test:
name: ${{ matrix.platform.distver }}-${{ matrix.pyver.name }}
name: ${{ matrix.platform.distver }}-${{ matrix.pyver.name }}-${{ matrix.variant }}
needs: activate
runs-on: ${{ matrix.platform.distver }}
defaults:
@@ -25,8 +48,9 @@ jobs:
strategy:
fail-fast: false
matrix:
variant: [novtk, all]
pyver: [
{ name: py311, distver: '3.11'},
# { name: py311, distver: '3.11'},
{ name: py312, distver: '3.12'}
]
platform: [
@@ -35,24 +59,28 @@ jobs:
{ name: macOS, distver: macos-latest, pkg_dir: 'osx-64' }
]
steps:
- uses: actions/checkout@v3
- name: Set up swap space
if: runner.os == 'Linux'
uses: pierotofy/set-swap-space@v1.0
with:
swap-size-gb: 10
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Download and extract MacOSX SDK
if: ${{ matrix.platform.name == 'macOS' }}
if: ${{ runner.os == 'macOS' }}
run: |
curl -o MacOSX10.13.sdk.tar.xz -L https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.13.sdk.tar.xz && \
tar xf MacOSX10.13.sdk.tar.xz && \
sudo mv -v MacOSX10.13.sdk /opt/ && \
ls /opt/
- uses: seanmiddleditch/gha-setup-ninja@master
curl -L https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.13.sdk.tar.xz | tar -xvJf - -C /Users/runner/work/
- uses: mamba-org/setup-micromamba@v1 # https://github.com/mamba-org/setup-micromamba
with:
environment-file: conda/environment.build.yml
environment-name: test-env
create-args: >-
python=${{ matrix.pyver.distver }}
python=3.11
anaconda-client
boa
- name: create conda package dist dir
run: |
@@ -60,8 +88,10 @@ jobs:
- name: build & test ifcopenshell
run: |
boa build . --python ${{ matrix.pyver.distver }} --no-remove-work-dir --output-folder '${{ github.workspace }}/dist'
conda mambabuild . --python ${{ matrix.pyver.distver }} --no-remove-work-dir --output-folder '${{ github.workspace }}/dist' --variants='{variant: ${{ matrix.variant }}}'
working-directory: ./conda
env:
VERSION_OVERRIDE: ${{ needs.activate.outputs.verdate }}
- name: upload to anaconda
if: ${{ matrix.platform.name == 'win' }}
@@ -71,4 +101,4 @@ jobs:
- name: upload to anaconda
if: ${{ matrix.platform.name != 'win' }}
run: |
anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload --force --user ifcopenshell ${{ github.workspace }}/dist/${{ matrix.platform.pkg_dir }}/*.tar.bz2
anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload --force --user ifcopenshell ${{ github.workspace }}/dist/${{ matrix.platform.pkg_dir }}/*.tar.bz2
+4 -3
View File
@@ -6,7 +6,6 @@ on:
tags:
- v0.**
jobs:
activate:
@@ -94,7 +93,7 @@ jobs:
lfs: true
- name: Download
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4.1.7
with:
# Artifact name
name: ifcos-artifacts
@@ -117,6 +116,8 @@ jobs:
with:
context: artifacts
repository: aecgeeks/ifcopenshell
tags: aecgeeks/ifcopenshell:latest
# Since the dispatch is set to `tag`, `github.ref_name` should evaluate to the pushed tag
# On a workflow dispatch, `ref_name` will take on the value from the dispatch payload
tags: aecgeeks/ifcopenshell:${{ github.ref_name }}${{ github.ref_name == github.event.repository.default_branch && ',aecgeeks/ifcopenshell:latest' }}
file: ./Dockerfile
push: true
@@ -27,19 +27,19 @@ jobs:
pyver: [py39, py310, py311, py312]
config:
- {
name: "Windows Build",
name: "Windows 64bit",
short_name: win64,
}
- {
name: "Linux Build",
name: "Linux 64bit",
short_name: linux64
}
- {
name: "MacOS Build",
name: "MacOS Intel 64bit",
short_name: macos64
}
- {
name: "MacOS ARM Build",
name: "MacOS Silicon 64bit",
short_name: macosm164
}
steps:
@@ -57,7 +57,7 @@ jobs:
pip install build
cp -r src/ifcopenshell-python src/ifcopenshell_${{ matrix.config.short_name }}_${{ matrix.pyver }} &&
cd src/ifcopenshell_${{ matrix.config.short_name }}_${{ matrix.pyver }} &&
make dist PLATFORM=${{ matrix.config.short_name }} PYVERSION=${{ matrix.pyver }}
make dist PLATFORM=${{ matrix.config.short_name }} PYVERSION=${{ matrix.pyver }} IS_STABLE=TRUE
- name: Publish a Python distribution to PyPI
uses: ortega2247/pypi-upload-action@master
with:
+8 -4
View File
@@ -22,19 +22,23 @@ jobs:
pyver: [py39, py310, py311, py312]
config:
- {
name: "Windows Build",
name: "Windows 64bit",
short_name: win64,
}
- {
name: "Linux Build",
name: "Windows 32bit",
short_name: win32,
}
- {
name: "Linux 64bit",
short_name: linux64
}
- {
name: "MacOS Build",
name: "MacOS Intel 64bit",
short_name: macos64
}
- {
name: "MacOS ARM Build",
name: "MacOS Silicon 64bit",
short_name: macosm164
}
steps:
+1 -14
View File
@@ -1,21 +1,8 @@
name: ci-ifcpatch-pypi
on:
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# * * * * *
- cron: "0 0 18 * *"
workflow_dispatch:
env:
major: 0
minor: 0
name: ifcopenshell
jobs:
activate:
runs-on: ubuntu-latest
@@ -39,7 +26,7 @@ jobs:
run: |
pip install build
cd src/ifcpatch &&
make dist
make dist IS_STABLE=TRUE
- name: Publish a Python distribution to PyPI
uses: ortega2247/pypi-upload-action@master
with:
+1 -1
View File
@@ -46,6 +46,6 @@ jobs:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: src/ifcsverchok/dist/ifcsverchok-${{steps.version.outputs.version}}.${{steps.date.outputs.date}}.zip
asset_name: ifcsverchok-${{steps.version.outputs.version}}.${{steps.date.outputs.date}}.zip
release_name: "ifcsverchok-${{steps.version.outputs.version}}.${{steps.date.outputs.date}}"
release_name: "ifcsverchok-${{steps.version.outputs.version}}.${{steps.date.outputs.date}} (unstable)"
tag: "ifcsverchok-${{steps.version.outputs.version}}.${{steps.date.outputs.date}}"
overwrite: true
+1 -14
View File
@@ -1,21 +1,8 @@
name: ci-ifctester-pypi
on:
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# * * * * *
- cron: "0 0 18 * *"
workflow_dispatch:
env:
major: 0
minor: 0
name: ifcopenshell
jobs:
activate:
runs-on: ubuntu-latest
@@ -39,7 +26,7 @@ jobs:
run: |
pip install build
cd src/ifctester &&
make dist
make dist IS_STABLE=TRUE
- name: Publish a Python distribution to PyPI
uses: ortega2247/pypi-upload-action@master
with:
@@ -1,34 +0,0 @@
name: Restart failed daily conda builds
on:
workflow_run:
workflows: [ ci-ifcopenshell-conda-daily ]
types:
- completed
env:
REPO_OWNER: IfcOpenShell/IfcOpenShell
MY_WORKFLOW: ci-ifcopenshell-conda-daily
jobs:
restart-failed-runs:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- name: checkout
uses: actions/checkout@v3
- name: Use python 3.11
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- name: Check for failed runs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WORKFLOW_RUN_ID: ${{ github.event.workflow_run.id }}
run: |
python check_repo_ci_jobs.py
working-directory: .github/workflows
+10 -2
View File
@@ -47,6 +47,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install xmlschema xsdata numpy lxml pytest isodate lark networkx tabulate python-dateutil shapely
pip install mathutils
pip install src/bcf --no-deps
pip install https://github.com/Andrej730/aud/archive/refs/heads/master-reduced-size.zip
@@ -106,7 +107,7 @@ jobs:
- name: Run IfcConvert on Sample files
run: |
(find test/input src/blenderbim/test/files -name '*.ifc' | while read i; do \
(find test/input src/bonsai/test/files -name '*.ifc' | while read i; do \
echo $i | tee -a log; \
timeout 1m "$(which IfcConvert)" -yv "$i" "$i.obj" --validate >> log 2>&1; \
echo $i $? >> statuses; \
@@ -125,4 +126,11 @@ jobs:
python tests.py
cd ../src/ifcopenshell-python
mv ifcopenshell ifcopenshell-local # Force testing on installed module
make test-safe
make test
cd ../bcf && make test
pip install requests
cd ../bsdd && make test
pip install deepdiff
cd ../ifcdiff && make test
cd ../ifcpatch && make test
cd ../ifctester && make test
+4 -4
View File
@@ -8,12 +8,12 @@ on:
jobs:
activate:
if: github.repository == 'IfcOpenShell/IfcOpenShell'
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- run: echo ok go
build:
needs: activate
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v2
@@ -52,8 +52,8 @@ jobs:
-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 \
-DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.10 \
-DPYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.10.so \
-DLIBXML2_INCLUDE_DIR=/usr/include/libxml2 \
-DLIBXML2_LIBRARIES=/usr/lib/x86_64-linux-gnu/libxml2.so \
-DGLTF_SUPPORT=On \
+9 -12
View File
@@ -73,19 +73,16 @@ src/ifcopenshell-python/test/build
# mypy cache
.mypy_cache
# blenderbim libs
src/blenderbim/blenderbim/libs
# bonsai i18n
src/bonsai/bonsai/translations.py
# blenderbim i18n
src/blenderbim/blenderbim/translations.py
# bonsai test temp files
src/bonsai/test/files/temp
src/bonsai/test/files/basic.ifc.cache.blend
src/bonsai/test/files/basic.ifc.cache.sqlite
# blenderbim test temp files
src/blenderbim/test/files/temp
src/blenderbim/test/files/basic.ifc.cache.blend
src/blenderbim/test/files/basic.ifc.cache.sqlite
src/blenderbim/drawings
src/blenderbim/layouts
src/bonsai/drawings
src/bonsai/layouts
# ifcopenshell swig and compiled files
src/ifcopenshell-python/ifcopenshell/_ifcopenshell_wrapper.so
@@ -100,4 +97,4 @@ src/ifcopenshell-python/ifcopenshell/ifcopenshell_wrapper.py
.cache
# Brickschema
src/blenderbim/blenderbim/bim/schema/Brick.ttl
src/bonsai/bonsai/bim/schema/Brick.ttl
+2 -2
View File
@@ -1,6 +1,6 @@
# -*- mode: Dockerfile -*-
FROM ubuntu:focal
FROM ubuntu:22.04
ARG CHANNEL
ENV CHANNEL=${CHANNEL:-latest}
@@ -23,7 +23,7 @@ RUN echo "deb http://archive.ubuntu.com/ubuntu focal-proposed main restricted" |
echo "deb http://archive.ubuntu.com/ubuntu focal-proposed multiverse" | tee -a /etc/apt/sources.list; \
apt-get -qq update; \
apt-get -y install tzdata dos2unix rsync; \
apt-get -y install python3 libxml2 libpython3.8 \
apt-get -y install python3 libxml2 libpython3.10 \
libboost-all-dev \
libocct-foundation-dev libocct-modeling-algorithms-dev libocct-modeling-data-dev \
libocct-ocaf-dev libocct-visualization-dev libocct-data-exchange-dev \
+31 -35
View File
@@ -12,7 +12,7 @@ is implemented for the IFC releases [IFC2x3 TC1] and [IFC4 Add2 TC1]. Extending
is possible at compile-time when using C++ and at run-time when using Python.
In addition to a C++ and Python API, IfcOpenShell comes with an ecosystem of tools, notably including IfcConvert (an application
to convert IFC models to other formats), the BlenderBIM Add-on (an add-on to Blender providing a graphical IFC authoring platform),
to convert IFC models to other formats), Bonsai (an add-on to Blender providing a graphical IFC authoring platform),
and many other libraries, CLI apps, and more. Support is also provided for auxiliary standards such as BCF and IDS.
For more information, see:
@@ -22,53 +22,49 @@ For more information, see:
* [IfcOpenShell C++ Installation](https://docs.ifcopenshell.org/ifcopenshell/installation.html)
* [IfcOpenShell Python Installation](https://docs.ifcopenshell.org/ifcopenshell-python/installation.html)
* [IfcOpenShell Python Hello World Tutorial](https://docs.ifcopenshell.org/ifcopenshell-python/hello_world.html)
* [BlenderBIM Add-on Website](https://blenderbim.org)
* [BlenderBIM Add-on Documentation](https://docs.blenderbim.org/index.html)
* [Add-on Installation](https://docs.blenderbim.org/users/installation.html)
* [Exploring an IFC model](https://docs.blenderbim.org/users/exploring_an_ifc_model.html)
* [Bonsai Website](https://bonsaibim.org)
* [Bonsai Documentation](https://docs.bonsaibim.org/index.html)
* [Add-on Installation](https://docs.bonsaibim.org/quickstart/installation.html)
* [Exploring an IFC model](https://docs.bonsaibim.org/quickstart/explore_model.html)
Development is sponsored through your generous donations!
| Service | Status |
| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| Anaconda Daily Build | [![Anaconda-Server Badge](https://img.shields.io/conda/vn/ifcopenshell/ifcopenshell)](https://anaconda.org/ifcopenshell/ifcopenshell) |
| Anaconda v0.7.0 Stable | [![Anaconda-Server Badge](https://img.shields.io/conda/vn/conda-forge/ifcopenshell)](https://anaconda.org/conda-forge/ifcopenshell) |
| PyPi Daily Build | [![PyPi Badge](https://img.shields.io/pypi/v/ifcopenshell)](https://pypi.org/project/ifcopenshell/) |
| ArchLinux AUR Package Stable | [![AUR Badge](https://img.shields.io/aur/version/ifcopenshell)](https://aur.archlinux.org/packages/ifcopenshell) |
| ArchLinux AUR Package git | [![AUR Badge](https://img.shields.io/aur/version/ifcopenshell-git)](https://aur.archlinux.org/packages/ifcopenshell-git) |
| BlenderBIM Add-on Chocolatey (under moderation) | [![Chocolatey Badge](https://img.shields.io/chocolatey/v/blenderbim-nightly)](https://community.chocolatey.org/packages/blenderbim-nightly/) |
| Sponsor development on OpenCollective | [![Financial Contributors](https://opencollective.com/opensourcebim/tiers/badge.svg)](https://opencollective.com/opensourcebim/) |
| Docker hub | [![Docker Pulls](https://img.shields.io/docker/pulls/aecgeeks/ifcopenshell)](https://hub.docker.com/r/aecgeeks/ifcopenshell) |
[![Open Collective Contributors](https://img.shields.io/opencollective/all/opensourcebim?label=Sponsors&color=22ce5f)](https://opencollective.com/opensourcebim/)
Contents
--------
Those marked with an asterisk are part of IfcOpenShell.
| Name | Description | License | Service |
| ------------------------- | --------------------------------------------------------------------- | ------------------- | ------- |
| bcf | Library to read and write BCF-XML and query OpenCDE BCF-API modules | LGPL-3.0-or-later | [![PyPI](https://img.shields.io/pypi/v/bcf-client?label=PyPI&color=006dad)](https://pypi.org/project/bcf-client/) [![Anaconda-Server Badge](https://anaconda.org/conda-forge/bcf-client/badges/version.svg)](https://anaconda.org/conda-forge/bcf-client) |
| bonsai | Add-on to Blender providing a graphical native IFC authoring platform | GPL-3.0-or-later | [![Official](https://img.shields.io/badge/BonsaiBIM.org-Download-70ba35)](https://bonsaibim.org/download.html) [![GitHub Unstable](https://img.shields.io/github/v/release/ifcopenshell/ifcopenshell?filter=bonsai-*&label=GitHub-Unstable&color=f6f8fa)](https://github.com/IfcOpenShell/IfcOpenShell/releases?q=bonsai&expanded=true) [![Chocolatey](https://img.shields.io/chocolatey/v/blenderbim-nightly?label=Chocolatey&color=5c9fd8)](https://community.chocolatey.org/packages/blenderbim-nightly/) |
| bsdd | Library to query the bSDD API | LGPL-3.0-or-later | [![PyPI](https://img.shields.io/pypi/v/bsdd?label=PyPI&color=006dad)](https://pypi.org/project/bsdd/) |
| ifc2ca | Utility to convert IFC structural analysis models to Code_Aster | LGPL-3.0-or-later |
| ifc4d | Convert to and from IFC and project management software | LGPL-3.0-or-later | [![PyPI](https://img.shields.io/pypi/v/ifc4d?label=PyPI&color=006dad)](https://pypi.org/project/ifc4d/) |
| ifc5d | Report and optimise cost information from IFC | LGPL-3.0-or-later | [![PyPI](https://img.shields.io/pypi/v/ifc5d?label=PyPI&color=006dad)](https://pypi.org/project/ifc5d/) |
| ifcbimtester | Wrapper for Gherkin based unit testing for IFC models | LGPL-3.0-or-later |
| ifcblender | Historic Blender IFC import add-on | LGPL-3.0-or-later\* |
| ifccityjson | Convert CityJSON to IFC | LGPL-3.0-or-later | [![PyPI](https://img.shields.io/pypi/v/ifccityjson?label=PyPI&color=006dad)](https://pypi.org/project/ifccityjson/) |
| ifcclash | Clash detection library and CLI app | LGPL-3.0-or-later | [![PyPI](https://img.shields.io/pypi/v/ifcclash?label=PyPI&color=006dad)](https://pypi.org/project/ifcclash/) |
| ifcconvert | CLI app to convert IFC to many other formats | LGPL-3.0-or-later\* | [![Official](https://img.shields.io/badge/IfcOpenShell.org-Download-70ba35)](https://docs.ifcopenshell.org/ifcconvert/installation.html) [![GitHub](https://img.shields.io/github/v/release/ifcopenshell/ifcopenshell?filter=ifcconvert-*&label=GitHub&color=f6f8fa)](https://github.com/IfcOpenShell/IfcOpenShell/releases?q=ifcconvert&expanded=true)
| ifccsv | Library and CLI app to export and import schedules from IFC | LGPL-3.0-or-later | [![PyPI](https://img.shields.io/pypi/v/ifccsv?label=PyPI&color=006dad)](https://pypi.org/project/ifccsv/) |
| ifcdiff | Compare changes between IFC models | LGPL-3.0-or-later | [![PyPI](https://img.shields.io/pypi/v/ifcdiff?label=PyPI&color=006dad)](https://pypi.org/project/ifcdiff/) |
| ifcfm | Extract IFC data for FM handover requirements | LGPL-3.0-or-later | [![PyPI](https://img.shields.io/pypi/v/ifcfm?label=PyPI&color=006dad)](https://pypi.org/project/ifcfm/) |
| ifcmax | Historic extension for IFC support in 3DS Max | LGPL-3.0-or-later\* | [![Official](https://img.shields.io/badge/IfcOpenShell.org-Download-70ba35)](https://docs.ifcopenshell.org/ifcmax.html)
| ifcopenshell-python | Python library for IFC manipulation | LGPL-3.0-or-later\* | [![Official](https://img.shields.io/badge/IfcOpenShell.org-Download-70ba35)](https://docs.ifcopenshell.org/ifcopenshell-python/installation.html) [![GitHub](https://img.shields.io/github/v/release/ifcopenshell/ifcopenshell?filter=ifcopenshell-python-*&label=GitHub&color=f6f8fa)](https://github.com/IfcOpenShell/IfcOpenShell/releases?q=ifcopenshell-python&expanded=true) [![PyPI](https://img.shields.io/pypi/v/ifcopenshell?label=PyPI&color=006dad)](https://pypi.org/project/ifcopenshell/) [![Anaconda](https://img.shields.io/conda/vn/conda-forge/ifcopenshell?label=Anaconda&color=43b02a)](https://anaconda.org/conda-forge/ifcopenshell) [![Anaconda](https://img.shields.io/conda/vn/ifcopenshell/ifcopenshell?label=Anaconda-Unstable&color=43b02a)](https://anaconda.org/ifcopenshell/ifcopenshell) [![Docker](https://img.shields.io/docker/pulls/aecgeeks/ifcopenshell?label=Docker&color=1D63ED)](https://hub.docker.com/r/aecgeeks/ifcopenshell) [![AUR](https://img.shields.io/aur/version/ifcopenshell?label=AUR&color=1793d1)](https://aur.archlinux.org/packages/ifcopenshell) [![AUR Unstable](https://img.shields.io/aur/version/ifcopenshell-git?label=AUR-Unstable&color=1793d1)](https://aur.archlinux.org/packages/ifcopenshell-git) |
| ifcpatch | Utility to run pre-packaged scripts to manipulate IFCs | LGPL-3.0-or-later | [![PyPI](https://img.shields.io/pypi/v/ifcpatch?label=PyPI&color=006dad)](https://pypi.org/project/ifcpatch/) |
| ifcsverchok | Blender Add-on for visual node programming with IFC | GPL-3.0-or-later | [![GitHub Unstable](https://img.shields.io/github/v/release/ifcopenshell/ifcopenshell?filter=ifcsverchok-*.*.*.*&label=GitHub-Unstable&color=f6f8fa)](https://github.com/IfcOpenShell/IfcOpenShell/releases?q=ifcsverchok&expanded=true)
| ifctester | Library, CLI and webapp for IDS model auditing | LGPL-3.0-or-later | [![PyPI](https://img.shields.io/pypi/v/ifctester?label=PyPI&color=006dad)](https://pypi.org/project/ifctester/) |
The IfcOpenShell C++ codebase is split into multiple interal libraries:
| Name | Description | License |
| ------------------------- | --------------------------------------------------------------------- | ------------------- |
| bcf | Library to read and write BCF-XML and query OpenCDE BCF-API modules | LGPL-3.0-or-later |
| blenderbim | Add-on to Blender providing a graphical native IFC authoring platform | GPL-3.0-or-later |
| bsdd | Library to query the bSDD API | LGPL-3.0-or-later |
| ifc2ca | Utility to convert IFC structural analysis models to Code_Aster | LGPL-3.0-or-later |
| ifc4d | Convert to and from IFC and project management software | LGPL-3.0-or-later |
| ifc5d | Report and optimise cost information from IFC | LGPL-3.0-or-later |
| ifcbimtester | Wrapper for Gherkin based unit testing for IFC models | LGPL-3.0-or-later |
| ifcblender | Historic Blender IFC import add-on | LGPL-3.0-or-later\* |
| ifccityjson | Convert CityJSON to IFC | LGPL-3.0-or-later |
| ifcclash | Clash detection library and CLI app | LGPL-3.0-or-later |
| ifcconvert | CLI app to convert IFC to many other formats | LGPL-3.0-or-later\* |
| ifccsv | Library and CLI app to export and import schedules from IFC | LGPL-3.0-or-later |
| ifcdiff | Compare changes between IFC models | LGPL-3.0-or-later |
| ifcfm | Extract IFC data for FM handover requirements | LGPL-3.0-or-later |
| ifcgeom | Internal library for IfcOpenShell | LGPL-3.0-or-later\* |
| ifcgeom\_schema\_agnostic | Internal library for IfcOpenShell | LGPL-3.0-or-later\* |
| ifcgeomserver | Internal library for IfcOpenShell | LGPL-3.0-or-later\* |
| ifcjni | Internal library for IfcOpenShell | LGPL-3.0-or-later\* |
| ifcmax | Historic extension for IFC support in 3DS Max | LGPL-3.0-or-later\* |
| ifcopenshell-python | Python library for IFC manipulation | LGPL-3.0-or-later\* |
| ifcparse | Internal library for IfcOpenShell | LGPL-3.0-or-later\* |
| ifcpatch | Utility to run pre-packaged scripts to manipulate IFCs | LGPL-3.0-or-later |
| ifcsverchok | Blender Add-on for visual node programming with IFC | GPL-3.0-or-later |
| ifctester | Library, CLI and webapp for IDS model auditing | LGPL-3.0-or-later |
| ifcwrap | Internal library for IfcOpenShell | LGPL-3.0-or-later\* |
| qtviewer | Internal library for IfcOpenShell | LGPL-3.0-or-later\* |
| serializers | Internal library for IfcOpenShell | LGPL-3.0-or-later\* |
+1 -1
View File
@@ -1 +1 @@
0.7.9
0.8.1
-89
View File
@@ -1,89 +0,0 @@
import datetime
import re
import sys
from urllib import request
def request_repo_info(url: str):
req = request.Request(url)
resp = request.urlopen(req)
if not resp.status == 200:
print(f"[ERROR] could not contact server: {url}")
quit(1)
return resp
def get_choco_package_info() -> str:
resp = request_repo_info(URL_CHOCO_PACKAGE)
html_txt = str(resp.read())
return html_txt
def get_latest_blender_version() -> list:
html_txt = get_choco_package_info()
return re.findall(RE_BLENDER_VERSION_MIN_MAJ_PAT, html_txt)
URL_IFCOS_RELEASES = "https://github.com/IfcOpenShell/IfcOpenShell/releases"
URL_CHOCO_PACKAGE = "https://community.chocolatey.org/packages/blender"
URL_BLENDER_CMAKE = "https://raw.githubusercontent.com/blender/blender/{}/build_files/cmake/Modules/FindPythonLibsUnix.cmake"
RE_BLENDER_VERSION_MIN_MAJ = r"Latest Version.+<span>Blender (\d+\.\d+)\..+</span>"
RE_BLENDER_VERSION_MIN_MAJ_PAT = r"Latest Version.+<span>Blender (\d+\.\d+\.\d+)</span>"
RE_BLENDER_PYTHON_VERSION_MAJ_MIN = r"(?:set|SET)\(_PYTHON_VERSION_SUPPORTED (\d+\.\d+)\)"
if sys.argv[1] == "--do_choco_release?":
now = datetime.datetime.now()
blenderbim_date = (now - datetime.timedelta(days=1)).strftime("%y%m%d")
resp = request_repo_info(URL_IFCOS_RELEASES)
text = str(resp.read())
if blenderbim_date in text:
print("do_choco_release", end="")
elif sys.argv[1] == "--latest_blender_release_maj_min_pat?":
latest_blender_version = get_latest_blender_version()
if latest_blender_version:
print(latest_blender_version[0], end="")
else:
print("[ERROR] could not determine blender_version_min_maj_pat")
quit(1)
elif sys.argv[1] == "--latest_blender_release_maj_min?":
html_txt = get_choco_package_info()
blender_version_min_maj = re.findall(RE_BLENDER_VERSION_MIN_MAJ, html_txt)
if blender_version_min_maj:
print(blender_version_min_maj[0], end="")
else:
print("[ERROR] could not determine blender_version_min_maj")
quit(1)
elif sys.argv[1] == "--latest_blender_python_version_maj_min?":
latest_blender_version = get_latest_blender_version()
if latest_blender_version:
latest_blender_version_tag = f"v{latest_blender_version[0]}"
resp = request_repo_info(URL_BLENDER_CMAKE.format(latest_blender_version_tag))
html_txt = str(resp.read())
found = re.findall(RE_BLENDER_PYTHON_VERSION_MAJ_MIN, html_txt)
if found:
print(found[0], end="")
else:
print("[ERROR] could not determine blender_python_version_maj_min")
quit(1)
elif sys.argv[1] == "--pyver?":
latest_blender_version = get_latest_blender_version()
if latest_blender_version:
latest_blender_version_tag = f"v{latest_blender_version[0]}"
resp = request_repo_info(URL_BLENDER_CMAKE.format(latest_blender_version_tag))
html_txt = str(resp.read())
found = re.findall(RE_BLENDER_PYTHON_VERSION_MAJ_MIN, html_txt)
if found:
print(f"py{found[0].replace('.', '')}", end="")
else:
print("[ERROR] could not determine pyver")
quit(1)
@@ -1,49 +0,0 @@
import os
from pathlib import Path
print("[INFO] inserting dynamic chocolatey package parameters")
HERE_DIR = Path(__file__).parent.absolute()
# print(f"[INFO] HERE_DIR: {HERE_DIR}")
topics = {
"spec": {
"path": HERE_DIR / "blenderbim.nuspec",
"env_vars": {
"latest_blender_version_maj_min_pat",
"blenderbim_build_version",
},
},
"install": {
"path": HERE_DIR / "tools" / "chocolateyinstall.ps1",
"env_vars": {
"url_blenderbim_py310_win_zip",
"sha256sum_blenderbim_py310_win_zip",
"latest_blender_version_maj_min",
},
},
"uninstall": {
"path": HERE_DIR / "tools" / "chocolateyuninstall.ps1",
"env_vars": {
"latest_blender_version_maj_min",
},
},
}
for topic, info in topics.items():
print(f"[INFO] {topic}:")
for env_var_name in info["env_vars"]:
print(f"[INFO] {env_var_name} exists?: {os.environ[env_var_name]}")
with open(info["path"], encoding="utf-8") as txt:
content = txt.read()
for env_var_name in info["env_vars"]:
# print(f"[INFO] replace: {env_var_name}")
content = content.replace(env_var_name, os.environ[env_var_name])
with open(info["path"], "w", encoding="utf-8") as txt:
txt.write(content)
print(f"[INFO] written: {info['path']}")
print("[INFO] inserting dynamic chocolatey package parameters successful")
@@ -12,10 +12,10 @@
<projectUrl>https://github.com/IfcOpenShell/IfcOpenShell</projectUrl>
<iconUrl>https://rawcdn.githack.com/IfcOpenShell/IfcOpenShell/c6ee1d1679d1298de0d7447ff108c22709c68e54/choco/blenderbim/blenderbim.png</iconUrl>
<!-- <copyright>Year Software Vendor</copyright> -->
<licenseUrl>https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/COPYING</licenseUrl>
<licenseUrl>https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.8.0/COPYING</licenseUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<projectSourceUrl>https://github.com/IfcOpenShell/IfcOpenShell</projectSourceUrl>
<docsUrl>https://docs.blenderbim.org/</docsUrl>
<docsUrl>https://docs.bonsaibim.org/</docsUrl>
<!--<mailingListUrl></mailingListUrl>-->
<bugTrackerUrl>https://github.com/IfcOpenShell/IfcOpenShell/issues</bugTrackerUrl>
<tags>blender bim blenderbim ifc python opensource foss</tags>

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

+224
View File
@@ -0,0 +1,224 @@
# commands to run it on a generic ubuntu 2404 oci container:
"""
apt update && apt install git wget curl ptpython mono-devel micro
mkdir -p /home/runner/work/IfcOpenShell && cd /home/runner/work/IfcOpenShell
git clone https://github.com/IfcOpenShell/IfcOpenShell
cd /home/runner/work/IfcOpenShell/IfcOpenShell/choco/blenderbim/
micro choco_release.py # paste this script, comment out push command
export CHOCO_TOKEN="secret_choco_release_token"
python3 choco_release.py
"""
import datetime
import hashlib
import os
import pathlib
import re
from urllib import request
from github import Github
from typing import NoReturn
def get_repo_tag_names() -> list[str]:
git_return = os.popen("git tag -l").read()
tag_names = [tag_name for tag_name in git_return.split("\n") if tag_name]
print(f"{len(tag_names)} tag_names found in repo")
return tag_names
def request_repo_info(url: str):
req = request.Request(url)
resp = request.urlopen(req)
if not resp.status == 200:
print(f"[ERROR] could not contact server: {url}")
quit(1)
return resp
def get_choco_package_info() -> str:
resp = request_repo_info(URL_CHOCO_PACKAGE)
html_txt = str(resp.read())
return html_txt
def get_latest_choco_blender_version() -> list:
html_txt = get_choco_package_info()
return re.findall(RE_BLENDER_VERSION_MIN_MAJ_PAT, html_txt)
def get_file_sha256_hash(file_path: str) -> str:
BLOCKSIZE = 65536
hasher = hashlib.sha256()
with open(file_path, "rb") as input_file:
buffer = input_file.read(BLOCKSIZE)
while len(buffer) > 0:
hasher.update(buffer)
buffer = input_file.read(BLOCKSIZE)
return hasher.hexdigest()
def quit_with_error_message(message: str) -> NoReturn:
print(f"ERROR: {message}")
quit(0)
def get_release_zip(tag: str) -> tuple[str, str]:
g = Github()
repo = g.get_repo("IfcOpenShell/IfcOpenShell")
release = repo.get_release(tag)
for asset in release.get_assets():
asset_name = asset.name
if python_version not in asset_name:
continue
if TARGET_OS not in asset_name:
continue
return (asset_name, asset.browser_download_url)
raise Exception(f"Couldn't find the release matching '{python_version}' and '{TARGET_OS}' in tag '{tag}'.")
start = datetime.datetime.now()
URL_CHOCO_PACKAGE = "https://community.chocolatey.org/packages/blender"
URL_BLENDER_CMAKE = "https://raw.githubusercontent.com/blender/blender/{}/build_files/cmake/Modules/FindPythonLibsUnix.cmake"
RE_BLENDER_VERSION_MIN_MAJ = r"Latest Version.+<span>Blender (\d+\.\d+)\..+</span>"
RE_BLENDER_VERSION_MIN_MAJ_PAT = r"Latest Version.+<span>Blender (\d+\.\d+\.\d+)</span>"
RE_BLENDER_PYTHON_VERSION_MAJ_MIN = r"\(_PYTHON_VERSION_SUPPORTED (\d+\.\d+)\)"
BLENDERBIM_DIR = pathlib.Path("/home/runner/work/IfcOpenShell/IfcOpenShell/choco/blenderbim/")
print("_____ check choco release needed?")
os.chdir(BLENDERBIM_DIR)
blenderbim_date_yesterday = (datetime.datetime.now() - datetime.timedelta(days=1)).strftime("%y%m%d")
should_release = False
target_release_tag = ""
TARGET_OS = "windows-x64"
git_status = os.popen("git status").read()
print(git_status)
for tag_name in get_repo_tag_names():
print(tag_name)
if blenderbim_date_yesterday in tag_name:
should_release = True
target_release_tag = tag_name
print(f"found {tag_name=} - {should_release=}")
break
if not should_release:
print(f"INFO: no blenderbim release tags found for {blenderbim_date_yesterday} -> no choco release today.")
quit(0)
print(f"{should_release=}")
if not os.environ.get("CHOCO_TOKEN"):
quit_with_error_message("could retrieve CHOCO_TOKEN env var")
choco_token = os.environ["CHOCO_TOKEN"]
print("\n_____ get blender info")
# blender_version_min_maj_pat - from chocolatey.org
latest_blender_release_maj_min_pat = get_latest_choco_blender_version()
if not latest_blender_release_maj_min_pat:
quit_with_error_message("could not determine blender_version_min_maj_pat")
latest_blender_release_maj_min_pat = latest_blender_release_maj_min_pat[0]
print(f"{latest_blender_release_maj_min_pat=}")
# blender_version_min_maj - from chocolatey.org
blender_version_min_maj = latest_blender_release_maj_min_pat.rsplit(".", 1)[0]
print(f"{blender_version_min_maj=}")
# blender_python_version_maj_min - from blender repo
python_version = ""
latest_blender_version_tag = f"v{latest_blender_release_maj_min_pat}"
resp = request_repo_info(URL_BLENDER_CMAKE.format(latest_blender_version_tag))
html_txt = str(resp.read())
found = re.findall(RE_BLENDER_PYTHON_VERSION_MAJ_MIN, html_txt)
if not found:
quit_with_error_message("could not determine blender_python_version_maj_min")
blender_python_version_maj_min = found[0]
print(f"{blender_python_version_maj_min=}")
python_version = f"py{found[0].replace('.', '')}"
print(f"{python_version=}")
blenderbim_build_version = target_release_tag.replace("blenderbim-", "")
# url_blenderbim_py3x_win_zip
release_zip_file_name, url_blenderbim_py3x_win_zip = get_release_zip(target_release_tag)
os.popen(f"wget {url_blenderbim_py3x_win_zip} --no-verbose").read()
# sha256sum_blenderbim_py310_win_zip
sha256sum_blenderbim_py3x_win_zip = get_file_sha256_hash(release_zip_file_name)
print("\n_____ fill dynamic chocolatey package parameters")
HERE_DIR = pathlib.Path(__file__).parent.absolute()
# print(f"[INFO] HERE_DIR: {HERE_DIR}")
topics = {
"spec": {
"path": HERE_DIR / "blenderbim.nuspec",
"key_values": {
"latest_blender_version_maj_min_pat": latest_blender_release_maj_min_pat,
"blenderbim_build_version" : blenderbim_build_version,
},
},
"install": {
"path": HERE_DIR / "tools" / "chocolateyinstall.ps1",
"key_values": {
"url_blenderbim_py3x_win_zip" : url_blenderbim_py3x_win_zip,
"sha256sum_blenderbim_py3x_win_zip": sha256sum_blenderbim_py3x_win_zip,
"latest_blender_version_maj_min" : blender_version_min_maj,
},
},
"uninstall": {
"path": HERE_DIR / "tools" / "chocolateyuninstall.ps1",
"key_values": {
"latest_blender_version_maj_min": blender_version_min_maj,
},
},
}
for topic, info in topics.items():
print(f" {topic}:")
with open(info["path"], encoding="utf-8") as txt:
content = txt.read()
for key, value in info["key_values"].items():
# print(f"[INFO] replace: {env_var_name}")
if not key in content:
print(f" {key=} not found in {info['path']}")
content = content.replace(key, value)
with open(info["path"], "w", encoding="utf-8") as txt:
txt.write(content)
print(f" written: {info['path']}")
print("[INFO] inserting dynamic chocolatey package parameters successful")
print("\n_____ build choco.exe with mono")
choco_version = "1.1.0"
os.popen(f"wget https://github.com/chocolatey/choco/archive/refs/tags/{choco_version}.tar.gz --quiet").read()
os.popen(f"tar -xzf {choco_version}.tar.gz").read()
print("choco tar unpack successful")
os.chdir("choco-1.1.0")
os.popen("./build.sh").read()
os.popen("cp -r build_output/chocolatey /opt/chocolatey").read()
os.chdir(BLENDERBIM_DIR)
if pathlib.Path("/opt/chocolatey/choco.exe").exists():
print("choco build successful")
print("\n_____ build choco pack")
os.popen("mono /opt/chocolatey/choco.exe pack --allow-unofficial").read()
os.popen('mono /opt/chocolatey/choco.exe setapikey --key="{choco_token}" --source="https://push.chocolatey.org/" --allow-unofficial').read()
print("\n_____ build choco push")
os.popen('mono /opt/chocolatey/choco.exe push --source="https://push.chocolatey.org/" --key="$CHOCO_TOKEN" --allow-unofficial --verbose').read()
print(f"choco push of version: {target_release_tag} successful!")
print(f"it took: {datetime.datetime.now() - start}")
@@ -1,7 +1,7 @@
$ErrorActionPreference = 'Stop'
$url64 = 'url_blenderbim_py310_win_zip'
$checksum64 = 'sha256sum_blenderbim_py310_win_zip'
$url64 = 'url_blenderbim_py3x_win_zip'
$checksum64 = 'sha256sum_blenderbim_py3x_win_zip'
$checksumType64 = 'sha256'
$appDataUserDir = [System.Environment]::GetEnvironmentVariable('appdata')
+65 -33
View File
@@ -27,11 +27,11 @@ if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
endif()
project(IfcOpenShell VERSION 0.8.0)
add_definitions(-D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR)
cmake_policy(SET CMP0048 NEW)
cmake_policy(SET CMP0074 NEW)
cmake_policy(SET CMP0078 OLD)
cmake_policy(SET CMP0078 NEW)
cmake_policy(SET CMP0086 NEW)
if (POLICY CMP0144)
cmake_policy(SET CMP0144 NEW) # find_package() uses upper-case <PACKAGENAME>_ROOT variables.
@@ -82,6 +82,17 @@ option(WITH_RELATIONSHIP_VALIDATION "Build IfcConvert with option to validate ge
option(USERSPACE_PYTHON_PREFIX "Installs IfcPython for the current user only instead of system-wide." OFF)
option(ADD_COMMIT_SHA "Add commit sha and branch in version number, warning results in many rebuilds, requires git" OFF)
option(VERSION_OVERRIDE "Override the version defined in IfcParse.h with the file VERSION in the repository root" OFF)
if (VERSION_OVERRIDE)
file(READ "../VERSION" "RELEASE_VERSION_")
string(STRIP "${RELEASE_VERSION_}" RELEASE_VERSION)
message(STATUS "Detected version '${RELEASE_VERSION}'")
else()
set(RELEASE_VERSION "0.8.0")
endif()
project(IfcOpenShell VERSION ${RELEASE_VERSION})
if(MINIMAL_BUILD)
message(STATUS "Setting options for minimal build")
@@ -212,10 +223,11 @@ endif()
if(GLTF_SUPPORT OR CITYJSON_SUPPORT)
UNIFY_ENVVARS_AND_CACHE(JSON_INCLUDE_DIR)
find_file(json_hpp "json.hpp" ${JSON_INCLUDE_DIR}/nlohmann)
find_path(json_header_path "nlohmann/json.hpp" HINTS ${JSON_INCLUDE_DIR})
set(JSON_INCLUDE_DIR ${json_header_path})
if(json_hpp)
message(STATUS "JSON for Modern C++ header file found")
if(json_header_path)
message(STATUS "JSON for Modern C++ header file found in ${JSON_INCLUDE_DIR}")
else()
message(FATAL_ERROR "Unable to find JSON for Modern C++ header file, aborting")
endif()
@@ -590,25 +602,27 @@ if(HDF5_SUPPORT)
else()
message(STATUS "Packaging hdf5 and zlib for conda distribution")
if(WIN32)
# Windows
set(zlib_post zlib)
set(lib_ext lib)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# macOS
set(zlib_post libz)
set(lib_ext dylib)
else()
# linux
set(zlib_post libz)
set(lib_ext so)
endif()
set(HDF5_LIBRARIES
set(HDF5_LIBRARIES
"${HDF5_LIBRARY_DIR}/libhdf5_cpp.${lib_ext}"
"${HDF5_LIBRARY_DIR}/libhdf5.${lib_ext}"
"${HDF5_LIBRARY_DIR}/${zlib_post}.${lib_ext}"
)
else()
# linux and windows
# Find HDF5 package
find_package(HDF5 REQUIRED COMPONENTS C CXX)
# Find ZLIB package
find_package(ZLIB REQUIRED)
# Include directories
include_directories(${HDF5_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS})
# Link libraries
set(HDF5_LIBRARIES ${HDF5_LIBRARIES} ${ZLIB_LIBRARIES})
message(STATUS "HDF5 libraries: ${HDF5_LIBRARIES}")
endif()
endif()
endif()
@@ -718,6 +732,10 @@ if(MSVC)
# endif()
add_definitions(-D_ENABLE_EXTENDED_ALIGNED_STORAGE)
# See #5158.
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.40)
add_definitions(-D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR)
endif()
else()
add_definitions(-Wall -Wextra)
@@ -741,6 +759,7 @@ endif(MSVC)
include_directories(${INCLUDE_DIRECTORIES} ${OCC_INCLUDE_DIR} ${OPENCOLLADA_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS} ${LIBXML2_INCLUDE_DIR} ${JSON_INCLUDE_DIR} ${HDF5_INCLUDE_DIR}
${EIGEN_DIR} ${CGAL_INCLUDE_DIR} ${GMP_INCLUDE_DIR} ${MPFR_INCLUDE_DIR} ${USD_INCLUDE_DIR}
${TBB_INCLUDE_DIR}
)
if(NOT SCHEMA_VERSIONS)
@@ -1032,10 +1051,19 @@ if(BUILD_CONVERT)
target_include_directories(cityjson_converter PRIVATE ../src)
set(IFCOPENSHELL_LIBRARIES ${IFCOPENSHELL_LIBRARIES} cityjson_converter)
install(TARGETS cityjson_converter
ARCHIVE DESTINATION ${LIBDIR}
LIBRARY DESTINATION ${LIBDIR}
)
add_executable(cityjson_converter_exe ${CITYJSON_CONVERT_FILES})
set_target_properties(cityjson_converter_exe PROPERTIES COMPILE_FLAGS "-DCITYJSON_EXECUTABLE")
target_include_directories(cityjson_converter_exe PRIVATE ../src)
target_link_libraries(cityjson_converter_exe ${IFCOPENSHELL_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${Boost_LIBRARIES} ${HDF5_LIBRARIES} ${USD_LIBRARIES})
install(TARGETS cityjson_converter_exe
RUNTIME DESTINATION ${BINDIR}
)
endif()
# IfcConvert
@@ -1095,22 +1123,26 @@ if(ADD_COMMIT_SHA)
find_package(Git)
if(GIT_FOUND)
message("git found: ${GIT_EXECUTABLE} with version ${GIT_VERSION_STRING}")
execute_process(
COMMAND ${GIT_EXECUTABLE} branch -a --contains HEAD
OUTPUT_VARIABLE git_branches
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string(REPLACE "\n" ";" git_branch_list "${git_branches}")
if (VERSION_OVERRIDE)
set (git_branch ${RELEASE_VERSION})
else()
message("git found: ${GIT_EXECUTABLE} with version ${GIT_VERSION_STRING}")
execute_process(
COMMAND ${GIT_EXECUTABLE} branch -a --contains HEAD
OUTPUT_VARIABLE git_branches
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string(REPLACE "\n" ";" git_branch_list "${git_branches}")
foreach(git_branch_candidate IN ITEMS ${git_branch_list})
string(REPLACE "*" "" git_branch_candidate_temp "${git_branch_candidate}")
string(STRIP "${git_branch_candidate_temp}" git_branch_candidate_2)
if(NOT git_branch_candidate_2 MATCHES "^HEAD$")
string(REPLACE "/" ";" git_branch_candidate_2_list "${git_branch_candidate_2}")
list(GET git_branch_candidate_2_list -1 git_branch)
endif()
endforeach()
foreach(git_branch_candidate IN ITEMS ${git_branch_list})
string(REPLACE "*" "" git_branch_candidate_temp "${git_branch_candidate}")
string(STRIP "${git_branch_candidate_temp}" git_branch_candidate_2)
if(NOT git_branch_candidate_2 MATCHES "^HEAD$")
string(REPLACE "/" ";" git_branch_candidate_2_list "${git_branch_candidate_2}")
list(GET git_branch_candidate_2_list -1 git_branch)
endif()
endforeach()
endif()
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
@@ -1177,7 +1209,7 @@ if(BUILD_IFCGEOM)
DESTINATION ${INCLUDEDIR}/ifcgeom_schema_agnostic
)
install(TARGETS ${IFCGEOM_SCHEMA_LIBRARIES} IfcGeom
install(TARGETS ${IFCGEOM_SCHEMA_LIBRARIES} ${kernel_libraries} IfcGeom
ARCHIVE DESTINATION ${LIBDIR}
LIBRARY DESTINATION ${LIBDIR}
RUNTIME DESTINATION ${BINDIR}
-1
View File
@@ -1 +0,0 @@
.env
+8 -6
View File
@@ -1,10 +1,13 @@
mkdir build && cd build
REM Remove dot from PY_VER for use in library name
REM From https://github.com/tpaviot/pythonocc-core/blob/master/ci/conda/bld.bat
set MY_PY_VER=%PY_VER:.=%
rem set LIBXML2="%LIBRARY_PREFIX%/lib/libxml2.lib"
set LIBXML2="%LIBRARY_PREFIX%/lib/libxml2.lib"
cmake -G "Ninja" ^
-D SCHEMA_VERSIONS="2x3;4;4x1;4x3;4x3_add1" ^
-D SCHEMA_VERSIONS="2x3;4;4x1;4x3_add2" ^
-D CMAKE_BUILD_TYPE:STRING=Release ^
-D CMAKE_INSTALL_PREFIX:FILEPATH="%LIBRARY_PREFIX%" ^
-D CMAKE_PREFIX_PATH:FILEPATH="%LIBRARY_PREFIX%" ^
@@ -39,11 +42,10 @@ cmake -G "Ninja" ^
-D Boost_INCLUDE_DIR:FILEPATH="%LIBRARY_PREFIX%\include" ^
-D Boost_USE_STATIC_LIBS:BOOL=OFF ^
-D CITYJSON_SUPPORT:BOOL=OFF ^
%SRC_DIR%/cmake
../cmake
if errorlevel 1 exit 1
:: Build and install
cmake --build . -- install
ninja install -j 1
if errorlevel 1 exit 1
+3 -5
View File
@@ -6,16 +6,14 @@
if [ "$(uname)" == "Darwin" ]; then
export FSUFFIX=dylib
export CFLAGS="$CFLAGS -Wl,-flat_namespace,-undefined,suppress"
export CXXFLAGS="$CXXFLAGS -Wl,-flat_namespace,-undefined,suppress"
export LDFLAGS="$LDFLAGS -Wl,-flat_namespace,-undefined,suppress"
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
export FSUFFIX=so
fi
cmake -G Ninja \
-DSCHEMA_VERSIONS="2x3;4;4x1;4x3;4x3_add1" \
cmake ${CMAKE_ARGS} -G Ninja \
-DSCHEMA_VERSIONS="2x3;4;4x1;4x3_add2" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
${CMAKE_PLATFORM_FLAGS[@]} \
@@ -48,4 +46,4 @@ cmake -G Ninja \
ninja
ninja install -j 1
ninja install -j 1
+53 -6
View File
@@ -1,11 +1,58 @@
CONDA_BUILD_SYSROOT: # used for github actions conda daily build
- /Users/runner/work/MacOSX10.13.sdk # [osx]
variant:
- novtk
- all
occt:
- 7.7.1
- 7.8.1
c_compiler:
- vs2022 # [win]
- vs2022 # [win]
- gcc # [linux]
- clang # [osx]
c_stdlib:
- vs # [win]
- sysroot # [linux]
- macosx_deployment_target # [osx]
cxx_compiler:
- vs2022 # [win]
- vs2022 # [win]
- gcc # [linux]
- clangxx # [osx]
c_compiler_version:
- '12' # [linux]
- '16' # [osx]
cxx_compiler_version:
- '12' # [linux]
- '16' # [osx]
c_stdlib_version:
- '2.12' # [linux]
- '10.13' # [osx]
hdf5:
- 1.14.3
libboost_devel:
- '1.84'
libxml2:
- '2'
mpfr:
- '4'
gmp:
- '6' # [not win]
pin_run_as_build:
python:
min_pin: x.x
max_pin: x.x
zlib:
- '1'
target_platform:
- win-64 # [win]
- linux-64 # [linux]
- osx-64 # [osx]
macos_machine:
- x86_64-apple-darwin13.4.0
MACOSX_DEPLOYMENT_TARGET:
- '10.13'
MACOSX_SDK_VERSION:
- '10.13'
CONDA_BUILD_SYSROOT:
- "/Users/runner/work/MacOSX10.13.sdk" # [osx]
-58
View File
@@ -1,58 +0,0 @@
@echo off
:: This is a batch file to set the environment variables for the project
:: It is not necessary for conda compilation, but it provides you with type hints when working with the c++ libraries
:: OpenCascade, CGAL, Eigen, etc distributed using conda-forge in your IDE.
::
:: mamba env update -f environment.build.yml --prune
:: mamba activate ifcopenshell-build
::
:: Note!
:: You have to add a .env file next to this env.bat file where you set PREFIX=<path to your conda env>
set CONDA_BUILD=1
set MY_PY_VER=311
:: set this file's parent directory as a variable
set THIS_DIR=%~dp0
:: read the .env file located in THIS_DIR and set the environment variables.
:: the .env file should contain a line like this:
:: PREFIX=C:\Users\your_user_name\mambaforge3\envs\ifcopenshell-build
for /f "tokens=*" %%i in (%THIS_DIR%.env) do set %%i
set LIBRARY_PREFIX=%PREFIX%/Library
set CMAKE_PREFIX_PATH=%PREFIX%;%LIBRARY_PREFIX%/include;%LIBRARY_PREFIX%/lib;%LIBRARY_PREFIX%/bin
set OCC_LIBRARY_DIR=%LIBRARY_PREFIX%/lib
set OCC_INCLUDE_DIR=%LIBRARY_PREFIX%/include/opencascade
set CGAL_DIR=%LIBRARY_PREFIX%/lib/cmake/CGAL
set CGAL_INCLUDE_DIR=%LIBRARY_PREFIX%/include
set EIGEN_DIR=%LIBRARY_PREFIX%/include/eigen3
set LIBXML2_INCLUDE_DIR=%LIBRARY_PREFIX%/include/libxml2
set LIBXML2_LIBRARIES=%LIBRARY_PREFIX%/lib/libxml2.lib
set Boost_LIBRARY_DIR=%LIBRARY_PREFIX%/lib
set Boost_INCLUDE_DIR=%LIBRARY_PREFIX%/include
set Boost_USE_STATIC_LIBS=OFF
set GMP_INCLUDE_DIR=%LIBRARY_PREFIX%/include
set GMP_LIBRARY_DIR=%LIBRARY_PREFIX%/lib
set MPFR_LIBRARY_DIR=%LIBRARY_PREFIX%/lib
set HDF5_INCLUDE_DIR=%LIBRARY_PREFIX%/include
set HDF5_LIBRARY_DIR=%LIBRARY_PREFIX%/lib
set JSON_INCLUDE_DIR=%LIBRARY_PREFIX%/include
set HDF5_SUPPORT=ON
set BUILD_IFCPYTHON=ON
set BUILD_IFCGEOM=ON
set COLLADA_SUPPORT=OFF
set BUILD_EXAMPLES=OFF
set BUILD_GEOMSERVER=OFF
set GLTF_SUPPORT=ON
set BUILD_CONVERT=ON
set BUILD_IFCMAX=OFF
set IFCXML_SUPPORT=ON
set PYTHON_EXECUTABLE=%PREFIX%/python.exe
set PYTHON_LIBRARY=%PREFIX%/libs/python%MY_PY_VER%.lib
-17
View File
@@ -1,17 +0,0 @@
name: ifcopenshell-build
channels:
- conda-forge
dependencies:
- boa
- boost-cpp
- occt
- libxml2
- cgal-cpp
- hdf5
- mpfr
- nlohmann_json
- swig
- zlib
# These needs to be installed per platform
#- sel(unix): gmp
#- sel(win): mpir
+303
View File
@@ -0,0 +1,303 @@
{% set version = environ.get('VERSION_OVERRIDE', '0.8.0') %}
{% set build = 0 %}
# Higher number -> Always prioritize "novtk" variant over "all" variant
{% set build = build + 200 %} # [variant == "novtk"]
{% set build = build + 100 %} # [variant == "all"]
package:
name: ifcopenshell
version: {{ version }}
source:
path: ../
build:
number: {{ build }}
skip: true # [py<39]
binary_relocation: false # [osx]
string: py{{ CONDA_PY }}_{{ variant }}_h{{ PKG_HASH }}_{{ build }}
run_exports:
- {{ pin_subpackage('ifcopenshell', max_pin='x.x.x') }} *{{ variant }}*
requirements:
build:
- cmake
- ninja
- swig >=4.1.1
- {{ stdlib("c") }}
- {{ compiler('c') }}
- {{ compiler('cxx') }}
host:
- python
- libboost-devel
- occt *=*{{ variant }}*
- libxml2
- cgal-cpp
- hdf5
- eigen
- mpfr
- nlohmann_json
- gmp # [unix]
- mpir # [win]
- zlib
run:
- python
- {{ pin_compatible('occt', max_pin='x.x.x') }} *{{ variant }}*
- {{ pin_compatible('cgal-cpp', max_pin='x.x') }}
test:
imports:
- ifcopenshell
about:
home: https://ifcopenshell.org
license: LGPL-3.0-or-later
license_file: COPYING
summary: 'IfcOpenShell is a library to support the IFC file format'
description: |
IfcOpenShell
============
IfcOpenShell is an open source ([LGPL]) software library for working with Industry Foundation Classes ([IFC]). Complete
parsing support is provided for [IFC2x3 TC1], [IFC4 Add2 TC1], IFC4x1, IFC4x3, and IFC4x3. Extensive geometric support
is implemented for the IFC releases [IFC2x3 TC1] and [IFC4 Add2 TC1]. Extending with support for arbitrary IFC schemas
is possible at compile-time when using C++ and at run-time when using Python.
In addition to a C++ and Python API, IfcOpenShell comes with an ecosystem of tools, notably including IfcConvert (an
application to convert IFC models to
other formats), the BlenderBIM Add-on (an add-on to Blender providing a graphical IFC authoring platform), and many
other libraries, CLI apps, and more. Support is also provided for auxiliary standards such as BCF and IDS.
For more information, see:
* [IfcOpenShell Website](http://ifcopenshell.org)
* [IfcOpenShell Documentation](http://bonsaibim.org/docs-python)
* [IfcOpenShell C++ Installation](https://bonsaibim.org/docs-python/ifcopenshell/installation.html)
* [IfcOpenShell Python Installation](https://bonsaibim.org/docs-python/ifcopenshell-python/installation.html)
* [IfcOpenShell Python Hello World Tutorial](https://bonsaibim.org/docs-python/ifcopenshell-python/hello_world.html)
* [Bonsai Website](https://bonsaibim.org)
* [Bonsai Documentation](http://bonsaibim.org/docs)
* [Add-on Installation](https://bonsaibim.org/docs/users/installation.html)
* [Exploring an IFC model](https://bonsaibim.org/docs/users/exploring_an_ifc_model.html)
<table>
<thead>
<tr>
<th>Service</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>Anaconda Daily Build</td>
<td><a href="https://anaconda.org/ifcopenshell/ifcopenshell"><img src="https://img.shields.io/conda/vn/ifcopenshell/ifcopenshell" alt="Anaconda-Server Badge"></a></td>
</tr>
<tr>
<td>Anaconda v0.8.0 Stable</td>
<td><a href="https://anaconda.org/conda-forge/ifcopenshell"><img src="https://img.shields.io/conda/vn/conda-forge/ifcopenshell" alt="Anaconda-Server Badge"></a></td>
</tr>
<tr>
<td>PyPi Daily Build</td>
<td><a href="https://pypi.org/project/ifcopenshell/"><img src="https://img.shields.io/pypi/v/ifcopenshell" alt="PyPi Badge"></a></td>
</tr>
<tr>
<td>ArchLinux AUR Package Stable</td>
<td><a href="https://aur.archlinux.org/packages/ifcopenshell"><img src="https://img.shields.io/aur/version/ifcopenshell" alt="AUR Badge"></a></td>
</tr>
<tr>
<td>ArchLinux AUR Package git</td>
<td><a href="https://aur.archlinux.org/packages/ifcopenshell-git"><img src="https://img.shields.io/aur/version/ifcopenshell-git" alt="AUR Badge"></a></td>
</tr>
<tr>
<td>BlenderBIM Add-on Chocolatey (under moderation)</td>
<td><a href="https://community.chocolatey.org/packages/blenderbim-nightly/"><img src="https://img.shields.io/chocolatey/v/blenderbim-nightly" alt="Chocolatey Badge"></a></td>
</tr>
<tr>
<td>Sponsor development on OpenCollective</td>
<td><a href="https://opencollective.com/opensourcebim/"><img src="https://opencollective.com/opensourcebim/tiers/badge.svg" alt="Financial Contributors"></a></td>
</tr>
<tr>
<td>Docker hub</td>
<td><a href="https://hub.docker.com/r/aecgeeks/ifcopenshell"><img src="https://img.shields.io/docker/pulls/aecgeeks/ifcopenshell" alt="Docker Pulls"></a></td>
</tr>
</tbody>
</table>
Contents
--------
Those marked with an asterisk are part of IfcOpenShell.
<table>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>License</th>
</tr>
</thead>
<tbody>
<tr>
<td>bcf</td>
<td>Library to read and write BCF-XML and query OpenCDE BCF-API modules</td>
<td>LGPL-3.0-or-later</td>
</tr>
<tr>
<td>blenderbim</td>
<td>Add-on to Blender providing a graphical native IFC authoring platform</td>
<td>GPL-3.0-or-later</td>
</tr>
<tr>
<td>bsdd</td>
<td>Library to query the bSDD API</td>
<td>LGPL-3.0-or-later</td>
</tr>
<tr>
<td>ifc2ca</td>
<td>Utility to convert IFC structural analysis models to Code_Aster</td>
<td>LGPL-3.0-or-later</td>
</tr>
<tr>
<td>ifc4d</td>
<td>Convert to and from IFC and project management software</td>
<td>LGPL-3.0-or-later</td>
</tr>
<tr>
<td>ifc5d</td>
<td>Report and optimise cost information from IFC</td>
<td>LGPL-3.0-or-later</td>
</tr>
<tr>
<td>ifcbimtester</td>
<td>Wrapper for Gherkin based unit testing for IFC models</td>
<td>LGPL-3.0-or-later</td>
</tr>
<tr>
<td>ifcblender</td>
<td>Historic Blender IFC import add-on</td>
<td>LGPL-3.0-or-later*</td>
</tr>
<tr>
<td>ifccityjson</td>
<td>Convert CityJSON to IFC</td>
<td>LGPL-3.0-or-later</td>
</tr>
<tr>
<td>ifcclash</td>
<td>Clash detection library and CLI app</td>
<td>LGPL-3.0-or-later</td>
</tr>
<tr>
<td>ifccobie</td>
<td>Extract IFC data for COBie handover requirements</td>
<td>LGPL-3.0-or-later</td>
</tr>
<tr>
<td>ifcconvert</td>
<td>CLI app to convert IFC to many other formats</td>
<td>LGPL-3.0-or-later*</td>
</tr>
<tr>
<td>ifccsv</td>
<td>Library and CLI app to export and import schedules from IFC</td>
<td>LGPL-3.0-or-later</td>
</tr>
<tr>
<td>ifcdiff</td>
<td>Compare changes between IFC models</td>
<td>LGPL-3.0-or-later</td>
</tr>
<tr>
<td>ifcfm</td>
<td>Extract IFC data for FM handover requirements</td>
<td>LGPL-3.0-or-later</td>
</tr>
<tr>
<td>ifcgeom</td>
<td>Internal library for IfcOpenShell</td>
<td>LGPL-3.0-or-later*</td>
</tr>
<tr>
<td>ifcgeom_schema_agnostic</td>
<td>Internal library for IfcOpenShell</td>
<td>LGPL-3.0-or-later*</td>
</tr>
<tr>
<td>ifcgeomserver</td>
<td>Internal library for IfcOpenShell</td>
<td>LGPL-3.0-or-later*</td>
</tr>
<tr>
<td>ifcjni</td>
<td>Internal library for IfcOpenShell</td>
<td>LGPL-3.0-or-later*</td>
</tr>
<tr>
<td>ifcmax</td>
<td>Historic extension for IFC support in 3DS Max</td>
<td>LGPL-3.0-or-later*</td>
</tr>
<tr>
<td>ifcopenshell-python</td>
<td>Python library for IFC manipulation</td>
<td>LGPL-3.0-or-later*</td>
</tr>
<tr>
<td>ifcparse</td>
<td>Internal library for IfcOpenShell</td>
<td>LGPL-3.0-or-later*</td>
</tr>
<tr>
<td>ifcpatch</td>
<td>Utility to run pre-packaged scripts to manipulate IFCs</td>
<td>LGPL-3.0-or-later</td>
</tr>
<tr>
<td>ifcsverchok</td>
<td>Blender Add-on for visual node programming with IFC</td>
<td>GPL-3.0-or-later</td>
</tr>
<tr>
<td>ifctester</td>
<td>Library, CLI and webapp for IDS model auditing</td>
<td>LGPL-3.0-or-later</td>
</tr>
<tr>
<td>ifcwrap</td>
<td>Internal library for IfcOpenShell</td>
<td>LGPL-3.0-or-later*</td>
</tr>
<tr>
<td>qtviewer</td>
<td>Internal library for IfcOpenShell</td>
<td>LGPL-3.0-or-later*</td>
</tr>
<tr>
<td>serializers</td>
<td>Internal library for IfcOpenShell</td>
<td>LGPL-3.0-or-later*</td>
</tr>
</tbody>
</table>
[LGPL]: https://github.com/IfcOpenShell/IfcOpenShell/tree/master/COPYING.LESSER "LGPL-3.0-or-later"
[IFC]: https://technical.buildingsmart.org/standards/ifc/ "IFC"
[IFC2x3 TC1]: https://standards.buildingsmart.org/IFC/RELEASE/IFC2x3/TC1/HTML/ "IFC2x3 TC1"
[IFC4 Add2 TC1]: https://standards.buildingsmart.org/IFC/RELEASE/IFC4/ADD2_TC1/HTML/ "IFC4 Add2 TC1"
[Visual Studio]: https://www.visualstudio.com/ "Visual Studio"
[Visual C++ Build Tools]: http://landinghub.visualstudio.com/visual-cpp-build-tools "Visual C++ Build Tools"
[MSYS2]: https://msys2.github.io/ "MSYS2"
[win/readme.md]: https://github.com/IfcOpenShell/IfcOpenShell/tree/master/win/readme.md "win/readme.md"
[nix/build-all.py]: https://github.com/IfcOpenShell/IfcOpenShell/tree/master/nix/build-all.py "nix/build-all.py"
doc_url: https://ifcopenshell.org/
dev_url: https://github.com/IfcOpenShell/IfcOpenShell
extra:
recipe-maintainers:
- adrianinsaval
- looooo
- Krande
-64
View File
@@ -1,64 +0,0 @@
context:
name: ifcopenshell
version: 0.8.0alpha1
package:
name: '{{ name|lower }}'
version: '{{ version }}'
source:
path: ..
build:
number: 1
requirements:
build:
- "{{ compiler('c') }}"
- "{{ compiler('cxx') }}"
- ninja >=1.10.2
- cmake
- swig 4.1.1
host:
- python
- boost-cpp
- occt ==7.7.0
- libxml2
- cgal-cpp
- hdf5
- eigen
- mpfr
- sel(unix): gmp
- sel(win): mpir
- nlohmann_json
- zlib
run:
- python
- {{ pin_compatible('occt', max_pin='x.x.x') }}
- {{ pin_compatible('cgal-cpp', max_pin='x.x.x') }}
- {{ pin_compatible('boost-cpp', max_pin='x.x.x') }}
- libxml2
- hdf5
- eigen
- mpfr
- sel(unix): gmp
- sel(win): mpir
- nlohmann_json
- zlib
test:
imports:
- ifcopenshell
about:
home: https://ifcopenshell.org
license: LGPL-3.0-or-later
license_file: COPYING
summary: 'IfcOpenShell is a library to support the IFC file format'
description: |
IfcOpenShell is an open source (LGPL) software library for
working with the Industry Foundation Classes (IFC) file format.
doc_url: https://blenderbim.org/docs-python/
dev_url: https://github.com/IfcOpenShell/IfcOpenShell
+17 -6
View File
@@ -53,6 +53,7 @@ import logging
import os
import re
import sys
import glob
import subprocess as sp
import shutil
import tarfile
@@ -80,7 +81,7 @@ ADD_COMMIT_SHA = os.getenv("ADD_COMMIT_SHA")
PYTHON_VERSIONS = ["3.9.11", "3.10.3", "3.11.8", "3.12.1"]
JSON_VERSION = "v3.6.1"
OCE_VERSION = "0.18.3"
OCCT_VERSION = "7.7.1"
OCCT_VERSION = "7.8.1"
BOOST_VERSION = "1.80.0"
PCRE_VERSION = "8.41"
LIBXML2_VERSION = "2.9.11"
@@ -219,6 +220,7 @@ if "v" in flags:
else:
logger.setLevel(logging.INFO)
OFF_ON = ["OFF", "ON"]
BUILD_STATIC = "shared" not in flags
ENABLE_FLAG = "--enable-static" if BUILD_STATIC else "--enable-shared"
DISABLE_FLAG = "--disable-shared" if BUILD_STATIC else "--disable-static"
@@ -330,7 +332,7 @@ def run_cmake(arg1, cmake_args, cmake_dir=None, cwd=None):
if "wasm" in flags:
wasm.append("emcmake")
run([*wasm, "cmake", P, *cmake_args, f"-DCMAKE_BUILD_TYPE={BUILD_CFG}"], cwd=cwd)
run([*wasm, "cmake", P, *cmake_args, f"-DCMAKE_BUILD_TYPE={BUILD_CFG}", f"-DBUILD_SHARED_LIBS={OFF_ON[not BUILD_STATIC]}"], cwd=cwd)
def git_clone_or_pull_repository(clone_url, target_dir, revision=None):
@@ -350,6 +352,8 @@ def git_clone_or_pull_repository(clone_url, target_dir, revision=None):
run([git, "pull", clone_url], cwd=target_dir)
if revision != None:
run([git, "reset", "--hard"], cwd=target_dir)
run([git, "fetch", "--all"], cwd=target_dir)
run([git, "checkout", revision], cwd=target_dir)
@@ -576,6 +580,7 @@ if "freetype" in targets:
download_url = "https://github.com/freetype/freetype",
download_name = "freetype2",
download_tool=download_tool_git,
revision="VER-2-11-1"
)
if USE_OCCT and "occ" in targets:
@@ -586,6 +591,12 @@ if USE_OCCT and "occ" in targets:
if OCCT_VERSION == "7.7.1":
patches.append("./patches/occt/no_ExpToCasExe.patch")
if OCCT_VERSION == "7.7.2":
patches.append("./patches/occt/no_ExpToCasExe_7_7_2.patch")
if OCCT_VERSION == "7.8.1":
patches.append("./patches/occt/no_ExpToCasExe_7_8_1.patch")
if "wasm" in flags:
patches.append("./patches/occt/no_em_js.patch")
@@ -819,7 +830,6 @@ os.makedirs(IFCOS_DIR, exist_ok=True)
executables_dir = os.path.join(IFCOS_DIR, "executables")
os.makedirs(executables_dir, exist_ok=True)
OFF_ON = ["OFF", "ON"]
cmake_args = [
"-DUSE_MMAP=" "OFF",
@@ -830,7 +840,8 @@ cmake_args = [
"-DJSON_INCLUDE_DIR=" f"{DEPS_DIR}/install/json",
"-DEIGEN_DIR=" f"{DEPS_DIR}/install/eigen-3.3.9",
"-DBoost_NO_BOOST_CMAKE=" "On",
"-DADD_COMMIT_SHA=" +("On" if ADD_COMMIT_SHA else "Off")
"-DADD_COMMIT_SHA=" +("On" if ADD_COMMIT_SHA else "Off"),
"-DVERSION_OVERRIDE=" +("On" if ADD_COMMIT_SHA else "Off")
]
if "wasm" in flags:
@@ -960,7 +971,7 @@ if "IfcOpenShell-Python" in targets:
logger.info(f"\rBuilding python {python_version} wrapper... ")
run([make, f"-j{IFCOS_NUM_BUILD_PROCS}", "_ifcopenshell_wrapper"], cwd=python_dir)
run([make, f"-j{IFCOS_NUM_BUILD_PROCS}", "ifcopenshell_wrapper"], cwd=python_dir)
run([make, "install/local"], cwd=os.path.join(python_dir, "ifcwrap"))
if python_executable:
@@ -969,7 +980,7 @@ if "IfcOpenShell-Python" in targets:
if platform.system() != "Darwin":
if BUILD_CFG == "Release":
# TODO: This symbol name depends on the Python version?
run([strip, "-s", "-K", "PyInit__ifcopenshell_wrapper", "_ifcopenshell_wrapper.so"], cwd=module_dir)
run([strip, "-s", "-K", "PyInit__ifcopenshell_wrapper", glob.glob(os.path.join(module_dir, "_ifcopenshell_wrapper*.so"))[0]], cwd=module_dir)
return module_dir
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1bacca1a48..11f931ad39 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -820,6 +820,8 @@ else()
OCCT_CHECK_AND_UNSET ("3RDPARTY_DOT_EXECUTABLE")
endif()
+list (REMOVE_ITEM BUILD_TOOLKITS ExpToCasExe)
+
# bison
if (BUILD_YACCLEX)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/bison")
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 86905287dc..9d0bce984c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -828,6 +828,8 @@ else()
OCCT_CHECK_AND_UNSET ("3RDPARTY_DOT_EXECUTABLE")
endif()
+list (REMOVE_ITEM BUILD_TOOLKITS ExpToCasExe)
+
# bison
if (BUILD_YACCLEX)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/bison")
+1 -1
View File
@@ -1,6 +1,6 @@
package:
name: ifcopenshell
version: 0.7.0
version: 0.8.0
source:
path: IfcOpenShell
+1 -1
View File
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
setup(name='IfcOpenShell',
version='0.7.0',
version='0.8.0',
description='IfcOpenShell is an open source (LGPL) software library for working with the Industry Foundation Classes (IFC) file format.',
author='Thomas Krijnen',
author_email='thomas@aecgeeks.com',
+34 -1
View File
@@ -1,2 +1,35 @@
[tool.black]
line-length = 120
line-length = 120
include = '''
src/(
bcf
|bcfserver
|bonsai
|bsdd
|foundationserver
|ifc2ca
|ifc4d
|ifc5d
|ifcbimtester
|ifcblender
|ifccityjson
|ifcclash
|ifccsv
|ifcdiff
|ifcfm
|ifcpatch
|ifctester
|ifcopenshell-python
|ifcsverchok
|opencdeserver
)/.*.py$
'''
extend-exclude = '''
src/ifcopenshell-python/ifcopenshell/express/*
|src/ifcopenshell-python/ifcopenshell/mvd/*
|src/ifc2ca/templates/*
'''
[tool.pyright]
reportInvalidTypeForm = false
disableBytesTypePromotions = true
+1 -1
View File
@@ -10,7 +10,7 @@ type: software
authors:
- name: "IfcOpenShell contributors"
repository-code: >-
https://github.com/IfcOpenShell/IfcOpenShell/tree/v0.7.0/src/bcf
https://github.com/IfcOpenShell/IfcOpenShell/tree/v0.8.0/src/bcf
abstract: >-
Library to read and write BCF-XML and query OpenCDE
BCF-API modules
+26 -14
View File
@@ -1,8 +1,23 @@
VERSION:=`date '+%y%m%d'`
SED:=sed -i
ifeq ($(UNAME_S),Darwin)
SED:=sed -i '' -e
endif
# BCF - BCF Python library
# Copyright (C) 2021 Prabhat Singh <singh01prabhat@gmail.com>
#
# This file is part of BCF.
#
# BCF is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BCF is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with BCF. If not, see <http://www.gnu.org/licenses/>.
PACKAGE_NAME:=bcf
include ../common.mk
.PHONY: ci
ci:
@@ -15,16 +30,13 @@ license:
# TODO: make this based on xsd file presence
.PHONY: models
models:
cd src && xsdata generate -p bcf.v2.model --unnest-classes --kw-only --slots -ds Google bcf/v2/xsd
cd src && xsdata generate -p bcf.v3.model --unnest-classes --kw-only --slots -ds Google bcf/v3/xsd
xsdata generate -p bcf.v2.model --unnest-classes --kw-only --slots -ds Google bcf/v2/xsd
xsdata generate -p bcf.v3.model --unnest-classes --kw-only --slots -ds Google bcf/v3/xsd
.PHONY: dist
dist:
rm -rf dist
$(SED) "s/999999/$(VERSION)/" pyproject.toml
python -m build
$(SED) "s/$(VERSION)/999999/" pyproject.toml
.PHONY: test
test:
pytest -p no:pytest-blender tests
# .PHONY
# api:
# openapi-python-client generate --url https://api.swaggerhub.com/apis/buildingSMART/BCF/3.0
# openapi-python-client generate --url https://api.swaggerhub.com/apis/buildingSMART/BCF/3.0
+4
View File
@@ -3,3 +3,7 @@
A simple Python implementation of the BCF standard. Manipulation of BCF-XML is
available via `bcfxml.py` and manipulation of BCF-API is available via
`bcfapi.py`.
Python files in 'model' folder are automatically generated from .xsd files (located in 'xsd' folder).
To regenerate them you can use `make models`.
The only exception is 'v2/model/extensions.py', see it's note for the details.
@@ -15,3 +15,5 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with BCF. If not, see <http://www.gnu.org/licenses/>.
__version__ = version = "0.0.0"
+28
View File
@@ -0,0 +1,28 @@
import bcf.v2.model.extensions
import bcf.v3.model.extensions
from typing import NamedTuple, Union
from dataclasses import fields
class AttributeData(NamedTuple):
attr_type: type
subattr_name: str
subattr_xsd_name: str
Extensions = Union[bcf.v2.model.extensions.Extensions, bcf.v3.model.extensions.Extensions]
def get_extensions_attributes(extensions: Extensions) -> dict[str, AttributeData]:
"""Return mapping of xsd attribute name to a tuple that consists of:
- Extensions attribute name
- Extensions attribute type type
- subattribute name"""
possible_attributes = {}
for field in fields(type(extensions)):
field_type = field.type.__args__[0] # type: ignore [reportAttributeAccessIssue]
subfield = next(iter(fields(field_type)))
xsd_name = subfield.metadata["name"]
possible_attributes[field.name] = AttributeData(field_type, subfield.name, xsd_name)
return possible_attributes
+10
View File
@@ -0,0 +1,10 @@
import bcf.v2.model
import bcf.v3.model
from typing import Union
BimSnippet = Union[bcf.v2.model.BimSnippet, bcf.v3.model.BimSnippet]
BitMap = Union[bcf.v2.model.VisualizationInfoBitmap, bcf.v3.model.Bitmap]
DocumentReference = Union[bcf.v2.model.TopicDocumentReference, bcf.v3.model.DocumentReference]
HeaderFile = Union[bcf.v2.model.HeaderFile, bcf.v3.model.File]
Topic = Union[bcf.v2.model.Topic, bcf.v3.model.Topic]
ViewPoint = Union[bcf.v2.model.ViewPoint, bcf.v3.model.ViewPoint]
+101
View File
@@ -0,0 +1,101 @@
import tempfile
import bcf.v2.bcfxml
import bcf.v2.model
import bcf.v2.topic
import bcf.v3.bcfxml
import bcf.v3.model
import bcf.v3.topic
import bcf.agnostic.model as mdl
from pathlib import Path
from typing import Union, Optional
from typing_extensions import assert_never
TopicHandler = Union[bcf.v2.topic.TopicHandler, bcf.v3.topic.TopicHandler]
def extract_file(
topic: TopicHandler,
entity: Union[mdl.HeaderFile, mdl.BimSnippet, mdl.DocumentReference, mdl.BitMap],
bcfxml: Optional[Union[bcf.v2.bcfxml.BcfXml, bcf.v3.bcfxml.BcfXml]] = None,
outfile: Optional[Path] = None,
) -> Union[Path, str, None]:
"""Extracts an element with a file into a temporary directory
These include header files, bim snippets, document references, and
viewpoint bitmaps. External reference are not downloaded. Instead, the
URI reference is returned.
:param entity: The entity with a file reference to extract
:param outfile: If provided, save the header file to that location.
Otherwise, a temporary directory is created and the filename is
derived from the header's original filename.
:param bcfxml: The BCF XML file to use for resolving document references files.
Required only for BCF v3 document references (in BCF v3 internal documents
are stored at BCF root, not in the topic).
:return: The filepath of the extracted file. It may be a URL if the
header file is external.
"""
if isinstance(entity, mdl.DocumentReference):
if isinstance(entity, bcf.v2.model.TopicDocumentReference):
reference = entity.referenced_document
else:
reference = entity.document_guid
else:
reference = entity.reference
if not reference:
return None
# For v3 document references external documents are detected by empty document_guid.
# External bitmaps are not supported by bcf.
if not isinstance(entity, (bcf.v3.model.DocumentReference, mdl.BitMap)) and entity.is_external:
return reference
if isinstance(entity, bcf.v3.model.DocumentReference):
# Extract document reference filename and contents.
if not bcfxml:
raise TypeError("bcfxml is required for BCF v3 document references.")
assert isinstance(bcfxml, bcf.v3.bcfxml.BcfXml)
error_msg = f"BCF XML is missing document with guid '{reference}'."
if not bcfxml.documents:
raise Exception(error_msg)
definition_docs = bcfxml.documents.definition.documents
if not definition_docs:
raise Exception(error_msg)
docs = next((doc for doc in definition_docs.document if doc.guid == reference), None)
if not docs:
raise Exception(error_msg)
filename = docs.filename
bytes_data = bcfxml.documents.documents[filename]
else:
if isinstance(entity, mdl.BimSnippet):
bytes_data = topic.bim_snippet
assert isinstance(bytes_data, bytes)
elif isinstance(entity, mdl.HeaderFile):
bytes_data = topic.reference_files[reference]
elif isinstance(entity, mdl.BitMap):
bytes_data = next(
byte_data
for vp in topic.viewpoints.values()
for data_reference, byte_data in vp.bitmaps.items()
if data_reference == reference
)
elif isinstance(entity, bcf.v2.model.TopicDocumentReference):
assert isinstance(topic, bcf.v2.topic.TopicHandler)
bytes_data = topic.document_references[reference]
else:
assert_never(entity)
# We don't really need it if 'outfile' is None, just keeping type checker happy.
if isinstance(entity, mdl.HeaderFile) and entity.filename:
filename = entity.filename
else:
filename = Path(reference).name
if not outfile:
outfile = Path(tempfile.mkdtemp()) / filename
with open(outfile, "wb") as f:
f.write(bytes_data)
return outfile
+5
View File
@@ -0,0 +1,5 @@
import bcf.v2.visinfo
import bcf.v3.visinfo
from typing import Union
VisualizationInfoHandler = Union[bcf.v2.visinfo.VisualizationInfoHandler, bcf.v3.visinfo.VisualizationInfoHandler]
@@ -18,6 +18,7 @@ GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with BCF. If not, see <http://www.gnu.org/licenses/>.
"""
import zipfile
from pathlib import Path
from typing import Optional, Union
@@ -29,9 +30,10 @@ from bcf.v3.model import Version as Version3
from bcf.xml_parser import AbstractXmlParserSerializer, XmlParserSerializer
def load(
filepath: Path, xml_handler: Optional[AbstractXmlParserSerializer] = None
) -> Optional[Union[BcfXml2, BcfXml3]]:
BcfXml = Union[BcfXml2, BcfXml3]
def load(filepath: Path, xml_handler: Optional[AbstractXmlParserSerializer] = None) -> Optional[BcfXml]:
"""
Load a BCF file.
@@ -5,8 +5,8 @@ from numpy.typing import NDArray
def camera_vectors_from_element_placement(
elem_placement: NDArray[np.float_],
) -> tuple[NDArray[np.float_], NDArray[np.float_], NDArray[np.float_]]:
elem_placement: NDArray[np.float64],
) -> tuple[NDArray[np.float64], NDArray[np.float64], NDArray[np.float64]]:
"""
Calculate the vectors of a camera pointing to an element.
@@ -21,8 +21,8 @@ def camera_vectors_from_element_placement(
def camera_vectors_from_target_position(
target_position: NDArray[np.float_], offset: Optional[NDArray[np.float_]] = None
) -> tuple[NDArray[np.float_], NDArray[np.float_], NDArray[np.float_]]:
target_position: NDArray[np.float64], offset: Optional[NDArray[np.float64]] = None
) -> tuple[NDArray[np.float64], NDArray[np.float64], NDArray[np.float64]]:
"""
Calculate the vectors of a camera pointing to a target point.
@@ -50,7 +50,7 @@ def camera_vectors_from_target_position(
# return camera_position, -mat[:3, 2], mat[:3, 1]
def unit_vector(v: NDArray[np.float_]) -> NDArray[np.float_]:
def unit_vector(v: NDArray[np.float64]) -> NDArray[np.float64]:
"""
Return the unit vector of a vector.
@@ -5,6 +5,7 @@ Copyright (c) 2017-2020 Anthon van der Neut, Ruamel bvba
original idea from https://stackoverflow.com/a/19722365/1307905
"""
import zipfile
from io import BytesIO
from os import PathLike
@@ -13,8 +14,7 @@ from typing import Any, Optional, Protocol
class ZipFileInterface(Protocol):
def writestr(self, filename_in_zip: str | zipfile.ZipInfo, file_contents: bytes | str) -> None:
...
def writestr(self, filename_in_zip: str | zipfile.ZipInfo, file_contents: bytes | str) -> None: ...
class InMemoryZipFile:
@@ -1,11 +1,14 @@
"""BCF XML V2 handler."""
import uuid
import warnings
import zipfile
from pathlib import Path
from typing import Any, NoReturn, Optional, TypeVar
import bcf.agnostic.extensions
import bcf.v2.model as mdl
import bcf.v2.model.extensions as mdl_extensions
from bcf.inmemory_zipfile import InMemoryZipFile, ZipFileInterface
from bcf.v2.topic import TopicHandler
from bcf.xml_parser import AbstractXmlParserSerializer, XmlParserSerializer
@@ -23,7 +26,8 @@ class BcfXml:
self._xml_handler = xml_handler or XmlParserSerializer()
self._version: Optional[mdl.Version] = None
self._project_info: Optional[mdl.ProjectExtension] = None
self._topics: dict[str, TopicHandler] = {}
self._extensions: Optional[mdl_extensions.Extensions] = None
self._topics: Optional[dict[str, TopicHandler]] = None
self._extension_schema: Optional[bytes] = None
self._zip_file = self._load_zip_file()
@@ -84,24 +88,63 @@ class BcfXml:
def extension_schema(self, value: bytes) -> None:
self._extension_schema = value
@property
def extensions(self) -> Optional[mdl_extensions.Extensions]:
"""BCF extensions."""
if not self._extensions and self.extension_schema:
import io
from xml.etree import ElementTree as etree
extensions = mdl_extensions.Extensions()
xs = "{http://www.w3.org/2001/XMLSchema}"
root = etree.parse(io.BytesIO((self.extension_schema)))
attrs = bcf.agnostic.extensions.get_extensions_attributes(extensions)
xsd_to_attrs = {v.subattr_xsd_name: k for k, v in attrs.items()}
for node in root.findall(f".//{xs}restriction"):
attr_type = node.attrib.get("base")
if not attr_type:
continue
attr_name = xsd_to_attrs.get(attr_type)
if attr_name is None:
continue
values = []
for enum in node.findall(f".//{xs}enumeration"):
values.append(enum.attrib["value"])
if not values:
continue
attr_data = attrs[attr_name]
attr = attr_data.attr_type()
setattr(attr, attr_data.subattr_name, values)
setattr(extensions, attr_name, attr)
self._extensions = extensions
return self._extensions
@extensions.setter
def extensions(self, value: Optional[mdl_extensions.Extensions]) -> None:
self._extensions = value
@property
def topics(self) -> dict[str, TopicHandler]:
"""BCF topics."""
if not self._topics and self._zip_file:
self._topics = self._load_topics(self._zip_file, self._xml_handler)
if self._topics is None:
self._topics = self._load_topics()
return self._topics
def _load_topics(
self, zip_file: zipfile.ZipFile, xml_handler: AbstractXmlParserSerializer
) -> dict[str, TopicHandler]:
def _load_topics(self) -> dict[str, TopicHandler]:
topics = {}
for topic_dir in zipfile.Path(zip_file).iterdir():
if self._zip_file is None:
return topics
for topic_dir in zipfile.Path(self._zip_file).iterdir():
if not topic_dir.is_dir():
continue
markup_path = topic_dir.joinpath("markup.bcf")
if not markup_path.exists():
continue
topics[topic_dir.name] = TopicHandler(topic_dir, xml_handler)
topics[topic_dir.name] = TopicHandler(topic_dir, self._xml_handler)
return topics
@classmethod
+197
View File
@@ -0,0 +1,197 @@
# NOTE: This file is not generated from
# https://github.com/buildingSMART/BCF-XML/blob/release_2_1/Extension%20Schemas/extensions.xsd
# because in bcf 2.1 there is no extensions.xml - I guess, the schema assumes that each .bcf
# will use their own schema patched by it's own extensions.xsd.
#
# To make things simpler we just mimic extensions structures from bcf 3, so they'll have common API,
# and parse extensions.xsd inside .bcf as .xml and fill our structures.
#
# Preferably if we could generate some kind of extensions.xml from extensions.xsd
# and leave all the handling to xsdata.
#
# We also don't add it to __init__.py not to mess with generator.
#
# Currently extensions support for v2 is only read-only.
from dataclasses import dataclass, field, fields
from typing import List, NamedTuple, Optional
@dataclass(slots=True, kw_only=True)
class ExtensionsPriorities:
class Meta:
global_type = False
priority: List[str] = field(
default_factory=list,
metadata={
"name": "Priority",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
},
)
@dataclass(slots=True, kw_only=True)
class ExtensionsSnippetTypes:
class Meta:
global_type = False
snippet_type: List[str] = field(
default_factory=list,
metadata={
"name": "SnippetType",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
},
)
@dataclass(slots=True, kw_only=True)
class ExtensionsStages:
class Meta:
global_type = False
stage: List[str] = field(
default_factory=list,
metadata={
"name": "Stage",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
},
)
@dataclass(slots=True, kw_only=True)
class ExtensionsTopicLabels:
class Meta:
global_type = False
topic_label: List[str] = field(
default_factory=list,
metadata={
"name": "TopicLabel",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
},
)
@dataclass(slots=True, kw_only=True)
class ExtensionsTopicStatuses:
class Meta:
global_type = False
topic_status: List[str] = field(
default_factory=list,
metadata={
"name": "TopicStatus",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
},
)
@dataclass(slots=True, kw_only=True)
class ExtensionsTopicTypes:
class Meta:
global_type = False
topic_type: List[str] = field(
default_factory=list,
metadata={
"name": "TopicType",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
},
)
@dataclass(slots=True, kw_only=True)
class ExtensionsUsers:
class Meta:
global_type = False
user: List[str] = field(
default_factory=list,
metadata={
"name": "UserIdType",
"type": "Element",
"namespace": "",
"min_length": 1,
"white_space": "collapse",
},
)
@dataclass(slots=True, kw_only=True)
class Extensions:
topic_types: Optional[ExtensionsTopicTypes] = field(
default=None,
metadata={
"name": "TopicTypes",
"type": "Element",
"namespace": "",
},
)
topic_statuses: Optional[ExtensionsTopicStatuses] = field(
default=None,
metadata={
"name": "TopicStatuses",
"type": "Element",
"namespace": "",
},
)
priorities: Optional[ExtensionsPriorities] = field(
default=None,
metadata={
"name": "Priorities",
"type": "Element",
"namespace": "",
},
)
topic_labels: Optional[ExtensionsTopicLabels] = field(
default=None,
metadata={
"name": "TopicLabels",
"type": "Element",
"namespace": "",
},
)
users: Optional[ExtensionsUsers] = field(
default=None,
metadata={
"name": "Users",
"type": "Element",
"namespace": "",
},
)
snippet_types: Optional[ExtensionsSnippetTypes] = field(
default=None,
metadata={
"name": "SnippetTypes",
"type": "Element",
"namespace": "",
},
)
stages: Optional[ExtensionsStages] = field(
default=None,
metadata={
"name": "Stages",
"type": "Element",
"namespace": "",
},
)
@@ -34,7 +34,7 @@ class BimSnippet:
metadata={
"name": "isExternal",
"type": "Attribute",
}
},
)
@@ -64,7 +64,7 @@ class HeaderFile:
"name": "Filename",
"type": "Element",
"namespace": "",
}
},
)
date: Optional[XmlDateTime] = field(
default=None,
@@ -72,7 +72,7 @@ class HeaderFile:
"name": "Date",
"type": "Element",
"namespace": "",
}
},
)
reference: Optional[str] = field(
default=None,
@@ -80,7 +80,7 @@ class HeaderFile:
"name": "Reference",
"type": "Element",
"namespace": "",
}
},
)
ifc_project: Optional[str] = field(
default=None,
@@ -89,7 +89,7 @@ class HeaderFile:
"type": "Attribute",
"length": 22,
"pattern": r"[0-9,A-Z,a-z,_$]*",
}
},
)
ifc_spatial_structure_element: Optional[str] = field(
default=None,
@@ -98,14 +98,14 @@ class HeaderFile:
"type": "Attribute",
"length": 22,
"pattern": r"[0-9,A-Z,a-z,_$]*",
}
},
)
is_external: bool = field(
default=True,
metadata={
"name": "isExternal",
"type": "Attribute",
}
},
)
@@ -120,7 +120,7 @@ class TopicDocumentReference:
"name": "ReferencedDocument",
"type": "Element",
"namespace": "",
}
},
)
description: Optional[str] = field(
default=None,
@@ -128,7 +128,7 @@ class TopicDocumentReference:
"name": "Description",
"type": "Element",
"namespace": "",
}
},
)
guid: Optional[str] = field(
default=None,
@@ -136,14 +136,14 @@ class TopicDocumentReference:
"name": "Guid",
"type": "Attribute",
"pattern": r"[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}",
}
},
)
is_external: bool = field(
default=False,
metadata={
"name": "isExternal",
"type": "Attribute",
}
},
)
@@ -170,7 +170,7 @@ class ViewPoint:
"name": "Viewpoint",
"type": "Element",
"namespace": "",
}
},
)
snapshot: Optional[str] = field(
default=None,
@@ -178,7 +178,7 @@ class ViewPoint:
"name": "Snapshot",
"type": "Element",
"namespace": "",
}
},
)
index: Optional[int] = field(
default=None,
@@ -186,7 +186,7 @@ class ViewPoint:
"name": "Index",
"type": "Element",
"namespace": "",
}
},
)
guid: str = field(
metadata={
@@ -230,7 +230,7 @@ class Comment:
"name": "Viewpoint",
"type": "Element",
"namespace": "",
}
},
)
modified_date: Optional[XmlDateTime] = field(
default=None,
@@ -238,7 +238,7 @@ class Comment:
"name": "ModifiedDate",
"type": "Element",
"namespace": "",
}
},
)
modified_author: Optional[str] = field(
default=None,
@@ -246,7 +246,7 @@ class Comment:
"name": "ModifiedAuthor",
"type": "Element",
"namespace": "",
}
},
)
guid: str = field(
metadata={
@@ -267,7 +267,7 @@ class Header:
"type": "Element",
"namespace": "",
"min_occurs": 1,
}
},
)
@@ -279,7 +279,7 @@ class Topic:
"name": "ReferenceLink",
"type": "Element",
"namespace": "",
}
},
)
title: str = field(
metadata={
@@ -295,7 +295,7 @@ class Topic:
"name": "Priority",
"type": "Element",
"namespace": "",
}
},
)
index: Optional[int] = field(
default=None,
@@ -303,7 +303,7 @@ class Topic:
"name": "Index",
"type": "Element",
"namespace": "",
}
},
)
labels: List[str] = field(
default_factory=list,
@@ -311,7 +311,7 @@ class Topic:
"name": "Labels",
"type": "Element",
"namespace": "",
}
},
)
creation_date: XmlDateTime = field(
metadata={
@@ -335,7 +335,7 @@ class Topic:
"name": "ModifiedDate",
"type": "Element",
"namespace": "",
}
},
)
modified_author: Optional[str] = field(
default=None,
@@ -343,7 +343,7 @@ class Topic:
"name": "ModifiedAuthor",
"type": "Element",
"namespace": "",
}
},
)
due_date: Optional[XmlDateTime] = field(
default=None,
@@ -351,7 +351,7 @@ class Topic:
"name": "DueDate",
"type": "Element",
"namespace": "",
}
},
)
assigned_to: Optional[str] = field(
default=None,
@@ -359,7 +359,7 @@ class Topic:
"name": "AssignedTo",
"type": "Element",
"namespace": "",
}
},
)
stage: Optional[str] = field(
default=None,
@@ -367,7 +367,7 @@ class Topic:
"name": "Stage",
"type": "Element",
"namespace": "",
}
},
)
description: Optional[str] = field(
default=None,
@@ -375,7 +375,7 @@ class Topic:
"name": "Description",
"type": "Element",
"namespace": "",
}
},
)
bim_snippet: Optional[BimSnippet] = field(
default=None,
@@ -383,7 +383,7 @@ class Topic:
"name": "BimSnippet",
"type": "Element",
"namespace": "",
}
},
)
document_reference: List[TopicDocumentReference] = field(
default_factory=list,
@@ -391,7 +391,7 @@ class Topic:
"name": "DocumentReference",
"type": "Element",
"namespace": "",
}
},
)
related_topic: List[TopicRelatedTopic] = field(
default_factory=list,
@@ -399,7 +399,7 @@ class Topic:
"name": "RelatedTopic",
"type": "Element",
"namespace": "",
}
},
)
guid: str = field(
metadata={
@@ -414,14 +414,14 @@ class Topic:
metadata={
"name": "TopicType",
"type": "Attribute",
}
},
)
topic_status: Optional[str] = field(
default=None,
metadata={
"name": "TopicStatus",
"type": "Attribute",
}
},
)
@@ -433,7 +433,7 @@ class Markup:
"name": "Header",
"type": "Element",
"namespace": "",
}
},
)
topic: Topic = field(
metadata={
@@ -449,7 +449,7 @@ class Markup:
"name": "Comment",
"type": "Element",
"namespace": "",
}
},
)
viewpoints: List[ViewPoint] = field(
default_factory=list,
@@ -457,5 +457,5 @@ class Markup:
"name": "Viewpoints",
"type": "Element",
"namespace": "",
}
},
)
@@ -10,7 +10,7 @@ class Project:
"name": "Name",
"type": "Element",
"namespace": "",
}
},
)
project_id: str = field(
metadata={
@@ -29,7 +29,7 @@ class ProjectExtension:
"name": "Project",
"type": "Element",
"namespace": "",
}
},
)
extension_schema: str = field(
metadata={
@@ -10,12 +10,12 @@ class Version:
"name": "DetailedVersion",
"type": "Element",
"namespace": "",
}
},
)
version_id: Optional[str] = field(
default=None,
metadata={
"name": "VersionId",
"type": "Attribute",
}
},
)
@@ -15,14 +15,14 @@ class Component:
metadata={
"name": "OriginatingSystem",
"type": "Element",
}
},
)
authoring_tool_id: Optional[str] = field(
default=None,
metadata={
"name": "AuthoringToolId",
"type": "Element",
}
},
)
ifc_guid: Optional[str] = field(
default=None,
@@ -31,7 +31,7 @@ class Component:
"type": "Attribute",
"length": 22,
"pattern": r"[0-9,A-Z,a-z,_$]*",
}
},
)
@@ -92,21 +92,21 @@ class ViewSetupHints:
metadata={
"name": "SpacesVisible",
"type": "Attribute",
}
},
)
space_boundaries_visible: Optional[bool] = field(
default=None,
metadata={
"name": "SpaceBoundariesVisible",
"type": "Attribute",
}
},
)
openings_visible: Optional[bool] = field(
default=None,
metadata={
"name": "OpeningsVisible",
"type": "Attribute",
}
},
)
@@ -139,7 +139,7 @@ class ComponentColoringColor:
"name": "Component",
"type": "Element",
"min_occurs": 1,
}
},
)
color: Optional[str] = field(
default=None,
@@ -147,7 +147,7 @@ class ComponentColoringColor:
"name": "Color",
"type": "Attribute",
"pattern": r"[0-9,a-f,A-F]{6}([0-9,a-f,A-F]{2})?",
}
},
)
@@ -159,7 +159,7 @@ class ComponentSelection:
"name": "Component",
"type": "Element",
"min_occurs": 1,
}
},
)
@@ -174,7 +174,7 @@ class ComponentVisibilityExceptions:
"name": "Component",
"type": "Element",
"min_occurs": 1,
}
},
)
@@ -205,6 +205,7 @@ class OrthogonalCamera:
camera_up_vector:
view_to_world_scale: view's visible size in meters
"""
camera_view_point: Point = field(
metadata={
"name": "CameraViewPoint",
@@ -247,6 +248,7 @@ class PerspectiveCamera:
release and viewers should be expect values outside this
range in current implementations.
"""
camera_view_point: Point = field(
metadata={
"name": "CameraViewPoint",
@@ -336,7 +338,7 @@ class ComponentColoring:
"name": "Color",
"type": "Element",
"min_occurs": 1,
}
},
)
@@ -347,14 +349,14 @@ class ComponentVisibility:
metadata={
"name": "Exceptions",
"type": "Element",
}
},
)
default_visibility: Optional[bool] = field(
default=None,
metadata={
"name": "DefaultVisibility",
"type": "Attribute",
}
},
)
@@ -368,7 +370,7 @@ class VisualizationInfoClippingPlanes:
metadata={
"name": "ClippingPlane",
"type": "Element",
}
},
)
@@ -383,7 +385,7 @@ class VisualizationInfoLines:
"name": "Line",
"type": "Element",
"min_occurs": 1,
}
},
)
@@ -394,14 +396,14 @@ class Components:
metadata={
"name": "ViewSetupHints",
"type": "Element",
}
},
)
selection: Optional[ComponentSelection] = field(
default=None,
metadata={
"name": "Selection",
"type": "Element",
}
},
)
visibility: ComponentVisibility = field(
metadata={
@@ -415,7 +417,7 @@ class Components:
metadata={
"name": "Coloring",
"type": "Element",
}
},
)
@@ -424,47 +426,48 @@ class VisualizationInfo:
"""
VisualizationInfo documentation.
"""
components: Optional[Components] = field(
default=None,
metadata={
"name": "Components",
"type": "Element",
}
},
)
orthogonal_camera: Optional[OrthogonalCamera] = field(
default=None,
metadata={
"name": "OrthogonalCamera",
"type": "Element",
}
},
)
perspective_camera: Optional[PerspectiveCamera] = field(
default=None,
metadata={
"name": "PerspectiveCamera",
"type": "Element",
}
},
)
lines: Optional[VisualizationInfoLines] = field(
default=None,
metadata={
"name": "Lines",
"type": "Element",
}
},
)
clipping_planes: Optional[VisualizationInfoClippingPlanes] = field(
default=None,
metadata={
"name": "ClippingPlanes",
"type": "Element",
}
},
)
bitmap: List[VisualizationInfoBitmap] = field(
default_factory=list,
metadata={
"name": "Bitmap",
"type": "Element",
}
},
)
guid: str = field(
metadata={
@@ -1,10 +1,11 @@
"""BCF XML V2 Topic handler."""
import datetime
import tempfile
import uuid
import zipfile
from pathlib import Path
from typing import Any, NoReturn, Optional
from typing import Any, NoReturn, Optional, Union
import numpy as np
from ifcopenshell import entity_instance
@@ -26,9 +27,9 @@ class TopicHandler:
xml_handler: Optional[AbstractXmlParserSerializer] = None,
) -> None:
self._markup: Optional[mdl.Markup] = None
self._viewpoints: dict[str, VisualizationInfoHandler] = {}
self._reference_files: dict[str, bytes] = {}
self._document_references: dict[str, bytes] = {}
self._viewpoints: Optional[dict[str, VisualizationInfoHandler]] = None
self._reference_files: Optional[dict[str, bytes]] = None
self._document_references: Optional[dict[str, bytes]] = None
self._bim_snippet: Optional[bytes] = None
self._xml_handler = xml_handler or XmlParserSerializer()
self._topic_dir = topic_dir
@@ -62,11 +63,21 @@ class TopicHandler:
"""Return the header of the topic."""
return self.markup.header if self.markup else None
@header.setter
def header(self, header: mdl.Header) -> None:
"""Set the header of the topic."""
self.markup.header = header
@property
def comments(self) -> list[mdl.Comment]:
"""Return the comments of the topic."""
return self.markup.comment if self.markup else []
@comments.setter
def comments(self, comments: list[mdl.Comment]) -> None:
assert self.markup
self.markup.comment = comments
@property
def bim_snippet(self) -> Optional[bytes]:
if not self._bim_snippet and self._topic_dir:
@@ -79,14 +90,24 @@ class TopicHandler:
@property
def viewpoints(self) -> dict[str, VisualizationInfoHandler]:
if not self._viewpoints and self._topic_dir:
if self._viewpoints is None:
self._viewpoints = self._load_viewpoints()
return self._viewpoints
def _load_viewpoints(self) -> dict[str, VisualizationInfoHandler]:
if self._topic_dir and self.markup and (viewpoints := self.markup.viewpoints):
return VisualizationInfoHandler.from_topic_viewpoints(self._topic_dir, viewpoints)
return {}
@property
def reference_files(self) -> dict[str, bytes]:
if self._reference_files or not self.header:
if self._reference_files is not None:
return self._reference_files
self._reference_files = {}
if not self.header:
return self._reference_files
for ref in self.header.file:
if ref.is_external:
continue
@@ -98,8 +119,13 @@ class TopicHandler:
@property
def document_references(self) -> dict[str, bytes]:
if self._document_references or not self.topic:
if self._document_references is not None:
return self._document_references
self._document_references = {}
if not self.topic:
return self._document_references
for doc in self.topic.document_reference:
if doc.is_external or not doc.referenced_document:
continue
@@ -117,11 +143,6 @@ class TopicHandler:
return bim_snippet_path.read_bytes()
return None
def _load_viewpoints(self) -> dict[str, VisualizationInfoHandler]:
if self.markup and (viewpoints := self.markup.viewpoints):
return VisualizationInfoHandler.from_topic_viewpoints(self._topic_dir, viewpoints)
return {}
@classmethod
def create_new(
cls,
@@ -219,55 +240,7 @@ class TopicHandler:
real_path = real_path.parent if path_part == ".." else real_path.joinpath(path_part)
destination_zip.writestr(real_path.at, self.document_references[doc.referenced_document])
def extract_file(self, entity, outfile: Optional[Path] = None) -> Path:
"""Extracts an element with a file into a temporary directory
These include header files, bim snippets, document references, and
viewpoint bitmaps. External reference are not downloaded. Instead, the
URI reference is returned.
:param entity: The entity with a file reference to extract
:type entity: bcf.v2.model.HeaderFile,bcf.v2.model.BimSnippet,bcf.v2.model.TopicDocumentReference
:param outfile: If provided, save the header file to that location.
Otherwise, a temporary directory is created and the filename is
derived from the header's original filename.
:type outfile: pathlib.Path,optional
:return: The filepath of the extracted file. It may be a URL if the
header file is external.
:rtype: Path
"""
if hasattr(entity, "reference"):
reference = entity.reference
else:
reference = entity.referenced_document
if not reference:
return
if getattr(entity, "is_external", False):
return entity.reference
resolved_reference = self._topic_dir
for part in Path(reference).parts:
if part == "..":
resolved_reference = resolved_reference.parent
else:
resolved_reference = resolved_reference.joinpath(part)
if not outfile:
if getattr(entity, "filename", None):
filename = entity.filename
else:
filename = resolved_reference.name
outfile = Path(tempfile.mkdtemp()) / filename
with open(outfile, "wb") as f:
f.write(resolved_reference.read_bytes())
return outfile
def add_viewpoint(self, element: entity_instance) -> None:
def add_viewpoint(self, element: entity_instance) -> VisualizationInfoHandler:
"""Add a viewpoint pointed at the placement of an IFC element to the topic.
Args:
@@ -277,7 +250,9 @@ class TopicHandler:
self.add_visinfo_handler(new_viewpoint)
return new_viewpoint
def add_viewpoint_from_point_and_guids(self, position: NDArray[np.float_], *guids: str) -> None:
def add_viewpoint_from_point_and_guids(
self, position: NDArray[np.float64], *guids: str
) -> VisualizationInfoHandler:
"""Add a viewpoint pointing at an XYZ point in space
Args:
@@ -290,9 +265,17 @@ class TopicHandler:
self.add_visinfo_handler(vi_handler)
return vi_handler
def add_visinfo_handler(self, new_viewpoint: VisualizationInfoHandler) -> None:
def add_visinfo_handler(
self, new_viewpoint: VisualizationInfoHandler, snapshot_filename: Optional[str] = None
) -> mdl.ViewPoint:
self.viewpoints[new_viewpoint.guid + ".bcfv"] = new_viewpoint
self.markup.viewpoints.append(mdl.ViewPoint(viewpoint=new_viewpoint.guid + ".bcfv", guid=new_viewpoint.guid))
viewpoint = mdl.ViewPoint(
viewpoint=new_viewpoint.guid + ".bcfv",
snapshot=snapshot_filename,
guid=new_viewpoint.guid,
)
self.markup.viewpoints.append(viewpoint)
return viewpoint
def __eq__(self, other: object) -> bool | NoReturn:
return (
@@ -1,7 +1,6 @@
import uuid
import zipfile
from functools import lru_cache
from typing import Any, Iterable, Optional
from typing import Any, Iterable, Optional, Literal, Union
import numpy as np
from ifcopenshell import entity_instance
@@ -134,6 +133,15 @@ class VisualizationInfoHandler:
self._save_bitmaps(bcf_zip, topic_dir)
def _save_snapshot(self, bcf_zip: ZipFileInterface, topic_dir: str, filename: Optional[str]) -> None:
if bool(self.snapshot) ^ bool(filename):
data = ["data (VisualizationInfoHandler.snapshot)", "filename (ViewPoint.snapshot)"]
provided_data, missing_data = data if self.snapshot else data[::-1]
print(
f"WARNING. Snapshot with viewpoint guid '{self.guid}' won't be saved to bcf. "
f"Only snapshot {provided_data} is provided but snapshot {missing_data} is missing."
)
return
if self.snapshot and filename:
bcf_zip.writestr(f"{topic_dir}/{filename}", self.snapshot)
@@ -176,7 +184,7 @@ class VisualizationInfoHandler:
@classmethod
def create_from_point_and_guids(
cls,
position: NDArray[np.float_],
position: NDArray[np.float64],
*guids: str,
xml_handler: Optional[AbstractXmlParserSerializer] = None,
) -> "VisualizationInfoHandler":
@@ -196,13 +204,110 @@ class VisualizationInfoHandler:
visualization_info=build_viewpoint_from_position_and_guids(position, *guids), xml_handler=xml_handler
)
def get_selected_guids(self) -> Union[list[str], None]:
"""
Return viewpoint selected elements IFC guids.
Returns:
If viewpoint has no selection settings, return `None`.
Otherwise return a list of selected elements IFC guids.
"""
visualization_info = self.visualization_info
components = visualization_info.components
if not components:
return None
selection = components.selection
if not selection:
return None
return [guid for c in selection.component if (guid := c.ifc_guid)]
def set_selected_elements(self, elements: list[ifcopenshell.entity_instance]) -> None:
visualization_info = self.visualization_info
guids = [e.GlobalId for e in elements]
components = visualization_info.components
if not components:
visibility = mdl.ComponentVisibility(default_visibility=True)
components = mdl.Components(visibility=visibility)
visualization_info.components = components
selection = components.selection
components_list = [mdl.Component(ifc_guid=guid) for guid in guids]
if not selection:
selection = mdl.ComponentSelection()
components.selection = selection
selection.component = components_list
def set_visible_elements(self, elements: list[ifcopenshell.entity_instance]) -> None:
self.set_visibility(elements, elements_visibility="VISIBLE")
def set_hidden_elements(self, elements: list[ifcopenshell.entity_instance]) -> None:
self.set_visibility(elements, elements_visibility="HIDDEN")
def set_visibility(
self, elements: list[ifcopenshell.entity_instance], elements_visibility: Literal["VISIBLE", "HIDDEN"]
) -> None:
visualization_info = self.visualization_info
default_visibility = elements_visibility == "HIDDEN"
guids = [e.GlobalId for e in elements]
components_list = [mdl.Component(ifc_guid=guid) for guid in guids]
components = visualization_info.components
if not components:
visibility = mdl.ComponentVisibility(default_visibility=default_visibility)
components = mdl.Components(visibility=visibility)
visualization_info.components = components
visibility = components.visibility
if not visibility:
visibility = mdl.ComponentVisibility(default_visibility=default_visibility)
components.visibility = visibility
elif visibility.default_visibility != default_visibility:
visibility.default_visibility = default_visibility
exceptions = visibility.exceptions
if not exceptions:
exceptions = mdl.ComponentVisibilityExceptions()
visibility.exceptions = exceptions
exceptions.component = components_list
def get_elements_visibility(self) -> Union[tuple[bool, list[str]], None]:
"""
Return viewpoint elements visibility settings.
Returns:
If viewpoint has no visibility settings, return `None`.
Otherwise return a tuple containing the default visibility
and a list of IFC element GUIDs listed as exceptions.
If default visibility is `True`, all elements are visible except the exceptions.
If default visibility is `False`, all elements are hidden except the exceptions.
"""
visualization_info = self.visualization_info
components = visualization_info.components
if not components:
return None
visibility = components.visibility
if not visibility:
return None
default_visibility = visibility.default_visibility or False
exceptions = visibility.exceptions
if not exceptions:
return default_visibility, []
guids = [guid for c in exceptions.component if (guid := c.ifc_guid)]
return default_visibility, guids
@lru_cache(maxsize=None)
def build_viewpoint(element: entity_instance) -> mdl.VisualizationInfo:
"""
Return a BCF viewpoint of an IFC element.
This function is cached to speedudp the creation of multiple BCF topics regarding the same element.
This function is cached to speed up the creation of multiple BCF topics regarding the same element.
Args:
element: The IFC element to point at.
@@ -224,11 +329,11 @@ def build_viewpoint(element: entity_instance) -> mdl.VisualizationInfo:
)
def build_viewpoint_from_position_and_guids(position: NDArray[np.float_], *guids: str) -> mdl.VisualizationInfo:
def build_viewpoint_from_position_and_guids(position: NDArray[np.float64], *guids: str) -> mdl.VisualizationInfo:
"""
Return a BCF viewpoint of an IFC element.
This function is cached to speedudp the creation of multiple BCF topics regarding the same element.
This function is cached to speed up the creation of multiple BCF topics regarding the same element.
Args:
position: target point coordinates.
@@ -249,7 +354,7 @@ def build_components(*guids: str) -> mdl.Components:
Return the BCF components from an IFC element GUID.
Args:
*guids: One or more IFC element GUID.
*guids: One or more selected IFC element GUID.
Returns:
The BCF components definition.
@@ -261,7 +366,7 @@ def build_components(*guids: str) -> mdl.Components:
)
def build_camera(elem_placement: NDArray[np.float_]) -> mdl.PerspectiveCamera:
def build_camera(elem_placement: NDArray[np.float64]) -> mdl.PerspectiveCamera:
"""
Return a BCF camera for an IFC element placement matrix.
@@ -275,7 +380,7 @@ def build_camera(elem_placement: NDArray[np.float_]) -> mdl.PerspectiveCamera:
def build_camera_from_vectors(
camera_position: NDArray[np.float_], camera_dir: NDArray[np.float_], camera_up: NDArray[np.float_]
camera_position: NDArray[np.float64], camera_dir: NDArray[np.float64], camera_up: NDArray[np.float64]
) -> mdl.PerspectiveCamera:
"""
Return a BCF camera for an IFC element placement matrix.
@@ -1,4 +1,5 @@
"""BCF XML V3 handlers."""
import uuid
import warnings
import zipfile
@@ -25,7 +26,7 @@ class BcfXml:
self._version: Optional[mdl.Version] = None
self._project_info: Optional[mdl.ProjectInfo] = None
self._extensions: Optional[mdl.Extensions] = None
self._topics: dict[str, TopicHandler] = {}
self._topics: Optional[dict[str, TopicHandler]] = None
self._documents: Optional[DocumentsHandler] = None
self._zip_file = self._load_zip_file()
@@ -90,18 +91,22 @@ class BcfXml:
@property
def topics(self) -> dict[str, TopicHandler]:
"""BCF topics."""
if not self._topics and self._zip_file:
self._load_topics()
if self._topics is None:
self._topics = self._load_topics()
return self._topics
def _load_topics(self) -> None:
def _load_topics(self) -> dict[str, TopicHandler]:
topics = {}
if self._zip_file is None:
return topics
for topic_dir in zipfile.Path(self._zip_file).iterdir():
if not topic_dir.is_dir():
continue
markup_path = topic_dir.joinpath("markup.bcf")
if not markup_path.exists():
continue
self._topics[topic_dir.name] = TopicHandler(topic_dir, self._xml_handler)
topics[topic_dir.name] = TopicHandler(topic_dir, self._xml_handler)
return topics
@property
def documents(self) -> Optional[DocumentsHandler]:
@@ -1,4 +1,5 @@
"""BCF XML V3 Documents handler."""
import zipfile
from typing import Any, Optional
@@ -22,7 +22,7 @@ class Document:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
guid: str = field(
metadata={
@@ -45,7 +45,7 @@ class DocumentInfoDocuments:
"name": "Document",
"type": "Element",
"namespace": "",
}
},
)
@@ -57,5 +57,5 @@ class DocumentInfo:
"name": "Documents",
"type": "Element",
"namespace": "",
}
},
)
@@ -15,7 +15,7 @@ class ExtensionsPriorities:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
@@ -32,7 +32,7 @@ class ExtensionsSnippetTypes:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
@@ -49,7 +49,7 @@ class ExtensionsStages:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
@@ -66,7 +66,7 @@ class ExtensionsTopicLabels:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
@@ -83,7 +83,7 @@ class ExtensionsTopicStatuses:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
@@ -100,7 +100,7 @@ class ExtensionsTopicTypes:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
@@ -117,7 +117,7 @@ class ExtensionsUsers:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
@@ -129,7 +129,7 @@ class Extensions:
"name": "TopicTypes",
"type": "Element",
"namespace": "",
}
},
)
topic_statuses: Optional[ExtensionsTopicStatuses] = field(
default=None,
@@ -137,7 +137,7 @@ class Extensions:
"name": "TopicStatuses",
"type": "Element",
"namespace": "",
}
},
)
priorities: Optional[ExtensionsPriorities] = field(
default=None,
@@ -145,7 +145,7 @@ class Extensions:
"name": "Priorities",
"type": "Element",
"namespace": "",
}
},
)
topic_labels: Optional[ExtensionsTopicLabels] = field(
default=None,
@@ -153,7 +153,7 @@ class Extensions:
"name": "TopicLabels",
"type": "Element",
"namespace": "",
}
},
)
users: Optional[ExtensionsUsers] = field(
default=None,
@@ -161,7 +161,7 @@ class Extensions:
"name": "Users",
"type": "Element",
"namespace": "",
}
},
)
snippet_types: Optional[ExtensionsSnippetTypes] = field(
default=None,
@@ -169,7 +169,7 @@ class Extensions:
"name": "SnippetTypes",
"type": "Element",
"namespace": "",
}
},
)
stages: Optional[ExtensionsStages] = field(
default=None,
@@ -177,5 +177,5 @@ class Extensions:
"name": "Stages",
"type": "Element",
"namespace": "",
}
},
)
@@ -40,7 +40,7 @@ class BimSnippet:
metadata={
"name": "IsExternal",
"type": "Attribute",
}
},
)
@@ -68,7 +68,7 @@ class DocumentReference:
"type": "Element",
"namespace": "",
"pattern": r"[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}",
}
},
)
url: Optional[str] = field(
default=None,
@@ -78,7 +78,7 @@ class DocumentReference:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
description: Optional[str] = field(
default=None,
@@ -88,7 +88,7 @@ class DocumentReference:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
guid: str = field(
metadata={
@@ -110,7 +110,7 @@ class File:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
date: Optional[XmlDateTime] = field(
default=None,
@@ -118,7 +118,7 @@ class File:
"name": "Date",
"type": "Element",
"namespace": "",
}
},
)
reference: Optional[str] = field(
default=None,
@@ -128,7 +128,7 @@ class File:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
ifc_project: Optional[str] = field(
default=None,
@@ -137,7 +137,7 @@ class File:
"type": "Attribute",
"length": 22,
"pattern": r"[0-9A-Za-z_$]*",
}
},
)
ifc_spatial_structure_element: Optional[str] = field(
default=None,
@@ -146,14 +146,14 @@ class File:
"type": "Attribute",
"length": 22,
"pattern": r"[0-9A-Za-z_$]*",
}
},
)
is_external: bool = field(
default=True,
metadata={
"name": "IsExternal",
"type": "Attribute",
}
},
)
@@ -170,7 +170,7 @@ class TopicLabels:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
@@ -187,7 +187,7 @@ class TopicReferenceLinks:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
@@ -216,7 +216,7 @@ class ViewPoint:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
snapshot: Optional[str] = field(
default=None,
@@ -226,7 +226,7 @@ class ViewPoint:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
index: Optional[int] = field(
default=None,
@@ -234,7 +234,7 @@ class ViewPoint:
"name": "Index",
"type": "Element",
"namespace": "",
}
},
)
guid: str = field(
metadata={
@@ -274,7 +274,7 @@ class Comment:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
viewpoint: Optional[CommentViewpoint] = field(
default=None,
@@ -282,7 +282,7 @@ class Comment:
"name": "Viewpoint",
"type": "Element",
"namespace": "",
}
},
)
modified_date: Optional[XmlDateTime] = field(
default=None,
@@ -290,7 +290,7 @@ class Comment:
"name": "ModifiedDate",
"type": "Element",
"namespace": "",
}
},
)
modified_author: Optional[str] = field(
default=None,
@@ -300,7 +300,7 @@ class Comment:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
guid: str = field(
metadata={
@@ -323,7 +323,7 @@ class HeaderFiles:
"name": "File",
"type": "Element",
"namespace": "",
}
},
)
@@ -338,7 +338,7 @@ class TopicDocumentReferences:
"name": "DocumentReference",
"type": "Element",
"namespace": "",
}
},
)
@@ -353,7 +353,7 @@ class TopicRelatedTopics:
"name": "RelatedTopic",
"type": "Element",
"namespace": "",
}
},
)
@@ -368,7 +368,7 @@ class TopicViewpoints:
"name": "ViewPoint",
"type": "Element",
"namespace": "",
}
},
)
@@ -380,7 +380,7 @@ class Header:
"name": "Files",
"type": "Element",
"namespace": "",
}
},
)
@@ -395,7 +395,7 @@ class TopicComments:
"name": "Comment",
"type": "Element",
"namespace": "",
}
},
)
@@ -407,7 +407,7 @@ class Topic:
"name": "ReferenceLinks",
"type": "Element",
"namespace": "",
}
},
)
title: str = field(
metadata={
@@ -427,7 +427,7 @@ class Topic:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
index: Optional[int] = field(
default=None,
@@ -435,7 +435,7 @@ class Topic:
"name": "Index",
"type": "Element",
"namespace": "",
}
},
)
labels: Optional[TopicLabels] = field(
default=None,
@@ -443,7 +443,7 @@ class Topic:
"name": "Labels",
"type": "Element",
"namespace": "",
}
},
)
creation_date: XmlDateTime = field(
metadata={
@@ -469,7 +469,7 @@ class Topic:
"name": "ModifiedDate",
"type": "Element",
"namespace": "",
}
},
)
modified_author: Optional[str] = field(
default=None,
@@ -479,7 +479,7 @@ class Topic:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
due_date: Optional[XmlDateTime] = field(
default=None,
@@ -487,7 +487,7 @@ class Topic:
"name": "DueDate",
"type": "Element",
"namespace": "",
}
},
)
assigned_to: Optional[str] = field(
default=None,
@@ -497,7 +497,7 @@ class Topic:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
stage: Optional[str] = field(
default=None,
@@ -507,7 +507,7 @@ class Topic:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
description: Optional[str] = field(
default=None,
@@ -517,7 +517,7 @@ class Topic:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
bim_snippet: Optional[BimSnippet] = field(
default=None,
@@ -525,7 +525,7 @@ class Topic:
"name": "BimSnippet",
"type": "Element",
"namespace": "",
}
},
)
document_references: Optional[TopicDocumentReferences] = field(
default=None,
@@ -533,7 +533,7 @@ class Topic:
"name": "DocumentReferences",
"type": "Element",
"namespace": "",
}
},
)
related_topics: Optional[TopicRelatedTopics] = field(
default=None,
@@ -541,7 +541,7 @@ class Topic:
"name": "RelatedTopics",
"type": "Element",
"namespace": "",
}
},
)
comments: Optional[TopicComments] = field(
default=None,
@@ -549,7 +549,7 @@ class Topic:
"name": "Comments",
"type": "Element",
"namespace": "",
}
},
)
viewpoints: Optional[TopicViewpoints] = field(
default=None,
@@ -557,7 +557,7 @@ class Topic:
"name": "Viewpoints",
"type": "Element",
"namespace": "",
}
},
)
guid: str = field(
metadata={
@@ -574,7 +574,7 @@ class Topic:
"type": "Attribute",
"min_length": 1,
"white_space": "collapse",
}
},
)
topic_type: str = field(
metadata={
@@ -604,7 +604,7 @@ class Markup:
"name": "Header",
"type": "Element",
"namespace": "",
}
},
)
topic: Topic = field(
metadata={
@@ -12,7 +12,7 @@ class Project:
"namespace": "",
"min_length": 1,
"white_space": "collapse",
}
},
)
project_id: str = field(
metadata={
@@ -17,7 +17,7 @@ class Component:
"type": "Element",
"min_length": 1,
"white_space": "collapse",
}
},
)
authoring_tool_id: Optional[str] = field(
default=None,
@@ -26,7 +26,7 @@ class Component:
"type": "Element",
"min_length": 1,
"white_space": "collapse",
}
},
)
ifc_guid: Optional[str] = field(
default=None,
@@ -35,7 +35,7 @@ class Component:
"type": "Attribute",
"length": 22,
"pattern": r"[0-9A-Za-z_$]*",
}
},
)
@@ -96,21 +96,21 @@ class ViewSetupHints:
metadata={
"name": "SpacesVisible",
"type": "Attribute",
}
},
)
space_boundaries_visible: bool = field(
default=False,
metadata={
"name": "SpaceBoundariesVisible",
"type": "Attribute",
}
},
)
openings_visible: bool = field(
default=False,
metadata={
"name": "OpeningsVisible",
"type": "Attribute",
}
},
)
@@ -191,7 +191,7 @@ class ComponentColoringColorComponents:
"name": "Component",
"type": "Element",
"min_occurs": 1,
}
},
)
@@ -202,7 +202,7 @@ class ComponentSelection:
metadata={
"name": "Component",
"type": "Element",
}
},
)
@@ -216,7 +216,7 @@ class ComponentVisibilityExceptions:
metadata={
"name": "Component",
"type": "Element",
}
},
)
@@ -249,6 +249,7 @@ class OrthogonalCamera:
aspect_ratio: Proportional relationship between the width and
the height of the view (w/h).
"""
camera_view_point: Point = field(
metadata={
"name": "CameraViewPoint",
@@ -302,6 +303,7 @@ class PerspectiveCamera:
aspect_ratio: Proportional relationship between the width and
the height of the view (w/h).
"""
camera_view_point: Point = field(
metadata={
"name": "CameraViewPoint",
@@ -371,21 +373,21 @@ class ComponentVisibility:
metadata={
"name": "ViewSetupHints",
"type": "Element",
}
},
)
exceptions: Optional[ComponentVisibilityExceptions] = field(
default=None,
metadata={
"name": "Exceptions",
"type": "Element",
}
},
)
default_visibility: bool = field(
default=False,
metadata={
"name": "DefaultVisibility",
"type": "Attribute",
}
},
)
@@ -399,7 +401,7 @@ class VisualizationInfoBitmaps:
metadata={
"name": "Bitmap",
"type": "Element",
}
},
)
@@ -413,7 +415,7 @@ class VisualizationInfoClippingPlanes:
metadata={
"name": "ClippingPlane",
"type": "Element",
}
},
)
@@ -427,7 +429,7 @@ class VisualizationInfoLines:
metadata={
"name": "Line",
"type": "Element",
}
},
)
@@ -438,7 +440,7 @@ class ComponentColoring:
metadata={
"name": "Color",
"type": "Element",
}
},
)
@@ -449,21 +451,21 @@ class Components:
metadata={
"name": "Selection",
"type": "Element",
}
},
)
visibility: Optional[ComponentVisibility] = field(
default=None,
metadata={
"name": "Visibility",
"type": "Element",
}
},
)
coloring: Optional[ComponentColoring] = field(
default=None,
metadata={
"name": "Coloring",
"type": "Element",
}
},
)
@@ -472,47 +474,48 @@ class VisualizationInfo:
"""
VisualizationInfo documentation.
"""
components: Optional[Components] = field(
default=None,
metadata={
"name": "Components",
"type": "Element",
}
},
)
orthogonal_camera: Optional[OrthogonalCamera] = field(
default=None,
metadata={
"name": "OrthogonalCamera",
"type": "Element",
}
},
)
perspective_camera: Optional[PerspectiveCamera] = field(
default=None,
metadata={
"name": "PerspectiveCamera",
"type": "Element",
}
},
)
lines: Optional[VisualizationInfoLines] = field(
default=None,
metadata={
"name": "Lines",
"type": "Element",
}
},
)
clipping_planes: Optional[VisualizationInfoClippingPlanes] = field(
default=None,
metadata={
"name": "ClippingPlanes",
"type": "Element",
}
},
)
bitmaps: Optional[VisualizationInfoBitmaps] = field(
default=None,
metadata={
"name": "Bitmaps",
"type": "Element",
}
},
)
guid: str = field(
metadata={
@@ -1,4 +1,5 @@
"""BCF XML V3 Topic handler."""
import datetime
import uuid
import zipfile
@@ -25,7 +26,8 @@ class TopicHandler:
xml_handler: Optional[AbstractXmlParserSerializer] = None,
) -> None:
self._markup: Optional[mdl.Markup] = None
self._viewpoints: dict[str, VisualizationInfoHandler] = {}
self._viewpoints: Optional[dict[str, VisualizationInfoHandler]] = None
self._reference_files: Optional[dict[str, bytes]] = None
self._bim_snippet: Optional[bytes] = None
self._xml_handler = xml_handler or XmlParserSerializer()
self._topic_dir = topic_dir
@@ -48,22 +50,36 @@ class TopicHandler:
return self.markup.topic
@property
def guid(self) -> Optional[str]:
def guid(self) -> str:
"""Return the GUID of the topic."""
if self._markup:
return self.topic.guid
return self._topic_dir.name if self._topic_dir else None
return self._topic_dir.name if self._topic_dir else ""
@property
def header(self) -> Optional[mdl.Header]:
"""Return the header of the topic."""
return self.markup.header
@header.setter
def header(self, header: mdl.Header) -> None:
"""Set the header of the topic."""
self.markup.header = header
@property
def comments(self) -> list[mdl.Comment]:
"""Return the comments of the topic."""
return self.topic.comments.comment if self.topic.comments else []
@comments.setter
def comments(self, comments: list[mdl.Comment]) -> None:
topic_comments = self.topic.comments
if topic_comments is None:
if not comments:
return
self.topic.comments = (topic_comments := mdl.TopicComments())
topic_comments.comment = comments
@property
def bim_snippet(self) -> Optional[bytes]:
if not self._bim_snippet and self._topic_dir:
@@ -76,15 +92,15 @@ class TopicHandler:
@property
def viewpoints(self) -> dict[str, "VisualizationInfoHandler"]:
if (
not self._viewpoints
and self._topic_dir
and self.topic.viewpoints
and (viewpoints := self.topic.viewpoints.view_point)
):
self._viewpoints = VisualizationInfoHandler.from_topic_viewpoints(self._topic_dir, viewpoints)
if self._viewpoints is None:
self._viewpoints = self._load_viewpoints()
return self._viewpoints
def _load_viewpoints(self) -> dict[str, "VisualizationInfoHandler"]:
if self._topic_dir and self.topic.viewpoints and (viewpoints := self.topic.viewpoints.view_point):
return VisualizationInfoHandler.from_topic_viewpoints(self._topic_dir, viewpoints)
return {}
def _load_bim_snippet(self) -> Optional[bytes]:
bim_snippet_obj = self.topic.bim_snippet
if bim_snippet_obj and not bim_snippet_obj.is_external and self._topic_dir:
@@ -93,6 +109,27 @@ class TopicHandler:
return bim_snippet_path.read_bytes()
return None
@property
def reference_files(self) -> dict[str, bytes]:
if self._reference_files is not None:
return self._reference_files
self._reference_files = {}
if not self.header:
return self._reference_files
if not self.header.files:
return self._reference_files
for ref in self.header.files.file:
if ref.is_external:
continue
real_path = self._topic_dir
for path_part in ref.reference.split("/"):
real_path = real_path.parent if path_part == ".." else real_path.joinpath(path_part)
self._reference_files[ref.reference] = real_path.read_bytes()
return self._reference_files
@classmethod
def create_new(
cls,
@@ -144,6 +181,7 @@ class TopicHandler:
self._save_xml(destination_zip, self._markup, "markup.bcf")
self._save_viewpoints(destination_zip, topic_dir)
self._save_bim_snippet(destination_zip)
self._save_reference_files(destination_zip)
def _save_viewpoints(self, destination_zip: ZipFileInterface, topic_dir: str) -> None:
if not self.topic.viewpoints or not (viewpoints := self.topic.viewpoints.view_point):
@@ -164,7 +202,20 @@ class TopicHandler:
if self.bim_snippet:
destination_zip.writestr(f"{self.topic.guid}/{ref_filename}", self.bim_snippet)
def add_viewpoint(self, element: entity_instance) -> None:
def _save_reference_files(self, destination_zip: ZipFileInterface) -> None:
if not self.header:
return
if not self.header.files:
return
for ref in self.header.files.file:
if ref.is_external or not ref.reference:
continue
real_path = self._topic_dir
for path_part in ref.reference.split("/"):
real_path = real_path.parent if path_part == ".." else real_path.joinpath(path_part)
destination_zip.writestr(real_path.at, self.reference_files[ref.reference])
def add_viewpoint(self, element: entity_instance) -> VisualizationInfoHandler:
"""
Add a viewpoint tergeting an IFC element to the topic.
@@ -173,8 +224,11 @@ class TopicHandler:
"""
new_viewpoint = VisualizationInfoHandler.create_new(element, self._xml_handler)
self.add_visinfo_handler(new_viewpoint)
return new_viewpoint
def add_viewpoint_from_point_and_guids(self, position: NDArray[np.float_], *guids: str) -> None:
def add_viewpoint_from_point_and_guids(
self, position: NDArray[np.float64], *guids: str
) -> VisualizationInfoHandler:
"""
Add a viewpoint tergeting an IFC element to the topic.
@@ -185,14 +239,21 @@ class TopicHandler:
position, *guids, xml_handler=self._xml_handler
)
self.add_visinfo_handler(vi_handler)
return vi_handler
def add_visinfo_handler(self, new_viewpoint: VisualizationInfoHandler) -> None:
def add_visinfo_handler(
self, new_viewpoint: VisualizationInfoHandler, snapshot_filename: Optional[str] = None
) -> mdl.ViewPoint:
self.viewpoints[new_viewpoint.guid + ".bcfv"] = new_viewpoint
if self.topic.viewpoints is None:
self.topic.viewpoints = mdl.TopicViewpoints()
self.topic.viewpoints.view_point.append(
mdl.ViewPoint(viewpoint=new_viewpoint.guid + ".bcfv", guid=new_viewpoint.guid)
viewpoint = mdl.ViewPoint(
viewpoint=new_viewpoint.guid + ".bcfv",
snapshot=snapshot_filename,
guid=new_viewpoint.guid,
)
self.topic.viewpoints.view_point.append(viewpoint)
return viewpoint
def __eq__(self, other: object) -> bool | NoReturn:
return (
@@ -1,11 +1,11 @@
import uuid
import zipfile
from functools import lru_cache
from typing import Any, Iterable, Optional
from typing import Any, Iterable, Optional, Literal, Union
import numpy as np
from ifcopenshell import entity_instance
from ifcopenshell.util import placement
import ifcopenshell.util.unit
import ifcopenshell.util.placement
from numpy.typing import NDArray
import bcf.v3.model as mdl
@@ -133,6 +133,15 @@ class VisualizationInfoHandler:
self._save_bitmaps(bcf_zip, topic_dir)
def _save_snapshot(self, bcf_zip: ZipFileInterface, topic_dir: str, filename: Optional[str]) -> None:
if bool(self.snapshot) ^ bool(filename):
data = ["data (VisualizationInfoHandler.snapshot)", "filename (ViewPoint.snapshot)"]
provided_data, missing_data = data if self.snapshot else data[::-1]
print(
f"WARNING. Snapshot with viewpoint guid '{self.guid}' won't be saved to bcf. "
f"Only snapshot {provided_data} is provided but snapshot {missing_data} is missing."
)
return
if self.snapshot and filename:
bcf_zip.writestr(f"{topic_dir}/{filename}", self.snapshot)
@@ -175,7 +184,7 @@ class VisualizationInfoHandler:
@classmethod
def create_from_point_and_guids(
cls,
position: NDArray[np.float_],
position: NDArray[np.float64],
*guids: str,
xml_handler: Optional[AbstractXmlParserSerializer] = None,
) -> "VisualizationInfoHandler":
@@ -195,13 +204,110 @@ class VisualizationInfoHandler:
visualization_info=build_viewpoint_from_position_and_guids(position, *guids), xml_handler=xml_handler
)
def get_selected_guids(self) -> Union[list[str], None]:
"""
Return viewpoint selected elements IFC guids.
Returns:
If viewpoint has no selection settings, return `None`.
Otherwise return a list of selected elements IFC guids.
"""
visualization_info = self.visualization_info
components = visualization_info.components
if not components:
return None
selection = components.selection
if not selection:
return None
return [guid for c in selection.component if (guid := c.ifc_guid)]
def set_selected_elements(self, elements: list[ifcopenshell.entity_instance]) -> None:
visualization_info = self.visualization_info
guids = [e.GlobalId for e in elements]
components = visualization_info.components
if not components:
visibility = mdl.ComponentVisibility(default_visibility=True)
components = mdl.Components(visibility=visibility)
visualization_info.components = components
selection = components.selection
components_list = [mdl.Component(ifc_guid=guid) for guid in guids]
if not selection:
selection = mdl.ComponentSelection()
components.selection = selection
selection.component = components_list
def set_visible_elements(self, elements: list[ifcopenshell.entity_instance]) -> None:
self.set_visibility(elements, elements_visibility="VISIBLE")
def set_hidden_elements(self, elements: list[ifcopenshell.entity_instance]) -> None:
self.set_visibility(elements, elements_visibility="HIDDEN")
def set_visibility(
self, elements: list[ifcopenshell.entity_instance], elements_visibility: Literal["VISIBLE", "HIDDEN"]
) -> None:
visualization_info = self.visualization_info
default_visibility = elements_visibility == "HIDDEN"
guids = [e.GlobalId for e in elements]
components_list = [mdl.Component(ifc_guid=guid) for guid in guids]
components = visualization_info.components
if not components:
visibility = mdl.ComponentVisibility(default_visibility=default_visibility)
components = mdl.Components(visibility=visibility)
visualization_info.components = components
visibility = components.visibility
if not visibility:
visibility = mdl.ComponentVisibility(default_visibility=default_visibility)
components.visibility = visibility
elif visibility.default_visibility != default_visibility:
visibility.default_visibility = default_visibility
exceptions = visibility.exceptions
if not exceptions:
exceptions = mdl.ComponentVisibilityExceptions()
visibility.exceptions = exceptions
exceptions.component = components_list
def get_elements_visibility(self) -> Union[tuple[bool, list[str]], None]:
"""
Return viewpoint elements visibility settings.
Returns:
If viewpoint has no visibility settings, return `None`.
Otherwise return a tuple containing the default visibility
and a list of IFC element GUIDs listed as exceptions.
If default visibility is `True`, all elements are visible except the exceptions.
If default visibility is `False`, all elements are hidden except the exceptions.
"""
visualization_info = self.visualization_info
components = visualization_info.components
if not components:
return None
visibility = components.visibility
if not visibility:
return None
default_visibility = visibility.default_visibility or False
exceptions = visibility.exceptions
if not exceptions:
return default_visibility, []
guids = [guid for c in exceptions.component if (guid := c.ifc_guid)]
return default_visibility, guids
@lru_cache(maxsize=None)
def build_viewpoint(element: entity_instance) -> mdl.VisualizationInfo:
"""
Return a BCF viewpoint of an IFC element.
This function is cached to speedudp the creation of multiple BCF topics regarding the same element.
This function is cached to speed up the creation of multiple BCF topics regarding the same element.
Args:
element: The IFC element to point at.
@@ -209,7 +315,12 @@ def build_viewpoint(element: entity_instance) -> mdl.VisualizationInfo:
Returns:
The BCF viewpoint definition.
"""
elem_placement = placement.get_local_placement(element.ObjectPlacement)
ifc_file = element.wrapped_data.file
unit_scale = ifcopenshell.util.unit.calculate_unit_scale(ifc_file)
elem_placement = ifcopenshell.util.placement.get_local_placement(element.ObjectPlacement)
elem_placement[0][3] *= unit_scale
elem_placement[1][3] *= unit_scale
elem_placement[2][3] *= unit_scale
return mdl.VisualizationInfo(
guid=str(uuid.uuid4()),
@@ -218,11 +329,11 @@ def build_viewpoint(element: entity_instance) -> mdl.VisualizationInfo:
)
def build_viewpoint_from_position_and_guids(position: NDArray[np.float_], *guids: str) -> mdl.VisualizationInfo:
def build_viewpoint_from_position_and_guids(position: NDArray[np.float64], *guids: str) -> mdl.VisualizationInfo:
"""
Return a BCF viewpoint of an IFC element.
This function is cached to speedudp the creation of multiple BCF topics regarding the same element.
This function is cached to speed up the creation of multiple BCF topics regarding the same element.
Args:
position: target point coordinates.
@@ -243,7 +354,7 @@ def build_components(*guids: str) -> mdl.Components:
Return the BCF components from an IFC element GUID.
Args:
*guids: One or more IFC element GUID.
*guids: One or more selected IFC element GUID.
Returns:
The BCF components definition.
@@ -255,7 +366,7 @@ def build_components(*guids: str) -> mdl.Components:
)
def build_camera(elem_placement: NDArray[np.float_]) -> mdl.PerspectiveCamera:
def build_camera(elem_placement: NDArray[np.float64]) -> mdl.PerspectiveCamera:
"""
Return a BCF camera for an IFC element placement matrix.
@@ -269,7 +380,7 @@ def build_camera(elem_placement: NDArray[np.float_]) -> mdl.PerspectiveCamera:
def build_camera_from_vectors(
camera_position: NDArray[np.float_], camera_dir: NDArray[np.float_], camera_up: NDArray[np.float_]
camera_position: NDArray[np.float64], camera_dir: NDArray[np.float64], camera_up: NDArray[np.float64]
) -> mdl.PerspectiveCamera:
"""
Return a BCF camera for an IFC element placement matrix.

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