1

I've posted this in another forum as well due to the mathematical nature of the issue: forum post

I have an .ifc file in which the raw data exported describes a wall in the xy plane by a set of coordinates and their corresponding indexes according to the link explanation:

Explanation

I have a txt where the data is divided into the coordinates in xyz space, then indexes and some other data.

I was hoping that someone can help me understand how to link the indexes to their corresponding coordinates. There are 164 coordinate pairs and 324 index pairs so it doesn't make sense to me that each index relates to only 1 coordinate pair.

The goal is to establish a relationship between indexes and coordinates such that this type of data can output the wall thickness, which is in this case '10'. I was thinking that (according to the link above) by taking the first triangle described, it should describe the edge of the wall in 3D and therefore give us one of its sides as the shortest segment in the wall which is the thickness.

I received an answer in the mentioned forum post, that I should "...expanding out each coordinate in terms of X's, Y's, and Z's [instead of (X,Y,Z) triples) and then use every index triple to get the actual coordinate for the individual coordinate instead of one triple. So for example you have X[], Y[] and Z[] and you have an index (a,b,c) then you find X[a], Y[b], and Z[c] not Point(a,b,c)... "

I didn't quite understand this explanation, and would appreciate any help or further explanation in order to achieve my goal.

Thank you

Yafim Simanovsky
  • 531
  • 7
  • 26
  • If I don't know that inside those numbers there's a wall, how could I tell it? Extra-info is needed. For example 3D viewing the data and selecting the desired triangle/edge/etc with the mouse. Or analize normals and their change between adyacent triangles. – Ripi2 Apr 18 '18 at 17:41
  • I know it's a wall because I exported the data. My goal is exactly this - to find the wall thickness without any extra information other than the data provided. The data should fully describe the 3d geometry of the wall. – Yafim Simanovsky Apr 18 '18 at 21:18

2 Answers2

2

Let's start with the cordinates (IfcCartesianPointList3D): each one is a triplet, resulting in a Point with (x,y,z) coordinates.

Then the IfcTriangulatedFaceSet uses indices to construct triangles. It has 2 indexing modes: direct and indirect via PnIndex. The indexing mode is determined by the existence of an array for PnIndex (attribute number 5). Take note that I call these variants direct and indirect - they aren't mentioned that way in the IFC documentation.

Direct indexing

PnIndex is not set. Lets look at an (simple and constructed) example:

#100=IFCCARTESIANPOINTLIST(((0,0,0),(1,0,0),(1,1,0),(0,1,0)));
#101=IFCTRIANGULATEDFACESET(
    /*reference to the points*/         #100,
    /*no normals*/                      $,
    /*no indication if closed or open*/ $,
    /*coordinate indices*/              ((1,2,3),(1,3,4)),
    /*no PnIndex*/                      ());

This describes a square lying in the x-y-plane. Each entry in attribute CoordIndex is a triplet giving a one-based index into a point in the IfcCartesianPointList. This means there are two triangles constructed from the following points:

  1. (0,0,0) (1,0,0) (1,1,0)
  2. (0,0,0) (1,1,0) (0,1,0)

Indirect indexing

Lets build further on the previous example:

#100=IFCCARTESIANPOINTLIST(((0,0,0),(1,0,0),(1,1,0),(0,1,0)));
#101=IFCTRIANGULATEDFACESET(
    /*reference to the points*/         #100,
    /*no normals*/                      $,
    /*no indication if closed or open*/ $,
    /*coordinate indices*/              ((1,2,3),(1,3,4)),
    /*PnIndex*/                         (2,3,4,1));

This time there is PnIndex set. It adds a level of indirection to access the points. Triplets from CoordIndex point into PnIndex (1-based). The value found in PnIndex is then used to access the IfcCartesianPointList.

So for the first triangle we have: (1,2,3) in CoordIndex. These point to 2, 3 and 4 in PnIndex. These result in the following points from the point list: (1,0,0) (1,1,0) (0,1,0)

Repeating the procudure for the second triangle (1,3,4) we get values 2, 4, 1 from PnIndex and the following points: (1,0,0) (0,1,0) (0,0,0)

It is again a square, but this time with a different triangulation.

Now if you want to know your wall thickness you will need to calculate the extents from the resulting geometry. If your wall is aligned with the coordinate system axes this is easy (get the difference between the smallest and largest X, Y and Z). If it is not, you might need to transform the points or look further into 3D-extent calculations (my knowledge ends there).

Loebl
  • 1,381
  • 11
  • 21
0

In a triangulation it's roughly num of triangles = 2 * num of vertices.

A wall (e.g. a rectangle) may be described by two triangles that share an edge and the two vertices of this edge.

Instead of describing the whole model triangle by triangle, each with its three vertices, or edge by edge, it's cheaper, avoids repeating vertex data, to set an index for each vertex and set a triangle by the three indices of its vertices. This is usually called "indexed rendering".

Ripi2
  • 7,031
  • 1
  • 17
  • 33