31 #define _USE_MATH_DEFINES 35 #include <gp_Trsf.hxx> 42 double fixEndAngle(
double startAngle,
double endAngle) {
43 auto mapped = std::fmod(endAngle, 360.);
44 return mapped > startAngle ? mapped : mapped + 360;
50 double endAngle,
double radius,
bool rotateWithArray,
51 const std::array<double, 3> ¢er)
53 numShapesInArr_(numSubshapes),
57 rotateWithArray_(rotateWithArray) {}
60 const auto start = std::fmod(
start_, 360.);
61 const auto end = fixEndAngle(start,
end_);
67 const auto destCenter =
69 gp_Trsf transformation{};
70 transformation.SetTranslation(
71 gp_Vec{destCenter[0], destCenter[1], destCenter[2]});
74 gp_Ax1 axisOfRotation{};
75 rotation.SetRotation(axisOfRotation, angle * M_PI / 180.);
76 transformation *= rotation;
Class to manage TopoDS_Shapes along with metadata.
static std::array< double, 3 > getRotatedPoint(const std::array< double, 3 > ¢er, const std::array< double, 2 > &rotation)
PolarArray(std::size_t numSubshapes, double startAngle, double endAngle, double radius, bool rotateWithArray=false, const std::array< double, 3 > ¢er={0, 0, 0})
std::size_t numShapesInArr_
const std::array< double, 3 > & getCenter() const
NEM::GEO::GeoManager createGeoImpl(Modifier &&modifier) const
static NEM::GEO::GeoManager basicTransformation(const gp_Trsf &transformation, NEM::GEO::GeoManager &&geoMetadata)
Abstract base class representing a set of other ShapeBase objects, with a transformation applied to e...
NEM::GEO::GeoManager createGeo() const override
Construct a NEM::GEO::GeoManager.