Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IVS-197 - Fix / GEM004 - IfcTopologyRepresentation #319

Merged
merged 6 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 15 additions & 35 deletions features/GEM004_Constraints-on-representation-identifiers.feature
Original file line number Diff line number Diff line change
@@ -1,57 +1,37 @@
@informal-proposition
@GEM
@version2
@version3
@E00010
Feature: GEM004 - Constraints on representation identifiers
The rule verifies that shape representations adhere to the permissible values outlined in the CSV files found in the 'features/resources/{attribute}.csv' folder, as specified in the documentation.

Scenario: Shape Representation Identifier must be valid - IFC4X3
Scenario: Shape Representation Identifier must be valid

Given A model with Schema "IFC4.3"
Given An IfcProduct
Given Its attribute Representation
Given Its attribute Representations
Given Its attribute RepresentationIdentifier

Then The values must be in 'valid_RepresentationIdentifier_IFC4.3.csv'
Then The values must be in 'valid_ShapeRepresentationIdentifier.csv'

Scenario: Shape Representation Type must be valid - IFC4X3

Given A model with Schema "IFC4.3"
Scenario: Shape Representation Type must be valid

Given An IfcProduct
Given Its attribute Representation
Given Its attribute Representations
Given Its entity type is 'IfcShapeRepresentation'
Given Its attribute RepresentationType

Then The values must be in 'valid_RepresentationType_IFC4.3.csv'


Scenario: Shape Representation Identifier must be valid - IFC4

Given A model with Schema "IFC4"
Given An IfcProduct
Given Its attribute Representation
Given Its attribute Representations
Given Its attribute RepresentationIdentifier
Then The values must be in 'valid_ShapeRepresentationType.csv'

Then The values must be in 'valid_RepresentationIdentifier_IFC4.csv'

Scenario: Shape Representation Type must be valid - IFC4

Given A model with Schema "IFC4"
Given An IfcProduct
Given Its attribute Representation
Given Its attribute Representations
Given Its attribute RepresentationType

Then The values must be in 'valid_RepresentationType_IFC4.csv'

Scenario: Shape Representation Type must be valid - IFC2X3
Given A model with Schema "IFC2X3"
Given An IfcProduct
Given Its attribute Representation
Given Its attribute Representations
Given Its attribute RepresentationType

Then The values must be in 'valid_RepresentationType_IFC2X3.csv'
Scenario: Topology Representation Type must be valid

Given An IfcProduct
Given Its attribute Representation
Given Its attribute Representations
Given Its entity type is 'IfcTopologyRepresentation'
Given Its attribute RepresentationType

Then The values must be in 'valid_TopologyRepresentationType.csv'
18 changes: 8 additions & 10 deletions features/GEM051_Presence-of-geometric-context.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,28 @@ The rule verifies that a geometric context is present in the model, that its att

Scenario Outline: Agreement on having at least one geometric representation context

Given A model with Schema "<Schema>"
Given A model with Schema <Schema>
Given An <Entity>
Given Its attribute RepresentationContexts

Then Assert existence
Then Its entity type is 'IfcGeometricRepresentationContext' including subtypes

Examples:
| Schema | Entity |
| IFC2X3 | IfcProject |
| IFC4 | IfcContext |
| IFC4.3 | IfcContext |
| Schema | Entity |
| "IFC2X3" | IfcProject |
| "IFC4.3" or "IFC4" | IfcContext |


Scenario Outline: Agreement on correct context types

Given A model with Schema "<Schema>"
Given A model with Schema <Schema>
Given An <Entity>
Given Its attribute RepresentationContexts

Then ContextType = "Model" or "Plan" or "NotDefined"

Examples:
| Schema | Entity |
| IFC2X3 | IfcProject |
| IFC4 | IfcContext |
| IFC4.3 | IfcContext |
| Schema | Entity |
| "IFC2X3" | IfcProject |
| "IFC4.3" or "IFC4" | IfcContext |
11 changes: 3 additions & 8 deletions features/GEM052_Correct-geometric-subcontexts.feature
civilx64 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,13 @@ Reference: https://github.com/buildingSMART/Sample-Test-Files/issues/137.
Then HasSubContexts = not empty


Scenario Outline: Constraints on context identifier
Scenario: Constraints on context identifier

Given a model with Schema "<schema>"
Given a model with Schema "IFC4.3" or "IFC4"
Given An IfcGeometricRepresentationSubContext
Given Its attribute ContextIdentifier

Then The values must be in '<source>'

Examples:
| schema | source |
| IFC4.3 | valid_RepresentationIdentifier_IFC4.3.csv |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case we can just remove the outline. and start with the same given as above:

Given a model with Schema "IFC4.3" or "IFC4"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true. I think we can even remove the schema selection from the Given statements; they are already selected in the python implementation. So then, we'll simply have three scenario's;

  • Shape representation identifiers
  • Shape representation types
  • Topology representation types

Something like this?

| IFC4 | valid_RepresentationIdentifier_IFC4.csv |
Then The values must be in 'valid_ShapeRepresentationIdentifier.csv'


Scenario: Context identifier must not be empty
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Vertex,topological vertex representation
Edge,topological edge representation
Path,topological path representation
Face,topological face representation
Shell,topological shell representation
Undefined,no constraints imposed
8 changes: 8 additions & 0 deletions features/resources/IFC4/valid_ProjectDeclaration.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
IfcActor
IfcControl
IfcGroup
IfcProcess
IfcProjectLibrary
IfcPropertySetTemplate
IfcResource
IfcTypeObject
11 changes: 11 additions & 0 deletions features/resources/IFC4/valid_ShapeRepresentationIdentifier.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CoG, Point to identify the center of gravity of an element. This value can be used for validation purposes.
Box, Bounding box as simplified 3D box geometry of an element
Annotation, 2D annotations not representing elements
Axis, 2D or 3D Axis, or single line, representation of an element
FootPrint, 2D Foot print, or double line, representation of an element, projected to ground view
Profile, 3D line representation of a profile being planar, e.g. used for door and window outlines
Surface, 3D Surface representation, e.g. of an analytical surface, of an elementplane)
Reference, 3D representation that is not part of the Body representation. This is used, e.g., for opening geometries, if there are to be excluded from an implicit Boolean operation.
Body, 3D Body representation, e.g. as wireframe, surface, or solid model, of an element
Clearance, 3D clearance volume of the element. Such clearance region indicates space that should not intersect with the 'Body' representation of other elements, though may intersect with the 'Clearance' representation of other elements.
Lighting, Representation of emitting light as a light source within a shape representation
6 changes: 6 additions & 0 deletions features/resources/IFC4/valid_TopologyRepresentationType.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Vertex,topological vertex representation
Edge,topological edge representation
Path,topological path representation
Face,topological face representation
Shell,topological shell representation
Undefined,no constraints imposed
8 changes: 8 additions & 0 deletions features/resources/IFC4X3/valid_ProjectDeclaration.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
IfcActor
IfcControl
IfcGroup
IfcProcess
IfcProjectLibrary
IfcPropertySetTemplate
IfcResource
IfcTypeObject
12 changes: 12 additions & 0 deletions features/resources/IFC4X3/valid_ShapeRepresentationIdentifier.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CoG,Point to identify the center of gravity of an element. This value can be used for validation purposes.
Box,Bounding box as simplified 3D box geometry of an element
Annotation,3D annotations not representing elements
Axis,2D or 3D Axis, or single line, representation of an element
FootPrint,2D Foot print, or double line, representation of an element, projected to ground view
Profile,3D line representation of a profile being planar, e.g. used for door and window outlines
Surface,3D Surface representation, e.g. of an analytical surface, of an elementplane)
Reference,3D representation that is not part of the Body representation. This is used, e.g., for opening geometries, if there are to be excluded from an implicit Boolean operation.
Body,3D Body representation, e.g. as wireframe, surface, or solid model, of an element
Body-Fallback,3D Body representation, e.g. as tessellation, or other surface, or boundary representation, added in addition to the solid model (potentially involving Boolean operations) of an element
Clearance,3D clearance volume of the element. Such clearance region indicates space that should not intersect with the 'Body' representation of other elements, though may intersect with the 'Clearance' representation of other elements.
Lighting,Representation of emitting light as a light source within a shape representation
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Vertex,topological vertex representation
Edge,topological edge representation
Path,topological path representation
Face,topological face representation
Shell,topological shell representation
Undefined,no constraints imposed
2 changes: 1 addition & 1 deletion features/steps/thens/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def step_impl(context, inst, i, csv_file):
return []

dirname = os.path.dirname(__file__)
filename = Path(dirname).parent.parent / "resources" / f"{csv_file}.csv"
filename = Path(dirname).parent.parent / "resources" / f"{context.model.schema}" /f"{csv_file}.csv"
valid_values = [row[0] for row in csv.reader(open(filename))]

def is_valid_instance(instance):
Expand Down
Loading