Commit Graph

7787 Commits

Author SHA1 Message Date
Dion Moult dff33632ae See #2881. Allow indices in the selector instead of relying on external evaluations. 2024-04-15 09:25:49 +02:00
Dion Moult e76487ca90 See #2916. Minor fix. 2024-04-15 09:25:49 +02:00
Andrej730 a2df9dcadd Revert "Fixed ifc validation errors for generated openings #2925"
This reverts commit 66a53b486a.
2024-04-15 09:25:49 +02:00
Gorgious56 1503a13f6c Interface now displays a hint when trying to edit a non-mesh-like object
& Fix case where the active object would go into edit mode even if not mesh-like when multiple objects were selected
2024-04-15 09:25:49 +02:00
Andrej730 7842877ba0 Fixed ifc validation errors for generated openings #2925 2024-04-15 09:25:49 +02:00
Andrej730 be75ef2596 Fixed ifc validation errors for furniture library #2925
Fixed bunch of validation errors with furniture library:

- IfcSpaceType PredefinedType wasn't optional
`<attribute PredefinedType: <enumeration IfcSpaceTypeEnum: (EXTERNAL, GFA, INTERNAL, NOTDEFINED, PARKING, SPACE, USERDEFINED)>> Not optional`

- some object had 0.0 depth extrusion
```
Rule IfcPositiveLengthMeasure_WR1:
    (self > 0.)
Violated by:
    (0.0 > 0.0)
```

- some orphan representations violating:
```
Rule IfcShapeModel_WR11:
    ((sizeof(self.OfProductRepresentation) == 1) ^ (sizeof(self.RepresentationMap) == 1) ^ (sizeof(ofshapeaspect) == 1))
Violated by:
    ((0 == 1 ^ 0 == 1) ^ 0 == 1)
     +  where 0 = sizeof(())
     +    where () = #9091=IfcShapeRepresentation(#15,'Body','SweptSolid',(#9090)).OfProductRepresentation
     +  and   0 = sizeof(())
     +    where () = #9091=IfcShapeRepresentation(#15,'Body','SweptSolid',(#9090)).RepresentationMap
     +  and   0 = sizeof(())
```
2024-04-15 09:25:48 +02:00
Andrej730 ec882a1a7d Fixed validation error for ELEVATION_VIEW curves #2925
Error occured because ShapeBuilder was assigning "Curve2D" representation type for elevation view curves when the correct type is "Curve3D".

It use to occur for both doors and windows created with ifc modifier.

```
Validation error text:
2023-04-03:18:21:28,879 ERROR   [rule_executor.py:154] On instance:
    #135=IfcShapeRepresentation(#21,'Profile','Curve2D',(#134))
Rule IfcShapeRepresentation_CorrectItemsForType:
    (IfcShapeRepresentationTypes(self.RepresentationType,self.Items))
Violated by:
    False
     +  where False = IfcShapeRepresentationTypes('Curve2D', (#134=IfcIndexedPolyCurve(#133,(IfcLineIndex((1,2)),IfcLineIndex((2,3)),IfcLineIndex((3,4)),IfcLineIndex((4,1))),$),))
     +    where 'Curve2D' = #135=IfcShapeRepresentation(#21,'Profile','Curve2D',(#134)).RepresentationType
     +    and   (#134=IfcIndexedPolyCurve(#133,(IfcLineIndex((1,2)),IfcLineIndex((2,3)),IfcLineIndex((3,4)),IfcLineIndex((4,1))),$),) = #135=IfcShapeRepresentation(#21,'Profile','Curve2D',(#134)).Items
```
2024-04-15 09:25:48 +02:00
Andrej730 75d3da9908 Fixed all unit.add_si_unit uses after fd87747
Now they were causing `TypeError: Usecase.__init__() got an unexpected keyword argument 'name'`
2024-04-15 09:25:48 +02:00
Andrej730 3095521e36 Fixed some validation errors for doors and windows #2925
Fixed the ones caused by using 3d curves as inner/outer curves in profiles.
2024-04-15 09:25:48 +02:00
Andrej730 4dcb9116e0 Fixed issue with tool.Blender.apply_bmesh 2024-04-15 09:25:48 +02:00
Dion Moult b18503d1e6 FixRevitTINs patch recipe now also purges non up-facing polygons as Revit doesn't handle them very well. 2024-04-15 09:25:48 +02:00
Dion Moult dd5e069729 Fix #2930. Do not require entity applicability in IfcTester. 2024-04-15 09:25:48 +02:00
Dion Moult 79479901f6 Fix #2910. Bug where style colours were not synced prior to duplication. 2024-04-15 09:25:48 +02:00
Chun 4bdf5475a9 a simplifier workflow and a more consistent coding style 2024-04-15 09:25:48 +02:00
Chun ab17b85854 Unify variable 2024-04-15 09:25:48 +02:00
Chun f859f11add Update functions of get_connected_to and get_connected_from compatible with IFC4 and IFC2X3 2024-04-15 09:25:48 +02:00
Chun 765b4a73d3 Add IFC4 support for functions get_connected_to and get_connected_from in util.system 2024-04-15 09:25:48 +02:00
Chun 9d70b9303b Add IFC4 support to get_connected_to and get_connected_from functions 2024-04-15 09:25:48 +02:00
Dion Moult a92c0d59d0 Fix #2928. 2024-04-15 09:25:48 +02:00
Dion Moult 4bd9515bf5 Fix #2924. IfcElements default to a null predefined type so they can inherit where possible. 2024-04-15 09:25:48 +02:00
Dion Moult 109df898e6 Fix #2926. Connections removed when rotating 90 deg to prevent unintuitive behaviour. Layer2 are also now recalculated. 2024-04-15 09:25:48 +02:00
Dion Moult e6468f280e Link to IfcArchitect tutorial series for quickstart video tutorials 2024-04-15 09:25:48 +02:00
Dion Moult ea5069a991 See #2881. Add support for evaluated commands in smart text literals 2024-04-15 09:25:48 +02:00
Dion Moult 40fb960101 Fix #2927. Continuing to make mesh editing stricter. 2024-04-15 09:25:48 +02:00
Dion Moult 65d2e51742 Shortlist which IFC geometries may be treated as a meshlike object. 2024-04-15 09:25:48 +02:00
Dion Moult 4b8152776d Minor fix 2024-04-15 09:25:48 +02:00
Massimo Fabbro 3f2adc1e13 fix qto ui bug where objects with no assigned base qto doesn't allow to show the qto panel 2024-04-15 09:25:48 +02:00
Dion Moult 86ed354a05 Fix #2922. You can now edit extrusion profiles of swept solids. 2024-04-15 09:25:48 +02:00
Dion Moult 2f3c5a7c75 Disable edit mode on non mesh-like representations as well to prevent risk of invalid geometry. 2024-04-15 09:25:48 +02:00
Dion Moult 6b4955344d Fix bug where generated openings invalidly used 3 dimensions instead of 2 2024-04-15 09:25:48 +02:00
Andrej730 e0f1ec3317 Fixed bug in tool.Blender.get_bmesh_for_mesh
It caused errors because it was expecting mesh object to be selected - when it's not necessary that active_object is the one that mesh belongs to and sometimes no objects can be selected at all.
2024-04-15 09:25:48 +02:00
Andrej730 31e5090a5d Fixed error with switching from EDIT mode for annotation meshes
Error occured when you were editing annotation mesh and tried to switched from EDIT mode

Error: Python: Traceback (most recent call last):
  File "\blenderbim\bim\module\geometry\operator.py", line 838, in invoke
    elif element.HasOpenings:
  File "\blenderbim\libs\site\packages\ifcopenshell\entity_instance.py", line 153, in __getattr__
    raise AttributeError(
AttributeError: entity instance of type 'IFC4.IfcAnnotation' has no attribute 'HasOpenings'
2024-04-15 09:25:48 +02:00
Andrej730 45536111b7 Revert part of 3a3d96be0 #2897
Reverted part of the bgl to gpu transition (to not scare away people with annotations without antialiasing🙂) until I work out the complete solution.
2024-04-15 09:25:48 +02:00
Andrej730 95848561c1 Fixed another typo related to #2889... 2024-04-15 09:25:48 +02:00
Andrej730 6ec4fc7914 Fixed crash in Blender 3.5 on creating fill area annotation
Crash was caused by some change in Blender Python API in 3.5.
The code below resulted in `ValueError: bpy_struct: item.attr = val: MeshPolygon.vertices: array length cannot be changed to 4 (expected 0)`

```
obj.data.polygons.add(1)
p1 = obj.data.polygons[-1]
p1.vertices = (v1.index, v2.index, v3.index, v4.index)
```
2024-04-15 09:25:48 +02:00
Andrej730 65055a9dd0 bgl to gpu: profiles and openings decorations #2897
Still need to fix shaders.py and decoration.py
2024-04-15 09:25:48 +02:00
Andrej730 db55cfc4ee Added description to some annotation operators 2024-04-15 09:25:48 +02:00
Andrej730 d4a8de95c5 Automatically adjusted STAIR_ARROWs now stop at the top thread
Previously they were ending at the end of the stair object and problem was that the end of the object could be at the slab underneath the stair.

Example - https://i.imgur.com/Y43v0GM.png
Before - https://i.imgur.com/Ze9DoK2.png
2024-04-15 09:25:48 +02:00
Andrej730 c807ea26e6 STAIR_ARROW annotations attached to IfcStairFlight object now readjusted after changes in IFC Stair modifier
Later probably will also need some other way to readjust annotations - so they can be readjusted for custom stairs, not created with modifier.
2024-04-15 09:25:48 +02:00
Andrej730 1ff6f691ac Clever STAIR_ARROW annotation
Now adding STAIR_ARROW annotation is a bit more clever - if you have IfcStairFlight selected when adding this type of annotation it will automatically:
1) define stair as it's parent;
2) add the stair as it's product;
3) place itself along the stair (it's assumed that stair direction is X+)

Example - https://i.imgur.com/Ze9DoK2.png
2024-04-15 09:25:47 +02:00
Andrej730 01a62bacd2 Fixed bug causing errors in IFC4X3 projects
It was causing an error below on opening BIM Tool and probably in some other places.

```
Traceback (most recent call last):
  File "C:\software\Steam\steamapps\common\Blender\3.5\scripts\startup\bl_ui\space_view3d.py", line 35, in draw
    self.draw_tool_settings(context)
  File "C:\software\Steam\steamapps\common\Blender\3.5\scripts\startup\bl_ui\space_view3d.py", line 48, in draw_tool_settings
    tool = ToolSelectPanelHelper.draw_active_tool_header(
  File "C:\software\Steam\steamapps\common\Blender\3.5\scripts\startup\bl_ui\space_toolsystem_common.py", line 809, in draw_active_tool_header
    draw_settings(context, layout, tool)
  File "\Blender\3.5\scripts\addons\blenderbim\bim\module\model\workspace.py", line 67, in draw_settings
    BimToolUI.draw(context, layout)
  File "\Blender\3.5\scripts\addons\blenderbim\bim\module\model\workspace.py", line 89, in draw
    AuthoringData.load()
  File "\Blender\3.5\scripts\addons\blenderbim\bim\module\model\data.py", line 52, in load
    cls.load_ifc_classes()
  File "\Blender\3.5\scripts\addons\blenderbim\bim\module\model\data.py", line 109, in load_ifc_classes
    cls.data["ifc_classes"] = cls.ifc_classes()
  File "\Blender\3.5\scripts\addons\blenderbim\bim\module\model\data.py", line 196, in ifc_classes
    + tool.Ifc.get().by_type("IfcDoorStyle")
  File "\Blender\3.5\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\file.py", line 364, in by_type
    return [entity_instance(e, self) for e in self.wrapped_data.by_type(type)]
  File "\Blender\3.5\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\ifcopenshell_wrapper.py", line 4499, in by_type
    return _ifcopenshell_wrapper.file_by_type(self, *args)
RuntimeError: Entity with name 'IfcDoorStyle' not found in schema 'IFC4X3'
Traceback (most recent call last):
  File "C:\software\Steam\steamapps\common\Blender\3.5\scripts\startup\bl_ui\space_view3d.py", line 35, in draw
    self.draw_tool_settings(context)
  File "C:\software\Steam\steamapps\common\Blender\3.5\scripts\startup\bl_ui\space_view3d.py", line 48, in draw_tool_settings
    tool = ToolSelectPanelHelper.draw_active_tool_header(
  File "C:\software\Steam\steamapps\common\Blender\3.5\scripts\startup\bl_ui\space_toolsystem_common.py", line 809, in draw_active_tool_header
    draw_settings(context, layout, tool)
  File "\Blender\3.5\scripts\addons\blenderbim\bim\module\model\workspace.py", line 67, in draw_settings
    BimToolUI.draw(context, layout)
  File "\Blender\3.5\scripts\addons\blenderbim\bim\module\model\workspace.py", line 92, in draw
    cls.draw_header_interface()
  File "\Blender\3.5\scripts\addons\blenderbim\bim\module\model\workspace.py", line 351, in draw_header_interface
    cls.draw_type_selection_interface()
  File "\Blender\3.5\scripts\addons\blenderbim\bim\module\model\workspace.py", line 367, in draw_type_selection_interface
    if AuthoringData.data["ifc_classes"]:
KeyError: 'ifc_classes'
```
2024-04-15 09:25:47 +02:00
Andrej730 e5427583ad Fixed typo in ifcopenshell.util.type 2024-04-15 09:25:47 +02:00
Andrej730 3429972067 Added arrow to 2d repr of sliding doors (#2919)
Example - https://i.imgur.com/eJnhDXU.png
2024-04-15 09:25:47 +02:00
Dion Moult 4e1dca6934 Load all type products by default (in preparation for IfcAnnotationType support) 2024-04-15 09:25:47 +02:00
Andrej730 7f1bb71c66 IFC Door Modifier - sliding doors
Added support for sliding doors in IFC Door Modifier.

The main differences are 2d representation (https://i.imgur.com/VyEH569.png) and the door panel being placed before the lining, not after
2024-04-15 09:25:22 +02:00
Thomas Krijnen 969b7382b6 Replace unpacking with boost::tie() for compatibility with msvc17 build machine 2024-04-15 08:55:37 +02:00
Thomas Krijnen 44deaedccc Incorporate profile in FixedRefSolid, some attempt at DirectrixDerived 2024-04-12 10:24:24 +02:00
Thomas Krijnen 7b296629d6 Doing a transpose was most likely misguided 2024-04-12 10:23:27 +02:00
Richard Brice 420eed1828 Adds new simplified alignment example that makes us of the alignment helper functions 2024-04-11 11:26:42 -07:00
Richard Brice e30fd6096a Adds framework for alignment helper functions.
Function include building a simple highway alignment and mapping of sementic segment definitions to geometric definitions (this part is still a work in progress)
2024-04-11 11:26:42 -07:00