Skip to content

Modeling - Add optimized point-to-plane projection helper for batch processing#959

Merged
dpasukhi merged 2 commits intoOpen-Cascade-SAS:IRfrom
dpasukhi:plane_project_points
Dec 26, 2025
Merged

Modeling - Add optimized point-to-plane projection helper for batch processing#959
dpasukhi merged 2 commits intoOpen-Cascade-SAS:IRfrom
dpasukhi:plane_project_points

Conversation

@dpasukhi
Copy link
Member

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces an optimized helper for projecting multiple 3D points onto a plane by pre-computing the plane basis and avoiding redundant gp_Trsf overhead for each point projection.

Key Changes:

  • Adds a new PlaneProjector struct that caches plane origin and direction components
  • Replaces two instances of ElSLib::Parameters calls with the optimized projector for batch pole projection

Comment on lines +61 to +63
double OX, OY, OZ; //!< Plane origin
double DXx, DXy, DXz; //!< X direction components
double DYx, DYy, DYz; //!< Y direction components
Copy link

Copilot AI Dec 26, 2025

Choose a reason for hiding this comment

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

Struct member fields should follow the FieldVariableName naming pattern according to OCCT conventions. These fields should be renamed: OXOriginX, OYOriginY, OZOriginZ, DXxXDirectionX, DXyXDirectionY, DXzXDirectionZ, DYxYDirectionX, DYyYDirectionY, DYzYDirectionZ.

Copilot generated this review using guidance from repository custom instructions.
//! Pre-computes plane basis for efficient batch projection of multiple points.
struct PlaneProjector
{
double OX, OY, OZ; //!< Plane origin
Copy link

Copilot AI Dec 26, 2025

Choose a reason for hiding this comment

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

Use Standard_Real instead of double for consistency with OCCT conventions. While Standard_Real is a typedef to double, using the OCCT type ensures consistency across the codebase and makes the code's intent clearer.

Copilot generated this review using guidance from repository custom instructions.
double DXx, DXy, DXz; //!< X direction components
double DYx, DYy, DYz; //!< Y direction components

//! Initialize from plane position.
Copy link

Copilot AI Dec 26, 2025

Choose a reason for hiding this comment

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

The constructor parameter thePos should be documented with a Doxygen comment explaining its purpose (e.g., @param thePos [in] plane coordinate system).

Suggested change
//! Initialize from plane position.
//! Initialize from plane position.
//! @param thePos [in] plane coordinate system defining origin and in-plane directions.

Copilot uses AI. Check for mistakes.
@dpasukhi dpasukhi merged commit b3e58b5 into Open-Cascade-SAS:IR Dec 26, 2025
24 checks passed
@dpasukhi dpasukhi deleted the plane_project_points branch December 26, 2025 11:03
@github-project-automation github-project-automation bot moved this from Todo to Done in Maintenance Dec 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants