feragon committed Aug 4, 2017
1 parent 42476bc commit da256b760a2003c2e986a85308abc78d24e3b815
 @@ -155,9 +155,11 @@ void DXFimpl::addArc(const DRW_Arc& data) { void DXFimpl::addEllipse(const DRW_Ellipse& data) { std::shared_ptr mf = getMetaInfo(data); auto layer = _document->layerByName(data.layer); auto secPoint = coord(data.secPoint); auto lcEllipse = std::make_shared(coord(data.basePoint), coord(data.secPoint), coord(data.basePoint).distanceTo(coord(data.secPoint)) / data.ratio, secPoint, secPoint.magnitude() * data.ratio, data.staparam, data.endparam, data.isccw,
 @@ -51,6 +51,9 @@ function EllipseOperations:newData(data) message("Click on major point") elseif(self.majorPoint == nil) then self.majorPoint = Operations:getCoordinate(data) if(self.majorPoint ~= nil) then self.majorPoint = self.majorPoint:sub(self.center) end message("Give minor radius") elseif(self.minorRadius == nil) then @@ -89,7 +92,7 @@ function EllipseOperations:createTempEllipse(point) if(center == nil) then center = point elseif(majorPoint == nil) then majorPoint = point majorPoint = point:sub(self.center) minorRadius = Operations:getDistance(center, majorPoint) / 2 elseif(minorRadius == nil) then minorRadius = Operations:getDistance(center, point)
 @@ -5,17 +5,6 @@ using namespace lc; using namespace geo; Ellipse::Ellipse(const Coordinate& center, const Coordinate& majorP, double minorRadius, double startAngle, double endAngle) : Base(), _center(center), _majorP(majorP), _minorRadius(minorRadius), _startAngle(startAngle), _endAngle(endAngle), _isReversed(false){ } Ellipse::Ellipse(const Coordinate& center, const Coordinate& majorP, double minorRadius, double startAngle, double endAngle, bool reversed) : _center(center), _majorP(majorP),
 @@ -13,16 +13,24 @@ namespace lc { namespace geo { class Ellipse : public Base, virtual public Visitable { public: Ellipse(const Coordinate& center, const Coordinate& majorP, double minorRadius, double startAngle, double endAngle); Ellipse(const Coordinate& center, const Coordinate& majorP, double minorRadius, double startAngle, double endAngle, bool reversed); /** * @brief * @param center * @param majorP relative to center * @param minorRadius * @param startAngle * @param endAngle * @param reversed */ Ellipse(const Coordinate& center, const Coordinate& majorP, double minorRadius, double startAngle, double endAngle, bool reversed = false); /** * @brief center, Returns Center point of Ellipse * @return geo::Coordinate center */ const Coordinate center() const; /** * @brief majorP, Returns major point of the ellipse * @brief majorP, Returns major point of the ellipse, relative to center * @return geo::Coordinate majorP */ const Coordinate majorP() const;
 @@ -19,7 +19,7 @@ Ellipse::Ellipse(const geo::Coordinate& center, Ellipse::Ellipse(const Ellipse_CSPtr other, bool sameID) : CADEntity(other, sameID), geo::Ellipse(other->center(), other->majorP(), other->minorRadius(), other->startAngle(), other->endAngle()) { geo::Ellipse(other->center(), other->majorP(), other->minorRadius(), other->startAngle(), other->endAngle(), other->isReversed()) { }
 @@ -25,6 +25,18 @@ namespace lc { */ class Ellipse : public std::enable_shared_from_this, public CADEntity, public geo::Ellipse { public: /** * @brief Create ellipse * @param center * @param majorP relative to center * @param minorRadius * @param startAngle * @param endAngle * @param reversed * @param layer * @param metaInfo * @param block */ Ellipse(const geo::Coordinate ¢er, const geo::Coordinate &majorP, double minorRadius,