Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #92 from gaganjyot/master
Cubic Beziers, Intersections.
- Loading branch information
Showing
17 changed files
with
762 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#pragma once | ||
|
||
#include "cad/const.h" | ||
#include "geoarea.h" | ||
#include "geocoordinate.h" | ||
#include "geobase.h" | ||
#include <cad/math/lcmath.h> | ||
#include <cmath> | ||
#include <cstdlib> | ||
#include <vector> | ||
|
||
namespace lc { | ||
namespace geo { | ||
class BezierBase; | ||
using BB_CSPtr = std::shared_ptr<const BezierBase>; | ||
using BB_SPtr = std::shared_ptr<BezierBase>; | ||
|
||
class BezierBase : public Base, virtual public Visitable { | ||
public: | ||
|
||
BezierBase() {} | ||
virtual ~BezierBase() {} | ||
|
||
virtual const Area boundingBox() const = 0; | ||
|
||
virtual Coordinate nearestPointOnPath(const Coordinate& coord) const = 0; | ||
virtual Coordinate nearestPointOnEntity(const Coordinate& coord) const = 0; | ||
|
||
virtual Coordinate CasteljauAt(std::vector<Coordinate> points, double t) const = 0; | ||
|
||
virtual const std::vector<Coordinate> getCP() const = 0; | ||
|
||
virtual Coordinate DirectValueAt(double t) const = 0; | ||
|
||
virtual const std::vector<Coordinate> Curve(double precession) = 0; | ||
|
||
virtual const double length() const = 0; | ||
|
||
virtual const Coordinate tangent(double t) const = 0; | ||
|
||
virtual const Coordinate normal(double t) const = 0; | ||
|
||
virtual std::vector<BB_CSPtr> splitHalf() const = 0; | ||
|
||
virtual BB_CSPtr offset(const geo::Coordinate& offset) const = 0; | ||
|
||
virtual BB_CSPtr rotate(const geo::Coordinate& center, double angle) const = 0; | ||
virtual BB_CSPtr scale(const geo::Coordinate& center, const geo::Coordinate& factor) const = 0; | ||
virtual BB_CSPtr move(const geo::Coordinate& offset) const = 0; | ||
virtual BB_CSPtr mirror(const geo::Coordinate& axis1, const geo::Coordinate& axis2) const = 0; | ||
|
||
virtual void accept(GeoEntityVisitor &v) const override { v.visit(*this); } | ||
|
||
virtual std::vector<double> nearestPointTValue(const Coordinate &coord) const = 0; | ||
virtual const lc::geo::Coordinate returnCasesForNearestPoint( | ||
double min_distance, const lc::geo::Coordinate &coord, | ||
const Coordinate &ret) const = 0; | ||
}; | ||
} | ||
} |
Oops, something went wrong.