-// Copyright (C) 2014-2019 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2024 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include <GeomAPI_Shape.h>
#include <GeomAPI_Vertex.h>
-
+#include <GeomAPI_Pnt.h>
#include <map>
#include <set>
+#ifdef WIN32
+#include<array>
+#endif
class GeomAPI_Ax1;
class GeomAPI_Edge;
class GeomAlgoAPI_ShapeTools
{
public:
+ /// \return the lenth of the edges of the current shape or 0.0 if it can be computed.
+ GEOMALGOAPI_EXPORT static double length(const std::shared_ptr<GeomAPI_Shape> theShape);
+
/// \return the total volume of the solids of the current shape or 0.0 if it can be computed.
GEOMALGOAPI_EXPORT static double volume(const std::shared_ptr<GeomAPI_Shape> theShape);
/// \return the total area of the faces of the current shape or 0.0 if it can be computed.
GEOMALGOAPI_EXPORT static double area(const std::shared_ptr<GeomAPI_Shape> theShape);
+ /// indicate if two faces are continuous
+ /// with an angular tolerance used for G1 continuity to compare the angle between the normals
+ /// \param theFace1 the first face
+ /// \param theFace2 the second face
+ /// \param thePoint the point for the normal
+ /// \param theAngle the angular tolerance
+ /// \param theError error
+ GEOMALGOAPI_EXPORT static bool isContinuousFaces(const GeomShapePtr& theFace1,
+ const GeomShapePtr& theFace2,
+ const GeomPointPtr& thePoint,
+ const double & theAngle,
+ std::string& theError);
+
/// \return the center of mass of the current face.
/// The coordinates returned for the center of mass
/// are expressed in the absolute Cartesian coordinate system.
/// \brief Calculate minimal distance between shapes
GEOMALGOAPI_EXPORT static double minimalDistance(const GeomShapePtr& theShape1,
const GeomShapePtr& theShape2);
+ GEOMALGOAPI_EXPORT static double minimalDistance(const GeomShapePtr& theShape1,
+ const GeomShapePtr& theShape2,
+ std::array<double, 3> & fromShape1To2);
+
+ /// \brief Calculate maximal value of all possible distances between shapes.
+ /// The shapes can be two edges or two faces only.
+ GEOMALGOAPI_EXPORT static double shapeProximity(const GeomShapePtr& theShape1,
+ const GeomShapePtr& theShape2);
/// \brief Combines faces with common edges to shells, or solids to compsolids.
/// \param[in] theCompound compound of shapes.
GEOMALGOAPI_EXPORT static bool isParallel(const std::shared_ptr<GeomAPI_Edge> theEdge,
const std::shared_ptr<GeomAPI_Face> theFace);
- // Computes intersection point between the edge curve and a face surface (only one point, with
- // preferences to point that belongs to edge and face boundaries.
+ /// Computes intersection point between the edge curve and a face surface (only one point, with
+ /// preferences to point that belongs to edge and face boundaries.
/// \returns null if there is no intersection
GEOMALGOAPI_EXPORT static std::list<std::shared_ptr<GeomAPI_Vertex> > intersect(
- const std::shared_ptr<GeomAPI_Edge> theEdge, const std::shared_ptr<GeomAPI_Face> theFace,
- const bool thePointsOutsideFace);
+ const std::shared_ptr<GeomAPI_Edge> theEdge, const std::shared_ptr<GeomAPI_Face> theFace);
typedef std::map<std::shared_ptr<GeomAPI_Pnt>,
std::pair<std::list<std::shared_ptr<GeomDataAPI_Point2D> >,
const ListOfShape& theBaseShapes,
const std::shared_ptr<GeomAPI_Dir> theDir,
double& theToSize, double& theFromSize);
+
+ /// \brief Get shared faces of a shape
+ /// \param[in] theShape shape that should be exploded
+ /// \return list of shared faces
+ GEOMALGOAPI_EXPORT static ListOfShape getSharedFaces(const GeomShapePtr& theShape);
};
#endif