Hey all, we're planning to migrate servers around Monday, so there will be a bit of downtime :) I can be contacted at dion@thinkmoult.com for anything urgent.

IfcRationalBSplineSurfaceWithKnots

Hi,
I am trying to create some BSplineSurfaces using ifcopenshell and geometry from rhino/grasshopper. The bSplineCurves are written succesfully to the .ifc, but the bSplineSurface's doesnt show up.
Attached are a .py file with .txt ending in order to upload it here on the forum, and the resulting .ifc file. The .py is self contained and should run on any other computer. It is a bit messy, but I am simply testing different geometries.
If anyone has any advice on what is missing in order for the surface itself, and not just its edgeCurves, to show up when I open the file using BlenderBIM, I would really appreciate it:)
BR Sondre

Comments


  • This is what it looks like, planar bsplinesurfaces show up, but not anything else. Each surface is "framed" by its edgecurves represented as sweptdiscsolids, in order to ensure the error is indeed with the surfaces..

    Gorgious
  • I haven't delved into it, but IfcConvert states the following:

    Log:
    [Error] [2023-05-26 08:30:07] {1xbzRGHUr7eR7gsQLZZ4kM} Error in: Geom_BSplineSurface: # U Poles and degree mismatch
    Failed to convert:
    #65=IfcRationalBSplineSurfaceWithKnots(2,1,((#59,#60,#61),(#62,#63,#64)),.UNSPECIFIED.,.F.,.F.,.F.,(3,3),(2,2),(0.,14.2857620433298),(0.,22.8647328647036),.UNSPECIFIED.,((1.,0.875839554606016,1.),(1.,0.875839554606016,1.)))
    [Error] [2023-05-26 08:30:07] {1xbzRGHUr7eR7gsQLZZ4kM} Failed to convert:
    #107=IfcClosedShell((#106))
    [Error] [2023-05-26 08:30:14] {3U_abyZt57_uI81_osnZKZ} Error in: Geom_BSplineSurface: # U Poles and degree mismatch
    Failed to convert:
    #256=IfcRationalBSplineSurfaceWithKnots(3,1,((#246,#247,#248,#249,#250),(#251,#252,#253,#254,#255)),.UNSPECIFIED.,.F.,.F.,.F.,(4,1,4),(2,2),(0.,6.52713044939322,14.4397363647717),(0.,14.3760814994358),.UNSPECIFIED.,((1.,1.,1.,1.,1.),(1.,1.,1.,1.,1.)))
    [Error] [2023-05-26 08:30:14] {3U_abyZt57_uI81_osnZKZ} Failed to convert:
    #290=IfcClosedShell((#289))
    [Error] [2023-05-26 08:30:15] {1w6px8k8z4BfccszTRh8Mj} Error in: Geom_BSplineSurface: # U Poles and degree mismatch
    Failed to convert:
    #317=IfcRationalBSplineSurfaceWithKnots(2,1,((#311,#312,#313),(#314,#315,#316)),.UNSPECIFIED.,.T.,.T.,.F.,(3,3),(2,2),(0.,78.1972451294613),(0.,15.447340124377),.UNSPECIFIED.,((1.,1.,1.),(1.,1.,1.)))
    [Error] [2023-05-26 08:30:15] {1w6px8k8z4BfccszTRh8Mj} Failed to convert:
    #359=IfcClosedShell((#358))
    

    This issue might be helpful, since the "poles and degree mismatch" error also appears.

    Lastly, some weeks ago I constructed some easier IfcBSplineSurfaceWithKnots (without weights). Maybe it can help.

    ArvBIMrookie92
  • I just realized the mismatch myself, when comparing with the advancedCube.ifc example found online, that I needed to flip degreeU/V and knotMultiplicationsU/V, and now it works:D
    Are you using IfcConvert from BlenderBIM or inside a .py script? I tried to validate the resulting .ifc file using ifcopenshell.validate, but it found no errors (the lines are included in my uploaded .py script in this thread). Could you perhaps link to an example using IfcConvert, or some online resource? It gave quite valuable feedback as you demonstrated above:)
    I will also look into your bSplineSurface's! Thank you for your help:)
    BR Sondre

  • Nice that you sorted it out! I just used IfcConvert from the CLI attempting to convert to an *.obj:
    IfcConvert /path/to/input.ifc /path/to/output.obj
    The full docs are here 😉:
    https://blenderbim.org/docs-python/ifcconvert/usage.html

  • @cvillagrasa, I really like the way that you have created multiple entities through file.create_entity(). I see that this is used for creating entities like IfcBSplineSurfaceWithKnots, IfcBSplineCurveWithKnots , IfcVertexPoint, ....
    Is this part of high level ifcopenshell api? Are there any documentation available?
    Could you point me to the api reference or source for creating these entities.

  • Hi @Arv , thanks! Actually, the base create_entity corresponds to the classic low level IfcOpenShell API. Some documentation can be found in the Hello World. The rule of thumb should be to try to use the high level API as much as possible, since it's easier, it deals with ownership, global IDs and a bunch of other stuff, so it minimizes errors. And look, just now that I say it... I think I missed to add global IDs 😅 in that example, I might need to fix it. I didn't notice because it worked alright in BlenderBIM and IFC.js, and didn't trigger validation errors.

    In any case, once you're dealing with entities directly, the documentation to consult becomes the bSI one. For instance, in order to assemble the advanced Brep for the IfcBSplineSurfaceWithKnots, I had a look at this diagram (found here):

    ArvCoenBIMrookie92
  • edited May 2023

    Looks exciting !

    I try model the Ron Champ on FreeCAD (which use OpenCascade the same engine as IfcOpenShell) with the Surface / Curve WB, only half-way experiment more than one year ago, not sure what kind of surface it belong. Trying to export to IFC. And tested viewing on IfcOpenShell Viewer - toggle the engine. A few screencaptures on FreeCAD / IfcOpenShell Viewer, and some *.IFC files attached if interested.

    FreeCAD -

    IfcOpenShell Viewer - Toggled Engine

    cvillagrasatheoryshaw
  • There are peoples who did pretty good curve surface in FreeCAD, recently on did an Aston Marton DB11
    https://forum.freecad.org/viewtopic.php?t=78331&start=10
    Curious if these kinds of surface is supported in IFC ?

  • Checking the exported IFC (reimported via NativeIFC in FreeCAD and examined with Show Geometry Tree)

    Found "IfcFactedBrep" for all the 3 surfaces - so seems FreeCAD exported the curve surface faceted. And now the surfaces are full of triangulated faces and edges select-able, instead of the original smooth curve surfaces.

    @yorik any comments? Thanks.



  • if you export this using the IfcOpenShell serializer (enable it in IFC preferences), i think the NURBS surfaces should be supported

    paullee
  • Thanks @yorik ! Very cool, it seems working :D

    1. The exported *.ifc re-imported into FreeCAD (with Native IFC support) and show the original curve surfaces.
    2. However, the IfcOpenShell Viewer seems not supporting (yet) ? (Toggle engine does not help)
      @aothms, any comments on the IfcOpenShell Viewer support on NURBS?


  • just for fun...

    paulleeBIMrookie92NigelAce
  • edited June 2023

    Not exactly same, simulated by One Side Lighting + FreeCAD FEM workbench Clipping Plane - :D

    https://youtu.be/DNMTR2Y40eU

  • However, the IfcOpenShell Viewer seems not supporting (yet) ? (Toggle engine does not help)
    @aothms, any comments on the IfcOpenShell Viewer support on NURBS?

    No, toggle engine is only in the frontend bit. They operate on the same triangulation obtained from IfcConvert. If a recent IfcConvert conversion does better than view.ifcopenshell on the server I will update it. Can you help check?

    paullee
  • edited May 2023

    Thanks @aothms
    As Yorik indicated, the surfaces are supported without triangulation using the 'IfcOpenShell Serializer'. Not sure if is is related to IfcConvert.
    You want me to test the model again when you update the IfcConvert version right? Please tell me when you are ready.

    Edit - Not sure what in O.P. IfcRationalBSplineSurfaceWithKnots is, and what IfcOpenShell supports ?

  • You want me to test the model again when you update the IfcConvert version right?

    I haven't done any work on this recently. The version runnning on view.ifcopenshell.org is https://github.com/IfcOpenShell/IfcOpenShell/commit/fa6bbf2 I meant simply trying the latest ifcconvert that is available now.

    Just trying to understand why it works in freecad and not view.ifcopenshell.org

    paullee
  • This is @paullee's file converted to .obj with IfcConvert and opened in Blender:

    So apparently IfcConvert works fine... The issue on the ifcopenshell viewer seems more like a renderer problem, like some faces have wrong normals... And indeed when reopening the file in FreeCAD with NativeIFC, you can see the black faces, that indicate normals pointing elsewhere, on the same faces that give problems in the viewer:

    Of course when modelling BIM stuff we tend to work mostly with solids, but I guess the more versatile IFC files will be, the more they will include non-solid stuff too.. Maybe there is a "render both sides" switch that can be enabled on the viewer?

    paullee
  • edited June 2023

    @yorik No, there is no Normal nor Triangulation problem re-importing back to FreeCAD the ifc exported using the IfcOpenShell Serializer

    See my screen capture on May 28 : )

  • Learnt to produce animated gif -

    • FreeCAD FEM workbench Clipping Plane + One Side Lighting

    theoryshaw
  • @yorik I use AppImage version (unzipped into directory) of FC_0.21 pre which included IfcOpenShell. Can import ifcopenshell under FC's python console. Can use IfcConvert somehow ? Thanks again .

  • I am not sure IfcConvert is bundled with the AppImage of FreeCAD. But you can download it from http://ifcopenshell.org/downloads.html

    paullee
Sign In or Register to comment.