AMCAX Kernel 1.0.0.0
Loading...
Searching...
No Matches
Geometric Constraint Solving​​

2D Constraint Solve

Constraint element type

Constraint element type include: point, line, circle, ellipse, elliptic arc, parabolic arc. Next, we will introduce how to create these constraint elements.

point

//Create constraint handle
//Define a point
AMCAX::GCS::Point2d p1{ 1., 2. };
//Initialize the handle and bind geometric objects
AMCAX::GCS::Status status1 = gcsSystem.Create2dPoint(handlePoint1, p1);
std::cout << status1 << std::endl;
The wrapper for GCSSystem.
Definition AMCAXGCS.h:309
Status Create2dPoint(GCSWVarGeomHandle &h, const Point2d &point)
Create a point in 2D.
The wrapper for GCSVarGeomHandle.
Definition AMCAXGCS.h:231
Point in 2d.
Definition AMCAXGCS.h:104

line

//Create constraint handle
//Define a point
AMCAX::GCS::Point2d p1{ 1., 2. };
AMCAX::GCS::Point2d p2{ 3., 4. };
//Initialize the handle and bind geometric objects
AMCAX::GCS::Status status1 = gcsSystem.Create2dPoint(handlePoint1, p1);
AMCAX::GCS::Status status2 = gcsSystem.Create2dPoint(handlePoint2, p2);
AMCAX::GCS::Status status3 = gcsSystem.Create2dLine(handleLine, handlePoint1, handlePoint2);
std::cout << status3 << std::endl;
Status Create2dLine(GCSWVarGeomHandle &h, const GCSWVarGeomHandle &point0, const GCSWVarGeomHandle &point1)
Create a line segment in 2D.

circle

//Create constraint handle
//Define a point
AMCAX::GCS::Point2d center{ 0., 0. };
//Initialize the handle and bind geometric objects
gcsSystem.Create2dPoint(handlecenter, center);
AMCAX::GCS::Status status3 = gcsSystem.Create2dCircle(handleCircle, handlecenter, 2.);
std::cout << status3 << std::endl;
Status Create2dCircle(GCSWVarGeomHandle &h, const GCSWVarGeomHandle &center, double radius)
Create a circle in 2D.

ellipse

//Create constraint handle
AMCAX::GCS::GCSWVarGeomHandle handleEllipse, h_center;
//Define a vector
AMCAX::GCS::Vector2d majorAxis{ 1.,0. };
AMCAX::GCS::Vector2d minorAxis{ 0.,1. };
//Initialize the handle and bind geometric objects
gcsSystem.Create2dPoint(h_center, { 0,0 });
AMCAX::GCS::Status status4 = gcsSystem.Create2dEllipse(handleEllipse, h_center, majorAxis, 2., minorAxis, 1.);
std::cout << status4 << std::endl;
Status Create2dEllipse(GCSWVarGeomHandle &h, const GCSWVarGeomHandle &center, const Vector2d &majorAxis, double majorRadius, const Vector2d &minorAxis, double minorRadius)
Create an ellipse in 2D.
Vector in 2d.
Definition AMCAXGCS.h:112

elliptic arc

//Create constraint handle
AMCAX::GCS::GCSWVarGeomHandle handleArcOfEllipse;
AMCAX::GCS::GCSWVarGeomHandle handleArcOfEllipsestart;
AMCAX::GCS::GCSWVarGeomHandle handleArcOfEllipseend, h_center1;
//Define a vector
AMCAX::GCS::Vector2d majorAxis{ 1.,0. };
AMCAX::GCS::Vector2d minorAxis{ 0.,1. };
AMCAX::GCS::Point2d start{ 2., 0. };
AMCAX::GCS::Point2d end{ -2., 0. };
//Initialize the handle and bind geometric objects
gcsSystem.Create2dPoint(h_center1, { 0,0 });
gcsSystem.Create2dPoint(handleArcOfEllipsestart, start);
gcsSystem.Create2dPoint(handleArcOfEllipseend, end);
double range = AMCAX::Constants::pi;
AMCAX::GCS::Status status5 = gcsSystem.Create2dArcOfEllipse(handleArcOfEllipse, h_center1, majorAxis, 2., minorAxis, 1., handleArcOfEllipsestart, handleArcOfEllipseend, range);
std::cout << status5 << std::endl;
Status Create2dArcOfEllipse(GCSWVarGeomHandle &h, const GCSWVarGeomHandle &center, const Vector2d &majorAxis, double majorRadius, const Vector2d &minorAxis, double minorRadius, const GCSWVarGeomHandle &start, const GCSWVarGeomHandle &end, double range=0)
Create an arc of ellipse in 2D.
constexpr double pi
Mathematical constant Pi, ratio of a circle's circumference to its diameter.
Definition Constants.hpp:42

parabolic arc

//Create constraint handle
AMCAX::GCS::GCSWVarGeomHandle handleArcOfParabola;
AMCAX::GCS::GCSWVarGeomHandle handleArcOfParabolafocus;
AMCAX::GCS::GCSWVarGeomHandle handleArcOfParabolavertex;
AMCAX::GCS::GCSWVarGeomHandle handleArcOfParabolastart;
AMCAX::GCS::GCSWVarGeomHandle handleArcOfParabolaend;
//Define a point
AMCAX::GCS::Point2d focus{ 1., 0. };
AMCAX::GCS::Point2d vertex{ 0., 0. };
AMCAX::GCS::Point2d apstart{ 1., 2. };
AMCAX::GCS::Point2d apend{ 1., -2. };
//Initialize the handle and bind geometric objects
gcsSystem.Create2dPoint(handleArcOfParabolafocus, focus);
gcsSystem.Create2dPoint(handleArcOfParabolavertex, vertex);
gcsSystem.Create2dPoint(handleArcOfParabolastart, apstart);
gcsSystem.Create2dPoint(handleArcOfParabolaend, apend);
AMCAX::GCS::Status status6 = gcsSystem.Create2dArcOfParabola(handleArcOfParabola, handleArcOfParabolafocus, vertex, handleArcOfParabolastart, handleArcOfParabolaend);
std::cout << status6 << std::endl;
Status Create2dArcOfParabola(GCSWVarGeomHandle &h, const GCSWVarGeomHandle &focus, const Point2d &vertex, const GCSWVarGeomHandle &start, const GCSWVarGeomHandle &end)
Create an arc of parabola in 2D.

Constraint Type

The types of constraint include parallel, vertical, angle, distance, concentric, symmetry, and equality.
To be down.

Support for Redundant Constraint Detection

To be down.

3D Constraint Solve

Constraint Element Type

The types of constraint element include point, line, and plane.
To be down.

Constraint Type

The types of constraint include parallel, angle, and distance.
To be down.