Menu

How to create icf-fole with points ang triangles

Alexander
2020-09-26
2020-09-29
  • Alexander

    Alexander - 2020-09-26

    Please tell me how you can resolve the issue. In a python program, I have a description of a 3D figure. It is presented in the form of coordinates of points, which are combined into triangles. In fact, these are rectangular objects (walls).
    For example:
    Points:(1.,1.,1.),(1.,1.,-1.),(1.,-1.,1.),(1.,-1.,-1.)
    Triangles: (1,2,3),(4,2,1)[/i]

    how can i achieve automatic 3D shape formation in ICF format with use ifcopenshell(python)? I understand that I need to add coordinates and triangles.
    It seems clear with coordinates:
    [i]file.createIfcCartesianPoint (Coordinates = (1.0,1.5,2.0))[/i]
    And the triangles? I can roughly imagine that as a result in file it will probably look like this:

    17 = IfcIndexedPolygonalFace ((1,0,2,3))

    But what function of ifcopenshell should I form such a result?Thanks.

     

    Last edit: Alexander 2020-09-26
  • Alexander

    Alexander - 2020-09-29

    I have convert vertice and triangles of simple cube.. but its some strange here - all coordinates are wrong.
    points:
    [[array([0., 0., 0.]),
    array([1., 0., 0.]),
    array([0., 0., 1.]),
    array([1., 0., 1.]),
    array([0., 1., 0.]),
    array([1., 1., 0.]),
    array([0., 1., 1.]),
    array([1., 1., 1.])],
    triangles:
    [(4, 7, 5),
    (4, 6, 7),
    (0, 2, 4),
    (2, 6, 4),
    (0, 1, 2),
    (1, 3, 2),
    (1, 5, 7),
    (1, 7, 3),
    (2, 3, 7),
    (2, 7, 6),
    (0, 4, 1),
    (1, 4, 5)]
    ]

     
  • Alexander

    Alexander - 2020-09-29

    that is IFC file. I think, I was wrong with something parameters, which use to interpretating coordinates. But wich parameters..

     
  • Alexander

    Alexander - 2020-09-29

    ok, I have fund answer. Points indices are 1-indexed. So need increment all indices with one.
    More detailed here: https://github.com/IfcOpenShell/IfcOpenShell/issues/955

     

Log in to post a comment.