B
by BIMrookie92 on 7 Aug 2022, edited 20 Aug 2022
#
+1 votes
Hi, see the attached .py script "ifcTest.txt" and the corresponding .ifc file "newTest.ifc" (stupid names, i know:p)
I am reading a rhino3dm file, which consist of a sphere brep, and I am trying to create a NURBS sphere in the .ifc file. I also tried to add a tesselated box as well, but neither the sphere nor box is working. Finally I add some reinforcingBars, just to make sure I am actually able to get something (*anything) to work, which it does.
I understand that the Python script is cumbersome to try to troubleshoot, but I am nonetheless including it alongside the resulting .ifc file, hoping that someone more experienced can perhaps take a glance at the .ifc file and tell me what I am missing since my geometry isnt showing up when importing to BlenderBIM?
Any help is appreciated:)
BR Sondre
B
by BIMrookie92 on 7 Aug 2022
#
+1 votes
OP again: I realized that I hadn't specified the "Coordinates" attribute for "IfcPolygonalFaceSet", so now the Box is working! (see attached updated .ifc file if of interest).
I guess I have done a similar mistake for the sphere, if one Nurbs surface and one nurbs egdecurve should be sufficient to describe the sphere in .ifc (it is sufficient in Rhino). Assuming the error is mine, I guess my question is altered to: Given the documentation for eg. IfcPolygonalFaceSet (https://standards.buildingsmart.org/IFC/DEV/IFC4_3/RC1/HTML/schema/ifcgeometricmodelresource/lexical/ifcpolygonalfaceset.htm), how do I know which attributes are mandatory and which aren't?
A
by aothms on 15 Aug 2022
#
+1 votes
I realized that I hadn't specified the "Coordinates" attribute for "IfcPolygonalFaceSet"
These kind of errors are more easily spotted using python -m ifcopenshell.validate <my_file.ifc>
to validate schema attribute cardinalities and types.
if one Nurbs surface and one nurbs egdecurve should be sufficient to describe the sphere in .ifc (it is sufficient in Rhino)
This depends a bit probably on implementation, but at least in Open CASCADE and hence IfcOpenShell, you'll need to fully bound the 2d parametric space, which means 4 "edges" with 2 edges degenerate in 3d and linear in 2d.
Periodic nurbs surfaces is not particularly well supported in most applications though and also needs more testing in ifopsh.
B
by BIMrookie92 on 15 Aug 2022, edited 15 Aug 2022
#
Wow, that was quite a neat command. Apparently I am missing a (very) large amount of Ifc Boolean arguments, which arent optional after all:p
And thanks for the OpenCASCADE explanation, I will try to fully bound my surfaces from now on. And be careful with periodic definitions...
May I ask about one specific feedback from ifcopenshell.validate:
'With attribute: attribute PredefinedType: <enumeration IfcReinforcingBarTypeEnum: (ANCHORING, EDGE, LIGATURE, MAIN, NOTDEFINED, PUNCHING, RING, SHEAR, STUD, USERDEFINED) Not optional
Are enumerations supposed to be given as strings or integers?
B
by BIMrookie92 on 19 Aug 2022, edited 19 Aug 2022
#
I really dont get nurbs, I looked at the advancedBasin.ifc example by geometryGym, I simplified my own shape into a single surface with 4 edges, I get no errors/warnings when validating the resulting .ifc file, but I am still not able to attach a shape to my wall...
Any suggestions?
M
by Moult on 20 Aug 2022
#
@BIMrookie92 enumerations are to be given as strings, e.g. "ANCHORING".
NURBs are rarely used in construction, so if you're after a tessellated box why don't you just use IfcPolygonalFaceSet? Alternatively, this is the function that converts the IfcBSplineSurfaceWithKnots into OpenCASACDE geometry that might help: https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/src/ifcgeom/IfcBSplineSurfaceWithKnots.cpp