Skip to content

Commit

Permalink
IVS-175/CTX000 - Presentation colours and textures (#312)
Browse files Browse the repository at this point in the history
* IVS-175/CTX000 - Presentation colours and textures

* testfiles schema-compliant

* Update features/CTX000_Presentation-colours-and-textures.feature

Co-authored-by: Evandro Alfieri <[email protected]>

* fix typo testfile

* simplify attr lookup & add styled materials

* Update features/CTX000_Presentation-colours-and-textures.feature

Co-authored-by: Thomas Krijnen <[email protected]>

* update filename testfile

---------

Co-authored-by: Evandro Alfieri <[email protected]>
Co-authored-by: Thomas Krijnen <[email protected]>
  • Loading branch information
3 people authored Nov 7, 2024
1 parent e36a2df commit 316e1c1
Show file tree
Hide file tree
Showing 12 changed files with 5,304 additions and 10 deletions.
35 changes: 35 additions & 0 deletions features/CTX000_Presentation-colours-and-textures.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@implementer-agreement
@CTX
@version1
@E00020

Feature: CTX000 - Presentation colours and textures
The rule verifies the presence of IFC entities used to assign colour, texture and other presentation appearance information to objects.
https://ifc43-docs.standards.buildingsmart.org/IFC/RELEASE/IFC4x3/HTML/concepts/Product_Shape/Product_Geometry_Colour/content.html

Scenario Outline: Check for activation - RepresentationItem attributes

Given an IfcRepresentationItem
Given Its attribute <attribute>

Then The IFC model contains information on the selected functional part

Examples:
| attribute |
| StyledByItem |
| HasColours |


Scenario: Check for activation - Styled Materials

Given an IfcRoot
Given its attribute HasAssociations
Given all referenced instances
Given its entity type is 'IfcMaterial'
Given its attribute HasRepresentation
Given its attribute Representations
Given its attribute Items
Given its entity type is 'IfcStyledItem'

Then The IFC model contains information on the selected functional part

2 changes: 0 additions & 2 deletions features/steps/givens/attributes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import ast
import itertools
import operator

import ifcopenshell
Expand All @@ -8,7 +7,6 @@
from parse_type import TypeBuilder
from validation_handling import gherkin_ifc, register_enum_type
from . import ValidationOutcome, OutcomeSeverity

from enum import Enum, auto


Expand Down
120 changes: 120 additions & 0 deletions test/files/ctx000/na-ctx000-non_styled_solid.ifc
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
ISO-10303-21;
HEADER;
/* NOTE a valid model view name has to be asserted, replacing 'notYetAssigned' ----------------- */
FILE_DESCRIPTION(
( 'ViewDefinition [notYetAssigned]'
,'Comment [manual creation of example file]'
)
,'2;1');
/* NOTE standard header information according to ISO 10303-21 ---------------------------------- */
FILE_NAME(
'basic_shape_Brep.ifc',
'2012-06-18T18:00:00',
('Thomas Liebich'),
('buildingSMART International'),
'IFC text editor',
'IFC text editor',
'reference file created for the IFC4 specification');
/* NOTE schema name to be replaced with 'IFC4' after the final release ------------------------ */
FILE_SCHEMA(('IFC4'));
ENDSEC;

DATA;
/* --------------------------------------------------------------------------------------------- */
/* general entities required for all IFC data sets, defining the context for the exchange ------ */
#100= IFCPROJECT('0xScRe4drECQ4DMSqUjd6d',#110,'proxy with brep',$,$,$,$,(#201),#301);

/* single owner history sufficient if not otherwise required by the view definition ------------ */
/* provides the person and application creating the data set, and the time it is created ------- */
#110= IFCOWNERHISTORY(#111,#115,$,.ADDED.,1320688800,$,$,1320688800);
#111= IFCPERSONANDORGANIZATION(#112,#113,$);
#112= IFCPERSON($,'Liebich','Thomas',$,$,$,$,$);
#113= IFCORGANIZATION($,'buildingSMART International',$,$,$);
#115= IFCAPPLICATION(#113,'1.0','IFC text editor','ifcTE');

/* each IFC data set containing geometry has to define a geometric representation context ------ */
/* the attribute 'ContextType' has to be 'Model' for 3D model geometry ------------------------- */
#201= IFCGEOMETRICREPRESENTATIONCONTEXT($,'Model',3,1.0E-5,#210,$);
/* the attribute 'ContextIdentifier' has to be 'Body' for the main 3D shape representation ----- */
#202= IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Body','Model',*,*,*,*,#201,$,.MODEL_VIEW.,$);
#210= IFCAXIS2PLACEMENT3D(#901,$,$);

/* each IFC data set containing geometry has to define at absolute minimum length and angle ---- */
/* here length is milli metre as SI unit, and plane angle is 'degree' as non SI unit ----------- */
#301= IFCUNITASSIGNMENT((#311,#312));
#311= IFCSIUNIT(*,.LENGTHUNIT.,.MILLI.,.METRE.);
#312= IFCCONVERSIONBASEDUNIT(#313,.PLANEANGLEUNIT.,'degree',#314);
#313= IFCDIMENSIONALEXPONENTS(0,0,0,0,0,0,0);
#314= IFCMEASUREWITHUNIT(IFCPLANEANGLEMEASURE(0.017453293),#315);
#315= IFCSIUNIT(*,.PLANEANGLEUNIT.,$,.RADIAN.);

/* each IFC data set containing elements in a building context has to include a building ------- */
/* at absolute minimum (could have a site and stories as well) --------------------------------- */
#500= IFCBUILDING('2FCZDorxHDT8NI01kdXi8P',$,'Test Building',$,$,#511,$,$,.ELEMENT.,$,$,$);
/* if the building is the uppermost spatial structure element it defines the absolut position -- */
#511= IFCLOCALPLACEMENT($,#512);
/* no rotation - z and x axes set to '$' are therefore identical to "world coordinate system" -- */
#512= IFCAXIS2PLACEMENT3D(#901,$,$);
/* if the building is the uppermost spatial structure element it is assigned to the project ---- */
#519= IFCRELAGGREGATES('2YBqaV_8L15eWJ9DA1sGmT',$,$,$,#100,(#500));

/* shared coordinates - it is permissable to share common instances to reduce file size -------- */
#901= IFCCARTESIANPOINT((0.,0.,0.));
#902= IFCDIRECTION((1.,0.,0.));
#903= IFCDIRECTION((0.,1.,0.));
#904= IFCDIRECTION((0.,0.,1.));
#905= IFCDIRECTION((-1.,0.,0.));
#906= IFCDIRECTION((0.,-1.,0.));
#907= IFCDIRECTION((0.,0.,-1.));

/* --------------------------------------------------------------------------------------------- */
/* proxy element with brep shape representation, assigned to the building ---------------------- */
#1000= IFCBUILDINGELEMENTPROXY('1kTvXnbbzCWw8lcMd1dR4o',$,'P-1','sample proxy',$,#1001,#1010,$,$);
/* proxy element placement relative to the building -------------------------------------------- */
#1001= IFCLOCALPLACEMENT(#511,#1002);
/* set local placement to 1 meter on x-axis, and 0 on y, and 0 on z axes ----------------------- */
/* no rotation - z and x axes set to '$' are therefore identical to those of building ---------- */
#1002= IFCAXIS2PLACEMENT3D(#1003,$,$);
#1003= IFCCARTESIANPOINT((1000.,0.,0.));
/* proxy element shape representation ---------------------------------------------------------- */
#1010= IFCPRODUCTDEFINITIONSHAPE($,$,(#1020));
/* a single shape representation of type 'brep' is included ------------------------------------ */
#1020= IFCSHAPEREPRESENTATION(#202,'Body','Brep',(#1021));
/* faceted boundary representation ------------------------------------------------------------- */
/* cube, 1m width, 1m depth, 2m height --------------------------------------------------------- */
#1021= IFCFACETEDBREP (#1022);
#1022= IFCCLOSEDSHELL ((#1110, #1120, #1130, #1140, #1150, #1160));
#1110= IFCFACE((#1111));
#1111= IFCFACEOUTERBOUND(#1112,.T.);
#1112= IFCPOLYLOOP((#1201,#1202,#1206,#1205));
#1120= IFCFACE((#1121));
#1121= IFCFACEOUTERBOUND(#1122,.T.);
#1122= IFCPOLYLOOP((#1206,#1202,#1203,#1207));
#1130= IFCFACE((#1131));
#1131= IFCFACEOUTERBOUND(#1132,.T.);
#1132= IFCPOLYLOOP((#1207,#1203,#1204,#1208));
#1140= IFCFACE((#1141));
#1141= IFCFACEOUTERBOUND(#1142,.T.);
#1142= IFCPOLYLOOP((#1208,#1204,#1201,#1205));
#1150= IFCFACE((#1151));
#1151= IFCFACEOUTERBOUND(#1152,.T.);
#1152= IFCPOLYLOOP((#1201,#1204,#1203,#1202));
#1160= IFCFACE((#1161));
#1161= IFCFACEOUTERBOUND(#1162,.T.);
#1162= IFCPOLYLOOP((#1206,#1207,#1208,#1205));
/* shared vertices of the faceted boundary representation -------------------------------------- */
#1201= IFCCARTESIANPOINT((-500.,-500.,0.));
#1202= IFCCARTESIANPOINT((500.,-500.,0.));
#1203= IFCCARTESIANPOINT((500.,500.,0.));
#1204= IFCCARTESIANPOINT((-500.,500.,0.));
#1205= IFCCARTESIANPOINT((-500.,-500.,2000.));
#1206= IFCCARTESIANPOINT((500.,-500.,2000.));
#1207= IFCCARTESIANPOINT((500.,500.,2000.));
#1208= IFCCARTESIANPOINT((-500.,500.,2000.));

/* proxy element assigned to the building ------------------------------------------------------ */
#10000=IFCRELCONTAINEDINSPATIALSTRUCTURE('2TnxZkTXT08eDuMuhUUFNy',$,'Physical model',$,(#1000),#500);


ENDSEC;
END-ISO-10303-21;
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
ISO-10303-21;
HEADER;
FILE_DESCRIPTION(('ViewDefinition [notYetAssigned]'),'2;1');
FILE_NAME(
/* name */ 'polygonal-faceset-cube.ifc',
/* time_stamp */ '2016-05-26T17:38:29',
/* author */ ('jonm'),
/* organization */ ('Geometry Gym'),
/* preprocessor_version */ 'GeomGymIFC by Geometry Gym Pty Ltd',
/* originating_system */ 'ggRhinoIFC - Grasshopper3d Plug-in by Geometry Gym Pty Ltd',
/* authorization */ 'None');

FILE_SCHEMA (('IFC4'));
ENDSEC;

DATA;
#1= IFCGEOMETRICREPRESENTATIONCONTEXT($,'Model',3,0.01,#3,$);
#2= IFCCARTESIANPOINT((0.0,0.0,0.0));
#3= IFCAXIS2PLACEMENT3D(#3058,#3059,#3060);
#4= IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Axis','Model',*,*,*,*,#1,$,.MODEL_VIEW.,$);
#5= IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Body','Model',*,*,*,*,#1,$,.MODEL_VIEW.,$);
#6= IFCCARTESIANPOINT((0.0,0.0,0.0));
#7= IFCDIRECTION((1.0,0.0,0.0));
#8= IFCDIRECTION((0.0,1.0,0.0));
#9= IFCDIRECTION((0.0,0.0,1.0));
#10= IFCCARTESIANPOINT((0.0,0.0));
#11= IFCAXIS2PLACEMENT2D(#10,$);
#12= IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.);
#13= IFCSIUNIT(*,.AREAUNIT.,$,.SQUARE_METRE.);
#14= IFCSIUNIT(*,.VOLUMEUNIT.,$,.CUBIC_METRE.);
/* ------------------------------------------------------------------------- */
/* polygonal face set geometry representation */
#15= IFCCARTESIANPOINTLIST3D(((-10000.0,-10000.0,-10000.0),(10000.0,-10000.0,-10000.0),(10000.0,10000.0,-10000.0),(-10000.0,10000.0,-10000.0),(-10000.0,-10000.0,10000.0),(10000.0,-10000.0,10000.0),(10000.0,10000.0,10000.0),(-10000.0,10000.0,10000.0),(-5000.0,-5000.0,-5000.0),(5000.0,-5000.0,-5000.0),(5000.0,5000.0,-5000.0),(-5000.0,5000.0,-5000.0),(5000.0,-5000.0,10000.0),(-5000.0,-5000.0,10000.0),(5000.0,5000.0,10000.0),(-5000.0,5000.0,10000.0)));
#16= IFCINDEXEDPOLYGONALFACE((2,6,6,5,1));
#17= IFCINDEXEDPOLYGONALFACE((3,7,6,2));
#18= IFCINDEXEDPOLYGONALFACE((4,8,7,3));
#19= IFCINDEXEDPOLYGONALFACE((1,5,8,4));
#20= IFCINDEXEDPOLYGONALFACE((4,3,2,1));
#21= IFCINDEXEDPOLYGONALFACEWITHVOIDS((6,7,8,5),((14,16,15,13)));
#22= IFCINDEXEDPOLYGONALFACE((13,10,9,14));
#23= IFCINDEXEDPOLYGONALFACE((15,11,10,13));
#24= IFCINDEXEDPOLYGONALFACE((16,12,11,15));
#25= IFCINDEXEDPOLYGONALFACE((14,9,12,16));
#26= IFCINDEXEDPOLYGONALFACE((9,10,11,12));
#27= IFCPOLYGONALFACESET(#15,.T.,(#16,#17,#18,#19,#20,#21,#22,#23,#24,#25,#26),$);
#28= IFCSHAPEREPRESENTATION(#5,'Body','Tessellation',(#27));
#29= IFCPRODUCTDEFINITIONSHAPE($,$,(#28));
/* ------------------------------------------------------------------------- */
/* assigned as shape representation to a proxy */
#30= IFCBUILDINGELEMENTPROXY('1csV6umSb0px7vDxobGEN_',#3054,'NOTDEFINED',$,$,#32,#29,$,.NOTDEFINED.);
#31= IFCAXIS2PLACEMENT3D(#2,$,$);
#32= IFCLOCALPLACEMENT(#3047,#31);
#3047= IFCLOCALPLACEMENT($,#3);
/* ------------------------------------------------------------------------- */
/* definition of the minimal building structure, units, owner history */
#3048= IFCBUILDING('2tMIBeIVfClPSrbOosOJDI',#3054,'Grasshopper Building','GH Building',$,#3047,$,'GH Building',$,0.0,0.0,$);
#3049= IFCPERSONANDORGANIZATION(#3050,#3051,$);
#3050= IFCPERSON('jonm','jonm',$,$,$,$,$,$);
#3051= IFCORGANIZATION($,'Geometry Gym',$,$,$);
#3052= IFCAPPLICATION(#3053,'1.4.14.0','ggRhinoIFC - Grasshopper3d Plug-in by Geometry Gym Pty Ltd','ggRhinoIFC');
#3053= IFCORGANIZATION($,'Geometry Gym Pty Ltd',$,$,$);
#3054= IFCOWNERHISTORY(#3049,#3052,$,.ADDED.,1464284014,$,$,1464284014);
#3055= IFCRELCONTAINEDINSPATIALSTRUCTURE('3_FDRX0_zCNwiRAZP_mk8l',#3054,'Building','Building Container for Elements',(#30),#3048);
#3056= IFCAXIS2PLACEMENT3D(#2,$,$);
#3058= IFCCARTESIANPOINT((0.0,0.0,0.0));
#3059= IFCDIRECTION((0.0,0.0,1.0));
#3060= IFCDIRECTION((1.0,0.0,0.0));
#3061= IFCPROJECT('37E0t9DhPDuPXM8sgxexaw',#3054,'Grasshopper Project',$,$,$,$,(#1),#3062);
#3062= IFCUNITASSIGNMENT((#3063,#13,#14,#3064,#3065));
#3063= IFCSIUNIT(*,.LENGTHUNIT.,.MILLI.,.METRE.);
#3064= IFCSIUNIT(*,.PLANEANGLEUNIT.,$,.RADIAN.);
#3065= IFCSIUNIT(*,.TIMEUNIT.,$,.SECOND.);
#3066= IFCRELAGGREGATES('1jnXpsMarCZQ$Xxt61uMb4',#3054,'Project Container','Project Container for Buildings',#3061,(#3048));
#3070= IFCAXIS2PLACEMENT3D(#2,$,$);
ENDSEC;

END-ISO-10303-21;


Loading

0 comments on commit 316e1c1

Please sign in to comment.