Skip to content

Commit

Permalink
Gem005 (#79)
Browse files Browse the repository at this point in the history
* ALS005 / RI-5

* Add .feature file

* ALS006 / RI-10 NB: attribute type check no longer includes subtypes, because IfcGradientCurve is a subtype of IfcCompositeCurve

* Correct ALS005 file for ALS006 rules

* ALS007 / RI-12

* GEM005 / RI-71

* Small irrelevant error in test case generation

* Rename testfile to correct rule id

* add markdown for testfiles

* 20 km -> 20m

---------

Co-authored-by: Geert Hesselink <geert.hess@gmail.com>
  • Loading branch information
aothms and Ghesselink authored Sep 26, 2023
1 parent 8340336 commit ff1892b
Show file tree
Hide file tree
Showing 22 changed files with 2,570 additions and 1 deletion.
12 changes: 12 additions & 0 deletions features/GEM005_Geometry-of-surrounding-buildings.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@implementer-agreement
@ALS
Feature: Building shape representation
Scenario: Agreement on empty IfcBuilding using correct representation

Given A file with Schema Identifier "IFC2X3" or "IFC4" or "IFC4X3_TC1" or "IFC4X3_ADD1" or "IFC4X3"
And An IfcBuilding
And ContainsElements = empty
And IsDecomposedBy = empty
And Its attribute Representation
And Its attribute Representations
Then The value of attribute RepresentationIdentifier must be Body
5 changes: 4 additions & 1 deletion features/steps/givens/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@

@given("{attribute} = {value}")
def step_impl(context, attribute, value):
value = ast.literal_eval(value)
if value == 'empty':
value = ()
else:
value = ast.literal_eval(value)
context.instances = list(
filter(lambda inst: getattr(inst, attribute, True) == value, context.instances)
)
Expand Down
185 changes: 185 additions & 0 deletions test/files/als005/fail-sectioned-solid-horizontal-wrong-identifier.ifc
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
ISO-10303-21;
HEADER;
FILE_DESCRIPTION (('ViewDefinition [Ifc4X3NotAssigned]'), '2;1');
FILE_NAME ('sectioned-solid-horizontal.ifc', '2021-05-31T10:35:59', (), (), 'redacted', $, $);
FILE_SCHEMA (('IFC4X3_ADD1'));
ENDSEC;

DATA;
#1 = IFCOWNERHISTORY(#2, #6, $, .NOCHANGE., $, $, $, 1622457359);
#2 = IFCPERSONANDORGANIZATION(#3, #4, $);
#3 = IFCPERSON($, 'redacted', 'redacted', $, $, $, $, $);
#4 = IFCORGANIZATION($, 'redacted', $, $, $);
#5 = IFCORGANIZATION($, 'redacted', $, $, $);
#6 = IFCAPPLICATION(#5, 'redacted', 'redacted', 'redacted');
#7 = IFCPROJECT('0A_yMRoUvBdBdFGHn1GH7s', #1, 'Test IFC Project', $, $, $, $, (#13), #8);
#8 = IFCUNITASSIGNMENT((#9, #10, #11, #12));
#9 = IFCSIUNIT(*, .LENGTHUNIT., $, .METRE.);
#10 = IFCSIUNIT(*, .AREAUNIT., $, .SQUARE_METRE.);
#11 = IFCSIUNIT(*, .VOLUMEUNIT., $, .CUBIC_METRE.);
#12 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.);
#13 = IFCGEOMETRICREPRESENTATIONCONTEXT($, 'Model', 3, 1.E-4, #14, #16);
#14 = IFCAXIS2PLACEMENT3D(#15, $, $);
#15 = IFCCARTESIANPOINT((0., 0., 0.));
#16 = IFCDIRECTION((0., 1.));
#17 = IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Body', 'Model', *, *, *, *, #13, $, .MODEL_VIEW., $);
#18 = IFCARBITRARYCLOSEDPROFILEDEF(.AREA., 'Simple Profile', #19);
#19 = IFCINDEXEDPOLYCURVE(#20, (IFCLINEINDEX((1, 2)), IFCLINEINDEX((2, 3)), IFCLINEINDEX((3, 4)), IFCLINEINDEX((4, 1))), $);
#20 = IFCCARTESIANPOINTLIST2D(((-4., 0.), (-5., -1.), (5., -1.), (4., 0.)), $);
#24 = IFCSITE('35wH0d2VDFze34cZziHyWH', #1, 'Default Site', $, $, #25, $, $, .ELEMENT., (0, 0, 0), (0, 0, 0), 0., $, $);
#25 = IFCLOCALPLACEMENT($, #28);
#26 = IFCDIRECTION((0., 0., 1.));
#27 = IFCDIRECTION((1., 0., 0.));
#28 = IFCAXIS2PLACEMENT3D(#15, #26, #27);
#29 = IFCALIGNMENT('0qI6nq6055HgCBPMUsw303', #1, 'Test Alignment', $, $, #30, #104, $);
#30 = IFCLOCALPLACEMENT(#25, #33);
#31 = IFCDIRECTION((0., 0., 1.));
#32 = IFCDIRECTION((1., 0., 0.));
#33 = IFCAXIS2PLACEMENT3D(#15, #31, #32);
#34 = IFCALIGNMENTHORIZONTAL('2a51YNKc9CIA9mX6PHta0R', #1, $, $, $, $, $);
#35 = IFCALIGNMENTSEGMENT('2VLcO34uj1ThLg3tnDQSDu', #1, $, $, $, #1501, #1601, #36);
#36 = IFCALIGNMENTHORIZONTALSEGMENT($, $, #37, 0., 0., 0., 400., $, .LINE.);
#37 = IFCCARTESIANPOINT((0., 0.));
#38 = IFCALIGNMENTSEGMENT('23in7RdgnF5etPmWAUg6Un', #1, $, $, $, #1501, #1611, #39);
#39 = IFCALIGNMENTHORIZONTALSEGMENT($, $, #40, 0., 0., -500.000000000002, 150., $, .CLOTHOID.);
#40 = IFCCARTESIANPOINT((400., 0.));
#41 = IFCALIGNMENTSEGMENT('2f96e3LmrECxEoe22s5Xpd', #1, $, $, $, #1501, #1621, #42);
#42 = IFCALIGNMENTHORIZONTALSEGMENT($, $, #43, 6.13318530717958, -500.000000000002, -500.000000000002, 400., $, .CIRCULARARC.);
#43 = IFCCARTESIANPOINT((549.662851380011, -7.48795505445));
#44 = IFCRELNESTS('3A9jueO1j2z8C76N1IFh7f', #1, 'Linear Element Nesting', $, #34, (#35, #38, #41, #1101));
#45 = IFCALIGNMENTVERTICAL('3SOdKle3DEtuUG6EbrmQpy', #1, $, $, $, $, $);
#46 = IFCALIGNMENTSEGMENT('16nyAX_5956AZO3WakpmwA', #1, $, $, $, #2501, #2601, #47);
#47 = IFCALIGNMENTVERTICALSEGMENT($, $, 0., 449.999993741124, 150., -9.99999999995544E-4, -9.99999999995544E-4, $, .CONSTANTGRADIENT.);
#48 = IFCALIGNMENTSEGMENT('3Zuiuqd_1EPuTb4o9SuLse', #1, $, $, $, #2501, #2611, #49);
#49 = IFCALIGNMENTVERTICALSEGMENT($, $, 449.999993741124, 100.000006258876, 149.550000006261, -9.99999999995544E-4, 4.44444444449813E-4, 69230.7996321627, .CIRCULARARC.);
#50 = IFCALIGNMENTSEGMENT('1ZSIbG7kLDTxDPZKyT21HX', #1, $, $, $, #2501, #2621, #51);
#51 = IFCALIGNMENTVERTICALSEGMENT($, $, 550., 400., 149.522222225005, 4.44444444449813E-4, 4.44444444449813E-4, $, .CONSTANTGRADIENT.);
#52 = IFCRELNESTS('0f0eGFsknBWxOW9inF_FLN', #1, 'Linear Element Nesting', $, #45, (#46, #48, #50, #2001));
#53 = IFCRELNESTS('0Ejb6tfov7UebksdwCEIZR', #1, 'Alignment Nesting', $, #29, (#34, #45));
#54 = IFCCOMPOSITECURVE((#55, #63, #71, #1201), .U.);
#55 = IFCCURVESEGMENT(.CONTSAMEGRADIENTSAMECURVATURE., #58, IFCLENGTHMEASURE(0.), IFCLENGTHMEASURE(400.), #59);
#56 = IFCCARTESIANPOINT((0., 0.));
#57 = IFCDIRECTION((1., 0.));
#58 = IFCAXIS2PLACEMENT2D(#56, #57);
#59 = IFCLINE(#60, #61);
#60 = IFCCARTESIANPOINT((0., 0.));
#61 = IFCVECTOR(#62, 1.);
#62 = IFCDIRECTION((1., 0.));
#63 = IFCCURVESEGMENT(.CONTSAMEGRADIENTSAMECURVATURE., #66, IFCLENGTHMEASURE(0.), IFCLENGTHMEASURE(150.), #67);
#64 = IFCCARTESIANPOINT((400., 0.));
#65 = IFCDIRECTION((1., 0.));
#66 = IFCAXIS2PLACEMENT2D(#64, #65);
#67 = IFCCLOTHOID(#70, -273.861278752584);
#68 = IFCCARTESIANPOINT((0., 0.));
#69 = IFCDIRECTION((1., 0.));
#70 = IFCAXIS2PLACEMENT2D(#68, #69);
#71 = IFCCURVESEGMENT(.CONTSAMEGRADIENTSAMECURVATURE., #74, IFCLENGTHMEASURE(0.), IFCLENGTHMEASURE(-400.), #75);
#72 = IFCCARTESIANPOINT((549.662851380011, -7.48795505445));
#73 = IFCDIRECTION((9.88771077936042E-1, -1.49438132473604E-1));
#74 = IFCAXIS2PLACEMENT2D(#72, #73);
#75 = IFCCIRCLE(#78, 500.000000000002);
#76 = IFCCARTESIANPOINT((0., 0.));
#77 = IFCDIRECTION((1., 0.));
#78 = IFCAXIS2PLACEMENT2D(#76, #77);
#79 = IFCGRADIENTCURVE((#80, #88, #96, #2101), .U., #54, $);
#80 = IFCCURVESEGMENT(.CONTSAMEGRADIENTSAMECURVATURE., #83, IFCLENGTHMEASURE(0.), IFCLENGTHMEASURE(450.000218741065), #84);
#81 = IFCCARTESIANPOINT((0., 150.));
#82 = IFCDIRECTION((9.99999500000375E-1, -9.99999499995919E-4));
#83 = IFCAXIS2PLACEMENT2D(#81, #82);
#84 = IFCLINE(#85, #86);
#85 = IFCCARTESIANPOINT((0., 0.));
#86 = IFCVECTOR(#87, 1.);
#87 = IFCDIRECTION((1., 0.));
#88 = IFCCURVESEGMENT(.CONTSAMEGRADIENTSAMECURVATURE., #91, IFCLENGTHMEASURE(4.71138898071803), IFCLENGTHMEASURE(100.00001881), #92);
#89 = IFCCARTESIANPOINT((449.999993741124, 149.550000006261));
#90 = IFCDIRECTION((9.99999500000375E-1, -9.99999499995919E-4));
#91 = IFCAXIS2PLACEMENT2D(#89, #90);
#92 = IFCCIRCLE(#95, 69230.7996321627);
#93 = IFCCARTESIANPOINT((0., 0.));
#94 = IFCDIRECTION((1., 0.));
#95 = IFCAXIS2PLACEMENT2D(#93, #94);
#96 = IFCCURVESEGMENT(.CONTSAMEGRADIENTSAMECURVATURE., #99, IFCLENGTHMEASURE(0.), IFCLENGTHMEASURE(400.000039506171), #100);
#97 = IFCCARTESIANPOINT((550., 149.522222225005));
#98 = IFCDIRECTION((9.99999901234583E-1, 4.44444400554072E-4));
#99 = IFCAXIS2PLACEMENT2D(#97, #98);
#100 = IFCLINE(#101, #102);
#101 = IFCCARTESIANPOINT((0., 0.));
#102 = IFCVECTOR(#103, 1.);
#103 = IFCDIRECTION((1., 0.));
/* tfk: remove the footprint representation for now in #1002 */
#104 = IFCPRODUCTDEFINITIONSHAPE($, $, (#106));
#105 = IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Axis', 'Model', *, *, *, *, #13, $, .MODEL_VIEW., $);
#106 = IFCSHAPEREPRESENTATION(#105, 'Body', 'Curve3D', (#79));
#107 = IFCBUILTELEMENT('3k7$iV7T92$R$xNE9oe5R8', #1, 'SimpleProfile', $, $, #108, #115, $);
#108 = IFCLOCALPLACEMENT(#25, #114);
#109 = IFCDIRECTION((0., 0., 1.));
#110 = IFCDIRECTION((1., 0., 0.));
#114 = IFCAXIS2PLACEMENT3D(#15, #109, #110);
#115 = IFCPRODUCTDEFINITIONSHAPE($, $, (#127));
#116 = IFCSECTIONEDSOLIDHORIZONTAL(#79, (#18, #18), (#117, #119));
#117 = IFCAXIS2PLACEMENTLINEAR(#118, $, $);
#118 = IFCPOINTBYDISTANCEEXPRESSION(IFCLENGTHMEASURE(300.), $, $, $, #79);
#119 = IFCAXIS2PLACEMENTLINEAR(#120, $, $);
#120 = IFCPOINTBYDISTANCEEXPRESSION(IFCLENGTHMEASURE(600.), $, $, $, #79);
#127 = IFCSHAPEREPRESENTATION(#17, 'Body', 'AdvancedSweptSolid', (#116));
#128 = IFCRELCONTAINEDINSPATIALSTRUCTURE('0de2EMoG5C3AvNHWz3ILSb', #1, 'Container', 'Container to Contained', (#29, #107), #24);
#129 = IFCRELAGGREGATES('0PN7lKNInB_OsofZN8N0Nn', #1, 'Project Container', 'Project to Spatial Element', #7, (#24));

#1001 = IFCGEOMETRICREPRESENTATIONSUBCONTEXT('FootPrint', 'Model', *, *, *, *, #13, $, .MODEL_VIEW., $);
#1002 = IFCSHAPEREPRESENTATION(#1001, 'FootPrint', 'Curve2D', (#54));

#1101 = IFCALIGNMENTSEGMENT('1lqBKv7Xz1Hx2tmPCGtaIa', #1, $, $, $, #1501, #1631, #1102);
#1102 = IFCALIGNMENTHORIZONTALSEGMENT($, $, #1103, -0.95, 0., 0., 0., $, .LINE.);
#1103 = IFCCARTESIANPOINT((881.65153753789, -211.03194929054));

#1201 = IFCCURVESEGMENT(.DISCONTINUOUS., #1204, IFCLENGTHMEASURE(0.), IFCLENGTHMEASURE(0.), #1205);
#1202 = IFCCARTESIANPOINT((0881.65153753789, -211.03194929054));
#1203 = IFCDIRECTION((0.58168308946, -0.81341550478));
#1204 = IFCAXIS2PLACEMENT2D(#1202, #1203);
#1205 = IFCLINE(#1206, #1207);
#1206 = IFCCARTESIANPOINT((0., 0.));
#1207 = IFCVECTOR(#1208, 1.);
#1208 = IFCDIRECTION((1., 0.));

#1501 = IFCLOCALPLACEMENT($, #1502);
#1502 = IFCAXIS2PLACEMENT3D(#1503, $, $);
#1503 = IFCCARTESIANPOINT((0., 0., 0.));

#1601 = IFCPRODUCTDEFINITIONSHAPE($, $, (#1602));
#1602 = IFCSHAPEREPRESENTATION(#105, 'Axis', 'Segment', (#55));
#1611 = IFCPRODUCTDEFINITIONSHAPE($, $, (#1612));
#1612 = IFCSHAPEREPRESENTATION(#105, 'Axis', 'Segment', (#63));
#1621 = IFCPRODUCTDEFINITIONSHAPE($, $, (#1622));
#1622 = IFCSHAPEREPRESENTATION(#105, 'Axis', 'Segment', (#71));
#1631 = IFCPRODUCTDEFINITIONSHAPE($, $, (#1632));
#1632 = IFCSHAPEREPRESENTATION(#105, 'Axis', 'Segment', (#1201));

#2001 = IFCALIGNMENTSEGMENT('49fS3hA8n5YOBvYphrBOIP', #1, $, $, $, #2501, #2631, #2002);
#2002 = IFCALIGNMENTVERTICALSEGMENT($, $, 950., 0., 149.7, 4.44444444449813E-4, 4.44444444449813E-4, $, .CONSTANTGRADIENT.);

#2101 = IFCCURVESEGMENT(.DISCONTINUOUS., #2104, IFCLENGTHMEASURE(0.), IFCLENGTHMEASURE(0.), #2105);
#2102 = IFCCARTESIANPOINT((950., 149.7));
#2103 = IFCDIRECTION((9.99999901234583E-1, 4.44444400554072E-4));
#2104 = IFCAXIS2PLACEMENT2D(#2102, #2103);
#2105 = IFCLINE(#85, #86);
#2106 = IFCCARTESIANPOINT((0., 0.));
#2107 = IFCVECTOR(#2108, 1.);
#2108 = IFCDIRECTION((1., 0.));

#2501 = IFCLOCALPLACEMENT($, #2502);
#2502 = IFCAXIS2PLACEMENT3D(#2503, $, $);
#2503 = IFCCARTESIANPOINT((0., 0., 0.));

#2601 = IFCPRODUCTDEFINITIONSHAPE($, $, (#2602));
#2602 = IFCSHAPEREPRESENTATION(#105, 'Axis', 'Segment', (#80));
#2611 = IFCPRODUCTDEFINITIONSHAPE($, $, (#2612));
#2612 = IFCSHAPEREPRESENTATION(#105, 'Axis', 'Segment', (#88));
#2621 = IFCPRODUCTDEFINITIONSHAPE($, $, (#2622));
#2622 = IFCSHAPEREPRESENTATION(#105, 'Axis', 'Segment', (#96));
#2631 = IFCPRODUCTDEFINITIONSHAPE($, $, (#2632));
#2632 = IFCSHAPEREPRESENTATION(#105, 'Axis', 'Segment', (#2101));

#3000 = IFCRELAGGREGATES('0mRn50inT2pf1XqujacVu9', #1, 'Project Container 2', 'Project to Alignment', #7, (#29));

ENDSEC;
END-ISO-10303-21;
Loading

0 comments on commit ff1892b

Please sign in to comment.