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

Brep solid from IfcFace #2669

Closed
BIM4SmartHydropower opened this issue Jan 1, 2023 · 10 comments
Closed

Brep solid from IfcFace #2669

BIM4SmartHydropower opened this issue Jan 1, 2023 · 10 comments

Comments

@BIM4SmartHydropower
Copy link

Hi, I'm trying to build a Brep solid model using IfcClosedShell with IfcFace.
Here, I'm trying to build a cylinder with two circle face.
But only a line between the two face.
I can't understand why this happened.

image

DATA;
#1= IFCCARTESIANPOINT((0.0,0.0,0.0));
#2= IFCAXIS2PLACEMENT3D(#1,$,$);
#3= IFCLOCALPLACEMENT($,#2);
#4= IFCSITE('0VKAP6rTz2ShuN$ciJ6wK6',#10,'IfcBuilding',$,$,#3,$,$,$,$,$,$,$,$);
#5= IFCPERSON('z','z',$,$,$,$,$,$);
#6= IFCORGANIZATION($,'Unknown',$,$,$);
#7= IFCPERSONANDORGANIZATION(#5,#6,$);
#8= IFCORGANIZATION($,'z',$,$,$);
#9= IFCAPPLICATION(#8,' v0.0.0.0','z v0.0.0.0','z');
#10= IFCOWNERHISTORY(#7,#9,$,.ADDED.,1672560076,$,$,1672560076);
#11= IFCPROJECT('3WXApcVrnEHgKLbX9sn_Mo',#10,'project',$,$,$,$,(#64),#12);
#12= IFCUNITASSIGNMENT((#13,#14,#15,#16,#17));
#13= IFCSIUNIT(,.LENGTHUNIT.,.MILLI.,.METRE.);
#14= IFCSIUNIT(
,.AREAUNIT.,$,.SQUARE_METRE.);
#15= IFCSIUNIT(,.VOLUMEUNIT.,$,.CUBIC_METRE.);
#16= IFCSIUNIT(
,.PLANEANGLEUNIT.,$,.RADIAN.);
#17= IFCSIUNIT(,.TIMEUNIT.,$,.SECOND.);
#18= IFCRELAGGREGATES('3qiJ22pJcUN6F7LHvRbTER',#10,$,$,#11,(#4));
#19= IFCCARTESIANPOINT((0.0,0.0,0.0));
#20= IFCAXIS2PLACEMENT3D(#19,$,$);
#21= IFCLOCALPLACEMENT(#3,#20);
#22= IFCBUILDING('1$wE87ocTE0wvBKXyRahxq',#10,'building',$,$,#21,$,$,$,$,$,$);
#23= IFCRELAGGREGATES('3XIInA3l3qOVSoUB_JNfyI',#10,$,$,#4,(#22));
#24= IFCCARTESIANPOINT((0.0,0.0,0.0));
#25= IFCAXIS2PLACEMENT3D(#24,$,$);
#26= IFCLOCALPLACEMENT(#21,#25);
#27= IFCBUILDINGSTOREY('04hBSO5cvCuPStJMy8qlYR',#10,'z',$,$,#26,$,$,$,0.0);
#28= IFCRELAGGREGATES('20auq7tph7lbArc44PVccz',#10,$,$,#22,(#27));
#29= IFCDIRECTION((0.0,0.0,1.0));
#30= IFCDIRECTION((0.0,1.0,0.0));
#31= IFCDIRECTION((0.0,0.0,1.0));
#32= IFCCARTESIANPOINT((-116000000.0,-32603000.00001,548000000.0));
#33= IFCAXIS2PLACEMENT3D(#32,#30,#31);
#34= IFCDIRECTION((1.0,0.0,0.0));
#35= IFCELLIPSE(#33,2700600.0,2700600.0);
#36= IFCCARTESIANPOINT((-116000000.0,-32603000.00001,550700600.0));
#37= IFCVERTEXPOINT(#36);
#38= IFCCARTESIANPOINT((-116000000.0,-32603000.00001,550700600.0));
#39= IFCVERTEXPOINT(#38);
#40= IFCEDGECURVE(#37,#39,#35,.T.);
#41= IFCORIENTEDEDGE(
,,#40,.T.);
#42= IFCEDGELOOP((#41));
#43= IFCFACEOUTERBOUND(#42,.T.);
#44= IFCFACE((#43));
#45= IFCDIRECTION((0.0,-1.0,0.0));
#46= IFCDIRECTION((0.0,0.0,1.0));
#47= IFCCARTESIANPOINT((-116000000.0,-32603000.00001,548000000.0));
#48= IFCAXIS2PLACEMENT3D(#47,#45,#46);
#49= IFCELLIPSE(#48,2700000.0,2700000.0);
#50= IFCCARTESIANPOINT((-116000000.0,-32603000.00001,550700000.0));
#51= IFCVERTEXPOINT(#50);
#52= IFCCARTESIANPOINT((-116000000.0,-32603000.00001,550700000.0));
#53= IFCVERTEXPOINT(#52);
#54= IFCEDGECURVE(#51,#53,#49,.T.);
#55= IFCORIENTEDEDGE(
,,#54,.T.);
#56= IFCEDGELOOP((#41,#55));
#57= IFCFACEOUTERBOUND(#56,.T.);
#58= IFCFACE((#57));
#59= IFCCARTESIANPOINT((0.0,0.0,0.0));
#60= IFCAXIS2PLACEMENT3D(#59,$,$);
#61= IFCLOCALPLACEMENT($,#60);
#62= IFCCONNECTEDFACESET((#44,#58));
#63= IFCFACEBASEDSURFACEMODEL((#62));
#64= IFCGEOMETRICREPRESENTATIONCONTEXT($,'Model',3,0.0001,#66,#67);
#65= IFCCARTESIANPOINT((0.0,0.0,0.0));
#66= IFCAXIS2PLACEMENT3D(#65,$,$);
#67= IFCDIRECTION((0.0,1.0));
#68= IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Body','Model',
,,,,#64,$,.MODEL_VIEW.,$);
#69= IFCSHAPEREPRESENTATION(#68,'Body','SurfaceModel',(#63));
#70= IFCPRODUCTDEFINITIONSHAPE($,$,(#69));
#71= IFCBUILDINGELEMENTPROXY('3XFe1oV$fFfx_XoYE7OYac',#10,'GroupedHole.MSElementType.Ellipse',$,$,#61,#70,$,$);
#72= IFCRELCONTAINEDINSPATIALSTRUCTURE('0s4v2wTlDa0YAkCWPMn9_a',#10,'BuildingStorey','BuildingStorey Container for Elements',(#71,#108,#150,#192,#200),#27);
#73= IFCDIRECTION((0.0,-1.0,0.0));
#74= IFCDIRECTION((0.0,0.0,1.0));
#75= IFCCARTESIANPOINT((-116000000.0,-125602999.99998,548000000.0));
#76= IFCAXIS2PLACEMENT3D(#75,#73,#74);
#77= IFCELLIPSE(#76,2700600.0,2700600.0);
#78= IFCCARTESIANPOINT((-116000000.0,-125602999.99998,550700600.0));
#79= IFCVERTEXPOINT(#78);
#80= IFCCARTESIANPOINT((-116000000.0,-125602999.99998,550700600.0));
#81= IFCVERTEXPOINT(#80);
#82= IFCEDGECURVE(#79,#81,#77,.T.);
#83= IFCORIENTEDEDGE(
,,#82,.T.);
#84= IFCEDGELOOP((#83));
#85= IFCFACEOUTERBOUND(#84,.T.);
#86= IFCFACE((#85));
#87= IFCDIRECTION((0.0,1.0,0.0));
#88= IFCDIRECTION((0.0,0.0,1.0));
#89= IFCCARTESIANPOINT((-116000000.0,-125602999.99998,548000000.0));
#90= IFCAXIS2PLACEMENT3D(#89,#87,#88);
#91= IFCELLIPSE(#90,2700000.0,2700000.0);
#92= IFCCARTESIANPOINT((-116000000.0,-125602999.99998,550700000.0));
#93= IFCVERTEXPOINT(#92);
#94= IFCCARTESIANPOINT((-116000000.0,-125602999.99998,550700000.0));
#95= IFCVERTEXPOINT(#94);
#96= IFCEDGECURVE(#93,#95,#91,.T.);
#97= IFCORIENTEDEDGE(
,,#96,.T.);
#98= IFCEDGELOOP((#83,#97));
#99= IFCFACEOUTERBOUND(#98,.T.);
#100= IFCFACE((#99));
#101= IFCCARTESIANPOINT((0.0,0.0,0.0));
#102= IFCAXIS2PLACEMENT3D(#101,$,$);
#103= IFCLOCALPLACEMENT($,#102);
#104= IFCCONNECTEDFACESET((#86,#100));
#105= IFCFACEBASEDSURFACEMODEL((#104));
#106= IFCSHAPEREPRESENTATION(#68,'Body','SurfaceModel',(#105));
#107= IFCPRODUCTDEFINITIONSHAPE($,$,(#106));
#108= IFCBUILDINGELEMENTPROXY('2$tiqXoTnDYBbRA3Btt9VI',#10,'GroupedHole.MSElementType.Ellipse',$,$,#103,#107,$,$);
#109= IFCDIRECTION((0.0,-1.0,0.0));
#110= IFCDIRECTION((0.0,0.0,1.0));
#111= IFCCARTESIANPOINT((-116000000.0,-32603000.0,548000000.0));
#112= IFCAXIS2PLACEMENT3D(#111,#109,#110);
#113= IFCCIRCLE(#112,2700600.0);
#114= IFCCARTESIANPOINT((-116000000.0,-32603000.0,550700600.0));
#115= IFCVERTEXPOINT(#114);
#116= IFCCARTESIANPOINT((-116000000.0,-32603000.0,550700600.0));
#117= IFCVERTEXPOINT(#116);
#118= IFCCARTESIANPOINT((-116000000.0,-32603000.0,550700600.0));
#119= IFCCARTESIANPOINT((-116000000.0,-32603000.0,550700600.0));
#120= IFCTRIMMEDCURVE(#113,(#118),(#119),.T.,.CARTESIAN.);
#121= IFCEDGECURVE(#115,#117,#120,.T.);
#122= IFCORIENTEDEDGE(
,,#121,.T.);
#123= IFCEDGELOOP((#122));
#124= IFCFACEOUTERBOUND(#123,.T.);
#125= IFCFACE((#124));
#126= IFCDIRECTION((0.0,1.0,0.0));
#127= IFCDIRECTION((0.0,0.0,1.0));
#128= IFCCARTESIANPOINT((-116000000.0,-125603000.0,548000000.0));
#129= IFCAXIS2PLACEMENT3D(#128,#126,#127);
#130= IFCCIRCLE(#129,2700600.0);
#131= IFCCARTESIANPOINT((-116000000.0,-125603000.0,550700600.0));
#132= IFCVERTEXPOINT(#131);
#133= IFCCARTESIANPOINT((-116000000.0,-125603000.0,550700600.0));
#134= IFCVERTEXPOINT(#133);
#135= IFCCARTESIANPOINT((-116000000.0,-125603000.0,550700600.0));
#136= IFCCARTESIANPOINT((-116000000.0,-125603000.0,550700600.0));
#137= IFCTRIMMEDCURVE(#130,(#135),(#136),.T.,.CARTESIAN.);
#138= IFCEDGECURVE(#132,#134,#137,.T.);
#139= IFCORIENTEDEDGE(
,,#138,.T.);
#140= IFCEDGELOOP((#122,#139));
#141= IFCFACEOUTERBOUND(#140,.T.);
#142= IFCFACE((#141));
#143= IFCCARTESIANPOINT((0.0,0.0,0.0));
#144= IFCAXIS2PLACEMENT3D(#143,$,$);
#145= IFCLOCALPLACEMENT($,#144);
#146= IFCCONNECTEDFACESET((#125,#142));
#147= IFCFACEBASEDSURFACEMODEL((#146));
#148= IFCSHAPEREPRESENTATION(#68,'Body','SurfaceModel',(#147));
#149= IFCPRODUCTDEFINITIONSHAPE($,$,(#148));
#150= IFCBUILDINGELEMENTPROXY('0VMqD95ef0hg2bt7Hi2sZQ',#10,'SmartSurface.MSElementType.Arc',$,$,#145,#149,$,$);
#151= IFCDIRECTION((0.0,-1.0,0.0));
#152= IFCDIRECTION((0.0,0.0,1.0));
#153= IFCCARTESIANPOINT((-116000000.0,-32603000.0,548000000.0));
#154= IFCAXIS2PLACEMENT3D(#153,#151,#152);
#155= IFCCIRCLE(#154,2700000.0);
#156= IFCCARTESIANPOINT((-116000000.0,-32603000.0,550700000.0));
#157= IFCVERTEXPOINT(#156);
#158= IFCCARTESIANPOINT((-116000000.0,-32603000.0,550700000.0));
#159= IFCVERTEXPOINT(#158);
#160= IFCCARTESIANPOINT((-116000000.0,-32603000.0,550700000.0));
#161= IFCCARTESIANPOINT((-116000000.0,-32603000.0,550700000.0));
#162= IFCTRIMMEDCURVE(#155,(#160),(#161),.T.,.CARTESIAN.);
#163= IFCEDGECURVE(#157,#159,#162,.T.);
#164= IFCORIENTEDEDGE(
,,#163,.T.);
#165= IFCEDGELOOP((#164));
#166= IFCFACEOUTERBOUND(#165,.T.);
#167= IFCFACE((#166));
#168= IFCDIRECTION((0.0,1.0,0.0));
#169= IFCDIRECTION((0.0,0.0,1.0));
#170= IFCCARTESIANPOINT((-116000000.0,-125603000.0,548000000.0));
#171= IFCAXIS2PLACEMENT3D(#170,#168,#169);
#172= IFCCIRCLE(#171,2700000.0);
#173= IFCCARTESIANPOINT((-116000000.0,-125603000.0,550700000.0));
#174= IFCVERTEXPOINT(#173);
#175= IFCCARTESIANPOINT((-116000000.0,-125603000.0,550700000.0));
#176= IFCVERTEXPOINT(#175);
#177= IFCCARTESIANPOINT((-116000000.0,-125603000.0,550700000.0));
#178= IFCCARTESIANPOINT((-116000000.0,-125603000.0,550700000.0));
#179= IFCTRIMMEDCURVE(#172,(#177),(#178),.T.,.CARTESIAN.);
#180= IFCEDGECURVE(#174,#176,#179,.T.);
#181= IFCORIENTEDEDGE(
,*,#180,.T.);
#182= IFCEDGELOOP((#164,#181));
#183= IFCFACEOUTERBOUND(#182,.T.);
#184= IFCFACE((#183));
#185= IFCCARTESIANPOINT((0.0,0.0,0.0));
#186= IFCAXIS2PLACEMENT3D(#185,$,$);
#187= IFCLOCALPLACEMENT($,#186);
#188= IFCCONNECTEDFACESET((#167,#184));
#189= IFCFACEBASEDSURFACEMODEL((#188));
#190= IFCSHAPEREPRESENTATION(#68,'Body','SurfaceModel',(#189));
#191= IFCPRODUCTDEFINITIONSHAPE($,$,(#190));
#192= IFCBUILDINGELEMENTPROXY('3dJ7pAuDP4I9e1nxwBqJPG',#10,'SmartSurface.MSElementType.Arc',$,$,#187,#191,$,$);
#193= IFCCLOSEDSHELL((#44,#58,#86,#100,#125,#142,#167,#184));
#194= IFCADVANCEDBREP(#193);
#195= IFCSHAPEREPRESENTATION(#68,'Body','AdvancedBrep',(#194));
#196= IFCPRODUCTDEFINITIONSHAPE($,$,(#195));
#197= IFCCARTESIANPOINT((0.0,0.0,0.0));
#198= IFCAXIS2PLACEMENT3D(#197,$,$);
#199= IFCLOCALPLACEMENT($,#198);
#200= IFCBUILDINGELEMENTPROXY('3Ztb3a4fb5a90ejhnqx5Me',#10,'NOTDEFINED',$,$,#199,#196,$,$);
#201= IFCCLOSEDSHELL((#44,#58,#86,#100,#125,#142,#167,#184));
#202= IFCADVANCEDBREP(#201);
ENDSEC;

@theoryshaw
Copy link
Member

see following ifc file, to see hierarchies...
testy_commented.ifc.txt

@aothms
Copy link
Member

aothms commented Jan 1, 2023

Please attach a full reproducible file as a .txt file and let us know how you import the model. Where and how does the line appear?

  • The huge coordinates don't help, you'll more easily get into precision issues projecting the vertex coords onto the edge curves. Add the transformation to the placement of the object.
  • No reason to use a trimmed curve as the edge geometry (not sure if it's supported in ifcopenshell), use the underlying curve and trimming happens as part of the topology (vertex coords).

@BIM4SmartHydropower
Copy link
Author

1、Here is the tested ifc file.
And the parsed tool is the Ifcviewer supported by ifcrdf.
cylinderBrep.ifc.txt
By the way, the tested ifc file is a hollow cylinder.
image

2、I`ve seen the cylinder build by Opencascade using brep.
The brep solid is made by three wires, which named #w4 #w6 #w8, which could be seen bellow.
image

3、However, when I parsed the solid model of the hollow cylinder.
Ive found 4 Face of Brep solid. For the upper or lower face which is made up of two circle. For the outer and inner body of cylinder, Ive parsed the solid, and only two circle (the edges for the outer/inner one) was found for each one.

4、All the Face model, and the whole Brep solid model was included in the Ifc file.

@BIM4SmartHydropower
Copy link
Author

I'm not 100% certain, but could it be that the IFCADVANCEDBREP entity is not connected to the IFCSHAPEREPRESENTATION entity?

Sorry, the last few lines are wrone output.

@BIM4SmartHydropower
Copy link
Author

Where and how does the line appear?

As a matter of fact, there is no line in the IFC output file.
I guess it is the result of the IfcClosedShell of two circles.

@aothms
Copy link
Member

aothms commented Jan 2, 2023

afbeelding

I get the same result in IfcOpenShell. The edgeloop you supply for the side face is purely degenerate because you don't have the 2d parametric space as I mentioned in #2666

afbeelding

Maybe @peterrdf has an example of a brep cylinder that works in his toolkit. Tbh adv brep is rather new still in the ifc world and I don't know what good conventions for edges in terms of 2d-only, 2d + 3d, etc.

@peterrdf
Copy link

peterrdf commented Jan 2, 2023

In my perception the following goes wrong in the example file.
The outer polygons are defined, however the actual surface is not defined, what you actually would like to define (if I understood correctly) is an Advanced Face, in this case based on a Cylindrical Surface. So from modelling point of view the base surface definition is missing (there is an exception when normally a plane is expected, in such cases we can define just the polygons / profiles).
So the base geometrical types to check are:
https://standards.buildingsmart.org/IFC/RELEASE/IFC4/ADD2_TC1/HTML/link/ifcadvancedface.htm
https://standards.buildingsmart.org/IFC/RELEASE/IFC4/ADD2_TC1/HTML/link/ifccylindricalsurface.htm

For examples see also:
https://github.com/buildingSMART/Sample-Test-Files/tree/master/IFC%204.0/NURBS/Bentley%20Building%20Designer/Faces

I hope this helps.

@aothms
Copy link
Member

aothms commented Jan 2, 2023

Oh yes, I completely missed that. This indeed requires IfcAdvancedBRep with IfcAdvancedFace.

@BIM4SmartHydropower
Copy link
Author

In my perception the following goes wrong in the example file. The outer polygons are defined, however the actual surface is not defined, what you actually would like to define (if I understood correctly) is an Advanced Face, in this case based on a Cylindrical Surface. So from modelling point of view the base surface definition is missing (there is an exception when normally a plane is expected, in such cases we can define just the polygons / profiles). So the base geometrical types to check are: https://standards.buildingsmart.org/IFC/RELEASE/IFC4/ADD2_TC1/HTML/link/ifcadvancedface.htm https://standards.buildingsmart.org/IFC/RELEASE/IFC4/ADD2_TC1/HTML/link/ifccylindricalsurface.htm

For examples see also: https://github.com/buildingSMART/Sample-Test-Files/tree/master/IFC%204.0/NURBS/Bentley%20Building%20Designer/Faces

I hope this helps.

afbeelding

I get the same result in IfcOpenShell. The edgeloop you supply for the side face is purely degenerate because you don't have the 2d parametric space as I mentioned in #2666

afbeelding

Maybe @peterrdf has an example of a brep cylinder that works in his toolkit. Tbh adv brep is rather new still in the ifc world and I don't know what good conventions for edges in terms of 2d-only, 2d + 3d, etc.

Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants