New support for specifying collection modes. Spatial elements now support 2D representations as well.

This commit is contained in:
Dion Moult
2021-09-21 10:14:07 +10:00
parent 090aae5ff6
commit f83d13b97c
4 changed files with 323 additions and 180 deletions
@@ -216,6 +216,61 @@ class TestLoadProjectElements(test.bim.bootstrap.NewFile):
And the object "IfcWall/Wall" does not exist
"""
@test.bim.bootstrap.scenario
def test_loading_with_the_decomposition_collection_mode(self):
return """
Given I press "bim.load_project(filepath='{cwd}/test/files/decomposition.ifc', is_advanced=True)"
When I set "scene.BIMProjectProperties.collection_mode" to "DECOMPOSITION"
And I set "scene.BIMProjectProperties.filter_mode" to "NONE"
And I press "bim.load_project_elements"
Then the object "IfcProject/My Project" is an "IfcProject"
And the object "IfcSite/My Site" is an "IfcSite"
And the object "IfcBuilding/My Building" is an "IfcBuilding"
And the object "IfcBuildingStorey/My Storey" is an "IfcBuildingStorey"
And the object "IfcSpace/Space" is an "IfcSpace"
And the object "IfcElementAssembly/Assembly" is an "IfcElementAssembly"
And the object "IfcBeam/Beam" is an "IfcBeam"
And the object "IfcSite/My Site" is in the collection "IfcSite/My Site"
And the object "IfcBuilding/My Building" is in the collection "IfcBuilding/My Building"
And the object "IfcBuildingStorey/My Storey" is in the collection "IfcBuildingStorey/My Storey"
And the object "IfcSpace/Space" is in the collection "IfcSpace/Space"
And the object "IfcElementAssembly/Assembly" is in the collection "IfcElementAssembly/Assembly"
And the object "IfcBeam/Beam" is in the collection "IfcElementAssembly/Assembly"
And the collection "IfcSite/My Site" is in the collection "IfcProject/My Project"
And the collection "IfcBuilding/My Building" is in the collection "IfcSite/My Site"
And the collection "IfcBuildingStorey/My Storey" is in the collection "IfcBuilding/My Building"
And the collection "IfcSpace/Space" is in the collection "IfcBuildingStorey/My Storey"
And the collection "IfcElementAssembly/Assembly" is in the collection "IfcSpace/Space"
And "scene.BIMProjectProperties.is_loading" is "False"
"""
@test.bim.bootstrap.scenario
def test_loading_with_the_spatial_decomposition_collection_mode(self):
return """
Given I press "bim.load_project(filepath='{cwd}/test/files/decomposition.ifc', is_advanced=True)"
When I set "scene.BIMProjectProperties.collection_mode" to "SPATIAL_DECOMPOSITION"
And I set "scene.BIMProjectProperties.filter_mode" to "NONE"
And I press "bim.load_project_elements"
Then the object "IfcProject/My Project" is an "IfcProject"
And the object "IfcSite/My Site" is an "IfcSite"
And the object "IfcBuilding/My Building" is an "IfcBuilding"
And the object "IfcBuildingStorey/My Storey" is an "IfcBuildingStorey"
And the object "IfcSpace/Space" is an "IfcSpace"
And the object "IfcElementAssembly/Assembly" is an "IfcElementAssembly"
And the object "IfcBeam/Beam" is an "IfcBeam"
And the object "IfcSite/My Site" is in the collection "IfcSite/My Site"
And the object "IfcBuilding/My Building" is in the collection "IfcBuilding/My Building"
And the object "IfcBuildingStorey/My Storey" is in the collection "IfcBuildingStorey/My Storey"
And the object "IfcSpace/Space" is in the collection "IfcSpace/Space"
And the object "IfcElementAssembly/Assembly" is in the collection "IfcSpace/Space"
And the object "IfcBeam/Beam" is in the collection "IfcSpace/Space"
And the collection "IfcSite/My Site" is in the collection "IfcProject/My Project"
And the collection "IfcBuilding/My Building" is in the collection "IfcSite/My Site"
And the collection "IfcBuildingStorey/My Storey" is in the collection "IfcBuilding/My Building"
And the collection "IfcSpace/Space" is in the collection "IfcBuildingStorey/My Storey"
And "scene.BIMProjectProperties.is_loading" is "False"
"""
@test.bim.bootstrap.scenario
def test_manual_offset_of_object_placements(self):
return """
+122
View File
@@ -0,0 +1,122 @@
ISO-10303-21;
HEADER;
FILE_DESCRIPTION(('ViewDefinition[DesignTransferView]'),'2;1');
FILE_NAME('decomposition.ifc','2021-09-21T09:50:31+10:00',(),(),'IfcOpenShell 0.6.0b0','BlenderBIM 0.0.999999','Nobody');
FILE_SCHEMA(('IFC4'));
ENDSEC;
DATA;
#1=IFCPERSON('HSeldon','Seldon','Hari',$,$,$,$,$);
#2=IFCORGANIZATION('APTR','Aperture Science',$,$,$);
#3=IFCACTORROLE(.USERDEFINED.,'CONTRIBUTOR',$);
#4=IFCTELECOMADDRESS(.USERDEFINED.,'The main webpage of the software collection.','WEBPAGE',$,$,$,$,'https://ifcopenshell.org',$);
#5=IFCTELECOMADDRESS(.USERDEFINED.,'The BlenderBIM Add-on webpage of the software collection.','WEBPAGE',$,$,$,$,'https://blenderbim.org',$);
#6=IFCTELECOMADDRESS(.USERDEFINED.,'The source code repository of the software collection.','REPOSITORY',$,$,$,$,'https://github.com/IfcOpenShell/IfcOpenShell.git',$);
#7=IFCORGANIZATION($,'IfcOpenShell','IfcOpenShell is an open source (LGPL) software library that helps users and software developers to work with the IFC file format.',(#3),(#4,#5,#6));
#8=IFCAPPLICATION(#7,'0.0.999999','BlenderBIM Add-on','BlenderBIM');
#9=IFCPERSONANDORGANIZATION(#1,#2,$);
#10=IFCOWNERHISTORY(#9,#8,.READWRITE.,.ADDED.,1632181704,#9,#8,1632181704);
#11=IFCPROJECT('25mhbqrQzBIhdUUHrZK_q3',#10,'My Project',$,$,$,$,(#20,#27),#15);
#12=IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.);
#13=IFCSIUNIT(*,.AREAUNIT.,$,.SQUARE_METRE.);
#14=IFCSIUNIT(*,.VOLUMEUNIT.,$,.CUBIC_METRE.);
#15=IFCUNITASSIGNMENT((#12,#13,#14));
#16=IFCCARTESIANPOINT((0.,0.,0.));
#17=IFCDIRECTION((0.,0.,1.));
#18=IFCDIRECTION((1.,0.,0.));
#19=IFCAXIS2PLACEMENT3D(#16,#17,#18);
#20=IFCGEOMETRICREPRESENTATIONCONTEXT($,'Model',3,1.E-05,#19,$);
#21=IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Body','Model',*,*,*,*,#20,$,.MODEL_VIEW.,$);
#22=IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Box','Model',*,*,*,*,#20,$,.MODEL_VIEW.,$);
#23=IFCCARTESIANPOINT((0.,0.,0.));
#24=IFCDIRECTION((0.,0.,1.));
#25=IFCDIRECTION((1.,0.,0.));
#26=IFCAXIS2PLACEMENT3D(#23,#24,#25);
#27=IFCGEOMETRICREPRESENTATIONCONTEXT($,'Plan',2,1.E-05,#26,$);
#28=IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Annotation','Plan',*,*,*,*,#27,$,.PLAN_VIEW.,$);
#29=IFCOWNERHISTORY(#9,#8,.READWRITE.,.MODIFIED.,1632181704,#9,#8,1632181704);
#30=IFCSITE('2nSisauITAw99Ipgpxnuc1',#29,'My Site',$,$,#56,$,$,$,$,$,$,$,$);
#36=IFCOWNERHISTORY(#9,#8,.READWRITE.,.MODIFIED.,1632181704,#9,#8,1632181704);
#37=IFCBUILDING('3VLkNpYOP6c92$32FgVhz1',#36,'My Building',$,$,#63,$,$,$,$,$,$);
#43=IFCOWNERHISTORY(#9,#8,.READWRITE.,.MODIFIED.,1632181704,#9,#8,1632181704);
#44=IFCBUILDINGSTOREY('2EXifXJjf7IvZ04BvDaAfA',#43,'My Storey',$,$,#70,$,$,$,$);
#50=IFCOWNERHISTORY(#9,#8,.READWRITE.,.ADDED.,1632181704,#9,#8,1632181704);
#51=IFCRELAGGREGATES('0riie8ARHD2P_3P8pg2s0e',#50,$,$,#11,(#30));
#52=IFCCARTESIANPOINT((0.,0.,0.));
#53=IFCDIRECTION((0.,0.,1.));
#54=IFCDIRECTION((1.,0.,0.));
#55=IFCAXIS2PLACEMENT3D(#52,#53,#54);
#56=IFCLOCALPLACEMENT($,#55);
#57=IFCOWNERHISTORY(#9,#8,.READWRITE.,.ADDED.,1632181704,#9,#8,1632181704);
#58=IFCRELAGGREGATES('3HMkYYf2j01up2RzoG1K$S',#57,$,$,#30,(#37));
#59=IFCCARTESIANPOINT((0.,0.,0.));
#60=IFCDIRECTION((0.,0.,1.));
#61=IFCDIRECTION((1.,0.,0.));
#62=IFCAXIS2PLACEMENT3D(#59,#60,#61);
#63=IFCLOCALPLACEMENT(#56,#62);
#64=IFCOWNERHISTORY(#9,#8,.READWRITE.,.ADDED.,1632181704,#9,#8,1632181704);
#65=IFCRELAGGREGATES('1r5yHIAoX7ExW8Fb$KK6Rv',#64,$,$,#37,(#44));
#66=IFCCARTESIANPOINT((0.,0.,0.));
#67=IFCDIRECTION((0.,0.,1.));
#68=IFCDIRECTION((1.,0.,0.));
#69=IFCAXIS2PLACEMENT3D(#66,#67,#68);
#70=IFCLOCALPLACEMENT(#63,#69);
#71=IFCOWNERHISTORY(#9,#8,.READWRITE.,.MODIFIED.,1632181716,#9,#8,1632181716);
#72=IFCSPACE('13wXihTNXCyASBfO8n3YgZ',#71,'Space',$,$,#102,#90,$,$,.EXTERNAL.,$);
#78=IFCINDEXEDPOLYGONALFACE((1,5,7,3));
#79=IFCINDEXEDPOLYGONALFACE((4,3,7,8));
#80=IFCINDEXEDPOLYGONALFACE((8,7,5,6));
#81=IFCINDEXEDPOLYGONALFACE((6,2,4,8));
#82=IFCINDEXEDPOLYGONALFACE((2,1,3,4));
#83=IFCINDEXEDPOLYGONALFACE((6,5,1,2));
#84=IFCCARTESIANPOINTLIST3D(((1.,1.,1.),(1.,1.,-1.),(1.,-1.,1.),(1.,-1.,-1.),(-1.,1.,1.),(-1.,1.,-1.),(-1.,-1.,1.),(-1.,-1.,-1.)));
#85=IFCPOLYGONALFACESET(#84,$,(#78,#79,#80,#81,#82,#83),$);
#86=IFCSHAPEREPRESENTATION(#21,'Body','Tessellation',(#85));
#87=IFCCARTESIANPOINT((-1.,-1.,-1.));
#88=IFCBOUNDINGBOX(#87,2.,2.,2.);
#89=IFCSHAPEREPRESENTATION(#22,'Box','BoundingBox',(#88));
#90=IFCPRODUCTDEFINITIONSHAPE($,$,(#89,#86));
#91=IFCCOLOURRGB($,0.800000011920929,0.800000011920929,0.800000011920929);
#92=IFCCOLOURRGB($,0.800000011920929,0.800000011920929,0.800000011920929);
#93=IFCSURFACESTYLERENDERING(#91,0.,#92,$,$,$,$,$,.NOTDEFINED.);
#94=IFCSURFACESTYLE('Material',.BOTH.,(#93));
#95=IFCSTYLEDITEM(#85,(#94),'Material');
#96=IFCOWNERHISTORY(#9,#8,.READWRITE.,.ADDED.,1632181716,#9,#8,1632181716);
#97=IFCRELAGGREGATES('2NuKgx$4L8OBX9R$MwP3Bf',#96,$,$,#44,(#72));
#98=IFCCARTESIANPOINT((0.,0.,0.));
#99=IFCDIRECTION((0.,0.,1.));
#100=IFCDIRECTION((1.,0.,0.));
#101=IFCAXIS2PLACEMENT3D(#98,#99,#100);
#102=IFCLOCALPLACEMENT(#70,#101);
#103=IFCOWNERHISTORY(#9,#8,.READWRITE.,.MODIFIED.,1632181774,#9,#8,1632181774);
#104=IFCELEMENTASSEMBLY('0hCUjYJgv6FwS2fAvN21mm',#103,'Assembly',$,$,#120,$,$,$,.ACCESSORY_ASSEMBLY.);
#110=IFCRELCONTAINEDINSPATIALSTRUCTURE('2zdJYp1Tr8qvLmsWlFRgz0',#151,$,$,(#104),#72);
#116=IFCCARTESIANPOINT((0.,0.,0.));
#117=IFCDIRECTION((0.,0.,1.));
#118=IFCDIRECTION((1.,0.,0.));
#119=IFCAXIS2PLACEMENT3D(#116,#117,#118);
#120=IFCLOCALPLACEMENT(#102,#119);
#121=IFCOWNERHISTORY(#9,#8,.READWRITE.,.MODIFIED.,1632181807,#9,#8,1632181786);
#122=IFCBEAM('1KiE3gs9z1sfj9c0spBIGv',#121,'Beam',$,$,#158,#140,$,.BEAM.);
#128=IFCINDEXEDPOLYGONALFACE((1,2,4,3));
#129=IFCINDEXEDPOLYGONALFACE((3,4,8,7));
#130=IFCINDEXEDPOLYGONALFACE((7,8,6,5));
#131=IFCINDEXEDPOLYGONALFACE((5,6,2,1));
#132=IFCINDEXEDPOLYGONALFACE((3,7,5,1));
#133=IFCINDEXEDPOLYGONALFACE((8,4,2,6));
#134=IFCCARTESIANPOINTLIST3D(((-1.,-1.,-1.),(-1.,-1.,1.),(-1.,1.,-1.),(-1.,1.,1.),(1.,-1.,-1.),(1.,-1.,1.),(1.,1.,-1.),(1.,1.,1.)));
#135=IFCPOLYGONALFACESET(#134,$,(#128,#129,#130,#131,#132,#133),$);
#136=IFCSHAPEREPRESENTATION(#21,'Body','Tessellation',(#135));
#137=IFCCARTESIANPOINT((-1.,-1.,-1.));
#138=IFCBOUNDINGBOX(#137,2.,2.,2.);
#139=IFCSHAPEREPRESENTATION(#22,'Box','BoundingBox',(#138));
#140=IFCPRODUCTDEFINITIONSHAPE($,$,(#139,#136));
#151=IFCOWNERHISTORY(#9,#8,.READWRITE.,.ADDED.,1632181798,#9,#8,1632181798);
#152=IFCOWNERHISTORY(#9,#8,.READWRITE.,.ADDED.,1632181807,#9,#8,1632181807);
#153=IFCRELAGGREGATES('1N$QRzghfDgA1Hw$swtu4S',#152,$,$,#104,(#122));
#154=IFCCARTESIANPOINT((0.,0.,0.));
#155=IFCDIRECTION((0.,0.,1.));
#156=IFCDIRECTION((1.,0.,0.));
#157=IFCAXIS2PLACEMENT3D(#154,#155,#156);
#158=IFCLOCALPLACEMENT(#120,#157);
ENDSEC;
END-ISO-10303-21;