From: dish Date: Wed, 16 Oct 2024 10:50:52 +0000 (+0000) Subject: [bos #40618] [CEA] Offset/Thickness Feature X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fdish%2F40618_Offset;p=modules%2Fshaper.git [bos #40618] [CEA] Offset/Thickness Feature Renaming proposals. --- diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Offset.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Offset.cpp index 2d74029e6..93edc9fab 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Offset.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Offset.cpp @@ -74,7 +74,7 @@ void GeomAlgoAPI_Offset::buildSimple(const GeomShapePtr& theShape, const double theOffsetValue) { BRepOffsetAPI_MakeOffsetShape* anOffsetAlgo = new BRepOffsetAPI_MakeOffsetShape; - anOffsetAlgo->PerformBySimple(theShape->impl(), theOffsetValue); + anOffsetAlgo->PerformBySimple(theShape->impl(), theOffsetValue); // COMMENT What are SimpleOffset, buildSimple, PerformBySimple and enum OffsetAlgo_Type::OffsetAlgo_SIMPLE ? setImpl(anOffsetAlgo); setBuilderType(OCCT_BRepBuilderAPI_MakeShape); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Offset.h b/src/GeomAlgoAPI/GeomAlgoAPI_Offset.h index 5bc01a6b6..6fa057181 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Offset.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Offset.h @@ -35,73 +35,80 @@ class GeomAPI_Pln; /// adjacent lines are prolonged to the point of their intersection. enum class GeomAlgoAPI_OffsetJoint { KeepDistance, Arcs, Lines }; +/// COMMENT Is it better to replace isPipeJoint with this? +/** @brief Type of generated joint of offset 3D shape. */ +enum class GeomAlgoAPI_Offset3DJoint { + Intersect, // Offset faces are extended unti they intersect other faces of offset base shape. + CircularPipe // Offset faces are extended unti they intersect other faces of offset base shape. Circular chamfer is added to offset edges. +}; + /// \class GeomAlgoAPI_Offset /// \ingroup DataAlgo -/// \brief Perform 3D offset for the shape +/// \brief Creates offset shapes. class GeomAlgoAPI_Offset : public GeomAlgoAPI_MakeShape { public: - /// \brief Perform simple offset. + /// \brief Performs simple offset. /// \param[in] theShape base shape - /// \param[in] theOffsetValue offset distance, it can be negative + /// \param[in] theOffsetDistance can be negative GEOMALGOAPI_EXPORT GeomAlgoAPI_Offset(const GeomShapePtr& theShape, - const double theOffsetValue); + const double theOffsetDistance); - /// \brief Perform 3d offset algorithm + /// \brief Performs 3d offset algorithm. /// \param[in] theShape base shape - /// \param[in] theOffsetValue offset distance, it can be negative - /// \param[in] isPipeJoint type of joint of faces (pipes or intersections) - GEOMALGOAPI_EXPORT GeomAlgoAPI_Offset + /// \param[in] theOffsetDistance can be negative + /// \param[in] isPipeJoint If false, offset faces are extended unti they intersect other faces. + GEOMALGOAPI_EXPORT GeomAlgoAPI_Offset3D (const GeomShapePtr& theShape, - const double theOffsetValue, + const double theOffsetDistance, const bool isPipeJoint); - /// \brief Perform partial 3d offset algorithm + /// \brief Performs partial 3d offset algorithm. /// \param[in] theShape base shape - /// \param[in] theFaces list of faces to be offset - /// \param[in] theOffsetValue offset distance for selected faces, it can be negative - GEOMALGOAPI_EXPORT GeomAlgoAPI_Offset + /// \param[in] theFaces list of faces to offset + /// \param[in] theOffsetDistance can be negative + GEOMALGOAPI_EXPORT GeomAlgoAPI_Offset3D (const GeomShapePtr& theShape, const ListOfShape& theFaces, - const double theOffsetValue); + const double theOffsetDistance); - /// \brief Perform 2d offset algorithm on the plane + /// \brief Performs 2d offset algorithm on the plane. /// \param[in] thePlane base plane for all offsets /// \param[in] theEdgesOrWire base shapes - /// \param[in] theOffsetValue offset distance, it can be negative + /// \param[in] theOffsetDistance can be negative /// \param[in] theJointType type of joint of straight edges GEOMALGOAPI_EXPORT GeomAlgoAPI_Offset (const std::shared_ptr& thePlane, const GeomShapePtr& theEdgeOrWire, - const double theOffsetValue, + const double theOffsetDistance, const GeomAlgoAPI_OffsetJoint theJoint = GeomAlgoAPI_OffsetJoint::KeepDistance, const bool theIsApprox = false); - /// \return the list of shapes generated from the shape \a theShape. + /// \returns the list of shapes generated from the shape \a theShape. /// \param[in] theOldShape base shape. /// \param[out] theNewShapes shapes generated from \a theShape. Does not cleared! GEOMALGOAPI_EXPORT virtual void generated(const GeomShapePtr theOldShape, ListOfShape& theNewShapes); private: - /// \brief Perform simple offset operation + /// \brief Performs simple offset operation. // COMMENT Is it applicable to 2D or 3D? How gaps between offset shapes are filled? void buildSimple(const GeomShapePtr& theShape, - const double theOffsetValue); + const double theOffsetDistance); - /// \brief Perform 3d offset algorithm by join + /// \brief Performs 3d offset algorithm by join. // COMMENT What "by join" means? void buildByJoin(const GeomShapePtr& theShape, - const double theOffsetValue, + const double theOffsetDistance, const bool isPipeJoint); - /// \brief Perform partial 3d offset algorithm + /// \brief Performs partial 3d offset algorithm. // COMMENT Why there is no parameter isPipeJoint? void buildPartial(const GeomShapePtr& theShape, const ListOfShape& theFaces, - const double theOffsetValue); + const double theOffsetDistance); - /// \brief Perform 2d offset algorithm on the plane + /// \brief Performs 2d offset algorithm on the plane. void build2d(const std::shared_ptr& thePlane, const GeomShapePtr& theEdgeOrWire, - const double theOffsetValue, + const double theOffsetDistance, const GeomAlgoAPI_OffsetJoint theJoint = GeomAlgoAPI_OffsetJoint::KeepDistance, const bool theIsApprox = false); }; diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Thickness.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Thickness.cpp index 0a7409b93..b00e3b9c5 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Thickness.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Thickness.cpp @@ -95,6 +95,7 @@ void GeomAlgoAPI_Thickness::buildThickening(const GeomShapePtr& theShape, // Control the solid orientation. This is mostly done to fix a bug in case of extrusion // of a circle. The built solid is then badly oriented + // COMMENT What is going on and why only with circle? BRepClass3d_SolidClassifier anotherClassifier(aResult); anotherClassifier.PerformInfinitePoint(Precision::Confusion()); if (anotherClassifier.State() == TopAbs_IN) { diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Thickness.h b/src/GeomAlgoAPI/GeomAlgoAPI_Thickness.h index dfe272cf8..83d263070 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Thickness.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Thickness.h @@ -51,7 +51,7 @@ public: private: /// \brief Perform thickening algorithm - void buildThickening(const GeomShapePtr& theShape, + void buildSurfaceThickening(const GeomShapePtr& theShape, const double theThickness, const bool isInside);