Skip to content

Add initial STEP import support#1641

Merged
oitel merged 10 commits intomasterfrom
feature/step_import
Sep 27, 2023
Merged

Add initial STEP import support#1641
oitel merged 10 commits intomasterfrom
feature/step_import

Conversation

@oitel
Copy link
Contributor

@oitel oitel commented Sep 26, 2023

No description provided.

@oitel oitel requested review from Fedr and Grantim September 26, 2023 12:39
{

MROPENCASCADEPLUGINS_API MR::Expected<MR::Mesh, std::string> fromStep( const std::filesystem::path& path, MR::Vector<MR::Color, MR::VertId>* colors = nullptr, MR::ProgressCallback callback = {} );
MROPENCASCADEPLUGINS_API MR::Expected<MR::Mesh, std::string> fromStep( std::istream& in, MR::Vector<MR::Color, MR::VertId>* colors = nullptr, MR::ProgressCallback callback = {} );
Copy link
Contributor

Choose a reason for hiding this comment

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

MR::Vector<MR::Color, MR::VertId> -> VertColors

@@ -0,0 +1,5 @@
{
"Order": 300,
"LibName": "MROpenCascadePlugins",
Copy link
Contributor

Choose a reason for hiding this comment

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

Let us avoid new projection creation for now, and put everything in MRMesh

namespace MR::MeshLoad
{

MROPENCASCADEPLUGINS_API MR::Expected<MR::Mesh, std::string> fromStep( const std::filesystem::path& path, MR::Vector<MR::Color, MR::VertId>* colors = nullptr, MR::ProgressCallback callback = {} );
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a minor comment

namespace MR
{

MROPENCASCADEPLUGINS_API void loadMROpenCascadePluginsDll();
Copy link
Contributor

Choose a reason for hiding this comment

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

no need in this as far as we load this dll in rantime

Comment on lines +36 to +38
// NOTE: OpenCASCADE STEP reader is NOT thread-safe
static std::mutex mutex;
std::unique_lock lock( mutex );
Copy link
Contributor

Choose a reason for hiding this comment

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

what are we protecting with this mutex?

if ( !in )
return unexpected( std::string( "Cannot open file for reading " ) + utf8string( path ) );

return fromStep( in, colors, callback );
Copy link
Contributor

Choose a reason for hiding this comment

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

addFileNameInError(, see in other places


/// loads meshes from STEP file using OpenCASCADE
MRMESH_API MR::Expected<MR::Mesh, std::string> fromStep( const std::filesystem::path& path, MR::VertColors* colors = nullptr, MR::ProgressCallback callback = {} );
MRMESH_API MR::Expected<MR::Mesh, std::string> fromStep( std::istream& in, MR::VertColors* colors = nullptr, MR::ProgressCallback callback = {} );
Copy link
Contributor

Choose a reason for hiding this comment

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

probably move function declarations in MRMeshLoad.h?

}
const auto shape = reader.OneShape();
//for ( auto i = 1; i <= reader.NbShapes(); ++i )
// shape = reader.Shape( i );
Copy link
Contributor

Choose a reason for hiding this comment

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

remove commented lines?

@oitel oitel merged commit 6b7ee0e into master Sep 27, 2023
@oitel oitel deleted the feature/step_import branch September 27, 2023 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants