Skip to content

Data Exchange, Step Export - Apply a scaling transformation#513

Merged
dpasukhi merged 1 commit intoOpen-Cascade-SAS:IRfrom
ikochetkova:ocp1949_ika
May 12, 2025
Merged

Data Exchange, Step Export - Apply a scaling transformation#513
dpasukhi merged 1 commit intoOpen-Cascade-SAS:IRfrom
ikochetkova:ocp1949_ika

Conversation

@ikochetkova
Copy link
Copy Markdown
Contributor

@ikochetkova ikochetkova commented May 7, 2025

Adding a scaling factor check and export in the geometry transformation code.
Updating parameter and configuration interfaces (DESTEP) to support a new flag (WriteScalingTrsf).
Introducing a new GeomToStep_MakeCartesianTransformationOperator class to create the transformation operator when scaling is active.
Add option (enabled by default) to export scaling factor to the STEP file as cartesian_transformation_operator_3d.
The issue came from OCP-1949; see there for more information and examples

@ikochetkova ikochetkova requested a review from dpasukhi May 7, 2025 15:27
@dpasukhi dpasukhi changed the title Apply a scaling transformation to STEP Export Data Exchange, Step Export - Apply a scaling transformation May 7, 2025
@dpasukhi dpasukhi added 2. Enhancement New feature or request 1. Data Exchange Import/Export or iterating of the CAD data labels May 7, 2025
@dpasukhi dpasukhi moved this from Todo to Review in Maintenance May 7, 2025
@dpasukhi dpasukhi changed the base branch from master to IR May 7, 2025 15:31
};

#endif // _DESTEP_Parameters_HeaderFile
#endif // _DEIGES_Parameters_HeaderFile
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you please check what it is here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

somebody's copy-paste mistake, which I fixed. I occasionally found it while searching for all the places where it is needed to make updates in creating a new parameter.

Comment thread src/DataExchange/TKDESTEP/DESTEP/DESTEP_Parameters.cxx Outdated
Comment thread src/DataExchange/TKDESTEP/STEPConstruct/STEPConstruct_Assembly.hxx Outdated
Comment thread src/DataExchange/TKDESTEP/STEPControl/STEPControl_ActorWrite.cxx Outdated
Comment thread src/DataExchange/TKDESTEP/STEPControl/STEPControl_Controller.cxx Outdated
Comment thread src/DataExchange/TKDESTEP/StepToGeom/StepToGeom.cxx
Comment thread tests/bugs/step/bug_ocp1949
… OCP-1949

Add possibility to export scaling factor into the STEP file as a cartesian_transformation_operator_3d.
Add flag for turning on/off (on by default) this behavior.
@dpasukhi dpasukhi requested review from a team and Copilot May 9, 2025 09:57
Copy link
Copy Markdown

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 option to export the scaling factor in the STEP file by writing it as a cartesian_transformation_operator_3d. Key changes include:

  • Adding a scaling factor check and export in the geometry transformation code.
  • Updating parameter and configuration interfaces (DESTEP) to support a new flag (WriteScalingTrsf).
  • Introducing a new GeomToStep_MakeCartesianTransformationOperator class to create the transformation operator when scaling is active.

Reviewed Changes

Copilot reviewed 10 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/DataExchange/TKDESTEP/StepToGeom/StepToGeom.cxx Adds conditional setting of scale factor in the transformation function.
src/DataExchange/TKDESTEP/STEPControl/STEPControl_ActorWrite.hxx & .cxx Updates parameter types and warning messages to accommodate the scaling factor option.
src/DataExchange/TKDESTEP/STEPConstruct/STEPConstruct_Assembly.hxx & .cxx Adds an overloaded Init() to support cartesian transformation operator initialization.
src/DataExchange/TKDESTEP/GeomToStep/GeomToStep_MakeCartesianTransformationOperator.* Implements the new operator creation for handling transformations with scaling.
src/DataExchange/TKDESTEP/DESTEP/DESTEP_Parameters.hxx & DESTEP_ConfigurationNode.cxx Introduces the new configuration flag to enable/disable scaling transformation export.
src/DataExchange/TKDEIGES/DEIGES/DEIGES_Parameters.hxx Fixes an include guard comment to reflect the correct module name.
Files not reviewed (5)
  • src/DataExchange/TKDESTEP/GeomToStep/FILES.cmake: Language not supported
  • tests/bugs/step/bug_ocp1949: Language not supported
  • tests/bugs/xde/bug27142: Language not supported
  • tests/de_wrapper/configuration/A3: Language not supported
  • tests/de_wrapper/configuration/A4: Language not supported
Comments suppressed due to low confidence (1)

src/DataExchange/TKDESTEP/STEPControl/STEPControl_ActorWrite.cxx:1790

  • [nitpick] The conditional logic for selecting between an axis2placement3d and a cartesian transformation based on the scale factor could be clarified or refactored for better readability.
if (Abs(aLoc.ScaleFactor() - 1.0) > Precision::Confusion())


const gp_Ax3 result(Pgp, D3, D1);
CT.SetTransformation(result);
if (SCTO->HasScale())
Copy link

Copilot AI May 9, 2025

Choose a reason for hiding this comment

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

Consider verifying that SCTO is non-null before calling HasScale(), unless its validity is guaranteed elsewhere.

Suggested change
if (SCTO->HasScale())
if (!SCTO.IsNull() && SCTO->HasScale())

Copilot uses AI. Check for mistakes.
@github-project-automation github-project-automation bot moved this from Review to Integration in Maintenance May 12, 2025
@dpasukhi dpasukhi merged commit 18a4660 into Open-Cascade-SAS:IR May 12, 2025
33 checks passed
@github-project-automation github-project-automation bot moved this from Integration to Done in Maintenance May 12, 2025
@dpasukhi dpasukhi added this to the Release 8.0 milestone May 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1. Data Exchange Import/Export or iterating of the CAD data 2. Enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants