-
Notifications
You must be signed in to change notification settings - Fork 25
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
IfcGradient #550
base: tunnel
Are you sure you want to change the base?
IfcGradient #550
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that some local variables aren't properly defined. IfcGradient
function should be revised.
...ce definition data schemas/Schemas/IfcGeometryResource/Functions/IfcFactorial/Expression.txt
Show resolved
Hide resolved
...rce definition data schemas/Schemas/IfcGeometryResource/Functions/IfcGradient/Expression.txt
Outdated
Show resolved
Hide resolved
...rce definition data schemas/Schemas/IfcGeometryResource/Functions/IfcGradient/Expression.txt
Show resolved
Hide resolved
...rce definition data schemas/Schemas/IfcGeometryResource/Functions/IfcGradient/Expression.txt
Outdated
Show resolved
Hide resolved
...rce definition data schemas/Schemas/IfcGeometryResource/Functions/IfcGradient/Expression.txt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Further improvements suggestions :) I generally agree with the overall architecture of the function.
...rce definition data schemas/Schemas/IfcGeometryResource/Functions/IfcGradient/Expression.txt
Outdated
Show resolved
Hide resolved
...rce definition data schemas/Schemas/IfcGeometryResource/Functions/IfcGradient/Expression.txt
Outdated
Show resolved
Hide resolved
...rce definition data schemas/Schemas/IfcGeometryResource/Functions/IfcGradient/Expression.txt
Outdated
Show resolved
Hide resolved
I may be a bit confused here but shouldn't it be Segment.ParentCurve? |
What about .PARABOLICARC.? IfcPolynomialCurve? |
Should be easy. Just need to derive the equations. I did not get to it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Further clarification questions.
NextSegment : IfcCurveSegment := GradientCurve.Segments[i + 1]; | ||
Location : IfcCartesianPoint := NextSegment\IfcCurveSegment.Placement\IfcAxis2Placement2D.Location\IfcCartesianPoint; | ||
SegmentPlacement : IfcAxis2Placement2D := Segment.Placement\IfcAxis2Placement2D; | ||
SegDistAlong : IfcParameterValue := SegmentPlacement.Location\IfcCartesianPoint.Coordinates[1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels weird that the 1st element of IfcLengthMeasure
array would be assigned to a IfcParameterValue
. Should there be any conversion / length adjustments according to the dataset's units?
REPEAT i := 1 TO (SIZEOF(GradientCurve.Segments) - 1); | ||
Segment : IfcCurveSegment := GradientCurve.Segments[i]; | ||
NextSegment : IfcCurveSegment := GradientCurve.Segments[i + 1]; | ||
Location : IfcCartesianPoint := NextSegment\IfcCurveSegment.Placement\IfcAxis2Placement2D.Location\IfcCartesianPoint; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Propose to call it NextLocation
to clearly encode that it is the location of the next segment.
SegmentPlacement : IfcAxis2Placement2D := Segment.Placement\IfcAxis2Placement2D; | ||
SegDistAlong : IfcParameterValue := SegmentPlacement.Location\IfcCartesianPoint.Coordinates[1]; | ||
|
||
IF (Location.Coordinates[1] > Position) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comparison needs some attention. Currently it is comparing an IfcLengthMeasure
with an IfcCurveMeasureSelect
.
'IFCCLOTHOID' IN TYPEOF(Segment.ParentCurve) : | ||
BEGIN | ||
RETURN SegmentPlacement.Location\IfcCartesianPoint.Coordinates[2] + 3 ** -1 * Segment.SegmentLength ** 3 + (3 * IfcFactorial(7)) ** -1 * Segment.SegmentLength ** 7 + (5 * IfcFactorial(11)) ** -1 * Segment.SegmentLength ** 11; | ||
END; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All other equations take into account (Position - SegDistAlong)
, but I cannot see this here. Is this intentional?
|
||
'IFCLINE' IN TYPEOF(Segment.ParentCurve) : | ||
BEGIN | ||
RETURN SegmentPlacement.Location\IfcCartesianPoint.Coordinates[2] + Segment.ParentCurve\IfcLine.Pnt[2] + Segment.ParentCurve\IfcLine.Dir.Orientation.DirectionRatios[2] * Segment.ParentCurve\IfcLine.Dir.Magnitude * Segment.ParentCurve\IfcLine.Dir.Orientation.DirectionRatios[2] * (Position - SegDistAlong) / Segment.ParentCurve\IfcLine.Dir.Orientation.DirectionRatios[1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mutliplication with Segment.ParentCurve\IfcLine.Dir.Orientation.DirectionRatios[2]
happens twice. Intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improvements suggestions to the documentation of IfcGradientCurve.
@@ -1,3 +1,5 @@ | |||
Gradient curve is a type of curve 3D curve representation that is based on its 2D projection (BaseCurve) and a height deifned by its gradient segments which can be derived from a function that retrieves it from the segment start height, its placement and the ParentCurve instance and the type of the ParentCurve. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gradient curve is a type of curve 3D curve representation that is based on its 2D projection (BaseCurve) and a height deifned by its gradient segments which can be derived from a function that retrieves it from the segment start height, its placement and the ParentCurve instance and the type of the ParentCurve. | |
Gradient curve is a type of 3D curve representation that is based on its 2D projection (BaseCurve) and a height function (IfcGradient). The curve is defined on the curvilinear surface, with its first (horizontal) axis being the BaseCurve and the second (vertical) axis being perpendicular to the plane in which the BaseCurve lies. |
I would put the sentence about the gradient function into the documentation of the IfcGradient
function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation document is missing. Proposal for a first draft:
The IfcGradient function derives the height of any position (Position) along a IfcGradientCurve (GradientCurve). It iterates the gradient segments (GradientCurve.Segments) and retrieves the height from the segment's start height, segment's placement, and segment's ParentCurve instance and type.
Please treat as a basis for discussion. Do not review in detail. It is an idea. I do not even know whether the call of the function from
IfcGradientCurve
would work with this method signature.