Sketcher: Parabola Arc rules solver constraint
This commit is contained in:
parent
b2bca80796
commit
61fe4bcaee
|
@ -639,8 +639,8 @@ int Sketch::addArcOfParabola(const Part::GeomArcOfParabola ¶bolaSegment, boo
|
||||||
Geoms.push_back(def);
|
Geoms.push_back(def);
|
||||||
|
|
||||||
// arcs require an ArcRules constraint for the end points
|
// arcs require an ArcRules constraint for the end points
|
||||||
//if (!fixed)
|
if (!fixed)
|
||||||
// GCSsys.addConstraintArcOfParabolaRules(a);
|
GCSsys.addConstraintArcOfParabolaRules(a);
|
||||||
|
|
||||||
// return the position of the newly added geometry
|
// return the position of the newly added geometry
|
||||||
return Geoms.size()-1;
|
return Geoms.size()-1;
|
||||||
|
|
|
@ -604,6 +604,12 @@ int System::addConstraintArcOfHyperbolaRules(ArcOfHyperbola &a, int tagId)
|
||||||
return addConstraintCurveValue(a.end,a,a.endAngle, tagId);
|
return addConstraintCurveValue(a.end,a,a.endAngle, tagId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int System::addConstraintArcOfParabolaRules(ArcOfParabola &a, int tagId)
|
||||||
|
{
|
||||||
|
addConstraintCurveValue(a.start,a,a.startAngle, tagId);
|
||||||
|
return addConstraintCurveValue(a.end,a,a.endAngle, tagId);
|
||||||
|
}
|
||||||
|
|
||||||
int System::addConstraintPointOnArc(Point &p, Arc &a, int tagId)
|
int System::addConstraintPointOnArc(Point &p, Arc &a, int tagId)
|
||||||
{
|
{
|
||||||
return addConstraintP2PDistance(p, a.center, a.rad, tagId);
|
return addConstraintP2PDistance(p, a.center, a.rad, tagId);
|
||||||
|
|
|
@ -185,6 +185,7 @@ namespace GCS
|
||||||
int addConstraintArcOfEllipseRules(ArcOfEllipse &a, int tagId=0);
|
int addConstraintArcOfEllipseRules(ArcOfEllipse &a, int tagId=0);
|
||||||
int addConstraintCurveValue(Point &p, Curve &a, double *u, int tagId=0);
|
int addConstraintCurveValue(Point &p, Curve &a, double *u, int tagId=0);
|
||||||
int addConstraintArcOfHyperbolaRules(ArcOfHyperbola &a, int tagId=0);
|
int addConstraintArcOfHyperbolaRules(ArcOfHyperbola &a, int tagId=0);
|
||||||
|
int addConstraintArcOfParabolaRules(ArcOfParabola &a, int tagId=0);
|
||||||
int addConstraintPointOnArc(Point &p, Arc &a, int tagId=0);
|
int addConstraintPointOnArc(Point &p, Arc &a, int tagId=0);
|
||||||
int addConstraintPerpendicularLine2Arc(Point &p1, Point &p2, Arc &a,
|
int addConstraintPerpendicularLine2Arc(Point &p1, Point &p2, Arc &a,
|
||||||
int tagId=0);
|
int tagId=0);
|
||||||
|
|
|
@ -539,9 +539,9 @@ DeriVector2 Parabola::Value(double u, double du, double* derivparam)
|
||||||
f = fv.length(df);
|
f = fv.length(df);
|
||||||
|
|
||||||
DeriVector2 xdir = fv.getNormalized();
|
DeriVector2 xdir = fv.getNormalized();
|
||||||
DeriVector2 ydir = xdir.rotate90ccw();
|
DeriVector2 ydir = xdir.rotate90cw();
|
||||||
|
|
||||||
DeriVector2 dirx = xdir.multD(u,du).multD(u,du).multD(0.25*f,0.5*df);
|
DeriVector2 dirx = xdir.multD(u,du).multD(u,du).divD(4*f,4*df);
|
||||||
DeriVector2 diry = ydir.multD(u,du);
|
DeriVector2 diry = ydir.multD(u,du);
|
||||||
|
|
||||||
DeriVector2 dir = dirx.sum(diry);
|
DeriVector2 dir = dirx.sum(diry);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user