-
-
Notifications
You must be signed in to change notification settings - Fork 681
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
IfcSectionedSolidHorizontal #4433
Conversation
I'm going to merge this in to start a build, but comments still welcome :) |
Took me a little digging through the IFC to understand the image. There are 3 solids. One is along the gradient curve, one has a lateral offset of 50 at the end of the gradient curve, and one has a vertical offset at the mid-point. Yes? I see lots of IfcLinearPlacement and IfcPointByDistanceExpression. Cool! That seems to be working. @aothms Can you try this with an IfcOffsetCurveByDistances? IfcSegmentedReferenceCurve isn't going to work yet. That's still a work in progress. |
sectioned-solid-horizontal-ocbd.ifc.txt Seems to work! Awesome. (None of the other viewers I tried render something for this though...) I didn't realize though we already have logic for this interpolation. I also didn't realize the conceptual overlap between SectionedSolidHorizontal and OffsetCurveByDistances. They both are a curve with a list of linearly placed offsets. The only difference is that the solid also defines an equal-cardinality list of profiles. The code we wrote is a bit different. You have a really interesting approach of defining the offsets as another piecewise function and returning the composition of both. I just iterate over the curve domain, lookup the span I'm currently in, and then apply the offset by lerp'ing. The consequence of that is that I will probably never hit exactly the locations at which the profiles/offsets are defined. I assumed that's not a big problem. And would also be the case if I use your approach, because ultimately the spans are hidden at the call site. It also makes sense that our approaches are different, because you return a new piecewise function and I just use the evaluation to position the profiles. But good to be aware of the conceptual overlap maybe and something to revisit/harmonize later.
Yeah sorry, I was a bit in a rush. Yes for the offsets. Two of them also have a different end profile. |
Neither did I.
Interesting good or interesting bad - If you have an alternative, I'm open to making the implementation better. How are you making the IFC files and displaying them in Blender? (sorry, still bit of novice). Being able to visualize a solid might help me understand cant and whether or not I'm doing it right. |
Haha I don't know. I guess yours is computationally more efficient because you calculate the slope and multiplication is cheap. I'm lerping for every interpolated point. But maybe there is some overhead in your case for returning full matrices or std::function.
Mostly hand editing actually. If you have some files in mind that you want me to wrap a solid around I don't mind. I'm curious to have a look as well. |
I've got a program that exports bridge superstructure models that uses IfcSectionedSolidHorizontal. I just don't what tools (IfcConvert maybe?) and what options to use to create something that can be opened and visualized in Blender. |
IfcConvert v0.8 to convert to Collada .dae which can be imported easily in Blender.
for the curve geometry:
edit:
I didn't know you were that far already. That's really cool! |
Thanks - my IFC bridge models are pretty weak. I've got an IFCOS build going right now. As soon as it's done I'll generate a post a couple of models. They are precast, prestressed concrete bridges and post-tensioned spliced precast bridges. Deck, girders, traffic barriers, and prestress reinforcement only. |
Guess I'm not as far along as I thought - the beams, deck, and railings are coming out with decent geometry but their placement is a mess. This file has a bunch of errors when running through IfcConvert
I need to be way more efficient with the beam cross section as well. |
Are you sure you pulled the latest changes? IfcSectionedSolidHorizontal is exactly the scope of this PR. But yeah... we have some work todo. |
Oh my - that's embarrassing :) I've got your commits on v0.8 branch from 2/21 and 3/13-3/15. Fetching doesn't get any more commits. |
That seems ok, but then you really shouldn't get an error about No operation defined for IfcSectionedSolidHorizontal I also tried with IfcOpenBot@0d3c73d / https://s3.amazonaws.com/ifcopenshell-builds/IfcConvert-v0.8.0-0d3c73d-win64.zip and I don't get the error on the automated build either. |
I'm really stuck here with bridge models using IfcSectionedSolidHorizontal. I re-build and ran the INSTALL project from visual studio. This seems to have updated IfcConvert so the previous error for Using a fresh build of IfcConvert (also using the pre-built one) I get
That tells me I'm doing something wrong with the shape representation and representation contexts. Using your sectioned-solid-horizontal-multiple.ifc file as a guide, I updated my coding so the representation context, representation subcontext, and shape representations are the same. Using IfcConvert without the --plan option, there are no errors and no dae file created. With the --plan option I get the 'No operation defined for' error and no geometry. Any ideas? The attached is a more simple model than before - one span, 5 beams, straight, flat road. |
Is this an error in the IfcSectionedSolidHorizontal documentation?
If RefDirection is omitted in IfcAxis2PlacementLinear it defaults to the tangent of the curve. This would put the section profile x-axis along the curve making the sweep nonsensical. Maybe it should be the profile x-axis is aligned with the placement x-axis defined by the cross product of Axis and RefDirection. |
This is strange. For me that model fails on a null ObjectPlacement in the mapping of IfcProduct. And it's not an exception that can be caught. I've fixed it in here 4b32381 After that output looks like this on my end:
To be honest I just randomly tried a couple of axis permutations until it looked well, but maybe I should have had a proper look. At least linguistically it seems to make sense. X matches X. The other axis doesn't linear Z corresponds to profile Y. My problem is that I don't understand linear placement I guess.
But this is probably something to bring up with the IF again.. |
I should have run my file through the validation service. It found that issue. The bridge model is what I expected. Simple, but a step in the right direction. The attached files are:
With the --plan option there are 'Failed to convert' with 'No operation defined for' There is also a bunch of warnings about `No material and surface styles for' the IfcCompositeCurve, IfcGradientCurve, and IfcCurveSegment but I think this is expected. Without the --plan option there is a bunch of errors for Are there bugs here? sectioned-solid-horizontal.ifc.txt |
My problem is that I don't understand placement in general I guess. For sectioned-solid-horizontal.ifc file in the previous comment, I changed the shape of the cross section so the left side is really wide compared to the right side, when looking in the X-Y plane the section is defined in. I changed (-5,-1) to (-50,-1). I expected the wide side of the cross section to be on the left in the IfcSectionedSolidHorizontal but it was on the right. After reviewing the documentation, this is expected.
It seems that the profile X-axis maps to the linear placement Y-axis and the profile Y-axis maps to the linear placement Z-axis. Doing the right-hand rule cross product the profile normal is the profile Z-axis and is pointing out of the screen. For this axis to align with the linear placement X-axis the mirror image of the profile shape is projected along the curve. This brings me to the conclusion that the documentation in IfcSectionedSolidHorizontal is not correct.
This should be the profile normal is the direction of RefDirection from IfcAxis2PlacementLinear. There is still an open question in the IF about the default Axis and RefDirection buildingSMART/IFC4.x-IF#125 (comment). I'll ping the IF to see if there are any resolutions. |
Here is that first bridge model I sent you. Can you see how it converts and renders in Blender? I don't seem to get any geometry in Blender, but do in RDF and ODA. |
I think that's a good way to put it, but strictly speaking the profile is 2d, so even I perfectly understand what you mean, maybe it needs to be augmented a bit to indicate that this normal is obtained when embedding the 2d profile in 3d space. I would also add another clarification indicating that RefDirection is the curve tangent. I must say, I'm not getting more optimistic about the state of 4.3 support in software. But yeah, good news is compared to the rest, we, with 0 buget, are doing ok :) BimVision. A bit wobly ODA. Weird plates. rdf.bg. Only the beams. IfcOpenShell. Discontinuities in gradient curve. For us the problem appears to be in the gradient curve evaluation. In order for that to show up I had to uncomment the footprint. For some reason it takes priority for visualization. Multiple representation and the selection of curve/surface types is still not ideal in v0.8 as you also observed in the logs. If I comment out the footprint:
And then run
I get the discontinuous gradient curve to display in Blender. |
When you select it from the "outliner" (your image), on the 3d view menu select Frame selected. Make sure that you have reasonable clipping planes in the view menu as well. Use the little arrow to get to that menu if you don't see it.
But how come than the other viewers don't have the weird jumps? |
Thanks - I thought I tried Frame Selected, but obviously not. I don't have any real experience with Blender. Obviously, there is still more work to do. Being able to visualize the geometry will help tremendously.
Maybe I'm not doing the IFC coding and the IFCOS implement correctly in general. There could be offsetting errors that end up looking ok when I dump the piecewise function points and plot them in Excel. |
I hope this is a step in the right direction.
I've tested a bit on the following file, with makes the spec example a bit more interesting with various interpolations, and it seems to match my understanding of what it should look like. @civilx64 @RickBrice hope you can have a look, curious to hear your comments and questions.
sectioned-solid-horizontal-multiple.ifc.txt