#include <Sketch.h>
Classes | |
struct | ConstrDef |
container element to store and work with the constraints of this sketch More... | |
struct | GeoDef |
container element to store and work with the geometric elements of this sketch More... | |
Public Types | |
enum | GeoType { , Point = 1, Line = 2, Arc = 3, Circle = 4, Ellipse = 5, ArcOfEllipse = 6, ArcOfHyperbola = 7, ArcOfParabola = 8, BSpline = 9 } |
Public Member Functions | |
int | addAngleAtPointConstraint (int geoId1, PointPos pos1, int geoId2, PointPos pos2, int geoId3, PointPos pos3, double *value, ConstraintType cTyp, bool driving=true) |
int | addAngleConstraint (int geoId, double *value, bool driving=true) |
add an angle constraint on a line or between two lines More... | |
int | addAngleConstraint (int geoId1, int geoId2, double *value, bool driving=true) |
add an angle constraint on a line or between two lines More... | |
int | addAngleConstraint (int geoId1, PointPos pos1, int geoId2, PointPos pos2, double *value, bool driving=true) |
add an angle constraint on a line or between two lines More... | |
int | addAngleViaPointConstraint (int geoId1, int geoId2, int geoId3, PointPos pos3, double value, bool driving=true) |
add angle-via-point constraint between any two curves More... | |
int | addArc (const Part::GeomArcOfCircle &circleSegment, bool fixed=false) |
add a arc (circle segment) More... | |
int | addArcOfEllipse (const Part::GeomArcOfEllipse &ellipseSegment, bool fixed=false) |
add an arc of ellipse More... | |
int | addArcOfHyperbola (const Part::GeomArcOfHyperbola &hyperbolaSegment, bool fixed=false) |
add an arc of hyperbola More... | |
int | addArcOfParabola (const Part::GeomArcOfParabola ¶bolaSegment, bool fixed=false) |
add an arc of parabola More... | |
int | addBSpline (const Part::GeomBSplineCurve &spline, bool fixed=false) |
add a BSpline More... | |
int | addCircle (const Part::GeomCircle &circle, bool fixed=false) |
add a circle More... | |
int | addConstraint (const Constraint *constraint) |
add one constraint to the sketch More... | |
int | addConstraints (const std::vector< Constraint * > &ConstraintList) |
constraints More... | |
int | addConstraints (const std::vector< Constraint * > &ConstraintList, const std::vector< bool > &unenforceableConstraints) |
add all constraints in the list, provided that are enforceable More... | |
int | addCoordinateXConstraint (int geoId, PointPos pos, double *value, bool driving=true) |
add a fixed X coordinate constraint to a point More... | |
int | addCoordinateYConstraint (int geoId, PointPos pos, double *value, bool driving=true) |
add a fixed Y coordinate constraint to a point More... | |
int | addDiameterConstraint (int geoId, double *value, bool driving=true) |
add a radius constraint on a circle or an arc More... | |
int | addDistanceConstraint (int geoId1, double *value, bool driving=true) |
add a length or distance constraint More... | |
int | addDistanceConstraint (int geoId1, PointPos pos1, int geoId2, double *value, bool driving=true) |
add a length or distance constraint More... | |
int | addDistanceConstraint (int geoId1, PointPos pos1, int geoId2, PointPos pos2, double *value, bool driving=true) |
add a length or distance constraint More... | |
int | addDistanceXConstraint (int geoId, double *value, bool driving=true) |
add a horizontal distance constraint to two points or line ends More... | |
int | addDistanceXConstraint (int geoId1, PointPos pos1, int geoId2, PointPos pos2, double *value, bool driving=true) |
add a horizontal distance constraint to two points or line ends More... | |
int | addDistanceYConstraint (int geoId, double *value, bool driving=true) |
add a vertical distance constraint to two points or line ends More... | |
int | addDistanceYConstraint (int geoId1, PointPos pos1, int geoId2, PointPos pos2, double *value, bool driving=true) |
add a vertical distance constraint to two points or line ends More... | |
int | addEllipse (const Part::GeomEllipse &ellipse, bool fixed=false) |
add an ellipse More... | |
int | addEqualConstraint (int geoId1, int geoId2) |
add an equal length or radius constraints between two lines or between circles and arcs More... | |
int | addGeometry (const Part::Geometry *geo, bool fixed=false) |
add unspecified geometry More... | |
int | addGeometry (const std::vector< Part::Geometry * > &geo, bool fixed=false) |
add unspecified geometry More... | |
int | addGeometry (const std::vector< Part::Geometry * > &geo, const std::vector< bool > &blockedGeometry) |
add unspecified geometry, where each element's "fixed" status is given by the blockedGeometry array More... | |
int | addHorizontalConstraint (int geoId) |
add a horizontal constraint to a geometry More... | |
int | addHorizontalConstraint (int geoId1, PointPos pos1, int geoId2, PointPos pos2) |
int | addInternalAlignmentBSplineControlPoint (int geoId1, int geoId2, int poleindex) |
int | addInternalAlignmentEllipseFocus1 (int geoId1, int geoId2) |
int | addInternalAlignmentEllipseFocus2 (int geoId1, int geoId2) |
int | addInternalAlignmentEllipseMajorDiameter (int geoId1, int geoId2) |
Internal Alignment constraints. More... | |
int | addInternalAlignmentEllipseMinorDiameter (int geoId1, int geoId2) |
int | addInternalAlignmentHyperbolaFocus (int geoId1, int geoId2) |
int | addInternalAlignmentHyperbolaMajorDiameter (int geoId1, int geoId2) |
add InternalAlignmentHyperbolaMajorRadius to a line and a hyperbola More... | |
int | addInternalAlignmentHyperbolaMinorDiameter (int geoId1, int geoId2) |
int | addInternalAlignmentKnotPoint (int geoId1, int geoId2, int knotindex) |
int | addInternalAlignmentParabolaFocus (int geoId1, int geoId2) |
int | addLine (const Part::GeomLineSegment &line, bool fixed=false) |
add an infinite line More... | |
int | addLineSegment (const Part::GeomLineSegment &lineSegment, bool fixed=false) |
add a line segment More... | |
int | addParallelConstraint (int geoId1, int geoId2) |
add a parallel constraint between two lines More... | |
int | addPerpendicularConstraint (int geoId1, int geoId2) |
add a perpendicular constraint between two lines More... | |
int | addPoint (const Part::GeomPoint &point, bool fixed=false) |
add dedicated geometry More... | |
int | addPointCoincidentConstraint (int geoId1, PointPos pos1, int geoId2, PointPos pos2) |
add a coincident constraint to two points of two geometries More... | |
int | addPointOnObjectConstraint (int geoId1, PointPos pos1, int geoId2, bool driving=true) |
add a point on line constraint More... | |
int | addRadiusConstraint (int geoId, double *value, bool driving=true) |
add a radius constraint on a circle or an arc More... | |
int | addSnellsLawConstraint (int geoIdRay1, PointPos posRay1, int geoIdRay2, PointPos posRay2, int geoIdBnd, double *value, double *second, bool driving=true) |
add a snell's law constraint More... | |
int | addSymmetricConstraint (int geoId1, PointPos pos1, int geoId2, PointPos pos2, int geoId3) |
add a symmetric constraint between two points with respect to a line More... | |
int | addSymmetricConstraint (int geoId1, PointPos pos1, int geoId2, PointPos pos2, int geoId3, PointPos pos3) |
add a symmetric constraint between three points, the last point is in the middle of the first two More... | |
int | addTangentConstraint (int geoId1, int geoId2) |
add a tangency constraint between two geometries More... | |
int | addVerticalConstraint (int geoId) |
add a vertical constraint to a geometry More... | |
int | addVerticalConstraint (int geoId1, PointPos pos1, int geoId2, PointPos pos2) |
double | calculateAngleViaPoint (int geoId1, int geoId2, double px, double py) |
double | calculateConstraintError (int icstr) |
Base::Vector3d | calculateNormalAtPoint (int geoIdCurve, double px, double py) |
void | clear (void) |
delete all geometry and constraints, leave an empty sketch More... | |
std::vector< Part::Geometry * > | extractGeometry (bool withConstructionElements=true, bool withExternalElements=false) const |
returns the actual geometry More... | |
void | getBlockedGeometry (std::vector< bool > &blockedGeometry, std::vector< bool > &unenforceableConstraints, const std::vector< Constraint * > &ConstraintList) const |
get boolean list indicating whether the geometry is to be blocked or not More... | |
const std::vector< int > & | getConflicting (void) const |
GCS::DebugMode | getDebugMode (void) |
int | getGeometrySize (void) const |
Returns the size of the Geometry. More... | |
virtual unsigned int | getMemSize (void) const |
This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB? More... | |
Base::Vector3d | getPoint (int geoId, PointPos pos) const |
retrieves a point More... | |
int | getPointId (int geoId, PointPos pos) const |
retrieves the index of a point More... | |
Py::Tuple | getPyGeometry (void) const |
get the geometry as python objects More... | |
GCS::QRAlgorithm | getQRAlgorithm () |
const std::vector< int > & | getRedundant (void) const |
double | getSolverPrecision () |
get standard (aka fine) solver precision More... | |
bool | hasConflicts (void) const |
bool | hasDependentParameters (int geoId, PointPos pos) const |
retrieves whether a geometry has dependent parameters or not More... | |
bool | hasRedundancies (void) const |
int | initMove (int geoId, PointPos pos, bool fine=true) |
initializes a point (or curve) drag by setting the current sketch status as a reference More... | |
int | movePoint (int geoId, PointPos pos, Base::Vector3d toPoint, bool relative=false) |
move this point (or curve) to a new location and solve. More... | |
void | resetInitMove () |
Resets the initialization of a point or curve drag. More... | |
int | resetSolver () |
resets the solver More... | |
virtual void | Restore (Base::XMLReader &) |
This method is used to restore properties from an XML document. More... | |
virtual void | Save (Base::Writer &) const |
This method is used to save properties to an XML document. More... | |
void | setConvergence (double conv) |
void | setConvergenceRedundant (double conv) |
int | setDatum (int constrId, double value) |
set the datum of a distance or angle constraint to a certain value and solve This can cause the solving to fail! More... | |
void | setDebugMode (GCS::DebugMode mode) |
void | setDL_tolf (double val) |
void | setDL_tolfRedundant (double val) |
void | setDL_tolg (double val) |
void | setDL_tolgRedundant (double val) |
void | setDL_tolx (double val) |
void | setDL_tolxRedundant (double val) |
void | setDogLegGaussStep (GCS::DogLegGaussStep mode) |
void | setLM_eps (double val) |
void | setLM_eps1 (double val) |
void | setLM_eps1Redundant (double val) |
void | setLM_epsRedundant (double val) |
void | setLM_tau (double val) |
void | setLM_tauRedundant (double val) |
void | setMaxIter (int maxiter) |
void | setMaxIterRedundant (int maxiter) |
void | setQRAlgorithm (GCS::QRAlgorithm alg) |
void | setQRPivotThreshold (double val) |
void | setSketchSizeMultiplier (bool mult) |
void | setSketchSizeMultiplierRedundant (bool mult) |
int | setUpSketch (const std::vector< Part::Geometry * > &GeoList, const std::vector< Constraint * > &ConstraintList, int extGeoCount=0) |
set the sketch up with geoms and constraints More... | |
Sketch () | |
int | solve (void) |
solve the actual set up sketch More... | |
Part::TopoShape | toShape (void) const |
return the actual geometry of the sketch a TopoShape More... | |
~Sketch () | |
Public Member Functions inherited from Base::Persistence | |
void | dumpToStream (std::ostream &stream, int compression) |
virtual Base::Type | getTypeId (void) const |
virtual void | RestoreDocFile (Reader &) |
This method is used to restore large amounts of data from a file In this method you simply stream in your SaveDocFile() saved data. More... | |
void | restoreFromStream (std::istream &stream) |
virtual void | SaveDocFile (Writer &) const |
This method is used to save large amounts of data to a binary file. More... | |
Public Member Functions inherited from Base::BaseClass | |
BaseClass () | |
Construction. More... | |
virtual PyObject * | getPyObject (void) |
This method returns the Python wrapper for a C++ object. More... | |
bool | isDerivedFrom (const Type type) const |
virtual void | setPyObject (PyObject *) |
virtual | ~BaseClass () |
Destruction. More... | |
Public Attributes | |
GCS::Algorithm | defaultSolver |
GCS::Algorithm | defaultSolverRedundant |
bool | RecalculateInitialSolutionWhileMovingPoint |
float | SolveTime |
Protected Attributes | |
std::vector< GCS::Arc > | Arcs |
std::vector< GCS::ArcOfEllipse > | ArcsOfEllipse |
std::vector< GCS::ArcOfHyperbola > | ArcsOfHyperbola |
std::vector< GCS::ArcOfParabola > | ArcsOfParabola |
std::vector< GCS::BSpline > | BSplines |
std::vector< GCS::Circle > | Circles |
std::vector< int > | Conflicting |
int | ConstraintsCounter |
std::vector< ConstrDef > | Constrs |
GCS::DebugMode | debugMode |
std::vector< double * > | DrivenParameters |
std::vector< GCS::Ellipse > | Ellipses |
std::vector< double * > | FixParameters |
GCS::System | GCSsys |
std::vector< GeoDef > | Geoms |
std::vector< double > | InitParameters |
Base::Vector3d | initToPoint |
bool | isFine |
bool | isInitMove |
std::vector< GCS::Line > | Lines |
std::vector< double > | MoveParameters |
double | moveStep |
std::vector< double * > | Parameters |
std::vector< double * > | pconstraintplistOut |
std::vector< GCS::Point > | Points |
std::vector< int > | Redundant |
Additional Inherited Members | |
Static Public Member Functions inherited from Base::Persistence | |
static void * | create (void) |
static std::string | encodeAttribute (const std::string &) |
Encodes an attribute upon saving. More... | |
static Base::Type | getClassTypeId (void) |
static void | init (void) |
Static Public Member Functions inherited from Base::BaseClass | |
static void * | create (void) |
static Type | getClassTypeId (void) |
static void | init (void) |
Static Protected Member Functions inherited from Base::BaseClass | |
static void | initSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Type::instantiationMethod method=nullptr) |
Member Enumeration Documentation
◆ GeoType
Constructor & Destructor Documentation
◆ Sketch()
Sketch::Sketch | ( | ) |
◆ ~Sketch()
Sketch::~Sketch | ( | ) |
Member Function Documentation
◆ addAngleAtPointConstraint()
int Sketch::addAngleAtPointConstraint | ( | int | geoId1, |
PointPos | pos1, | ||
int | geoId2, | ||
PointPos | pos2, | ||
int | geoId3, | ||
PointPos | pos3, | ||
double * | value, | ||
ConstraintType | cTyp, | ||
bool | driving = true |
||
) |
◆ addAngleConstraint() [1/3]
int Sketch::addAngleConstraint | ( | int | geoId, |
double * | value, | ||
bool | driving = true |
||
) |
add an angle constraint on a line or between two lines
double * value is a pointer to double allocated in the heap, containing the constraint value and already inserted into either the FixParameters or Parameters array, as the case may be.
◆ addAngleConstraint() [2/3]
int Sketch::addAngleConstraint | ( | int | geoId1, |
int | geoId2, | ||
double * | value, | ||
bool | driving = true |
||
) |
add an angle constraint on a line or between two lines
double * value is a pointer to double allocated in the heap, containing the constraint value and already inserted into either the FixParameters or Parameters array, as the case may be.
◆ addAngleConstraint() [3/3]
int Sketch::addAngleConstraint | ( | int | geoId1, |
PointPos | pos1, | ||
int | geoId2, | ||
PointPos | pos2, | ||
double * | value, | ||
bool | driving = true |
||
) |
add an angle constraint on a line or between two lines
double * value is a pointer to double allocated in the heap, containing the constraint value and already inserted into either the FixParameters or Parameters array, as the case may be.
◆ addAngleViaPointConstraint()
int Sketcher::Sketch::addAngleViaPointConstraint | ( | int | geoId1, |
int | geoId2, | ||
int | geoId3, | ||
PointPos | pos3, | ||
double | value, | ||
bool | driving = true |
||
) |
add angle-via-point constraint between any two curves
double * value is a pointer to double allocated in the heap, containing the constraint value and already inserted into either the FixParameters or Parameters array, as the case may be.
◆ addArc()
int Sketch::addArc | ( | const Part::GeomArcOfCircle & | circleSegment, |
bool | fixed = false |
||
) |
add a arc (circle segment)
References Part::Geometry::clone(), Sketcher::Sketch::GeoDef::endPointId, Sketcher::Sketch::GeoDef::geo, Part::GeomArcOfConic::getCenter(), Part::GeomArcOfConic::getEndPoint(), Part::GeomArcOfCircle::getRadius(), Part::GeomArcOfCircle::getRange(), Part::GeomArcOfConic::getStartPoint(), Sketcher::Sketch::GeoDef::index, Sketcher::Sketch::GeoDef::midPointId, GCS::Arc::start, Sketcher::Sketch::GeoDef::startPointId, Sketcher::Sketch::GeoDef::type, GCS::Point::x, Base::Vector3< _Precision >::x, GCS::Point::y, and Base::Vector3< _Precision >::y.
◆ addArcOfEllipse()
int Sketch::addArcOfEllipse | ( | const Part::GeomArcOfEllipse & | ellipseSegment, |
bool | fixed = false |
||
) |
add an arc of ellipse
References Part::Geometry::clone(), Sketcher::Sketch::GeoDef::endPointId, Sketcher::Sketch::GeoDef::geo, Part::GeomArcOfConic::getCenter(), Part::GeomArcOfConic::getEndPoint(), Part::GeomArcOfEllipse::getMajorAxisDir(), Part::GeomArcOfEllipse::getMajorRadius(), Part::GeomArcOfEllipse::getMinorRadius(), Part::GeomArcOfEllipse::getRange(), Part::GeomArcOfConic::getStartPoint(), Sketcher::Sketch::GeoDef::index, Sketcher::Sketch::GeoDef::midPointId, GCS::ArcOfEllipse::start, Sketcher::Sketch::GeoDef::startPointId, Sketcher::Sketch::GeoDef::type, GCS::Point::x, Base::Vector3< _Precision >::x, GCS::Point::y, and Base::Vector3< _Precision >::y.
◆ addArcOfHyperbola()
int Sketch::addArcOfHyperbola | ( | const Part::GeomArcOfHyperbola & | hyperbolaSegment, |
bool | fixed = false |
||
) |
add an arc of hyperbola
References Part::Geometry::clone(), Sketcher::Sketch::GeoDef::endPointId, Sketcher::Sketch::GeoDef::geo, Part::GeomArcOfConic::getCenter(), Part::GeomArcOfConic::getEndPoint(), Part::GeomArcOfHyperbola::getMajorAxisDir(), Part::GeomArcOfHyperbola::getMajorRadius(), Part::GeomArcOfHyperbola::getMinorRadius(), Part::GeomArcOfHyperbola::getRange(), Part::GeomArcOfConic::getStartPoint(), Sketcher::Sketch::GeoDef::index, Sketcher::Sketch::GeoDef::midPointId, GCS::ArcOfHyperbola::start, Sketcher::Sketch::GeoDef::startPointId, Sketcher::Sketch::GeoDef::type, GCS::Point::x, Base::Vector3< _Precision >::x, GCS::Point::y, and Base::Vector3< _Precision >::y.
◆ addArcOfParabola()
int Sketch::addArcOfParabola | ( | const Part::GeomArcOfParabola & | parabolaSegment, |
bool | fixed = false |
||
) |
add an arc of parabola
References Part::Geometry::clone(), Sketcher::Sketch::GeoDef::endPointId, Sketcher::Sketch::GeoDef::geo, Part::GeomArcOfConic::getCenter(), Part::GeomArcOfConic::getEndPoint(), Part::GeomArcOfParabola::getFocus(), Part::GeomArcOfParabola::getRange(), Part::GeomArcOfConic::getStartPoint(), Sketcher::Sketch::GeoDef::index, Sketcher::Sketch::GeoDef::midPointId, GCS::ArcOfParabola::start, Sketcher::Sketch::GeoDef::startPointId, Sketcher::Sketch::GeoDef::type, GCS::Point::x, Base::Vector3< _Precision >::x, GCS::Point::y, and Base::Vector3< _Precision >::y.
◆ addBSpline()
int Sketch::addBSpline | ( | const Part::GeomBSplineCurve & | spline, |
bool | fixed = false |
||
) |
add a BSpline
References Sketcher::Sketch::GeoDef::endPointId, Sketcher::Sketch::GeoDef::geo, Sketcher::Constraint::GeoUndef, Part::GeomBSplineCurve::getDegree(), Part::GeomBoundedCurve::getEndPoint(), Part::GeomBSplineCurve::getKnots(), Part::GeomBSplineCurve::getMultiplicities(), Part::GeomBSplineCurve::getPoles(), Part::GeomBoundedCurve::getStartPoint(), Part::GeomBSplineCurve::getWeights(), Sketcher::Sketch::GeoDef::index, Part::GeomBSplineCurve::isPeriodic(), Sketcher::Sketch::GeoDef::startPointId, Sketcher::Sketch::GeoDef::type, GCS::Point::x, Base::Vector3< _Precision >::x, GCS::Point::y, and Base::Vector3< _Precision >::y.
◆ addCircle()
int Sketch::addCircle | ( | const Part::GeomCircle & | circle, |
bool | fixed = false |
||
) |
◆ addConstraint()
int Sketch::addConstraint | ( | const Constraint * | constraint | ) |
add one constraint to the sketch
References Sketcher::Constraint::AlignmentType, Sketcher::Angle, Sketcher::Block, Sketcher::BSplineControlPoint, Sketcher::BSplineKnotPoint, Sketcher::Coincident, Sketcher::Sketch::ConstrDef::constr, Sketcher::Diameter, Sketcher::Distance, Sketcher::DistanceX, Sketcher::DistanceY, Sketcher::EllipseFocus1, Sketcher::EllipseFocus2, Sketcher::EllipseMajorDiameter, Sketcher::EllipseMinorDiameter, Sketcher::Equal, Sketcher::Constraint::First, Sketcher::Constraint::FirstPos, Sketcher::Constraint::GeoUndef, Sketcher::Constraint::getValue(), Sketcher::Horizontal, Sketcher::HyperbolaFocus, Sketcher::HyperbolaMajor, Sketcher::HyperbolaMinor, Sketcher::InternalAlignment, Sketcher::Constraint::InternalAlignmentIndex, Sketcher::Constraint::isDriving, Sketcher::none, Sketcher::NumConstraintTypes, Sketcher::ParabolaFocus, Sketcher::Parallel, Sketcher::Perpendicular, Sketcher::PointOnObject, Sketcher::Radius, Sketcher::Constraint::Second, Sketcher::Constraint::SecondPos, Sketcher::SnellsLaw, Sketcher::Symmetric, Sketcher::Tangent, Sketcher::Constraint::Third, Sketcher::Constraint::ThirdPos, Sketcher::Constraint::Type, and Sketcher::Vertical.
Referenced by Sketcher::SketchObject::calculateConstraintError().
◆ addConstraints() [1/2]
int Sketch::addConstraints | ( | const std::vector< Constraint * > & | ConstraintList | ) |
constraints
add all constraints in the list
References Base::Console(), and Base::ConsoleSingleton::Error().
◆ addConstraints() [2/2]
int Sketch::addConstraints | ( | const std::vector< Constraint * > & | ConstraintList, |
const std::vector< bool > & | unenforceableConstraints | ||
) |
add all constraints in the list, provided that are enforceable
References Sketcher::Block, Base::Console(), and Base::ConsoleSingleton::Error().
◆ addCoordinateXConstraint()
int Sketch::addCoordinateXConstraint | ( | int | geoId, |
PointPos | pos, | ||
double * | value, | ||
bool | driving = true |
||
) |
add a fixed X coordinate constraint to a point
double * value is a pointer to double allocated in the heap, containing the constraint value and already inserted into either the FixParameters or Parameters array, as the case may be.
◆ addCoordinateYConstraint()
int Sketch::addCoordinateYConstraint | ( | int | geoId, |
PointPos | pos, | ||
double * | value, | ||
bool | driving = true |
||
) |
add a fixed Y coordinate constraint to a point
double * value is a pointer to double allocated in the heap, containing the constraint value and already inserted into either the FixParameters or Parameters array, as the case may be.
◆ addDiameterConstraint()
int Sketch::addDiameterConstraint | ( | int | geoId, |
double * | value, | ||
bool | driving = true |
||
) |
add a radius constraint on a circle or an arc
double * value is a pointer to double allocated in the heap, containing the constraint value and already inserted into either the FixParameters or Parameters array, as the case may be.
◆ addDistanceConstraint() [1/3]
int Sketch::addDistanceConstraint | ( | int | geoId1, |
double * | value, | ||
bool | driving = true |
||
) |
add a length or distance constraint
double * value is a pointer to double allocated in the heap, containing the constraint value and already inserted into either the FixParameters or Parameters array, as the case may be.
◆ addDistanceConstraint() [2/3]
int Sketch::addDistanceConstraint | ( | int | geoId1, |
PointPos | pos1, | ||
int | geoId2, | ||
double * | value, | ||
bool | driving = true |
||
) |
add a length or distance constraint
double * value is a pointer to double allocated in the heap, containing the constraint value and already inserted into either the FixParameters or Parameters array, as the case may be.
◆ addDistanceConstraint() [3/3]
int Sketch::addDistanceConstraint | ( | int | geoId1, |
PointPos | pos1, | ||
int | geoId2, | ||
PointPos | pos2, | ||
double * | value, | ||
bool | driving = true |
||
) |
add a length or distance constraint
double * value is a pointer to double allocated in the heap, containing the constraint value and already inserted into either the FixParameters or Parameters array, as the case may be.
◆ addDistanceXConstraint() [1/2]
int Sketch::addDistanceXConstraint | ( | int | geoId, |
double * | value, | ||
bool | driving = true |
||
) |
add a horizontal distance constraint to two points or line ends
double * value is a pointer to double allocated in the heap, containing the constraint value and already inserted into either the FixParameters or Parameters array, as the case may be.
◆ addDistanceXConstraint() [2/2]
int Sketch::addDistanceXConstraint | ( | int | geoId1, |
PointPos | pos1, | ||
int | geoId2, | ||
PointPos | pos2, | ||
double * | value, | ||
bool | driving = true |
||
) |
add a horizontal distance constraint to two points or line ends
double * value is a pointer to double allocated in the heap, containing the constraint value and already inserted into either the FixParameters or Parameters array, as the case may be.
References GCS::Point::x.
◆ addDistanceYConstraint() [1/2]
int Sketch::addDistanceYConstraint | ( | int | geoId, |
double * | value, | ||
bool | driving = true |
||
) |
add a vertical distance constraint to two points or line ends
double * value is a pointer to double allocated in the heap, containing the constraint value and already inserted into either the FixParameters or Parameters array, as the case may be.
◆ addDistanceYConstraint() [2/2]
int Sketch::addDistanceYConstraint | ( | int | geoId1, |
PointPos | pos1, | ||
int | geoId2, | ||
PointPos | pos2, | ||
double * | value, | ||
bool | driving = true |
||
) |
add a vertical distance constraint to two points or line ends
double * value is a pointer to double allocated in the heap, containing the constraint value and already inserted into either the FixParameters or Parameters array, as the case may be.
References GCS::Point::y.
◆ addEllipse()
int Sketch::addEllipse | ( | const Part::GeomEllipse & | ellipse, |
bool | fixed = false |
||
) |
add an ellipse
References Part::Geometry::clone(), Sketcher::Sketch::GeoDef::geo, Part::GeomConic::getCenter(), Part::GeomEllipse::getMajorAxisDir(), Part::GeomEllipse::getMajorRadius(), Part::GeomEllipse::getMinorRadius(), Sketcher::Sketch::GeoDef::index, Sketcher::Sketch::GeoDef::midPointId, Sketcher::Sketch::GeoDef::type, GCS::Point::x, Base::Vector3< _Precision >::x, and Base::Vector3< _Precision >::y.
◆ addEqualConstraint()
int Sketch::addEqualConstraint | ( | int | geoId1, |
int | geoId2 | ||
) |
add an equal length or radius constraints between two lines or between circles and arcs
References Base::Console(), and Base::ConsoleSingleton::Warning().
◆ addGeometry() [1/3]
int Sketch::addGeometry | ( | const Part::Geometry * | geo, |
bool | fixed = false |
||
) |
add unspecified geometry
References Base::Persistence::getTypeId().
Referenced by Sketcher::SketchObject::calculateAngleViaPoint(), Sketcher::SketchObject::calculateConstraintError(), and Sketcher::SketchObject::isPointOnCurve().
◆ addGeometry() [2/3]
int Sketch::addGeometry | ( | const std::vector< Part::Geometry * > & | geo, |
bool | fixed = false |
||
) |
add unspecified geometry
◆ addGeometry() [3/3]
int Sketch::addGeometry | ( | const std::vector< Part::Geometry * > & | geo, |
const std::vector< bool > & | blockedGeometry | ||
) |
add unspecified geometry, where each element's "fixed" status is given by the blockedGeometry array
◆ addHorizontalConstraint() [1/2]
int Sketch::addHorizontalConstraint | ( | int | geoId | ) |
add a horizontal constraint to a geometry
◆ addHorizontalConstraint() [2/2]
◆ addInternalAlignmentBSplineControlPoint()
int Sketch::addInternalAlignmentBSplineControlPoint | ( | int | geoId1, |
int | geoId2, | ||
int | poleindex | ||
) |
References Sketcher::mid.
◆ addInternalAlignmentEllipseFocus1()
int Sketch::addInternalAlignmentEllipseFocus1 | ( | int | geoId1, |
int | geoId2 | ||
) |
◆ addInternalAlignmentEllipseFocus2()
int Sketch::addInternalAlignmentEllipseFocus2 | ( | int | geoId1, |
int | geoId2 | ||
) |
◆ addInternalAlignmentEllipseMajorDiameter()
int Sketch::addInternalAlignmentEllipseMajorDiameter | ( | int | geoId1, |
int | geoId2 | ||
) |
Internal Alignment constraints.
add InternalAlignmentEllipseMajorDiameter to a line and an ellipse
◆ addInternalAlignmentEllipseMinorDiameter()
int Sketch::addInternalAlignmentEllipseMinorDiameter | ( | int | geoId1, |
int | geoId2 | ||
) |
◆ addInternalAlignmentHyperbolaFocus()
int Sketch::addInternalAlignmentHyperbolaFocus | ( | int | geoId1, |
int | geoId2 | ||
) |
◆ addInternalAlignmentHyperbolaMajorDiameter()
int Sketch::addInternalAlignmentHyperbolaMajorDiameter | ( | int | geoId1, |
int | geoId2 | ||
) |
add InternalAlignmentHyperbolaMajorRadius to a line and a hyperbola
◆ addInternalAlignmentHyperbolaMinorDiameter()
int Sketch::addInternalAlignmentHyperbolaMinorDiameter | ( | int | geoId1, |
int | geoId2 | ||
) |
◆ addInternalAlignmentKnotPoint()
int Sketch::addInternalAlignmentKnotPoint | ( | int | geoId1, |
int | geoId2, | ||
int | knotindex | ||
) |
References GCS::BSpline::knotpointGeoids.
◆ addInternalAlignmentParabolaFocus()
int Sketch::addInternalAlignmentParabolaFocus | ( | int | geoId1, |
int | geoId2 | ||
) |
◆ addLine()
int Sketch::addLine | ( | const Part::GeomLineSegment & | line, |
bool | fixed = false |
||
) |
add an infinite line
◆ addLineSegment()
int Sketch::addLineSegment | ( | const Part::GeomLineSegment & | lineSegment, |
bool | fixed = false |
||
) |
add a line segment
References Part::Geometry::clone(), Sketcher::Sketch::GeoDef::endPointId, Sketcher::Sketch::GeoDef::geo, Part::GeomLineSegment::getEndPoint(), Part::GeomLineSegment::getStartPoint(), Sketcher::Sketch::GeoDef::index, Sketcher::Sketch::GeoDef::startPointId, Sketcher::Sketch::GeoDef::type, GCS::Point::x, and GCS::Point::y.
◆ addParallelConstraint()
int Sketch::addParallelConstraint | ( | int | geoId1, |
int | geoId2 | ||
) |
add a parallel constraint between two lines
◆ addPerpendicularConstraint()
int Sketch::addPerpendicularConstraint | ( | int | geoId1, |
int | geoId2 | ||
) |
add a perpendicular constraint between two lines
References Base::Console(), and Base::ConsoleSingleton::Warning().
◆ addPoint()
int Sketch::addPoint | ( | const Part::GeomPoint & | point, |
bool | fixed = false |
||
) |
add dedicated geometry
add a point
References Sketcher::Sketch::GeoDef::endPointId, Sketcher::Sketch::GeoDef::geo, Sketcher::Sketch::GeoDef::midPointId, Sketcher::Sketch::GeoDef::startPointId, Sketcher::Sketch::GeoDef::type, GCS::Point::x, and GCS::Point::y.
Referenced by Sketcher::SketchObject::isPointOnCurve().
◆ addPointCoincidentConstraint()
add a coincident constraint to two points of two geometries
◆ addPointOnObjectConstraint()
int Sketch::addPointOnObjectConstraint | ( | int | geoId1, |
PointPos | pos1, | ||
int | geoId2, | ||
bool | driving = true |
||
) |
add a point on line constraint
Referenced by addAngleAtPointConstraint(), and Sketcher::SketchObject::isPointOnCurve().
◆ addRadiusConstraint()
int Sketch::addRadiusConstraint | ( | int | geoId, |
double * | value, | ||
bool | driving = true |
||
) |
add a radius constraint on a circle or an arc
double * value is a pointer to double allocated in the heap, containing the constraint value and already inserted into either the FixParameters or Parameters array, as the case may be.
◆ addSnellsLawConstraint()
int Sketch::addSnellsLawConstraint | ( | int | geoIdRay1, |
PointPos | posRay1, | ||
int | geoIdRay2, | ||
PointPos | posRay2, | ||
int | geoIdBnd, | ||
double * | value, | ||
double * | second, | ||
bool | driving = true |
||
) |
add a snell's law constraint
double * value and double * second are each a pointer to double allocated in the heap and already inserted into either the FixParameters or Parameters array, as the case may be.
value must contain the constraint value (the ratio of n2/n1) second may be initialized to any value, however the solver will provide n1 in value and n2 in second.
References Base::Console(), and Base::ConsoleSingleton::Error().
◆ addSymmetricConstraint() [1/2]
int Sketch::addSymmetricConstraint | ( | int | geoId1, |
PointPos | pos1, | ||
int | geoId2, | ||
PointPos | pos2, | ||
int | geoId3 | ||
) |
add a symmetric constraint between two points with respect to a line
◆ addSymmetricConstraint() [2/2]
int Sketch::addSymmetricConstraint | ( | int | geoId1, |
PointPos | pos1, | ||
int | geoId2, | ||
PointPos | pos2, | ||
int | geoId3, | ||
PointPos | pos3 | ||
) |
add a symmetric constraint between three points, the last point is in the middle of the first two
◆ addTangentConstraint()
int Sketch::addTangentConstraint | ( | int | geoId1, |
int | geoId2 | ||
) |
add a tangency constraint between two geometries
References Base::Console(), and Base::ConsoleSingleton::Error().
◆ addVerticalConstraint() [1/2]
int Sketch::addVerticalConstraint | ( | int | geoId | ) |
add a vertical constraint to a geometry
◆ addVerticalConstraint() [2/2]
◆ calculateAngleViaPoint()
double Sketch::calculateAngleViaPoint | ( | int | geoId1, |
int | geoId2, | ||
double | px, | ||
double | py | ||
) |
References GCS::Point::x.
Referenced by Sketcher::SketchObject::calculateAngleViaPoint().
◆ calculateConstraintError()
double Sketcher::Sketch::calculateConstraintError | ( | int | icstr | ) |
◆ calculateNormalAtPoint()
Base::Vector3d Sketch::calculateNormalAtPoint | ( | int | geoIdCurve, |
double | px, | ||
double | py | ||
) |
References GCS::Point::x.
◆ clear()
void Sketch::clear | ( | void | ) |
delete all geometry and constraints, leave an empty sketch
◆ extractGeometry()
std::vector< Part::Geometry * > Sketch::extractGeometry | ( | bool | withConstructionElements = true , |
bool | withExternalElements = false |
||
) | const |
returns the actual geometry
◆ getBlockedGeometry()
void Sketch::getBlockedGeometry | ( | std::vector< bool > & | blockedGeometry, |
std::vector< bool > & | unenforceableConstraints, | ||
const std::vector< Constraint * > & | ConstraintList | ||
) | const |
get boolean list indicating whether the geometry is to be blocked or not
References Sketcher::Block, Sketcher::Constraint::GeoUndef, and Sketcher::InternalAlignment.
◆ getConflicting()
const std::vector<int>& Sketcher::Sketch::getConflicting | ( | void | ) | const |
◆ getDebugMode()
GCS::DebugMode Sketcher::Sketch::getDebugMode | ( | void | ) |
◆ getGeometrySize()
int Sketcher::Sketch::getGeometrySize | ( | void | ) | const |
Returns the size of the Geometry.
◆ getMemSize()
|
virtual |
This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB?
Implements Base::Persistence.
◆ getPoint()
Base::Vector3d Sketch::getPoint | ( | int | geoId, |
PointPos | pos | ||
) | const |
retrieves a point
◆ getPointId()
int Sketch::getPointId | ( | int | geoId, |
PointPos | pos | ||
) | const |
retrieves the index of a point
References Sketcher::end, Sketcher::mid, Sketcher::none, and Sketcher::start.
◆ getPyGeometry()
Py::Tuple Sketch::getPyGeometry | ( | void | ) | const |
get the geometry as python objects
◆ getQRAlgorithm()
GCS::QRAlgorithm Sketcher::Sketch::getQRAlgorithm | ( | ) |
◆ getRedundant()
const std::vector<int>& Sketcher::Sketch::getRedundant | ( | void | ) | const |
◆ getSolverPrecision()
double Sketcher::Sketch::getSolverPrecision | ( | ) |
get standard (aka fine) solver precision
Referenced by Sketcher::SketchObject::isPointOnCurve().
◆ hasConflicts()
bool Sketcher::Sketch::hasConflicts | ( | void | ) | const |
◆ hasDependentParameters()
retrieves whether a geometry has dependent parameters or not
References Sketcher::end, Sketcher::mid, Sketcher::none, and Sketcher::start.
◆ hasRedundancies()
bool Sketcher::Sketch::hasRedundancies | ( | void | ) | const |
◆ initMove()
initializes a point (or curve) drag by setting the current sketch status as a reference
References Sketcher::mid, Sketcher::none, GCS::BSpline::poles, Sketcher::start, GCS::Point::x, and GCS::Point::y.
◆ movePoint()
int Sketch::movePoint | ( | int | geoId, |
PointPos | pos, | ||
Base::Vector3d | toPoint, | ||
bool | relative = false |
||
) |
move this point (or curve) to a new location and solve.
This will introduce some additional weak constraints expressing a condition for satisfying the new point location! The relative flag permits moving relatively to the current position
References Sketcher::mid, Sketcher::none, GCS::BSpline::poles, Base::Vector3< _Precision >::x, and Base::Vector3< _Precision >::y.
◆ resetInitMove()
void Sketch::resetInitMove | ( | ) |
Resets the initialization of a point or curve drag.
◆ resetSolver()
int Sketch::resetSolver | ( | ) |
resets the solver
◆ Restore()
|
virtual |
This method is used to restore properties from an XML document.
It uses the XMLReader class, which bases on SAX, to read the in Save() written information. Again the Vector as an example:
Implements Base::Persistence.
◆ Save()
|
virtual |
This method is used to save properties to an XML document.
A good example you'll find in PropertyStandard.cpp, e.g. the vector:
The writer.ind() expression writes the indentation, just for pretty printing of the XML. As you see, the writing of the XML document is not done with a DOM implementation because of performance reasons. Therefore the programmer has to take care that a valid XML document is written. This means closing tags and writing UTF-8.
- See also
- Base::Writer
Implements Base::Persistence.
◆ setConvergence()
void Sketcher::Sketch::setConvergence | ( | double | conv | ) |
◆ setConvergenceRedundant()
void Sketcher::Sketch::setConvergenceRedundant | ( | double | conv | ) |
◆ setDatum()
int Sketch::setDatum | ( | int | constrId, |
double | value | ||
) |
set the datum of a distance or angle constraint to a certain value and solve This can cause the solving to fail!
◆ setDebugMode()
void Sketcher::Sketch::setDebugMode | ( | GCS::DebugMode | mode | ) |
◆ setDL_tolf()
void Sketcher::Sketch::setDL_tolf | ( | double | val | ) |
◆ setDL_tolfRedundant()
void Sketcher::Sketch::setDL_tolfRedundant | ( | double | val | ) |
◆ setDL_tolg()
void Sketcher::Sketch::setDL_tolg | ( | double | val | ) |
◆ setDL_tolgRedundant()
void Sketcher::Sketch::setDL_tolgRedundant | ( | double | val | ) |
◆ setDL_tolx()
void Sketcher::Sketch::setDL_tolx | ( | double | val | ) |
◆ setDL_tolxRedundant()
void Sketcher::Sketch::setDL_tolxRedundant | ( | double | val | ) |
◆ setDogLegGaussStep()
void Sketcher::Sketch::setDogLegGaussStep | ( | GCS::DogLegGaussStep | mode | ) |
◆ setLM_eps()
void Sketcher::Sketch::setLM_eps | ( | double | val | ) |
◆ setLM_eps1()
void Sketcher::Sketch::setLM_eps1 | ( | double | val | ) |
◆ setLM_eps1Redundant()
void Sketcher::Sketch::setLM_eps1Redundant | ( | double | val | ) |
◆ setLM_epsRedundant()
void Sketcher::Sketch::setLM_epsRedundant | ( | double | val | ) |
◆ setLM_tau()
void Sketcher::Sketch::setLM_tau | ( | double | val | ) |
◆ setLM_tauRedundant()
void Sketcher::Sketch::setLM_tauRedundant | ( | double | val | ) |
◆ setMaxIter()
void Sketcher::Sketch::setMaxIter | ( | int | maxiter | ) |
◆ setMaxIterRedundant()
void Sketcher::Sketch::setMaxIterRedundant | ( | int | maxiter | ) |
◆ setQRAlgorithm()
void Sketcher::Sketch::setQRAlgorithm | ( | GCS::QRAlgorithm | alg | ) |
◆ setQRPivotThreshold()
void Sketcher::Sketch::setQRPivotThreshold | ( | double | val | ) |
◆ setSketchSizeMultiplier()
void Sketcher::Sketch::setSketchSizeMultiplier | ( | bool | mult | ) |
◆ setSketchSizeMultiplierRedundant()
void Sketcher::Sketch::setSketchSizeMultiplierRedundant | ( | bool | mult | ) |
◆ setUpSketch()
int Sketch::setUpSketch | ( | const std::vector< Part::Geometry * > & | GeoList, |
const std::vector< Constraint * > & | ConstraintList, | ||
int | extGeoCount = 0 |
||
) |
set the sketch up with geoms and constraints
returns the degree of freedom of a sketch and calculates a list of conflicting constraints
0 degrees of freedom correspond to a fully constrained sketch -1 degrees of freedom correspond to an over-constrained sketch positive degrees of freedom correspond to an under-constrained sketch
an over-constrained sketch will always contain conflicting constraints a fully constrained or under-constrained sketch may contain conflicting constraints or may not
References Base::Console(), Base::TimeInfo::diffTime(), GCS::IterationLevel, Base::ConsoleSingleton::Log(), and GCS::Minimal.
◆ solve()
int Sketch::solve | ( | void | ) |
solve the actual set up sketch
References GCS::BFGS, Base::Console(), Base::TimeInfo::diffTime(), Base::TimeInfo::diffTimeF(), GCS::DogLeg, GCS::IterationLevel, GCS::LevenbergMarquardt, Base::ConsoleSingleton::Log(), GCS::Minimal, GCS::Success, GCS::SuccessfulSolutionInvalid, and Base::ConsoleSingleton::Warning().
◆ toShape()
TopoShape Sketch::toShape | ( | void | ) | const |
return the actual geometry of the sketch a TopoShape
Member Data Documentation
◆ Arcs
|
protected |
◆ ArcsOfEllipse
|
protected |
◆ ArcsOfHyperbola
|
protected |
◆ ArcsOfParabola
|
protected |
◆ BSplines
|
protected |
◆ Circles
|
protected |
◆ Conflicting
|
protected |
◆ ConstraintsCounter
|
protected |
◆ Constrs
|
protected |
◆ debugMode
|
protected |
◆ defaultSolver
GCS::Algorithm Sketcher::Sketch::defaultSolver |
◆ defaultSolverRedundant
GCS::Algorithm Sketcher::Sketch::defaultSolverRedundant |
◆ DrivenParameters
|
protected |
◆ Ellipses
|
protected |
◆ FixParameters
|
protected |
◆ GCSsys
|
protected |
◆ Geoms
|
protected |
◆ InitParameters
|
protected |
◆ initToPoint
|
protected |
◆ isFine
|
protected |
◆ isInitMove
|
protected |
◆ Lines
|
protected |
◆ MoveParameters
|
protected |
◆ moveStep
|
protected |
◆ Parameters
|
protected |
◆ pconstraintplistOut
|
protected |
◆ Points
|
protected |
◆ RecalculateInitialSolutionWhileMovingPoint
bool Sketcher::Sketch::RecalculateInitialSolutionWhileMovingPoint |
◆ Redundant
|
protected |
◆ SolveTime
float Sketcher::Sketch::SolveTime |
The documentation for this class was generated from the following files:
- src/Mod/Sketcher/App/Sketch.h
- src/Mod/Sketcher/App/Sketch.cpp