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

IfcGradient #550

Draft
wants to merge 15 commits into
base: tunnel
Choose a base branch
from
Draft

IfcGradient #550

wants to merge 15 commits into from

Conversation

SergejMuhic
Copy link
Collaborator

@SergejMuhic SergejMuhic commented Mar 11, 2023

  1. adding IfcFactorial
  2. implementing IfcGradient

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.

@SergejMuhic SergejMuhic added the EXPRESS Issues or pull requests relating to EXPRESS schema label Mar 11, 2023
@SergejMuhic SergejMuhic requested review from larswik and pjanck March 11, 2023 14:39
@SergejMuhic SergejMuhic self-assigned this Mar 11, 2023
Copy link
Member

@pjanck pjanck left a 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.

Copy link
Member

@pjanck pjanck left a 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.

@larswik
Copy link
Collaborator

larswik commented Mar 13, 2023

I may be a bit confused here but shouldn't it be Segment.ParentCurve?

@larswik
Copy link
Collaborator

larswik commented Mar 13, 2023

What about .PARABOLICARC.? IfcPolynomialCurve?

@SergejMuhic
Copy link
Collaborator Author

What about .PARABOLICARC.? IfcPolynomialCurve?

Should be easy. Just need to derive the equations. I did not get to it.

@pjanck pjanck added the Legacy Issues stemming from before 2023.01.01. label Mar 15, 2023
Copy link
Member

@pjanck pjanck left a 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];
Copy link
Member

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;
Copy link
Member

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)
Copy link
Member

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.

Comment on lines +18 to +21
'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;
Copy link
Member

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];
Copy link
Member

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?

Copy link
Member

@pjanck pjanck left a 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link
Member

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.

@pjanck pjanck added the BucketA Content 4.3.2.0 or older label Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BucketA Content 4.3.2.0 or older EXPRESS Issues or pull requests relating to EXPRESS schema Legacy Issues stemming from before 2023.01.01.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants