You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. I have encountered a problem during loading a specific model, containing a lot of reinforcing bars. Bars geometry is defined using IfcSweptDiskSolid over curve IfcIndexedPolyCurve. After generating meshes all of them appeared trimmed.
Assemblies and versions affected:
I'm using my own fork of Xbim.Geometry based on 5.1.431, however I don't see any changes in relevant code base up to current 5.1.762 develop.
After some digging I found the reason fot this behaviour. To build the mesh with IfcSweptDiskSolid firstly the wire should be created. Is is created in method XbimSolid::CreateDirectrix(IIfcCurve^ directrix, Nullable<IfcParameterValue> startParam, Nullable<IfcParameterValue> endParam, Microsoft::Extensions::Logging::ILogger^ logger). As you can see, this method accepts two parameters for wire trimming. This method even has a useful link to this thread, which explains, that for composite curves the parameter values are calculated as a sum of parameter lengths of individual segments, where line segment has parameter length 1, and arc segments has parameter length equal to arc angle in degrees.
The problem is that in OpenCascade line segment wires are parameterized not from 0 to 1 as in IFC, but from 0 to segment length. So, if we have a composite wire containing a line segment with the length of 3 and an 90-degree arc, according to IFC this wire should have parametric length of 91 (90 degrees + 1 line), and in OpenCascade it would have length 93 (90 degrees + line length).
The CreateDirectrix method applies a special handling to IIfcCompositeCurves, recalculating parameter values to pass them to underlying OpenCascade objects, but it lacks the same handling for IIfcIndexedPolyCurves. I didn't check it, but it seems that the same problem should arise when using IfcPolyLine, because it has the same problems with parametrization.
I've managed to fix this problem in my fork (both images above are from my application), but I'm a bit hesitant to make a pull request because I'm not enirely happy with the implementation. However, it may be of some help to someone: xbimsolid.patch
The text was updated successfully, but these errors were encountered:
Hello. I have encountered a problem during loading a specific model, containing a lot of reinforcing bars. Bars geometry is defined using
IfcSweptDiskSolid
over curveIfcIndexedPolyCurve
. After generating meshes all of them appeared trimmed.Assemblies and versions affected:
I'm using my own fork of Xbim.Geometry based on 5.1.431, however I don't see any changes in relevant code base up to current 5.1.762 develop.
Minimal file to reproduce the issue:
bar.stripped.ifc.zip
Expected behavior:
I expect the bar to look like this:
Actual behavior or exception details:
Actually generated mesh:
Additional Details
After some digging I found the reason fot this behaviour. To build the mesh with
IfcSweptDiskSolid
firstly the wire should be created. Is is created in methodXbimSolid::CreateDirectrix(IIfcCurve^ directrix, Nullable<IfcParameterValue> startParam, Nullable<IfcParameterValue> endParam, Microsoft::Extensions::Logging::ILogger^ logger)
. As you can see, this method accepts two parameters for wire trimming. This method even has a useful link to this thread, which explains, that for composite curves the parameter values are calculated as a sum of parameter lengths of individual segments, where line segment has parameter length 1, and arc segments has parameter length equal to arc angle in degrees.The problem is that in OpenCascade line segment wires are parameterized not from 0 to 1 as in IFC, but from 0 to segment length. So, if we have a composite wire containing a line segment with the length of 3 and an 90-degree arc, according to IFC this wire should have parametric length of 91 (90 degrees + 1 line), and in OpenCascade it would have length 93 (90 degrees + line length).
The
CreateDirectrix
method applies a special handling toIIfcCompositeCurve
s, recalculating parameter values to pass them to underlying OpenCascade objects, but it lacks the same handling forIIfcIndexedPolyCurve
s. I didn't check it, but it seems that the same problem should arise when usingIfcPolyLine
, because it has the same problems with parametrization.I've managed to fix this problem in my fork (both images above are from my application), but I'm a bit hesitant to make a pull request because I'm not enirely happy with the implementation. However, it may be of some help to someone:
xbimsolid.patch
The text was updated successfully, but these errors were encountered: