const EntityID& theSketchID,
const SketchSolver_ConstraintType& theType,
const double& theValue,
+ const bool theFullValue,
const EntityWrapperPtr& thePoint1,
const EntityWrapperPtr& thePoint2,
const std::list<EntityWrapperPtr>& theTrsfEnt) const
ConstraintWrapperPtr aResult(new SolveSpaceSolver_ConstraintWrapper(theConstraint, aConstraint));
aResult->setValue(theValue);
+ aResult->setIsFullValue(theFullValue);
aResult->setEntities(aConstrAttrList);
return std::list<ConstraintWrapperPtr>(1, aResult);
}
std::list<EntityWrapperPtr>::const_iterator anIt1 = theEntity1->subEntities().begin();
std::list<EntityWrapperPtr>::const_iterator anIt2 = theEntity2->subEntities().begin();
if ((*anIt2)->group() == theGroupID) // mirrored point is not fixed
- makeMirrorPoints(theEntity1->subEntities().front(),
- theEntity2->subEntities().front(), theMirrorLine);
+ makeMirrorPoints(*anIt1, *anIt2, theMirrorLine);
// Workaround to avoid problems in SolveSpace.
// The symmetry of two arcs will be done using symmetry of three points on these arcs:
const Slvs_Entity& aSubEnt =
std::dynamic_pointer_cast<SolveSpaceSolver_EntityWrapper>(aSub)->entity();
- EntityWrapperPtr aNewEntity(new SolveSpaceSolver_EntityWrapper(theFeature, aSubEnt));
- aNewEntity->setSubEntities(std::list<EntityWrapperPtr>(1, aSub));
- return aNewEntity;
+ return EntityWrapperPtr(new SolveSpaceSolver_EntityWrapper(theFeature, aPoint, aSubEnt));
}
// wrong entity
{
BuilderPtr aBuilder = SolveSpaceSolver_Builder::getInstance();
- double anAngleRad = theConstraint->value() * PI / 180.0;
+ double anAngleValue = theConstraint->value();
+ const std::list<EntityWrapperPtr>& aSubs = theConstraint->entities();
+
+ bool isFullValue = theConstraint->isFullValue();
+ int aNbObjects = aSubs.size()-2;
+ if (isFullValue && aNbObjects > 0) {
+ anAngleValue /= aNbObjects;
+ }
+
+ double anAngleRad = anAngleValue * PI / 180.0;
double aSin = sin(anAngleRad);
double aCos = cos(anAngleRad);
- const std::list<EntityWrapperPtr>& aSubs = theConstraint->entities();
std::list<EntityWrapperPtr>::const_iterator aSIt = aSubs.begin();
std::shared_ptr<GeomAPI_Pnt2d> aCenter = aBuilder->point(*aSIt++);
std::shared_ptr<GeomAPI_Pnt2d> aEndPnt = aBuilder->point(*aSIt++);
std::shared_ptr<GeomAPI_XY> aDelta = aEndPnt->xy()->decreased(aStartPnt->xy());
+ bool isFullValue = theConstraint->isFullValue();
+ int aNbObjects = aSubs.size()-3;
+ if (isFullValue && aNbObjects > 0) {
+ aDelta->setX(aDelta->x()/aNbObjects);
+ aDelta->setY(aDelta->y()/aNbObjects);
+ }
+
std::list<EntityWrapperPtr>::const_iterator aPrevIt = aSIt++;
for (; aSIt != aSubs.end(); ++aPrevIt, ++aSIt)
translate(*aPrevIt, *aSIt, aDelta);