/// 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<GeomAPI_Pln>& 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<GeomAPI_Pln>& thePlane,
const GeomShapePtr& theEdgeOrWire,
- const double theOffsetValue,
+ const double theOffsetDistance,
const GeomAlgoAPI_OffsetJoint theJoint = GeomAlgoAPI_OffsetJoint::KeepDistance,
const bool theIsApprox = false);
};